<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="es">
		<id>https://wiki.gacq.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=C4tboCcdro</id>
		<title>gacq wiki - Contribuciones del usuario [es]</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.gacq.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=C4tboCcdro"/>
		<link rel="alternate" type="text/html" href="https://wiki.gacq.com/index.php/Especial:Contribuciones/C4tboCcdro"/>
		<updated>2026-04-29T16:04:52Z</updated>
		<subtitle>Contribuciones del usuario</subtitle>
		<generator>MediaWiki 1.29.2</generator>

	<entry>
		<id>https://wiki.gacq.com/index.php?title=Linux_tips&amp;diff=2775</id>
		<title>Linux tips</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacq.com/index.php?title=Linux_tips&amp;diff=2775"/>
				<updated>2009-01-11T11:18:48Z</updated>
		
		<summary type="html">&lt;p&gt;C4tboCcdro: http://zelfibu.strefa.pl/domwbotaf-617.html&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://zelfibu.strefa.pl/domwbotaf-617.html aclands video atlas] [http://roladarh.strefa.pl/news-515.html auto fellatio free video] [http://ettaelt.strefa.pl/news-1963.html michael moore music videos] [http://fademon.0lx.net/article-681.htm orion home video] [http://tacataca.strefa.pl/sitemap.htm index] &lt;br /&gt;
[http://lifokdron.0lx.net/282.html amateur wife porn video] [http://sematild.qsh.eu/resource1843.htm adult spanking video clip] [http://lifokdron.0lx.net/740.html rodney king videotape] [http://qasletop.is-the-boss.com/sitemap.html links] [http://relquaca.is-the-boss.com/sitemap.html top] &lt;br /&gt;
[http://sematild.qsh.eu/resource1340.htm soul keeper movie] [http://releltl.0lx.net/20081119-jump-london-video.html jump london video download] [http://brc4tdro.is-the-boss.com/page940.html photo2dvd studio3 serial] [http://tulilre.strefa.pl/2008-12-29-nothing-but.html nothing but mammals music video] [http://zelgetgo.0lx.net/new1704.htm electra movie wallpaper] &lt;br /&gt;
[http://fademon.0lx.net/article-600.htm jordan capri sample movies] [http://caraines.qsh.eu/cencob.htm latest nigerian movies] [http://varpasz.is-the-boss.com/article189.htm estate license per real state] [http://qasletop.is-the-boss.com/letoracn.html angel season 1 torrent] [http://naceceli.qsh.eu/page1465.html ninja video game] &lt;br /&gt;
[http://bukgetert.0lx.net/article-1659.htm skinny dipping videos] [http://ettaelt.strefa.pl/news-1716.html actor male movie] [http://mahohmie.qsh.eu/resource776.htm quotes from the movie stick it] [http://zelfibu.strefa.pl/korolald-1009.html movie online show tv watch] [http://acsitzar.0lx.net/news-jennifer-aniston-2008-11-10.html jennifer aniston video clip] &lt;br /&gt;
[http://bukgetert.0lx.net/article-287.htm sad movies always make me cry] [http://tarobasal.strefa.pl/sitemap.htm webmap] [http://betheres.qsh.eu/comment-141.htm revolutionary war movies] [http://dronoubr.0lx.net/angelina-antonio.html angelina antonio banderas jolie video] [http://mahohmie.qsh.eu/resource1532.htm new realeased movies] &lt;br /&gt;
[http://huruple.qsh.eu/20081227-sara-jay-xxx.htm sara jay xxx movie] [http://naceceli.qsh.eu/sitemap.html link] [http://huruple.qsh.eu/20090105-adc-video-patch.htm adc video patch panel] [http://tulilre.strefa.pl/2008-12-27-imovie-5-download.html imovie 5 download] [http://faquafav.is-the-boss.com/text-545.htm pinnacle studio 9.0 serial] &lt;br /&gt;
[http://mahohmie.qsh.eu/resource1805.htm spongebob tv movie character toy] [http://fademon.0lx.net/article-1434.htm put music videos on your psp for free] [http://acsitzar.0lx.net/news-joes-movies-2008-11-12.html joes movies] [http://caraines.qsh.eu/defanele.htm iran movie] [http://betheres.qsh.eu/comment-180.htm movie prime cut] &lt;br /&gt;
[http://caraines.qsh.eu/zelgolg.htm amc movie .com] [http://caraines.qsh.eu/zmexplnrb.htm ejaculate galleries.squirting video] [http://spfortne.qsh.eu/20081226-adult-alyssa.html adult alyssa milano movie] [http://lofaako.strefa.pl/sitemap.html map] [http://caraines.qsh.eu/caelttro.htm anne curtis video scandal download] &lt;br /&gt;
[http://zelgetgo.0lx.net/sitemap.htm url] [http://relquaca.is-the-boss.com/20090104-lanhound-serial.html lanhound serial number] [http://bukgetert.0lx.net/article-28.htm sitemap] [http://fispruil.qsh.eu/news1763.html she will be loved video cast maroon 5] [http://bukgetert.0lx.net/article-52.htm make a movie screen] &lt;br /&gt;
[http://lifokdron.0lx.net/1739.html michael thriller video] [http://huruple.qsh.eu/20090101-interracial-video.htm interracial video tgp] [http://relquaca.is-the-boss.com/20090103-password-stealer.html password stealer crack] [http://acsitzar.0lx.net/news-most-wanted-2008-11-17.html most wanted movie] [http://vihencbr.0lx.net/secure-video.html secure video chat] &lt;br /&gt;
[http://acsitzar.0lx.net/news-jethro-tull-videos-2008-11-19.html jethro tull videos] [http://bukgetert.0lx.net/sitemap.htm links] [http://lifokdron.0lx.net/504.html movie theater in virginia] [http://flheddin.qsh.eu/brfadron-453.html motivational military videos] [http://sematild.qsh.eu/resource322.htm real player video codecs] &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Mike Chirico (mchirico@users.sourceforge.net) or (mchirico@comcast.net)&lt;br /&gt;
Copyright (C) 2004 (GNU Free Documentation License)&lt;br /&gt;
Last Updated: Thu Dec 28 16:42:50 EST 2006&lt;br /&gt;
&lt;br /&gt;
The latest version of this document can be found at:&lt;br /&gt;
http://souptonuts.sourceforge.net/how_to_linux_and_open_source.htm&lt;br /&gt;
  or text version ( if you have trouble downloading the full document: over 140 pages )&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/How_to_Linux_and_Open_Source.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on Gmail with Postix and Fetchmail&lt;br /&gt;
http://souptonuts.sourceforge.net/postfix_tutorial.html&lt;br /&gt;
&lt;br /&gt;
For tips on using SQLite (over 25 pages)&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_sqlite_tutorial.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on MySQL reference:&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_mysql.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For a recommended reading list&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/Recommended_Reading.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on upgrading RedHat 9 or 8.0 to 2.6.x src kernel&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_26.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on Comcast Email with Home Linux Box&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_COMCAST_EMAIL.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  **Note, if you want email notification after every 50 new tips have been&lt;br /&gt;
    added, then, click on the following link:&lt;br /&gt;
     https://sourceforge.net/project/filemodule_monitor.php?filemodule_id=120838&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 1:&lt;br /&gt;
&lt;br /&gt;
     Is NTP Working?&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Test the current server):&lt;br /&gt;
&lt;br /&gt;
          Try issuing the following command:&lt;br /&gt;
&lt;br /&gt;
          $ ntpq -pn&lt;br /&gt;
&lt;br /&gt;
           remote refid st t when poll reach delay offset jitter&lt;br /&gt;
           ===================================================&lt;br /&gt;
           tock.usno.navy 0.0.0.0 16 u - 64 0 0.000 0.000 4000.00&lt;br /&gt;
&lt;br /&gt;
          The above is an example of a problem.&lt;br /&gt;
          Compare it to a working configuration.&lt;br /&gt;
&lt;br /&gt;
          $ ntpq -pn&lt;br /&gt;
&lt;br /&gt;
           remote refid st t when poll reach delay offset jitter&lt;br /&gt;
           ========================================================&lt;br /&gt;
           +128.4.40.12 128.4.40.10 2 u 107 128 377 25.642 3.350 1.012&lt;br /&gt;
           127.127.1.0 127.127.1.0 10 l 40 64 377 0.000 0.000 0.008&lt;br /&gt;
           +128.91.2.13 128.4.40.12 3 u 34 128 377 21.138 6.118 0.398&lt;br /&gt;
           *192.5.41.41 .USNO. 1 u 110 128 377 33.69 9.533 3.534&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Configure the /etc/ntp.conf):&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/ntp.conf&lt;br /&gt;
&lt;br /&gt;
            # My simple client-only ntp configuration.&lt;br /&gt;
            server timeserver1.upenn.edu&lt;br /&gt;
            # ping -a timeserver1.upenn.edu shows the IP address 128.91.2.13&lt;br /&gt;
            # which is used in the restrict below&lt;br /&gt;
            restrict 128.91.2.13&lt;br /&gt;
            server tock.usno.navy.mil&lt;br /&gt;
            restrict 192.5.41.41&lt;br /&gt;
            server 128.4.40.12&lt;br /&gt;
            restrict 128.4.40.12&lt;br /&gt;
            server 127.127.1.0 # local clock&lt;br /&gt;
            fudge 127.127.1.0 stratum 10&lt;br /&gt;
            driftfile /etc/ntp/drift&lt;br /&gt;
            restrict default ignore&lt;br /&gt;
            restrict 127.0.0.0 mask 255.0.0.0&lt;br /&gt;
            authenticate no&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Configure /etc/ntp/step-tickers):&lt;br /&gt;
&lt;br /&gt;
          The values for server above are placed in the &amp;quot;/etc/ntp/step-tickers&amp;quot; file&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/ntp/step-tickers&lt;br /&gt;
&lt;br /&gt;
              timeserver1.upenn.edu&lt;br /&gt;
              tock.usno.navy.mil&lt;br /&gt;
              128.4.40.12&lt;br /&gt;
&lt;br /&gt;
          The startup script /etc/rc.d/init.d/ntpd will grab the servers in this&lt;br /&gt;
          file and execute the ntpdate command as follows:&lt;br /&gt;
&lt;br /&gt;
             /usr/sbin/ntpdate -s -b -p 8 timeserver1.upenn.edu&lt;br /&gt;
&lt;br /&gt;
          Why? Because if the time is off ntpd will not start. The command above set the&lt;br /&gt;
          clock. If System Time deviates from true time by more than 1000 seconds, then,&lt;br /&gt;
          the ntpd daemon  will enter panic mode and exit.&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Restart the service and check):&lt;br /&gt;
&lt;br /&gt;
          Issue the restart command&lt;br /&gt;
&lt;br /&gt;
            /etc/init.d/ntpd restart&lt;br /&gt;
&lt;br /&gt;
          check the values for &amp;quot;ntpq -pn&amp;quot;,&lt;br /&gt;
          which should match step 1.&lt;br /&gt;
&lt;br /&gt;
             ntpq -pn&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE:&lt;br /&gt;
&lt;br /&gt;
          Time is always stored in the kernel as the number of seconds since&lt;br /&gt;
          midnight of the 1st of January 1970 UTC, regardless of whether the&lt;br /&gt;
          hardware clock is stored as UTC or not.  Conversions to local time&lt;br /&gt;
          are done at run-time. So, it's easy to get the time in different&lt;br /&gt;
          timezones for only the current session as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ export TZ=EST&lt;br /&gt;
              $ date&lt;br /&gt;
              Mon Aug  2 10:34:04 EST 2004&lt;br /&gt;
&lt;br /&gt;
              $ export TZ=NET&lt;br /&gt;
              $ date&lt;br /&gt;
              Mon Aug  2 15:34:18 NET 2004&lt;br /&gt;
&lt;br /&gt;
          The following are possible values for TZ:&lt;br /&gt;
&lt;br /&gt;
              Hours From Greenwich Mean Time (GMT) Value Description&lt;br /&gt;
              0 GMT Greenwich Mean Time&lt;br /&gt;
              +1 ECT European Central Time&lt;br /&gt;
              +2 EET European Eastern Time&lt;br /&gt;
              +2 ART&lt;br /&gt;
              +3 EAT Saudi Arabia&lt;br /&gt;
              +3.5 MET Iran&lt;br /&gt;
              +4 NET&lt;br /&gt;
              +5 PLT West Asia&lt;br /&gt;
              +5.5 IST India&lt;br /&gt;
              +6 BST Central Asia&lt;br /&gt;
              +7 VST Bangkok&lt;br /&gt;
              +8 CTT China&lt;br /&gt;
              +9 JST Japan&lt;br /&gt;
              +9.5 ACT Central Australia&lt;br /&gt;
              +10 AET Eastern Australia&lt;br /&gt;
              +11 SST Central Pacific&lt;br /&gt;
              +12 NST New Zealand&lt;br /&gt;
              -11 MIT Samoa&lt;br /&gt;
              -10 HST Hawaii&lt;br /&gt;
              -9 AST Alaska&lt;br /&gt;
              -8 PST Pacific Standard Time&lt;br /&gt;
              -7 PNT Arizona&lt;br /&gt;
              -7 MST Mountain Standard Time&lt;br /&gt;
              -6 CST Central Standard Time&lt;br /&gt;
              -5 EST Eastern Standard Time&lt;br /&gt;
              -5 IET Indiana East&lt;br /&gt;
              -4 PRT Atlantic Standard Time&lt;br /&gt;
              -3.5 CNT Newfoundland&lt;br /&gt;
              -3 AGT Eastern South America&lt;br /&gt;
              -3 BET Eastern South America&lt;br /&gt;
              -1 CAT Azores&lt;br /&gt;
&lt;br /&gt;
              DST timezone&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              0      BST for British Summer.&lt;br /&gt;
              +400   ADT for Atlantic Daylight.&lt;br /&gt;
              +500   EDT for Eastern Daylight.&lt;br /&gt;
              +600   CDT for Central Daylight.&lt;br /&gt;
              +700   MDT for Mountain Daylight.&lt;br /&gt;
              +800   PDT for Pacific Daylight.&lt;br /&gt;
              +900   YDT for Yukon Daylight.&lt;br /&gt;
              +1000  HDT for Hawaii Daylight.&lt;br /&gt;
              -100   MEST for Middle European Summer,&lt;br /&gt;
                         MESZ for Middle European Summer,&lt;br /&gt;
                         SST for Swedish Summer and FST for French Summer.&lt;br /&gt;
              -700   WADT for West Australian Daylight.&lt;br /&gt;
              -1000  EADT for Eastern Australian Daylight.&lt;br /&gt;
              -1200  NZDT for New Zealand Daylight.&lt;br /&gt;
&lt;br /&gt;
     The following is an example of setting the TZ environment variable&lt;br /&gt;
     for the timezone, only when timezone changes go into effect.&lt;br /&gt;
&lt;br /&gt;
               $ export TZ=EST+5EDT,M4.1.0/2,M10.5.0/2&lt;br /&gt;
&lt;br /&gt;
     Take a look at the last line &amp;quot;M10.5.0/2&amp;quot;. What does it mean? Here is the&lt;br /&gt;
     documentation&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Mm.w.d This  specifies  day  d (0 &amp;lt;= d &amp;lt;= 6) of week w (1 &amp;lt;= w &amp;lt;= 5) of&lt;br /&gt;
              month m (1 &amp;lt;= m &amp;lt;= 12).  Week 1 is the first week in which day d&lt;br /&gt;
              occurs and week 5 is the last week in which day d occurs.  Day 0&lt;br /&gt;
              is a Sunday.&lt;br /&gt;
&lt;br /&gt;
              The time fields specify when, in the local time  currently  in&lt;br /&gt;
              effect, the  change  to  the  other  time  occurs.   If omitted,&lt;br /&gt;
              the default is  02:00:00.&lt;br /&gt;
&lt;br /&gt;
      So this is what it means. M10 stands for October, the 5 is the fifth week&lt;br /&gt;
      that includes a Sunday (note 0 in M10.5.0/2 is Sunday). To see that it is&lt;br /&gt;
      the fifth week see the calendar below. The time change occurs a 2am in&lt;br /&gt;
      the morning.&lt;br /&gt;
&lt;br /&gt;
                                October&lt;br /&gt;
                         Su Mo Tu We Th Fr Sa&lt;br /&gt;
                                         1  2&lt;br /&gt;
                          3  4  5  6  7  8  9&lt;br /&gt;
                         10 11 12 13 14 15 16&lt;br /&gt;
                         17 18 19 20 21 22 23&lt;br /&gt;
                         24 25 26 27 28 29 30&lt;br /&gt;
                         31&lt;br /&gt;
&lt;br /&gt;
       Prove it. Take the following program sunrise, which can calcuates sunrise&lt;br /&gt;
       and sunset for an latitude and longitude. This program can be downloaded&lt;br /&gt;
       from the following location:&lt;br /&gt;
           http://sourceforge.net/direct-dl/mchirico/souptonuts/working_with_time.tar.gz&lt;br /&gt;
&lt;br /&gt;
       Below is a bash script that will run the program for the next 100 days.&lt;br /&gt;
&lt;br /&gt;
          #!/bin/bash&lt;br /&gt;
          #  program: next100days  Mike Chirico&lt;br /&gt;
          #  download:&lt;br /&gt;
          #  http://sourceforge.net/direct-dl/mchirico/souptonuts/working_with_time.tar.gz&lt;br /&gt;
          #&lt;br /&gt;
          #  This will calculate the sunrise and sunset for&lt;br /&gt;
          #  latitude     39.95  Note must convert to degrees&lt;br /&gt;
          #  longitude  75.15  Note must convert to degrees&lt;br /&gt;
          lat=39.95&lt;br /&gt;
          long=75.15&lt;br /&gt;
          for (( i=0; i &amp;lt;= 100; i++))&lt;br /&gt;
          do&lt;br /&gt;
            sunrise    `date -d &amp;quot;+$i day&amp;quot; &amp;quot;+%Y %m %d&amp;quot;` $lat $long&lt;br /&gt;
          done&lt;br /&gt;
&lt;br /&gt;
       Take a look at the following sample output.&lt;br /&gt;
&lt;br /&gt;
           $ export TZ=EST+5EDT,M4.1.0/2,M10.5.0/2&lt;br /&gt;
           $ ./next100days&lt;br /&gt;
&lt;br /&gt;
          Sunrise  08-24-2004  06:21:12   Sunset 08-24-2004  19:43:42&lt;br /&gt;
          Sunrise  08-25-2004  06:22:09   Sunset 08-25-2004  19:42:12&lt;br /&gt;
          Sunrise  08-26-2004  06:23:06   Sunset 08-26-2004  19:40:41&lt;br /&gt;
          Sunrise  08-27-2004  06:24:03   Sunset 08-27-2004  19:39:09&lt;br /&gt;
          Sunrise  08-28-2004  06:25:00   Sunset 08-28-2004  19:37:37&lt;br /&gt;
          Sunrise  08-29-2004  06:25:56   Sunset 08-29-2004  19:36:04&lt;br /&gt;
          Sunrise  08-30-2004  06:26:53   Sunset 08-30-2004  19:34:31&lt;br /&gt;
          Sunrise  08-31-2004  06:27:50   Sunset 08-31-2004  19:32:57&lt;br /&gt;
          Sunrise  09-01-2004  06:28:46   Sunset 09-01-2004  19:31:22&lt;br /&gt;
          Sunrise  09-02-2004  06:29:43   Sunset 09-02-2004  19:29:47&lt;br /&gt;
          ..[values omitted ]&lt;br /&gt;
          Sunrise  10-28-2004  07:25:31   Sunset 10-28-2004  18:02:34&lt;br /&gt;
          Sunrise  10-29-2004  07:26:38   Sunset 10-29-2004  18:01:19&lt;br /&gt;
          Sunrise  10-30-2004  07:27:46   Sunset 10-30-2004  18:00:06&lt;br /&gt;
          Sunrise  10-31-2004  06:28:53   Sunset 10-31-2004  16:58:54&lt;br /&gt;
          Sunrise  11-01-2004  06:30:01   Sunset 11-01-2004  16:57:44&lt;br /&gt;
          Sunrise  11-02-2004  06:31:10   Sunset 11-02-2004  16:56:35&lt;br /&gt;
&lt;br /&gt;
       Compare 10-30-2004 with 10-31-2004. Sunrise is an hour earlier because&lt;br /&gt;
       daylight saving time has ended, just as predicted.&lt;br /&gt;
&lt;br /&gt;
       There is an easier way to switch between timezones. Take a look at the&lt;br /&gt;
       directory zoneinfo as follows:&lt;br /&gt;
&lt;br /&gt;
            $ ls /usr/share/zoneinfo&lt;br /&gt;
&lt;br /&gt;
            Africa      Chile    Factory    Iceland      Mexico    posix       UCT&lt;br /&gt;
            America     CST6CDT  GB         Indian       Mideast   posixrules  Universal&lt;br /&gt;
            Antarctica  Cuba     GB-Eire    Iran         MST       PRC         US&lt;br /&gt;
            Arctic      EET      GMT        iso3166.tab  MST7MDT   PST8PDT     UTC&lt;br /&gt;
            Asia        Egypt    GMT0       Israel       Navajo    right       WET&lt;br /&gt;
            Atlantic    Eire     GMT-0      Jamaica      NZ        ROC         W-SU&lt;br /&gt;
            Australia   EST      GMT+0      Japan        NZ-CHAT   ROK         zone.tab&lt;br /&gt;
            Brazil      EST5EDT  Greenwich  Kwajalein    Pacific   Singapore   Zulu&lt;br /&gt;
            Canada      Etc      Hongkong   Libya        Poland    SystemV&lt;br /&gt;
            CET         Europe   HST        MET          Portugal  Turkey&lt;br /&gt;
&lt;br /&gt;
       TZ can be set to any one of these files. Some of these are directories and contain&lt;br /&gt;
       subdirectories, such as ./posix/America. This way you don not have to enter the&lt;br /&gt;
       timezone, offset, and range for dst, since it has already been calculated.&lt;br /&gt;
&lt;br /&gt;
           $ export TZ=:/usr/share/zoneinfo/posix/America/Aruba&lt;br /&gt;
           $ export TZ=:/usr/share/zoneinfo/Egypt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Reference:&lt;br /&gt;
          http://prdownloads.sourceforge.net/cpearls/date_calc.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
          Also see  (TIP 27).&lt;br /&gt;
          Also see  (TIP 103) using chrony which is very similiar to ntpd.&lt;br /&gt;
          Note time settings can usually be found in /etc/sysconfig/clock&lt;br /&gt;
         &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 2:&lt;br /&gt;
&lt;br /&gt;
     cpio works like tar, only better.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Create two directories with data ../dir1 an ../dir2)&lt;br /&gt;
&lt;br /&gt;
          mkdir -p ../dir1&lt;br /&gt;
          mkdir -p ../dir2&lt;br /&gt;
          cp /etc/*.conf ../dir1/.&lt;br /&gt;
          cp /etc/*.cnf ../dir2/.&lt;br /&gt;
&lt;br /&gt;
          Which will backup all your cnf and conf files.&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Piping the files to tar)&lt;br /&gt;
&lt;br /&gt;
          cpio works like tar but can take input&lt;br /&gt;
          from the &amp;quot;find&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar &amp;gt; test.tar&lt;br /&gt;
               or&lt;br /&gt;
           $ find ../dir1/ | cpio -o -H tar &amp;gt; test2.tar&lt;br /&gt;
&lt;br /&gt;
          Same command without the &amp;quot;&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar -F test.tar&lt;br /&gt;
              or&lt;br /&gt;
           $ find ../dir1/ | cpio -o -H tar -F test2.tar&lt;br /&gt;
&lt;br /&gt;
          Using append&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar -F test.tar&lt;br /&gt;
             or&lt;br /&gt;
           $ find ../dir2/ | cpio -o --format=tar --append -F test.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (List contents of the tar file)&lt;br /&gt;
&lt;br /&gt;
          $ cpio -it &amp;lt; test.tar&lt;br /&gt;
                or&lt;br /&gt;
          $ cpio -it -F test.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Extract the contents)&lt;br /&gt;
&lt;br /&gt;
          $ cpio -i -F test.tar&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 3:&lt;br /&gt;
&lt;br /&gt;
     Working with tar. The basics with encryption.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Using the tar command on the directory /stuff)&lt;br /&gt;
&lt;br /&gt;
          Suppose you have a directory /stuff&lt;br /&gt;
          To tar everything in stuff to create a &amp;quot;.tar&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
          $ tar -cvf stuff.tar stuff&lt;br /&gt;
&lt;br /&gt;
          Which will create &amp;quot;stuff.tar&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Using the tar command to create a &amp;quot;.tar.gz&amp;quot; of /stuff)&lt;br /&gt;
&lt;br /&gt;
          $ tar -czf stuff.tar.gz stuff&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (List the files in the archive)&lt;br /&gt;
&lt;br /&gt;
          $ tar -tzf stuff.tar.gz&lt;br /&gt;
               or&lt;br /&gt;
          $ tar -tf stuff.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (A way to list specific files)&lt;br /&gt;
&lt;br /&gt;
          Note, pipe the results to a file and edit&lt;br /&gt;
&lt;br /&gt;
           $ tar -tzf stuff.tar.gz &amp;gt; mout&lt;br /&gt;
&lt;br /&gt;
          Then, edit mout to only include the files you want&lt;br /&gt;
&lt;br /&gt;
           $ tar -T mout -xzf stuff.tar.gz&lt;br /&gt;
&lt;br /&gt;
          The above command will only get the files in mout.&lt;br /&gt;
          Of couse, if you want them all&lt;br /&gt;
&lt;br /&gt;
           $ tar -xzf stuff.tar.gz&lt;br /&gt;
&lt;br /&gt;
     STEP 5 (ENCRYPTION)&lt;br /&gt;
&lt;br /&gt;
           $ tar -zcvf - stuff|openssl des3 -salt -k secretpassword | dd of=stuff.des3&lt;br /&gt;
&lt;br /&gt;
          This will create stuff.des3...don't forget the password you&lt;br /&gt;
          put in place of  secretpassword. This can be done interactively as&lt;br /&gt;
          well.&lt;br /&gt;
&lt;br /&gt;
            $ dd if=stuff.des3 |openssl des3 -d -k secretpassword|tar zxf -&lt;br /&gt;
&lt;br /&gt;
     NOTE:  above there is a &amp;quot;-&amp;quot; at the end... this will&lt;br /&gt;
            extract everything.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 4:&lt;br /&gt;
&lt;br /&gt;
     Creating a Virtual File System and Mounting it with a Loopback Device.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Construct a 10MB file)&lt;br /&gt;
&lt;br /&gt;
           $ dd if=/dev/zero of=/tmp/disk-image count=20480&lt;br /&gt;
&lt;br /&gt;
          By default dd uses block of 512 so the size will be 20480*512&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Make an ext2 or ext3 file system) -- ext2 shown here.&lt;br /&gt;
&lt;br /&gt;
           $ mke2fs -q&lt;br /&gt;
&lt;br /&gt;
          or if you want ext3&lt;br /&gt;
&lt;br /&gt;
           $ mkfs -t ext3 -q /tmp/disk-image&lt;br /&gt;
&lt;br /&gt;
          yes, you can even use reiser, but you'll need to create a bigger&lt;br /&gt;
          disk image. Something like &amp;quot;dd if=/dev/zero of=/tmp/disk-image count=50480&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ mkfs -t reiserfs -q /tmp/disk-image&lt;br /&gt;
&lt;br /&gt;
          Hit yes for confirmation.  It only asks this because it's a file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Create a directory &amp;quot;virtual-fs&amp;quot; and mount. This has to be done as root)&lt;br /&gt;
&lt;br /&gt;
           $ mkdir /virtual-fs&lt;br /&gt;
           $ mount -o loop=/dev/loop0 /tmp/disk-image /virtual-fs&lt;br /&gt;
&lt;br /&gt;
         SPECIAL NOTE: if you mount a second device you will have to increase the&lt;br /&gt;
                       loop count: loop=/dev/loop1, loop=/dev/loop2, ... loop=/dev/loopn&lt;br /&gt;
&lt;br /&gt;
          Now it operates just like a disk. This virtual filesystem can be mounted&lt;br /&gt;
          when the system boots by adding the following to the &amp;quot;/etc/fstab&amp;quot; file. Then,&lt;br /&gt;
          to mount, just type &amp;quot;mount /virtual-fs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                 /tmp/disk-image /virtual-fs ext2               rw,loop=/dev/loop0 0 0&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (When done, umount it)&lt;br /&gt;
&lt;br /&gt;
           $ umount /virtual-fs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE: If you are using Fedora core 2, in the /etc/fstab you can take&lt;br /&gt;
              advantage of acl properties for this mount. Note the acl next to the&lt;br /&gt;
              rw entry. This is shown here with ext3.&lt;br /&gt;
&lt;br /&gt;
                 /tmp/disk-image     /virtual-fs ext3    rw,acl,loop=/dev/loop1 0 0&lt;br /&gt;
&lt;br /&gt;
              Also, if you are using Fedora core 2 and above, you can mount the file&lt;br /&gt;
              on a cryptoloop.&lt;br /&gt;
&lt;br /&gt;
                $ dd if=/dev/urandom of=disk-aes count=20480&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ modprobe loop&lt;br /&gt;
                $ modprobe cryptoloop&lt;br /&gt;
                $ modprobe aes&lt;br /&gt;
&lt;br /&gt;
                $ losetup -e aes /dev/loop0 disk-aes&lt;br /&gt;
                $ mkfs -t ext2 /dev/loop0&lt;br /&gt;
                $ mount -o loop,encryption=aes disk-aes &amp;lt;mount point&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              If you do not have Fedora core 2, then, you can build the kernel from source&lt;br /&gt;
              with some of the following options (not complete, yet)&lt;br /&gt;
               reference:&lt;br /&gt;
     http://cvs.sourceforge.net/viewcvs.py/cpearls/cpearls/src/posted_on_sf/acl/ehd.pdf?rev=1.1&amp;amp;view=log&lt;br /&gt;
&lt;br /&gt;
                      Cryptographic API Support (CONFIG_CRYPTO)&lt;br /&gt;
                      generic loop cryptographic (CONFIG_CRYPTOLOOP)&lt;br /&gt;
                      Cryptographic ciphers (CONFIG_CIPHERS)&lt;br /&gt;
                      Enable one or more  ciphers  (CONFIG CIPHER .*) such as AES.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     HELPFUL INFORMATION: It is possible to bind mount partitions, or associate the&lt;br /&gt;
                     mounted partition to a directory name.&lt;br /&gt;
&lt;br /&gt;
                  # mount --bind  /virtual-fs      /home/mchirico/vfs&lt;br /&gt;
&lt;br /&gt;
             Also, if you want to see what filesystems are currently mounted, &amp;quot;cat&amp;quot; the&lt;br /&gt;
             file &amp;quot;/etc/mtab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
                  $ cat /etc/mtab&lt;br /&gt;
&lt;br /&gt;
     Also see TIP 91.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 5:&lt;br /&gt;
&lt;br /&gt;
     Setting up 2 IP address on &amp;quot;One&amp;quot; NIC. This example is on ethernet.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (The settings for the initial IP address)&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
&lt;br /&gt;
            DEVICE=eth0&lt;br /&gt;
            BOOTPROTO=static&lt;br /&gt;
            BROADCAST=192.168.99.255&lt;br /&gt;
            IPADDR=192.168.1.155&lt;br /&gt;
            NETMASK=255.255.252.0&lt;br /&gt;
            NETWORK=192.168.1.0&lt;br /&gt;
            ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (2nd IP address: )&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/sysconfig/network-scripts/ifcfg-eth0:1&lt;br /&gt;
&lt;br /&gt;
            DEVICE=eth0:1&lt;br /&gt;
            BOOTPROTO=static&lt;br /&gt;
            BROADCAST=192.168.99.255&lt;br /&gt;
            IPADDR=192.168.1.182&lt;br /&gt;
            NETMASK=255.255.252.0&lt;br /&gt;
            NETWORK=192.168.1.0&lt;br /&gt;
            ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
     SUMMARY  Note, in STEP 1 the filename is &amp;quot;ifcfg-eth0&amp;quot;, whereas in&lt;br /&gt;
              STEP 2 it's &amp;quot;ifcfg-eth0:1&amp;quot; and also not the matching&lt;br /&gt;
              entries for &amp;quot;DEVICE=...&amp;quot;.  Also, obviously, the&lt;br /&gt;
              &amp;quot;IPADDR&amp;quot; is different as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 6:&lt;br /&gt;
&lt;br /&gt;
     Sharing Directories Among Several Users.&lt;br /&gt;
&lt;br /&gt;
     Several people are working on a project in &amp;quot;/home/share&amp;quot;&lt;br /&gt;
     and they need to create documents and programs so that&lt;br /&gt;
     others in the group can edit and execute these documents&lt;br /&gt;
     as needed. Also see (TIP 186) for adding existing users&lt;br /&gt;
     to groups.&lt;br /&gt;
&lt;br /&gt;
       $  /usr/sbin/groupadd share&lt;br /&gt;
       $  chown -R root.share /home/share&lt;br /&gt;
       $  /usr/bin/gpasswd -a &amp;lt;username&amp;gt; share&lt;br /&gt;
       $  chmod 2775 /home/share&lt;br /&gt;
&lt;br /&gt;
       $  ls -ld /home/share&lt;br /&gt;
             drwxrwsr-x    2 root     share        4096 Nov  8 16:19 /home/share&lt;br /&gt;
                   ^---------- Note the s bit, which was set with the chmod 2775&lt;br /&gt;
&lt;br /&gt;
       $  cat /etc/group&lt;br /&gt;
          ...&lt;br /&gt;
           share:x:502:chirico,donkey,zoe&lt;br /&gt;
          ...          ^------- users are added to this group.&lt;br /&gt;
&lt;br /&gt;
     The user may need to login again to get access. Or, if the user is currently&lt;br /&gt;
     logged in, they can run the following command:&lt;br /&gt;
&lt;br /&gt;
       $ su - &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Note, the above step is recommended over  &amp;quot;newgrp - share&amp;quot; since currently&lt;br /&gt;
     newgrp in FC2,FC3, and FC4 gets access to the group but the umask is not&lt;br /&gt;
     correctly formed.&lt;br /&gt;
&lt;br /&gt;
     As root you  can test their account.&lt;br /&gt;
&lt;br /&gt;
       $ su - &amp;lt;username&amp;gt;   &amp;quot;You need to '-' to pickup thier environment  '$ su - chirico' &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Note: SUID, SGID, Sticky bit. Only the left most octet is examined, and &amp;quot;chmod 755&amp;quot; is used&lt;br /&gt;
          as an example of the full command. But, anything else could be used as well. Normally&lt;br /&gt;
          you'd want executable permissions.&lt;br /&gt;
&lt;br /&gt;
        Octal digit  Binary value      Meaning                           Example usage&lt;br /&gt;
            0           000       all cleared                             $ chmod 0755 or chmod 755&lt;br /&gt;
            1           001       sticky                                  $ chmod 1755&lt;br /&gt;
            2           010       setgid                                  $ chmod 2755&lt;br /&gt;
            3           011       setgid, sticky                          $ chmod 3755&lt;br /&gt;
            4           100       setuid                                  $ chmod 4755&lt;br /&gt;
            5           101       setuid, sticky                          $ chmod 5755&lt;br /&gt;
            6           110       setuid, setgid                          $ chmod 6755&lt;br /&gt;
            7           111       setuid, setgid, sticky                  $ chmod 7755&lt;br /&gt;
&lt;br /&gt;
     A few examples applied to a directory below. In the first example all users in the group can&lt;br /&gt;
     add files to directory &amp;quot;dirA&amp;quot; and they can delete their own files. Users cannot delete other&lt;br /&gt;
     user's files.&lt;br /&gt;
&lt;br /&gt;
        Sticky bit:&lt;br /&gt;
           $ chmod 1770  dirA&lt;br /&gt;
&lt;br /&gt;
     Below files created within the directory have the group ID of the directory, rather than that&lt;br /&gt;
     of the default group setting for the user who created the file.&lt;br /&gt;
&lt;br /&gt;
        Set group ID bit:&lt;br /&gt;
           $ chmod 2755  dirB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 7:&lt;br /&gt;
&lt;br /&gt;
     Getting Infomation on Commands&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;info&amp;quot; is a great utility for getting information about the system.&lt;br /&gt;
     Here's a quick key on using &amp;quot;info&amp;quot; from the terminal prompt.&lt;br /&gt;
&lt;br /&gt;
       'q' exits.&lt;br /&gt;
       'u' moves up to the table of contents of the current section.&lt;br /&gt;
       'n' moves to the next chapter.&lt;br /&gt;
       'p' moves to the previous chapter.&lt;br /&gt;
       'space' goes into the selected section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The following is a good starting point:&lt;br /&gt;
&lt;br /&gt;
        $ info coreutils&lt;br /&gt;
&lt;br /&gt;
      Need to find out what a certain program does?&lt;br /&gt;
&lt;br /&gt;
        $ whatis  open&lt;br /&gt;
       open   (2)  - open and possibly create a file or device&lt;br /&gt;
       open   (3)  - perl pragma to set default PerlIO layers for input and output&lt;br /&gt;
       open   (3pm)  - perl pragma to set default PerlIO layers for input and output&lt;br /&gt;
       open   (n)  - Open a file-based or command pipeline channel&lt;br /&gt;
&lt;br /&gt;
      To get specific information about the open commmand&lt;br /&gt;
&lt;br /&gt;
        $ man 2 open&lt;br /&gt;
&lt;br /&gt;
       also try 'keyword' search, which is the same as the apropos command.&lt;br /&gt;
       For example, to find all the man pages on selinux, type the following:&lt;br /&gt;
&lt;br /&gt;
        $ man -k selinux&lt;br /&gt;
&lt;br /&gt;
       or the man full word search. Same as whatis command.&lt;br /&gt;
&lt;br /&gt;
        $ man -f &amp;lt;some string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       This is a hint once you are inside man.&lt;br /&gt;
&lt;br /&gt;
        space      moves forward one page&lt;br /&gt;
        b          moves backward&lt;br /&gt;
        y          scrolls up one line &amp;quot;yikes, I missed it!&amp;quot;&lt;br /&gt;
        g          goes to the beginning&lt;br /&gt;
        q          quits&lt;br /&gt;
        /&amp;lt;string&amp;gt;  search, repeat seach n&lt;br /&gt;
        m          mark, enter a letter like &amp;quot;a&amp;quot;, then, ' to go back&lt;br /&gt;
        '          enter a letter that is marked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       To get section numbers&lt;br /&gt;
&lt;br /&gt;
        $ man 8 ping&lt;br /&gt;
&lt;br /&gt;
       Note the numbers are used as follows&lt;br /&gt;
         (This is OpenBSD)&lt;br /&gt;
&lt;br /&gt;
         1  General Commands&lt;br /&gt;
         2  System Calls and Error Numbers&lt;br /&gt;
         3  C Libraries&lt;br /&gt;
         3p perl&lt;br /&gt;
         4  Devices and device drivers&lt;br /&gt;
         5  File Formats and config files&lt;br /&gt;
         6  Game instructions&lt;br /&gt;
         7  Miscellaneous information&lt;br /&gt;
         8  System maintenance&lt;br /&gt;
         9  Kernel internals&lt;br /&gt;
&lt;br /&gt;
       To find the man page directly, &amp;quot;ls&amp;quot; command:&lt;br /&gt;
&lt;br /&gt;
         $ whereis -m ls&lt;br /&gt;
         ls: /usr/share/man/man1/ls.1.gz /usr/share/man/man1/ls.1 /usr/share/man/man1p/ls.1p&lt;br /&gt;
&lt;br /&gt;
       To read this file directly, do the following:&lt;br /&gt;
&lt;br /&gt;
         $ man /usr/share/man/man1/ls.1.gz&lt;br /&gt;
&lt;br /&gt;
       If you want to know the manpath, execute manpath.&lt;br /&gt;
&lt;br /&gt;
         $ manpath&lt;br /&gt;
         /usr/share/man:/usr/X11R6/man:/usr/local/share/man:/usr/local/pgsql/man:/usr/man:/usr/local/man&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 8:&lt;br /&gt;
&lt;br /&gt;
     How to Put a &amp;quot;Running Job&amp;quot; in the Background.&lt;br /&gt;
&lt;br /&gt;
     You're running a job at the terminal prompt, and it's taking&lt;br /&gt;
     a very long time. You want to put the job in the backgroud.&lt;br /&gt;
&lt;br /&gt;
       &amp;quot;CTL - z&amp;quot; Temporarily suspends the job&lt;br /&gt;
       $ jobs     This will list all the jobs&lt;br /&gt;
       $ bg %jobnumber (bg %1)  To run in the background&lt;br /&gt;
       $ fg %jobnumber          To bring back in the foreground&lt;br /&gt;
&lt;br /&gt;
     Need to kill all jobs -- say you're using several suspended&lt;br /&gt;
     emacs sessions and you just want everything to exit.&lt;br /&gt;
&lt;br /&gt;
       $ kill -9  `jobs -p`&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;jobs -p&amp;quot; gives the process number of each job, and the&lt;br /&gt;
     kill -9 kills everything. Yes, sometimes &amp;quot;kill -9&amp;quot; is excessive&lt;br /&gt;
     and you should issue a &amp;quot;kill -15&amp;quot; that allows jobs to clean-up.&lt;br /&gt;
     However, for exacs session, I prefer &amp;quot;kill -9&amp;quot; and haven't had&lt;br /&gt;
     a problem.&lt;br /&gt;
&lt;br /&gt;
     Sometimes you need to list the process id along with job&lt;br /&gt;
     information. For instance, here's process id with the listing.&lt;br /&gt;
&lt;br /&gt;
       $ jobs -l&lt;br /&gt;
&lt;br /&gt;
     Note you can also renice a job, or give it lower priority.&lt;br /&gt;
&lt;br /&gt;
       $ nice -n +15 find . -ctime 2 -type f  -exec ls {} \; &amp;gt; last48hours&lt;br /&gt;
        ^z&lt;br /&gt;
       $  bg&lt;br /&gt;
&lt;br /&gt;
     So above that was a ctl-z to suppend. Then, bg to run it in&lt;br /&gt;
     the background. Now, if you want to change the priority lower&lt;br /&gt;
     you just renice it, once you know the process id.&lt;br /&gt;
&lt;br /&gt;
       $ jobs -pl&lt;br /&gt;
   [1]+ 29388 Running                 nice -n +15 find . -ctime 2 -exec ls -l {} \; &amp;gt;mout &amp;amp;&lt;br /&gt;
&lt;br /&gt;
       $ renice +30 -p 29388&lt;br /&gt;
        29388: old priority 15, new priority 19&lt;br /&gt;
&lt;br /&gt;
      19 was the lowest priority for this job. You cannot increase&lt;br /&gt;
      the priority unless you are root.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 9:&lt;br /&gt;
&lt;br /&gt;
     Need to Delete a File for Good -- not even GOD can recover.&lt;br /&gt;
&lt;br /&gt;
     You have a file &amp;quot;secret&amp;quot;.  The following makes it so no one&lt;br /&gt;
     can read it.  If the file was 12 bytes, it's now 4096 after it&lt;br /&gt;
     has been over written 100 times.  There's no way to recover this.&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z secret&lt;br /&gt;
&lt;br /&gt;
     Want to remove the file? Use the &amp;quot;u&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z -u test2&lt;br /&gt;
&lt;br /&gt;
     It can be applied to a device&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z -u /dev/fd0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       CAUTION: Note that shred relies on a very important assumption: that the file system  overwrites  data&lt;br /&gt;
       in  place.   This is the traditional way to do things, but many modern file system designs do not sat-&lt;br /&gt;
       isfy this assumption.  The following are examples of file systems on which shred is not effective,  or&lt;br /&gt;
       is not guaranteed to be effective in all file system modes:&lt;br /&gt;
&lt;br /&gt;
       * log-structured or journaled file systems, such as those supplied with&lt;br /&gt;
&lt;br /&gt;
              AIX and Solaris (and JFS, ReiserFS, XFS, Ext3, etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 52).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 10:&lt;br /&gt;
&lt;br /&gt;
     Who and What is doing What on Your System - finding open sockets,&lt;br /&gt;
     files etc.&lt;br /&gt;
&lt;br /&gt;
       $ lsof&lt;br /&gt;
          or as root&lt;br /&gt;
       $ watch lsof -i&lt;br /&gt;
&lt;br /&gt;
     To list all open Internet files, use:&lt;br /&gt;
&lt;br /&gt;
       $ lsof -i -U&lt;br /&gt;
&lt;br /&gt;
       (See TIP 118)&lt;br /&gt;
&lt;br /&gt;
     Also try fuser. Suppose you have a mounted file-system, and you need&lt;br /&gt;
     to umount it. To list the users on the file-system /work&lt;br /&gt;
&lt;br /&gt;
       $ fuser -u /work&lt;br /&gt;
&lt;br /&gt;
     To kill all processes accessing the file system /work  in  any way.&lt;br /&gt;
&lt;br /&gt;
       $ fuser -km /work&lt;br /&gt;
&lt;br /&gt;
     Or better yet, maybe you want to eject a cdrom on /mnt/cdrom&lt;br /&gt;
&lt;br /&gt;
       $ fuser -km /mnt/cdrom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     If you need IO load information about your system, you can execute&lt;br /&gt;
     iostat. But note, the very first iostat gives a snapshot since&lt;br /&gt;
     the last boot. You typically want the following command, which gives&lt;br /&gt;
     you 3 outputs every 5 seconds.&lt;br /&gt;
&lt;br /&gt;
       $ iostat -xtc 5 3&lt;br /&gt;
       Linux 2.6.12-1.1376_FC3smp (squeezel.squeezel.com) 	10/05/2005&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:04 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  0.97    0.06    1.94    0.62   96.41&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:09 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  0.60    0.00    1.70    0.00   97.70&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:14 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  1.00    0.00    1.60    0.00   97.39&lt;br /&gt;
&lt;br /&gt;
     vmstat reports memory statistics.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ vmstat&lt;br /&gt;
       $ ifconfig&lt;br /&gt;
       $ cat /proc/sys/vm/.. (entries under here)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      *NOTE: (TIP 77) shows sample usage of &amp;quot;ifconfig&amp;quot;. Also&lt;br /&gt;
       (TIP 84) shows sample output of &amp;quot;$ cat /proc/cpuinfo&amp;quot;. You can download iostat&lt;br /&gt;
       and other packages from (http://perso.wanadoo.fr/sebastien.godard/download_en.html).&lt;br /&gt;
       You also may want to look at iozone (TIP 178).&lt;br /&gt;
&lt;br /&gt;
     Also&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/meminfo&lt;br /&gt;
       $ cat /proc/stat&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/uptime&lt;br /&gt;
       1078623.55 1048008.34       First number is the number of seconds since boot.&lt;br /&gt;
                                   The second number is the number of idle seconds.&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/loadavg&lt;br /&gt;
       0.25 0.14 0.10 1/166 7778   This shows load at 1,5, and 15 minutes,&lt;br /&gt;
                                   a total of 1 current running process out&lt;br /&gt;
                                   from a total of 166. The 7778 is the last&lt;br /&gt;
                                   process id used.&lt;br /&gt;
                                   Ref: http://www.teamquest.com/resources/gunther/ldavg1.shtml&lt;br /&gt;
&lt;br /&gt;
     Or current process open file descriptors&lt;br /&gt;
&lt;br /&gt;
        $ ls -l /proc/self/fd/0&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lr-x------    1 chirico  chirico        64 Jun 29 13:17 3 -&amp;gt; /proc/26667/fd&lt;br /&gt;
&lt;br /&gt;
      So you could, $ echo &amp;quot;stuff&amp;quot; &amp;gt; /dev/pts/51, to get output. Note, tree is also&lt;br /&gt;
      helpful here:&lt;br /&gt;
&lt;br /&gt;
         $ tree /proc/self&lt;br /&gt;
&lt;br /&gt;
            /proc/self&lt;br /&gt;
            |-- auxv&lt;br /&gt;
            |-- cmdline&lt;br /&gt;
            |-- cwd -&amp;gt; /work/souptonuts/documentation/theBook&lt;br /&gt;
            |-- environ&lt;br /&gt;
            |-- exe -&amp;gt; /usr/bin/tree&lt;br /&gt;
            |-- fd&lt;br /&gt;
            |   |-- 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   |-- 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   |-- 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   `-- 3 -&amp;gt; /proc/26668/fd&lt;br /&gt;
            |-- maps&lt;br /&gt;
            |-- mem&lt;br /&gt;
            |-- mounts&lt;br /&gt;
            |-- root -&amp;gt; /&lt;br /&gt;
            |-- stat&lt;br /&gt;
            |-- statm&lt;br /&gt;
            |-- status&lt;br /&gt;
            |-- task&lt;br /&gt;
            |   `-- 26668&lt;br /&gt;
            |       |-- auxv&lt;br /&gt;
            |       |-- cmdline&lt;br /&gt;
            |       |-- cwd -&amp;gt; /work/souptonuts/documentation/theBook&lt;br /&gt;
            |       |-- environ&lt;br /&gt;
            |       |-- exe -&amp;gt; /usr/bin/tree&lt;br /&gt;
            |       |-- fd&lt;br /&gt;
            |       |   |-- 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   |-- 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   |-- 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   `-- 3 -&amp;gt; /proc/26668/task/26668/fd&lt;br /&gt;
            |       |-- maps&lt;br /&gt;
            |       |-- mem&lt;br /&gt;
            |       |-- mounts&lt;br /&gt;
            |       |-- root -&amp;gt; /&lt;br /&gt;
            |       |-- stat&lt;br /&gt;
            |       |-- statm&lt;br /&gt;
            |       |-- status&lt;br /&gt;
            |       `-- wchan&lt;br /&gt;
            `-- wchan&lt;br /&gt;
&lt;br /&gt;
            10 directories, 28 files&lt;br /&gt;
&lt;br /&gt;
     Need a listing of the system settings?&lt;br /&gt;
&lt;br /&gt;
       $ sysctl -a&lt;br /&gt;
&lt;br /&gt;
     Need IPC (Shared Memory Segments, Semaphore Arrays, Message Queue) status&lt;br /&gt;
     etc?&lt;br /&gt;
&lt;br /&gt;
       $ ipcs&lt;br /&gt;
       $ ipcs -l  &amp;quot;This gives limits&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Need to &amp;quot;watch&amp;quot; everything a user does?  The following watches donkey.&lt;br /&gt;
&lt;br /&gt;
       $ watch lsof -u donkey&lt;br /&gt;
&lt;br /&gt;
     Or, to see what in  going on in directory &amp;quot;/work/junk&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       $ watch lsof +D /work/junk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 11:&lt;br /&gt;
&lt;br /&gt;
     How to make a File &amp;quot;immutable&amp;quot; or &amp;quot;unalterable&amp;quot; -- it cannot be changed&lt;br /&gt;
     or deleted even by root. Note this works on (ext2/ext3) filesystems.&lt;br /&gt;
     And, yes, root can delete after it's changed back.&lt;br /&gt;
&lt;br /&gt;
     As root:&lt;br /&gt;
&lt;br /&gt;
       $ chattr +i filename&lt;br /&gt;
&lt;br /&gt;
     And to change it back:&lt;br /&gt;
&lt;br /&gt;
       $ chattr -i filename&lt;br /&gt;
&lt;br /&gt;
     List attributes&lt;br /&gt;
&lt;br /&gt;
       $ lsattr filename&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 12:&lt;br /&gt;
&lt;br /&gt;
     SSH - How to Generate the Key Pair.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     On the local server&lt;br /&gt;
&lt;br /&gt;
       $  ssh-keygen -t dsa -b 2048&lt;br /&gt;
&lt;br /&gt;
     This will create the two files:&lt;br /&gt;
&lt;br /&gt;
            .ssh/id_dsa (Private key)&lt;br /&gt;
            .ssh/id_dsa.pub  (Public key you can share)&lt;br /&gt;
&lt;br /&gt;
     Next insert &amp;quot;.ssh/id_dsa.pub&amp;quot; on the remote server&lt;br /&gt;
     in the file  &amp;quot;.ssh/authorized_keys&amp;quot; and &amp;quot;.ssh/authorized_keys2&amp;quot;&lt;br /&gt;
     and change the  permission of each file to (chmod 600). Plus, make&lt;br /&gt;
     sure the directory &amp;quot;.ssh&amp;quot; exists on the remote computer with 700 rights.&lt;br /&gt;
     Ok, assuming  192.168.1.155 is the remote server and &amp;quot;donkey&amp;quot; is the&lt;br /&gt;
     account on that remote server.&lt;br /&gt;
&lt;br /&gt;
       $ ssh donkey@192.168.1.155 &amp;quot;mkdir -p .ssh&amp;quot;&lt;br /&gt;
       $ ssh donkey@192.168.1.155 &amp;quot;chmod 700 .ssh&amp;quot;&lt;br /&gt;
       $ scp ./.ssh/id_dsa.pub  donkey@192.168.1.155:.ssh/newkey.pub&lt;br /&gt;
&lt;br /&gt;
     Now connect to that remote server &amp;quot;192.168.1.155&amp;quot; and add .ssh/newkey.pub&lt;br /&gt;
     to both &amp;quot;authorized_keys&amp;quot; and &amp;quot;authorized_keys2&amp;quot;.  When done, the permission&lt;br /&gt;
     on&lt;br /&gt;
       (This is on the remote server)&lt;br /&gt;
&lt;br /&gt;
        $chmod 600 .ssh/authorized_key*&lt;br /&gt;
&lt;br /&gt;
     Next, go back to the local server and issue the following:&lt;br /&gt;
&lt;br /&gt;
        $ ssh-agent $SHELL&lt;br /&gt;
        $ ssh-add&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;ssh-add&amp;quot; will allow you to enter the passphrase and it will&lt;br /&gt;
     save it for the current login session.&lt;br /&gt;
&lt;br /&gt;
     You don't have to enter a password when running &amp;quot;ssh-keygen&amp;quot; above. But,&lt;br /&gt;
     remember anyone with root access can &amp;quot;su - &amp;lt;username&amp;gt;&amp;quot; and then connect&lt;br /&gt;
     to your computers.  It's harder, however, not impossible, for root to do&lt;br /&gt;
     this if  you have a password.&lt;br /&gt;
&lt;br /&gt;
     (Reference TIP 151)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 13:&lt;br /&gt;
&lt;br /&gt;
     Securing the System: Don't allow root to login remotely.  Instead,&lt;br /&gt;
     the admin could login as another account, then, &amp;quot;su -&amp;quot;.  However,&lt;br /&gt;
     root can still login &amp;quot;from the local terminal&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     In the &amp;quot;/etc/ssh/sshd_config&amp;quot; file change the following lines:&lt;br /&gt;
&lt;br /&gt;
        Protocol 2&lt;br /&gt;
        PermitRootLogin no&lt;br /&gt;
        PermitEmptyPasswords no&lt;br /&gt;
&lt;br /&gt;
     Then, restart ssh&lt;br /&gt;
&lt;br /&gt;
        /etc/init.d/sshd restart&lt;br /&gt;
&lt;br /&gt;
     Why would you want to do this?  It's not possible for anyone to guess&lt;br /&gt;
     or keep trying the root account.  This is especially good for computers&lt;br /&gt;
     on the Internet. So, even if the &amp;quot;root&amp;quot; passwords is known, they can't&lt;br /&gt;
     get access to the system remotely.  Only from the terminal, which is locked&lt;br /&gt;
     in your computer room. However, if anyone has a account on the server,&lt;br /&gt;
     then, they can login under their  account then &amp;quot;su -&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Suppose you only want a limited number of users:  &amp;quot;mchirico&amp;quot; and &amp;quot;donkey&amp;quot;.&lt;br /&gt;
     Add the following line to &amp;quot;/etc/ssh/sshd_config&amp;quot;. Note, this allows access&lt;br /&gt;
     for chirico and donkey, but everyone else is denied.&lt;br /&gt;
&lt;br /&gt;
         #  Once you add AllowUsers - everyone else is denied.&lt;br /&gt;
         AllowUsers mchirico donkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 14:&lt;br /&gt;
&lt;br /&gt;
     Keep Logs Longer with Less Space.&lt;br /&gt;
&lt;br /&gt;
     Normally logs rotate monthly, over writing all the old data.  Here's a&lt;br /&gt;
     sample &amp;quot;/etc/logrotate.conf&amp;quot; that will keep 12 months of backup&lt;br /&gt;
     compressing the logfiles&lt;br /&gt;
&lt;br /&gt;
       $ cat /etc/logrotate.conf&lt;br /&gt;
&lt;br /&gt;
             # see &amp;quot;man logrotate&amp;quot; for details&lt;br /&gt;
             # rotate log files weekly&lt;br /&gt;
             #chirico changes to monthly&lt;br /&gt;
             monthly&lt;br /&gt;
&lt;br /&gt;
             # keep 4 weeks worth of backlogs&lt;br /&gt;
             # keep 12 months of backup&lt;br /&gt;
             rotate 12&lt;br /&gt;
&lt;br /&gt;
             # create new (empty) log files after rotating old ones&lt;br /&gt;
             create&lt;br /&gt;
&lt;br /&gt;
             # uncomment this if you want your log files compressed&lt;br /&gt;
             compress&lt;br /&gt;
&lt;br /&gt;
             # RPM packages drop log rotation information into this directory&lt;br /&gt;
             include /etc/logrotate.d&lt;br /&gt;
&lt;br /&gt;
             # no packages own wtmp -- we'll rotate them here&lt;br /&gt;
             /var/log/wtmp {&lt;br /&gt;
                 monthly&lt;br /&gt;
                 create 0664 root utmp&lt;br /&gt;
                 rotate 1&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
             # system-specific logs may be also be configured here.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Note: see tip 1. The clock should always be correctly set.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 15:&lt;br /&gt;
&lt;br /&gt;
     What Network Services are Running?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -atup&lt;br /&gt;
&lt;br /&gt;
     or&lt;br /&gt;
&lt;br /&gt;
          $ netstat -ap|grep LISTEN|less&lt;br /&gt;
&lt;br /&gt;
     This can be helpful to determine the services running.&lt;br /&gt;
&lt;br /&gt;
     Need stats on dropped UDP packets?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s -u&lt;br /&gt;
&lt;br /&gt;
     or TCP&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s -t&lt;br /&gt;
&lt;br /&gt;
     or summary of everything&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s&lt;br /&gt;
&lt;br /&gt;
     or looking for error rates on the interface?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -i&lt;br /&gt;
&lt;br /&gt;
     Listening interfaces?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -l&lt;br /&gt;
&lt;br /&gt;
     (Tip above provided by Amos Shapira)&lt;br /&gt;
&lt;br /&gt;
     Also see TIP 77.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 16:&lt;br /&gt;
&lt;br /&gt;
     Apache: Creating and Using an &amp;quot;.htaccess&amp;quot; File&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Below is a sample &amp;quot;.htaccess&amp;quot; file which goes in&lt;br /&gt;
     &amp;quot;/usr/local/apache/htdocs/chirico/alpha/.htaccess&amp;quot; for this&lt;br /&gt;
     example&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         AuthUserFile /usr/local/apache/htdocs/chirico/alpha/.htpasswd&lt;br /&gt;
         AuthGroupFile /dev/null&lt;br /&gt;
         AuthName &amp;quot;Your Name and regular password required&amp;quot;&lt;br /&gt;
         AuthType Basic&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;Limit GET POST&amp;gt;&lt;br /&gt;
         require valid-user&lt;br /&gt;
         &amp;lt;/Limit&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    In order for this to work /usr/local/apache/conf/httpd.conf must&lt;br /&gt;
    have the following line in it:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       #&lt;br /&gt;
       &amp;lt;Directory /usr/local/apache/htdocs/chirico/alpha&amp;gt;&lt;br /&gt;
           AllowOverride FileInfo AuthConfig Limit&lt;br /&gt;
           Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec&lt;br /&gt;
           &amp;lt;Limit GET POST OPTIONS PROPFIND&amp;gt;&lt;br /&gt;
               Order allow,deny&lt;br /&gt;
               Allow from all&lt;br /&gt;
           &amp;lt;/Limit&amp;gt;&lt;br /&gt;
           &amp;lt;LimitExcept GET POST OPTIONS PROPFIND&amp;gt;&lt;br /&gt;
               Order deny,allow&lt;br /&gt;
               Deny from all&lt;br /&gt;
           &amp;lt;/LimitExcept&amp;gt;&lt;br /&gt;
       &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Also, a password file must be created&lt;br /&gt;
&lt;br /&gt;
      $ /usr/local/apache/bin/htpasswd -c .htpasswd chirico&lt;br /&gt;
&lt;br /&gt;
    And enter the user names and passwords.&lt;br /&gt;
&lt;br /&gt;
    Next Reload Apache:&lt;br /&gt;
&lt;br /&gt;
      $ /etc/init.d/httpd reload&lt;br /&gt;
&lt;br /&gt;
    (Reference TIP 213 limit access to certain directories based on IP address).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 17:&lt;br /&gt;
&lt;br /&gt;
     Working with &amp;quot;mt&amp;quot; Commands: reading and writing to tape.&lt;br /&gt;
&lt;br /&gt;
     The following assumes the tape device is &amp;quot;/dev/st0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     STEP 1 ( rewind the tape)&lt;br /&gt;
&lt;br /&gt;
          # mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (check to see if you are at block 0)&lt;br /&gt;
&lt;br /&gt;
          # mt -f /dev/nst0 tell&lt;br /&gt;
            At block 0.&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Backup &amp;quot;tar compress&amp;quot;  directories &amp;quot;one&amp;quot;  and &amp;quot;two&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
          # tar -czf /dev/nst0 one two&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Check to see what block you are at)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
&lt;br /&gt;
       You should get something like block 2 at this point.&lt;br /&gt;
&lt;br /&gt;
     STEP 5 (Rewind the tape)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
     STEP 6 (List the files)&lt;br /&gt;
&lt;br /&gt;
           # tar -tzf /dev/nst0&lt;br /&gt;
              one/&lt;br /&gt;
              one/test&lt;br /&gt;
              two/&lt;br /&gt;
&lt;br /&gt;
     STEP 7 (Restore directory &amp;quot;one&amp;quot;  into directory &amp;quot;junk&amp;quot;).  Note, you&lt;br /&gt;
          have to first rewind the tape, since the last operation moved&lt;br /&gt;
          ahead 2 blocks. Check this with &amp;quot;mt -f /dev/nst0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           # cd junk&lt;br /&gt;
           # mt -f /dev/nst0 rewind&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
              At block 0.&lt;br /&gt;
           # tar -xzf /dev/nst0 one&lt;br /&gt;
&lt;br /&gt;
     STEP 8 (Next, take a look to see what block the tape is at)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
              At block 2.&lt;br /&gt;
&lt;br /&gt;
     STEP 9 (Now backup directories three  and four)&lt;br /&gt;
&lt;br /&gt;
           # tar -czf /dev/nst0 three four&lt;br /&gt;
&lt;br /&gt;
       After backing up the files, the tape should be past block 2.&lt;br /&gt;
       Check this.&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
             At block 4.&lt;br /&gt;
&lt;br /&gt;
          Currently the following exist:&lt;br /&gt;
&lt;br /&gt;
                At block 1:&lt;br /&gt;
                     one/&lt;br /&gt;
                    one/test&lt;br /&gt;
                    two/&lt;br /&gt;
&lt;br /&gt;
                At block 2:&lt;br /&gt;
                    three/&lt;br /&gt;
                    three/samplehere&lt;br /&gt;
                    four/&lt;br /&gt;
&lt;br /&gt;
                At block 4:&lt;br /&gt;
                    (* This is empty *)&lt;br /&gt;
&lt;br /&gt;
     A few notes. You can set the blocking factor and a label&lt;br /&gt;
     with tar. For example:&lt;br /&gt;
&lt;br /&gt;
      $ tar --label=&amp;quot;temp label&amp;quot; --create  --blocking-factor=128 --file=/dev/nst0 Notes&lt;br /&gt;
&lt;br /&gt;
     But note if you try to read it with the default, incorrect blocking&lt;br /&gt;
     factor, then, you will get the following error:&lt;br /&gt;
&lt;br /&gt;
        $ tar -t   --file=/dev/nst0&lt;br /&gt;
        tar: /dev/nst0: Cannot read: Cannot allocate memory&lt;br /&gt;
        tar: At beginning of tape, quitting now&lt;br /&gt;
        tar: Error is not recoverable: exiting now&lt;br /&gt;
&lt;br /&gt;
     However this is easily fixed with the correct blocking factor&lt;br /&gt;
&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ tar -t --blocking-factor=128 --file=/dev/nst0&lt;br /&gt;
         temp label&lt;br /&gt;
         Notes&lt;br /&gt;
&lt;br /&gt;
     Take advantage of the label command.&lt;br /&gt;
&lt;br /&gt;
         $ MYCOMMENTS=&amp;quot;Big_important_tape&amp;quot;&lt;br /&gt;
         $ tar --label=&amp;quot;$(date +%F)&amp;quot;+&amp;quot;${MYCOMMENTS}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Writing to tape on a remote 192.168.1.155 computer&lt;br /&gt;
&lt;br /&gt;
         $ tar cvzf - ./tmp | ssh -l chirico 192.168.1.155 '(mt -f /dev/nst0 rewind; dd of=/dev/st0 )'&lt;br /&gt;
&lt;br /&gt;
     Restoring the contents from tape on a remote computer&lt;br /&gt;
&lt;br /&gt;
         $ ssh -l chirico 192.168.1.155 '(mt -f /dev/nst0 rewind; dd if=/dev/st0  )'|tar xzf -&lt;br /&gt;
&lt;br /&gt;
     Getting data off of tape with dd command with odd blocking factor. Just set ibs very high&lt;br /&gt;
&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ tar --label=&amp;quot;Contenets of Notes&amp;quot; --create  --blocking-factor=128 --file=/dev/nst0 Notes&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ dd ibs=1048576 if=/dev/st0 of=notes.tar&lt;br /&gt;
&lt;br /&gt;
     The above will probably work with ibs=64k as well&lt;br /&gt;
&lt;br /&gt;
        (Also see TIP 136)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 18:&lt;br /&gt;
&lt;br /&gt;
     Encrypting Data to Tape using &amp;quot;tar&amp;quot; and &amp;quot;openssl&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     The following shows an example of writing the contents of &amp;quot;tapetest&amp;quot; to tape:&lt;br /&gt;
&lt;br /&gt;
        $ tar zcvf - tapetest|openssl des3 -salt  -k secretpassword | dd of=/dev/st0&lt;br /&gt;
&lt;br /&gt;
     Reading the data back:&lt;br /&gt;
&lt;br /&gt;
        $ dd if=/dev/st0|openssl des3 -d -k secretpassword|tar xzf -&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 19:&lt;br /&gt;
&lt;br /&gt;
     Mounting an ISO Image as a Filesystem -- this is great if you don't have the DVD&lt;br /&gt;
         hardware, but, need to get at the data.  The following show an example of&lt;br /&gt;
         mounting the Fedora core 2 as a file.&lt;br /&gt;
&lt;br /&gt;
         $ mkdir /iso0&lt;br /&gt;
         $ mount -o loop -t iso9660 /FC2-i386-DVD.iso  /iso0&lt;br /&gt;
&lt;br /&gt;
     Or to mount automatically at boot, add the following to &amp;quot;/etc/fstab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         /FC2-i386-DVD.iso /iso0     iso9660 rw,loop  0 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Reference: http://umn.dl.sourceforge.net/sourceforge/souptonuts/README_fedora.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 20:&lt;br /&gt;
&lt;br /&gt;
     Getting Information about the Hard drive and list all PCI devices.&lt;br /&gt;
&lt;br /&gt;
                $ hdparm /dev/hda&lt;br /&gt;
&lt;br /&gt;
                  /dev/hda:&lt;br /&gt;
                   multcount    = 16 (on)&lt;br /&gt;
                   IO_support   =  0 (default 16-bit)&lt;br /&gt;
                   unmaskirq    =  0 (off)&lt;br /&gt;
                   using_dma    =  1 (on)&lt;br /&gt;
                   keepsettings =  0 (off)&lt;br /&gt;
                   readonly     =  0 (off)&lt;br /&gt;
                   readahead    = 256 (on)&lt;br /&gt;
                   geometry     = 16383/255/63, sectors = 234375000, start = 0&lt;br /&gt;
&lt;br /&gt;
            or for SCSI&lt;br /&gt;
&lt;br /&gt;
                $ hdparm /dev/sda&lt;br /&gt;
&lt;br /&gt;
            Try it with the -i option for information&lt;br /&gt;
&lt;br /&gt;
                $ hdparm -i /dev/hda&lt;br /&gt;
&lt;br /&gt;
                /dev/hda:&lt;br /&gt;
&lt;br /&gt;
                Model=IC35L120AVV207-1, FwRev=V24OA66A, SerialNo=VNVD09G4CZ6E0T&lt;br /&gt;
                Config={ HardSect NotMFM HdSw&amp;gt;15uSec Fixed DTR&amp;gt;10Mbs }&lt;br /&gt;
                RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=52&lt;br /&gt;
                BuffType=DualPortCache, BuffSize=7965kB, MaxMultSect=16, MultSect=16&lt;br /&gt;
                CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=234375000&lt;br /&gt;
                IORDY=on/off, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}&lt;br /&gt;
                PIO modes:  pio0 pio1 pio2 pio3 pio4&lt;br /&gt;
                DMA modes:  mdma0 mdma1 mdma2&lt;br /&gt;
                UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5&lt;br /&gt;
                AdvancedPM=yes: disabled (255) WriteCache=enabled&lt;br /&gt;
                Drive conforms to: ATA/ATAPI-6 T13 1410D revision 3a:  2 3 4 5 6&lt;br /&gt;
&lt;br /&gt;
            How fast is your drive?&lt;br /&gt;
&lt;br /&gt;
                $ hdparm -tT /dev/hda&lt;br /&gt;
&lt;br /&gt;
                /dev/hda:&lt;br /&gt;
                Timing buffer-cache reads:   128 MB in  0.41 seconds =315.32 MB/sec&lt;br /&gt;
                Timing buffered disk reads:  64 MB in  1.19 seconds = 53.65 MB/sec&lt;br /&gt;
&lt;br /&gt;
            Need to find your device?&lt;br /&gt;
&lt;br /&gt;
                $ mount&lt;br /&gt;
                   or&lt;br /&gt;
                $ cat /proc/partitions&lt;br /&gt;
                   or&lt;br /&gt;
                $ dmesg | egrep '^(s|h)d'&lt;br /&gt;
&lt;br /&gt;
                   which for my system lists:&lt;br /&gt;
&lt;br /&gt;
                      hda: IC35L120AVV207-1, ATA DISK drive&lt;br /&gt;
                      hdc: Lite-On LTN486S 48x Max, ATAPI CD/DVD-ROM drive&lt;br /&gt;
                      hda: max request size: 1024KiB&lt;br /&gt;
                      hda: 234375000 sectors (120000 MB) w/7965KiB Cache, CHS=16383/255/63, UDMA(100)&lt;br /&gt;
&lt;br /&gt;
             By the way, if you want to turn on dma&lt;br /&gt;
&lt;br /&gt;
                 $ hdparm -d1 /dev/hda&lt;br /&gt;
                   setting using_dma to 1 (on)&lt;br /&gt;
                   using_dma    =  1 (on)&lt;br /&gt;
&lt;br /&gt;
         (Also see TIP 122 )&lt;br /&gt;
&lt;br /&gt;
     List all PCI devices&lt;br /&gt;
&lt;br /&gt;
                $ lspci -v&lt;br /&gt;
&lt;br /&gt;
          00:00.0 Host bridge: Intel Corp. 82845G/GL [Brookdale-G] Chipset Host Bridge (rev&lt;br /&gt;
                  Subsystem: Dell Computer Corporation: Unknown device 0160&lt;br /&gt;
                  Flags: bus master, fast devsel, latency 0&lt;br /&gt;
                  Memory at f0000000 (32-bit, prefetchable) [size=128M]&lt;br /&gt;
                  Capabilities: &amp;lt;available only to root&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              ... lots more ...&lt;br /&gt;
&lt;br /&gt;
           Note, there is also lspci -vv for even more information.&lt;br /&gt;
&lt;br /&gt;
          (Also see TIP 200)&lt;br /&gt;
&lt;br /&gt;
TIP 21:&lt;br /&gt;
&lt;br /&gt;
     Setting up &amp;quot;cron&amp;quot; Jobs.&lt;br /&gt;
&lt;br /&gt;
     If you want to use the emacs editor for editing cron jobs, then,&lt;br /&gt;
     set the following in your &amp;quot;/home/user/.bash_profile&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        EDITOR=emacs&lt;br /&gt;
&lt;br /&gt;
     Then, to edit cron jobs&lt;br /&gt;
&lt;br /&gt;
        $ crontab -e&lt;br /&gt;
&lt;br /&gt;
     You may want to put in the following header&lt;br /&gt;
&lt;br /&gt;
        #MINUTE(0-59) HOUR(0-23) DAYOFMONTH(1-31) MONTHOFYEAR(1-12) DAYOFWEEK(0-6) Note 0=Sun and 7=Sun&lt;br /&gt;
        #&lt;br /&gt;
        #14,15 10 * * 0   /usr/bin/somecommmand  &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     The sample &amp;quot;commented out command&amp;quot; will run at 10:14 and 10:15 every Sunday.  There will&lt;br /&gt;
     be no &amp;quot;mail&amp;quot; sent to the user because of the &amp;quot;&amp;gt;/dev/null 2&amp;gt;&amp;amp;1&amp;quot; entry.&lt;br /&gt;
&lt;br /&gt;
        $ crontab -l&lt;br /&gt;
&lt;br /&gt;
     The above will list all cron jobs. Or if you're root&lt;br /&gt;
&lt;br /&gt;
        $ crontab -l -u &amp;lt;username&amp;gt;&lt;br /&gt;
        $ crontab -e -u &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Reference &amp;quot;man 5 crontab&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
        The time and date fields are:&lt;br /&gt;
&lt;br /&gt;
                     field          allowed values&lt;br /&gt;
                     -----          --------------&lt;br /&gt;
                     minute         0-59&lt;br /&gt;
                     hour           0-23&lt;br /&gt;
                     day of month   1-31&lt;br /&gt;
                     month          1-12 (or names, see below)&lt;br /&gt;
                     day of week    0-7 (0 or 7 is Sun, or use names)&lt;br /&gt;
&lt;br /&gt;
              A field may be an asterisk (*), which always stands for ``first-last''.&lt;br /&gt;
&lt;br /&gt;
              Ranges of numbers are allowed.  Ranges are two numbers separated with a&lt;br /&gt;
              hyphen.   The  specified  range is inclusive.  For example, 8-11 for an&lt;br /&gt;
              ``hours'' entry specifies execution at hours 8, 9, 10 and 11.&lt;br /&gt;
&lt;br /&gt;
              Lists are allowed.  A list is a set of numbers (or ranges) separated by&lt;br /&gt;
              commas.  Examples: ``1,2,5,9'', ``0-4,8-12''.&lt;br /&gt;
&lt;br /&gt;
              Ranges can include &amp;quot;steps&amp;quot;, so &amp;quot;1-9/2&amp;quot; is the same as &amp;quot;1,3,5,7,9&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Note, you can run just every 5 minutes as follows:&lt;br /&gt;
&lt;br /&gt;
              */5 * * * * /etc/mrtg/domrtg  &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     To run jobs hourly,daily,weekly or monthly you can add shell scripts into the&lt;br /&gt;
     appropriate directory:&lt;br /&gt;
&lt;br /&gt;
             /etc/cron.hourly/&lt;br /&gt;
             /etc/cron.daily/&lt;br /&gt;
             /etc/cron.weekly/&lt;br /&gt;
             /etc/cron.monthly/&lt;br /&gt;
&lt;br /&gt;
     Note that the above are pre-configured schedules set in &amp;quot;/etc/crontab&amp;quot;, so&lt;br /&gt;
     if you want, you can change the schedule. Below is my /etc/crontab:&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/crontab&lt;br /&gt;
           SHELL=/bin/bash&lt;br /&gt;
           PATH=/sbin:/bin:/usr/sbin:/usr/bin&lt;br /&gt;
           MAILTO=root&lt;br /&gt;
           HOME=/&lt;br /&gt;
&lt;br /&gt;
           # run-parts&lt;br /&gt;
           01 * * * * root run-parts /etc/cron.hourly&lt;br /&gt;
           02 4 * * * root run-parts /etc/cron.daily&lt;br /&gt;
           22 4 * * 0 root run-parts /etc/cron.weekly&lt;br /&gt;
           42 4 1 * * root run-parts /etc/cron.monthly&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 22:&lt;br /&gt;
&lt;br /&gt;
     Keeping Files in Sync Between Servers.&lt;br /&gt;
&lt;br /&gt;
     The remote computer is &amp;quot;192.168.1.171&amp;quot; and has the account &amp;quot;donkey&amp;quot;.  You want&lt;br /&gt;
     to &amp;quot;keep in sync&amp;quot; the files under &amp;quot;/home/cu2000/Logs&amp;quot; on the remote computer&lt;br /&gt;
     with files on &amp;quot;/home/chirico/dev/MEDIA_Server&amp;quot; on the local computer.&lt;br /&gt;
&lt;br /&gt;
       $ rsync  -Lae ssh  donkey@192.168.1.171:/home/cu2000/Logs /home/chirico/dev/MEDIA_Server&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;rsync&amp;quot; is a convient command for keeping files in sync, and as shown here will work&lt;br /&gt;
     through ssh.  The -L option tells rsync to treat symbolic links like ordinary files.&lt;br /&gt;
&lt;br /&gt;
        Also see [http://www.rsnapshot.org/]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 23:&lt;br /&gt;
&lt;br /&gt;
     Looking up the Spelling of a Word.&lt;br /&gt;
&lt;br /&gt;
        $ look &amp;lt;partial spelling&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     so the following will list all words that&lt;br /&gt;
     start with stuff&lt;br /&gt;
&lt;br /&gt;
        $ look stuff&lt;br /&gt;
           stuff&lt;br /&gt;
           stuffage&lt;br /&gt;
           stuffata&lt;br /&gt;
           stuffed&lt;br /&gt;
           stuffender&lt;br /&gt;
           stuffer&lt;br /&gt;
           stuffers&lt;br /&gt;
           stuffgownsman&lt;br /&gt;
           stuffier&lt;br /&gt;
           stuffiest&lt;br /&gt;
           stuffily&lt;br /&gt;
           stuffiness&lt;br /&gt;
           stuffinesses&lt;br /&gt;
           stuffiness's&lt;br /&gt;
           stuffing&lt;br /&gt;
           stuffings&lt;br /&gt;
           stuffing's&lt;br /&gt;
           stuffless&lt;br /&gt;
           stuffs&lt;br /&gt;
           stuffy&lt;br /&gt;
&lt;br /&gt;
     It helps to have a large &amp;quot;linuxwords&amp;quot; dictionary.  You can download&lt;br /&gt;
     a much bigger dictionary from the following:&lt;br /&gt;
&lt;br /&gt;
              http://prdownloads.sourceforge.net/souptonuts/linuxwords.1.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
     Note: vim users can setup the .vimrc file with the following. Now when you type &lt;br /&gt;
       CTL-X CTL-T in insert mode, you'll get a thesaurus lookup.&lt;br /&gt;
&lt;br /&gt;
           set dictionary+=/usr/share/dict/words&lt;br /&gt;
           set thesaurus+=/usr/share/dict/words&lt;br /&gt;
&lt;br /&gt;
     Or, you can call aspell with the F6 command after putting the folling entry in your&lt;br /&gt;
     .vimrc file&lt;br /&gt;
&lt;br /&gt;
           :nmap &amp;lt;F6&amp;gt; :w&amp;lt;CR&amp;gt;:!aspell -e -c %&amp;lt;CR&amp;gt;:e&amp;lt;CR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Now, hit F6 when you're in vim, and you'll get a spell checker.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     There is also an X Windows dictionary that runs with the following command.&lt;br /&gt;
&lt;br /&gt;
           $ gnome-dictionary&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 24:&lt;br /&gt;
&lt;br /&gt;
     Find out if a Command is Aliased.&lt;br /&gt;
&lt;br /&gt;
         $ type -all &amp;lt;command&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Example:&lt;br /&gt;
&lt;br /&gt;
         $ type -all ls&lt;br /&gt;
            ls is aliased to `ls --color=tty'&lt;br /&gt;
            ls is /bin/ls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 25:&lt;br /&gt;
&lt;br /&gt;
     Create a Terminal Calculator&lt;br /&gt;
&lt;br /&gt;
      Put the following in your .bashrc file&lt;br /&gt;
&lt;br /&gt;
            function calc&lt;br /&gt;
            {&lt;br /&gt;
             echo &amp;quot;${1}&amp;quot;|bc -l;&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
      Or, run it at the shell prompt. Now&lt;br /&gt;
      &amp;quot;calc&amp;quot; from the shell will work as follows:&lt;br /&gt;
&lt;br /&gt;
            $ calc 3+45&lt;br /&gt;
               48&lt;br /&gt;
&lt;br /&gt;
      All functions  with a &amp;quot;(&amp;quot; or &amp;quot;)&amp;quot; must be enclosed&lt;br /&gt;
      in quotes.  For instance, to get the sin of .4&lt;br /&gt;
&lt;br /&gt;
            $ calc &amp;quot;s(.4)&amp;quot;&lt;br /&gt;
              .38941834230865049166&lt;br /&gt;
&lt;br /&gt;
          (See TIP 115 using the expr command)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 26:&lt;br /&gt;
&lt;br /&gt;
     Kill a User and All Their Current Processes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        #  This program will kill all processes from a&lt;br /&gt;
        #  user.  The user name is read from the command line.&lt;br /&gt;
        #&lt;br /&gt;
        #  This program also demonstrates reading a bash variable&lt;br /&gt;
        #  into an awk script.&lt;br /&gt;
        #&lt;br /&gt;
        #  Usage: kill9user &amp;lt;user&amp;gt;&lt;br /&gt;
        #&lt;br /&gt;
        kill -9 `ps aux|awk -v var=$1 '$1==var { print $2 }'`&lt;br /&gt;
&lt;br /&gt;
    or if you want want to create the above script the command&lt;br /&gt;
    below will kill the user &amp;quot;donkey&amp;quot; and all of his processes.&lt;br /&gt;
&lt;br /&gt;
        $ kill -9 `ps aux|awk -v var=&amp;quot;donkey&amp;quot; '$1==var { print $2 }'`&lt;br /&gt;
&lt;br /&gt;
    Check their cron jobs and &amp;quot;at&amp;quot; jobs, if you have a security issue.&lt;br /&gt;
&lt;br /&gt;
          $ crontab -u &amp;lt;user&amp;gt; -e&lt;br /&gt;
&lt;br /&gt;
    Lock the account:&lt;br /&gt;
&lt;br /&gt;
          $ passwd -l &amp;lt;user&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Remove all authorized_keys&lt;br /&gt;
&lt;br /&gt;
          $ rm /home/user/.shosts&lt;br /&gt;
          $ rm /home/user/.rhosts&lt;br /&gt;
          $ rm -rf /home/user/.ssh&lt;br /&gt;
          $ rm /home/user/.forward&lt;br /&gt;
&lt;br /&gt;
      or consider&lt;br /&gt;
&lt;br /&gt;
          $ mv /home/user  /home/safeuser&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Change the shell&lt;br /&gt;
&lt;br /&gt;
          $ chsh -s /bin/true &amp;lt;user&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Do an inventory&lt;br /&gt;
&lt;br /&gt;
          $ find / -user &amp;lt;user&amp;gt;  &amp;gt; list_of_user_files&lt;br /&gt;
&lt;br /&gt;
    NOTE: Also see (TIP 10).&lt;br /&gt;
&lt;br /&gt;
    To see all users, except the current user. Do not use the&lt;br /&gt;
    dash &amp;quot;ps -aux&amp;quot; is wrong but the following is correct:&lt;br /&gt;
&lt;br /&gt;
          $ ps aux| awk '!/'${USER}'/{printf(&amp;quot;%s \n&amp;quot;,$0)}'&lt;br /&gt;
&lt;br /&gt;
     or (ww = wide, wide output)&lt;br /&gt;
&lt;br /&gt;
          $ ps auwwx| awk '!/'${USER}'/{printf(&amp;quot;%s \n&amp;quot;,$0)}'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    The following codes may be useful:&lt;br /&gt;
&lt;br /&gt;
       D    Uninterruptible sleep (usually IO)&lt;br /&gt;
       R    Running or runnable (on run queue)&lt;br /&gt;
       S    Interruptible sleep (waiting for an event to complete)&lt;br /&gt;
       T    Stopped, either by a job control signal or because it is being traced.&lt;br /&gt;
       W    paging (not valid since the 2.6.xx kernel)&lt;br /&gt;
       X    dead (should never be seen)&lt;br /&gt;
       Z    Defunct (&amp;quot;zombie&amp;quot;) process, terminated but not reaped by its parent.&lt;br /&gt;
&lt;br /&gt;
    For BSD formats and when the stat keyword is used, additional&lt;br /&gt;
       characters may be displayed:&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;    high-priority (not nice to other users)&lt;br /&gt;
       N    low-priority (nice to other users)&lt;br /&gt;
       L    has pages locked into memory (for real-time and custom IO)&lt;br /&gt;
       s    is a session leader&lt;br /&gt;
       l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)&lt;br /&gt;
       +    is in the foreground process group&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Also see TIP 28. and TIP 89.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 27:&lt;br /&gt;
&lt;br /&gt;
     Format Dates for Logs and Files&lt;br /&gt;
&lt;br /&gt;
         $ date &amp;quot;+%m%d%y %A,%B %d %Y %X&amp;quot;&lt;br /&gt;
             061704 Thursday,June 17 2004 07:13:40 PM&lt;br /&gt;
&lt;br /&gt;
         $ date &amp;quot;+%m%d%Y&amp;quot;&lt;br /&gt;
             06172004&lt;br /&gt;
&lt;br /&gt;
         $ date -d '1 day ago' &amp;quot;+%m%d%Y&amp;quot;&lt;br /&gt;
             06162004&lt;br /&gt;
&lt;br /&gt;
         $ date -d '3 months 1 day  2 hour  15 minutes 2 seconds ago'&lt;br /&gt;
&lt;br /&gt;
      or to go into the future remove the &amp;quot;ago&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         $ date -d '3 months 1 day  2 hour  15 minutes 2 seconds '&lt;br /&gt;
&lt;br /&gt;
            Also the following works:&lt;br /&gt;
&lt;br /&gt;
                $ date -d '+2 year +1 month -1 week  +3 day -8 hour +2 min -5 seconds'&lt;br /&gt;
&lt;br /&gt;
      Quick question: If there are 100,000,000 stars in the visible sky, and you can&lt;br /&gt;
      count them, round the clock, at a rate of a star per second starting now, when&lt;br /&gt;
      would you finish counting?  Would you still be alive?&lt;br /&gt;
&lt;br /&gt;
                $ date -d '+100000000 seconds'&lt;br /&gt;
&lt;br /&gt;
      Sooner than you think!&lt;br /&gt;
&lt;br /&gt;
      This can be assigned to variables&lt;br /&gt;
&lt;br /&gt;
         $ mdate=`date -d '3 months 1 day  2 hour  15 minutes 2 seconds ' &amp;quot;+%m%d%Y_%A_%B_%D_%Y_%X&amp;quot;  `&lt;br /&gt;
         $ echo $mdate&lt;br /&gt;
             09182004_Saturday_September_09/18/04_2004_09:40:41 PM&lt;br /&gt;
             ^---- Easy to sort   ^-------^----- Easy to read&lt;br /&gt;
&lt;br /&gt;
      See TIP 28 below.&lt;br /&gt;
&lt;br /&gt;
      See TIP 87 when working with large delta time changes -40 years, or -200 years ago, or even&lt;br /&gt;
      1,000,000 days into the future.&lt;br /&gt;
&lt;br /&gt;
      Also see (TIP 1) for working with time zones.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 28:&lt;br /&gt;
&lt;br /&gt;
     Need Ascii Codes? For instance, for printing quotes:&lt;br /&gt;
&lt;br /&gt;
                         awk 'BEGIN { msg = &amp;quot;Don\047t Panic!&amp;quot;; printf &amp;quot;%s \n&amp;quot;,msg }'&lt;br /&gt;
              or&lt;br /&gt;
                         awk 'BEGIN { msg = &amp;quot;Don\x027t Panic!&amp;quot;; printf &amp;quot;%s \n&amp;quot;,msg }'&lt;br /&gt;
&lt;br /&gt;
     It's better to use \047, because certain characters that follow \x027 may cause problems.&lt;br /&gt;
&lt;br /&gt;
     For example, take a look at the following two lines. The first line prints a &amp;quot;}&amp;quot; caused&lt;br /&gt;
     by the extra D in \x027D. The the line immediately below does not work as expected.&lt;br /&gt;
&lt;br /&gt;
                      awk 'BEGIN {printf(&amp;quot;The D causes problems \x027D\n&amp;quot;)}'&lt;br /&gt;
&lt;br /&gt;
            However, the line below works fine:&lt;br /&gt;
&lt;br /&gt;
                      awk 'BEGIN {printf(&amp;quot;The D does not cause problems \047D\n&amp;quot;)}'&lt;br /&gt;
&lt;br /&gt;
     Or if you wanted to use the date command in &amp;quot;awk&amp;quot; to print date.time.nanosecond.timezone for&lt;br /&gt;
     each line of a file &amp;quot;test&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     The following date can be used in awk because the single quotes are enclosed within the&lt;br /&gt;
     double quotes.&lt;br /&gt;
&lt;br /&gt;
             date '+%m%d%Y.%H%M%S.%N%z'&lt;br /&gt;
&lt;br /&gt;
       $ awk 'BEGIN { &amp;quot;date '+%m%d%Y.%H%M%S.%N%z'&amp;quot; | getline MyDate  } { print MyDate,$0 }' &amp;lt; data&lt;br /&gt;
&lt;br /&gt;
     But it's also possible to replace  &amp;quot;+&amp;quot;  with  \x2B,  &amp;quot;%&amp;quot; with \x25, and &amp;quot;d&amp;quot; with \x64 as follows:&lt;br /&gt;
&lt;br /&gt;
       $ awk 'BEGIN { &amp;quot;date \x27\x2B\x25m\x25\x64\x25Y.\x25H\x25M\x25S.\x25N\x25z\x27&amp;quot; | getline MyDate  } { print MyDate,$0 }' &amp;lt; test&lt;br /&gt;
&lt;br /&gt;
             07062004.113820.346033000-0400 bob 71&lt;br /&gt;
             07062004.113820.346033000-0400 tom 43&lt;br /&gt;
             07062004.113820.346033000-0400 sal 34&lt;br /&gt;
             07062004.113820.346033000-0400 bob 89&lt;br /&gt;
             07062004.113820.346033000-0400 tom 66&lt;br /&gt;
             07062004.113820.346033000-0400 sal 99&lt;br /&gt;
&lt;br /&gt;
     For this example it's not needed because single quotes are used inside of double quotes; however, there may be times when&lt;br /&gt;
     hex replacement is easier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ man ascii&lt;br /&gt;
&lt;br /&gt;
        Oct   Dec   Hex   Char           Oct   Dec   Hex   Char&lt;br /&gt;
            -----------------------------------------------------------&lt;br /&gt;
            000   0     00    NUL '\0'       100   64    40    @&lt;br /&gt;
            001   1     01    SOH            101   65    41    A&lt;br /&gt;
            002   2     02    STX            102   66    42    B&lt;br /&gt;
            003   3     03    ETX            103   67    43    C&lt;br /&gt;
            004   4     04    EOT            104   68    44    D&lt;br /&gt;
            005   5     05    ENQ            105   69    45    E&lt;br /&gt;
            006   6     06    ACK            106   70    46    F&lt;br /&gt;
            007   7     07    BEL '\a'       107   71    47    G&lt;br /&gt;
            010   8     08    BS  '\b'       110   72    48    H&lt;br /&gt;
            011   9     09    HT  '\t'       111   73    49    I&lt;br /&gt;
            012   10    0A    LF  '\n'       112   74    4A    J&lt;br /&gt;
            013   11    0B    VT  '\v'       113   75    4B    K&lt;br /&gt;
            014   12    0C    FF  '\f'       114   76    4C    L&lt;br /&gt;
            015   13    0D    CR  '\r'       115   77    4D    M&lt;br /&gt;
            016   14    0E    SO             116   78    4E    N&lt;br /&gt;
            017   15    0F    SI             117   79    4F    O&lt;br /&gt;
            020   16    10    DLE            120   80    50    P&lt;br /&gt;
            021   17    11    DC1            121   81    51    Q&lt;br /&gt;
            022   18    12    DC2            122   82    52    R&lt;br /&gt;
            023   19    13    DC3            123   83    53    S&lt;br /&gt;
            024   20    14    DC4            124   84    54    T&lt;br /&gt;
            025   21    15    NAK            125   85    55    U&lt;br /&gt;
            026   22    16    SYN            126   86    56    V&lt;br /&gt;
            027   23    17    ETB            127   87    57    W&lt;br /&gt;
            030   24    18    CAN            130   88    58    X&lt;br /&gt;
            031   25    19    EM             131   89    59    Y&lt;br /&gt;
            032   26    1A    SUB            132   90    5A    Z&lt;br /&gt;
            033   27    1B    ESC            133   91    5B    [&lt;br /&gt;
            034   28    1C    FS             134   92    5C    \   '\\'&lt;br /&gt;
            035   29    1D    GS             135   93    5D    ]&lt;br /&gt;
            036   30    1E    RS             136   94    5E    ^&lt;br /&gt;
            037   31    1F    US             137   95    5F    _&lt;br /&gt;
            040   32    20    SPACE          140   96    60    `&lt;br /&gt;
            041   33    21    !              141   97    61    a&lt;br /&gt;
            042   34    22    &amp;quot;              142   98    62    b&lt;br /&gt;
            043   35    23    #              143   99    63    c&lt;br /&gt;
            044   36    24    $              144   100   64    d&lt;br /&gt;
            045   37    25    %              145   101   65    e&lt;br /&gt;
            046   38    26    &amp;amp;              146   102   66    f&lt;br /&gt;
            047   39    27    '              147   103   67    g&lt;br /&gt;
            050   40    28    (              150   104   68    h&lt;br /&gt;
            051   41    29    )              151   105   69    i&lt;br /&gt;
            052   42    2A    *              152   106   6A    j&lt;br /&gt;
            053   43    2B    +              153   107   6B    k&lt;br /&gt;
            054   44    2C    ,              154   108   6C    l&lt;br /&gt;
            055   45    2D    -              155   109   6D    m&lt;br /&gt;
            056   46    2E    .              156   110   6E    n&lt;br /&gt;
            057   47    2F    /              157   111   6F    o&lt;br /&gt;
            060   48    30    0              160   112   70    p&lt;br /&gt;
            061   49    31    1              161   113   71    q&lt;br /&gt;
            062   50    32    2              162   114   72    r&lt;br /&gt;
            063   51    33    3              163   115   73    s&lt;br /&gt;
            064   52    34    4              164   116   74    t&lt;br /&gt;
            065   53    35    5              165   117   75    u&lt;br /&gt;
            066   54    36    6              166   118   76    v&lt;br /&gt;
            067   55    37    7              167   119   77    w&lt;br /&gt;
            070   56    38    8              170   120   78    x&lt;br /&gt;
            071   57    39    9              171   121   79    y&lt;br /&gt;
            072   58    3A    :              172   122   7A    z&lt;br /&gt;
            073   59    3B    ;              173   123   7B    {&lt;br /&gt;
            074   60    3C    &amp;lt;              174   124   7C    |&lt;br /&gt;
            075   61    3D    =              175   125   7D    }&lt;br /&gt;
            076   62    3E    &amp;gt;              176   126   7E    ~&lt;br /&gt;
            077   63    3F    ?              177   127   7F    DEL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 29:&lt;br /&gt;
&lt;br /&gt;
     Need a WWW Browser for the Terminal Session? Try lynx or elinks.&lt;br /&gt;
&lt;br /&gt;
         $ lynx&lt;br /&gt;
&lt;br /&gt;
     Or to read all these tips, with the latest updates&lt;br /&gt;
&lt;br /&gt;
      $ lynx http://umn.dl.sourceforge.net/sourceforge/souptonuts/How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Or, better yet elinks.&lt;br /&gt;
&lt;br /&gt;
         $ elinks http://somepage.&lt;br /&gt;
&lt;br /&gt;
     You can get elinks at the following site:&lt;br /&gt;
&lt;br /&gt;
             http://elinks.or.cz/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 30:&lt;br /&gt;
&lt;br /&gt;
    screen - screen manager with VT100/ANSI terminal emulation&lt;br /&gt;
&lt;br /&gt;
         This is an excellent utility. But if you work a lot in Emacs,&lt;br /&gt;
         then, you should place the following in your ~./.bashrc&lt;br /&gt;
&lt;br /&gt;
             alias s='screen -e^Pa -D -R'&lt;br /&gt;
&lt;br /&gt;
         After loging in again (or source .bashrc) ,&lt;br /&gt;
         type the following to load &amp;quot;screen&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
             $ s&lt;br /&gt;
&lt;br /&gt;
         If you're using the not using the alias command above, substitute&lt;br /&gt;
         CTL-a for CTL-p below. :&lt;br /&gt;
&lt;br /&gt;
             CTL-p CTL-C       To get a new session&lt;br /&gt;
             CTL-p  &amp;quot;           To list sessions, and arrow keys to move&lt;br /&gt;
             CTL-p SHFT-A      To name sessions&lt;br /&gt;
             CTL-p S            To split screens&lt;br /&gt;
             CLT-p Q            To unsplit screens&lt;br /&gt;
             CLT-p TAB          To switch between screens&lt;br /&gt;
             CLT-p :resize n    To resize screen to n rows, on split screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Screen is very powerful.  Should you become disconneced, you can&lt;br /&gt;
         still resume work after loggin in.&lt;br /&gt;
&lt;br /&gt;
             $ man screen&lt;br /&gt;
&lt;br /&gt;
         The above command will give you more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 31:&lt;br /&gt;
&lt;br /&gt;
     Need to Find the Factors of a Number?&lt;br /&gt;
&lt;br /&gt;
           $ factor 2345678992&lt;br /&gt;
                2345678992: 2 2 2 2 6581 22277&lt;br /&gt;
&lt;br /&gt;
     It's a quick way to find out if a number is prime&lt;br /&gt;
&lt;br /&gt;
           $ factor 7867&lt;br /&gt;
                7867: 7867&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 32:&lt;br /&gt;
&lt;br /&gt;
     Less is More -- piping to less to scroll backword and forward&lt;br /&gt;
&lt;br /&gt;
      For large &amp;quot;ls&amp;quot; listings try the followin, then, use the arrow key&lt;br /&gt;
      to move up and down the list.&lt;br /&gt;
&lt;br /&gt;
           $ ls /some_large_dir/ | less&lt;br /&gt;
&lt;br /&gt;
                 or&lt;br /&gt;
&lt;br /&gt;
           $ cat some_large_file | less&lt;br /&gt;
&lt;br /&gt;
                 or&lt;br /&gt;
&lt;br /&gt;
           $ less some_large_file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 33:&lt;br /&gt;
&lt;br /&gt;
     C &amp;quot;indent&amp;quot; Settings for Kernel Development&lt;br /&gt;
&lt;br /&gt;
           $ indent -kr -i8  program.c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 34:&lt;br /&gt;
&lt;br /&gt;
     FTP auto-login.  &amp;quot;ftp&amp;quot; to a site and have the password stored.&lt;br /&gt;
&lt;br /&gt;
     For instance, here's a sample &amp;quot;.net&amp;quot; file in a user's home&lt;br /&gt;
     directory for uploading to sourceforge. Note, sourceforge will&lt;br /&gt;
     take any password, so m@temp.com is used here for login &amp;quot;anonymous&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ cat ~/.netrc&lt;br /&gt;
               machine upload.sourceforge.net login anonymous password m@temp.com&lt;br /&gt;
               default login anonymous password user@site&lt;br /&gt;
&lt;br /&gt;
     It might be a good idea to change the rights on this file&lt;br /&gt;
&lt;br /&gt;
           $ chmod 0400 ~/.netrc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         #!/bin/bash&lt;br /&gt;
         #&lt;br /&gt;
         #  Sample ftp automated script to download&lt;br /&gt;
         #  file to ${dwnld}&lt;br /&gt;
         #&lt;br /&gt;
         dwnld=&amp;quot;/work/faq/unix-faq&amp;quot;&lt;br /&gt;
         cd ${dwnld}&lt;br /&gt;
         ftp &amp;lt;&amp;lt; FTPSTRING&lt;br /&gt;
         prompt off&lt;br /&gt;
         open rtfm.mit.edu&lt;br /&gt;
         cd /pub/usenet-by-group/news.answers/unix-faq/faq&lt;br /&gt;
         mget contents&lt;br /&gt;
         mget diff&lt;br /&gt;
         mget part*&lt;br /&gt;
         bye&lt;br /&gt;
         FTPSTRING&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      (Also see TIP 114 for ncftpget, which is a very powerful restarting&lt;br /&gt;
                            ftp program)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 35:&lt;br /&gt;
&lt;br /&gt;
     Bash Brace Expansion&lt;br /&gt;
&lt;br /&gt;
           $ echo f{ee,ie,oe,um}&lt;br /&gt;
                fee fie foe fum&lt;br /&gt;
&lt;br /&gt;
     This works with almost any command&lt;br /&gt;
&lt;br /&gt;
           $ mkdir -p /work/junk/{one,two,three,four}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 36:&lt;br /&gt;
&lt;br /&gt;
     Getting a List of Users on the System&lt;br /&gt;
&lt;br /&gt;
           $ cut -d: -f1 /etc/passwd | sort&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 37:&lt;br /&gt;
&lt;br /&gt;
     Editing a Bash Command&lt;br /&gt;
&lt;br /&gt;
      Try typing a long command say, then, type &amp;quot;fc&amp;quot; for an easy way&lt;br /&gt;
      to edit the command.&lt;br /&gt;
&lt;br /&gt;
           $ find /etc -iname '*.cnf' -exec grep -H 'log' {} \;&lt;br /&gt;
           $ fc&lt;br /&gt;
&lt;br /&gt;
      &amp;quot;fc&amp;quot; will bring the last command typed into an editor, &amp;quot;emacs&amp;quot; if&lt;br /&gt;
      that's the default editor. Type &amp;quot;fc -l&amp;quot; to list last few commands.&lt;br /&gt;
&lt;br /&gt;
      To seach for a command, try typing &amp;quot;CTL-r&amp;quot; at the shell prompt for&lt;br /&gt;
      searching. &amp;quot;CTL-t&amp;quot; to transpose, say &amp;quot;sl&amp;quot; was typed by you want &amp;quot;ls&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Hints when using &amp;quot;fc: in emacs:&lt;br /&gt;
&lt;br /&gt;
           ESC-b     move one word backward&lt;br /&gt;
           ESC-f     move one word forward&lt;br /&gt;
           ESC-DEL   kill one word backward&lt;br /&gt;
           CTL-k     kill point to end&lt;br /&gt;
           CTL-y     un-yank killed region at point&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 38:&lt;br /&gt;
&lt;br /&gt;
     Moving around Directories.&lt;br /&gt;
&lt;br /&gt;
     Change to the home directory:&lt;br /&gt;
          $ cd ~&lt;br /&gt;
            or&lt;br /&gt;
          $ cd&lt;br /&gt;
&lt;br /&gt;
     To go back to the last directory&lt;br /&gt;
          $ cd -&lt;br /&gt;
&lt;br /&gt;
     Instead of &amp;quot;cd&amp;quot; to a directory try &amp;quot;pushd&amp;quot; and look&lt;br /&gt;
     at the heading...you can see a list of directories.&lt;br /&gt;
&lt;br /&gt;
          $ pushd /etc&lt;br /&gt;
          $ pushd /usr/local&lt;br /&gt;
&lt;br /&gt;
      Then, to get back &amp;quot;popd&amp;quot; or &amp;quot;popd 1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      To list all the directories pushed on the stack&lt;br /&gt;
      use the &amp;quot;dirs -v&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
          $ dirs -v&lt;br /&gt;
           0  /usr/local&lt;br /&gt;
           1  /etc&lt;br /&gt;
           2  /work/souptonuts/documentation/theBook&lt;br /&gt;
&lt;br /&gt;
      Now, if you &amp;quot;pushd +1&amp;quot; you will be moved to &amp;quot;/etc&amp;quot;, since&lt;br /&gt;
      is number &amp;quot;1&amp;quot; on the stack, and this directory will become&lt;br /&gt;
      &amp;quot;0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ pwd&lt;br /&gt;
           /usr/local&lt;br /&gt;
          $ pushd +1&lt;br /&gt;
          $ pwd&lt;br /&gt;
           /etc&lt;br /&gt;
&lt;br /&gt;
          $ dirs -v&lt;br /&gt;
           0  /etc&lt;br /&gt;
           1  /work/souptonuts/documentation/theBook&lt;br /&gt;
           2  /usr/local&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 39:&lt;br /&gt;
&lt;br /&gt;
     Need an Underscore after a Variable?&lt;br /&gt;
&lt;br /&gt;
       Enclose the variable in &amp;quot;{}&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $echo ${UID}_&lt;br /&gt;
&lt;br /&gt;
       Compare to&lt;br /&gt;
&lt;br /&gt;
          $echo $UID_&lt;br /&gt;
&lt;br /&gt;
       Also try the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ m=&amp;quot;my stuff here&amp;quot;&lt;br /&gt;
                $ echo -e ${m// /'\n'}&lt;br /&gt;
                        my&lt;br /&gt;
                        stuff&lt;br /&gt;
                        here&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 40:&lt;br /&gt;
&lt;br /&gt;
     Bash Variable Offset and String Operators&lt;br /&gt;
&lt;br /&gt;
        $ r=&amp;quot;this is stuff&amp;quot;&lt;br /&gt;
        $ echo ${r:3}&lt;br /&gt;
        $ echo ${r:5:2}&lt;br /&gt;
&lt;br /&gt;
      Note, ${varname:offset:length}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         ${varname:?message}  If varname exist and isn't null return value, else,&lt;br /&gt;
                              print var and message.&lt;br /&gt;
&lt;br /&gt;
           $ r=&amp;quot;new stuff&amp;quot;&lt;br /&gt;
           $ echo ${r:? &amp;quot;that's r for you&amp;quot;}&lt;br /&gt;
               new stuff&lt;br /&gt;
           $ unset r&lt;br /&gt;
           $ echo ${r:? &amp;quot;that's r for you&amp;quot;}&lt;br /&gt;
               bash: r:  that's r for you&lt;br /&gt;
&lt;br /&gt;
         ${varname:+word}    If varname exist and not null return word. Else, return null.&lt;br /&gt;
&lt;br /&gt;
         ${varname:-word}    If varname exist and not null return value. Else, return word.&lt;br /&gt;
&lt;br /&gt;
      Working with arrays in bash - bash arrays.&lt;br /&gt;
&lt;br /&gt;
           $ unset p&lt;br /&gt;
           $ p=(one two three)&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[@]}&amp;quot;&lt;br /&gt;
           one two three&lt;br /&gt;
&lt;br /&gt;
      or&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[*]}&amp;quot;&lt;br /&gt;
           one two three&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${#p[@]}&amp;quot;&lt;br /&gt;
           3&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[0]}&amp;quot;&lt;br /&gt;
           one&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[1]}&amp;quot;&lt;br /&gt;
           two&lt;br /&gt;
&lt;br /&gt;
            Also see (TIP 95)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 41:&lt;br /&gt;
&lt;br /&gt;
     Loops in Bash&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The command below loops through directories listed in $PATH.&lt;br /&gt;
&lt;br /&gt;
          $ path=$PATH:&lt;br /&gt;
          $ while [ $path ]; do echo &amp;quot; ${path%%:*} &amp;quot;; path=${path#*:}; done&lt;br /&gt;
&lt;br /&gt;
       The command below will also loop through directories in your path.&lt;br /&gt;
&lt;br /&gt;
          $IFS=:&lt;br /&gt;
          $ for dir in $PATH&lt;br /&gt;
          &amp;gt; do&lt;br /&gt;
          &amp;gt; ls -ld $dir&lt;br /&gt;
          &amp;gt; done&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Jun 10 20:16 /usr/local/bin&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Jun 13 23:12 /bin&lt;br /&gt;
              drwxr-xr-x    3 root     root        40960 Jun 12 08:00 /usr/bin&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Feb 14 03:12 /usr/X11R6/bin&lt;br /&gt;
              drwxrwxr-x    2 chirico  chirico      4096 Jun  6 13:06 /home/chirico/bin&lt;br /&gt;
&lt;br /&gt;
     Other ways of doing loops:&lt;br /&gt;
&lt;br /&gt;
        for (( i=1; i &amp;lt;= 20; i++))&lt;br /&gt;
                do&lt;br /&gt;
                        echo -n &amp;quot;$i &amp;quot;&lt;br /&gt;
                done&lt;br /&gt;
&lt;br /&gt;
     Note, to do it all on one line, do the following:&lt;br /&gt;
&lt;br /&gt;
        $ for (( i=1; i &amp;lt;= 20; i++)); do echo -n &amp;quot;$i&amp;quot;; done&lt;br /&gt;
&lt;br /&gt;
     Below, is an example of declaring i an integer so that you do not&lt;br /&gt;
     have to preface with let.&lt;br /&gt;
&lt;br /&gt;
          $ declare -i i&lt;br /&gt;
          $ i=5;&lt;br /&gt;
          $ while (( $i &amp;gt; 1 )); do&lt;br /&gt;
          &amp;gt; i=i-1&lt;br /&gt;
          &amp;gt; echo $i&lt;br /&gt;
          &amp;gt; done&lt;br /&gt;
          4&lt;br /&gt;
          3&lt;br /&gt;
          2&lt;br /&gt;
&lt;br /&gt;
     You can also use &amp;quot;while [ $i -gt 1 ]; do&amp;quot;  in place of &amp;quot;while (( $i &amp;gt; 1 )); do&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     To get a listing of all declared values&lt;br /&gt;
&lt;br /&gt;
          $ declare -i&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Try putting a few words in the file &amp;quot;test&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         $ while read filename; do echo  &amp;quot;- $filename &amp;quot;; done &amp;lt; test |nl -w1&lt;br /&gt;
&lt;br /&gt;
     Or, using an array&lt;br /&gt;
&lt;br /&gt;
                declare -a Array&lt;br /&gt;
                Array[0]=&amp;quot;zero&amp;quot;&lt;br /&gt;
                Array[1]=&amp;quot;one&amp;quot;&lt;br /&gt;
                Array[2]=&amp;quot;two&amp;quot;&lt;br /&gt;
                for i in `seq ${#Array[@]}`&lt;br /&gt;
                do&lt;br /&gt;
                  echo $Array[$i-1]&lt;br /&gt;
                done&lt;br /&gt;
&lt;br /&gt;
         Also see (TIP 95 and TIP 133).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 42:&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;diff&amp;quot; and &amp;quot;patch&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
        You have created a program &amp;quot;prog.c&amp;quot;, saved as this name and also copied&lt;br /&gt;
        to  &amp;quot;prog.c.old&amp;quot;. You post &amp;quot;prog.c&amp;quot; to users.  Next, you make changes&lt;br /&gt;
        to prog.c&lt;br /&gt;
&lt;br /&gt;
          $ diff -c prog.c.old prog.c &amp;gt; prog.patch&lt;br /&gt;
&lt;br /&gt;
        Now, users can get the latest updates by running.&lt;br /&gt;
&lt;br /&gt;
          $ patch &amp;lt; prog.patch&lt;br /&gt;
&lt;br /&gt;
        By the way, you can make backups of your data easily.&lt;br /&gt;
&lt;br /&gt;
          $ cp /etc/fstab{,.bak}&lt;br /&gt;
&lt;br /&gt;
        Now, you do your edits to &amp;quot;/etc/fstab&amp;quot; and if you need&lt;br /&gt;
        to go back to the original, you can find it at&lt;br /&gt;
        &amp;quot;/etc/fstab.bak&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 43:&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;cat&amp;quot; the Contents of Files Listed in a File, in That Order.&lt;br /&gt;
&lt;br /&gt;
       SETUP (Assume you have the following)&lt;br /&gt;
&lt;br /&gt;
              $ cat file_of_files&lt;br /&gt;
                  file1&lt;br /&gt;
                  file2&lt;br /&gt;
&lt;br /&gt;
              $ cat file1&lt;br /&gt;
                  This is the data in file1&lt;br /&gt;
&lt;br /&gt;
              $ cat file 2&lt;br /&gt;
                  This is the data in file2&lt;br /&gt;
&lt;br /&gt;
       So there are 3 files here &amp;quot;file_of_files&amp;quot; which contains the name of&lt;br /&gt;
       other files.  In this case &amp;quot;file1&amp;quot; and &amp;quot;file2&amp;quot;. And the contents of&lt;br /&gt;
       &amp;quot;file1&amp;quot; and &amp;quot;file2&amp;quot; is shown above.&lt;br /&gt;
&lt;br /&gt;
               $ cat file_of_files|xargs cat&lt;br /&gt;
                    This is the data in  file1&lt;br /&gt;
                    This is the data in  file2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 44:&lt;br /&gt;
&lt;br /&gt;
     Columns and Rows -- getting anything you want.&lt;br /&gt;
&lt;br /&gt;
     Assume you have the following file.&lt;br /&gt;
&lt;br /&gt;
        $ cat data&lt;br /&gt;
           1 2 3&lt;br /&gt;
           4 5&lt;br /&gt;
           6 7 8 9 10&lt;br /&gt;
           11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
     How to you get everything in  2 columns?&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l2&lt;br /&gt;
           1 2&lt;br /&gt;
           3 4&lt;br /&gt;
           5 6&lt;br /&gt;
           7 8&lt;br /&gt;
           9 10&lt;br /&gt;
           11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
    Three columns?&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l3&lt;br /&gt;
           1 2 3&lt;br /&gt;
           4 5 6&lt;br /&gt;
           7 8 9&lt;br /&gt;
           10 11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
    What's the row sum of the &amp;quot;three columns?&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
           6&lt;br /&gt;
           15&lt;br /&gt;
           24&lt;br /&gt;
           33&lt;br /&gt;
           27&lt;br /&gt;
&lt;br /&gt;
    or&lt;br /&gt;
&lt;br /&gt;
        $ tr ' ' '\n' &amp;lt; data |xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
&lt;br /&gt;
    NOTE &amp;quot;Steven Heiner's rule&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
             cat one_file | program&lt;br /&gt;
&lt;br /&gt;
           can always be rewritten as&lt;br /&gt;
&lt;br /&gt;
             program &amp;lt; one_file&lt;br /&gt;
&lt;br /&gt;
   Note: thanks to Steven Heiner (http://www.shelldorado.com/) the above can be&lt;br /&gt;
       shortened as follows:&lt;br /&gt;
&lt;br /&gt;
               $ tr ' ' '\n' &amp;lt; data|xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
&lt;br /&gt;
          Need to &amp;quot;tr&amp;quot; from the stdin?&lt;br /&gt;
&lt;br /&gt;
               $ tr &amp;quot;xy&amp;quot; &amp;quot;yx&amp;quot;| ... | ...&lt;br /&gt;
&lt;br /&gt;
       But there is a the &amp;quot;Stephane CHAZELAS&amp;quot; condition here&lt;br /&gt;
&lt;br /&gt;
         &amp;quot;Note that tr, sed, and awk mail fail on files containing '\0'&lt;br /&gt;
          sed and awk have unspecified behaviors if the input&lt;br /&gt;
          doesn't end in a '\n' (or to sum up, cat works for&lt;br /&gt;
          binary and text files, text utilities such as sed or awk&lt;br /&gt;
          work only for text files).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 45:&lt;br /&gt;
&lt;br /&gt;
     Auto Directory Spelling Corrections.&lt;br /&gt;
&lt;br /&gt;
      To turn this on:&lt;br /&gt;
&lt;br /&gt;
           $ shopt -s cdspell&lt;br /&gt;
&lt;br /&gt;
      Now mispell a directory in the cd command.&lt;br /&gt;
&lt;br /&gt;
           $ cd /usk/local&lt;br /&gt;
                   ^-------- still gets you to --&lt;br /&gt;
                                                |&lt;br /&gt;
                                            /usr/local&lt;br /&gt;
&lt;br /&gt;
      What other options can you set? The following will list&lt;br /&gt;
      all the options:&lt;br /&gt;
&lt;br /&gt;
           $ shopt -p&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 46:&lt;br /&gt;
&lt;br /&gt;
     Record Eveything Printed on Your Terminal Screen.&lt;br /&gt;
&lt;br /&gt;
            $ script -a &amp;lt;filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Now start doing stuff and &amp;quot;everything&amp;quot; is appended to &amp;lt;filename&amp;gt;.&lt;br /&gt;
     For example&lt;br /&gt;
&lt;br /&gt;
            $ script installation&lt;br /&gt;
&lt;br /&gt;
            $ (command)&lt;br /&gt;
&lt;br /&gt;
            $ (result)&lt;br /&gt;
&lt;br /&gt;
            $ ...&lt;br /&gt;
&lt;br /&gt;
            $ ...&lt;br /&gt;
&lt;br /&gt;
            $ (command)&lt;br /&gt;
&lt;br /&gt;
            $ (result)&lt;br /&gt;
&lt;br /&gt;
            $ exit&lt;br /&gt;
&lt;br /&gt;
     The whole session log is in the installation file that you can later&lt;br /&gt;
     read and/or cleanup and add to a documentation.&lt;br /&gt;
&lt;br /&gt;
     This command can also be used to redirect the contents to another user,&lt;br /&gt;
     but you must be root to do this.&lt;br /&gt;
&lt;br /&gt;
     Step 1 - find out what pts they are using.&lt;br /&gt;
&lt;br /&gt;
            $ w&lt;br /&gt;
&lt;br /&gt;
     Step 2 - Run script on that pts. After running this command below&lt;br /&gt;
              everything you type will appear on their screen.&lt;br /&gt;
&lt;br /&gt;
            $ script /dev/pts/4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Thanks to Jacques.GARNIER-EXTERIEUR@EU.RHODIA.COM for his contribution&lt;br /&gt;
     to this tip.&lt;br /&gt;
&lt;br /&gt;
     Also reference TIP 208.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 47:&lt;br /&gt;
&lt;br /&gt;
     Monitor all Network Traffic Except Your Current ssh Connection.&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX -s 1500 port not 22&lt;br /&gt;
&lt;br /&gt;
       Or to filter out port 123 as well getting the full length of the packet&lt;br /&gt;
       (-s 0), use the following:&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX -s 0 port not 22  and port not 123&lt;br /&gt;
&lt;br /&gt;
       Or to filter only a certain host say 81.169.158.205&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX  port not 22 and host 81.169.158.205&lt;br /&gt;
&lt;br /&gt;
     Just want ip addresses and a little bit of data, then,&lt;br /&gt;
     use this. The &amp;quot;-c 20&amp;quot; is to stop after 20 packets.&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN  -s 1500 port not 22 -c 20&lt;br /&gt;
&lt;br /&gt;
     If you're looking for sign of DOS attacks, the following show just the SYN&lt;br /&gt;
     packets on all interfaces:&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump 'tcp[13] &amp;amp; 2 == 2'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 48:&lt;br /&gt;
&lt;br /&gt;
     Where are the GNU Reference Manuals?&lt;br /&gt;
&lt;br /&gt;
           http://www.gnu.org/manual/manual.html&lt;br /&gt;
&lt;br /&gt;
     Also worth a look the &amp;quot;Linux Documentation Project&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           http://en.tldp.org/&lt;br /&gt;
&lt;br /&gt;
     and Red Hat manuals&lt;br /&gt;
&lt;br /&gt;
           http://www.redhat.com/docs/manuals/enterprise/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 49:&lt;br /&gt;
&lt;br /&gt;
     Setting or Changing the Library Path.&lt;br /&gt;
&lt;br /&gt;
     The following contains the settings to be added or deleted&lt;br /&gt;
&lt;br /&gt;
           /etc/ld.so.conf&lt;br /&gt;
&lt;br /&gt;
     After this file is edited, you must run the following:&lt;br /&gt;
&lt;br /&gt;
           $ ldconfig&lt;br /&gt;
&lt;br /&gt;
     See &amp;quot;man ldconfig&amp;quot; for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 50:&lt;br /&gt;
&lt;br /&gt;
     Working with Libraries in C&lt;br /&gt;
&lt;br /&gt;
     Assume the following 3 programs:&lt;br /&gt;
&lt;br /&gt;
      $ cat ./src/test.c&lt;br /&gt;
&lt;br /&gt;
         int test(int t)&lt;br /&gt;
         {&lt;br /&gt;
           printf(&amp;quot;%d\n&amp;quot;,t);&lt;br /&gt;
           return t;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      $ cat ./src/prog1.c&lt;br /&gt;
&lt;br /&gt;
         /*&lt;br /&gt;
          program: prog1.c&lt;br /&gt;
          dependences: test.c&lt;br /&gt;
&lt;br /&gt;
          compiling this program:&lt;br /&gt;
          gcc -o prog test.c prog1.c&lt;br /&gt;
&lt;br /&gt;
          Note the libpersonal include&lt;br /&gt;
          should be remove if NOT using the&lt;br /&gt;
          library&lt;br /&gt;
         */&lt;br /&gt;
&lt;br /&gt;
         #include &amp;lt;libpersonal.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         int&lt;br /&gt;
         main(int argc, char **argv)&lt;br /&gt;
         {&lt;br /&gt;
           test(45);&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
      $ cat ./include/libpersonal.h&lt;br /&gt;
&lt;br /&gt;
         extern int test(int);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Prog1.c needs the test function in  test.c&lt;br /&gt;
     To compile, so that both programs work together, do the following:&lt;br /&gt;
&lt;br /&gt;
          $ cd src&lt;br /&gt;
          $ gcc -o prog test.c prog1.c -I../include&lt;br /&gt;
&lt;br /&gt;
     However, if you want to create your own static library, then, run the following:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p ../lib&lt;br /&gt;
          $ gcc -c test.c  -o ../lib/test.o&lt;br /&gt;
          $ cd ../lib&lt;br /&gt;
          $ ar r libpersonal.a test.o&lt;br /&gt;
          $ ranlib libpersonal.a&lt;br /&gt;
&lt;br /&gt;
     or, the ar and ranlib command can be combined as follows:&lt;br /&gt;
&lt;br /&gt;
          $ ar rs libpersonal.a test.o&lt;br /&gt;
&lt;br /&gt;
     To compile the program with the static library:&lt;br /&gt;
&lt;br /&gt;
          $ cd ../src&lt;br /&gt;
          $ gcc -I../include -L../lib -o prog1 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     The -I../include  tells  gcc to look in the ../include directory for&lt;br /&gt;
     libpersonal.h. and -L../lib, tells gcc to look for the&lt;br /&gt;
     &amp;quot;libpersonal.a&amp;quot; library.&lt;br /&gt;
&lt;br /&gt;
           $ cd ..&lt;br /&gt;
           $ tree src lib include&lt;br /&gt;
           src&lt;br /&gt;
           |-- prog&lt;br /&gt;
           |-- prog1&lt;br /&gt;
           |-- prog1.c&lt;br /&gt;
           `-- test.c&lt;br /&gt;
           lib&lt;br /&gt;
           |-- libpersonal.a&lt;br /&gt;
           `-- test.o&lt;br /&gt;
           include&lt;br /&gt;
           `-- libpersonal.h&lt;br /&gt;
&lt;br /&gt;
     This was a STATIC library. Often times you will want to use a SHARED&lt;br /&gt;
     or dynamic library.&lt;br /&gt;
&lt;br /&gt;
     SHARED LIBRARY:&lt;br /&gt;
&lt;br /&gt;
     You must recompile test.c with -fpic option.&lt;br /&gt;
&lt;br /&gt;
          $ cd ../lib&lt;br /&gt;
          $ gcc -c -fpic ../src/test.c -o test.o&lt;br /&gt;
&lt;br /&gt;
     Next create the libpersonal.so file.&lt;br /&gt;
&lt;br /&gt;
          $ gcc -shared -o libpersonal.so test.o&lt;br /&gt;
&lt;br /&gt;
     Now, compile the source prog1.c as follows:&lt;br /&gt;
&lt;br /&gt;
          $ cd ../src&lt;br /&gt;
          $ gcc -Wl,-R../lib -L../lib -I../include -o prog2 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
     This should work fine. But, take a look at prog2 using the ldd command.&lt;br /&gt;
&lt;br /&gt;
          $ ldd prog2&lt;br /&gt;
&lt;br /&gt;
        libpersonal.so =&amp;gt; ../lib/libpersonal.so (0x40017000)&lt;br /&gt;
        libc.so.6 =&amp;gt; /lib/tls/libc.so.6 (0x42000000)&lt;br /&gt;
        /lib/ld-linux.so.2 =&amp;gt; /lib/ld-linux.so.2 (0x40000000)&lt;br /&gt;
&lt;br /&gt;
     If you move the program prog2 to a different location, it will not run.&lt;br /&gt;
     Instead you will get the following error:&lt;br /&gt;
&lt;br /&gt;
           prog2: error while loading shared libraries: libpersonal.so:&lt;br /&gt;
                     cannot open shared object file: No such file or directory&lt;br /&gt;
&lt;br /&gt;
     To fix this, you should specify the direct path to the library. And in my&lt;br /&gt;
     case it is rather long&lt;br /&gt;
&lt;br /&gt;
      $  gcc -Wl,-R/work/souptonuts/documentation/theBook/lib -L../lib -I../include -o prog2 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE: The -R must always follow the -Wl.  (-Wl,-R&amp;lt;directory&amp;gt;) They always go together&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 51:&lt;br /&gt;
&lt;br /&gt;
     Actively Monitor a File and Send Email when Expression Occurs.&lt;br /&gt;
&lt;br /&gt;
     This is a way to monitor &amp;quot;/var/log/messages&amp;quot; or any file for certain changes.&lt;br /&gt;
     The example below actively monitors &amp;quot;stuff&amp;quot; for the work &amp;quot;now&amp;quot; and as soon as&lt;br /&gt;
     &amp;quot;now&amp;quot; is added to the file, the contents of msg are sent to the user&lt;br /&gt;
     mikechirico@hotmail.com&lt;br /&gt;
&lt;br /&gt;
          $ tail -f stuff | \&lt;br /&gt;
              awk ' /now/ { system(&amp;quot;mail -s \&amp;quot;This is working\&amp;quot;  mikechirico@hotmail.com &amp;lt; msg&amp;quot;) }'&lt;br /&gt;
&lt;br /&gt;
     Or, you can run a program, say get headings on slashdot from the program &amp;quot;getslash.php&amp;quot; which&lt;br /&gt;
     runs on  &amp;quot;192.168.1.155&amp;quot; with account &amp;quot;chirico&amp;quot;. Assuming you have ssh keys setup, then, the following&lt;br /&gt;
     will send mail from the output:&lt;br /&gt;
&lt;br /&gt;
          $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;|mail -s &amp;quot;Slash cron Headlines&amp;quot;  mchirico@comcast.net&lt;br /&gt;
&lt;br /&gt;
     See (TIP 80) for scraping the headings on slash dot and how to get a copy of &amp;quot;getslash.php&amp;quot;.  If you still&lt;br /&gt;
     want to use awk:&lt;br /&gt;
&lt;br /&gt;
           $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;| \&lt;br /&gt;
                      awk '{ print $0 | &amp;quot;mail -s \x27 Slash Topics \x27 mchirico@comcast.net &amp;quot;}'&lt;br /&gt;
&lt;br /&gt;
     Note the &amp;quot;\x27&amp;quot; is a quote.  Maybe you only want articles dealing with &amp;quot;Linux&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
           $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;| \&lt;br /&gt;
                      awk '/Linux/{ print $0 | &amp;quot;mail -s \x27 Slash Topics \x27 mchirico@comcast.net &amp;quot;}'&lt;br /&gt;
&lt;br /&gt;
     For $60, you can get a numeric display from &amp;quot;delcom engineering&amp;quot; that you can send messages and&lt;br /&gt;
     data to.  I get weather information off the internet and send it to this device.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/projects/delcom/&lt;br /&gt;
&lt;br /&gt;
     (Reference TIP 151 for ssh tips)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 52:&lt;br /&gt;
&lt;br /&gt;
     Need to Keep Secrets? Encrypt it.&lt;br /&gt;
&lt;br /&gt;
      To Encrypt:&lt;br /&gt;
&lt;br /&gt;
            $ openssl des3 -salt -in file.txt -out file.des3&lt;br /&gt;
&lt;br /&gt;
      The above will prompt for a password, or you can put it in&lt;br /&gt;
      with a -k option, assuming you're on a trusted server.&lt;br /&gt;
&lt;br /&gt;
      To Decrypt&lt;br /&gt;
&lt;br /&gt;
            $  openssl des3 -d -salt -in file.des3 -out file.txt -k mypassword&lt;br /&gt;
&lt;br /&gt;
      Need to encrypt what you type? Enter the following, then start typing&lt;br /&gt;
      and  ^D to end.&lt;br /&gt;
&lt;br /&gt;
            $ openssl des3 -salt -out stuff.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 53:&lt;br /&gt;
&lt;br /&gt;
     Check that a File has Not Been Tampered With: Use Cryptographic Hashing Function.&lt;br /&gt;
&lt;br /&gt;
     The md5sum is popular but dated&lt;br /&gt;
&lt;br /&gt;
              $ md5sum file&lt;br /&gt;
&lt;br /&gt;
     Instead, use one of the following;&lt;br /&gt;
&lt;br /&gt;
              $ openssl dgst -sha1 -c file&lt;br /&gt;
&lt;br /&gt;
              $ openssl dgst -ripemd160 -c  file&lt;br /&gt;
&lt;br /&gt;
     All calls give a fixed length string or &amp;quot;message digest&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 54:&lt;br /&gt;
&lt;br /&gt;
     Need to View Information About a Secure Web Server? A SSL/TLS test.&lt;br /&gt;
&lt;br /&gt;
           $ openssl s_client -connect www.sourceforge.net:443&lt;br /&gt;
&lt;br /&gt;
     Above will give a long listing of certificates.&lt;br /&gt;
&lt;br /&gt;
     Note, it is also possible to get certificate information about a mail server&lt;br /&gt;
&lt;br /&gt;
           $ openssl s_client -connect mail.comcast.net:995 -showcerts&lt;br /&gt;
&lt;br /&gt;
     When you do the above command you get two certificates. If you copy&lt;br /&gt;
     past both certificates by taking the following contents include the&lt;br /&gt;
     begin and end show below:&lt;br /&gt;
&lt;br /&gt;
                 -----BEGIN CERTIFICATE-----&lt;br /&gt;
                 ....&lt;br /&gt;
                 -----END CERTIFICATE-----&lt;br /&gt;
&lt;br /&gt;
     Then create files &amp;quot;comcast0.pem&amp;quot; and &amp;quot;comcast1.pem&amp;quot; out of these certificaties and&lt;br /&gt;
     put them in a directory &amp;quot;/home/donkey/.certs&amp;quot;, then, with the openssl src package, in&lt;br /&gt;
     the &amp;quot;./tools/c_rehash&amp;quot; run&lt;br /&gt;
&lt;br /&gt;
            $ c_rehash .certs&lt;br /&gt;
            Doing .certs&lt;br /&gt;
            comcast0.pem =&amp;gt; 72f90dc0.0&lt;br /&gt;
            comcast1.pem =&amp;gt; f73e89fd.0&lt;br /&gt;
&lt;br /&gt;
     Now it's possible to have fetchmail work with these certs.&lt;br /&gt;
&lt;br /&gt;
       #&lt;br /&gt;
       #&lt;br /&gt;
       # Sample .fetchmailrc file for Comcast&lt;br /&gt;
       #&lt;br /&gt;
       # Check mail every 90 seconds&lt;br /&gt;
       set daemon 90&lt;br /&gt;
       set syslog&lt;br /&gt;
       set postmaster donkey&lt;br /&gt;
       #set bouncemail&lt;br /&gt;
       #&lt;br /&gt;
       # Comcast email is zdonkey but computer account is  just donkey&lt;br /&gt;
       #&lt;br /&gt;
       poll mail.comcast.net with proto POP3 and options no dns&lt;br /&gt;
              user 'zdonkey' with pass &amp;quot;somethin35&amp;quot;  is 'donkey' here options ssl sslcertck sslcertpath '/home/donkey/.certs'&lt;br /&gt;
              smtphost comcast.net&lt;br /&gt;
       # currently not used&lt;br /&gt;
       mda '/usr/bin/procmail -d %T'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     REFERENCE: http://www.openssl.org/&lt;br /&gt;
                http://www.catb.org/~esr/fetchmail/fetchmail-6.2.5.tar.gz&lt;br /&gt;
                http://www.madboa.com/geek/openssl/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 55:&lt;br /&gt;
&lt;br /&gt;
     cp --parents. What does this option do?&lt;br /&gt;
&lt;br /&gt;
     Assume you have the following directory structure&lt;br /&gt;
&lt;br /&gt;
            .&lt;br /&gt;
            |-- a&lt;br /&gt;
            |   `-- b&lt;br /&gt;
            |       `-- c&lt;br /&gt;
            |           `-- d&lt;br /&gt;
            |               |-- file1&lt;br /&gt;
            |               `-- file2&lt;br /&gt;
            `-- newdir&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Issue the following command:&lt;br /&gt;
&lt;br /&gt;
         $ cp --parents ./a/b/c/d/* ./newdir/&lt;br /&gt;
&lt;br /&gt;
     Now you have the following:&lt;br /&gt;
&lt;br /&gt;
            .&lt;br /&gt;
            |-- a&lt;br /&gt;
            |   `-- b&lt;br /&gt;
            |       `-- c&lt;br /&gt;
            |           `-- d&lt;br /&gt;
            |               |-- file1&lt;br /&gt;
            |               `-- file2&lt;br /&gt;
            `-- newdir&lt;br /&gt;
                `-- a&lt;br /&gt;
                    `-- b&lt;br /&gt;
                        `-- c&lt;br /&gt;
                            `-- d&lt;br /&gt;
                                |-- file1&lt;br /&gt;
                                `-- file2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 56:&lt;br /&gt;
&lt;br /&gt;
     Quickly Locating files.&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;locate&amp;quot; command quickly searches the indexed database for files.  It just&lt;br /&gt;
     gives the name of the files; but, if you need more information use it as follows&lt;br /&gt;
&lt;br /&gt;
         $ locate document|xargs ls -l&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;locate&amp;quot; database may only get updated every 24 hours.  For more recent finds,&lt;br /&gt;
     use the &amp;quot;find&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 57:&lt;br /&gt;
&lt;br /&gt;
     Using the &amp;quot;find&amp;quot; Command.&lt;br /&gt;
&lt;br /&gt;
     List only directories, max 2 nodes down that have &amp;quot;net&amp;quot; in the name&lt;br /&gt;
&lt;br /&gt;
       $ find /proc -type d -maxdepth 2 -iname '*net*'&lt;br /&gt;
&lt;br /&gt;
     Find all *.c and *.h files starting from the current &amp;quot;.&amp;quot; position.&lt;br /&gt;
&lt;br /&gt;
       $ find . \( -iname '*.c'  -o -iname '*.h' \) -print&lt;br /&gt;
&lt;br /&gt;
     Find all, but skip what's in &amp;quot;/CVS&amp;quot; and &amp;quot;/junk&amp;quot;. Start from &amp;quot;/work&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ find /work \( -iregex '.*/CVS'  -o -iregex '.*/junk' \)  -prune -o -print&lt;br /&gt;
&lt;br /&gt;
     Note -regex and -iregex work on the directory as well, which means&lt;br /&gt;
     you must consider the &amp;quot;./&amp;quot; that comes before all listings.&lt;br /&gt;
&lt;br /&gt;
     Here is another example. Find all files except what is under the CVS, including&lt;br /&gt;
     CVS listings. Also exclude &amp;quot;#&amp;quot; and &amp;quot;~&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       $ find . -regex '.*' ! \( -regex '.*CVS.*'  -o -regex '.*[#|~].*' \)&lt;br /&gt;
&lt;br /&gt;
     Find a *.c file, then run grep on it looking for &amp;quot;stdio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       $ find . -iname '*.c' -exec grep -H 'stdio.h' {} \;&lt;br /&gt;
         sample output --&amp;gt;  ./prog1.c:#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
                            ./test.c:#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Looking for the disk-hog on the whole system?&lt;br /&gt;
&lt;br /&gt;
       $ find /  -size +10000k 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
     Looking for files changed in the last 24 hours? Make sure you add the&lt;br /&gt;
     minus sign &amp;quot;-1&amp;quot;, otherwise, you will only find files changed exactly&lt;br /&gt;
     24 hours from now. With the &amp;quot;-1&amp;quot; you get files changed from now to 24&lt;br /&gt;
     hours.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ find  . -ctime -1  -printf &amp;quot;%a %f\n&amp;quot;&lt;br /&gt;
       Wed Oct  6 12:51:56 2004 .&lt;br /&gt;
       Wed Oct  6 12:35:16 2004 How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
     Or if you just want files.&lt;br /&gt;
&lt;br /&gt;
       $ find . -type f -ctime -1  -printf &amp;quot;%a %f\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Details on file status change in the last 48 hours, current directory. Also note &amp;quot;-atime -2&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
       $ find . -ctime -2 -type f -exec ls -l {} \;&lt;br /&gt;
&lt;br /&gt;
             NOTE: if you don't use -type f, you make get &amp;quot;.&amp;quot; returned, which&lt;br /&gt;
             when run through ls &amp;quot;ls .&amp;quot; may list more than what you want.&lt;br /&gt;
&lt;br /&gt;
             Also you may only want the current directory&lt;br /&gt;
&lt;br /&gt;
       $ find . -ctime -2 -type f -maxdepth 1 -exec ls -l {} \;&lt;br /&gt;
&lt;br /&gt;
     To find files modified within the last 5 to 10 minutes&lt;br /&gt;
&lt;br /&gt;
       $ find . -mmin +5 -mmin -10 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     For more example &amp;quot;find&amp;quot; commands, reference the following looking&lt;br /&gt;
     for the latest version of &amp;quot;bashscripts.x.x.x.tar.gz&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79320&amp;amp;package_id=80711&lt;br /&gt;
&lt;br /&gt;
     See &amp;quot;TIP 71&amp;quot; for examples of find using the inode feature. &amp;quot; $ find . -inum &amp;lt;inode&amp;gt; -exec rm -- '{}' \; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     If you don't want error messages, or need to redirect error messages &amp;quot;&amp;gt; /dev/null 2&amp;gt;&amp;amp;1&amp;quot;, or see&lt;br /&gt;
     &amp;quot;TIP 81&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 58:&lt;br /&gt;
&lt;br /&gt;
     Using the &amp;quot;rm&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
     How do you remove a file that has the name &amp;quot;-&amp;quot;.  For instance, if you run the command&lt;br /&gt;
     &amp;quot;$ cat &amp;gt; - &amp;quot; and type some text followed by ^d, how does the &amp;quot;-&amp;quot; file get deleted?&lt;br /&gt;
&lt;br /&gt;
        $ rm -- -&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;--&amp;quot; nullifies any rm options.&lt;br /&gt;
&lt;br /&gt;
     How do you delete the directory &amp;quot;one&amp;quot;, all it's sub-directories, and any data?&lt;br /&gt;
&lt;br /&gt;
        $ rm -rf ./one&lt;br /&gt;
&lt;br /&gt;
     Note, to selectively delete stuff on a directory, use the find command &amp;quot;TIP 57&amp;quot;.&lt;br /&gt;
     To delete by inode, see &amp;quot;TIP 71&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 59:&lt;br /&gt;
&lt;br /&gt;
     Giving ownership.&lt;br /&gt;
&lt;br /&gt;
     How do you give the user &amp;quot;donkey&amp;quot; ownership to all directories and files under&lt;br /&gt;
     &amp;quot;./fordonkey&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          $ chown -R donkey ./fordonkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 60:&lt;br /&gt;
&lt;br /&gt;
     Only Permit root login -- give others a message when they try to login.&lt;br /&gt;
&lt;br /&gt;
     Create the file &amp;quot;/etc/nologin&amp;quot; with &amp;quot;nologin&amp;quot; containing the contents&lt;br /&gt;
     of the message.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 61:&lt;br /&gt;
&lt;br /&gt;
     Limits: file size, open files, pipe size, stack size, max memory size&lt;br /&gt;
             cpu time, plus others.&lt;br /&gt;
&lt;br /&gt;
     To get a listing of current limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -a&lt;br /&gt;
             core file size        (blocks, -c) 0&lt;br /&gt;
             data seg size         (kbytes, -d) unlimited&lt;br /&gt;
             file size             (blocks, -f) unlimited&lt;br /&gt;
             max locked memory     (kbytes, -l) unlimited&lt;br /&gt;
             max memory size       (kbytes, -m) unlimited&lt;br /&gt;
             open files                    (-n) 1024&lt;br /&gt;
             pipe size          (512 bytes, -p) 8&lt;br /&gt;
             stack size            (kbytes, -s) 8192&lt;br /&gt;
             cpu time             (seconds, -t) unlimited&lt;br /&gt;
             max user processes            (-u) 8179&lt;br /&gt;
             virtual memory        (kbytes, -v) unlimited&lt;br /&gt;
&lt;br /&gt;
     Note as a user you can decrease your limits in the current&lt;br /&gt;
     shell session; but, you cannot increase.  This can be ideal&lt;br /&gt;
     for testing programs.  But, first you may want to create&lt;br /&gt;
     another shell &amp;quot;sh&amp;quot; so that you can &amp;quot;go back to where started&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -f 10&lt;br /&gt;
&lt;br /&gt;
     Now try&lt;br /&gt;
&lt;br /&gt;
          $ yes &amp;gt;&amp;gt; out&lt;br /&gt;
             File size limit exceeded&lt;br /&gt;
&lt;br /&gt;
     To set limits on users, make changes to &amp;quot;/etc/security/limits.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           bozo   - maxlogins 1&lt;br /&gt;
&lt;br /&gt;
     Will keep bozo from loging in more than once.&lt;br /&gt;
&lt;br /&gt;
     To list hard limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -Ha&lt;br /&gt;
&lt;br /&gt;
     To list soft limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -Sa&lt;br /&gt;
&lt;br /&gt;
     To restrict user access by time, day make changes to&lt;br /&gt;
             &amp;quot;/etc/security/time.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Also take a look at &amp;quot;/etc/profile&amp;quot; to see what other changes&lt;br /&gt;
     can be made, plus take a look under &amp;quot;/etc/security/*.conf&amp;quot; for&lt;br /&gt;
     other configuration files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 62:&lt;br /&gt;
&lt;br /&gt;
     Stupid &amp;quot;cat&amp;quot; Tricks.&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 43).&lt;br /&gt;
&lt;br /&gt;
     If you have multiple blank lines, squeeze these lines down to one,&lt;br /&gt;
     then, try the following:&lt;br /&gt;
&lt;br /&gt;
          $ cat -s &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to number the lines?&lt;br /&gt;
&lt;br /&gt;
          $ cat -n &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to show tabs?&lt;br /&gt;
&lt;br /&gt;
          $ cat -t &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Need to mark end of lines by &amp;quot;$&amp;quot;? The following was suggested by  (Amos Shapira)&lt;br /&gt;
&lt;br /&gt;
          $ cat -e &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to see all the ctl characters?&lt;br /&gt;
&lt;br /&gt;
          /* ctlgen.c&lt;br /&gt;
            Program to generate ctl characters.&lt;br /&gt;
&lt;br /&gt;
            Compile:&lt;br /&gt;
&lt;br /&gt;
               gcc -o ctlgen ctlgen.c&lt;br /&gt;
&lt;br /&gt;
            Run:&lt;br /&gt;
&lt;br /&gt;
               ./ctlgen &amp;gt; mout&lt;br /&gt;
&lt;br /&gt;
            Now see the characters:&lt;br /&gt;
&lt;br /&gt;
               cat -v mout&lt;br /&gt;
&lt;br /&gt;
            Here's a sample output:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               $ cat -v mout|tail&lt;br /&gt;
                   test M-v&lt;br /&gt;
                   test M-w&lt;br /&gt;
                   test M-x&lt;br /&gt;
                   test M-y&lt;br /&gt;
                   test M-z&lt;br /&gt;
                   test M-{&lt;br /&gt;
                   test M-|&lt;br /&gt;
                   test M-}&lt;br /&gt;
                   test M-~&lt;br /&gt;
                   test M-^?&lt;br /&gt;
&lt;br /&gt;
          */&lt;br /&gt;
          #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
          #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
          int main()&lt;br /&gt;
          {&lt;br /&gt;
            int i;&lt;br /&gt;
&lt;br /&gt;
            for(i=0; i &amp;lt; 256; ++i)&lt;br /&gt;
              printf(&amp;quot;test %c \n&amp;quot;,i);&lt;br /&gt;
&lt;br /&gt;
            return 0;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 63:&lt;br /&gt;
&lt;br /&gt;
     Guard against SYN attacks and &amp;quot;ping&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     As root do the following:&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/tcp_syncookies&lt;br /&gt;
&lt;br /&gt;
     Want to disable &amp;quot;ping&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_all&lt;br /&gt;
&lt;br /&gt;
     Disable broadcast/multicast &amp;quot;ping&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts&lt;br /&gt;
&lt;br /&gt;
     And to enable again:&lt;br /&gt;
&lt;br /&gt;
          echo 0 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_all&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 64:&lt;br /&gt;
&lt;br /&gt;
     Make changes to .bash_profile and need to update the current session?&lt;br /&gt;
&lt;br /&gt;
       $ source .bash_profile&lt;br /&gt;
&lt;br /&gt;
     With the above command, the user does not have to logout.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 65:&lt;br /&gt;
&lt;br /&gt;
     What are the Special Shell Variables?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        $#   The number of arguments.&lt;br /&gt;
        $@   All arguments, as separate words.&lt;br /&gt;
        $*   All arguments, as one word.&lt;br /&gt;
        $$   ID of the current process.&lt;br /&gt;
        $?   Exit status of the last command.&lt;br /&gt;
        $0,$1,..$9,${10},${11}...${N}    Positional parameters. After &amp;quot;9&amp;quot; you must use the ${k} syntax.&lt;br /&gt;
&lt;br /&gt;
     Note that 0 is true. For example if you execute the following, which is true you get zero.&lt;br /&gt;
&lt;br /&gt;
         $  [[ -f /etc/passwd ]]&lt;br /&gt;
         $  echo $?&lt;br /&gt;
         0&lt;br /&gt;
     And the following is false, which returns a 1.&lt;br /&gt;
&lt;br /&gt;
         $  [[ -f /etc/passwdjabberwisnohere ]]&lt;br /&gt;
         $  echo $?&lt;br /&gt;
         1&lt;br /&gt;
&lt;br /&gt;
     So true=0 and false=1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Sample program &amp;quot;mdo&amp;quot;  to show the difference between &amp;quot;$@&amp;quot; and &amp;quot;$*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        function myarg&lt;br /&gt;
        {&lt;br /&gt;
            echo &amp;quot;$# in myarg function&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
        echo -e &amp;quot;$# parameters on the cmd line\n&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;calling: myarg \&amp;quot;\$@\&amp;quot; and myarg \&amp;quot;\$*\&amp;quot;\n&amp;quot;&lt;br /&gt;
        myarg &amp;quot;$@&amp;quot;&lt;br /&gt;
        myarg &amp;quot;$*&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;\ncalling: myarg \$@ and myarg \$* without quotes\n&amp;quot;&lt;br /&gt;
        myarg $@&lt;br /&gt;
        myarg $*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The result of running &amp;quot;./mdo one two&amp;quot;. Note that when quoted, myarg &amp;quot;$*&amp;quot;,&lt;br /&gt;
      returns 1 ... all parameters are smushed together as one word.&lt;br /&gt;
&lt;br /&gt;
            [chirico@third-fl-71 theBook]$ ./mdo one two&lt;br /&gt;
            2 parameters on the cmd line&lt;br /&gt;
&lt;br /&gt;
            calling: myarg &amp;quot;$@&amp;quot; and myarg &amp;quot;$*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
            1 in myarg function&lt;br /&gt;
&lt;br /&gt;
            calling: myarg $@ and myarg $* without quotes&lt;br /&gt;
&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
&lt;br /&gt;
      Example program &amp;quot;mdo2&amp;quot; shows how the input separator can be changed.&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        IFS=|&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=,&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=\;&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=$1&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            [chirico@third-fl-71 theBook]$ ./mdo2 one two three four five&lt;br /&gt;
            one two three four five&lt;br /&gt;
&lt;br /&gt;
            one,two,three,four,five&lt;br /&gt;
&lt;br /&gt;
            one;two;three;four;five&lt;br /&gt;
&lt;br /&gt;
            oneotwoothreeofourofive&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 66:&lt;br /&gt;
&lt;br /&gt;
     Replace all &amp;quot;x&amp;quot; with &amp;quot;y&amp;quot; and all &amp;quot;y&amp;quot; with &amp;quot;x&amp;quot; in file data.&lt;br /&gt;
&lt;br /&gt;
        $ cata data&lt;br /&gt;
          x y&lt;br /&gt;
          y x&lt;br /&gt;
&lt;br /&gt;
        $ tr &amp;quot;xy&amp;quot;  &amp;quot;yx&amp;quot; &amp;lt; data&lt;br /&gt;
          y x&lt;br /&gt;
          x y&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 67:&lt;br /&gt;
&lt;br /&gt;
     On a Linux 2.6.x Kernel, how do you directly measure disk activity,&lt;br /&gt;
     and where is this information documented?&lt;br /&gt;
&lt;br /&gt;
          o The information is documented in the kernel source&lt;br /&gt;
               ./Documentation/iostats.txt&lt;br /&gt;
&lt;br /&gt;
          o The new way of getting this info in 2.6.x is&lt;br /&gt;
              $ cat /sys/block/hda/stat&lt;br /&gt;
            151121 5694 1932358 796675 37867 76770 916994 8353762 0 800672 9150437&lt;br /&gt;
&lt;br /&gt;
             Field  1 -- # of reads issued&lt;br /&gt;
                 This is the total number of reads completed successfully.&lt;br /&gt;
             Field  2 -- # of reads merged, field 6 -- # of writes merged&lt;br /&gt;
                 Reads and writes which are adjacent to each other may be merged for&lt;br /&gt;
                 efficiency.  Thus two 4K reads may become one 8K read before it is&lt;br /&gt;
                 ultimately handed to the disk, and so it will be counted (and queued)&lt;br /&gt;
                 as only one I/O.  This field lets you know how often this was done.&lt;br /&gt;
             Field  3 -- # of sectors read&lt;br /&gt;
                 This is the total number of sectors read successfully.&lt;br /&gt;
             Field  4 -- # of milliseconds spent reading&lt;br /&gt;
                 This is the total number of milliseconds spent by all reads (as&lt;br /&gt;
                 measured from __make_request() to end_that_request_last()).&lt;br /&gt;
             Field  5 -- # of writes completed&lt;br /&gt;
                 This is the total number of writes completed successfully.&lt;br /&gt;
             Field  7 -- # of sectors written&lt;br /&gt;
                 This is the total number of sectors written successfully.&lt;br /&gt;
             Field  8 -- # of milliseconds spent writing&lt;br /&gt;
                 This is the total number of milliseconds spent by all writes (as&lt;br /&gt;
                 measured from __make_request() to end_that_request_last()).&lt;br /&gt;
             Field  9 -- # of I/Os currently in progress&lt;br /&gt;
                 The only field that should go to zero. Incremented as requests are&lt;br /&gt;
                 given to appropriate request_queue_t and decremented as they finish.&lt;br /&gt;
             Field 10 -- # of milliseconds spent doing I/Os&lt;br /&gt;
                 This field is increases so long as field 9 is nonzero.&lt;br /&gt;
             Field 11 -- weighted # of milliseconds spent doing I/Os&lt;br /&gt;
                 This field is incremented at each I/O start, I/O completion, I/O&lt;br /&gt;
                 merge, or read of these stats by the number of I/Os in progress&lt;br /&gt;
                 (field 9) times the number of milliseconds spent doing I/O since the&lt;br /&gt;
                 last update of this field.  This can provide an easy measure of both&lt;br /&gt;
                 I/O completion time and the backlog that may be accumulating.&lt;br /&gt;
&lt;br /&gt;
       Note, this is device specific.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 68:&lt;br /&gt;
&lt;br /&gt;
     Passing Outbound Mail, plus Masquerading User and Hostname.&lt;br /&gt;
&lt;br /&gt;
     Here's a specific example:&lt;br /&gt;
&lt;br /&gt;
         How does one send and receive Comcast email from a home Linux box,&lt;br /&gt;
         which uses Comcast as the ISP, if the local account on the Linux&lt;br /&gt;
         box is different from the Comcast email.  For instance, the&lt;br /&gt;
         account on the Linux box is &amp;quot;chirico@third-fl-71&amp;quot; and the Comcast&lt;br /&gt;
         email account is &amp;quot;mchirico@comcast.net&amp;quot;.  Note both the hostname and&lt;br /&gt;
         username are different.&lt;br /&gt;
&lt;br /&gt;
         So, the user &amp;quot;chirico&amp;quot; using &amp;quot;mutt&amp;quot;, &amp;quot;elm&amp;quot; or any email program would&lt;br /&gt;
         like to send out email to say &amp;quot;donkey@comcast.net&amp;quot;; yet, donkey would&lt;br /&gt;
         see the email from &amp;quot;mchirico@comcast.net&amp;quot; and not &amp;quot;chirico@third-fl-71&amp;quot;&lt;br /&gt;
         but chirico@third-fl-71 would get the replies.&lt;br /&gt;
&lt;br /&gt;
         For a full description of how to solve this problem, including related&lt;br /&gt;
         &amp;quot;sendmail.mc&amp;quot;, &amp;quot;site.config.m4&amp;quot;, &amp;quot;genericstable&amp;quot;, &amp;quot;genericsdomain&amp;quot;,&lt;br /&gt;
         &amp;quot;.procmailrc&amp;quot;, and &amp;quot;.forward&amp;quot; files,  reference the following:&lt;br /&gt;
&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/README_COMCAST_EMAIL.txt?download&lt;br /&gt;
&lt;br /&gt;
         Included in the above link are instructions for building sendmail with&lt;br /&gt;
         &amp;quot;SASL&amp;quot; and &amp;quot;STARTTLS&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 69:&lt;br /&gt;
&lt;br /&gt;
     How do you remove just the last 2 lines from a file and save the result?&lt;br /&gt;
&lt;br /&gt;
         $ sed  '$d' file | sed '$d' &amp;gt; savefile&lt;br /&gt;
&lt;br /&gt;
     Or, as Amos Shapira pointed out, it's much easier with the head command.&lt;br /&gt;
&lt;br /&gt;
         $ head -2 file&lt;br /&gt;
&lt;br /&gt;
      And, of course, removing just the last line&lt;br /&gt;
&lt;br /&gt;
         $ sed '$d' file &amp;gt; savefile&lt;br /&gt;
&lt;br /&gt;
         (See REFERENCES (13))&lt;br /&gt;
&lt;br /&gt;
     How do you remove extra spaces at the end of a line?&lt;br /&gt;
&lt;br /&gt;
         $ sed 's/[ ]*$//g'&lt;br /&gt;
&lt;br /&gt;
     How do you remove blank lines, or lines with just spaces and tabs,&lt;br /&gt;
     saving the origional file as file.backup?&lt;br /&gt;
&lt;br /&gt;
         $ perl -pi.backup -e &amp;quot;s/^(\s)*\n//&amp;quot;  file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 70:&lt;br /&gt;
&lt;br /&gt;
     Generating Random Numbers.&lt;br /&gt;
&lt;br /&gt;
         $ od -vAn -N4 -tu4 &amp;lt; /dev/urandom&lt;br /&gt;
             3905158199&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 71:&lt;br /&gt;
&lt;br /&gt;
     Deleting a File by it's Inode Value.&lt;br /&gt;
&lt;br /&gt;
       See (PROGRAMMING TIP 5) for creating the file, or&lt;br /&gt;
&lt;br /&gt;
       $ cat &amp;gt; '\n\n\n\n\n\n\n'&lt;br /&gt;
         type some text&lt;br /&gt;
         ^D&lt;br /&gt;
&lt;br /&gt;
     To list the inode and display the characters.&lt;br /&gt;
&lt;br /&gt;
       $ ls -libt *&lt;br /&gt;
&lt;br /&gt;
     To remove by inode. Note the &amp;quot;--&amp;quot; option.  This&lt;br /&gt;
     will keep any special characters in the file from being&lt;br /&gt;
     interpreted at &amp;quot;rm&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
       $ find . -inum &amp;lt;inode&amp;gt; -exec rm -- '{}' \;&lt;br /&gt;
&lt;br /&gt;
     Or to check contents&lt;br /&gt;
&lt;br /&gt;
       $ find . -inum &amp;lt;inode&amp;gt; -exec cat '{}' \;&lt;br /&gt;
&lt;br /&gt;
     Reference:&lt;br /&gt;
         http://www.faqs.org/ftp/usenet/news.answers/unix-faq/faq/part2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 72:&lt;br /&gt;
&lt;br /&gt;
     Sending Attachments Using Mutt -- On the Command Line.&lt;br /&gt;
&lt;br /&gt;
        $ mutt -s &amp;quot;See Attachment&amp;quot; -a file.doc user@domain.net &amp;lt; message.txt&lt;br /&gt;
&lt;br /&gt;
          or just the message:&lt;br /&gt;
&lt;br /&gt;
        $ echo | mutt -a sample.tar.gz user@domain.net&lt;br /&gt;
&lt;br /&gt;
      Reference:&lt;br /&gt;
          http://www.shelldorado.com/articles/mailattachments.html&lt;br /&gt;
&lt;br /&gt;
        Also see (TIP 51).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 73:&lt;br /&gt;
&lt;br /&gt;
     Want to find out what functions a program calls?&lt;br /&gt;
&lt;br /&gt;
         $ strace &amp;lt;program&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Try this with &amp;quot;topen.c&amp;quot; (see PROGRAMMING TIP 5)&lt;br /&gt;
&lt;br /&gt;
         $ strace  ./topen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 74:&lt;br /&gt;
&lt;br /&gt;
     RPM Usage Summary.&lt;br /&gt;
&lt;br /&gt;
     Install. Full filename is needed.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -ivh Fedora/RPMS/postgresql-libs-7.4.2-1.i386.rpm&lt;br /&gt;
&lt;br /&gt;
     To view list of files installed with a particular package.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -ql postgresql-libs&lt;br /&gt;
                /usr/lib/libecpg.so.4&lt;br /&gt;
                /usr/lib/libecpg.so.4.1&lt;br /&gt;
                /usr/lib/libecpg_compat.so.1&lt;br /&gt;
                /usr/lib/libecpg_compat.so.1.1&lt;br /&gt;
                /usr/lib/libpgtypes.so.1&lt;br /&gt;
                ...&lt;br /&gt;
&lt;br /&gt;
     Or, to get the file listing from a package that is not installed use the&lt;br /&gt;
     &amp;quot;-p&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -pql /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/CHANGES&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/LICENSE&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/README&lt;br /&gt;
               /usr/share/man/man3/pcap.3.gz&lt;br /&gt;
&lt;br /&gt;
     For dependencies listing, use the &amp;quot;R&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qpR /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /sbin/ldconfig&lt;br /&gt;
               /sbin/ldconfig&lt;br /&gt;
               kernel &amp;gt;= 2.2.0&lt;br /&gt;
               libc.so.6&lt;br /&gt;
               libc.so.6(GLIBC_2.0)&lt;br /&gt;
               libc.so.6(GLIBC_2.1)&lt;br /&gt;
               libc.so.6(GLIBC_2.1.3)&lt;br /&gt;
               libc.so.6(GLIBC_2.3)&lt;br /&gt;
               openssl&lt;br /&gt;
               rpmlib(CompressedFileNames) &amp;lt;= 3.0.4-1&lt;br /&gt;
               rpmlib(PayloadFilesHavePrefix) &amp;lt;= 4.0-1&lt;br /&gt;
&lt;br /&gt;
     To check the integrity, use the &amp;quot;-K&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -K /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm: (sha1) dsa sha1 md5 gpg OK&lt;br /&gt;
&lt;br /&gt;
     To list all packages installed.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qa&lt;br /&gt;
&lt;br /&gt;
     To find out which file a package belongs to.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qf /usr/lib/libecpg.so.4.1&lt;br /&gt;
&lt;br /&gt;
     To uninstall a package&lt;br /&gt;
&lt;br /&gt;
         $ rpm -e&lt;br /&gt;
&lt;br /&gt;
     For building rpm packages reference the following:&lt;br /&gt;
       http://www-106.ibm.com/developerworks/library/l-rpm1/&lt;br /&gt;
&lt;br /&gt;
     To verify md5 sum so that you know it downloaded ok&lt;br /&gt;
&lt;br /&gt;
         $ rpm -K  *.rpm&lt;br /&gt;
&lt;br /&gt;
     The following is a good reference:&lt;br /&gt;
        http://www.rpm.org/max-rpm/s1-rpm-install-additional-options.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 75:&lt;br /&gt;
&lt;br /&gt;
     Listing Output from a Bash Script.&lt;br /&gt;
&lt;br /&gt;
     Add &amp;quot;set -x&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          #!/bin/bash&lt;br /&gt;
          set -x&lt;br /&gt;
          ls&lt;br /&gt;
          date&lt;br /&gt;
&lt;br /&gt;
     Will list the files and output as follows:&lt;br /&gt;
&lt;br /&gt;
           + ls&lt;br /&gt;
           ChangeLog  CVS  data  test&lt;br /&gt;
           + date&lt;br /&gt;
           Thu Jul  1 20:41:04 EDT 2004&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 76:&lt;br /&gt;
&lt;br /&gt;
     Using wget.&lt;br /&gt;
&lt;br /&gt;
     Grap a webpage and pipe it to less. For example suppose you wanted to pipe the&lt;br /&gt;
     contents of all these tips, directly from the web.&lt;br /&gt;
&lt;br /&gt;
      $ wget -O - http://sourceforge.net/direct-dl/mchirico/souptonuts/How_to_Linux_and_Open_Source.txt|less&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 77:&lt;br /&gt;
&lt;br /&gt;
     Finding IP address and MAC address.&lt;br /&gt;
&lt;br /&gt;
       $ /sbin/ifconfig&lt;br /&gt;
&lt;br /&gt;
     Note the following output &amp;quot;eth0&amp;quot; and &amp;quot;eth0:1&amp;quot; which means&lt;br /&gt;
     two IP addresses are tied to 1 NIC (Network Interface Card).&lt;br /&gt;
&lt;br /&gt;
             eth0      Link encap:Ethernet  HWaddr 00:50:DA:60:5B:AD&lt;br /&gt;
                       inet addr:192.168.1.155  Bcast:192.168.99.255  Mask:255.255.252.0&lt;br /&gt;
                       UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
                       RX packets:982757 errors:116 dropped:0 overruns:0 frame:116&lt;br /&gt;
                       TX packets:439297 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:1000&lt;br /&gt;
                       RX bytes:693529078 (661.4 Mb)  TX bytes:78400296 (74.7 Mb)&lt;br /&gt;
                       Interrupt:10 Base address:0xa800&lt;br /&gt;
&lt;br /&gt;
             eth0:1    Link encap:Ethernet  HWaddr 00:50:DA:60:5B:AD&lt;br /&gt;
                       inet addr:192.168.1.182  Bcast:192.168.3.255  Mask:255.255.252.0&lt;br /&gt;
                       UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
                       RX packets:982757 errors:116 dropped:0 overruns:0 frame:116&lt;br /&gt;
                       TX packets:439299 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:1000&lt;br /&gt;
                       RX bytes:693529078 (661.4 Mb)  TX bytes:78400636 (74.7 Mb)&lt;br /&gt;
                       Interrupt:10 Base address:0xa800&lt;br /&gt;
&lt;br /&gt;
             lo        Link encap:Local Loopback&lt;br /&gt;
                       inet addr:127.0.0.1  Mask:255.0.0.0&lt;br /&gt;
                       UP LOOPBACK RUNNING  MTU:16436  Metric:1&lt;br /&gt;
                       RX packets:785 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
                       TX packets:785 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:0&lt;br /&gt;
                       RX bytes:2372833 (2.2 Mb)  TX bytes:2372833 (2.2 Mb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 78:&lt;br /&gt;
&lt;br /&gt;
     DOS to UNIX and UNIX to DOS.&lt;br /&gt;
&lt;br /&gt;
        $ dos2unix file.txt&lt;br /&gt;
&lt;br /&gt;
     And to go the other way from UNIX to DOS&lt;br /&gt;
&lt;br /&gt;
        $ unix2dos unixfile&lt;br /&gt;
&lt;br /&gt;
     See the man page, since there are MAC options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     NOTE: If you're working file DOS files, you'll probably want to use&lt;br /&gt;
           &amp;quot;zip&amp;quot; instead of &amp;quot;gzip&amp;quot; so users on Windows can unzip them.&lt;br /&gt;
&lt;br /&gt;
              $ zip test.zip test.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 79:&lt;br /&gt;
&lt;br /&gt;
     Need to Run Interactive Commands? Try &amp;quot;expect&amp;quot;.&lt;br /&gt;
       http://expect.nist.gov/expect.tar.gz&lt;br /&gt;
&lt;br /&gt;
     This simple example waits for the input &amp;quot;hi&amp;quot;, in some form before&lt;br /&gt;
     returning, immediately, &amp;quot;hello there!&amp;quot;. Otherwise, it will wait for&lt;br /&gt;
     60 seconds, then, return &amp;quot;hello there!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/expect&lt;br /&gt;
          set timeout 60&lt;br /&gt;
          expect &amp;quot;hi\n&amp;quot;&lt;br /&gt;
          send &amp;quot;hello there!\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference:&lt;br /&gt;
        http://www.oreilly.com/catalog/expect/chapter/ch03.html&lt;br /&gt;
&lt;br /&gt;
        http://www.cotse.com/dlf/man/expect/bulletproof1.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 80:&lt;br /&gt;
&lt;br /&gt;
     Using PHP as a Command Line Scripting Language.&lt;br /&gt;
&lt;br /&gt;
     The following will grab the complete file from slashdot.&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/php -q&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;?php&lt;br /&gt;
         $fileName = &amp;quot;http://slashdot.org/slashdot.xml&amp;quot;;&lt;br /&gt;
         $rss = file($fileName) or die (&amp;quot;Cannot open file $fileName\n&amp;quot;);&lt;br /&gt;
         for ($index=0; $index &amp;lt; count($rss); $index++)&lt;br /&gt;
              {&lt;br /&gt;
              echo $rss[$index];&lt;br /&gt;
              }&lt;br /&gt;
         ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       Note, if you want an example that parses the XML of&lt;br /&gt;
       slashdot, then, download the following:&lt;br /&gt;
&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/php_scripts.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 81:&lt;br /&gt;
&lt;br /&gt;
     Discarding all output -- including stderr messages.&lt;br /&gt;
&lt;br /&gt;
         $ ls  &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     Or sending all output to a file&lt;br /&gt;
&lt;br /&gt;
         $ someprog &amp;gt; /tmp/file 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     Sometimes, find displays a lot of errors when searching through&lt;br /&gt;
     directories that the user doesn't have access to. To discard&lt;br /&gt;
     error messages &amp;quot;stderr&amp;quot;, which is normally file descripter &amp;quot;2&amp;quot;&lt;br /&gt;
     work the following:&lt;br /&gt;
&lt;br /&gt;
         $ find / -iname 'stuff' 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
          or to pipe results elsewhere&lt;br /&gt;
&lt;br /&gt;
         $ find / -iname 'stuff' &amp;gt; /tmp/results_of_find  2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 118).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 82:&lt;br /&gt;
&lt;br /&gt;
     Using MIX.  D. Knuth's  assembly language/machine-code instruction set used in&lt;br /&gt;
     his books to illustrate his algorithms.&lt;br /&gt;
&lt;br /&gt;
     Download the source:&lt;br /&gt;
&lt;br /&gt;
       http://sourceforge.net/project/showfiles.php?group_id=13897&lt;br /&gt;
&lt;br /&gt;
       $ ./configure&lt;br /&gt;
       $ make&lt;br /&gt;
       $ make install&lt;br /&gt;
&lt;br /&gt;
     Documentation can be found at the following link. The link on&lt;br /&gt;
     sourceforge is not correct, but, the one below works.&lt;br /&gt;
&lt;br /&gt;
       http://www.gnu.org/software/mdk/manual/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 83:&lt;br /&gt;
&lt;br /&gt;
     Gnuplot [ http://sourceforge.net/projects/gnuplot/ ].&lt;br /&gt;
&lt;br /&gt;
     This software is ideal for printing graphs.&lt;br /&gt;
&lt;br /&gt;
         gnuplot&amp;gt; set term png&lt;br /&gt;
         gnuplot&amp;gt; set output 'testcos.png'&lt;br /&gt;
         gnuplot&amp;gt; plot cos(x)*sin(x)&lt;br /&gt;
         gnuplot&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
     Or the following command can be put into &amp;quot;file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            $ cat &amp;gt; file&lt;br /&gt;
            set term png&lt;br /&gt;
            set output 'testcos.png'&lt;br /&gt;
            plot cos(x)*sin(x)&lt;br /&gt;
            exit&lt;br /&gt;
            ^D&lt;br /&gt;
&lt;br /&gt;
     Then, run as follows:&lt;br /&gt;
&lt;br /&gt;
            $ gnuplot file&lt;br /&gt;
&lt;br /&gt;
     Or, suppose you have the following file &amp;quot;/home/chirico/data&amp;quot;. Comments&lt;br /&gt;
     with &amp;quot;#&amp;quot; are not read by gnuplot.&lt;br /&gt;
&lt;br /&gt;
            # File /home/chirico/data&lt;br /&gt;
            #&lt;br /&gt;
            2005-07-26  1    2.3    3&lt;br /&gt;
            2005-07-27  2    3.4    5&lt;br /&gt;
            2005-07-28  3    4    6.6&lt;br /&gt;
            2005-07-29  4    6    2.5&lt;br /&gt;
&lt;br /&gt;
     And you have the following new &amp;quot;file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            set term png&lt;br /&gt;
            set xdata time&lt;br /&gt;
            set timefmt &amp;quot;%Y-%m-%d &amp;quot;&lt;br /&gt;
            set format x &amp;quot;%Y/%m/%d&amp;quot;&lt;br /&gt;
            set output '/var/www/html/chirico/gnuplot/data.png'&lt;br /&gt;
            plot '/home/chirico/data' using 1:2 w linespoints  title '1st col', \&lt;br /&gt;
             '/home/chirico/data' using 1:3 w linespoints  title '2nd col', \&lt;br /&gt;
             '/home/chirico/data' using 1:4 w linespoints  title '3rd col'&lt;br /&gt;
            exit&lt;br /&gt;
&lt;br /&gt;
     You can now get a graph of this data running the following:&lt;br /&gt;
&lt;br /&gt;
            $ gnuplot file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 84:&lt;br /&gt;
&lt;br /&gt;
     CPU Information - speed, processor, cache.&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/cpuinfo&lt;br /&gt;
&lt;br /&gt;
               processor       : 0&lt;br /&gt;
               vendor_id       : GenuineIntel&lt;br /&gt;
               cpu family      : 15&lt;br /&gt;
               model           : 2&lt;br /&gt;
               model name      : Intel(R) Pentium(R) 4 CPU 2.20GHz&lt;br /&gt;
               stepping        : 9&lt;br /&gt;
               cpu MHz         : 2193.221&lt;br /&gt;
               cache size      : 512 KB&lt;br /&gt;
               fdiv_bug        : no&lt;br /&gt;
               hlt_bug         : no&lt;br /&gt;
               f00f_bug        : no&lt;br /&gt;
               coma_bug        : no&lt;br /&gt;
               fpu             : yes&lt;br /&gt;
               fpu_exception   : yes&lt;br /&gt;
               cpuid level     : 2&lt;br /&gt;
               wp              : yes&lt;br /&gt;
               flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr&lt;br /&gt;
               bogomips        : 4325.37&lt;br /&gt;
&lt;br /&gt;
      &amp;quot;bogomips&amp;quot; is a rough but good way to quickly compare two computer speeds. True it's a&lt;br /&gt;
      bogus reading; but, a &amp;quot;good enough&amp;quot; for government work calculation.  See (TIP 10) for&lt;br /&gt;
      &amp;quot;vmstat&amp;quot; and &amp;quot;iostat&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 85:&lt;br /&gt;
&lt;br /&gt;
     POVRAY - Making Animated GIFs&lt;br /&gt;
&lt;br /&gt;
     To see this in action, reference:&lt;br /&gt;
      http://souptonuts.sourceforge.net/povray/orbit.pov.html&lt;br /&gt;
&lt;br /&gt;
     These are the basic command to create:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        $ povray orbit.ini -Iorbit.pov&lt;br /&gt;
        $ convert -delay 20 *.ppm orbit.gif&lt;br /&gt;
&lt;br /&gt;
     By the way, convert is a program from imagemagick, and it can&lt;br /&gt;
     be downloaded from ( http://www.imagemagick.org ).&lt;br /&gt;
&lt;br /&gt;
    The following is &amp;quot;orbit.pov&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          #include &amp;quot;colors.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;finish.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;metals.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;textures.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;stones.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;skies.inc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          camera {&lt;br /&gt;
            location &amp;lt; 2, 3, -8 &amp;gt;&lt;br /&gt;
            look_at  &amp;lt; 0, 0, 0 &amp;gt;&lt;br /&gt;
            focal_point &amp;lt;0, 0, 0&amp;gt;&lt;br /&gt;
            blur_samples 20&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          light_source {&lt;br /&gt;
                  &amp;lt; 0, 10, 0&amp;gt;&lt;br /&gt;
                  color White&lt;br /&gt;
                  area_light &amp;lt;2,0,0&amp;gt;,&amp;lt;0,0,2&amp;gt;, 2, 2&lt;br /&gt;
                  adaptive 1&lt;br /&gt;
                  fade_distance 8&lt;br /&gt;
                  fade_power 1&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          sky_sphere {&lt;br /&gt;
            S_Cloud3&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          plane { &amp;lt;0, 1, 0&amp;gt;, -1&lt;br /&gt;
                  texture {&lt;br /&gt;
                          pigment {&lt;br /&gt;
                                  checker color Blue, color White&lt;br /&gt;
                          }&lt;br /&gt;
                          finish {Phong_Glossy}&lt;br /&gt;
                  }&lt;br /&gt;
          }&lt;br /&gt;
          #declare ball0=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;0.5, 0.5, 0&amp;gt;, 1&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Yellow}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          #declare ball1=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;3, 2, 0&amp;gt;, 0.5&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Blue}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          #declare ball2=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;3, 1, 0&amp;gt;, 1&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Green}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          object {ball0 rotate 360*clock*y}&lt;br /&gt;
          object {ball1 rotate 720*clock*y}&lt;br /&gt;
          object {ball2 rotate 360*(1 - clock)*y}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    And, &amp;quot;orbit.ini&amp;quot; follows:&lt;br /&gt;
&lt;br /&gt;
          Output_File_Type=P&lt;br /&gt;
&lt;br /&gt;
          Width=320&lt;br /&gt;
          Height=240&lt;br /&gt;
&lt;br /&gt;
          Initial_Frame=1&lt;br /&gt;
          Final_Frame=10&lt;br /&gt;
          Antialias=true&lt;br /&gt;
&lt;br /&gt;
          Subset_Start_Frame=1&lt;br /&gt;
          Subset_End_Frame=10&lt;br /&gt;
&lt;br /&gt;
          Cyclic_Animation=on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 86:&lt;br /&gt;
&lt;br /&gt;
     GPG --  GnuPG&lt;br /&gt;
&lt;br /&gt;
        Reference: http://www.gnupg.org/documentation/faqs.html&lt;br /&gt;
                   http://codesorcery.net/mutt/mutt-gnupg-howto&lt;br /&gt;
                   http://www.gnupg.org/(en)/download/index.html&lt;br /&gt;
                   (SCRIPT 4) on following link:&lt;br /&gt;
                   http://prdownloads.sourceforge.net/souptonuts/README_common_script_commands.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Generage key:&lt;br /&gt;
&lt;br /&gt;
        $ gpg --gen-key&lt;br /&gt;
&lt;br /&gt;
     Generate public key ID and fingerprint&lt;br /&gt;
&lt;br /&gt;
        $ gpg --fingerprint&lt;br /&gt;
&lt;br /&gt;
     Get a list of keys:&lt;br /&gt;
&lt;br /&gt;
        $ gpg --list-keys&lt;br /&gt;
&lt;br /&gt;
          pub  1024D/A11C1499 2004-07-15 Mike Chirico &amp;lt;mchirico@comcast.net&amp;gt;&lt;br /&gt;
          sub  1024g/E1A3C2B3 2004-07-15&lt;br /&gt;
&lt;br /&gt;
     Encrypt&lt;br /&gt;
&lt;br /&gt;
        $ gpg -r Mike  --encrypt sample.txt&lt;br /&gt;
&lt;br /&gt;
       This will produce &amp;quot;sample.txt.asc&amp;quot;, which is a binary file.  Note, I can use &amp;quot;Mike&amp;quot; because that's the&lt;br /&gt;
       name on the list of keys. Again, it will be a binary file.&lt;br /&gt;
&lt;br /&gt;
     Encrypt using &amp;quot;ASCII-armored text&amp;quot;  (--armor), which is probably what you want when sending &amp;quot;in&amp;quot; the body of an&lt;br /&gt;
     email, or some document.&lt;br /&gt;
&lt;br /&gt;
        $ gpg  -r Mike  --encrypt --armor sample.txt&lt;br /&gt;
            or&lt;br /&gt;
        $ gpg -r Mike -e -a sample.txt&lt;br /&gt;
            or&lt;br /&gt;
        $ gpg --output somefile.asc --armor -r Mike  --encrypt --armor sample.txt&lt;br /&gt;
&lt;br /&gt;
     The above 3 statements will still produce &amp;quot;sample.txt.asc&amp;quot;, but look at it, or &amp;quot;$ cat sample.txt.asc&amp;quot; without &lt;br /&gt;
     fear, since there are no binary characters. Yes, you could even compile a program &amp;quot;$ g++ -o test test.c&amp;quot; , then,&lt;br /&gt;
     &amp;quot;$ gpg --output test.asc  -r Mike --encrypt --armor test&amp;quot;. However, when decrypting make sure to pipe&lt;br /&gt;
     the results.&lt;br /&gt;
&lt;br /&gt;
            $ gpg --decrypt test.asc &amp;gt; test&lt;br /&gt;
&lt;br /&gt;
     Export &amp;quot;public&amp;quot; key:&lt;br /&gt;
&lt;br /&gt;
           $ gpg --armor --export Mike &amp;gt; m1.asc&lt;br /&gt;
&lt;br /&gt;
     Signing the file &amp;quot;message.txt&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
           $ gpg --clearsign message.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Sending the key to the &amp;quot;key-server&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        First, list the keys.&lt;br /&gt;
&lt;br /&gt;
                $ gpg --list-keys&lt;br /&gt;
                    /home/chirico/.gnupg/pubring.gpg&lt;br /&gt;
                                 v------------------ Use this with &amp;quot;0x&amp;quot; in front -------&lt;br /&gt;
                  pub  1024D/A11C1499 2004-07-15 Mike Chirico  &amp;lt;mchirico@comcast.net&amp;gt;   |&lt;br /&gt;
                  sub  1024g/E1A3C2B3 2004-07-15                                        |&lt;br /&gt;
                                                                                        |&lt;br /&gt;
                                   v----------------------------------------------------&lt;br /&gt;
                $ gpg --send-keys 0xA11C1499&lt;br /&gt;
&lt;br /&gt;
             The above sends it to the keyserver defined in &amp;quot;/home/chirico/.gnupg/gpg.conf&amp;quot;.  Other key servers:&lt;br /&gt;
&lt;br /&gt;
                            wwwkeys.pgp.net&lt;br /&gt;
                            search.keyserver.net&lt;br /&gt;
                            pgp.ai.mit.edu&lt;br /&gt;
&lt;br /&gt;
             When you go to your user-group meetings, you need to bring 2 forms of ID, and&lt;br /&gt;
             list your Key fingerprint. Shown below is the command for getting this fingerprint.&lt;br /&gt;
&lt;br /&gt;
                $ gpg --fingerprint mchirico@comcast.net&lt;br /&gt;
                 pub   1024D/A11C1499 2004-07-15&lt;br /&gt;
                 Key fingerprint = 9D7F C80D BB7B 4BAB CCA4  1BE9 9056 5BEC A11C 1499&lt;br /&gt;
                 uid   Mike Chirico (http://souptonuts.sourceforge.net/chirico/index.php) &amp;lt;mchirico@comcast.net&amp;gt;&lt;br /&gt;
                 sub   1024g/E1A3C2B3 2004-07-15&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Receving keys:&lt;br /&gt;
&lt;br /&gt;
        The following will retrieve my mchirico@comcast.net key&lt;br /&gt;
&lt;br /&gt;
               $ gpg --recv-keys 0xA11C1499&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Special Note: If you get the following error &amp;quot;GPG: Warning: Using Insecure Memory&amp;quot; , then,&lt;br /&gt;
                   &amp;quot; chmod 4755 /path/to/gpg&amp;quot;  to setuid(root) permissioins on the gpg binary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     NOTE: If using mutt, just before sending with the &amp;quot;y&amp;quot; option, hit &amp;quot;p&amp;quot; to sign or encrypt.&lt;br /&gt;
&lt;br /&gt;
     It's possible to create a gpg/pgp email from the command line. For a tutorial on this,&lt;br /&gt;
     reference (SCRIPT 4) at the following link:&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/README_common_script_commands.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 87:&lt;br /&gt;
&lt;br /&gt;
     Working with Dates: Steffen Beyer has developed a Perl and C module for working with dates&lt;br /&gt;
&lt;br /&gt;
     This softare can be downloaded from the following location:&lt;br /&gt;
        http://www.engelschall.com/u/sb/download/pkg/Date-Calc-5.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
         $ wget http://www.engelschall.com/u/sb/download/pkg/Date-Calc-5.3.tar.gz&lt;br /&gt;
         $ tar -xzvf Date-Calc-5.3.tar.gz&lt;br /&gt;
         $ cd Date-Calc-5.3&lt;br /&gt;
         $ cp ./examples/cal.c .&lt;br /&gt;
         $ gcc cal.c DateCalc.c -o mcal&lt;br /&gt;
&lt;br /&gt;
     The file cal.c contains sample function calls from DateCalc.c.  Note, &amp;quot;DateCalc.c&amp;quot;&lt;br /&gt;
     is just a list of functions and includes for &amp;quot;DateCalc.h&amp;quot; and &amp;quot;ToolBox.h&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Or, and this may be easier, just download the following:&lt;br /&gt;
         http://prdownloads.sourceforge.net/cpearls/date_calc.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
     The above link contains a few examples.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 88:&lt;br /&gt;
&lt;br /&gt;
     Color patterns for mutt.&lt;br /&gt;
&lt;br /&gt;
     The colors can be changed in the /home/user/.muttrc file. The first field begins with&lt;br /&gt;
     color, the second field is the foreground color, and the third field is the background&lt;br /&gt;
     color, or default.&lt;br /&gt;
&lt;br /&gt;
     An example .muttrc for colors:&lt;br /&gt;
&lt;br /&gt;
       # color patterns for mutt&lt;br /&gt;
       color normal     white          black # normal text&lt;br /&gt;
       color indicator  black          yellow  # actual message&lt;br /&gt;
       color tree       brightmagenta  default # thread arrows&lt;br /&gt;
       color status     brightyellow         default # status line&lt;br /&gt;
       color error      brightred      default # errors&lt;br /&gt;
       color message    magenta        default # info messages&lt;br /&gt;
       color signature  magenta        default # signature&lt;br /&gt;
       color attachment brightyellow   red     # MIME attachments&lt;br /&gt;
       color search     brightyellow   red     # search matches&lt;br /&gt;
       color tilde      brightmagenta  default # ~ at bottom of msg&lt;br /&gt;
       color markers    red            default # + at beginning of wrapped lines&lt;br /&gt;
       color hdrdefault cyan           default # default header lines&lt;br /&gt;
       color bold       red            default # hiliting bold patterns in body&lt;br /&gt;
       color underline  green          default # hiliting underlined patterns in body&lt;br /&gt;
       color quoted     cyan           default # quoted text&lt;br /&gt;
       color quoted1    magenta        default&lt;br /&gt;
       color quoted2    red            default&lt;br /&gt;
       color quoted3    green          default&lt;br /&gt;
       color quoted4    magenta           default&lt;br /&gt;
       color quoted5    cyan           default&lt;br /&gt;
       color quoted6    magenta        default&lt;br /&gt;
       color quoted7    red            default&lt;br /&gt;
       color quoted8    green          default&lt;br /&gt;
       color quoted9    cyan           default&lt;br /&gt;
       color body   cyan  default  &amp;quot;((ftp|http|https)://|news:)[^ &amp;gt;)\&amp;quot;\t]+&amp;quot;&lt;br /&gt;
       color body   cyan  default  &amp;quot;[-a-z_0-9.+]+@[-a-z_0-9.]+&amp;quot;&lt;br /&gt;
       color body   red   default  &amp;quot;(^| )\\*[-a-z0-9*]+\\*[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color body   green default  &amp;quot;(^| )_[-a-z0-9_]+_[,.?]?[\n]&amp;quot;&lt;br /&gt;
       color body   red   default  &amp;quot;(^| )\\*[-a-z0-9*]+\\*[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color body   green default  &amp;quot;(^| )_[-a-z0-9_]+_[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color index  cyan  default  ~F         # Flagged&lt;br /&gt;
       color index  red   default  ~N         # New&lt;br /&gt;
       color index  magenta    default  ~T         # Tagged&lt;br /&gt;
       color index  cyan       default  ~D         # Deleted&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 190)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 89:&lt;br /&gt;
&lt;br /&gt;
     ps command in detail&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Here are the possible codes when using state &amp;quot;$ ps -e -o state,cmd&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             PROCESS STATE CODES&lt;br /&gt;
                  D   uninterruptible sleep (usually IO)&lt;br /&gt;
                  R   runnable (on run queue)&lt;br /&gt;
                  S   sleeping&lt;br /&gt;
                  T   traced or stopped&lt;br /&gt;
                  Z   a defunct (&amp;quot;zombie&amp;quot;) process&lt;br /&gt;
&lt;br /&gt;
                  &amp;lt;    high-priority (not nice to other users)&lt;br /&gt;
                  N    low-priority (nice to other users)&lt;br /&gt;
                  L    has pages locked into memory (for real-time and custom IO)&lt;br /&gt;
                  s    is a session leader&lt;br /&gt;
                  l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)&lt;br /&gt;
                  +    is in the foreground process group&lt;br /&gt;
&lt;br /&gt;
    For instance:&lt;br /&gt;
&lt;br /&gt;
     Note that the -o is for user defined, and -e is for select&lt;br /&gt;
     all process.&lt;br /&gt;
&lt;br /&gt;
       $ ps -e -o pid,state,start,time,etime,cmd&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
             9946 S 15:40:45 00:00:00    02:23:29 /bin/bash -i&lt;br /&gt;
             9985 T 15:41:24 00:00:01    02:22:50 emacs mout2&lt;br /&gt;
            10003 T 15:43:59 00:00:00    02:20:15 emacs NOTES&lt;br /&gt;
            10320 T 17:38:42 00:00:00       25:32 emacs stuff.c&lt;br /&gt;
         ...&lt;br /&gt;
&lt;br /&gt;
     You may want to command below, without the -e, which will give the&lt;br /&gt;
     process only under the current terminal.&lt;br /&gt;
&lt;br /&gt;
       $ ps -o pid,state,start,time,etime,cmd&lt;br /&gt;
&lt;br /&gt;
     Want to find what 's impacting your load?&lt;br /&gt;
&lt;br /&gt;
       $ ps -e -o %cpu,pid,state,start,time,etime,%cpu,%mem,cmd|sort -rn|less&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ ps aux&lt;br /&gt;
&lt;br /&gt;
            USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND&lt;br /&gt;
            root         1  0.0  0.0  1380  480 ?        S    Aug04   0:00 init [3]&lt;br /&gt;
            root         2  0.0  0.0     0    0 ?        SWN  Aug04   0:00 [ksoftirqd/0]&lt;br /&gt;
            root         3  0.0  0.0     0    0 ?        SW&amp;lt;  Aug04   0:00 [events/0]&lt;br /&gt;
            root         4  0.0  0.0     0    0 ?        SW&amp;lt;  Aug04   0:00 [khelper]&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     Or, if you want to see the environment add the -e option&lt;br /&gt;
&lt;br /&gt;
       $ ps aeux&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
            chirico   2735  0.0  0.1  4400 1492 pts/0    S    Aug04   0:00 -bash USER=chirico LOGNAME=chirico HOME=/home/chirico PATH=/usr/&lt;br /&gt;
            chirico   2771  0.0  0.0  4328  924 pts/0    S    Aug04   0:00 screen -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm S&lt;br /&gt;
            chirico   2772  0.0  0.6  9476 6352 ?        S    Aug04   0:54 SCREEN -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm S&lt;br /&gt;
            chirico   2773  0.0  0.1  4432 1548 pts/1    S    Aug04   0:10 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            chirico   2797  0.0  0.1  4416 1496 pts/2    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            root      2821  0.0  0.0  4100  952 pts/2    S    Aug04   0:00 su -&lt;br /&gt;
            root      2822  0.0  0.1  4384 1480 pts/2    S    Aug04   0:00 -bash&lt;br /&gt;
            chirico   2862  0.0  0.1  4428 1524 pts/3    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            sporkey   2946  0.0  0.2  6836 2960 ?        S    Aug04   0:15 fetchmail&lt;br /&gt;
            chirico   2952  0.0  0.1  4436 1552 pts/5    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            chirico   3880  0.0  0.1  4416 1496 pts/6    S    Aug05   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            root      3904  0.0  0.0  4100  956 pts/6    S    Aug05   0:00 su - donkey&lt;br /&gt;
            donkey    3905  0.0  0.1  4336 1452 pts/6    S    Aug05   0:00 -bash&lt;br /&gt;
            donkey    3938  0.0  0.2  6732 2856 ?        S    Aug05   0:14 fetchmail&lt;br /&gt;
            chirico   3944  0.0  0.1  4416 1496 pts/7    S    Aug05   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     There is also a -f &amp;quot;forrest&amp;quot; option. Also note below &amp;quot; -bash&amp;quot; is the start of a login shell.&lt;br /&gt;
&lt;br /&gt;
      $ ps aeuxwwf &lt;br /&gt;
     &lt;br /&gt;
     The ww option above gives a wide format with all variables. Use the above command if you plan&lt;br /&gt;
     to parse through a Perl script. Otherwise, it may be easier to do a quick read using the command&lt;br /&gt;
     below, without &amp;quot;ww&amp;quot;.    &lt;br /&gt;
&lt;br /&gt;
      $ ps aeuxf&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
            root      2339  0.0  0.1  3512 1444 ?        S    Dec01   0:00 /usr/sbin/sshd&lt;br /&gt;
            root     25651  0.0  0.1  6764 1980 ?        S    Dec23   0:00  \_ /usr/sbin/sshd&lt;br /&gt;
            chirico  25653  0.0  0.2  6840 2236 ?        S    Dec23   0:14      \_ /usr/sbin/sshd&lt;br /&gt;
            chirico  25654  0.0  0.1  4364 1440 pts/4    S    Dec23   0:00          \_ -bash USER=chirico LOGNAME=chirico HOME=/home/chirico&lt;br /&gt;
            chirico  25690  0.0  0.0  4328  920 pts/4    S    Dec23   0:00              \_ screen -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm&lt;br /&gt;
            root      2355  0.0  0.0  2068  904 ?        S    Dec01   0:00 xinetd -stayalive -pidfile /var/run/xinetd.pid&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     It is also possible to list the process by command line. For example, the following command will only list the emacs&lt;br /&gt;
     processes.&lt;br /&gt;
&lt;br /&gt;
      $ ps -fC emacs&lt;br /&gt;
       UID        PID  PPID  C STIME TTY          TIME CMD&lt;br /&gt;
       chirico   5049  5020  0 May11 pts/13   00:00:00 emacs -nw Notes&lt;br /&gt;
       chirico  12368  5104  0 May12 pts/18   00:00:00 emacs -nw dnotify.c&lt;br /&gt;
       chirico  19792 18028  0 May13 pts/20   00:00:00 emacs -nw hello.c&lt;br /&gt;
       chirico  14034 27367  0 18:52 pts/8    00:00:00 emacs -nw How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
     You may also want to consider using top in batch mode. Here the &amp;quot;-n 1&amp;quot; means refresh once,&lt;br /&gt;
     and the &amp;quot;b&amp;quot; is for batch. The &amp;quot;fmt -s&amp;quot; is to put it in a more readable format.&lt;br /&gt;
&lt;br /&gt;
       $ top -n 1 b |fmt  -s &amp;gt;&amp;gt;statfile&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 90:&lt;br /&gt;
&lt;br /&gt;
     Learning Assembly.&lt;br /&gt;
&lt;br /&gt;
     Once you have written the source, assuming the file is &amp;quot;exit.s&amp;quot;, it can be compiled as follows:&lt;br /&gt;
&lt;br /&gt;
            $ as exit.s -o exit.o&lt;br /&gt;
            $ ld exit.o -o exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Here is the program:&lt;br /&gt;
&lt;br /&gt;
         #&lt;br /&gt;
         #INPUT:  none&lt;br /&gt;
         #&lt;br /&gt;
         #OUTPUT:         returns a status code. This can be viewed&lt;br /&gt;
         # by typing&lt;br /&gt;
         #&lt;br /&gt;
         # echo $?&lt;br /&gt;
         #&lt;br /&gt;
         # after running the program&lt;br /&gt;
         #&lt;br /&gt;
         #VARIABLES:&lt;br /&gt;
         # %eax holds the system call number&lt;br /&gt;
         # (this is always the case)&lt;br /&gt;
         #&lt;br /&gt;
         # %ebx holds the return status&lt;br /&gt;
         #&lt;br /&gt;
                 .section .data&lt;br /&gt;
                 .section .text&lt;br /&gt;
&lt;br /&gt;
                 .globl _start&lt;br /&gt;
         _start:&lt;br /&gt;
                 movl $1, %eax # this is the linux kernel command&lt;br /&gt;
                 # number (system call) for exiting&lt;br /&gt;
                 # a program&lt;br /&gt;
                 movl $0, %ebx # this is the status number we will&lt;br /&gt;
                 # return to the operating system.&lt;br /&gt;
                 # Change this around and it will&lt;br /&gt;
                 # return different things to&lt;br /&gt;
                 # echo $?&lt;br /&gt;
                 int $0x80 # this wakes up the kernel to run&lt;br /&gt;
                 # the exit command&lt;br /&gt;
&lt;br /&gt;
     After running this program, you can get the exit code.&lt;br /&gt;
&lt;br /&gt;
            $ exit $?&lt;br /&gt;
            0&lt;br /&gt;
&lt;br /&gt;
     That is about all it does; but, get the book for more details. The&lt;br /&gt;
     book is free.&lt;br /&gt;
&lt;br /&gt;
          http://savannah.nongnu.org/download/pgubook/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 91:&lt;br /&gt;
&lt;br /&gt;
     Creating a sandbox for reiserfstune,debugreiserfs and ACL.  Also see TIP 4.&lt;br /&gt;
&lt;br /&gt;
     Assume you have a reisers files system created from a disk file, which&lt;br /&gt;
     means you have done something like the following:&lt;br /&gt;
&lt;br /&gt;
          # dd if=/dev/zero of=disk-rfs count=102400&lt;br /&gt;
          # losetup  /dev/loop4 ./disk-rfs&lt;br /&gt;
          # mkfs -t reiserfs /dev/loop4&lt;br /&gt;
          # mkdir /fs2&lt;br /&gt;
          # mount -o loop,acl ./disk-rfs /fs2&lt;br /&gt;
&lt;br /&gt;
     Now, you can run reiserfstune. But, first you will need to umount fs2&lt;br /&gt;
&lt;br /&gt;
          # umount /fs2&lt;br /&gt;
          # reiserfstune ./disk-rfs&lt;br /&gt;
&lt;br /&gt;
     Or you can run the debug command&lt;br /&gt;
&lt;br /&gt;
          # debugreiserfs -J ./disk-rfs&lt;br /&gt;
&lt;br /&gt;
     Now, suppose you run through a lot of the debug options on&lt;br /&gt;
     http://www.namesys.com/ and you destroy this file.&lt;br /&gt;
&lt;br /&gt;
     You can recreate the file and delete the loop device.&lt;br /&gt;
&lt;br /&gt;
          # dd if=/dev/zero of=disk-rfs count=102400&lt;br /&gt;
          # losetup -d /dev/loop4&lt;br /&gt;
          # mount -o loop,acl ./disk-rfs /fs2&lt;br /&gt;
&lt;br /&gt;
     Now, try working with some of the ACL options - you can only do this&lt;br /&gt;
     with the latest kernel and tools -- Fedora Core 2 will work.&lt;br /&gt;
&lt;br /&gt;
     Assume you have 3 users, donkey, chirico and bozo2. You can give&lt;br /&gt;
     everyone rights to this file system as follows:&lt;br /&gt;
&lt;br /&gt;
          # setfacl -R -m d:u:donkey:rwx,d:u:chirico:rwx,d:u:bozo2:rwx /fs2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 92:&lt;br /&gt;
&lt;br /&gt;
     SpamAssassin - Setup.&lt;br /&gt;
&lt;br /&gt;
     Step 1.&lt;br /&gt;
&lt;br /&gt;
           Installing the SpamAssassin CPAN utility. You will need to do this&lt;br /&gt;
           as root.&lt;br /&gt;
        &lt;br /&gt;
              $ su -&lt;br /&gt;
&lt;br /&gt;
           Once you have root privileges invoke cpan.&lt;br /&gt;
        &lt;br /&gt;
              # perl -MCPAN -e shell&lt;br /&gt;
&lt;br /&gt;
              cpan&amp;gt;&lt;br /&gt;
&lt;br /&gt;
           Now install with prerequisites policy set to ask.&lt;br /&gt;
        &lt;br /&gt;
              cpan&amp;gt; o conf prerequisites_policy ask&lt;br /&gt;
        &lt;br /&gt;
              cpan&amp;gt; install Mail::SpamAssassin&lt;br /&gt;
        &lt;br /&gt;
           You will get lots of output as the necessary modules are downloaded and&lt;br /&gt;
           compiled and installed.&lt;br /&gt;
&lt;br /&gt;
     Step 2.&lt;br /&gt;
&lt;br /&gt;
            Configuration.&lt;br /&gt;
&lt;br /&gt;
            Edit the following &amp;quot;/etc/mail/spamassassin/local.cf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            Here is a look at my file&lt;br /&gt;
&lt;br /&gt;
                $ cat /etc/mail/spamassassin/local.cf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                # This is the right place to customize your installation of SpamAssassin.&lt;br /&gt;
                #&lt;br /&gt;
                # See 'perldoc Mail::SpamAssassin::Conf' for details of what can be&lt;br /&gt;
                # tweaked.&lt;br /&gt;
                #&lt;br /&gt;
                ###########################################################################&lt;br /&gt;
                #&lt;br /&gt;
                # rewrite_subject 0&lt;br /&gt;
                # report_safe 1&lt;br /&gt;
                # trusted_networks 212.17.35.&lt;br /&gt;
                #&lt;br /&gt;
                &lt;br /&gt;
                # Below added from book&lt;br /&gt;
                # You may want to set this to 5, then, work your way down.&lt;br /&gt;
                # Currently I have this 3&lt;br /&gt;
                required_hits 3&lt;br /&gt;
                &lt;br /&gt;
                # This determines how spam is reported. Currently safe email is reported&lt;br /&gt;
                # in the message.&lt;br /&gt;
                report_safe 1&lt;br /&gt;
                &lt;br /&gt;
                # The will rewrite the tag of the spam message.&lt;br /&gt;
                rewrite_subject 1&lt;br /&gt;
                &lt;br /&gt;
                # By default, SpamAssassin will run RBL checks.  If your ISP already&lt;br /&gt;
                # does this, set this to 1.&lt;br /&gt;
                skip_rbl_checks 0&lt;br /&gt;
&lt;br /&gt;
     Step 3.&lt;br /&gt;
&lt;br /&gt;
            Update .procmail.&lt;br /&gt;
&lt;br /&gt;
            You should update the .procmail file as follows. Here is my /home/chirico/.procmail file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ cat /home/chirico/.procmailrc&lt;br /&gt;
&lt;br /&gt;
                PATH=/bin:/usr/bin:/usr/local/bin&lt;br /&gt;
                MAILDIR=/var/spool/mail&lt;br /&gt;
                DEFAULT=/var/spool/mail/chirico&lt;br /&gt;
                LOGFILE=/home/chirico/MailBAG&lt;br /&gt;
                MYHOME=/home/chirico&lt;br /&gt;
                #  Must have folder MailTRASH&lt;br /&gt;
                TRASH=/home/chirico/MailTRASH&lt;br /&gt;
                &lt;br /&gt;
                # Will get everything from this mail&lt;br /&gt;
                :0&lt;br /&gt;
                * ^From:.*sporkey@comcast.net&lt;br /&gt;
                        $DEFAULT&lt;br /&gt;
                &lt;br /&gt;
                # Spamassassin&lt;br /&gt;
                :0fw&lt;br /&gt;
                * &amp;lt;300000&lt;br /&gt;
                |/usr/local/bin/spamassassin&lt;br /&gt;
&lt;br /&gt;
      Reference:&lt;br /&gt;
        http://pm-doc.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 93:&lt;br /&gt;
&lt;br /&gt;
     Make Graphs: using dot and neato.&lt;br /&gt;
&lt;br /&gt;
       $ dot -Tpng dotfile -o myout.png&lt;br /&gt;
&lt;br /&gt;
     To see the output reference the following:&lt;br /&gt;
       http://souptonuts.sourceforge.net/code/myout.png&lt;br /&gt;
&lt;br /&gt;
     Where &amp;quot;dotfile&amp;quot; is the following:&lt;br /&gt;
&lt;br /&gt;
       $ cat dotfile&lt;br /&gt;
&lt;br /&gt;
       digraph g&lt;br /&gt;
       {&lt;br /&gt;
               node [shape = record];&lt;br /&gt;
&lt;br /&gt;
               node0 [ label =&amp;quot;&amp;lt;f0&amp;gt; stuff | &amp;lt;f1&amp;gt; J | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node1 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; E | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node4 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; C | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node6 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; I | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node2 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; U | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node5 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; N | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node9 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; Y | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node8 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; W | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node10 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; Z | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node7 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; A | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node3 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; G | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node0&amp;quot;:f0 -&amp;gt; &amp;quot;node1&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node0&amp;quot;:f2 -&amp;gt; &amp;quot;node2&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node1&amp;quot;:f0 -&amp;gt; &amp;quot;node4&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node1&amp;quot;:f2 -&amp;gt; &amp;quot;node6&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node4&amp;quot;:f0 -&amp;gt; &amp;quot;node7&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node4&amp;quot;:f2 -&amp;gt; &amp;quot;node3&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node2&amp;quot;:f0 -&amp;gt; &amp;quot;node5&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node2&amp;quot;:f2 -&amp;gt; &amp;quot;node9&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node9&amp;quot;:f0 -&amp;gt; &amp;quot;node8&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node9&amp;quot;:f2 -&amp;gt; &amp;quot;node10&amp;quot;:f1;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
     Checkout the following article:&lt;br /&gt;
        http://www.linuxjournal.com/article.php?sid=7275&lt;br /&gt;
&lt;br /&gt;
     To download this software&lt;br /&gt;
        http://www.graphviz.org/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 94:&lt;br /&gt;
&lt;br /&gt;
     Makefile: working with conditions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     First note that all the indentations of the file must be&lt;br /&gt;
     a single tab. There cannot be any spaces, or make will&lt;br /&gt;
     not run.&lt;br /&gt;
&lt;br /&gt;
       $ cat Makefile&lt;br /&gt;
&lt;br /&gt;
        # Compiler flags&lt;br /&gt;
        sqliteLIB := $(shell ls /usr/local/lib/libsqlite.so)&lt;br /&gt;
        sqlite3LIB := $(shell ls /usr/local/lib/libsqlite3.so)&lt;br /&gt;
        # all assumes sqlite and sqlite3 are installed&lt;br /&gt;
        #&lt;br /&gt;
&lt;br /&gt;
        test:&lt;br /&gt;
        ifeq (&amp;quot;$(sqlite3LIB)&amp;quot;,&amp;quot;/usr/local/lib/libsqlite3.so&amp;quot;)&lt;br /&gt;
             @echo -e &amp;quot;True -- we found the file&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
             @echo &amp;quot;False -- we did not find the file&amp;quot;&lt;br /&gt;
        endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     So, if I run make I will get the following output.&lt;br /&gt;
&lt;br /&gt;
       $ make&lt;br /&gt;
       True -- we found the file&lt;br /&gt;
&lt;br /&gt;
     This is because I have a file /usr/local/lib/libsqlite3.so on my system.&lt;br /&gt;
     Note how the assignment is made, with the shell command&lt;br /&gt;
&lt;br /&gt;
           sqlite3LIB := $(shell ls /usr/local/lib/libsqlite3.so)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 95:&lt;br /&gt;
&lt;br /&gt;
     Bash: Conditional Expressions&lt;br /&gt;
&lt;br /&gt;
          if [ -e /etc/ntp.conf ]&lt;br /&gt;
            then&lt;br /&gt;
              echo &amp;quot;You have the ntp config file&amp;quot;&lt;br /&gt;
            else&lt;br /&gt;
              echo &amp;quot;You do not have the ntp config file&amp;quot;&lt;br /&gt;
          fi&lt;br /&gt;
&lt;br /&gt;
       Now using an AND condition inside the [ ]. By the way, above, you&lt;br /&gt;
       can put the &amp;quot;then&amp;quot; on the same line as the if &amp;quot;if [ -e /etc/ntp.conf ]; then&amp;quot;&lt;br /&gt;
       as long as you use the &amp;quot;;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           if [ \( -e /etc/ntp.conf \) -a \( -e /etc/ntp/ntpservers \) ]&lt;br /&gt;
             then&lt;br /&gt;
               echo &amp;quot;You have ntp config and ntpservers&amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp.conf ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntp.conf &amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp/ntpservers ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntpservers &amp;quot;&lt;br /&gt;
             else&lt;br /&gt;
               echo &amp;quot; you have neither ntp.conf or ntpservers&amp;quot;&lt;br /&gt;
           fi&lt;br /&gt;
&lt;br /&gt;
        A few things to note above. Else if statement is written as &amp;quot;elif&amp;quot;, and when&lt;br /&gt;
        dealing with &amp;quot;(&amp;quot; you will need to insert &amp;quot;\(&amp;quot;. By the way &amp;quot;-o&amp;quot; can replace &amp;quot;-a&amp;quot;&lt;br /&gt;
        and the &amp;quot;-o&amp;quot; is for OR condition. AND can be done as follows too.&lt;br /&gt;
&lt;br /&gt;
           if [ -e /etc/ntp.conf ] &amp;amp;&amp;amp; [ -e /etc/ntp/ntpservers ]&lt;br /&gt;
             then&lt;br /&gt;
               echo &amp;quot;You have ntp config and ntpservers&amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp.conf ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntp.conf &amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp/ntpservers ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntpservers &amp;quot;&lt;br /&gt;
             else&lt;br /&gt;
               echo &amp;quot; you have neither ntp.conf or ntpservers&amp;quot;&lt;br /&gt;
           fi&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (files).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             -b file      True if file exists and is a block file&lt;br /&gt;
             -c file      True if file exists and is a character device file&lt;br /&gt;
             -d file      True if file exists and is a directory&lt;br /&gt;
             -e file      True if file exists&lt;br /&gt;
             -f file      True if file exists and is a regular file&lt;br /&gt;
             -g file      True if file exists and is set goup id&lt;br /&gt;
             -G file      True if owned by the effective group ID&lt;br /&gt;
&lt;br /&gt;
             -k file      True if &amp;quot;sticky&amp;quot; bit is set and file exists&lt;br /&gt;
             -L file      True if file exists and is a symbolic link&lt;br /&gt;
             -n string    True if string is non-null&lt;br /&gt;
&lt;br /&gt;
             -O file      Ture if file exists and is owned by the effective user ID&lt;br /&gt;
&lt;br /&gt;
             -p file      True if file is a named pipe (FIFO)&lt;br /&gt;
             -r file      True if file is readable&lt;br /&gt;
             -s file      True if file has size &amp;gt; 0&lt;br /&gt;
             -S file      True if file exists and is a socket&lt;br /&gt;
&lt;br /&gt;
             -t file      True if file is open and refers to a terminal.&lt;br /&gt;
             -u file      True if setuid bit is set&lt;br /&gt;
             -w file      True if file exists and is writeable&lt;br /&gt;
             -x file      True if file executable&lt;br /&gt;
             -x dir       True if directory can be searched&lt;br /&gt;
&lt;br /&gt;
             file1 -nt file2     True if file1 modification date newer than file2&lt;br /&gt;
             file1 -ot file2     True if file1 modification date older than file2&lt;br /&gt;
             file1 -ef file2     True if file1 and file2 have same inode&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (Integers).&lt;br /&gt;
&lt;br /&gt;
             -lt  Less than&lt;br /&gt;
             -le  Less than or equal&lt;br /&gt;
             -eq  Equal&lt;br /&gt;
             -ge  Greater than or equal&lt;br /&gt;
             -gt  Greater than&lt;br /&gt;
             -ne  Not equal&lt;br /&gt;
&lt;br /&gt;
          Example usage.&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
             {&lt;br /&gt;
               while read num value; do&lt;br /&gt;
                if [ $num -gt  2 ]; then&lt;br /&gt;
                  echo $value&lt;br /&gt;
                fi&lt;br /&gt;
               done&lt;br /&gt;
             } &amp;lt; somefile&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (Strings).&lt;br /&gt;
&lt;br /&gt;
             str1 = str2      str1 matches str2&lt;br /&gt;
             str1 != str2     str1 does not matches str2&lt;br /&gt;
             str1 &amp;lt; str2      str1 is less than str2&lt;br /&gt;
             str1 &amp;gt;  str2     str1 is greater than str2&lt;br /&gt;
             -n str1          str1 is not null (length greater than 0)&lt;br /&gt;
             -z str1          str1 is null (las length 0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 96:&lt;br /&gt;
&lt;br /&gt;
     CVS: Working with cvs&lt;br /&gt;
&lt;br /&gt;
      INITIAL REPOSITORY:&lt;br /&gt;
&lt;br /&gt;
       To create a repository, and this is normally done by the system admin. This&lt;br /&gt;
       is NOT creating a project to checkout, but the location where everything&lt;br /&gt;
       will be stored! The initial repository!&lt;br /&gt;
&lt;br /&gt;
             cvs -d repository_root_directory init&lt;br /&gt;
&lt;br /&gt;
       Or here is a specific example:&lt;br /&gt;
&lt;br /&gt;
             cvs -d /work/cvsREPOSITORY/   init&lt;br /&gt;
&lt;br /&gt;
       Creating a directory tree from scratch. For a new project, the easiest thing to&lt;br /&gt;
       do is probably to create an empty directory structure, like this:&lt;br /&gt;
&lt;br /&gt;
             $ mkdir sqlite_examples&lt;br /&gt;
             $ mkdir sqlite_examples/man&lt;br /&gt;
             $ mkdir sqlite_examples/testing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       After that, you use the import command to create the&lt;br /&gt;
       corresponding (empty) directory structure inside the repository:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             $ cd &amp;lt;directory&amp;gt;&lt;br /&gt;
             $ cvs -d repository_root_directory import  -m &amp;quot;Created directory structure&amp;quot; yoyodyne/dir yoyo start&lt;br /&gt;
&lt;br /&gt;
       Or, here is a specific example.&lt;br /&gt;
&lt;br /&gt;
             $  cd sqlite_examples&lt;br /&gt;
             $  cvs  -d /work/cvsREPOSITORY/ import -m 'test SQlite'  sqlite_examples sqlite_examples start&lt;br /&gt;
&lt;br /&gt;
       Now, you can delete the directory sqlite_examples, or go to another directory and type&lt;br /&gt;
       the following:&lt;br /&gt;
&lt;br /&gt;
             $ cvs -d /work/cvsREPOSITORY/ co sqlite_examples&lt;br /&gt;
&lt;br /&gt;
     COOL TOOLS:&lt;br /&gt;
&lt;br /&gt;
           1. cvsps&lt;br /&gt;
           2. cvsreport&lt;br /&gt;
&lt;br /&gt;
         cvsps which you can find at http://www.cobite.com/cvsps/cvsps-2.0rc1.tar.gz&lt;br /&gt;
&lt;br /&gt;
             $ cvsps -f README_sqlite_tutorial.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 97:&lt;br /&gt;
&lt;br /&gt;
     Common vi and vim commands&lt;br /&gt;
&lt;br /&gt;
           Command mode ESC&lt;br /&gt;
&lt;br /&gt;
                dd       delete&lt;br /&gt;
                u        undelete&lt;br /&gt;
                y        yank (copy to buffer)&lt;br /&gt;
                p/P      p before cursor/P after cursor&lt;br /&gt;
&lt;br /&gt;
                Ctl-g    show current line number&lt;br /&gt;
                shft-G   end of file&lt;br /&gt;
              n shft-G   move to line n&lt;br /&gt;
&lt;br /&gt;
               /stuff/   search&lt;br /&gt;
                  n   repeat in same direction&lt;br /&gt;
                  N   repeat in opposite direction&lt;br /&gt;
                  /return  repeat seach forward&lt;br /&gt;
                  ?return  repeat seach backward&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;dyy  Yank current line to buffer d&lt;br /&gt;
               &amp;quot;a7yy Yank next 7 lines to buffer a&lt;br /&gt;
                    or&lt;br /&gt;
               :1,7ya a  Yank [ya] lines 1,7 to buffer a&lt;br /&gt;
               :1,7ya b  Yank [ya] lines 1,7 to buffer b&lt;br /&gt;
&lt;br /&gt;
               :5 pu b   Put [pu] buffer b after line 5&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;dP   Put the content of buffer d before cursor&lt;br /&gt;
               &amp;quot;ap   Put the contents of buffer a after cursor&lt;br /&gt;
&lt;br /&gt;
               :1,4 w! file2  Write lines 1,4 to file2&lt;br /&gt;
               :1,3&lt;br /&gt;
&lt;br /&gt;
               :set nu     Display line numbers&lt;br /&gt;
               :set nonum  Turns off display&lt;br /&gt;
&lt;br /&gt;
               :e &amp;lt;filename&amp;gt; Edit a file in a new buffer&lt;br /&gt;
&lt;br /&gt;
            vim&lt;br /&gt;
               :split&lt;br /&gt;
               :split &amp;lt;filename&amp;gt;&lt;br /&gt;
               :sp &amp;lt;filename&amp;gt;&lt;br /&gt;
               :split new&lt;br /&gt;
&lt;br /&gt;
                   ctl-w   To move between windows&lt;br /&gt;
                   ctl-w+&lt;br /&gt;
                   ctl-w-  To change size&lt;br /&gt;
                   ctl+wv  Split windows vertically&lt;br /&gt;
                   ctl-wq  Close window&lt;br /&gt;
&lt;br /&gt;
               :only       To view only 1 window&lt;br /&gt;
&lt;br /&gt;
            vim dictionary - put the following command in ~/.vimrc&lt;br /&gt;
&lt;br /&gt;
                   set dictionary+=/usr/share/dict/words&lt;br /&gt;
                   set thesaurus+=/usr/share/dict/words&lt;br /&gt;
              &lt;br /&gt;
               Now, after you type a word &amp;lt;ctl-x&amp;gt;&amp;lt;ctl-k&amp;gt;&amp;lt;ctl-n&amp;gt; and to &lt;br /&gt;
               go back in the listing &amp;lt;ctl-p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                   butter&amp;lt;ctl-x&amp;gt;&amp;lt;ctl-k&amp;gt;&amp;lt;ctl-n&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 98:&lt;br /&gt;
&lt;br /&gt;
     Using apt-get&lt;br /&gt;
&lt;br /&gt;
          $ apt-get update&lt;br /&gt;
          $ apt-get -s install &amp;lt;pkage&amp;gt;    &amp;lt;---- if everything is ok, then, remove the s&lt;br /&gt;
&lt;br /&gt;
     Note you may want to use dpkg to purge if you have to do a reinstall.&lt;br /&gt;
&lt;br /&gt;
          $ dpkg --purge exim4-base&lt;br /&gt;
          $ dpkg --purge exim4-config&lt;br /&gt;
          $ apt-get install exim4&lt;br /&gt;
&lt;br /&gt;
          $ dpkg-reconfigure exim4-config&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 99:&lt;br /&gt;
&lt;br /&gt;
     Mounting a cdrom on openbsd and installing packages&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /cdrom&lt;br /&gt;
          $ mount /dev/cd0a /cdrom&lt;br /&gt;
          $ cd /cdrom&lt;br /&gt;
&lt;br /&gt;
     To add packages&lt;br /&gt;
&lt;br /&gt;
          $ pkg_add -v  &amp;lt;directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Mounting a cdrom on linux to a user's home sub-directory:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /home/chirico/cdrom&lt;br /&gt;
          $ mount /dev/cdrom /home/chirico/cdrom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 100:&lt;br /&gt;
&lt;br /&gt;
    Creating a boot floppy for knoppix cd:&lt;br /&gt;
&lt;br /&gt;
          $ dd if=/mnt/cdrom/KNOPPIX/boot.img of=/dev/fd0 bs=1440k&lt;br /&gt;
&lt;br /&gt;
    References:&lt;br /&gt;
        http://www.knoppix.net/docs/index.php/BootFloppyHowTo&lt;br /&gt;
&lt;br /&gt;
    For a lot of the knoppix how-to's&lt;br /&gt;
        http://www.knoppix.net/docs/index.php/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 101:&lt;br /&gt;
&lt;br /&gt;
    Diction and Style Tools for Linux  http://ftp.gnu.org/gnu/diction/&lt;br /&gt;
&lt;br /&gt;
        $ diction mytext|less&lt;br /&gt;
&lt;br /&gt;
    Or, this can be done interactively&lt;br /&gt;
&lt;br /&gt;
        $ diction&lt;br /&gt;
        This is more text to read and you can do with it&lt;br /&gt;
        what you want.&lt;br /&gt;
        (stdin):1: This is more text to read and you [can -&amp;gt; (do not confuse with &amp;quot;may&amp;quot;)] do with it what you want.&lt;br /&gt;
&lt;br /&gt;
    DESCRIPTION&lt;br /&gt;
       Diction finds all sentences in a document, that contain phrases from  a&lt;br /&gt;
       database  of  frequently  misused,  bad  or  wordy diction.  It further&lt;br /&gt;
       checks for double words.  If no files are given, the document  is  read&lt;br /&gt;
       from  standard input.  Each found phrase is enclosed in [ ] (brackets).&lt;br /&gt;
       Suggestions and advice, if any, are printed headed by a right arrow -&amp;gt;.&lt;br /&gt;
       A  sentence is a sequence of words, that starts with a capitalised word&lt;br /&gt;
       and ends with a full stop, double colon, question mark or  exclaimation&lt;br /&gt;
       mark.  A single letter followed by a dot is considered an abbreviation,&lt;br /&gt;
       so it does not terminate a sentence.   Various  multi-letter  abbrevia-&lt;br /&gt;
       tions are recognized, they do not terminate a sentence as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 102:&lt;br /&gt;
&lt;br /&gt;
    Using a mail alias.&lt;br /&gt;
&lt;br /&gt;
       Suppose all root mail on your system to go to one root account root@main.com&lt;br /&gt;
&lt;br /&gt;
       In the following file:&lt;br /&gt;
&lt;br /&gt;
             /etc/aliases&lt;br /&gt;
&lt;br /&gt;
       Add this line&lt;br /&gt;
&lt;br /&gt;
             root:    root@main.com&lt;br /&gt;
&lt;br /&gt;
       Next, run newaliases [/usr/bin/newaliases] as follows:&lt;br /&gt;
&lt;br /&gt;
             $ newaliases&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Special note: It's possible to send mail to more than one address. Suppose you want&lt;br /&gt;
                     mail going to root@main.com above, plus you want it going to user donkey&lt;br /&gt;
                     on the local system.&lt;br /&gt;
&lt;br /&gt;
             root:  root@main.com donkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 103:&lt;br /&gt;
&lt;br /&gt;
    Chrony - this service is similiar to ntp. It keeps accurate time&lt;br /&gt;
            on your computer against a very accurate clock in across&lt;br /&gt;
            a network with various time delays.&lt;br /&gt;
&lt;br /&gt;
    Reference: http://go.to/chrony&lt;br /&gt;
&lt;br /&gt;
        In the file &amp;quot;/etc/chrony/chrony.conf&amp;quot; add/replace the following&lt;br /&gt;
&lt;br /&gt;
             server 146.186.218.60&lt;br /&gt;
             server 128.118.25.3&lt;br /&gt;
             server 128.2.129.21&lt;br /&gt;
&lt;br /&gt;
        Next start the chrony service&lt;br /&gt;
&lt;br /&gt;
           $ /etc/init.d/chrony restart&lt;br /&gt;
&lt;br /&gt;
     Next verify that this is working. It may take 20 or 30 minutes to update&lt;br /&gt;
     the clock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Shell command:&lt;br /&gt;
       # chronyc&lt;br /&gt;
       chronyc&amp;gt; sourcestats&lt;br /&gt;
       210 Number of sources = 3&lt;br /&gt;
       Name/IP Address            NP  NR  Span  Frequency   Freq Skew   Std Dev&lt;br /&gt;
       ========================================================================&lt;br /&gt;
       b50.cede.psu.edu            2   0    64       0.000    2000.000  4000ms&lt;br /&gt;
       otc2.psu.edu                2   0    66       0.000    2000.000  4000ms&lt;br /&gt;
       FS3.ECE.CMU.EDU             2   0    64       0.000    2000.000  4000ms&lt;br /&gt;
       chronyc&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    It is probably best to let chrony do its work. However, if you want to&lt;br /&gt;
    set both the hardware and software clock, the following will work:&lt;br /&gt;
&lt;br /&gt;
      Sets the hardware clock&lt;br /&gt;
        # hwclock --set --date=&amp;quot;12/10/04 10:18:05&amp;quot;&lt;br /&gt;
      Sync the hardware clock to software&lt;br /&gt;
        # hwclock --hctosys&lt;br /&gt;
&lt;br /&gt;
    Normally the system keep accurate time with the software clock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 104:&lt;br /&gt;
&lt;br /&gt;
    NFS mount&lt;br /&gt;
&lt;br /&gt;
     SERVER (192.168.1.182)&lt;br /&gt;
&lt;br /&gt;
       Make sure nfs is running on the server&lt;br /&gt;
 &lt;br /&gt;
           $ /etc/init.d/nfs restart&lt;br /&gt;
&lt;br /&gt;
       At the server the contents of /etc/exports for&lt;br /&gt;
       allowing 2 computers (192.168.1.171 and 192.168.1.71)&lt;br /&gt;
       to access the home directory of this server. Note that&lt;br /&gt;
       read write (rw) access is allowed.&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/exports&lt;br /&gt;
         /home   192.168.1.171(rw)&lt;br /&gt;
         /home   192.168.1.71(rw)&lt;br /&gt;
&lt;br /&gt;
       Or, if you have a lot of clients on 192.168.1.* then consider&lt;br /&gt;
       the following:&lt;br /&gt;
&lt;br /&gt;
          /home 192.168.1.0/255.255.252.0(rw)&lt;br /&gt;
&lt;br /&gt;
       Next, still at the server, run the exportfs command&lt;br /&gt;
&lt;br /&gt;
          $ exportfs -rv&lt;br /&gt;
&lt;br /&gt;
       IPTABLES (lokkit). If you're using fedora with default lokkit firewall&lt;br /&gt;
                then you can put the following under &amp;quot;Other ports&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                  Other ports nfs:tcp nfs:udp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       If the above does not work or you are not using lokkit&lt;br /&gt;
        IPTABLES (values in /etc/sysconfig/iptables on SERVER )&lt;br /&gt;
&lt;br /&gt;
        # NFS Need to accept fragmented packets and may not have header&lt;br /&gt;
        #             so you will not know where they are coming from&lt;br /&gt;
        -A INPUT -f -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -m tcp -s 192.168.1.171 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -s 192.168.1.171 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -m udp -s 192.168.1.171 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -s 192.168.1.171 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        &lt;br /&gt;
        -A INPUT -f -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -m tcp -s 192.168.1.71 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -s 192.168.1.71 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -m udp -s 192.168.1.71 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -s 192.168.1.71 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        (Reference: http://nfs.sourceforge.net/nfs-howto/server.html)&lt;br /&gt;
                  and&lt;br /&gt;
        (Reference: http://nfs.sourceforge.net/nfs-howto/security.html)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     CLIENT1 (192.168.1.171)&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /home2&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/fstab&lt;br /&gt;
         192.168.1.182:/home          /home2     nfs     rw 0 0&lt;br /&gt;
&lt;br /&gt;
          $ mount -a -t nfs&lt;br /&gt;
&lt;br /&gt;
        Or to do a one time mounting by hand&lt;br /&gt;
&lt;br /&gt;
          $ mount -t nfs 192.168.1.182:/home  /home2&lt;br /&gt;
&lt;br /&gt;
        Now /home2 on the client will be /home on the server&lt;br /&gt;
&lt;br /&gt;
        Reference:&lt;br /&gt;
          http://nfs.sourceforge.net/nfs-howto/index.html&lt;br /&gt;
&lt;br /&gt;
     MONITOR NFS:&lt;br /&gt;
&lt;br /&gt;
        To monitor the client:&lt;br /&gt;
&lt;br /&gt;
          $ nfsstat -c&lt;br /&gt;
&lt;br /&gt;
           Also note you can &amp;quot;cat /proc/net/rpc/nfs&amp;quot; as well.&lt;br /&gt;
&lt;br /&gt;
       To monitor the server (note the -s instead of the -c).&lt;br /&gt;
&lt;br /&gt;
         $ nfsstat -s&lt;br /&gt;
&lt;br /&gt;
           Also note you can &amp;quot;cat /proc/net/rpc/nfsd&amp;quot; as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       The following &amp;quot;cat&amp;quot; command is done on the NFS server, and shows which&lt;br /&gt;
       clients are mounting. This does not go with examples above. By the way,&lt;br /&gt;
       &amp;quot;root_squash&amp;quot; is the default, and means that root access on the clients is&lt;br /&gt;
       denied. So, how does the client root get access to these filesystems? You have&lt;br /&gt;
       to &amp;quot;su - &amp;lt;someuser&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
              $ cat /proc/fs/nfs/exports&lt;br /&gt;
              # Version 1.1&lt;br /&gt;
              # Path Client(Flags) # IPs&lt;br /&gt;
              /home   192.168.1.102(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   squeezel.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   192.168.1.106(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   livingroom.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   10.8.0.1(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   closet.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
&lt;br /&gt;
     (Reference: http://www.vanemery.com/Linux/NFSv4/NFSv4-no-rpcsec.html#automount )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 105:&lt;br /&gt;
&lt;br /&gt;
      Ports used for Microsoft products&lt;br /&gt;
               http://www.microsoft.com/canada/smallbiz/sgc/articles/ref_net_ports_ms_prod.mspx?pf=true&lt;br /&gt;
          Firewalling?&lt;br /&gt;
               http://www.microsoft.com/technet/prodtechnol/windowsserver2003/library/ServerHelp/428c1bbf-2ceb-4f76-a1ef-0219982eca10.mspx&lt;br /&gt;
&lt;br /&gt;
      To find out common port mappings, take a look at &amp;quot;/etc/services&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 106:&lt;br /&gt;
&lt;br /&gt;
      Man pages: If man pages are formatting incorrectly with PuTTY, try editing&lt;br /&gt;
      the &amp;quot;/etc/man.config&amp;quot; file with the following changes:&lt;br /&gt;
&lt;br /&gt;
           NROFF /usr/bin/groff -Tlatin1 -mandoc&lt;br /&gt;
           NEQN /usr/bin/geqn -Tlatin1&lt;br /&gt;
&lt;br /&gt;
         (Reference TIP 7 for using man)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 107:&lt;br /&gt;
&lt;br /&gt;
      Valgrind: check for memory leaks in your programs. (http://valgrind.org/)&lt;br /&gt;
&lt;br /&gt;
       This is how you can run it on the program &amp;quot;a.out&amp;quot; for valgrind version 2.2.0&lt;br /&gt;
&lt;br /&gt;
         $ valgrind --logfile=valgrind.output   --tool=memcheck ./a.out&lt;br /&gt;
&lt;br /&gt;
       This is how you write the logfile &amp;quot;--log-file&amp;quot; for valgrind-3.0.1&lt;br /&gt;
&lt;br /&gt;
         $ valgrind  --log-file=valgrind --leak-check=yes --tool=memcheck ./a.out&lt;br /&gt;
&lt;br /&gt;
       With C++ programs with gcc 3.4 and later that use STL, export GLIBCXX_FORCE_NEW &lt;br /&gt;
       only when testing to disable memory caching. Remember to enable for production&lt;br /&gt;
       as this will have a performance penalty. Reference  http://valgrind.org/docs/FAQ/ &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 108:&lt;br /&gt;
&lt;br /&gt;
      Runlevel Configuring.&lt;br /&gt;
&lt;br /&gt;
       These two programs, run as root give you a ncurses GUI to what will&lt;br /&gt;
       run on your system on boot.&lt;br /&gt;
&lt;br /&gt;
            # ntsysv&lt;br /&gt;
&lt;br /&gt;
            # chkconfig&lt;br /&gt;
&lt;br /&gt;
       Note, you can also set these manually. For example, normally you will&lt;br /&gt;
       have files in &amp;quot;/etc/init.d/&amp;quot; that will take parameters like &amp;quot;start&amp;quot;,&amp;quot;stop&amp;quot;&lt;br /&gt;
       &amp;quot;restart&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       Take a look at &amp;quot;/etc/init.d/mysql&amp;quot; this file will start and stop the&lt;br /&gt;
       mysql daemon. So, how does know which run levels, and the order it gets&lt;br /&gt;
       loaded in the run level to other programs? By the K&amp;lt;number&amp;gt; and S&amp;lt;number&amp;gt;&lt;br /&gt;
       values.&lt;br /&gt;
&lt;br /&gt;
            $ ls /etc/rc3.d/*mysql&lt;br /&gt;
&lt;br /&gt;
                /etc/rc3.d/K85mysql&lt;br /&gt;
                /etc/rc3.d/S85mysql&lt;br /&gt;
&lt;br /&gt;
       So here on my system the start value is 85. Looking in /etc/rc3.d, which is&lt;br /&gt;
       run level 3, any program with a lower number S84something will get loaded&lt;br /&gt;
       before mysql.&lt;br /&gt;
&lt;br /&gt;
       I manually set the run level as follows for mysql.&lt;br /&gt;
&lt;br /&gt;
            # cd /etc/rc3.d&lt;br /&gt;
            # ln -s ../init.d/mysql S85mysql&lt;br /&gt;
            # ln -s ../init.d/mysql K85mysql&lt;br /&gt;
&lt;br /&gt;
            # cd /etc/rc5.d&lt;br /&gt;
            # ln -s ../init.d/mysql S85mysql&lt;br /&gt;
            # ln -s ../init.d/mysql K85mysql&lt;br /&gt;
&lt;br /&gt;
       Note that I could have chose other numbers as well. &amp;quot;ntsysv&amp;quot; gives&lt;br /&gt;
       you a graphical interface.&lt;br /&gt;
&lt;br /&gt;
       This is a way of doing this with &amp;quot;chkconfig&amp;quot; at the command prompt.&lt;br /&gt;
&lt;br /&gt;
            # chkconfig --list mysqld&lt;br /&gt;
            mysqld          0:off   1:off   2:off   3:on    4:off   5:on    6:off&lt;br /&gt;
&lt;br /&gt;
       Above you can see it's on. Here's how we would have turned this on with chkconfig.&lt;br /&gt;
&lt;br /&gt;
            # chkconfig --level 35 mysqld on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 109:&lt;br /&gt;
&lt;br /&gt;
       File Alteration Monitor - Gamin a FAM replacement&lt;br /&gt;
        http://www.gnome.org/~veillard/gamin/&lt;br /&gt;
        http://www.gnome.org/~veillard/gamin/sources/&lt;br /&gt;
       ******  EXAMPLE NOT COMPLETE *****&lt;br /&gt;
&lt;br /&gt;
       Working with fam  - file alteration monitor.  Mail uses this to signify&lt;br /&gt;
           a change in a file's status.&lt;br /&gt;
&lt;br /&gt;
        Below is the sample C program ftest.c which can be compiled as&lt;br /&gt;
        follows:&lt;br /&gt;
&lt;br /&gt;
              $ gcc -o ftest ftest.c  -lfam&lt;br /&gt;
&lt;br /&gt;
        You will need to work with this as root&lt;br /&gt;
&lt;br /&gt;
              #  ./ftest &amp;lt;somefile absolute path&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Reference:&lt;br /&gt;
            http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?db=man&amp;amp;fname=/usr/share/catman/p_man/cat3x/fam.z&lt;br /&gt;
            http://www.devchannel.org/devtoolschannel/04/05/13/2146252.shtml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 110:&lt;br /&gt;
&lt;br /&gt;
       glibc - this is the main library used by C, and the following&lt;br /&gt;
        link below gives you examples on everything from sockets,math,&lt;br /&gt;
        date and time functions, user environment, and much more.&lt;br /&gt;
&lt;br /&gt;
         http://www.gnu.org/software/libc/manual/html_mono/libc.html&lt;br /&gt;
&lt;br /&gt;
       How do you know which version of glibc you are running?&lt;br /&gt;
&lt;br /&gt;
          #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
          #include &amp;lt;gnu/libc-version.h&amp;gt;&lt;br /&gt;
          int main (void)&lt;br /&gt;
           {&lt;br /&gt;
             puts (gnu_get_libc_version ());&lt;br /&gt;
             return 0;&lt;br /&gt;
           }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 111:&lt;br /&gt;
&lt;br /&gt;
       nslookup and dig - query Internet name servers interactively.&lt;br /&gt;
&lt;br /&gt;
         $ nslookup&lt;br /&gt;
         &amp;gt;chirico.org&lt;br /&gt;
         Server:        68.80.0.6&lt;br /&gt;
         Address:       68.80.0.6#53&lt;br /&gt;
&lt;br /&gt;
         Name: chirico.org&lt;br /&gt;
         Address: 66.35.250.210&lt;br /&gt;
         &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      The nslookup command will query the dns server is &amp;quot;/etc/resolve.conf&amp;quot;&lt;br /&gt;
      However, you can force a certain dns with &amp;quot;- server&amp;quot;.  For example the&lt;br /&gt;
      command below goes to the server named dilbert&lt;br /&gt;
&lt;br /&gt;
         $ nslookup - dilbert&lt;br /&gt;
         &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      dig:&lt;br /&gt;
&lt;br /&gt;
      dig gives you more information. You should probably use dig instead&lt;br /&gt;
      of nslookup.&lt;br /&gt;
&lt;br /&gt;
      Below I am forcing the lookup from DNS 68.80.0.6 of the name chirico.org, and&lt;br /&gt;
      note that the query time is return too.&lt;br /&gt;
&lt;br /&gt;
         $ dig @68.80.0.6  +qr chirico.org&lt;br /&gt;
&lt;br /&gt;
         ; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.2.1 &amp;lt;&amp;lt;&amp;gt;&amp;gt; @68.80.0.6 +qr chirico.org&lt;br /&gt;
         ;; global options:  printcmd&lt;br /&gt;
         ;; Sending:&lt;br /&gt;
         ;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 55908&lt;br /&gt;
         ;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0&lt;br /&gt;
        &lt;br /&gt;
         ;; QUESTION SECTION:&lt;br /&gt;
         ;chirico.org.                   IN      A&lt;br /&gt;
        &lt;br /&gt;
         ;; Got answer:&lt;br /&gt;
         ;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 55908&lt;br /&gt;
         ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
        &lt;br /&gt;
         ;; QUESTION SECTION:&lt;br /&gt;
         ;chirico.org.                   IN      A&lt;br /&gt;
        &lt;br /&gt;
         ;; ANSWER SECTION:&lt;br /&gt;
         chirico.org.            5538    IN      A       66.35.250.210&lt;br /&gt;
        &lt;br /&gt;
         ;; AUTHORITY SECTION:&lt;br /&gt;
         chirico.org.            30599   IN      NS      ns78.worldnic.com.&lt;br /&gt;
         chirico.org.            30599   IN      NS      ns77.worldnic.com.&lt;br /&gt;
        &lt;br /&gt;
         ;; ADDITIONAL SECTION:&lt;br /&gt;
         ns78.worldnic.com.      16022   IN      A       216.168.225.218&lt;br /&gt;
         ns77.worldnic.com.      7       IN      A       216.168.228.41&lt;br /&gt;
        &lt;br /&gt;
         ;; Query time: 155 msec&lt;br /&gt;
         ;; SERVER: 68.80.0.6#53(68.80.0.6)&lt;br /&gt;
         ;; WHEN: Thu Dec 23 07:48:23 2004&lt;br /&gt;
         ;; MSG SIZE  rcvd: 127&lt;br /&gt;
&lt;br /&gt;
      So what if you wanted to know what name the IP address 66.35.250.210&lt;br /&gt;
      resolves to, when using dns 68.80.0.12.&lt;br /&gt;
&lt;br /&gt;
          $ dig @68.80.0.12 -x 66.35.250.210&lt;br /&gt;
          ...&lt;br /&gt;
          ;; ANSWER SECTION:&lt;br /&gt;
          210.250.35.66.in-addr.arpa. 3600 IN   CNAME   210.0/24.250.35.66.in-addr.arpa.&lt;br /&gt;
          210.0/24.250.35.66.in-addr.arpa. 3600 IN PTR  vhost.sourceforge.net.&lt;br /&gt;
&lt;br /&gt;
      Above you can see it resolved to &amp;quot;vhost.sourceforge.net&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      Reference ( http://www.tldp.org/HOWTO/DNS-HOWTO-5.html )&lt;br /&gt;
        Also see TIP 223.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 112:&lt;br /&gt;
&lt;br /&gt;
       Using GNU Autotools - so you can produce the familiar &amp;quot;./configure&amp;quot;  &amp;quot;make&amp;quot;  and &amp;quot;make install&amp;quot;&lt;br /&gt;
                             commands. There is also a &amp;quot;make dist&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                The program sqlite3api.cc and the rest of this code can be found at&lt;br /&gt;
                 http://prdownloads.sourceforge.net/cpearls/autotools.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         A &amp;quot;Makefile.am&amp;quot; is required:&lt;br /&gt;
&lt;br /&gt;
            bin_PROGRAMS = sprog&lt;br /&gt;
            sprog_SOURCES = sqlite3api.cc&lt;br /&gt;
            sprog_LDADD = @INCLUDES@ @SQLIBOBJS@&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         In addition, a &amp;quot;configure.in&amp;quot; file is required. Note, AC_CHECK_LIB will&lt;br /&gt;
         check the &amp;quot;libsqlite3.so&amp;quot; file for the &amp;quot;sqlite3_open&amp;quot; file. Note that&lt;br /&gt;
         &amp;quot;sqlite3&amp;quot;, is a shortcut for &amp;quot;libsqlite3&amp;quot; by convention. If this file&lt;br /&gt;
         is not found, AC_CHECK_FILE looks for &amp;quot;/usr/local/lib/libsqlite3.a&amp;quot;. If&lt;br /&gt;
         this is found, then, &amp;quot;-lsqlite3&amp;quot; is added to the LIBS environment variable.&lt;br /&gt;
         Also, &amp;quot;-I/usr/local/include&amp;quot; and &amp;quot;-L/usr/local/lib&amp;quot; will be added on the&lt;br /&gt;
         command line. This is common when some one does not have the library in&lt;br /&gt;
         the path.  (See TIP 49)&lt;br /&gt;
&lt;br /&gt;
            dnl Process this file with autoconf to produce a configure script.&lt;br /&gt;
            AC_INIT(sqlite3api.cc)&lt;br /&gt;
            AM_INIT_AUTOMAKE(sqliteprog, 1.0)&lt;br /&gt;
            AC_PROG_CXX&lt;br /&gt;
            CXXFLAGS='-Wall -W -O2 -s -pipe'&lt;br /&gt;
            AC_CHECK_LIB(sqlite3,sqlite3_open,[],found=no)&lt;br /&gt;
             if test &amp;quot;$found&amp;quot; = &amp;quot;no&amp;quot;; then&lt;br /&gt;
               AC_CHECK_FILE(/usr/local/lib/libsqlite3.a, found=yes)&lt;br /&gt;
               if test &amp;quot;$found&amp;quot; = &amp;quot;yes&amp;quot;; then&lt;br /&gt;
                 LIBS=&amp;quot;$LIBS -lsqlite3&amp;quot;&lt;br /&gt;
                 INCLUDES=&amp;quot;$INCLUDES -I/usr/local/include&amp;quot;&lt;br /&gt;
                 EXTRALIB='-L/usr/local/lib'&lt;br /&gt;
                else&lt;br /&gt;
                 echo &amp;quot;Are you SURE sqlite3 is installed?&amp;quot;&lt;br /&gt;
               fi&lt;br /&gt;
             fi&lt;br /&gt;
            SQLIBOBJS='-Wl,-R/usr/local/lib'&lt;br /&gt;
            AC_SUBST(INCLUDES)&lt;br /&gt;
            AC_SUBST(SQLIBOBJS)&lt;br /&gt;
            AC_SUBST(EXTRALIB)&lt;br /&gt;
            AC_OUTPUT(Makefile)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         To build the configure file, just run the following:&lt;br /&gt;
&lt;br /&gt;
             $ aclocal&lt;br /&gt;
             $ autoconf&lt;br /&gt;
             $ touch NEWS README AUTHORS ChangeLog&lt;br /&gt;
             $ automake --add-missing&lt;br /&gt;
&lt;br /&gt;
         Now if you want to make a tar.gz file &amp;quot;sqliteprog-1.0.tar.gz&amp;quot;, then&lt;br /&gt;
         all you have to run is the following:&lt;br /&gt;
&lt;br /&gt;
             $ make dist&lt;br /&gt;
&lt;br /&gt;
         Note: did you ever want to save all the output from a ./configure? Well, it&lt;br /&gt;
               is automatically saved in the &amp;quot;config.log&amp;quot; file. In fact, this file may&lt;br /&gt;
               contain a lot more than what you saw on the screen.&lt;br /&gt;
&lt;br /&gt;
               Also, you may need to rerun ./configure. But before you do, delete&lt;br /&gt;
               the &amp;quot;config.cache&amp;quot; file to get a clean build.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 113:&lt;br /&gt;
&lt;br /&gt;
       EMACS - common emacs commands.&lt;br /&gt;
&lt;br /&gt;
         M is the ESC&lt;br /&gt;
         C or c is the Ctl&lt;br /&gt;
&lt;br /&gt;
        Shell - when working in a shell. &amp;quot;M-x rename-uniquely&amp;quot; is good for split screen editing.&lt;br /&gt;
&lt;br /&gt;
          M-x rename-uniquely   Use this for multiple shells (renames buffer so it's not the same shell)&lt;br /&gt;
          C-c C-z               Send job in background (when working in a shell)&lt;br /&gt;
          C-c C-o               commit-kill-output (gets rid of a lot of shell output)&lt;br /&gt;
          C-c C-r               reposition at beginning of output&lt;br /&gt;
          C-c C-e               reposition at end of output&lt;br /&gt;
          M-x send-invisible    Hide passwords - use this before typing a password&lt;br /&gt;
&lt;br /&gt;
         Note: if the shell prompt does not show up correctly, then, you may want to creat a &amp;quot;.emacs_bash&amp;quot;&lt;br /&gt;
               file with the following contents:&lt;br /&gt;
&lt;br /&gt;
                          PS1=&amp;quot;emacs:\W \$ &amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Directories  (C-x d) give you a directory listing. You know all those annoying &amp;quot;~&amp;quot; and &amp;quot;#&amp;quot;&lt;br /&gt;
                     file that you get? You can easily delete these when in &amp;quot;dired&amp;quot; mode by hitting&lt;br /&gt;
                     &amp;quot;~&amp;quot;, then  &amp;quot;d&amp;quot; to flag it for delete. Then, hit &amp;quot;x&amp;quot; to and confirm deletion.&lt;br /&gt;
&lt;br /&gt;
                     These are other command that work on highlighted files in &amp;quot;dired&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
                          R   rename&lt;br /&gt;
                          v   view&lt;br /&gt;
                          Z   compress the file&lt;br /&gt;
                          +   create directory&lt;br /&gt;
&lt;br /&gt;
        Other common commands:&lt;br /&gt;
&lt;br /&gt;
          c-x l          list the line you are on, and how many lines in the document.&lt;br /&gt;
                         You will get something like: Page has 4881 lines (4440 + 442),&lt;br /&gt;
                         which means you are on the 4440 line.&lt;br /&gt;
&lt;br /&gt;
          c-x rm bookmark make&lt;br /&gt;
          c-x rb bookmark bounce&lt;br /&gt;
        &lt;br /&gt;
          c-x rb notes&lt;br /&gt;
          c-x rb emacs&lt;br /&gt;
        &lt;br /&gt;
          c-x / &amp;lt;r&amp;gt; (save position in register &amp;lt;r&amp;gt;)&lt;br /&gt;
          c-x j &amp;lt;r&amp;gt; (jump to position in register &amp;lt;r&amp;gt;)&lt;br /&gt;
          c-x r SPC 1 (mark current point in register 1)&lt;br /&gt;
          c-x r j 1 (jump to marked point in register 1)&lt;br /&gt;
          c-x r t &amp;lt;string&amp;gt;  (insert string into register)&lt;br /&gt;
        &lt;br /&gt;
          c-x r s 1 (save marked region in register 1)&lt;br /&gt;
          c-x r i 1 (insert marked region)&lt;br /&gt;
        &lt;br /&gt;
          c-x c-o (delete all blank lines, except one)&lt;br /&gt;
        &lt;br /&gt;
          c-x z (repeat the last command ... stop with an a)&lt;br /&gt;
          c-x zz (repeat the last command twice)&lt;br /&gt;
&lt;br /&gt;
          rectangle&lt;br /&gt;
          ---------&lt;br /&gt;
          C-SPC&lt;br /&gt;
          goto the next region&lt;br /&gt;
          C-x&lt;br /&gt;
          C-x&lt;br /&gt;
          then, C-x r r &amp;quot;name of register&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
          to insert the register&lt;br /&gt;
          C-x r i &amp;quot;name of register&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
          macros:&lt;br /&gt;
          -------&lt;br /&gt;
          c-x (    start macro&lt;br /&gt;
          c-x )    end macro&lt;br /&gt;
          c-x e    execute macro&lt;br /&gt;
        &lt;br /&gt;
          mail:&lt;br /&gt;
          -----&lt;br /&gt;
          c-x m   mail&lt;br /&gt;
          c-c c-s send&lt;br /&gt;
        &lt;br /&gt;
          C-x C-e&lt;br /&gt;
          (insert &amp;quot;\n\nExtra Line of text&amp;quot;)&lt;br /&gt;
        &lt;br /&gt;
          ;; chirico functions in .emacs&lt;br /&gt;
          ;; This creates an html template&lt;br /&gt;
          (defun my-html ()&lt;br /&gt;
          (interactive)&lt;br /&gt;
          (insert &amp;quot;&amp;lt;html&amp;gt;&lt;br /&gt;
          &amp;lt;head&amp;gt;&lt;br /&gt;
          &amp;lt;META HTTP-EQUIV=\&amp;quot;Pragma\&amp;quot; CONTENT=\&amp;quot;no-cache\&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;META HTTP-EQUIV=\&amp;quot;Expires\&amp;quot; CONTENT=\&amp;quot;-1\&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;/head&amp;gt;&lt;br /&gt;
          &amp;lt;body bgcolor=\&amp;quot;#ffffff\&amp;quot;&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
          &amp;lt;/body&amp;gt;&lt;br /&gt;
          &amp;lt;/html&amp;gt;&amp;quot;)&lt;br /&gt;
          )&lt;br /&gt;
&lt;br /&gt;
     Backspace issues when using &amp;quot;emacs -nw&amp;quot;? They putting the following in your &amp;quot;~/.emacs&amp;quot; file&lt;br /&gt;
&lt;br /&gt;
             (global-set-key &amp;quot;\C-d&amp;quot; 'backward-delete-char)&lt;br /&gt;
             (global-set-key &amp;quot;\C-h&amp;quot; 'backward-delete-char)&lt;br /&gt;
             (global-set-key (kbd &amp;quot;DEL&amp;quot;) 'delete-char)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 114:&lt;br /&gt;
&lt;br /&gt;
        ncftpget - an intelligent ftp client (http://www.ncftp.com/). Also&lt;br /&gt;
                   check your fedora or debian install. This package allows&lt;br /&gt;
                   you to easily download packages from ftp sites.&lt;br /&gt;
&lt;br /&gt;
          This is an example of connect to an ftp site, with a subdirectory, and&lt;br /&gt;
          downloading all in one command.&lt;br /&gt;
&lt;br /&gt;
           $ ncftpget ftp://ftp.gnu.org/pub/gnu/gcc/gcc-3.2.3/gcc-3.2.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
          Of if you want to get the fedora core 3 installs&lt;br /&gt;
&lt;br /&gt;
           $ ncftpget ftp://ftp.linux.ncsu.edu/pub/fedora/linux/core/3/i386/iso/FC3*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 115:&lt;br /&gt;
&lt;br /&gt;
        expr - evaluate expressions. You can use this on the command line&lt;br /&gt;
&lt;br /&gt;
           $ expr 6 + 4&lt;br /&gt;
           10&lt;br /&gt;
&lt;br /&gt;
         Note the spaces. Without spaces, you get the following:&lt;br /&gt;
&lt;br /&gt;
           $ expr 6+4&lt;br /&gt;
           6+4&lt;br /&gt;
&lt;br /&gt;
         If you're using &amp;quot;*&amp;quot;, you'll need a &amp;quot;\&amp;quot; before it&lt;br /&gt;
&lt;br /&gt;
           $ expr 10 \* 10&lt;br /&gt;
           100&lt;br /&gt;
&lt;br /&gt;
         This also works for variables&lt;br /&gt;
&lt;br /&gt;
           $ var1=34&lt;br /&gt;
           $ expr $var1 + 3&lt;br /&gt;
           37&lt;br /&gt;
&lt;br /&gt;
         or&lt;br /&gt;
&lt;br /&gt;
           $ var1=2&lt;br /&gt;
           $ var1=`expr $var1 \* 2`&lt;br /&gt;
           $ echo $var1&lt;br /&gt;
           4&lt;br /&gt;
&lt;br /&gt;
         see (TIP 25) you can get the cosine(.23)&lt;br /&gt;
&lt;br /&gt;
           $ var1=`echo &amp;quot;c(.23)&amp;quot;|bc -l`&lt;br /&gt;
           $ echo $var1&lt;br /&gt;
           .97366639500537483696&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         You can also do substrings:&lt;br /&gt;
&lt;br /&gt;
           $ expr substr &amp;quot;BigBear&amp;quot; 4 4&lt;br /&gt;
           Bear&lt;br /&gt;
&lt;br /&gt;
         And length of strings&lt;br /&gt;
&lt;br /&gt;
           $ mstr=&amp;quot;12345&amp;quot;&lt;br /&gt;
           $ expr length $mstr&lt;br /&gt;
           5&lt;br /&gt;
&lt;br /&gt;
         Regular expressions&lt;br /&gt;
&lt;br /&gt;
           $ expr &amp;quot;a3&amp;quot; : [a-z][1-9]&lt;br /&gt;
           2&lt;br /&gt;
&lt;br /&gt;
         Or you can get a bit fancy&lt;br /&gt;
&lt;br /&gt;
           $ myexpr=&amp;quot;[a-z][1-9]&amp;quot;&lt;br /&gt;
           $ echo $myexpr&lt;br /&gt;
           [a-z][1-9]&lt;br /&gt;
&lt;br /&gt;
           $ expr &amp;quot;a3&amp;quot; : $myexpr&lt;br /&gt;
           2&lt;br /&gt;
&lt;br /&gt;
         This may not be the best way to find out if it is Friday, but&lt;br /&gt;
         it seems to work. It's more of an exercise in xargs.&lt;br /&gt;
&lt;br /&gt;
           $ date&lt;br /&gt;
           Fri Dec 31 16:44:47 EST 2004&lt;br /&gt;
           $ date|xargs -i expr {} : &amp;quot;[Fri]&amp;quot;&lt;br /&gt;
           1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 116:&lt;br /&gt;
&lt;br /&gt;
        eval&lt;br /&gt;
&lt;br /&gt;
           $ mypipe=&amp;quot;|&amp;quot;&lt;br /&gt;
           $ eval ls $mypipe wc&lt;br /&gt;
           6       6     129&lt;br /&gt;
&lt;br /&gt;
        Did you catch that? The above statement is the same as&lt;br /&gt;
&lt;br /&gt;
           $ ls | wc&lt;br /&gt;
&lt;br /&gt;
        Where &amp;quot;|&amp;quot; is put into the variable $mypipe&lt;br /&gt;
&lt;br /&gt;
        (also see TIP 118)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 117:&lt;br /&gt;
&lt;br /&gt;
        lxr, glimpse, patchset - tools for reading the kernel source&lt;br /&gt;
&lt;br /&gt;
          This example puts some of the files in /home/src since my home&lt;br /&gt;
          partition is the largest. Plus, you do not want to over write&lt;br /&gt;
          the source in /usr/src/ If you want to put your files elsewhere&lt;br /&gt;
          just substitute /home/src for your desired directory.&lt;br /&gt;
&lt;br /&gt;
         patchset -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ export SRCDIR=/home/src&lt;br /&gt;
            $ cd $SRCDIR&lt;br /&gt;
            $ wget http://www.csn.ul.ie/~mel/projects/patchset/patchset-0.5.tar.gz&lt;br /&gt;
            $ export PATH=$PATH:$SRCDIR/patchset-0.5/bin&lt;br /&gt;
&lt;br /&gt;
          Now edit &amp;quot;/home/src/patchset-0.5/etc/patchset.conf&amp;quot; and set WWW_USER to&lt;br /&gt;
          whatever your website runs as&lt;br /&gt;
&lt;br /&gt;
                  export WWW_USER=nobody&lt;br /&gt;
&lt;br /&gt;
          Getting kernel source. The last step builds and asks a lot of questions. Enter&lt;br /&gt;
          yes to things that interest you, since this is what you will see in the source&lt;br /&gt;
          code. It is not going to build for booting. The &amp;quot;downlaod -p&amp;quot; is for downloading&lt;br /&gt;
          a patch.&lt;br /&gt;
&lt;br /&gt;
            $ download 2.6.10&lt;br /&gt;
            $ createset 2.6.10&lt;br /&gt;
            $ make-kernel -b 2.6.10&lt;br /&gt;
&lt;br /&gt;
        glimpse -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ mkdir -p /home/src/glimpse&lt;br /&gt;
            $ cd /home/src/glimpse&lt;br /&gt;
            $ wget http://webglimpse.net/trial/glimpse-latest.tar.gz&lt;br /&gt;
            $ tar -xzf glimpse-latest.tar.gz&lt;br /&gt;
            $ cd glimpse-4.18.0&lt;br /&gt;
            $ ./configure; make&lt;br /&gt;
            $ make install&lt;br /&gt;
&lt;br /&gt;
        lxr -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ make -p /home/src/lxr&lt;br /&gt;
            $ cd /home/src/lxr&lt;br /&gt;
            $ wget http://heanet.dl.sourceforge.net/sourceforge/lxr/lxr-0.3.1.tar.gz&lt;br /&gt;
            $ cd lxr-0.3&lt;br /&gt;
&lt;br /&gt;
          Edit &amp;quot;Makefile&amp;quot; and set PERLBIN to &amp;quot;/usr/bin/perl&amp;quot; or the where perl is&lt;br /&gt;
          on your system. Also set INSTALLPREFIX to &amp;quot;/var/www/lxr&amp;quot;.  Then, as root&lt;br /&gt;
          do the following:&lt;br /&gt;
&lt;br /&gt;
            $ make install&lt;br /&gt;
&lt;br /&gt;
         Apache changes&lt;br /&gt;
&lt;br /&gt;
          Next edit the apache httpd.conf. On my system it is&lt;br /&gt;
          &amp;quot;/usr/local/apache2/conf/httpd.conf&amp;quot;, but if you did a fedora install&lt;br /&gt;
          I think this file is located at &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             Alias  /lxr/ &amp;quot;/var/www/lxr/&amp;quot;&lt;br /&gt;
             &amp;lt;Directory &amp;quot;/var/www/lxr/&amp;quot;&amp;gt;&lt;br /&gt;
               Options ExecCGI Indexes Includes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride all&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
&lt;br /&gt;
              &amp;lt;Files ~ (search|source|ident|diff|find)&amp;gt;&lt;br /&gt;
                    SetHandler cgi-script&lt;br /&gt;
              &amp;lt;/Files&amp;gt;&lt;br /&gt;
             &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          lxr - continued &amp;quot;/var/www/lxr/http/lxr.conf&amp;quot; changes.  The following contains&lt;br /&gt;
                my lxr.conf with changes made to almost every variable. Make sure you use&lt;br /&gt;
                your website in place of 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
                 # Configuration file.&lt;br /&gt;
                &lt;br /&gt;
                 # Define typed variable &amp;quot;v&amp;quot;, read valueset from file.&lt;br /&gt;
                 variable: v, Version, [/var/www/lxr/source/versions], [/var/www/lxr/source/defversion]&lt;br /&gt;
                &lt;br /&gt;
                 # Define typed variable &amp;quot;a&amp;quot;.  First value is default.&lt;br /&gt;
                 variable: a, Architecture, (i386, alpha, m68k, mips, ppc, sparc, sparc64)&lt;br /&gt;
                &lt;br /&gt;
                 # Define the base url for the LXR files.&lt;br /&gt;
                 baseurl: http://192.168.1.71/lxr/http/&lt;br /&gt;
                &lt;br /&gt;
                 # These are the templates for the HTML heading, directory listing and&lt;br /&gt;
                 # footer, respectively.&lt;br /&gt;
                 htmlhead: /var/www/lxr/http/template-head&lt;br /&gt;
                 htmltail: /var/www/lxr/http/template-tail&lt;br /&gt;
                 htmldir:  /var/www/lxr/http/template-dir&lt;br /&gt;
                &lt;br /&gt;
                 # The source is here.&lt;br /&gt;
                 sourceroot: /var/www/lxr/source/$v/&lt;br /&gt;
                 srcrootname: Linux&lt;br /&gt;
                &lt;br /&gt;
                 # &amp;quot;#include &amp;lt;foo.h&amp;gt;&amp;quot; is mapped to this directory (in the LXR source&lt;br /&gt;
                 # tree)&lt;br /&gt;
                 incprefix: /include&lt;br /&gt;
                &lt;br /&gt;
                 # The database files go here.&lt;br /&gt;
                 dbdir: /var/www/lxr/source/$v/&lt;br /&gt;
                &lt;br /&gt;
                 # Glimpse can be found here.&lt;br /&gt;
                 glimpsebin: /usr/local/bin/glimpse&lt;br /&gt;
                &lt;br /&gt;
                 # The power of regexps.  This is pretty Linux-specific, but quite&lt;br /&gt;
                 # useful.  Tinker with it and see what it does.  (How's that for&lt;br /&gt;
                 # documentation?)&lt;br /&gt;
                 map: /include/asm[^\/]*/ /include/asm-$a/&lt;br /&gt;
                 map: /arch/[^\/]+/ /arch/$a/&lt;br /&gt;
&lt;br /&gt;
         Now you should be ready to run &amp;quot;make-lxr&amp;quot;. Make sure the path is setup to patchset,&lt;br /&gt;
         which is repeated here. The last step take awhile.&lt;br /&gt;
&lt;br /&gt;
            $ export SRCDIR=/home/src&lt;br /&gt;
            $ cd $SRCDIR&lt;br /&gt;
            $ export PATH=$PATH:$SRCDIR/patchset-0.5/bin&lt;br /&gt;
&lt;br /&gt;
            $  make-lxr 2.6.10&lt;br /&gt;
&lt;br /&gt;
         Now you need to index the source. Below the ./glimpse_* file will be put in&lt;br /&gt;
         root. Checkout the -H option if you do not want them here on a temporary&lt;br /&gt;
         bases of if you run out of room.&lt;br /&gt;
&lt;br /&gt;
            $ glimpseindex -o -t -w 5000 /var/www/lxr/source/2.6.10 &amp;gt;&amp;amp; .glimpse_out&lt;br /&gt;
&lt;br /&gt;
         Since the above put the files under /root/.glimpse_* they should be moved&lt;br /&gt;
&lt;br /&gt;
            $ mv /root/.glimps_* /var/www/lxr/source/2.6.10/.&lt;br /&gt;
            $ chown -R nobody.nobody ./.glimpse_*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 118:&lt;br /&gt;
&lt;br /&gt;
        exec - you can change standard output and input without starting a new&lt;br /&gt;
               process.&lt;br /&gt;
&lt;br /&gt;
          The exec redirect the output from ls and date to a file. Nothing&lt;br /&gt;
          is show on the terminal until &amp;quot;exec &amp;gt; /dev/tty&amp;quot; is performed&lt;br /&gt;
&lt;br /&gt;
            $ exec &amp;gt; mfile&lt;br /&gt;
            $ ls&lt;br /&gt;
            $ date&lt;br /&gt;
            $ exec &amp;gt; /dev/tty&lt;br /&gt;
&lt;br /&gt;
          This is an example of assigning file descriptor 3 to file &amp;quot;output3&amp;quot; for&lt;br /&gt;
          output, then, redirecting &amp;quot;ls&amp;quot; to this descriptor. Finally, file descriptor&lt;br /&gt;
          3 is used for input, and the contents are read into the cat command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
            $ exec 3&amp;gt;output3&lt;br /&gt;
            $ ls  &amp;gt;&amp;amp; 3&lt;br /&gt;
            $ exec 3&amp;lt;output3&lt;br /&gt;
            $ cat &amp;lt;&amp;amp;3&lt;br /&gt;
            ChangeLog&lt;br /&gt;
            CVS&lt;br /&gt;
            How_to_Linux_and_Open_Source.txt&lt;br /&gt;
            How_to_Linux_and_Open_Source.txt.~1.193.~&lt;br /&gt;
            mfile&lt;br /&gt;
            mfile2&lt;br /&gt;
            mfile3&lt;br /&gt;
            mftp&lt;br /&gt;
            output3&lt;br /&gt;
&lt;br /&gt;
        Could you redirect the output to 3 files and stderr?&lt;br /&gt;
&lt;br /&gt;
            $ exec 3&amp;gt;output3&lt;br /&gt;
            $ exec 4&amp;gt;output4&lt;br /&gt;
            $ exec 5&amp;gt;output5&lt;br /&gt;
&lt;br /&gt;
            $ ls &amp;gt;&amp;amp; 3 &amp;gt;&amp;amp; 4 &amp;gt;&amp;amp; 5 &amp;gt;&amp;amp; 2   // Nope, can't do this.&lt;br /&gt;
            output3  output4  output5&lt;br /&gt;
&lt;br /&gt;
         Instead, you should do the following:&lt;br /&gt;
&lt;br /&gt;
            $ ls | tee output3 | tee output4 |tee output5&lt;br /&gt;
&lt;br /&gt;
         Closing the &amp;quot;output&amp;quot; file descriptor&lt;br /&gt;
&lt;br /&gt;
            $ &amp;gt;&amp;amp;3-&lt;br /&gt;
&lt;br /&gt;
         Closing the &amp;quot;input&amp;quot; file descriptor&lt;br /&gt;
&lt;br /&gt;
            $ 3&amp;lt;&amp;amp;-&lt;br /&gt;
&lt;br /&gt;
         See what is still open on 0-10&lt;br /&gt;
&lt;br /&gt;
            $ lsof -a -p $$ -d 0-10&lt;br /&gt;
&lt;br /&gt;
         Recursion - the following counts to 5, then, quits.&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
            sleep 1&lt;br /&gt;
            declare -x n&lt;br /&gt;
            let n=${n:=0}+1&lt;br /&gt;
            [ $n -le 5 ] &amp;amp;&amp;amp; echo &amp;quot;$n&amp;quot; &amp;amp;&amp;amp;  exec $0&lt;br /&gt;
&lt;br /&gt;
         There are some real-life applications for this technique, as follows:&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
            declare -x N&lt;br /&gt;
            declare -x n&lt;br /&gt;
            N=${N:=$(od -vAn -N1 -tu4 &amp;lt; /dev/urandom)}&lt;br /&gt;
            let n=${n:=0}+1&lt;br /&gt;
            [ $(($n%2)) -eq 0 ] &amp;amp;&amp;amp; echo &amp;quot;She Loves Me!&amp;quot; || echo &amp;quot;She Loves Me NOT!&amp;quot;&lt;br /&gt;
            [ $n -lt $N ] &amp;amp;&amp;amp;  exec $0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 119:&lt;br /&gt;
&lt;br /&gt;
        runlevel - need to know the current runlevel?&lt;br /&gt;
&lt;br /&gt;
           $ who -r&lt;br /&gt;
           run-level 3  Dec 31 19:02                   last=S&lt;br /&gt;
&lt;br /&gt;
        Need to know the architecture?&lt;br /&gt;
&lt;br /&gt;
          $ arch&lt;br /&gt;
          i686&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 120:&lt;br /&gt;
&lt;br /&gt;
        at - executes commands at a specified time.&lt;br /&gt;
&lt;br /&gt;
         A few examples here. The 1970 program will run&lt;br /&gt;
         next Auguest 2 even though the year 1970 has long past.&lt;br /&gt;
&lt;br /&gt;
          $ at 6:30am Jan 12 &amp;lt; program&lt;br /&gt;
          $ at noon tomorrow &amp;lt; program&lt;br /&gt;
          $ at 1970 pm August 2 &amp;lt; program&lt;br /&gt;
&lt;br /&gt;
        This is an interactive way to use the command:&lt;br /&gt;
&lt;br /&gt;
          $ at now + 6 minutes&lt;br /&gt;
          warning: commands will be executed using (in order) a) $SHELL b) login shell c) /bin/sh&lt;br /&gt;
          at&amp;gt; ls&lt;br /&gt;
          at&amp;gt; date &amp;gt; /tmp/5min&lt;br /&gt;
          at&amp;gt; ^D&lt;br /&gt;
          job 3 at 2005-01-01 08:50&lt;br /&gt;
&lt;br /&gt;
        What jobs are in the queue?&lt;br /&gt;
&lt;br /&gt;
          $ atq&lt;br /&gt;
&lt;br /&gt;
        or&lt;br /&gt;
&lt;br /&gt;
          $ at -l&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 121:&lt;br /&gt;
&lt;br /&gt;
        Creating a Manpage&lt;br /&gt;
&lt;br /&gt;
         As root you can copy the following to /usr/local/man/man1/soup.1 which will&lt;br /&gt;
         give you a manpage for soup.&lt;br /&gt;
&lt;br /&gt;
              .\&amp;quot; Manpage for souptonuts.&lt;br /&gt;
              .\&amp;quot; Contact mchirico@users.sourceforge.com to correct errors or omissions.&lt;br /&gt;
              .TH man 1 &amp;quot;04 January 2005&amp;quot; &amp;quot;1.0&amp;quot; &amp;quot;souptonuts man page&amp;quot;&lt;br /&gt;
              .SH NAME&lt;br /&gt;
              soup \- man page for souptonuts&lt;br /&gt;
              .SH SYNOPSIS&lt;br /&gt;
              soup&lt;br /&gt;
              .SH DESCRIPTION&lt;br /&gt;
              souptonuts is a collection of linux and open&lt;br /&gt;
              source tips.&lt;br /&gt;
              off for golf.&lt;br /&gt;
              .SH OPTIONS&lt;br /&gt;
              The souptonuts does not take any options.&lt;br /&gt;
              .SH SEE ALSO&lt;br /&gt;
              doughnut(1), golf(8)&lt;br /&gt;
              .SH BUGS&lt;br /&gt;
              No known bugs at this time.&lt;br /&gt;
              .SH AUTHOR&lt;br /&gt;
              Mike Chirico (mchirico@comcast.net mchirico@users.sourceforge.net)&lt;br /&gt;
&lt;br /&gt;
         So, to view this man page&lt;br /&gt;
&lt;br /&gt;
            $ man soup&lt;br /&gt;
&lt;br /&gt;
         It's also possible to compress&lt;br /&gt;
&lt;br /&gt;
            $ gzip /usr/local/man/man1/soup.1&lt;br /&gt;
&lt;br /&gt;
         For plenty of examples look at the other man pages. Also the following&lt;br /&gt;
         is helpful. The last one is a tutorial &amp;quot;man 7 mdoc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            $ man manpath&lt;br /&gt;
            $ man groff&lt;br /&gt;
            $ man 7 mdoc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 122:&lt;br /&gt;
&lt;br /&gt;
        dmesg - print out boot messages, or what is in the kernel ring buffer.&lt;br /&gt;
&lt;br /&gt;
          If you missed the messages on boot-up, you can use dmesg to print them.&lt;br /&gt;
&lt;br /&gt;
            $ dmesg &amp;gt; boot.msg&lt;br /&gt;
&lt;br /&gt;
          Or to print, then, clear the ring&lt;br /&gt;
&lt;br /&gt;
            # dmesg -c &amp;gt; boot.msg&lt;br /&gt;
&lt;br /&gt;
          (also see TIP 20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 123:&lt;br /&gt;
&lt;br /&gt;
        gnus - emacs email nntp news reader (comcast as example with NO TLS or SSL)&lt;br /&gt;
&lt;br /&gt;
          First check that you can connect to the news group:&lt;br /&gt;
&lt;br /&gt;
                 $ telnet newsgroups.comcast.net 119&lt;br /&gt;
                 Trying 216.196.97.136...&lt;br /&gt;
                 Connected to newsgroups.comcast.net.&lt;br /&gt;
                 Escape character is '^]'.&lt;br /&gt;
                 200 News.GigaNews.Com&lt;br /&gt;
&lt;br /&gt;
          If you want to check for TLS or SSL see (TIP 54).&lt;br /&gt;
&lt;br /&gt;
          Here is a very simple configuration example without encryption. It&lt;br /&gt;
          appears that comcast does not support ssl or TLS.&lt;br /&gt;
&lt;br /&gt;
          In the &amp;quot;~/.emacs&amp;quot; file you would add the following to get comcast&lt;br /&gt;
          news groups&lt;br /&gt;
&lt;br /&gt;
             (setq gnus-select-method '(nntp &amp;quot;newsgroups.comcast.net&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
          Then, create an &amp;quot;~/.authinfo&amp;quot; file with the following settings using&lt;br /&gt;
          you own username and password.&lt;br /&gt;
&lt;br /&gt;
             machine newsgroups.comcast.net login borkey@comcast.net  password borkeypass0rd&lt;br /&gt;
&lt;br /&gt;
          Next create a &amp;quot;~/.newsrc&amp;quot; with your groups&lt;br /&gt;
&lt;br /&gt;
             news.announce.newusers:&lt;br /&gt;
             comp.lang.c++.moderated! 1-500&lt;br /&gt;
             comp.unix.programmer! 1-500&lt;br /&gt;
             comp.unix.shell! 1-500&lt;br /&gt;
             gnu.emacs.gnus! 1-500&lt;br /&gt;
&lt;br /&gt;
          Finally, create a &amp;quot;~/.gnus&amp;quot; with the following email settings for you&lt;br /&gt;
&lt;br /&gt;
             (setq user-mail-address &amp;quot;mchirico@comcast.net&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
             (defun my-message-mode-setup ()&lt;br /&gt;
               (setq fill-column 72)&lt;br /&gt;
               (turn-on-auto-fill))&lt;br /&gt;
               (add-hook 'message-mode-hook 'my-message-mode-setup)&lt;br /&gt;
&lt;br /&gt;
          To get into gnus&lt;br /&gt;
&lt;br /&gt;
              E-x gnus&lt;br /&gt;
&lt;br /&gt;
          The following are common gnus commands&lt;br /&gt;
&lt;br /&gt;
                RET  view the article under the cursor&lt;br /&gt;
&lt;br /&gt;
                A A (shift-a, shift a): List all newsgroups known&lt;br /&gt;
                                        to the server.&lt;br /&gt;
&lt;br /&gt;
                l (lower-case L)      : List only  subscribed groups&lt;br /&gt;
                                        with unread articles.&lt;br /&gt;
&lt;br /&gt;
                L                     : List all newsgroups in .newsrc file.&lt;br /&gt;
&lt;br /&gt;
                g                     : See if new articles have arrived.&lt;br /&gt;
&lt;br /&gt;
            Some commands for reading&lt;br /&gt;
&lt;br /&gt;
                n  next unread article&lt;br /&gt;
&lt;br /&gt;
                p  previous article&lt;br /&gt;
&lt;br /&gt;
                SPC  scroll down  moves to next unread&lt;br /&gt;
                     when at the bottom of the article&lt;br /&gt;
&lt;br /&gt;
                del  scroll up&lt;br /&gt;
&lt;br /&gt;
                F  follow-up to group on the article you are&lt;br /&gt;
                   reading now.&lt;br /&gt;
&lt;br /&gt;
                f  follow-up to group without citing the article&lt;br /&gt;
&lt;br /&gt;
                R  reply by mail and cite the article&lt;br /&gt;
&lt;br /&gt;
                r  reply by mail without citing the article&lt;br /&gt;
&lt;br /&gt;
                m  new mail&lt;br /&gt;
&lt;br /&gt;
                a  new posting&lt;br /&gt;
&lt;br /&gt;
                c  Catchup&lt;br /&gt;
&lt;br /&gt;
                C-u / t  Show only young headers&lt;br /&gt;
                         / t without C-u limits the summary&lt;br /&gt;
                         to old headers&lt;br /&gt;
&lt;br /&gt;
                T T  toggle threading&lt;br /&gt;
&lt;br /&gt;
                C-u g  Display raw article&lt;br /&gt;
                       hit g to return to normal view&lt;br /&gt;
&lt;br /&gt;
                t  Show all headers  it's a toggle&lt;br /&gt;
&lt;br /&gt;
                W w  Wordwrap the current article&lt;br /&gt;
&lt;br /&gt;
                W r  Decode ROT13  a toggle&lt;br /&gt;
&lt;br /&gt;
                ^  fetch parent of article&lt;br /&gt;
&lt;br /&gt;
                L  create a scorefile-entry based&lt;br /&gt;
                   on the current article (low score)&lt;br /&gt;
                   ? gives you information what each char means&lt;br /&gt;
&lt;br /&gt;
                I  like L but high score&lt;br /&gt;
&lt;br /&gt;
          Commands to send email&lt;br /&gt;
&lt;br /&gt;
            C-c C-c  send message&lt;br /&gt;
&lt;br /&gt;
            C-c C-d  save message as draft&lt;br /&gt;
&lt;br /&gt;
            C-c C-k  kill message&lt;br /&gt;
&lt;br /&gt;
            C-c C-m f  attach file&lt;br /&gt;
&lt;br /&gt;
            M-q  reformat paragraph&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 124:&lt;br /&gt;
&lt;br /&gt;
        Sending Email from telnet&lt;br /&gt;
&lt;br /&gt;
           Note, if you are on the computer you can sometime use the local loopback.&lt;br /&gt;
           In fact, sometimes you can only use the local loop back 127.0.0.1 in&lt;br /&gt;
           place of &amp;quot;bozo.company.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            1     [mchirico@soup Notes]$ telnet bozo.company.com 25&lt;br /&gt;
            2     Trying 192.168.0.204...&lt;br /&gt;
            3     Connected to bozo.company.com.&lt;br /&gt;
            4     Escape character is '^]'.&lt;br /&gt;
            5     220 bozo.company.com ESMTP Postfix (Postfix-20010228-pl03) (Mandrake Linux)&lt;br /&gt;
            6     HELO fakedomain.com&lt;br /&gt;
            7     HELO fakedomain.com         // server echo&lt;br /&gt;
            8     250 bozo.company.com&lt;br /&gt;
            9     MAIL FROM: test@fakedomain.com&lt;br /&gt;
           10     MAIL FROM: test@fakedomain.com   // server echo&lt;br /&gt;
           11     250 Ok&lt;br /&gt;
           12     RCPT TO: mchirico@someother.com&lt;br /&gt;
           13     RCPT TO: mchirico@someother.com   // server echo&lt;br /&gt;
           14     250 Ok&lt;br /&gt;
           15     DATA&lt;br /&gt;
           16     DATA    // echo&lt;br /&gt;
           17     354 Enter mail, end with &amp;quot;.&amp;quot; on a line by itself&lt;br /&gt;
           18     This is a test message&lt;br /&gt;
           19     This is a test message&lt;br /&gt;
           20     to send&lt;br /&gt;
           21     to send&lt;br /&gt;
           22     .&lt;br /&gt;
           23     250 2.0.0 j0B0uH3L018469 Message accepted for delivery&lt;br /&gt;
&lt;br /&gt;
          Above on line 6 you can type in any domain name. Line 7 is an echo. All&lt;br /&gt;
          echos are listed in the comment field.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 125:&lt;br /&gt;
&lt;br /&gt;
          IP forwarding, IP Masquerade&lt;br /&gt;
&lt;br /&gt;
             # echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
             # ipchains -F forward&lt;br /&gt;
             # ipchains -P forward DENY&lt;br /&gt;
             # ipchains -A forward -s 192.168.0.0/24 -j MASQ&lt;br /&gt;
             # ipchains -A forward -i eth1 -j MASQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          This assumes that your internal network is 192.168.0.0 on eth1, and the&lt;br /&gt;
          internet is connected to eth0.&lt;br /&gt;
&lt;br /&gt;
          (Also See TIP 182)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 126:&lt;br /&gt;
&lt;br /&gt;
         Setting KDE as the default desktop manager&lt;br /&gt;
&lt;br /&gt;
               Edit &amp;quot;/etc/sysconfig/desktop&amp;quot; to include the two lines:&lt;br /&gt;
&lt;br /&gt;
                 DESKTOP=&amp;quot;KDE&amp;quot;&lt;br /&gt;
                 DISPLAYMANAGER=&amp;quot;KDE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 127:&lt;br /&gt;
&lt;br /&gt;
        Have a file and you do not know whay type it is (tar, gz, ASCII, binary) ?&lt;br /&gt;
        Use the file command.  Below it is used on the file &amp;quot;mftp&amp;quot;&lt;br /&gt;
&lt;br /&gt;
               $ file mftp&lt;br /&gt;
               mftp: Bourne-Again shell script text executable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 128:&lt;br /&gt;
&lt;br /&gt;
        Software RAID: Two good references&lt;br /&gt;
&lt;br /&gt;
          http://www.tldp.org/HOWTO/Software-RAID-HOWTO-1.html&lt;br /&gt;
          http://lists.us.dell.com/pipermail/linux-poweredge/2003-July/014331.html&lt;br /&gt;
&lt;br /&gt;
        Note, you must setup grub for each RAID 1 device. Suppose you have&lt;br /&gt;
        2 SCSI drives (sda and sdb). By default grub is setup on sda; but, you&lt;br /&gt;
        need to enable it for sdb (/dev/hdb for ide) as follows:&lt;br /&gt;
&lt;br /&gt;
           grub&amp;gt;device (hd0) /dev/sdb&lt;br /&gt;
           grub&amp;gt;root (hd0,0)&lt;br /&gt;
           grub&amp;gt;setup (hd0)&lt;br /&gt;
&lt;br /&gt;
           Checking if &amp;quot;/boot/grub/stage1&amp;quot; exists... no&lt;br /&gt;
           Checking if &amp;quot;/grub/stage1&amp;quot; exists... yes&lt;br /&gt;
           Checking if &amp;quot;/grub/stage2&amp;quot; exists... yes&lt;br /&gt;
           Checking if &amp;quot;/grub/e2fs_stage1_5&amp;quot; exists.. yes&lt;br /&gt;
           Running &amp;quot;embed /grub/e2fs_stage1_5 (hd0)&amp;quot;... 16 sectors are embedded.&lt;br /&gt;
          succeeded&lt;br /&gt;
           Running &amp;quot;install /grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/grub/stage2 /grub/grub&lt;br /&gt;
         .conf&amp;quot;... succeeded.&lt;br /&gt;
         Done.&lt;br /&gt;
&lt;br /&gt;
          grub&amp;gt;&lt;br /&gt;
          grub&amp;gt;quit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Checking to see if everything is working:&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
        Checking the drives&lt;br /&gt;
&lt;br /&gt;
          $ sfdisk -d /dev/sdb&lt;br /&gt;
          $ sfdisk -d /dev/sda&lt;br /&gt;
&lt;br /&gt;
          $ fdisk -l /dev/sda  &amp;quot;This will give general information&amp;quot;&lt;br /&gt;
          $ fdisk -l           &amp;quot;General information for all drives&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Adding raid (assume you want to add the first drive &amp;quot;sda1&amp;quot;, or if it is the second&lt;br /&gt;
                    drive then substitute &amp;quot;sda2&amp;quot; below )&lt;br /&gt;
&lt;br /&gt;
          $ raidhotadd /dev/md0 /dev/sda1&lt;br /&gt;
          $ raidhotadd /dev/md1 /dev/sda2&lt;br /&gt;
          $ raidhotadd /dev/md2 /dev/sda3&lt;br /&gt;
&lt;br /&gt;
        This is an example of an cat /proc/mdstat that is working. Note that&lt;br /&gt;
        there is a listing for both sda1[0] and sdb1[1]&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
                Personalities : [raid1]&lt;br /&gt;
                read_ahead 1024 sectors&lt;br /&gt;
                Event: 12&lt;br /&gt;
                md0 : active raid1 sda1[0] sdb1[1]&lt;br /&gt;
                      104320 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md1 : active raid1 sda2[0] sdb2[1]&lt;br /&gt;
                      1044160 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md2 : active raid1 sda3[0] sdb3[1]&lt;br /&gt;
                      34411136 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        Compare that to this where md2 is missing sdb3&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
                Personalities : [raid1]&lt;br /&gt;
                read_ahead 1024 sectors&lt;br /&gt;
                Event: 9&lt;br /&gt;
                md0 : active raid1 sda1[0] sdb1[1]&lt;br /&gt;
                      104320 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md1 : active raid1 sda2[0] sdb2[1]&lt;br /&gt;
                      1044160 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md2 : active raid1 sdb3[1]        &amp;lt;---- HERE&lt;br /&gt;
                      34411136 blocks [2/1] [_U]&lt;br /&gt;
&lt;br /&gt;
                unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        If you are rebuilding an array, you can watch it by doing the following:&lt;br /&gt;
&lt;br /&gt;
           $ watch -n1 cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
        Need to know the raid setup?&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/raidtab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 129:&lt;br /&gt;
&lt;br /&gt;
        Resetting Redhat Linux Passwords using GRUB&lt;br /&gt;
&lt;br /&gt;
           1. Press 'e'&lt;br /&gt;
           2. Press 'e' again&lt;br /&gt;
           3. Append 'single' to the kernel version listing&lt;br /&gt;
&lt;br /&gt;
          See&lt;br /&gt;
             http://linuxgazette.net/107/tomar.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 130:&lt;br /&gt;
&lt;br /&gt;
        mtr - matt's traceroute. This is an advanced traceroute that keeps&lt;br /&gt;
              [http://www.bitwizard.nl/mtr/]&lt;br /&gt;
                  $ mtr www.yahoo.com&lt;br /&gt;
&lt;br /&gt;
                                              Matt's traceroute  [v0.52]&lt;br /&gt;
                     third-fl-71.localdomain                            Thu Jan 20 11:05:57 2005&lt;br /&gt;
                     Keys:  D - Display mode    R - Restart statistics    Q - Quit&lt;br /&gt;
                                                            Packets               Pings&lt;br /&gt;
                     Hostname                            %Loss  Rcv  Snt  Last Best  Avg  Worst&lt;br /&gt;
                      1. 192.168.1.1                        0%    3    3     0    0    0      1&lt;br /&gt;
                      2. ???&lt;br /&gt;
                      3. fe-2-6-rr01.willogrove5.pa.pa01    0%    3    3     8    7    7      8&lt;br /&gt;
                      4. srp-8-1-ar01.willowgrove1.pa.pa    0%    2    2     8    8    8      8&lt;br /&gt;
                      5. pos7-3-cr01.torresdale.pa.core.    0%    2    2     8    8    8      8&lt;br /&gt;
                      6. 12.119.53.53                       0%    2    2    12   12   12     13&lt;br /&gt;
                      7. tbr1-p012401.phlpa.ip.att.net      0%    2    2    12   12   13     13&lt;br /&gt;
                      8. tbr1-cl8.n54ny.ip.att.net          0%    2    2    13   13   13     13&lt;br /&gt;
                      9. ggr2-p310.n54ny.ip.att.net         0%    2    2    12   12   13     14&lt;br /&gt;
                     10. so-1-0-0.gar4.NewYork1.Level3.n    0%    2    2    14   14   37     61&lt;br /&gt;
                     11. ae-1-54.bbr2.NewYork1.Level3.ne    0%    2    2    13   12   13     13&lt;br /&gt;
                     12. ge-0-3-0.bbr2.Washington1.Level    0%    2    2    19   19   19     19&lt;br /&gt;
                     13. ge-1-1-51.car1.Washington1.Leve    0%    2    2    18   18   19     20&lt;br /&gt;
                     14. 4.79.228.6                         0%    2    2    21   19   20     21&lt;br /&gt;
                     15. UNKNOWN-216-109-120-201.yahoo.c    0%    2    2    21   20   20     21&lt;br /&gt;
                     16. w2.rc.vip.dcn.yahoo.com            0%    2    2    23   21   22     23&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 131:&lt;br /&gt;
&lt;br /&gt;
        chfn - change finger information&lt;br /&gt;
&lt;br /&gt;
            $ chfn&lt;br /&gt;
&lt;br /&gt;
          Next you are asked for a password and user information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 132:&lt;br /&gt;
&lt;br /&gt;
        chsh - change login shell&lt;br /&gt;
&lt;br /&gt;
          First, you may want to get a listing of all the possible&lt;br /&gt;
          shells.&lt;br /&gt;
&lt;br /&gt;
             $ chsh -l&lt;br /&gt;
&lt;br /&gt;
               /bin/sh&lt;br /&gt;
               /bin/bash&lt;br /&gt;
               /sbin/nologin&lt;br /&gt;
               /bin/ash&lt;br /&gt;
               /bin/bsh&lt;br /&gt;
               /bin/ksh&lt;br /&gt;
               /usr/bin/ksh&lt;br /&gt;
               /usr/bin/pdksh&lt;br /&gt;
               /bin/tcsh&lt;br /&gt;
               /bin/csh&lt;br /&gt;
               /bin/zsh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 133:&lt;br /&gt;
&lt;br /&gt;
        bash - working with binary, hex and base 3.&lt;br /&gt;
&lt;br /&gt;
         For the variable must be declare as an integer. Then&lt;br /&gt;
         specify the  &amp;lt;base&amp;gt;#&amp;lt;value&amp;gt;. The example below is 22 in&lt;br /&gt;
         base 3.&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n&lt;br /&gt;
              $ n=3#22&lt;br /&gt;
              $ echo $n&lt;br /&gt;
                8&lt;br /&gt;
&lt;br /&gt;
           Base 16 (hex)&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n2&lt;br /&gt;
              $ n2=16#a&lt;br /&gt;
              $ echo $n2&lt;br /&gt;
                10&lt;br /&gt;
&lt;br /&gt;
           Base 8 (octal)&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n3&lt;br /&gt;
              $ n3=8#11&lt;br /&gt;
              $ echo $n3&lt;br /&gt;
                9   Note 8+1=9&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 134:&lt;br /&gt;
&lt;br /&gt;
        monitoring IP traffic. Try iptraf http://iptraf.seul.org/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 135:&lt;br /&gt;
&lt;br /&gt;
        enscript - convert text files to PostScript&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 136:&lt;br /&gt;
&lt;br /&gt;
        dd and tar - blocking factor. How to determine the blocking factor, block size&lt;br /&gt;
                   so that tar and dd can work together.&lt;br /&gt;
&lt;br /&gt;
        Step 1: Create a large file on local disk, in a directory &amp;quot;1&amp;quot; that will eventually&lt;br /&gt;
                be written to tape. This will be created with dd as follows:&lt;br /&gt;
&lt;br /&gt;
                $ mkdir 1&lt;br /&gt;
                $ dd if=/dev/zero of=disk-image count=40960&lt;br /&gt;
                  40960+0 records in&lt;br /&gt;
                  40960+0 records out&lt;br /&gt;
&lt;br /&gt;
                $ cd ..&lt;br /&gt;
&lt;br /&gt;
        Step 2: tar the directory and contents to tape. First rewind the tape. These examples&lt;br /&gt;
                use /dev/nst0 as the location of the tape. Make sure to substitute your values&lt;br /&gt;
                if needed.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ tar --label=&amp;quot;Test 1&amp;quot; --create --blocking-factor=128 --file=/dev/nst0 1&lt;br /&gt;
&lt;br /&gt;
        Step 3: Read data from the tape using a block size of 128k. If you get an I/O error, which&lt;br /&gt;
                could happend if you used a different blocking factor above, then, you may need&lt;br /&gt;
                to increase the bs to 256, or 512 etc. as needed.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=/dev/nst0 bs=128k of=testblocksz count=1&lt;br /&gt;
                 0+1 records in&lt;br /&gt;
                 0+1 records out&lt;br /&gt;
&lt;br /&gt;
                $ ls -l testblocksz&lt;br /&gt;
                 -rw-r--r--    1 root     root        65536 Feb  9 10:41 testblocksz&lt;br /&gt;
&lt;br /&gt;
                $ ls -lh testblocksz&lt;br /&gt;
                 -rw-r--r--    1 root     root          64k Feb  9 10:41 testblocksz&lt;br /&gt;
&lt;br /&gt;
               Note above that the size 65536 is equal to 64k. That &amp;quot;h&amp;quot; switch in &amp;quot;ls&amp;quot; is for&lt;br /&gt;
               human readable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 4: tar uses a multiplier of 512*blocking-factor to get block size. Again&lt;br /&gt;
&lt;br /&gt;
                 512 * blocking-factor = block size used in dd command.&lt;br /&gt;
&lt;br /&gt;
              Putting in the values, we see that&lt;br /&gt;
&lt;br /&gt;
                 512 * 128 = 65536&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 5: So what does this tell you? You can now use these numbers to &amp;quot;dd&amp;quot; files&lt;br /&gt;
              to tape. But, first tar will be used to create the file locally.&lt;br /&gt;
&lt;br /&gt;
                $ tar --label=&amp;quot;Test 1&amp;quot; --create --blocking-factor=128 --file=test.tar 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 6: Send this to tape with the dd command. Remember 64k is equal to 65536.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=test.tar bs=64k of=/dev/nst0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 7: Now test that it can be read with tar command using blocking-factor=128.&lt;br /&gt;
             Note the &amp;quot;t&amp;quot; command in tar is for tell. It will not write data.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ tar -tvf /dev/nst0 --blocking-factor=128&lt;br /&gt;
                 V--------- 0/0               0 2005-02-09 10:38:20 Test 1--Volume Header--&lt;br /&gt;
                 drwxr-xr-x root/root         0 2005-02-09 10:34:10 1/&lt;br /&gt;
                 -rw-r--r-- root/root  20971520 2005-02-09 10:34:11 1/disk-image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 8: Reading tape data with dd. Most of the time a high &amp;quot;ibs&amp;quot; input block size&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=/dev/nst0 of=outfromdd.tar ibs=64k&lt;br /&gt;
                 321+0 records in&lt;br /&gt;
                 41088+0 records out&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 9: Verify that outfromdd.tar can be read by tar with blocking-factor=128&lt;br /&gt;
&lt;br /&gt;
                $ tar -tvf outfromdd.tar --blocking-factor=128&lt;br /&gt;
                 V--------- 0/0               0 2005-02-09 10:38:20 Test 1--Volume Header--&lt;br /&gt;
                 drwxr-xr-x root/root         0 2005-02-09 10:34:10 1/&lt;br /&gt;
                 -rw-r--r-- root/root  20971520 2005-02-09 10:34:11 1/disk-image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       PULLING FILES:  The dd command can be used to pull files.&lt;br /&gt;
&lt;br /&gt;
              ssh target_address dd if=remotefile | dd of=localfile&lt;br /&gt;
&lt;br /&gt;
           Or, a specific example of getting a file from a computer called hamlet.&lt;br /&gt;
&lt;br /&gt;
              $ ssh root@hamlet  dd if=/home/cvs/test | dd of=/home/storage/test&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        GOING BACKWARD AND FORWARD ON TAPE:&lt;br /&gt;
&lt;br /&gt;
             Go to end of data&lt;br /&gt;
              $ mt -f /dev/nst0  eod&lt;br /&gt;
&lt;br /&gt;
             Previous record&lt;br /&gt;
              $ mt -f /dev/nst0  bsfm 1&lt;br /&gt;
&lt;br /&gt;
             Forward record&lt;br /&gt;
              $ mt -f /dev/nst0  fsf 1&lt;br /&gt;
&lt;br /&gt;
             Rewind&lt;br /&gt;
              $ mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
             Tell&lt;br /&gt;
              $ mt -f /dev/nst0 tell&lt;br /&gt;
&lt;br /&gt;
         (Reference TIP 151 - for how to get around firewalls)&lt;br /&gt;
&lt;br /&gt;
         Below is a script that I use to backup computers via ssh. The&lt;br /&gt;
         tape drive is on &amp;quot;nis&amp;quot; and the extra space is on &amp;quot;hamlet&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                #!/bin/bash&lt;br /&gt;
                # Program to backup server remotely&lt;br /&gt;
                # Assume remote server is nis, you are on squeezel&lt;br /&gt;
                #&lt;br /&gt;
                # Recover from tape&lt;br /&gt;
                #&lt;br /&gt;
                #   dd if=/dev/nst0 of=test.tar.gz bs=64k&lt;br /&gt;
                #&lt;br /&gt;
                filename=&amp;quot;support1.$(date &amp;quot;+%m%d%y%H%M&amp;quot;).tar.gz&amp;quot;&lt;br /&gt;
                DIRTOBACKUP=/var/www&lt;br /&gt;
                #tar cvzf - $DIRTOBACKUP | ssh  root@nis  '(mt -f /dev/nst0 rewind; dd of=/dev/nst0 bs=64k )'&lt;br /&gt;
                tar cvzf - $DIRTOBACKUP | ssh  support1@hamlet &amp;quot;dd of=/home/support1/backups/${filename} &amp;quot;&lt;br /&gt;
&lt;br /&gt;
         Another example program, below, pushes the last &amp;quot;.tar.gz&amp;quot; file to tape:&lt;br /&gt;
&lt;br /&gt;
                #!/bin/bash&lt;br /&gt;
                # Program to push files to tape&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                # Notes on recovering from tape&lt;br /&gt;
                #&lt;br /&gt;
                #   dd if=/dev/nst0 of=test.tar.gz ibs=64k&lt;br /&gt;
                #    or&lt;br /&gt;
                #  $ ssh root@tapeserver &amp;quot;mt -f /dev/nst0 rewind&amp;quot;&lt;br /&gt;
                #  $ ssh root@tapeserver &amp;quot;dd if=/dev/nst0 ibs=64k&amp;quot;|dd of=cvs1.tar.gz&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                # First rewind tape&lt;br /&gt;
                ssh root@tapeserver 'mt -f /dev/nst0 rewind'&lt;br /&gt;
                #&lt;br /&gt;
                # Grab only the last file&lt;br /&gt;
                file=$(find /home/cvs  -iname 'cvs*.tar.gz'|sort|tail -n 1)&lt;br /&gt;
                dd if=${file}|ssh root@tapeserver 'dd of=/dev/nst0 bs=64k'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 137:&lt;br /&gt;
&lt;br /&gt;
        Apache - redirecting pages. All changes are in httpd.conf&lt;br /&gt;
&lt;br /&gt;
               RedirectMatch (.*)\.gif$ http://www.anotherserver.com$1.jpg&lt;br /&gt;
&lt;br /&gt;
               Redirect /service http://foo2.bar.com/service&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 138:&lt;br /&gt;
&lt;br /&gt;
        samba mounts via ssh - mounting a samba share through an ssh tunnel, going&lt;br /&gt;
               through an intermediate computer, that accepts ssh. We'll call this&lt;br /&gt;
               intermediate computer middle [65.219.4.23], and we want to get to&lt;br /&gt;
               destination [192.168.0.81]. The user will be mchirico.&lt;br /&gt;
&lt;br /&gt;
          STEP 1:&lt;br /&gt;
&lt;br /&gt;
               $ mkdir -p /samba/share&lt;br /&gt;
&lt;br /&gt;
          STEP 2:&lt;br /&gt;
&lt;br /&gt;
            This has to be done as root, since we are using a lower port.&lt;br /&gt;
&lt;br /&gt;
               $ ssh -N -L 139:192.168.0.81:139 mchirico@65.219.4.23&lt;br /&gt;
&lt;br /&gt;
          STEP 3:&lt;br /&gt;
&lt;br /&gt;
              umount /samba/sales&lt;br /&gt;
              /bin/mount -t smbfs -o  username=donkey,workgroup=donkeydomain,&lt;br /&gt;
                      password=passw0rk1,port=139,dmask=770,fmask=660,&lt;br /&gt;
                      netbiosname=homecpu //localhost/share /samba/share&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 139:&lt;br /&gt;
&lt;br /&gt;
        Music on Fedora Core -- How to play music on http://magnatune.com with &amp;quot;xmms&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           The following command will show the sound driver:&lt;br /&gt;
&lt;br /&gt;
              $ lspci|grep -i audio&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          STEP 1:&lt;br /&gt;
&lt;br /&gt;
                Unmute amixer with the following command:&lt;br /&gt;
&lt;br /&gt;
              $ amixer set Master 100% unmute&lt;br /&gt;
              $ amixer set PCM 100%  unmute&lt;br /&gt;
&lt;br /&gt;
                Note you can also get a graphical interface with &amp;quot;alsamixer&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              $ alsamixer&lt;br /&gt;
&lt;br /&gt;
                 h,F1   -- for help&lt;br /&gt;
                 Esc    -- exit&lt;br /&gt;
                 Tab    -- move to selections&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          STEP 2:&lt;br /&gt;
&lt;br /&gt;
                Test a sound file &amp;quot;*.au&amp;quot; with aplay. To quickly find files on your system use&lt;br /&gt;
                the &amp;quot;locate *.au&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
                  $ aplay /usr/lib/python2.3/test/audiotest.au&lt;br /&gt;
&lt;br /&gt;
          STEP 3:&lt;br /&gt;
&lt;br /&gt;
                Install &amp;quot;xmms-mp3-1.2.10-9.2.1.fc3.rf.i386.rpm&amp;quot; which does not come with Fedora because&lt;br /&gt;
                of GPL license restrictions.  The latest version of this package can be found&lt;br /&gt;
                at the following url:&lt;br /&gt;
&lt;br /&gt;
                  http://rpmseek.com/rpm-pl/xmms-mp3.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                  $ rpm -ivh xmms-mp3-1.2.10-9.2.1.fc3.rf.i386.rpm&lt;br /&gt;
&lt;br /&gt;
          STEP 4:&lt;br /&gt;
&lt;br /&gt;
                Go to magnatun &amp;quot;http://magnatune.com/&amp;quot;, select genre and make sure xmms&lt;br /&gt;
                is the default player.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 140:&lt;br /&gt;
&lt;br /&gt;
        Routing -- getting access to a network 1 hop away. You are currently on the 192 network&lt;br /&gt;
                   and you want access to the 172.21.0.0 network that has a computer straddling&lt;br /&gt;
                   the two, with /proc/sys/net/ipv4/ip_forward set to 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               $ route add -net 172.21.0.0 netmask 255.255.255.0 gw 192.168.0.204&lt;br /&gt;
&lt;br /&gt;
         To undo:&lt;br /&gt;
&lt;br /&gt;
               $ route del -net 172.21.0.0 netmask 255.255.255.0 gw 192.168.0.204&lt;br /&gt;
&lt;br /&gt;
         Now you can ping 172.21.0.21.&lt;br /&gt;
&lt;br /&gt;
         Does not work?&lt;br /&gt;
&lt;br /&gt;
         Go on to 192.168.0.204 and execute the following commands:&lt;br /&gt;
&lt;br /&gt;
               $ echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
               $ cat /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
               1&lt;br /&gt;
&lt;br /&gt;
         To Look at the the gateway, execute the following command.&lt;br /&gt;
&lt;br /&gt;
               $ netstat -r&lt;br /&gt;
&lt;br /&gt;
         References: &lt;br /&gt;
&lt;br /&gt;
               http://lartc.org/lartc.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 141:&lt;br /&gt;
&lt;br /&gt;
        RAM disk -- creating a filesystem in RAM.&lt;br /&gt;
&lt;br /&gt;
               $ mkfs -t ext3 -q /dev/ram1 4096&lt;br /&gt;
               $ mkdir -p /fsram&lt;br /&gt;
               $ mount /dev/ram1 /fsram -o defaults,rw&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 142:&lt;br /&gt;
&lt;br /&gt;
        Create a Live Linux CDROM  using  BusyBox and OpenSSH.&lt;br /&gt;
&lt;br /&gt;
            These steps are rather long. A complete tutorial is given at&lt;br /&gt;
            the following link:&lt;br /&gt;
             http://prdownloads.sourceforge.net/souptonuts/instructions_boot_system.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 143:&lt;br /&gt;
&lt;br /&gt;
      SystemImager (http://www.systemimager.org/) SystemImager is software that automates Linux installs,&lt;br /&gt;
                       software distribution, and production deployment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 144:&lt;br /&gt;
&lt;br /&gt;
      Mounted a filesystem in rescue mode, yet, you cannot read and write?  Remount.&lt;br /&gt;
&lt;br /&gt;
             $ mount -o remount /&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 145:&lt;br /&gt;
&lt;br /&gt;
      Nmap commands to check for Microsoft VPN connection.&lt;br /&gt;
&lt;br /&gt;
         $ nmap -sO -p 47 vpn1.someserver.com&lt;br /&gt;
         $ nmap -sS -p T:1723 vpn1.someserver.com&lt;br /&gt;
&lt;br /&gt;
      By the way, with nmap you can specify multiple ports. Below&lt;br /&gt;
      is an example of multiple ports; but, use the commands above&lt;br /&gt;
      for Microsoft VPN services.&lt;br /&gt;
&lt;br /&gt;
         $ nmap -sS -p T:1723-3000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 146:&lt;br /&gt;
&lt;br /&gt;
      Perl and ssh - monitoring systems. The output from ssh can be parsed. Below is&lt;br /&gt;
      a simple procedure to just to read the ssh ouput into perl.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #&lt;br /&gt;
          $pid = open $readme, &amp;quot;ssh root\@hamlet df -lh|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
          while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
           print $_&lt;br /&gt;
          }&lt;br /&gt;
          close $readme&lt;br /&gt;
&lt;br /&gt;
      But note, you probably want to do something more complex. Below is a more robust&lt;br /&gt;
      example that bypassed all the fortune, heading junk that you may encounter when&lt;br /&gt;
      logging in.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #&lt;br /&gt;
          $pid = open $readme, &amp;quot;ssh root\@hamlet df -lh 2&amp;gt;/dev/null|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
          while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
           print $_&lt;br /&gt;
          }&lt;br /&gt;
          close $readme&lt;br /&gt;
&lt;br /&gt;
      NO! you CANNOT do bidirectional communication with the open statement. Note the &amp;quot;|&amp;quot; before&lt;br /&gt;
      and after below, which cannot be done.&lt;br /&gt;
&lt;br /&gt;
          # Cannot do this!&lt;br /&gt;
          $pid = open $readme, &amp;quot;|ssh root\@hamlet df -lh 2&amp;gt;/dev/null|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
      Below is a simple Perl example working with arrays:&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          @ArrayOfArray = (&lt;br /&gt;
                   [ &amp;quot;ant&amp;quot;, &amp;quot;bee&amp;quot; ],&lt;br /&gt;
                   [ &amp;quot;mouse&amp;quot;, &amp;quot;mole&amp;quot;, &amp;quot;rat&amp;quot; ],&lt;br /&gt;
                   [ &amp;quot;duck&amp;quot;, &amp;quot;goose&amp;quot;, &amp;quot;flamingo&amp;quot; ],&lt;br /&gt;
                   [  &amp;quot;rose&amp;quot;,&amp;quot;carnation&amp;quot;,&amp;quot;sunflower&amp;quot;],&lt;br /&gt;
                  );&lt;br /&gt;
&lt;br /&gt;
          for $i ( 0 .. $#ArrayOfArray ) {&lt;br /&gt;
              for $j ( 0 .. $#{$ArrayOfArray[$i]} ) {&lt;br /&gt;
                  print &amp;quot;Element $i $j is $ArrayOfArray[$i][$j]\n&amp;quot;;&lt;br /&gt;
              }&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          # Or this is another way to list elements&lt;br /&gt;
          foreach( @ArrayOfArray ) {&lt;br /&gt;
             foreach $i (0..$#$_) {&lt;br /&gt;
                print &amp;quot;$_-&amp;gt;[$i] &amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
             print &amp;quot;\n&amp;quot;;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Below is an example of working with Hash of Arrays:&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #  ./program &amp;lt; /etc/passwd&lt;br /&gt;
          while(&amp;lt;&amp;gt;){&lt;br /&gt;
              next unless s/^(.*?):\s*//;&lt;br /&gt;
              $HoA{$1} = [ split(/:/) ];&lt;br /&gt;
          }&lt;br /&gt;
          for $i (keys %HoA ) {&lt;br /&gt;
              print &amp;quot;$i: @{ $HoA{$i} } \n&amp;quot;;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
      Example of regular expression. This is my most used regular expression - I like&lt;br /&gt;
      this sample. See the &amp;quot;www.unix.org.ua&amp;quot; link at the end of this tip.&lt;br /&gt;
&lt;br /&gt;
          &amp;quot;hot cross buns&amp;quot; =~ /cross/;&lt;br /&gt;
          print &amp;quot;Matched: &amp;lt;$`&amp;gt; $&amp;amp; &amp;lt;$'&amp;gt;\n&amp;quot;;    # Matched: &amp;lt;hot &amp;gt; cross &amp;lt; buns&amp;gt;&lt;br /&gt;
          print &amp;quot;Left:    &amp;lt;$`&amp;gt;\n&amp;quot;;            # Left:    &amp;lt;hot &amp;gt;&lt;br /&gt;
          print &amp;quot;Match:   &amp;lt;$&amp;amp;&amp;gt;\n&amp;quot;;            # Match:   &amp;lt;cross&amp;gt;&lt;br /&gt;
          print &amp;quot;Right:   &amp;lt;$'&amp;gt;\n&amp;quot;;            # Right:   &amp;lt; buns&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      If you're looking for Perl information, type &amp;quot;man perl&amp;quot;, which will show you how&lt;br /&gt;
      to get even more information. Or better yet, take a look at the following&lt;br /&gt;
      link:&lt;br /&gt;
&lt;br /&gt;
          http://www.unix.org.ua/orelly/perl/prog3/ch09_01.htm&lt;br /&gt;
               also&lt;br /&gt;
          http://www.stonehenge.com/merlyn/UnixReview/&lt;br /&gt;
&lt;br /&gt;
      For a quick example on using Perl with SQLite, see the following links:&lt;br /&gt;
&lt;br /&gt;
          http://prdownloads.sourceforge.net/souptonuts/README_sqlite_tutorial.html?download&lt;br /&gt;
            or&lt;br /&gt;
          http://freshmeat.net/articles/view/1428/&lt;br /&gt;
            or&lt;br /&gt;
          http://www.perl.com/pub/a/1999/09/refererents.html&lt;br /&gt;
&lt;br /&gt;
      Standard input for files. This example will read from stdin, or open a file if given as&lt;br /&gt;
      an argument, and convert all &amp;quot;&amp;lt;&amp;quot; to &amp;quot;&amp;amp;lt;&amp;quot; and &amp;quot;&amp;gt;&amp;quot; to &amp;quot;&amp;amp;gt;&amp;quot;, which can be handy when&lt;br /&gt;
      converting text files to html files. Note the &amp;quot;while(&amp;lt;&amp;gt;)&amp;quot; will take multiple file names&lt;br /&gt;
      on the command line.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          while(&amp;lt;&amp;gt;) {&lt;br /&gt;
             s/&amp;amp;amp;/&amp;amp;amp;amp;/g;&lt;br /&gt;
             s/&amp;amp;lt;/&amp;amp;amp;lt;/g;&lt;br /&gt;
             s/&amp;amp;gt;/&amp;amp;amp;gt;/g;&lt;br /&gt;
             s/&amp;lt;/&amp;amp;lt;/g;&lt;br /&gt;
             s/&amp;gt;/&amp;amp;gt;/g;&lt;br /&gt;
             print;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
      Perl Debugger is very useful for testing commands and works like an interpreter, just&lt;br /&gt;
      like python. So to get into the Perl Debugger execute the command below, &amp;quot;q&amp;quot; to quit.&lt;br /&gt;
&lt;br /&gt;
          $ perl -de 0&lt;br /&gt;
&lt;br /&gt;
      Reference TIP 170&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 147:&lt;br /&gt;
&lt;br /&gt;
      Shutdown&lt;br /&gt;
&lt;br /&gt;
          # shutdown 8:00 -- Shutdown at 8:00&lt;br /&gt;
&lt;br /&gt;
          # shutdown +13  -- Shutdown after 13min&lt;br /&gt;
&lt;br /&gt;
          # shutdown -r now  -- Shutdown now and restart&lt;br /&gt;
&lt;br /&gt;
          # shutdown -k +2  -- &amp;quot;The system is going DOWN to maintenance mode in 2 minutes!&amp;quot;&lt;br /&gt;
                              The above is only a warning.&lt;br /&gt;
&lt;br /&gt;
          # shutdown -h now   -- Shutdown now and halt&lt;br /&gt;
&lt;br /&gt;
          # shutdown -c    -- Cancel shutdown&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 148:&lt;br /&gt;
&lt;br /&gt;
      ac -  print statistics about users connect time&lt;br /&gt;
&lt;br /&gt;
          $ ac -p    -- print hour usage by user (individual)&lt;br /&gt;
          $ ac -dy   -- print daily usage&lt;br /&gt;
&lt;br /&gt;
       Options can also be combined&lt;br /&gt;
&lt;br /&gt;
          $ ac -dyp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 149:&lt;br /&gt;
&lt;br /&gt;
      Smart Monitoring Tools:&lt;br /&gt;
      Disk failing? Or want to know the temperature of your hard-drive?&lt;br /&gt;
&lt;br /&gt;
         http://smartmontools.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
      For a good, quick tutorial, see the Linux Journal article&lt;br /&gt;
        http://www.linuxjournal.com/article/6983&lt;br /&gt;
&lt;br /&gt;
      Below are some common commands:&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -i /dev/hda&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -Hc /dev/hda&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -A /dev/hda&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 150:&lt;br /&gt;
&lt;br /&gt;
      Monitor dhcp trafic - dhcpdump and tcpdump.&lt;br /&gt;
&lt;br /&gt;
      Download dhcpdump&lt;br /&gt;
&lt;br /&gt;
         $ wget  http://voxel.dl.sourceforge.net/sourceforge/mavetju/dhcpdump-1.5.tar.gz&lt;br /&gt;
         $ ./configure&lt;br /&gt;
         $ make &amp;amp;&amp;amp; make install&lt;br /&gt;
&lt;br /&gt;
     Once it's installed, you can monitor all dhcp traffic as follows, if done with root.&lt;br /&gt;
&lt;br /&gt;
         $ tcpdump -lenx -i eth0 -s 1500 port bootps or port bootpc| dhcpdump&lt;br /&gt;
&lt;br /&gt;
     The above assumes you are using eth0 (ethernet port 0).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 151:&lt;br /&gt;
&lt;br /&gt;
      Breaking Firewalls with ssh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      A sample .ssh/config file (note this must have chmod 600 rights)&lt;br /&gt;
&lt;br /&gt;
           ## Server1 ##&lt;br /&gt;
           Host 130.21.19.227&lt;br /&gt;
               LocalForward 20000 192.168.0.66:80&lt;br /&gt;
               LocalForward 22000 192.168.0.66:22&lt;br /&gt;
&lt;br /&gt;
      With the above &amp;quot;~/.ssh/config&amp;quot; file, after sshing into 130.21.19.227 it&lt;br /&gt;
      is then possible to ssh into nearby computers directly.&lt;br /&gt;
&lt;br /&gt;
         $ ssh -l mchirico 130.21.19.227&lt;br /&gt;
         $ scp -P 22000 authorized_keys* mchirico@localhost:.&lt;br /&gt;
         $ ssh -l mchirico localhost -p 22000&lt;br /&gt;
&lt;br /&gt;
      For the complete article reference the following link:&lt;br /&gt;
        http://souptonuts.sourceforge.net/sshtips.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 152:&lt;br /&gt;
&lt;br /&gt;
      Renaming files - suppose you want to rename all the &amp;quot;.htm&amp;quot; files to &amp;quot;.html&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          $ rename .htm .html *.htm&lt;br /&gt;
&lt;br /&gt;
      Or, suppose you files file1, file2, file3 ...&lt;br /&gt;
&lt;br /&gt;
          $ touch file1 file2 file3 file4 file5 file6&lt;br /&gt;
          $ rename file file. file*&lt;br /&gt;
&lt;br /&gt;
      The above command will give you &amp;quot;file.1&amp;quot;, &amp;quot;file.2&amp;quot; ... &amp;quot;file.6&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 153:&lt;br /&gt;
&lt;br /&gt;
      Renaming files with Perl - this is taken from &amp;quot;Programming Perl 3rd Edition&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          # rename - change filenames&lt;br /&gt;
          $op = shift;&lt;br /&gt;
          for (@ARGV) {&lt;br /&gt;
              $was = $_;&lt;br /&gt;
              eval $op;&lt;br /&gt;
              die if $@;&lt;br /&gt;
              # next line calls built-in function, not the script&lt;br /&gt;
              rename($was,$_) unless $was eq $_;&lt;br /&gt;
           }&lt;br /&gt;
&lt;br /&gt;
      The above Perl program can be used as follows:&lt;br /&gt;
&lt;br /&gt;
           $ rename 's/\.orig$//'    *.orig&lt;br /&gt;
           $ rename 'y/A-Z/a-z/ unless /^Make/' *&lt;br /&gt;
&lt;br /&gt;
      Also reference:&lt;br /&gt;
           http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 154:&lt;br /&gt;
&lt;br /&gt;
      R project (http://www.r-project.org)&lt;br /&gt;
&lt;br /&gt;
      To start R, just type &amp;quot;R&amp;quot; at the command prompt and &amp;quot;q()&amp;quot; to quit. Below&lt;br /&gt;
      2 is raised to powers 0 through 6 and thrown into an array.&lt;br /&gt;
&lt;br /&gt;
           $ R&lt;br /&gt;
           &amp;gt; N &amp;lt;- 2^(0:6)&lt;br /&gt;
           &amp;gt; N&lt;br /&gt;
           [1]  1  2  4  8 16 32 64&lt;br /&gt;
           &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      There is a summary summary() command.&lt;br /&gt;
&lt;br /&gt;
           &amp;gt; summary(N)&lt;br /&gt;
           Min. 1st Qu.  Median    Mean 3rd Qu.    Max.&lt;br /&gt;
           1.00    3.00    8.00   18.14   24.00   64.00&lt;br /&gt;
&lt;br /&gt;
      Note that the array begins as 1 and not 0&lt;br /&gt;
&lt;br /&gt;
           &amp;gt; N[1:3]&lt;br /&gt;
           [1] 1 2 4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 155:&lt;br /&gt;
&lt;br /&gt;
      ls - listing files by size, with the biggest file listed last&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           $ ls --sort=size -lhr&lt;br /&gt;
&lt;br /&gt;
      The above command sorts files by size, listing the contents in&lt;br /&gt;
      &amp;quot;h&amp;quot; human readable format in reverse order.&lt;br /&gt;
&lt;br /&gt;
      Note the options:  --sort={none,time,size,extension}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 156:&lt;br /&gt;
&lt;br /&gt;
     Perl - program to clean up old versions of files&lt;br /&gt;
&lt;br /&gt;
       #!/usr/bin/perl&lt;br /&gt;
       #   Copyright (c) GPL 2005 Mike Chirico&lt;br /&gt;
       # This program deletes old files from several directories&lt;br /&gt;
       # and within each directory there must be x number of copies&lt;br /&gt;
       # each y number of bytes&lt;br /&gt;
       #&lt;br /&gt;
&lt;br /&gt;
       sub delete_old_ones {&lt;br /&gt;
           $directory_and_file=$_[0];&lt;br /&gt;
           $save_count=$_[1];&lt;br /&gt;
           $bytes_in_file=$_[2];&lt;br /&gt;
         # Don't change setting here of '-lt'&lt;br /&gt;
           $pid = open $readme, &amp;quot;ls -lt $directory_and_file|&amp;quot; or die &amp;quot;Could not execute\n&amp;quot;;&lt;br /&gt;
           while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
               my @fields = split;&lt;br /&gt;
              # Make sure we have $save_count good ones with data&lt;br /&gt;
               if ($fields[4] &amp;gt; $bytes_in_file &amp;amp;&amp;amp; $save_count &amp;gt; 0) {&lt;br /&gt;
                   $save_count--;&lt;br /&gt;
                   print &amp;quot;Kept files: $fields[4] $fields[8]\n&amp;quot;;&lt;br /&gt;
               }&lt;br /&gt;
              # delete the old ones&lt;br /&gt;
              if ($save_count &amp;lt;= 0 )&lt;br /&gt;
              {&lt;br /&gt;
                  print &amp;quot;Deleted files: $fields[4] $fields[8]\n&amp;quot;;&lt;br /&gt;
                  unlink $fields[8];&lt;br /&gt;
              }&lt;br /&gt;
           }&lt;br /&gt;
           close $readme;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       @AofA = (&lt;br /&gt;
          [ &amp;quot;/home/cvs/backups/*.gz&amp;quot;, &amp;quot;6&amp;quot;,196621 ],&lt;br /&gt;
          [ &amp;quot;/home/mail/backups/*.gz&amp;quot;,&amp;quot;5&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/snort/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/server1/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/actserver/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/server2/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
                );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       foreach( @AofA ) {&lt;br /&gt;
           &amp;amp;delete_old_ones($_-&amp;gt;[0],$_-&amp;gt;[1],$_-&amp;gt;[2]);&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
     Reference TIP 170 and the following link:&lt;br /&gt;
       http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 157:&lt;br /&gt;
&lt;br /&gt;
     Graphics and Visualization Software that runs on Linux&lt;br /&gt;
        http://www.tldp.org/HOWTO/Scientific-Computing-with-GNU-Linux/graphvis.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 158:&lt;br /&gt;
&lt;br /&gt;
     Keeping files in sync going both ways. Unlike rsync, this is not a one way mirror&lt;br /&gt;
     option.&lt;br /&gt;
&lt;br /&gt;
     You will need ocaml installed first.&lt;br /&gt;
&lt;br /&gt;
       $ wget http://caml.inria.fr/pub/distrib/ocaml-3.08/ocaml-3.08.3.tar.gz&lt;br /&gt;
       $ tar -xzf ocaml-3.08.3.tar.gz&lt;br /&gt;
       $ cd ocaml-3.08.3&lt;br /&gt;
&lt;br /&gt;
       $ ./configure&lt;br /&gt;
       $ make world&lt;br /&gt;
       $ make opt&lt;br /&gt;
       $ make install&lt;br /&gt;
&lt;br /&gt;
     Next, get unison and put it in a different directory.&lt;br /&gt;
     [http://www.cis.upenn.edu/~bcpierce/unison/]&lt;br /&gt;
&lt;br /&gt;
       $ wget http://www.cis.upenn.edu/~bcpierce/unison/download/stable/latest/unison-2.10.2.tar.gz&lt;br /&gt;
       $ tar -xzf unison-2.10.2.tar.gz&lt;br /&gt;
       $ cd unison-2.10.2&lt;br /&gt;
       $ make UISTYLE=text&lt;br /&gt;
       $ su&lt;br /&gt;
       # cp unison /usr/local/bin/.&lt;br /&gt;
&lt;br /&gt;
     Note, you have to copy the file manually.&lt;br /&gt;
&lt;br /&gt;
     See the following article [http://www.linuxjournal.com/article/7712]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 159:&lt;br /&gt;
&lt;br /&gt;
     Dump ext2/ext3 filesystem information with &amp;quot;dumpe2fs&amp;quot;. Perform the mount command&lt;br /&gt;
     and query away.&lt;br /&gt;
&lt;br /&gt;
       $ dumpe2fs /dev/sda1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 160:&lt;br /&gt;
&lt;br /&gt;
     sysreport - a script that generates an HTML report on the system configuration. It&lt;br /&gt;
     gathers information about the hardware and is somewhat redhat specific. The utility&lt;br /&gt;
     should be run as root.&lt;br /&gt;
&lt;br /&gt;
       $ /usr/sbin/sysreport&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 161:&lt;br /&gt;
&lt;br /&gt;
     Key Bindings Using bind.  You can bind, say, ctl-t to a command.&lt;br /&gt;
&lt;br /&gt;
     Add the following to you &amp;quot;~/.inputrc&amp;quot; file, just as it is typed below with quotes.&lt;br /&gt;
&lt;br /&gt;
           &amp;quot;\C-t&amp;quot;: ls -l&lt;br /&gt;
&lt;br /&gt;
     Next, run the command&lt;br /&gt;
&lt;br /&gt;
           $ bind -f .inputrc&lt;br /&gt;
&lt;br /&gt;
     Or, you can do everything on the command line; however, it won't be there the next time&lt;br /&gt;
     you log in. Below is the way to do everything on the command line.&lt;br /&gt;
&lt;br /&gt;
           $ bind -x '&amp;quot;\C-t&amp;quot;:ls -l'&lt;br /&gt;
&lt;br /&gt;
     To unbind use the &amp;quot;-r&amp;quot; option. Single quotes are not needed.&lt;br /&gt;
&lt;br /&gt;
           $ bind -r &amp;quot;\C-t&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Getting a list of all bindings can be done as follows, and not this can be redirected&lt;br /&gt;
     to the &amp;quot;.inputrc&amp;quot; file for further editing.&lt;br /&gt;
&lt;br /&gt;
           $ bind -p &amp;gt; .inputrc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 162:&lt;br /&gt;
&lt;br /&gt;
     awk - common awk commands.&lt;br /&gt;
&lt;br /&gt;
     Find device names &amp;quot;sd&amp;quot; or with major number 4 and device name &amp;quot;tty&amp;quot;. Print the&lt;br /&gt;
     record number NR, plus the major number and minor number.&lt;br /&gt;
&lt;br /&gt;
          $ awk '$2 == &amp;quot;sd&amp;quot;||$1 == 4 &amp;amp;&amp;amp; $2 == &amp;quot;tty&amp;quot; { print NR,$1,$2}' /proc/devices&lt;br /&gt;
&lt;br /&gt;
     Find device name equal to &amp;quot;sound&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ awk '/sound/{print NR,$1,$2}' /proc/devices&lt;br /&gt;
&lt;br /&gt;
     Print the 5th record, first field, in file test&lt;br /&gt;
&lt;br /&gt;
          $ awk 'NR==5{print $1}' test&lt;br /&gt;
&lt;br /&gt;
     Print a record, skip 4 records, print a record etc from file1&lt;br /&gt;
&lt;br /&gt;
          $ awk '(NR-1) % 4 == 0 {print $1}' file1&lt;br /&gt;
&lt;br /&gt;
     Print all records except the last one from file1&lt;br /&gt;
&lt;br /&gt;
          $ tac file1|awk 'NR &amp;gt; 1 {print $0}'|tac&lt;br /&gt;
&lt;br /&gt;
     Print A,B,C ..Z on each line, cycling back to A if greater than 26 lines&lt;br /&gt;
&lt;br /&gt;
          $ awk '{ print substr(&amp;quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&amp;quot;,(NR-1)%26+1,1),$0}' file1&lt;br /&gt;
&lt;br /&gt;
     Number of bytes in a directory.&lt;br /&gt;
&lt;br /&gt;
          $ ls -l|awk 'BEGIN{ c=0}{ c+=$5} END{ print c}'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 163:&lt;br /&gt;
&lt;br /&gt;
     Configuring Remote Logging.  If you have several servers on 192.168.1.0, you can setup remote logging&lt;br /&gt;
     as follows.&lt;br /&gt;
&lt;br /&gt;
     MAIN LOG SERVER (192.168.1.81):&lt;br /&gt;
&lt;br /&gt;
        Firewall - allow UDP port 514 on the main server that will receive the logs.&lt;br /&gt;
&lt;br /&gt;
          $ iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 514 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        Edit &amp;quot;/etc/sysconfig/syslog&amp;quot; and add the &amp;quot;-r&amp;quot; option to SYSLOGD_OPTIONS as shown below.&lt;br /&gt;
&lt;br /&gt;
          SYSLOGD_OPTIONS=&amp;quot;-r -m -0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Note, the &amp;quot;-r&amp;quot; is to allow remote logging and  &amp;quot;-m 0&amp;quot; specifies that that the syslog process should&lt;br /&gt;
        not write regular timestamps.  I prefer to only write timestamps for the clients.&lt;br /&gt;
&lt;br /&gt;
        Next, restart the logging process&lt;br /&gt;
&lt;br /&gt;
          $ service syslog restart&lt;br /&gt;
&lt;br /&gt;
     CLIENT LOG SERVER:&lt;br /&gt;
&lt;br /&gt;
        Edit &amp;quot;/etc/syslog.conf&amp;quot; and add the ip address of the log server, or put in the hostname.&lt;br /&gt;
&lt;br /&gt;
            *.* @192.168.1.81&lt;br /&gt;
&lt;br /&gt;
        Next, restart the logging process&lt;br /&gt;
&lt;br /&gt;
          $ service syslog restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 164:&lt;br /&gt;
&lt;br /&gt;
     kudzu - hardware on your system. To probe the hardware on your system without doing&lt;br /&gt;
             anything, issue the following command.&lt;br /&gt;
&lt;br /&gt;
          $ kudzu -p&lt;br /&gt;
&lt;br /&gt;
      But wait, a lot of this information is already recorded in the following file&lt;br /&gt;
&lt;br /&gt;
            /etc/sysconfig/hwconf&lt;br /&gt;
&lt;br /&gt;
      You can also use lspci to list all PCI devices.&lt;br /&gt;
&lt;br /&gt;
          $ lspci&lt;br /&gt;
&lt;br /&gt;
      Also, take a look at the script /etc/sbin/sysreport, since this script has a lot of&lt;br /&gt;
      info gathering commands. You can pick and choose what you want, or run the complete&lt;br /&gt;
      report.&lt;br /&gt;
&lt;br /&gt;
      If you just want information on the NIC&lt;br /&gt;
&lt;br /&gt;
          $ ip link show eth0&lt;br /&gt;
          2: eth0: &amp;lt;BROADCAST,MULTICAST,UP&amp;gt; mtu 1500 qdisc pfifo_fast qlen 1000&lt;br /&gt;
          link/ether 00:11:11:8a:be:3f brd ff:ff:ff:ff:ff:ff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 165:&lt;br /&gt;
&lt;br /&gt;
     cfengine - a very power agent for monitoring and administrating both a single computer&lt;br /&gt;
              and or multiple computers. [ http://www.cfengine.org/ ]&lt;br /&gt;
&lt;br /&gt;
     The following is a quick example on downloading and installing cfengine.&lt;br /&gt;
&lt;br /&gt;
          $ ncftpget ftp://ftp.iu.hio.no/pub/cfengine/cfengine-2.1.15.tar.gz&lt;br /&gt;
          $ md5sum cfengine-2.1.15.tar.gz&lt;br /&gt;
          f03de82709f84c3d6d916b6e557321f9  cfengine-2.1.15.tar.gz&lt;br /&gt;
&lt;br /&gt;
          $ tar -xzf cfengine-2.1.15.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You need to have a current version of BerkeleyDB (http://downloads.sleepycat.com/db-4.3.28.tar.gz).&lt;br /&gt;
     Note that BerkeleyDB has a funny install. You cd to the &amp;quot;build_unix&amp;quot; directory, then,&lt;br /&gt;
&lt;br /&gt;
          Installing BerkeleyDB if needed:&lt;br /&gt;
                 $ wget http://downloads.sleepycat.com/db-4.3.28.tar.gz&lt;br /&gt;
                 $ tar -xzf db-4.3.28.tar.gz&lt;br /&gt;
                 $ cd db-4.3.28/build_unix/&lt;br /&gt;
                 $ ../dist/configure&lt;br /&gt;
                 make&lt;br /&gt;
                 make install&lt;br /&gt;
&lt;br /&gt;
     You also need a current version of OpenSSL. For instructions on how to install OpenSSL see&lt;br /&gt;
     (http://souptonuts.sourceforge.net/postfix_tutorial.html).&lt;br /&gt;
&lt;br /&gt;
     See (TIP 49) on putting &amp;quot;/usr/local/BerkeleyDB.4.3/lib&amp;quot; in the &amp;quot;/etc/ld.so.conf&amp;quot; file. Or&lt;br /&gt;
     once BerkeleyDB is installed, you can put the location on the command line as follows:&lt;br /&gt;
&lt;br /&gt;
     Configuring cfengine with direct reference to BerkeleyDB.4.3.  First cd to the cfengine source.&lt;br /&gt;
&lt;br /&gt;
          $ ./configure --with-berkeleydb=/usr/local/BerkeleyDB.4.3/lib&lt;br /&gt;
          $ make&lt;br /&gt;
          $ make install&lt;br /&gt;
&lt;br /&gt;
     Next create the following directories:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /var/cfengine/bin&lt;br /&gt;
          $ mkdir -p /var/cfengine/inputs&lt;br /&gt;
&lt;br /&gt;
     Copy needed files (cfagent, cfdoc, cfenvd, cfenvgraph, cfexecd, cfkey, cfrun, cfservd, cfshow):&lt;br /&gt;
&lt;br /&gt;
          $ cp /usr/local/sbin/cf* /var/cfengine/bin&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You'll also need to generate keys. As root, execute the following:&lt;br /&gt;
&lt;br /&gt;
          $ cfkey&lt;br /&gt;
&lt;br /&gt;
     The command above will write the public and private keys in&lt;br /&gt;
     &amp;quot;/var/cfengine/ppkeys&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You probably want (cfexecd, cfservd, and cfenvd) running on all servers. If you&lt;br /&gt;
     add the following to &amp;quot;/etc/rc.local&amp;quot; these daemons will start on reboot.&lt;br /&gt;
&lt;br /&gt;
           # Lines in /etc/rc.local&lt;br /&gt;
           /usr/local/sbin/cfexecd&lt;br /&gt;
           /usr/local/sbin/cfservd&lt;br /&gt;
           /usr/local/sbin/cfenvd&lt;br /&gt;
&lt;br /&gt;
     Also, make sure you run each command now as follows:&lt;br /&gt;
&lt;br /&gt;
          $ /usr/local/sbin/cfexecd&lt;br /&gt;
          $ /usr/local/sbin/cfservd&lt;br /&gt;
          $ /usr/local/sbin/cfenvd&lt;br /&gt;
&lt;br /&gt;
     Firewall settings must be adjusted to allows 5308 for tcp/udp. My local network&lt;br /&gt;
     is 192.168.1.0, so I'm opening it up for all my computers.&lt;br /&gt;
&lt;br /&gt;
          $ iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 5308 -j ACCEPT&lt;br /&gt;
          $ iptables -A INPUT -p tcp -s 192.168.1.0/24  --dport 5308 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
     A set of keys needs to be on the server and hosts. For example, my key on &amp;quot;tape.squeezel.com&amp;quot;&lt;br /&gt;
     should be copied over to the server &amp;quot;squeezel.squeezel.com&amp;quot; as follows:&lt;br /&gt;
&lt;br /&gt;
     This is done from tape.squeezel.com&lt;br /&gt;
&lt;br /&gt;
          $ scp /var/cfengine/ppkeys/localhost.pub  root@squeezel.squeezel.com:/var/cfengine/ppkeys/root-tape.squeezel.com.pub&lt;br /&gt;
          $ scp root@squeezel.squeezel.com:/var/cfengine/ppkeys/localhost.pub /var/cfengine/ppkeys/root-squeezel.squeezel.com.pub&lt;br /&gt;
&lt;br /&gt;
     Also, &amp;quot;/var/cfengine/inputs/cfrun.hosts&amp;quot; on the server &amp;quot;squeezel.squeezel.com&amp;quot; must contain&lt;br /&gt;
     all the computers that will get updated. This is &amp;quot;cfrun.hosts&amp;quot; on &amp;quot;squeezel.squeezel.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          closet.squeezel.com&lt;br /&gt;
          tape.squeezel.com&lt;br /&gt;
&lt;br /&gt;
     Once I'm done, from &amp;quot;tape.squeezel.com&amp;quot; I can run the following test:&lt;br /&gt;
&lt;br /&gt;
          $ cfrun squeezel.squeezel.com -v&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 166:&lt;br /&gt;
&lt;br /&gt;
     cfengine - a quick example. This example will be run as root. You create the file &amp;quot;cfagent.conf&amp;quot; in&lt;br /&gt;
     &amp;quot;/var/cfengine/inputs/&amp;quot;. The example below will checksum all the files in /home/chirico/deleteme/tripwire,&lt;br /&gt;
     it will also comment out the line &amp;quot;finger&amp;quot; in any file located in /tmp/testdir/stuff, also appending&lt;br /&gt;
     the command in this file &amp;quot; Edit change with cfengine&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          # /var/cfengine/inputs/cfagent.conf&lt;br /&gt;
          #&lt;br /&gt;
          # You run this with the following:&lt;br /&gt;
          #   cfagent -vK&lt;br /&gt;
        &lt;br /&gt;
          control:&lt;br /&gt;
                 actionsequence = ( files tidy editfiles )&lt;br /&gt;
                 ChecksumDatabase = ( /var/cfengine/cache.db )&lt;br /&gt;
                 # Below, true to update md5&lt;br /&gt;
                 ChecksumUpdates = ( true )&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
          files:&lt;br /&gt;
                 /home/chirico/deleteme/tripwire checksum=md5 recurse=inf&lt;br /&gt;
                 /home/chirico/deleteme/tripwire/moredata checksum=md5 recurse=inf&lt;br /&gt;
                 #/home/chirico/deleteme/tripwire/compress  recurse=inf include=*.txt acti on=compress&lt;br /&gt;
                   # If the database isn't secure, nothing is secure...&lt;br /&gt;
                 /var/cfengine/cache.db  mode=600 owner=root action=fixall&lt;br /&gt;
        &lt;br /&gt;
          tidy:&lt;br /&gt;
                 /home/chirico/deleteme/tripwire pattern=*~ recurse=inf age=0&lt;br /&gt;
                 # You must put an age. 0 runs now.&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
          editfiles:&lt;br /&gt;
        &lt;br /&gt;
                {  /tmp/testdir/stuff&lt;br /&gt;
&lt;br /&gt;
                   HashCommentLinesContaining &amp;quot;finger&amp;quot;&lt;br /&gt;
                   AppendIfNoSuchLine &amp;quot;# Edit Change with cfengine &amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     A few further notes on the above. The command &amp;quot;actionsequence = ( files tidy editfiles) tells the order&lt;br /&gt;
     of what to execute. The heading &amp;quot;tidy:&amp;quot; deletes files, and of course, &amp;quot;editfiles&amp;quot; does the editing of files.&lt;br /&gt;
&lt;br /&gt;
     To run the example, execute the following command. The  &amp;quot;-K&amp;quot; causes the lock file to be ignored.&lt;br /&gt;
&lt;br /&gt;
            $ cfagent -vK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 167:&lt;br /&gt;
&lt;br /&gt;
     Implementing Disk Quotas - a quick example that can easily be done on a live system for testing. There&lt;br /&gt;
     is no need to reboot, since you'll be creating a virtual filesystem.&lt;br /&gt;
&lt;br /&gt;
     Do the following as root. First create a mount point.&lt;br /&gt;
&lt;br /&gt;
            # mkdir -p /quota&lt;br /&gt;
&lt;br /&gt;
     Next, create 20M file. Since I have many of these files, I created a special directory &amp;quot;/usr/disk-img&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            # mkdir -p /usr/disk-img&lt;br /&gt;
            # dd if=/dev/zero of=/usr/disk-img/disk-quota.ext3 count=40960&lt;br /&gt;
&lt;br /&gt;
     The dd command above create a 20 MB file because, by default, dd uses a block size of 512 bytes. That makes&lt;br /&gt;
     the size: 40960*512=20971520.&lt;br /&gt;
&lt;br /&gt;
     Next, format this as an ext3 filesystem&lt;br /&gt;
&lt;br /&gt;
            # /sbin/mkfs -t ext3 -q /usr/disk-img/disk-quota.ext3 -F&lt;br /&gt;
&lt;br /&gt;
     Add the following line to &amp;quot;/etc/fstab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            /usr/disk-img/disk-quota.ext3    /quota ext3    rw,loop,usrquota,grpquota  0 0&lt;br /&gt;
&lt;br /&gt;
     Now, mount this filesystem&lt;br /&gt;
&lt;br /&gt;
            # mount /quota&lt;br /&gt;
&lt;br /&gt;
     Take a look at it:&lt;br /&gt;
&lt;br /&gt;
            # ls -l /quota&lt;br /&gt;
            lost+found&lt;br /&gt;
&lt;br /&gt;
     Now, run &amp;quot;quotacheck&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            # quotacheck -vug /quota&lt;br /&gt;
&lt;br /&gt;
     You'll get errors the first time this is run, because you have no quota files.&lt;br /&gt;
     But, run it a second time and you'll see something similiar to the following:&lt;br /&gt;
&lt;br /&gt;
            # quotacheck -vug /quota&lt;br /&gt;
            quotacheck: Scanning /dev/loop2 [/quota] done&lt;br /&gt;
            quotacheck: Checked 3 directories and 4 files&lt;br /&gt;
&lt;br /&gt;
     Now take a look at the files:&lt;br /&gt;
&lt;br /&gt;
            # ls -l /quota&lt;br /&gt;
            total 26&lt;br /&gt;
            -rw-------  1 root root  6144 Jun 14 12:23 aquota.group&lt;br /&gt;
            -rw-------  1 root root  6144 Jun 14 12:23 aquota.user&lt;br /&gt;
            drwx------  2 root root 12288 Jun 14 12:18 lost+found&lt;br /&gt;
&lt;br /&gt;
     Next use &amp;quot;edquota&amp;quot; to grant the user &amp;quot;chirico&amp;quot; a certain quota&lt;br /&gt;
&lt;br /&gt;
            # edquota -f /quota chirico&lt;br /&gt;
&lt;br /&gt;
     This will bring up a menu, and here I have edited so that user &amp;quot;chirico&amp;quot;&lt;br /&gt;
     has a soft limit of 120*512=61K, and a soft limit of 2 inodes and a hard limit of 5.&lt;br /&gt;
&lt;br /&gt;
             Disk quotas for user chirico (uid 500):&lt;br /&gt;
             Filesystem                   blocks       soft       hard     inodes     soft     hard&lt;br /&gt;
             /dev/loop2                        2        120        150         1        2         3&lt;br /&gt;
&lt;br /&gt;
     Next, turn quotas on with the following command:&lt;br /&gt;
&lt;br /&gt;
             $ quotaon /quota&lt;br /&gt;
&lt;br /&gt;
     If you need to turn off quotas, the command is &amp;quot;quotaoff -a&amp;quot; for all filesystems. You'll run into&lt;br /&gt;
     errors if you try to run quotacheck, say &amp;quot;quotacheck -avug&amp;quot; because this tries to unmount and mount&lt;br /&gt;
     the filesystem. You need to turn off quotas first &amp;quot;quotaoff /quota&amp;quot;. Note you only need to run&lt;br /&gt;
     quotacheck once, or when doing maintenance after a system crash.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      To get a report on the quote, runn &amp;quot;repquota&amp;quot; as follows:&lt;br /&gt;
&lt;br /&gt;
           $ repquota /quota&lt;br /&gt;
            *** Report for user quotas on device /dev/loop0&lt;br /&gt;
            Block grace time: 7days; Inode grace time: 7days&lt;br /&gt;
                                    Block limits                File limits&lt;br /&gt;
            User            used    soft    hard  grace    used  soft  hard  grace&lt;br /&gt;
            ----------------------------------------------------------------------&lt;br /&gt;
            root      --    1189       0       0              2     0     0&lt;br /&gt;
            chirico   -+      93       0       0              4     2     5  6days&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Note above that user &amp;quot;chirico&amp;quot; has used 4 on the file limits. This user has a hard&lt;br /&gt;
      limit of 5. So when this user tries to create 2 more files (bring this over the limit of 5)&lt;br /&gt;
      then he will get the following error as demonstrated below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           [chirico@squeezel chirico]$ touch one&lt;br /&gt;
           [chirico@squeezel chirico]$ touch two&lt;br /&gt;
           loop0: write failed, user file limit reached.&lt;br /&gt;
           touch: cannot touch `two': Disk quota exceeded&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Now, if repquota (run by root) is executed it shows the following:&lt;br /&gt;
&lt;br /&gt;
           $ repquota /quota&lt;br /&gt;
           *** Report for user quotas on device /dev/loop0&lt;br /&gt;
           Block grace time: 7days; Inode grace time: 7days&lt;br /&gt;
                                   Block limits                File limits&lt;br /&gt;
           User            used    soft    hard  grace    used  soft  hard  grace&lt;br /&gt;
           ----------------------------------------------------------------------&lt;br /&gt;
           root      --    1189       0       0              2     0     0&lt;br /&gt;
           chirico   -+      94       0       0              5     2     5  6days&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Note the &amp;quot;+&amp;quot; sign above. User &amp;quot;chirico&amp;quot; is above the File soft limits, and in this case&lt;br /&gt;
      above the hard limits.&lt;br /&gt;
&lt;br /&gt;
      To warn user by sending email to them, run &amp;quot;warnquota&amp;quot;, but you need check that&lt;br /&gt;
      &amp;quot;/etc/warnquota.conf&amp;quot; is setup correctly. For the example above, this file should&lt;br /&gt;
      look as follows:&lt;br /&gt;
&lt;br /&gt;
            $ cat /etc/quotatab&lt;br /&gt;
            #&lt;br /&gt;
            #  This is sample quotatab (/etc/quotatab)&lt;br /&gt;
            #  Here you can specify description of each device for user&lt;br /&gt;
            #&lt;br /&gt;
            #  Comments begin with hash in the beginning of the line&lt;br /&gt;
&lt;br /&gt;
            # Example of description&lt;br /&gt;
            /dev/loop0: This is loopback device&lt;br /&gt;
&lt;br /&gt;
      Just run the following as root:&lt;br /&gt;
&lt;br /&gt;
            $ warnquota&lt;br /&gt;
&lt;br /&gt;
      By the way, if you want to change the grace period, it can only be done on a filesystem&lt;br /&gt;
      basis. Not per user.&lt;br /&gt;
&lt;br /&gt;
            $  edquota -t&lt;br /&gt;
&lt;br /&gt;
      Users can run &amp;quot;quota&amp;quot; to see their usage as follows:&lt;br /&gt;
&lt;br /&gt;
            [chirico@squeezel ~]$ quota&lt;br /&gt;
            Disk quotas for user chirico (uid 500):&lt;br /&gt;
                 Filesystem  blocks   quota   limit   grace   files   quota   limit   grace&lt;br /&gt;
                 /dev/loop0      94       0       0               5      10      50&lt;br /&gt;
&lt;br /&gt;
      As you can see from above, I changed my inode limit to 50.&lt;br /&gt;
&lt;br /&gt;
      What about running this on the whole filesystem? Yes, below is an example where I'm running&lt;br /&gt;
      this on FC3, on the root of the filesystem &amp;quot;/&amp;quot;. This assumes that you have installed the&lt;br /&gt;
      quota package. Try doing &amp;quot;rpm -q quota&amp;quot; to see if this package is installed.&lt;br /&gt;
&lt;br /&gt;
        Step 1:&lt;br /&gt;
&lt;br /&gt;
           Check to make sure the quota software is installed. You can either do a &amp;quot;whereis quota&amp;quot;,&lt;br /&gt;
           or check for the rpm package.&lt;br /&gt;
&lt;br /&gt;
             $ whereis quota&lt;br /&gt;
             whereis quota&lt;br /&gt;
             quota: /usr/bin/quota /usr/share/man/man1/quota.1.gz&lt;br /&gt;
&lt;br /&gt;
           Checking for the rpm package.&lt;br /&gt;
&lt;br /&gt;
            $ rpm -q quota&lt;br /&gt;
            quota-3.12-5&lt;br /&gt;
&lt;br /&gt;
        Step 2:&lt;br /&gt;
&lt;br /&gt;
           Edit /etc/fstab and add usrquota and grpquota options for &amp;quot;/dev/VolGroup00/LogVol00&amp;quot;,&lt;br /&gt;
           which is shown on the first line below:&lt;br /&gt;
&lt;br /&gt;
             /dev/VolGroup00/LogVol00 /                      ext3    defaults,usrquota,grpquota        1 1&lt;br /&gt;
             LABEL=/boot             /boot                   ext3    defaults        1 2&lt;br /&gt;
             none                    /dev/pts                devpts  gid=5,mode=620  0 0&lt;br /&gt;
             none                    /dev/shm                tmpfs   defaults        0 0&lt;br /&gt;
             none                    /proc                   proc    defaults        0 0&lt;br /&gt;
             none                    /sys                    sysfs   defaults        0 0&lt;br /&gt;
             /dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0&lt;br /&gt;
&lt;br /&gt;
        Step 3:&lt;br /&gt;
&lt;br /&gt;
           Remount the filesystem as follows:&lt;br /&gt;
&lt;br /&gt;
             $ mount -o remount /&lt;br /&gt;
&lt;br /&gt;
        Step 4:&lt;br /&gt;
&lt;br /&gt;
           Run quotacheck with the &amp;quot;-m&amp;quot; option. Like the above statement, this will have to be run with&lt;br /&gt;
           root priviliges. This creates the quota database files, and it can take a long time if it is&lt;br /&gt;
           a large full filesystem.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             $ quotacheck -cugm /&lt;br /&gt;
&lt;br /&gt;
        Step 5:&lt;br /&gt;
&lt;br /&gt;
           This step is optional, but it's good to know if you need to recalculate quotas because of a&lt;br /&gt;
           system crash. It's demonstrated here, because at this point quota's have not been turned on.&lt;br /&gt;
           Again, note the &amp;quot;m&amp;quot; option below.&lt;br /&gt;
&lt;br /&gt;
             $ quotacheck -avumg&lt;br /&gt;
&lt;br /&gt;
        Step 6:&lt;br /&gt;
&lt;br /&gt;
           Set limits for specific users or groups using the &amp;quot;edquota&amp;quot; command. Shown below is the command&lt;br /&gt;
           to setup quotas for user &amp;quot;chirico&amp;quot;. Shown below this user has used 161560 blocks, he has a soft&lt;br /&gt;
           limit of 1161560 and a hard limit of 900000. He has used 3085 inodes and has a soft limit of 10000&lt;br /&gt;
           and a hard limit of 12000.&lt;br /&gt;
&lt;br /&gt;
             $ edquota -f / chirico&lt;br /&gt;
&lt;br /&gt;
             Disk quotas for user chirico (uid 500):&lt;br /&gt;
               Filesystem                   blocks       soft       hard     inodes     soft     hard&lt;br /&gt;
               /dev/mapper/VolGroup00-LogVol00     161560    1161560     900000       3085    10000    12000&lt;br /&gt;
&lt;br /&gt;
           You can put quotas on groups as well. The following is done as root. See (TIP 186 and TIP 6) for creating&lt;br /&gt;
           groups and adding users to groups.&lt;br /&gt;
&lt;br /&gt;
             $ edquota -g share&lt;br /&gt;
&lt;br /&gt;
           If you create a sharable directory for anyone in the group &amp;quot;share&amp;quot; (TIP 6), quota restrictions against&lt;br /&gt;
           group &amp;quot;share&amp;quot; will only apply to files added in the &amp;quot;/home/share&amp;quot; directory. When user &amp;quot;chirico&amp;quot; creates&lt;br /&gt;
           files in &amp;quot;/home/share&amp;quot; they also go against this user quota as well. However, when files are created in&lt;br /&gt;
           his home directory they do not go against the &amp;quot;share&amp;quot; group.&lt;br /&gt;
&lt;br /&gt;
           Note - if you get errors when trying to run &amp;quot;edquota -g share&amp;quot;, turn quotas off &amp;quot;quotaoff /&amp;quot; and&lt;br /&gt;
                  run &amp;quot;quotacheck -avugm&amp;quot;. Then, turn the quotas back on &amp;quot;quotaon /&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           You can see the status of the group quota with the following command:&lt;br /&gt;
&lt;br /&gt;
             $ quota -g share&lt;br /&gt;
&lt;br /&gt;
        Step 7:&lt;br /&gt;
&lt;br /&gt;
           Turn on quotas with the &amp;quot;qutoaon&amp;quot; command. This command needs to be done with root privileges.&lt;br /&gt;
&lt;br /&gt;
             $ quotaon /&lt;br /&gt;
&lt;br /&gt;
        Step 8:&lt;br /&gt;
&lt;br /&gt;
           Check &amp;quot;/etc/quotatab&amp;quot; file for the correct entries. Note that when you do the &amp;quot;mount&amp;quot; command&lt;br /&gt;
           the filesystem returned needs to match what is in the &amp;quot;quotatab&amp;quot; file. I have noticed that this&lt;br /&gt;
           is not the case by default.&lt;br /&gt;
&lt;br /&gt;
             $ mount&lt;br /&gt;
             /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw,usrquota,grpquota)&lt;br /&gt;
&lt;br /&gt;
           So the &amp;quot;/etc/quotatab&amp;quot; must contain the following line.&lt;br /&gt;
&lt;br /&gt;
             /dev/mapper/VolGroup00-LogVol00: This is the Volume group&lt;br /&gt;
&lt;br /&gt;
        Step 9:&lt;br /&gt;
&lt;br /&gt;
           Run &amp;quot;warnquota&amp;quot; as a check that the &amp;quot;/etc/quotatab&amp;quot; files is setup correctly.&lt;br /&gt;
&lt;br /&gt;
              $ warnquota&lt;br /&gt;
&lt;br /&gt;
        Step 10:&lt;br /&gt;
&lt;br /&gt;
           Setup a daily cron job for running &amp;quot;warnquota&amp;quot;. The following should be placed&lt;br /&gt;
           in &amp;quot;/etc/cron.daily&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              #!/bin/sh&lt;br /&gt;
              # Place this file in /etc/cron.daily&lt;br /&gt;
              # with rights 0755&lt;br /&gt;
              /usr/sbin/warnquota&lt;br /&gt;
              EXITVALUE=$?&lt;br /&gt;
              if [ $EXITVALUE != 0 ]; then&lt;br /&gt;
                 /usr/bin/logger -t warnquota &amp;quot;ALERT exited abnormally with [$EXITVALUE]&amp;quot;&lt;br /&gt;
              fi&lt;br /&gt;
              exit 0&lt;br /&gt;
&lt;br /&gt;
      References:&lt;br /&gt;
        http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/sysadmin-guide/ch-disk-quotas.html&lt;br /&gt;
        (TIP 6, TIP 186, and TIP 205)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 168:&lt;br /&gt;
&lt;br /&gt;
     rdist - remote file distribution client program. You can use this program in combination with&lt;br /&gt;
     ssh. This program does more than just copy files. Once a file has been copied, you can dictate&lt;br /&gt;
     other actions to be performed. Or you can hold off copying all together if the destination is&lt;br /&gt;
     running low on inodes, or disk space.&lt;br /&gt;
&lt;br /&gt;
     For the purpose of this example, all commands will been run on &amp;quot;squeezel.squeezel.com&amp;quot;, and the&lt;br /&gt;
     computers that will be updated are &amp;quot;tape.squeezel.com&amp;quot; and &amp;quot;closet.squeezel.com&amp;quot;. Obviously, you&lt;br /&gt;
     would substitute your computer names.&lt;br /&gt;
&lt;br /&gt;
     It helps to setup ssh keys on each computer first. Reference [http://souptonuts.sourceforge.net/sshtips.htm]&lt;br /&gt;
     and (TIP 12).&lt;br /&gt;
&lt;br /&gt;
     Step 1: Create the Configuration file myDistfile&lt;br /&gt;
&lt;br /&gt;
       Below is my sample &amp;quot;myDistfile&amp;quot;. This file will access hosts &amp;quot;tape.squeezel.com&amp;quot; using username chirico&lt;br /&gt;
       and &amp;quot;closet.squeezel.com&amp;quot; with the username running this command, and copy the&lt;br /&gt;
       files &amp;quot;/home/chirico/file1&amp;quot; and &amp;quot;/home/chirico/file2&amp;quot; to the these two servers creating the&lt;br /&gt;
       directory ~/tmpdir if it doesn't exist. Once these files are updated, a mail check (&amp;quot;sendmail -bv&amp;quot;)&lt;br /&gt;
       will be performed, and mail will be sent to &amp;quot;chirico@squeezel&amp;quot;. This happens twice, once for each file.&lt;br /&gt;
&lt;br /&gt;
       Note, the line &amp;quot;/home/chirico/file2 -&amp;gt; tape.squeezel.com&amp;quot; which moves the file &amp;quot;file2&amp;quot; to&lt;br /&gt;
       tape.squeezel.com renaming the file to &amp;quot;tapedest&amp;quot; in the directory &amp;quot;/home/chirico&amp;quot;. Once this file&lt;br /&gt;
       is copied, the rights are modified to &amp;quot;chmod +r&amp;quot;.  Likewise, &amp;quot;/home/chirico/file2 -&amp;gt; closet.squeezel.com&amp;quot;&lt;br /&gt;
       copies the file file2, which is renamed as closetdest.&lt;br /&gt;
&lt;br /&gt;
                 # Contents of myDistfile&lt;br /&gt;
                 HOSTS = ( chirico@tape.squeezel.com closet.squeezel.com )&lt;br /&gt;
&lt;br /&gt;
                 FILES = ( /home/chirico/file1 /home/chirico/file2 )&lt;br /&gt;
&lt;br /&gt;
                 ${FILES} -&amp;gt; ${HOSTS}&lt;br /&gt;
                    # Directory tmpdir will be created if it doesn't exist&lt;br /&gt;
                    install tmpdir ;&lt;br /&gt;
                    special /home/chirico/file1  &amp;quot;/usr/sbin/sendmail -bv mchirico@gmail.com&amp;quot;;&lt;br /&gt;
                    notify chirico@squeezel;&lt;br /&gt;
&lt;br /&gt;
                 /home/chirico/file2 -&amp;gt; tape.squeezel.com&lt;br /&gt;
                    install  /home/chirico/tapedest;&lt;br /&gt;
                    special  /home/chirico/tapedest &amp;quot;chmod +r /home/chirico/tapedest&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
                 /home/chirico/file2 -&amp;gt; closet.squeezel.com&lt;br /&gt;
                    install /home/chirico/closetdest;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 2: Command from squeezel.squeezel.com to run myDistfile above&lt;br /&gt;
&lt;br /&gt;
       Below is the command that will execute the contents in &amp;quot;myDistfile&amp;quot;. This command is run from the&lt;br /&gt;
       computer &amp;quot;squeezel.squeezel.com&amp;quot;. All output will go in the file &amp;quot;cmd1rdist.log&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ rdist -P /usr/local/bin/ssh -f ./myDistfile -l file=./cmd1rdist.log=all&lt;br /&gt;
&lt;br /&gt;
       Obviously you want a secure copy (using scp), so the -P option uses ssh as your secure&lt;br /&gt;
       transport mechanism.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 169:&lt;br /&gt;
&lt;br /&gt;
     Restricting root logins (/etc/securetty). ctl-alt-F4 will give you a prompt for tty3. Note&lt;br /&gt;
     that it is one number less. Take a look at the contents of &amp;quot;/etc/securetty&amp;quot;. To prevent&lt;br /&gt;
     root from logging in on this device, take out tty3 from this listing. Note, you can always&lt;br /&gt;
     login as another user, then, su to root.  Below is an example of the default&lt;br /&gt;
     &amp;quot;/etc/securetty&amp;quot; that allows root to login to everything.&lt;br /&gt;
&lt;br /&gt;
         [root@squeezel ~]# cat /etc/securetty&lt;br /&gt;
         console&lt;br /&gt;
         vc/1&lt;br /&gt;
         vc/2&lt;br /&gt;
         vc/3&lt;br /&gt;
         vc/4&lt;br /&gt;
         vc/5&lt;br /&gt;
         vc/6&lt;br /&gt;
         vc/7&lt;br /&gt;
         vc/8&lt;br /&gt;
         vc/9&lt;br /&gt;
         vc/10&lt;br /&gt;
         vc/11&lt;br /&gt;
         tty1&lt;br /&gt;
         tty2&lt;br /&gt;
         tty3&lt;br /&gt;
         tty4&lt;br /&gt;
         tty5&lt;br /&gt;
         tty6&lt;br /&gt;
         tty7&lt;br /&gt;
         tty8&lt;br /&gt;
         tty9&lt;br /&gt;
         tty10&lt;br /&gt;
         tty11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 170:&lt;br /&gt;
&lt;br /&gt;
     Perl map function. Try the following to get a quick take on this function,&lt;br /&gt;
     which increments each value in the array a;&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map {$_++} @a;&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot; } @a;&lt;br /&gt;
&lt;br /&gt;
     or&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     And you can easily make modifications, like reversing the order&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     Plus there is a grep() function that works on each element as well&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse grep{ $_ &amp;gt; 3} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     To get only odd numbers in reverse order:&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse grep{ !($_ % 2)} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference: http://www-128.ibm.com/developerworks/linux/library/l-road4.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 171:&lt;br /&gt;
&lt;br /&gt;
     Perl - subroutine call and shifting through variables. A simple and useful&lt;br /&gt;
     technique.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          sub test {&lt;br /&gt;
            local $mval;&lt;br /&gt;
            while( $mval = shift ) {&lt;br /&gt;
              print &amp;quot; $mval\n&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          test(&amp;quot;one&amp;quot;,&amp;quot;two&amp;quot;,&amp;quot;three&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 172:&lt;br /&gt;
&lt;br /&gt;
     Tcp wrappers - First &amp;quot;/etc/hosts.allow&amp;quot; is check, and if there is an entry in this file, no more&lt;br /&gt;
     checking it done.  If are no matches in &amp;quot;/etc/hosts.allow&amp;quot;, the &amp;quot;/etc/hosts.deny&amp;quot; file is checked&lt;br /&gt;
     and if a match is found, that service is blocked for that host.&lt;br /&gt;
&lt;br /&gt;
     Example &amp;quot;/etc/hosts.deny&amp;quot; file:&lt;br /&gt;
&lt;br /&gt;
         sshd: 192.168.1.171&lt;br /&gt;
&lt;br /&gt;
     The above file blocks access to computer 192.168.1.171. It's also possible to run commands when&lt;br /&gt;
     someone from this computer tries to ssh in. This example sends mail.&lt;br /&gt;
&lt;br /&gt;
         sshd: 192.168.1.171: spawn (echo -e &amp;quot;%d %h %H %u&amp;quot;| /bin/mail -s 'hosts.deny entry' root)&lt;br /&gt;
&lt;br /&gt;
     Of course, you can also run commands in the &amp;quot;/etc/hosts.allow&amp;quot; if you wanted mail sent for a successful&lt;br /&gt;
     login.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 173:&lt;br /&gt;
&lt;br /&gt;
     pgrep, pkill - look up or signal process based on name and other attributes.&lt;br /&gt;
&lt;br /&gt;
     To quick find all instances of ssh running, for user root, execute the following&lt;br /&gt;
     command:&lt;br /&gt;
&lt;br /&gt;
           $ pgrep -u root -l ssh&lt;br /&gt;
&lt;br /&gt;
     To kill a process, or send a signal use the &amp;quot;pkill&amp;quot; option. For example, to&lt;br /&gt;
     make syslog reread its configuration file:&lt;br /&gt;
&lt;br /&gt;
           $ pkill -HUP syslogd&lt;br /&gt;
&lt;br /&gt;
     Another command command is &amp;quot;pidof&amp;quot; that can tell you how many processes are running.&lt;br /&gt;
     This can be useful for detecting DOS attacks.&lt;br /&gt;
&lt;br /&gt;
           $ pidof sshd&lt;br /&gt;
           4783 4781 30008 30006 29888 29886 2246&lt;br /&gt;
&lt;br /&gt;
     Above there are 7 sshd's running. Reference &amp;quot;Tcpdump, Raw Socket and Libpap Tutorial&amp;quot;&lt;br /&gt;
     at [http://souptonuts.sourceforge.net/tcpdump_tutorial.html].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 174:&lt;br /&gt;
&lt;br /&gt;
     Password Cracking - tools to check your users passwords:&lt;br /&gt;
&lt;br /&gt;
      John The Ripper&lt;br /&gt;
        http://www.openwall.com/john/&lt;br /&gt;
&lt;br /&gt;
      Crack&lt;br /&gt;
        http://www.crypticide.com/users/alecm/&lt;br /&gt;
&lt;br /&gt;
      Slurpie&lt;br /&gt;
        http://www.ussrback.com/distributed.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 175:&lt;br /&gt;
&lt;br /&gt;
     Password Aging - setting the number of days a password is valid.&lt;br /&gt;
&lt;br /&gt;
         $ chage -M 90 &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 176:&lt;br /&gt;
&lt;br /&gt;
     Kernel Performance Tuning - /Documentation/sysctl/vm.txt documents kernel settings to&lt;br /&gt;
     improve performance. Below are some examples.&lt;br /&gt;
&lt;br /&gt;
       overcommit_memory:  0 -- default estimates the amount of memory for malloc&lt;br /&gt;
                           1 -- kernel pretends there is always enough memory until it runs out&lt;br /&gt;
                           3 -- never overcommit&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/overcommit_memory&lt;br /&gt;
          0&lt;br /&gt;
&lt;br /&gt;
       page-cluster:&lt;br /&gt;
            The Linux VM subsystem avoids excessive disk seeks by reading&lt;br /&gt;
            multiple pages on a page fault. The number of pages it reads&lt;br /&gt;
            is dependent on the amount of memory in your machine.&lt;br /&gt;
        &lt;br /&gt;
            The number of pages the kernel reads in at once is equal to&lt;br /&gt;
            2 ^ page-cluster. Values above 2 ^ 5 don't make much sense&lt;br /&gt;
            for swap because we only cluster swap data in 32-page groups.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/page-cluster&lt;br /&gt;
          3&lt;br /&gt;
&lt;br /&gt;
       min_free_kbytes:&lt;br /&gt;
            This is used to force the Linux VM to keep a minimum number&lt;br /&gt;
            of kilobytes free.  The VM uses this number to compute a pages_min&lt;br /&gt;
            value for each lowmem zone in the system.  Each lowmem zone gets&lt;br /&gt;
            a number of reserved free pages based proportionally on its size.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/min_free_kbytes&lt;br /&gt;
          3831&lt;br /&gt;
&lt;br /&gt;
       max_map_count:&lt;br /&gt;
            This file contains the maximum number of memory map areas a process&lt;br /&gt;
            may have. Memory map areas are used as a side-effect of calling&lt;br /&gt;
            malloc, directly by mmap and mprotect, and also when loading shared&lt;br /&gt;
            libraries.&lt;br /&gt;
&lt;br /&gt;
            While most applications need less than a thousand maps, certain&lt;br /&gt;
            programs, particularly malloc debuggers, may consume lots of them,&lt;br /&gt;
            e.g., up to one or two maps per allocation.&lt;br /&gt;
&lt;br /&gt;
            The default value is 65536.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/max_map_count&lt;br /&gt;
          65536&lt;br /&gt;
&lt;br /&gt;
        Also see http://people.redhat.com/alikins/system_tuning.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 177:&lt;br /&gt;
&lt;br /&gt;
     IO Scheduler - /Documentation/block/as-iosched.txt documents kernel settings for disk&lt;br /&gt;
     performance.&lt;br /&gt;
&lt;br /&gt;
     If you're not sure what partitions you have &amp;quot;$ cat /proc/partitions&amp;quot;. This example&lt;br /&gt;
     assumes hda, and you can see some of the kernel settings:&lt;br /&gt;
&lt;br /&gt;
          $ ls /sys/block/hda/queue/iosched&lt;br /&gt;
          back_seek_max  back_seek_penalty  clear_elapsed  fifo_batch_expire  fifo_expire_async&lt;br /&gt;
           fifo_expire_sync  find_best_crq  key_type  quantum  queued&lt;br /&gt;
&lt;br /&gt;
     References: http://lwn.net/Articles/102505/&lt;br /&gt;
                 http://bhhdoa.org.au/pipermail/ck/2004-September/000961.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 178:&lt;br /&gt;
&lt;br /&gt;
     iozone -- getting data on disk performance (http://www.iozone.org/). This is a very&lt;br /&gt;
     comprehensive package.&lt;br /&gt;
&lt;br /&gt;
           $ wget http://www.iozone.org/src/current/iozone3_242.tar&lt;br /&gt;
           $ tar -xf iozone3_242.tar&lt;br /&gt;
           $ cd iozone3_242/src/current&lt;br /&gt;
           $ make linux&lt;br /&gt;
&lt;br /&gt;
     At this point you should read the documentation. There is no &amp;quot;make install&amp;quot;. You&lt;br /&gt;
     copy it to each filesystem you want to run this program on. Below are some quick&lt;br /&gt;
     start commands.&lt;br /&gt;
&lt;br /&gt;
       Good comprehensive test.&lt;br /&gt;
&lt;br /&gt;
           $ iozone -a&lt;br /&gt;
&lt;br /&gt;
       I prefer this for small filesystems. It limits the record size to 10000 and does&lt;br /&gt;
       the output in operations per second (higher numbers mean faster drive).&lt;br /&gt;
&lt;br /&gt;
           $ ./iozone -a -s 10000 -O&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 179:&lt;br /&gt;
&lt;br /&gt;
     history - bash command to get a history of all commands typed. But, here is a way&lt;br /&gt;
     that you can get date and time listed as well.&lt;br /&gt;
&lt;br /&gt;
           $ HISTTIMEFORMAT=&amp;quot;%y/%m/%d %T &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Defining the environment variable above give you the date/time info when you&lt;br /&gt;
     execute history:&lt;br /&gt;
&lt;br /&gt;
           $ history&lt;br /&gt;
              ...&lt;br /&gt;
               175  05/06/30 12:51:46 grep '141.162.' mout &amp;gt; mout2&lt;br /&gt;
               176  05/06/30 12:51:48 e mout2&lt;br /&gt;
               177  05/06/30 12:56:59 ls&lt;br /&gt;
               178  05/06/30 12:57:02 ls&lt;br /&gt;
               179  05/06/30 12:57:39 ls&lt;br /&gt;
               180  05/06/30 12:57:49 ls -l&lt;br /&gt;
               181  05/06/30 13:01:10 history&lt;br /&gt;
               182  05/06/30 13:01:20 HISTTIMEFORMAT=&amp;quot;%y/%m/%d %T &amp;quot;&lt;br /&gt;
               183  05/06/30 13:01:23 history&lt;br /&gt;
              ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 180:&lt;br /&gt;
&lt;br /&gt;
     .config - Fedora Core getting the .config to rebuild the kernel. You can find&lt;br /&gt;
     this file, the &amp;quot;.config&amp;quot; file at the following location:&lt;br /&gt;
&lt;br /&gt;
          $ ls &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Or, to see the contents&lt;br /&gt;
&lt;br /&gt;
          $ cat &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     This can be important, if you're planning to build your own kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 181:&lt;br /&gt;
&lt;br /&gt;
     Listing control key settings.&lt;br /&gt;
&lt;br /&gt;
          $ stty -a&lt;br /&gt;
          speed 38400 baud; rows 0; columns 0; line = 0;&lt;br /&gt;
          intr = ^C; quit = ^\; erase = &amp;lt;undef&amp;gt;; kill = &amp;lt;undef&amp;gt;; eof = ^D; eol = &amp;lt;undef&amp;gt;; eol2 = &amp;lt;undef&amp;gt;; start = ^Q;&lt;br /&gt;
          stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;&lt;br /&gt;
          -parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts&lt;br /&gt;
          -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel&lt;br /&gt;
          opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0&lt;br /&gt;
          isig icanon iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 182:&lt;br /&gt;
&lt;br /&gt;
     iptables DNAT and SNAT. You have a webserver on 192.168.1.71. When people query this webserver, you want them&lt;br /&gt;
     to goto 192.168.1.81, with no indication that they are going to another web server. In fact, they always make&lt;br /&gt;
     their web hits to 192.168.1.71.&lt;br /&gt;
&lt;br /&gt;
     The following is the iptables commands:&lt;br /&gt;
&lt;br /&gt;
        $ echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
        $ iptables -t nat -A PREROUTING -d 192.168.1.71 -p tcp --dport 80 -j DNAT --to 192.168.1.81&lt;br /&gt;
        $ iptables -t nat -A POSTROUTING -d 192.168.1.81 -s 192.168.1.0/24 -p tcp --dport 80 -j SNAT --to 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
     Change 192.168.1.0/24 to whatever source you expect the web browser to come in on. Below is the tcpdump showing&lt;br /&gt;
     all traffic is relayed via 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
         [root@closet iptables]# tcpdump -nN port 80&lt;br /&gt;
&lt;br /&gt;
         17:34:58.790398 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: S 3620106373:3620106373(0) win 16384 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790465 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: S 3620106373:3620106373(0) win 16384 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790703 IP 192.168.1.81.80 &amp;gt; 192.168.1.71.1158: S 1973665156:1973665156(0) ack 3620106374 win 5840 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790720 IP 192.168.1.71.80 &amp;gt; 192.168.1.102.1158: S 1973665156:1973665156(0) ack 3620106374 win 5840 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790951 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: . ack 1 win 17520&lt;br /&gt;
         17:34:58.790965 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: . ack 1 win 17520&lt;br /&gt;
         17:34:58.791451 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: P 1:327(326) ack 1 win 17520&lt;br /&gt;
         17:34:58.791472 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: P 1:327(326) ack 1 win 17520&lt;br /&gt;
         17:34:58.791973 IP 192.168.1.81.80 &amp;gt; 192.168.1.71.1158: . ack 327 win 6432&lt;br /&gt;
&lt;br /&gt;
     Above the web client is on &amp;quot;192.168.1.102&amp;quot;. You can see that the 1st server &amp;quot;192.168.1.71&amp;quot; then goes out to&lt;br /&gt;
     the 2nd server &amp;quot;192.168.1.81&amp;quot; on the second line. The third line shows the 2nd server &amp;quot;192.168.1.81&amp;quot; responding to&lt;br /&gt;
     the 1st server, and the forth line passes this data back to the web client &amp;quot;192.168.1.102&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Note: You can save your current iptables setting with the following command:&lt;br /&gt;
&lt;br /&gt;
         $ iptables-save &amp;gt; iptables_store&lt;br /&gt;
&lt;br /&gt;
       The big advantage is that you can store the counters as well.&lt;br /&gt;
&lt;br /&gt;
         $ iptables-save -c &amp;gt; iptables_store_w_cnts&lt;br /&gt;
&lt;br /&gt;
       To restore the file, use the following:&lt;br /&gt;
&lt;br /&gt;
         $ iptables-restore -c &amp;lt; iptables_store_w_cnts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 183:&lt;br /&gt;
&lt;br /&gt;
     mailstats - display mail statistics. This file reads data from &amp;quot;/var/log/mail/statistics&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         [root@closet ~]# mailstats&lt;br /&gt;
         Statistics from Sat Jun 25 15:59:52 2005&lt;br /&gt;
          M   msgsfr  bytes_from   msgsto    bytes_to  msgsrej msgsdis msgsqur  Mailer&lt;br /&gt;
          4        1          2K        0          0K        0       0       0  esmtp&lt;br /&gt;
          9        0          0K        1          2K        0       0       0  local&lt;br /&gt;
         =====================================================================&lt;br /&gt;
          T        1          2K        1          2K        0       0       0&lt;br /&gt;
          C        1                    0                    0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 184:&lt;br /&gt;
&lt;br /&gt;
     Profiling C Applications - Assume you have the following program p1.c:&lt;br /&gt;
&lt;br /&gt;
         /* Program  p1.c */&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
         t1(int i)&lt;br /&gt;
         {&lt;br /&gt;
                 printf(&amp;quot;t1:%d\n&amp;quot;, i);&lt;br /&gt;
         }&lt;br /&gt;
        &lt;br /&gt;
         t2(int j)&lt;br /&gt;
         {&lt;br /&gt;
                 printf(&amp;quot;t2:%d\n&amp;quot;, j);&lt;br /&gt;
         }&lt;br /&gt;
        &lt;br /&gt;
         int main(void)&lt;br /&gt;
         {&lt;br /&gt;
                 int i, j;&lt;br /&gt;
        &lt;br /&gt;
                 for (i = 0; i &amp;lt; 5; ++i) {&lt;br /&gt;
                         t1(i);&lt;br /&gt;
                         for (j = 0; j &amp;lt; 2; ++j) {&lt;br /&gt;
                                 t2(j);&lt;br /&gt;
                         }&lt;br /&gt;
                 }&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
     Compile the program as follows:&lt;br /&gt;
&lt;br /&gt;
        $ gcc -pg -g -o p1 p1.c&lt;br /&gt;
        $ ./p1&lt;br /&gt;
        t1:0&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:1&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:2&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:3&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:4&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
&lt;br /&gt;
     Next, to get the profile graph.&lt;br /&gt;
&lt;br /&gt;
        $ gprof -p -b p1&lt;br /&gt;
        Flat profile:&lt;br /&gt;
        &lt;br /&gt;
        Each sample counts as 0.01 seconds.&lt;br /&gt;
         no time accumulated&lt;br /&gt;
        &lt;br /&gt;
          %   cumulative   self              self     total&lt;br /&gt;
         time   seconds   seconds    calls  Ts/call  Ts/call  name&lt;br /&gt;
          0.00      0.00     0.00       10     0.00     0.00  t2&lt;br /&gt;
          0.00      0.00     0.00        5     0.00     0.00  t1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Above note the 10 calls to t2 and 5 calls to t1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 185:&lt;br /&gt;
&lt;br /&gt;
     CDPATH - this is a bash variable like PATH that defines a search path&lt;br /&gt;
              for the cd command.&lt;br /&gt;
&lt;br /&gt;
     Suppose you have the following directory structure:&lt;br /&gt;
&lt;br /&gt;
             /home/chirico/stuff&lt;br /&gt;
                               |-- dirA&lt;br /&gt;
                               `-- dirB&lt;br /&gt;
&lt;br /&gt;
     Assume you define CDPATH as follows:&lt;br /&gt;
&lt;br /&gt;
             CDPATH=/home/chirico/stuff&lt;br /&gt;
&lt;br /&gt;
     Now, no matter what directory you are in if you use the cd command below&lt;br /&gt;
     you will automatically move to &amp;quot;/home/chirico/stuff/dirA&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             $ cd dirA&lt;br /&gt;
&lt;br /&gt;
     Note you could be in &amp;quot;/etc&amp;quot; and will move directly to &amp;quot;/home/chirico/stuff/dirA&amp;quot;.&lt;br /&gt;
     This command has the same format as PATH - multiple entries are separated by a colon.&lt;br /&gt;
     If the current directory contain a sub-directory dirA, then, it gets priority.&lt;br /&gt;
&lt;br /&gt;
     The following is part of my .bash_profile&lt;br /&gt;
&lt;br /&gt;
             CDPATH=/work/cpearls/src/posted_on_sf/:/work/souptonuts/documentation/:/home/chirico/deleteme/&lt;br /&gt;
             export PATH CVS_RSH EDITOR JAVA_HOME CDPATH&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 186:&lt;br /&gt;
&lt;br /&gt;
     Groups - add groups and users to groups. The following shows how to create the group &amp;quot;share&amp;quot;&lt;br /&gt;
              and add the user &amp;quot;chirico&amp;quot; to this group. The following should be done as root, and&lt;br /&gt;
              assumes the account &amp;quot;chirico&amp;quot; already exits.&lt;br /&gt;
&lt;br /&gt;
             $ groupadd share&lt;br /&gt;
             $ usermod -G share chirico&lt;br /&gt;
&lt;br /&gt;
     Note the change made to &amp;quot;/etc/group&amp;quot; below:&lt;br /&gt;
&lt;br /&gt;
             $ cat /etc/group|grep 'share'&lt;br /&gt;
             share:x:616:chirico&lt;br /&gt;
&lt;br /&gt;
     If the user chirico is currently logged in, he should run the following&lt;br /&gt;
     command to immediately have group &amp;quot;share&amp;quot; rights. Or, the next time he logs&lt;br /&gt;
     in he will have access to this group.&lt;br /&gt;
&lt;br /&gt;
             $ newgrp share&lt;br /&gt;
&lt;br /&gt;
     Reference the following (TIP 6, TIP 167).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 187:&lt;br /&gt;
&lt;br /&gt;
     oprofile - steps for running oprofile on Fedora.&lt;br /&gt;
&lt;br /&gt;
     Step 1:&lt;br /&gt;
&lt;br /&gt;
       Find out what version of the kernel you are running.&lt;br /&gt;
&lt;br /&gt;
           $ uname -a&lt;br /&gt;
           Linux closet.squeezel.com 2.6.12-1.1398_FC4 #1 Fri Jul 15 00:52:32 EDT 2005 i686 i686 i386 GNU/Linux&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 2:&lt;br /&gt;
&lt;br /&gt;
       Download the source in a chosen directory. Above, I'm running 2.6.12-1, but I'm going to go for 2.6.12.3, since&lt;br /&gt;
       it's a little later. You want the signed file as well.&lt;br /&gt;
&lt;br /&gt;
           $ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.12.3.tar.gz&lt;br /&gt;
           $ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.12.3.tar.gz.sign&lt;br /&gt;
&lt;br /&gt;
       Now, check the signature.&lt;br /&gt;
&lt;br /&gt;
           $ gpg --verify linux-2.6.12.3.tar.gz.sign linux-2.6.12.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 3:&lt;br /&gt;
&lt;br /&gt;
       Unpack the file.&lt;br /&gt;
&lt;br /&gt;
           $ tar -xzf linux-2.6.12.3.tar.gz&lt;br /&gt;
           $ cd cd linux-2.6.12.3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 4:&lt;br /&gt;
&lt;br /&gt;
       Copy the &amp;quot;.config&amp;quot; used to compile your previous kernel. You should find it&lt;br /&gt;
       in the following direcotry &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       Copy it to the linux-2.6.12.3 directory.&lt;br /&gt;
&lt;br /&gt;
           $ cp &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot; .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 5:&lt;br /&gt;
&lt;br /&gt;
       Run make as follows. It will ask for a few questions on &amp;quot;make oldconfig&amp;quot;. The&lt;br /&gt;
       make installs below will have to be done with root privileges.&lt;br /&gt;
&lt;br /&gt;
          $ make oldconfig&lt;br /&gt;
          $ make bzImage&lt;br /&gt;
          $ make modules&lt;br /&gt;
          $ make modules_install&lt;br /&gt;
          $ make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 6:&lt;br /&gt;
&lt;br /&gt;
       Edit the &amp;quot;/boot/grub/grub.conf&amp;quot; and set default = 0  as shown below in this&lt;br /&gt;
       file.&lt;br /&gt;
&lt;br /&gt;
            default=0&lt;br /&gt;
            timeout=5&lt;br /&gt;
            splashimage=(hd0,2)/grub/splash.xpm.gz&lt;br /&gt;
            hiddenmenu&lt;br /&gt;
            title Fedora Core (2.6.12.3)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.12.3 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.12.3.img&lt;br /&gt;
            title Fedora Core (2.6.12-1.1398_FC4)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.12-1.1398_FC4 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.12-1.1398_FC4.img&lt;br /&gt;
            title Fedora Core (2.6.11-1.1369_FC4)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.11-1.1369_FC4 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.11-1.1369_FC4.img&lt;br /&gt;
            title Other&lt;br /&gt;
                    rootnoverify (hd0,1)&lt;br /&gt;
                    chainloader +1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 7:&lt;br /&gt;
&lt;br /&gt;
       Shutdown with the restart option.&lt;br /&gt;
&lt;br /&gt;
           $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 8:&lt;br /&gt;
&lt;br /&gt;
       Run opcontrol. The commands below are done as root.  My kernel was compiled in the following&lt;br /&gt;
       directory &amp;quot;/home/kernel/linux-2.6.12.3/&amp;quot;, so I'll run opcontrol as follows:&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --vmlinux=/home/kernel/linux-2.6.12.3/vmlinux&lt;br /&gt;
&lt;br /&gt;
       Now start.&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --start&lt;br /&gt;
           Using 2.6+ OProfile kernel interface.&lt;br /&gt;
           Reading module info.&lt;br /&gt;
           Using log file /var/lib/oprofile/oprofiled.log&lt;br /&gt;
           Daemon started.&lt;br /&gt;
           Profiler running.&lt;br /&gt;
&lt;br /&gt;
       Shutdown opcontrol.&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --shutdown&lt;br /&gt;
&lt;br /&gt;
       Run report.&lt;br /&gt;
&lt;br /&gt;
           $ opreport&lt;br /&gt;
&lt;br /&gt;
           CPU: CPU with timer interrupt, speed 0 MHz (estimated)&lt;br /&gt;
           Profiling through timer interrupt&lt;br /&gt;
                     TIMER:0|&lt;br /&gt;
             samples|      %|&lt;br /&gt;
           ------------------&lt;br /&gt;
              156088 99.8746 vmlinux&lt;br /&gt;
                  60  0.0384 libc-2.3.5.so&lt;br /&gt;
                  30  0.0192 oprofiled&lt;br /&gt;
                  23  0.0147 libcrypto.so.0.9.7f&lt;br /&gt;
                  13  0.0083 bash&lt;br /&gt;
                  12  0.0077 screen&lt;br /&gt;
                  10  0.0064 sshd&lt;br /&gt;
                   9  0.0058 ssh&lt;br /&gt;
                   6  0.0038 ip_tables&lt;br /&gt;
                   6  0.0038 libncurses.so.5.4&lt;br /&gt;
                   5  0.0032 b44&lt;br /&gt;
                   5  0.0032 ext3&lt;br /&gt;
                   5  0.0032 ld-2.3.5.so&lt;br /&gt;
                   4  0.0026 ip_conntrack&lt;br /&gt;
                   4  0.0026 jbd&lt;br /&gt;
                   2  0.0013 grep&lt;br /&gt;
                   1 6.4e-04 libdns.so.20.0.2&lt;br /&gt;
                   1 6.4e-04 libisc.so.9.1.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Reference the following for more documentation:&lt;br /&gt;
             http://oprofile.sourceforge.net/doc/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 188:&lt;br /&gt;
&lt;br /&gt;
     cyrus-imapd with Postfix using sasldb for authentication. For this example&lt;br /&gt;
     the server is tape.squeezel.com and the user is chirico.&lt;br /&gt;
&lt;br /&gt;
        Step 1:&lt;br /&gt;
        &lt;br /&gt;
                   $ yum install cyrus-imapd&lt;br /&gt;
                   $ yum install cyrus-imapd-utils&lt;br /&gt;
        &lt;br /&gt;
            You need &amp;quot;cyrus-imapd-utils&amp;quot; for cyradm.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 2:&lt;br /&gt;
        &lt;br /&gt;
          Edit /etc/imapd.conf&lt;br /&gt;
        &lt;br /&gt;
               configdirectory: /var/lib/imap&lt;br /&gt;
               partition-default: /var/spool/imap&lt;br /&gt;
               admins: cyrus&lt;br /&gt;
               sievedir: /var/lib/imap/sieve&lt;br /&gt;
               sendmail: /usr/sbin/sendmail&lt;br /&gt;
               hashimapspool: true&lt;br /&gt;
               # Chirico Commented the below line&lt;br /&gt;
               # sasl_pwcheck_method: saslauthd&lt;br /&gt;
               # Because using sasldb&lt;br /&gt;
               sasl_pwcheck_method: auxprop&lt;br /&gt;
               sasl_auxprop_plugin: sasldb&lt;br /&gt;
               #  Chirico end change&lt;br /&gt;
               sasl_mech_list: PLAIN&lt;br /&gt;
               tls_cert_file: /usr/share/ssl/certs/cyrus-imapd.pem&lt;br /&gt;
               tls_key_file: /usr/share/ssl/certs/cyrus-imapd.pem&lt;br /&gt;
               tls_ca_file: /usr/share/ssl/certs/ca-bundle.crt&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 3:&lt;br /&gt;
        &lt;br /&gt;
           Create a user and password:&lt;br /&gt;
        &lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` cyrus&lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` chirico&lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` allmail&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
           This will automatically create the file /etc/sasldb2. But look&lt;br /&gt;
           at the default rights, assuming you ran saslpasswd2 as root:&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /etc/sasldb2&lt;br /&gt;
                 -rw-r-----  1 root root 12288 Jul 31 09:50 /etc/sasldb2&lt;br /&gt;
        &lt;br /&gt;
           We need to correct this in step 4.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 4:&lt;br /&gt;
        &lt;br /&gt;
                 $ chown root.mail /etc/sasldb2&lt;br /&gt;
                 $ ls -l /etc/sasldb2&lt;br /&gt;
                 -rw-r-----  1 root mail 12288 Jul 31 09:50 /etc/sasldb2&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 5:&lt;br /&gt;
        &lt;br /&gt;
            Update &amp;quot;/etc/postfix/main.cf&amp;quot;. Note in /etc/imapd.conf the configdirectory&lt;br /&gt;
            points to /var/lib/imap, and if I look at this directory I see the&lt;br /&gt;
            socket directory. However, after staring /etc/init.d/cyrus-imapd  there&lt;br /&gt;
            will be a socket file &amp;quot;/var/lib/imap/socket/lmtp&amp;quot;. (See step 6).&lt;br /&gt;
        &lt;br /&gt;
                  mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp&lt;br /&gt;
                  mailbox_transport = cyrus&lt;br /&gt;
        &lt;br /&gt;
            Restart postfix.&lt;br /&gt;
        &lt;br /&gt;
                  /etc/init.d/postfix restart&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 6:&lt;br /&gt;
&lt;br /&gt;
            Start cyrus-imapd and look for the socket file.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
                   $ /etc/init.d/cyrus-imapd restart&lt;br /&gt;
                   Shutting down cyrus-imapd:                                 [  OK  ]&lt;br /&gt;
                   Starting cyrus-imapd: preparing databases... done.         [  OK  ]&lt;br /&gt;
        &lt;br /&gt;
            Now you should see the lmtp file:&lt;br /&gt;
        &lt;br /&gt;
                   $ ls -l /var/lib/imap/socket/lmtp&lt;br /&gt;
                   srwxrwxrwx  1 root root 0 Jul 31 10:04 /var/lib/imap/socket/lmtp&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 7:&lt;br /&gt;
        &lt;br /&gt;
            Add users. Note, you may have to go back to step 3 to add them to /etc/sasldb2&lt;br /&gt;
            as well.&lt;br /&gt;
        &lt;br /&gt;
                   $ su - cyrus&lt;br /&gt;
                   $ cyradm tape.squeezel.com&lt;br /&gt;
                   tape.squeezel.com&amp;gt; cm user.chirico&lt;br /&gt;
                   tape.squeezel.com&amp;gt; quit&lt;br /&gt;
        &lt;br /&gt;
            Now got back as root, and check that everything was created correctly.&lt;br /&gt;
        &lt;br /&gt;
                   $ ls /var/spool/imap/c/user/&lt;br /&gt;
                   total 8&lt;br /&gt;
                   drwx------  2 cyrus mail 4096 Jul 31 10:21 chirico&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 8:&lt;br /&gt;
        &lt;br /&gt;
             Run a mail test. We'll do this as root to the chirico account.&lt;br /&gt;
        &lt;br /&gt;
                   $ mail -s 'First test'  chirico&lt;br /&gt;
                   first test&lt;br /&gt;
                   .&lt;br /&gt;
        &lt;br /&gt;
             Now, still as root check the maillog. Normally everything should work.&lt;br /&gt;
        &lt;br /&gt;
                  $ tail /var/log/maillog&lt;br /&gt;
        &lt;br /&gt;
             However, I got the following error below.&lt;br /&gt;
&lt;br /&gt;
                     Jul 31 10:29:03 tape postfix/cleanup[30124]: AE7CB1B34A4: message-id=&amp;lt;20050731142903.AE7CB1B34A4@tape.squeezel.com&amp;gt;&lt;br /&gt;
                     Jul 31 10:29:03 tape postfix/qmgr[30120]: AE7CB1B34A4: from=&amp;lt;root@tape.squeezel.com&amp;gt;, size=315, nrcpt=1 (queue active)&lt;br /&gt;
                     Jul 31 10:29:03 tape pipe[30128]: fatal: pipe_comand: execvp /cyrus/bin/deliver: No such file or directory&lt;br /&gt;
&lt;br /&gt;
             If you get a similiar error, you may need to adjust the settting in /etc/postfix/master.cf&lt;br /&gt;
        &lt;br /&gt;
                 # This is the problem in /etc/postfix/master.cf&lt;br /&gt;
                 cyrus     unix  -       n       n       -       -       pipe&lt;br /&gt;
                   user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}&lt;br /&gt;
        &lt;br /&gt;
             My deliver file is the following&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
                 -rwxr-xr-x  1 root root 846228 Apr  4 18:59 /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
        &lt;br /&gt;
             So I need to change my /etc/postfix/master.cf as follows:&lt;br /&gt;
        &lt;br /&gt;
                 # Fix because by deliver file is under  /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
                 cyrus     unix  -       n       n       -       -       pipe&lt;br /&gt;
                   user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -r ${sender} -m ${extension} ${user}&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
             If changes were needed, like I had to do, restart postfix&lt;br /&gt;
        &lt;br /&gt;
                 $ /etc/init.d/postfix restart&lt;br /&gt;
        &lt;br /&gt;
             Now, if everything works, you should start to see numbers in the spool directory like &amp;quot;1.&amp;quot; and&lt;br /&gt;
             &amp;quot;2.&amp;quot;.&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /var/spool/imap/c/user/chirico/&lt;br /&gt;
                 total 40&lt;br /&gt;
                 -rw-------  1 cyrus mail  545 Jul 31 10:44 1.&lt;br /&gt;
                 -rw-------  1 cyrus mail  547 Jul 31 10:45 2.&lt;br /&gt;
                 -rw-------  1 cyrus mail 1276 Jul 31 10:45 cyrus.cache&lt;br /&gt;
                 -rw-------  1 cyrus mail  153 Jul 31 10:21 cyrus.header&lt;br /&gt;
                 -rw-------  1 cyrus mail  196 Jul 31 10:45 cyrus.index&lt;br /&gt;
&lt;br /&gt;
        Step 9:&lt;br /&gt;
        &lt;br /&gt;
             Local firewall.&lt;br /&gt;
        &lt;br /&gt;
                 # imap&lt;br /&gt;
                iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 143 -j ACCEPT&lt;br /&gt;
                iptables -A INPUT -p tcp -s 192.168.1.0/24  --dport 143 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        Step 10:&lt;br /&gt;
        &lt;br /&gt;
             Configure cyrus-imapd to start for run-level 3 and 5.&lt;br /&gt;
&lt;br /&gt;
                 # chkconfig --level 35 cyrus-imapd on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       HINTS - &lt;br /&gt;
&lt;br /&gt;
        Something to watch out for:&lt;br /&gt;
&lt;br /&gt;
              Something to watch out for: If a user creates a .forward file in their shell account with the&lt;br /&gt;
              following entry, then, mail will not get mail relayed to cyrus.&lt;br /&gt;
&lt;br /&gt;
                  &amp;quot;|exec /usr/bin/procmail&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             The /etc/maillog will show something like this:&lt;br /&gt;
&lt;br /&gt;
                    to=&amp;lt;chirico@squeezel.squeezel.com&amp;gt;, orig_to=&amp;lt;chirico&amp;gt;, relay=local, delay=0,&lt;br /&gt;
                          status=sent (delivered to command: exec /usr/bin/procmail)&lt;br /&gt;
&lt;br /&gt;
             Remove the &amp;quot;.forward&amp;quot; file from their home directory and you'll get the following:&lt;br /&gt;
&lt;br /&gt;
                    to=&amp;lt;chirico@squeezel.squeezel.com&amp;gt;, relay=cyrus, delay=0,&lt;br /&gt;
                          status=sent (squeezel.squeezel.com)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              mutt with IMAP?  (See TIP 190)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 189:&lt;br /&gt;
&lt;br /&gt;
     expand - convert tabs to spaces in a file.&lt;br /&gt;
&lt;br /&gt;
             $ expand How_to_Linux_and_Open_Source.txt &amp;gt; notabs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 190:&lt;br /&gt;
&lt;br /&gt;
     mutt with imap - assume you have setup imap (see tip 188). Now how do you configure&lt;br /&gt;
                      your &amp;quot;.muttrc&amp;quot; file to automatically connect, securely to the IMAP server?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       &lt;br /&gt;
     Below is an example of my &amp;quot;.muttrc&amp;quot; file. For this example, assume my password is &amp;quot;S0m3paSSw0r9&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             $ cat .muttrc&lt;br /&gt;
             set spoolfile = &amp;quot;imaps://chirico:S0m3paSSw0r9@squeezel.squeezel.com/&lt;br /&gt;
             set imap_force_ssl=yes&lt;br /&gt;
             set certificate_file=~/.mutt/certificates/72d31154.0&lt;br /&gt;
&lt;br /&gt;
     Now, you want to copy the certificate as a &amp;quot;file.pem&amp;quot; and run &amp;quot;c_rehash&amp;quot; to convert this&lt;br /&gt;
     file to a number. See the article. See the following article on how to do this under the &lt;br /&gt;
     fetchmail section.&lt;br /&gt;
&lt;br /&gt;
          http://souptonuts.sourceforge.net/postfix_tutorial.html&lt;br /&gt;
&lt;br /&gt;
     This is a quick summary of creating this key.&lt;br /&gt;
&lt;br /&gt;
             $ openssl s_client -connect squeezel.squeezel.com:995 -showcerts &amp;gt; file.pem&lt;br /&gt;
             $ c_rehash ~/.mutt/certificates&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 191:&lt;br /&gt;
&lt;br /&gt;
     Apache - CGI scripts.  There are two ways to enable CGI scripts. The second method is the&lt;br /&gt;
              prefered method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           First way, the easy way. Look for the &amp;quot;http.conf&amp;quot; file. On Fedora Core, this file can be&lt;br /&gt;
           found under &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;. Edit this file as follows to make &lt;br /&gt;
           &amp;quot;http://squeezel.squeezel.com/chirico-cgi/&amp;quot; execute scripts.&lt;br /&gt;
&lt;br /&gt;
                     ScriptAlias /chirico-cgi/ &amp;quot;/home/chirico/cgi-bin/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           Second way, the better way. Instead of doing the above, make the following change in &lt;br /&gt;
           &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                     &amp;lt;Directory /home/chirico/cgi-bin&amp;gt;&lt;br /&gt;
                      Options +ExecCGI&lt;br /&gt;
                      SetHandler chirico-cgi&lt;br /&gt;
                     &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Running a test script. Now copy the following test script into the directory &amp;quot;/home/chirico/cgi-bin&amp;quot;&lt;br /&gt;
        and change the rights to execute for the user running this.&lt;br /&gt;
&lt;br /&gt;
                  #!/bin/sh&lt;br /&gt;
                  # Save as test.cgi&lt;br /&gt;
                  #  chown apache.apache test.cgi&lt;br /&gt;
                  #  chmod 700 test.cgi&lt;br /&gt;
                  echo &amp;quot;Content-Type: text/html&amp;quot;&lt;br /&gt;
                  echo&lt;br /&gt;
                  echo &amp;quot;Hello world from user &amp;lt;b&amp;gt;`whoami`&amp;lt;/b&amp;gt;! &amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 192:&lt;br /&gt;
&lt;br /&gt;
     Bash - using getopts for your bash scripts.&lt;br /&gt;
&lt;br /&gt;
                   #!/bin/bash&lt;br /&gt;
                   while getopts &amp;quot;ab:cd:&amp;quot; Option&lt;br /&gt;
                   # b and d take arguments&lt;br /&gt;
                   #&lt;br /&gt;
                   do&lt;br /&gt;
                     case $Option in&lt;br /&gt;
                       a) echo -e &amp;quot;a = $OPTIND&amp;quot;;;&lt;br /&gt;
                       b) echo -e &amp;quot;b = $OPTIND $OPTARG&amp;quot;;;&lt;br /&gt;
                       c) echo -e &amp;quot;c = $OPTIND&amp;quot;;;&lt;br /&gt;
                       d) echo -e &amp;quot;d = $OPTIND $OPTARG&amp;quot;;;&lt;br /&gt;
                    esac&lt;br /&gt;
                  done&lt;br /&gt;
                  shift $(($OPTIND - 1))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 193:&lt;br /&gt;
&lt;br /&gt;
     Sieve - creating sieve recipes with &amp;quot;sieveshell&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     The following sieve script put all jefferson.edu mail into the &lt;br /&gt;
     folder jefferson. This assumes that I have already created the IMP &lt;br /&gt;
     directory, or mail box (INBOX.jefferson), which can be done in mutt &lt;br /&gt;
     with the &amp;quot;C&amp;quot; command. Below is an example of finding &amp;quot;jefferson.edu&amp;quot;&lt;br /&gt;
     anywhere in the header. &lt;br /&gt;
&lt;br /&gt;
         # This is a file named jefferson.siv&lt;br /&gt;
         require [&amp;quot;fileinto&amp;quot;];&lt;br /&gt;
         if header :contains &amp;quot;Received&amp;quot; &amp;quot;from jefferson.edu&amp;quot; {&lt;br /&gt;
           fileinto &amp;quot;INBOX.jefferson&amp;quot;;&lt;br /&gt;
           stop;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
     Now, from the command propt execute &amp;quot;sieveshell&amp;quot; with the hostname of the&lt;br /&gt;
     imap server. My server is squeezel.squeezel.com, so I would execute the &lt;br /&gt;
     following:&lt;br /&gt;
&lt;br /&gt;
          $ sieveshell squeezel.squeezel.com&lt;br /&gt;
          connecting to squeezel.squeezel.com&lt;br /&gt;
          Please enter your password:****&lt;br /&gt;
          &amp;gt; put jefferson.siv&lt;br /&gt;
          &amp;gt; activate jefferson.siv&lt;br /&gt;
          &amp;gt; list&lt;br /&gt;
          jefferson.siv  &amp;lt;- active script&lt;br /&gt;
          &amp;gt; quit&lt;br /&gt;
&lt;br /&gt;
     Note the put brings in the script. And you need to activiate it.&lt;br /&gt;
&lt;br /&gt;
     You can activate a sieve script for any user on your system if you are&lt;br /&gt;
     root. This is an example of activating a script for user chirico. Assume&lt;br /&gt;
     below the root prompt is &amp;quot;#&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          # sieveshell -a chirico -u chirico squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
     You can also automate everything from a bash script. But note after&lt;br /&gt;
     the -e the commands, and not a file with the commands, follows within&lt;br /&gt;
     quotes. This is the script I use for my home system.&lt;br /&gt;
&lt;br /&gt;
         #!/bin/bash&lt;br /&gt;
         sieveshell -a chirico -u chirico -e 'deactivate&lt;br /&gt;
         delete chirico.siv&lt;br /&gt;
         put chirico.siv&lt;br /&gt;
         activate chirico.siv&lt;br /&gt;
         list&lt;br /&gt;
         '  squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     References:&lt;br /&gt;
         http://wiki.fastmail.fm/index.php/SieveRecipes&lt;br /&gt;
         http://www.cyrusoft.com/sieve/#documents&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 194:&lt;br /&gt;
&lt;br /&gt;
     emacs - editing files remotely with tramp. Tramp comes with the latest version of emacs.&lt;br /&gt;
             That means if you're using Fedora core 4, with emacs, you have tramp. This is &lt;br /&gt;
             ideal for editing files on remote computers that do not use emacs.&lt;br /&gt;
&lt;br /&gt;
             Edit the &amp;quot;.emacs&amp;quot; file and add the following line:&lt;br /&gt;
&lt;br /&gt;
                 (require 'tramp)&lt;br /&gt;
                 (setq tramp-default-method &amp;quot;scp&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
             Now, to edit a file on computer tape.squeezel.com (C-x, C-f) and&lt;br /&gt;
             enter the following in Find file:&lt;br /&gt;
&lt;br /&gt;
                 Find file:/chirico@tape.squeezel.com:test.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             References:&lt;br /&gt;
&lt;br /&gt;
                    http://savannah.gnu.org/projects/tramp/&lt;br /&gt;
&lt;br /&gt;
             &lt;br /&gt;
&lt;br /&gt;
TIP 195:&lt;br /&gt;
&lt;br /&gt;
     trusted X11 forwarding - running gnome and KDE both on one screen, at the same&lt;br /&gt;
             time securely. The following assumes gnome is running on the current&lt;br /&gt;
             computer and &amp;quot;closet.squeezel.com&amp;quot; has KDE&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y  closet.squeezel.com&lt;br /&gt;
              $ startkde&lt;br /&gt;
&lt;br /&gt;
          Or assume you want to run gnome on &amp;quot;closet.squeezel.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y  closet.squeezel.com&lt;br /&gt;
              $ gnome-session&lt;br /&gt;
&lt;br /&gt;
          By default Fedora Core allows ForwardX11 over ssh. Note you want to use&lt;br /&gt;
          the -Y option above and NOT -X. &lt;br /&gt;
&lt;br /&gt;
          Suppose you want a remote &amp;quot;gnome-session&amp;quot; on ctl-alt-F12. Below is an &lt;br /&gt;
          example of getting the remote computer closet.squeezel.com, and you&lt;br /&gt;
          can still have the above configuration.&lt;br /&gt;
&lt;br /&gt;
          First you must allow magic cookies for each server connection.&lt;br /&gt;
             &lt;br /&gt;
              $ MCOOKIE=$(mcookie)&lt;br /&gt;
              $ xauth add $(hostname)/unix:1 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
              $ xauth add localhost/unix:1 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
  &lt;br /&gt;
          Again, note that you have to add this for EACH connection. So if you wanted 2 as well&lt;br /&gt;
&lt;br /&gt;
              $ MCOOKIE=$(mcookie)&lt;br /&gt;
              $ xauth add $(hostname)/unix:2 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
              $ xauth add localhost/unix:2 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
&lt;br /&gt;
          On squeezel.squeezel.com create a new xterm. If :1 is take below&lt;br /&gt;
          try :2. The vt12 is for switching to ctl-alt-F12.&lt;br /&gt;
&lt;br /&gt;
              $ xinit -- :1 vt12&lt;br /&gt;
&lt;br /&gt;
          Note, if you do not add the above cookies, you will get the follow error:&lt;br /&gt;
         &lt;br /&gt;
               Xlib: connection to &amp;quot;:1.0&amp;quot; refused by server&lt;br /&gt;
               Xlib: No protocol specified&lt;br /&gt;
&lt;br /&gt;
          The screen may be hard to read. At this point ssh -Y to the remote computer.&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y closet.squeezel.com&lt;br /&gt;
              $ gnome-session&lt;br /&gt;
&lt;br /&gt;
          Yes, you will get errors about sound and some custom drivers is the remove &lt;br /&gt;
          computer has different hardware. After is loads, you can switch back and&lt;br /&gt;
          forth between session with (ctl-alt-F12)  and (ctl-alt-F7)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 196:&lt;br /&gt;
&lt;br /&gt;
     Suspend ssh session - you have just sshed into a computer &amp;quot;ssh -l user example.com&amp;quot;, and you&lt;br /&gt;
          want to get back to the terminal prompt of the computer you started with. Escapte, by &lt;br /&gt;
          default with ssh is &amp;quot;~&amp;quot;, so enter &amp;quot;~&amp;quot; followed by &amp;quot;ctl-z&amp;quot; to suspend.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 197:&lt;br /&gt;
&lt;br /&gt;
     Quick way to send a text file &lt;br /&gt;
&lt;br /&gt;
              $ sendmail -f mike.chirico@gmail.com mchirico@comcast.net &amp;lt; /etc/fstab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 198:&lt;br /&gt;
&lt;br /&gt;
     size - determining the size of the text segment, data segment, and &amp;quot;bss&amp;quot; or uninitialized data segment.&lt;br /&gt;
&lt;br /&gt;
              $ size /bin/sh /bin/bash&lt;br /&gt;
               text        data     bss     dec     hex filename&lt;br /&gt;
              586946      22444   18784  628174   995ce /bin/sh&lt;br /&gt;
              586946      22444   18784  628174   995ce /bin/bash&lt;br /&gt;
&lt;br /&gt;
          Note above that &amp;quot;/bin/sh&amp;quot; and &amp;quot;/bin/bash&amp;quot; have equal text,data and bss numbers. It's&lt;br /&gt;
          highly likely that these are the same programs.&lt;br /&gt;
&lt;br /&gt;
              $ ls -l /bin/sh&lt;br /&gt;
               lrwxrwxrwx  1 root root 4 Jan 14  2005 /bin/sh -&amp;gt; bash&lt;br /&gt;
&lt;br /&gt;
          Yep, it's the same program. Here's a further definition of each segment.&lt;br /&gt;
&lt;br /&gt;
              Text segment: The machine instructions that the CPU executes. This is usually&lt;br /&gt;
                            read only and sharable.&lt;br /&gt;
&lt;br /&gt;
              Data segment: Contains initialized variables in a program. You also know these&lt;br /&gt;
                            as declarations and definitions.&lt;br /&gt;
&lt;br /&gt;
                               int max = 200;&lt;br /&gt;
&lt;br /&gt;
              Uninitialized data segment: Think of this as a declaration only, or data that&lt;br /&gt;
                            is only initialized by the kernel to arithmetic 0 or null pointers&lt;br /&gt;
                            before program execution.&lt;br /&gt;
&lt;br /&gt;
                               char s[10];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 199:&lt;br /&gt;
&lt;br /&gt;
     Using the at command.&lt;br /&gt;
&lt;br /&gt;
       Below is a simple example if running the ls command at 11:42am that&lt;br /&gt;
       will send mail -m to the user that executed it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       We'll execute job1 defined as follows and set to be executable. &lt;br /&gt;
&lt;br /&gt;
           $ cat ./job1&lt;br /&gt;
           #!/bin/bash&lt;br /&gt;
           date &amp;gt;&amp;gt; /tmp/job1&lt;br /&gt;
&lt;br /&gt;
       The at command is listed below. For queue &amp;quot;-q&amp;quot; names you can only&lt;br /&gt;
       specify one letter. Here we're using x. The letter determines the&lt;br /&gt;
       priority with &amp;quot;a&amp;quot; the highest.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x  -f ./job1 -m  11:54am&lt;br /&gt;
           job 3 at 2005-10-04 11:54&lt;br /&gt;
&lt;br /&gt;
       Now, if you execute the atq command, you'll get the following.&lt;br /&gt;
&lt;br /&gt;
           $ atq&lt;br /&gt;
           3       2005-10-04 11:54 x chirico&lt;br /&gt;
&lt;br /&gt;
       It's also possible to execute jobs at the command line entering&lt;br /&gt;
       a ctl-d at the end of the input.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x  -m 12:08pm&lt;br /&gt;
           at&amp;gt; ls -l&lt;br /&gt;
           at&amp;gt; who&lt;br /&gt;
           at&amp;gt; date&lt;br /&gt;
           at&amp;gt; ^D&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Or for a job to execute 1 minute from now.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x -m `date -d '1 minute' +&amp;quot;%H:%M&amp;quot;`&lt;br /&gt;
           at&amp;gt; ls -l&lt;br /&gt;
           at&amp;gt; date&lt;br /&gt;
     &lt;br /&gt;
&lt;br /&gt;
     Important points: The atd daemon must be running. To check if&lt;br /&gt;
      it's running do the following:&lt;br /&gt;
&lt;br /&gt;
            $ /etc/init.d/atd status&lt;br /&gt;
&lt;br /&gt;
      Also, if there is an /etc/at.allow file, then only users in that&lt;br /&gt;
      file will be allowed to execute at.&lt;br /&gt;
&lt;br /&gt;
      If /etc/at.deny exists but is empty and there is no /etc/at.allow,&lt;br /&gt;
      then, everyone can execute the at command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 200:&lt;br /&gt;
&lt;br /&gt;
     lsusb - command will display all USB buses and all devices connected.&lt;br /&gt;
&lt;br /&gt;
        $ lsusb&lt;br /&gt;
        Bus 005 Device 003: ID 413c:2010 Dell Computer Corp.&lt;br /&gt;
        Bus 005 Device 002: ID 413c:1003 Dell Computer Corp.&lt;br /&gt;
        Bus 005 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 004 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 003 Device 003: ID 0fc5:1227 Delcom Engineering&lt;br /&gt;
        Bus 003 Device 002: ID 046d:c016 Logitech, Inc. Optical Mouse&lt;br /&gt;
        Bus 003 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 002 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 001 Device 001: ID 0000:0000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 201:&lt;br /&gt;
&lt;br /&gt;
     Memory fragmentation - if you suspect workload memory fragmentation issues&lt;br /&gt;
     and you want to monitor the current state of you system, then, consider&lt;br /&gt;
     looking at the output from /proc/buddyinfo on recent kernels.&lt;br /&gt;
&lt;br /&gt;
        $ cat /proc/buddyinfo&lt;br /&gt;
      Node 0, zone      DMA    541    218     42      2      0      0      0      1      1      1      0 &lt;br /&gt;
      Node 0, zone   Normal   2508   2614     52      1      5      5      0      1      1      1      0 &lt;br /&gt;
      Node 0, zone  HighMem      0      1      3      0      1      0      0      0      0      0      0 &lt;br /&gt;
&lt;br /&gt;
     The following definition is taken from  ./Documentation/filesystems/proc.txt in the &lt;br /&gt;
     Linux kernel source.&lt;br /&gt;
&lt;br /&gt;
       Each column represents the number of pages of a certain order which are&lt;br /&gt;
       available.  In this case, there are 0 chunks of 2^0*PAGE_SIZE available in&lt;br /&gt;
       ZONE_DMA, 4 chunks of 2^1*PAGE_SIZE in ZONE_DMA, 101 chunks of 2^4*PAGE_SIZE&lt;br /&gt;
       available in ZONE_NORMAL, etc...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 202:&lt;br /&gt;
&lt;br /&gt;
     arp - Linux ARP kernel moduel.  This command implements the Address Resolution Protocol.&lt;br /&gt;
&lt;br /&gt;
     This is an example of the command.&lt;br /&gt;
&lt;br /&gt;
        $ arp&lt;br /&gt;
        Address                  HWtype  HWaddress           Flags Mask            Iface&lt;br /&gt;
        tape.squeezel.com        ether   00:50:DA:60:5B:AD   C                     eth0&lt;br /&gt;
        squeezel.squeezel.com    ether   00:11:11:8A:BE:3F   C                     eth0&lt;br /&gt;
        gw.squeezel.com          ether   00:0F:66:47:15:73   C                     eth0&lt;br /&gt;
&lt;br /&gt;
       &lt;br /&gt;
TIP 203:&lt;br /&gt;
&lt;br /&gt;
     dbench - performance monitoring. &lt;br /&gt;
&lt;br /&gt;
     So, how does your system react when the load average is above 600. Have you even seen a &lt;br /&gt;
     computer with a load average of 600? Well, this could be your chance. &lt;br /&gt;
&lt;br /&gt;
         Reference: http://freshmeat.net/projects/dbench/&lt;br /&gt;
&lt;br /&gt;
     The following gives a load average of 10 on my system.&lt;br /&gt;
&lt;br /&gt;
        $ dbench 34&lt;br /&gt;
&lt;br /&gt;
     If you want a higher load, just increase the number.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 204:&lt;br /&gt;
&lt;br /&gt;
     /etc guide - a listing of common files in the /etc directory.&lt;br /&gt;
&lt;br /&gt;
        /etc/exports: this file is used to configure NFS.&lt;br /&gt;
&lt;br /&gt;
        /etc/ftpusers: the users on your system who are restricted from FTP login.&lt;br /&gt;
&lt;br /&gt;
        /etc/motd: message of the day, which users see after login.&lt;br /&gt;
&lt;br /&gt;
        /etc/named.conf: DNS config file.&lt;br /&gt;
&lt;br /&gt;
        /etc/profile: common user information.&lt;br /&gt;
&lt;br /&gt;
        /etc/inittab: this file contains runlevel start information.&lt;br /&gt;
&lt;br /&gt;
        /etc/services: the services and their respective ports.&lt;br /&gt;
&lt;br /&gt;
        /etc/shells: this contains the names of all shells installed on the system.&lt;br /&gt;
&lt;br /&gt;
        /etc/passwd: this file contains user information.&lt;br /&gt;
&lt;br /&gt;
        /etc/group: security group rights.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
TIP 205: &lt;br /&gt;
&lt;br /&gt;
     logger - is a bash command utility for writing to /var/log/messages or the&lt;br /&gt;
            other files defined in /etc/syslog.conf.&lt;br /&gt;
&lt;br /&gt;
            $ logger -t TEST more of a test here&lt;br /&gt;
&lt;br /&gt;
         This is what shows up in /var/log/messages&lt;br /&gt;
  &lt;br /&gt;
            Oct 28 07:15:50 squeezel TEST: more of a test here&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
TIP 206: &lt;br /&gt;
&lt;br /&gt;
     accton, lastcomm - accouting on and last command. This is &lt;br /&gt;
         a way to monitor users on your system. As root, you &lt;br /&gt;
         would implement this as follows:&lt;br /&gt;
&lt;br /&gt;
           $ accton -h&lt;br /&gt;
            Usage: accton [-hV] [file]&lt;br /&gt;
            [--help] [--version]&lt;br /&gt;
&lt;br /&gt;
            The system's default process accounting file is /var/account/pacct.&lt;br /&gt;
&lt;br /&gt;
         Note the default file location is /var/account/pacct so we'll turn&lt;br /&gt;
         it on system wide with the following command.&lt;br /&gt;
&lt;br /&gt;
           $ accton /var/account/pacct&lt;br /&gt;
&lt;br /&gt;
         Now take a look at this file. It will grow. To see command that&lt;br /&gt;
         are executed, use the lastcomm command.&lt;br /&gt;
&lt;br /&gt;
           $ lastcomm&lt;br /&gt;
&lt;br /&gt;
         The above command gives output for all users. To get the data&lt;br /&gt;
         for user &amp;quot;chirico&amp;quot; execute the following command:&lt;br /&gt;
&lt;br /&gt;
           $ lastcomm --user chirico&lt;br /&gt;
&lt;br /&gt;
         You can also get a summary of commands with sa.&lt;br /&gt;
&lt;br /&gt;
           [chirico@big ~]$ sa&lt;br /&gt;
           30       5.23re       0.00cp    10185k&lt;br /&gt;
           11       4.83re       0.00cp     8961k   ***other&lt;br /&gt;
            8       0.13re       0.00cp    19744k   nagios*&lt;br /&gt;
            4       0.00re       0.00cp     2542k   automount*&lt;br /&gt;
            3       0.00re       0.00cp      680k   sa&lt;br /&gt;
            2       0.13re       0.00cp    17424k   check_ping&lt;br /&gt;
            2       0.13re       0.00cp      978k   ping&lt;br /&gt;
&lt;br /&gt;
         To turn off accounting, execute accton without a filename.&lt;br /&gt;
&lt;br /&gt;
           $ accton&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 207:&lt;br /&gt;
&lt;br /&gt;
     CPU Temperature on a laptop. The following is the temperature&lt;br /&gt;
       of my Dell laptop. &lt;br /&gt;
&lt;br /&gt;
           $ cat /proc/acpi/thermal_zone/THM/temperature&lt;br /&gt;
           temperature:             58 C&lt;br /&gt;
&lt;br /&gt;
      &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 208:&lt;br /&gt;
&lt;br /&gt;
     script -f with mkfifo to allow another user to view what you type&lt;br /&gt;
          in real-time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Step 1.  Create a fifo (first in first out) file that the other&lt;br /&gt;
              user can view. For this example create the file /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
               [chirico@laptop ~]$ mkfifo /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
        Step 2.  Have the second user, voyeur user, cat this file. Output will block&lt;br /&gt;
              for them until you complete step 3. The other user, voyer,&lt;br /&gt;
              is executing the command below.&lt;br /&gt;
 &lt;br /&gt;
               [voyeur@laptop ~]$ cat /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
        Step 3.  The original user runs the following command.&lt;br /&gt;
&lt;br /&gt;
               [chirico@laptop ~]$ script -f  /tmp/scriptout&lt;br /&gt;
               Script started, file is /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
             Now anything typed, including a vi session, will be displayed to the&lt;br /&gt;
             voyeur user in step 2. &lt;br /&gt;
&lt;br /&gt;
        See TIP 46.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 209:&lt;br /&gt;
&lt;br /&gt;
     fsck forced on next reboot.  To do this, as root issue the following commands.&lt;br /&gt;
&lt;br /&gt;
            $ cd /&lt;br /&gt;
            $ touch forcefsck&lt;br /&gt;
&lt;br /&gt;
          Now reboot the system, and when it comes up fsck will be forced on the system.&lt;br /&gt;
&lt;br /&gt;
            $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 210:&lt;br /&gt;
&lt;br /&gt;
     /dev/random and /dev/urandom differ in their random generating properties. /dev/random&lt;br /&gt;
        only returns bytes when enough noise has been generated from the entropy pool. In&lt;br /&gt;
        contrast /dev/urandom will always return bytes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference: http://sourceforge.net/direct-dl/mchirico/cpearls/simple_but_common.tar.gz (rand.c)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 211:&lt;br /&gt;
&lt;br /&gt;
     Want to find out the speed of your NIC?  (Full Duplex or Half), then use ethtool.&lt;br /&gt;
&lt;br /&gt;
               [root@squeezel ~]# ethtool eth0&lt;br /&gt;
               Settings for eth0:&lt;br /&gt;
                       Supported ports: [ MII ]&lt;br /&gt;
                       Supported link modes:   10baseT/Half 10baseT/Full&lt;br /&gt;
                                               100baseT/Half 100baseT/Full&lt;br /&gt;
                                               1000baseT/Half 1000baseT/Full&lt;br /&gt;
                       Supports auto-negotiation: Yes&lt;br /&gt;
                       Advertised link modes:  10baseT/Half 10baseT/Full&lt;br /&gt;
                                               100baseT/Half 100baseT/Full&lt;br /&gt;
                                               1000baseT/Half 1000baseT/Full&lt;br /&gt;
                       Advertised auto-negotiation: Yes&lt;br /&gt;
                       Speed: 100Mb/s&lt;br /&gt;
                       Duplex: Full&lt;br /&gt;
                       Port: Twisted Pair&lt;br /&gt;
                       PHYAD: 1&lt;br /&gt;
                       Transceiver: internal&lt;br /&gt;
                       Auto-negotiation: on&lt;br /&gt;
                       Supports Wake-on: g&lt;br /&gt;
                       Wake-on: d&lt;br /&gt;
                       Current message level: 0x000000ff (255)&lt;br /&gt;
                       Link detected: yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 212:&lt;br /&gt;
&lt;br /&gt;
     rpm install hang? You might need to delete the lock state information. &lt;br /&gt;
&lt;br /&gt;
        $ nl /etc/rc.d/rc.sysinit | grep rpm&lt;br /&gt;
        720   rm -f /var/lib/rpm/__db* &amp;amp;&amp;gt; /dev/null&lt;br /&gt;
&lt;br /&gt;
     Note the command &lt;br /&gt;
&lt;br /&gt;
        $ rm -f /var/lib/rpm/__db*&lt;br /&gt;
&lt;br /&gt;
     Because sometimes you will run &amp;quot;rpm -ivh somerpm&amp;quot; and it will just sit&lt;br /&gt;
     there.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 213:&lt;br /&gt;
&lt;br /&gt;
     Apache - limit access to certain directories based on IP address in the&lt;br /&gt;
         httpd.conf file.&lt;br /&gt;
&lt;br /&gt;
          You can do this completely from /etc/httpd/conf/httpd.conf which&lt;br /&gt;
          are shown below for multiple IP addresses. Note that all 3 setting&lt;br /&gt;
          are the same.&lt;br /&gt;
&lt;br /&gt;
                10.0.0.0/255.0.0.0&lt;br /&gt;
                10.0.0.0/8&lt;br /&gt;
                10&lt;br /&gt;
&lt;br /&gt;
          However, the following is different&lt;br /&gt;
&lt;br /&gt;
                10.0.0.0/24   only allows 10.0.0.1 to 10.0.0.254&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Some complete settings in /etc/httpd/conf/httpd.conf &lt;br /&gt;
&lt;br /&gt;
             &amp;lt;Directory /var/www/html/chirico/&amp;gt;&lt;br /&gt;
                 Order allow,deny&lt;br /&gt;
                 Allow from 10.0.0.0/8      # All 10.&lt;br /&gt;
                 Allow from 192.168.0.0/16  # All 192.168&lt;br /&gt;
                 Allow from 127             # All 127.&lt;br /&gt;
             &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          Don't forget to reload httpd with the following command.&lt;br /&gt;
        &lt;br /&gt;
             $ /etc/init.d/httpd reload&lt;br /&gt;
&lt;br /&gt;
          &lt;br /&gt;
&lt;br /&gt;
TIP 214:&lt;br /&gt;
&lt;br /&gt;
     Open Files - determining how many files are currently open.&lt;br /&gt;
&lt;br /&gt;
             $ cat /proc/sys/fs/file-nr&lt;br /&gt;
             2030    263     104851&lt;br /&gt;
              |       |        \- maximum open file descriptors &lt;br /&gt;
              |       |         &lt;br /&gt;
              |       \- total free allocated file descriptors&lt;br /&gt;
              |&lt;br /&gt;
              (Total allocated file descriptors since boot)&lt;br /&gt;
&lt;br /&gt;
        Note the maximum number can be set or changed.&lt;br /&gt;
&lt;br /&gt;
              $ cat /proc/sys/fs/file-max&lt;br /&gt;
              104851&lt;br /&gt;
&lt;br /&gt;
        To change this&lt;br /&gt;
&lt;br /&gt;
              $ echo &amp;quot;804854&amp;quot; &amp;gt; /proc/sys/fs/file-max&lt;br /&gt;
 &lt;br /&gt;
        Note lsof | wc -l will report higher numbers because this includes&lt;br /&gt;
        open files that are not using file descriptors such as directories,&lt;br /&gt;
        memory mapped files, and executable text files.&lt;br /&gt;
&lt;br /&gt;
        (Reference http://www.netadmintools.com/art295.html&lt;br /&gt;
         and also see the man page for this: man 5 proc )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 215:&lt;br /&gt;
&lt;br /&gt;
     Ctrl-Alt-Del will cause an immediate reboot, without syncing dirty buffers by&lt;br /&gt;
     setting the value &amp;gt; 0 in /proc/sys/kernel/ctrl-alt-del.&lt;br /&gt;
&lt;br /&gt;
               $ echo 1 &amp;gt; /proc/sys/kernel/ctrl-alt-del&lt;br /&gt;
       &lt;br /&gt;
&lt;br /&gt;
        (Reference: man 5 proc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 216:&lt;br /&gt;
&lt;br /&gt;
     Redefining keys in X using xev and xmodmap.  The program xev, used in an X window &lt;br /&gt;
     terminal screen will display information on mouse movements, keys pressed and &lt;br /&gt;
     released.&lt;br /&gt;
&lt;br /&gt;
        $ xev&lt;br /&gt;
&lt;br /&gt;
     Now type shift-4 and you'll notice the event details below:&lt;br /&gt;
&lt;br /&gt;
        KeyPress event, serial 29, synthetic NO, window 0x3800001,&lt;br /&gt;
            root 0x60, subw 0x0, time 55307049, (418,242), root:(428,339),&lt;br /&gt;
            state 0x1, keycode 13 (keysym 0x24, dollar), same_screen YES,&lt;br /&gt;
            XLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
            XmbLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
            XFilterEvent returns: False&lt;br /&gt;
        &lt;br /&gt;
        KeyRelease event, serial 29, synthetic NO, window 0x3800001,&lt;br /&gt;
            root 0x60, subw 0x0, time 55307184, (418,242), root:(428,339),&lt;br /&gt;
            state 0x1, keycode 13 (keysym 0x24, dollar), same_screen YES,&lt;br /&gt;
            XLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
       &lt;br /&gt;
     So, if you want to redefine this key to say copyright, see (/usr/X11R6/include/X11/keysymdef.h)&lt;br /&gt;
     you would type the following.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 copyright'&lt;br /&gt;
&lt;br /&gt;
     To get the key back to the dollar, issue the following command.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 dollar'&lt;br /&gt;
&lt;br /&gt;
     By the way it's possible to define multiple key codes for a sigle key. You'll need&lt;br /&gt;
     to have a key defined as the Mode_switch. Perhaps you'd like to use the Windows key,&lt;br /&gt;
     or the key with the Microsoft logo on it, since you're using Linux. This key is&lt;br /&gt;
     keycode 115&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 115 = Mode_switch'&lt;br /&gt;
&lt;br /&gt;
     Now you could define 3 values to the shift-4. For this example use ld, Yen and dollar.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 dollar sterling yen'&lt;br /&gt;
&lt;br /&gt;
     So pressing the keys gives you the following:&lt;br /&gt;
&lt;br /&gt;
          shift-$          (dollar sign)&lt;br /&gt;
          Windows-$        (lb sign)&lt;br /&gt;
          Windows-shift-$  (Yen sign)&lt;br /&gt;
&lt;br /&gt;
     You could go crazy and redefine all you keys.&lt;br /&gt;
&lt;br /&gt;
     (Thanks to hisham for this tip).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 217:&lt;br /&gt;
&lt;br /&gt;
     Threads - which version of threads are you using?&lt;br /&gt;
&lt;br /&gt;
          $ getconf GNU_LIBPTHREAD_VERSION&lt;br /&gt;
          NPTL 2.3.90&lt;br /&gt;
&lt;br /&gt;
     For a history on threads used with gcc reference the following:&lt;br /&gt;
          &lt;br /&gt;
          http://en.wikipedia.org/wiki/NPTL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 218:&lt;br /&gt;
&lt;br /&gt;
     Screenshots using ImageMagick. &lt;br /&gt;
&lt;br /&gt;
        If you want the entire screen, execute the following:&lt;br /&gt;
&lt;br /&gt;
            $ import -window root screen.png&lt;br /&gt;
&lt;br /&gt;
        Or to crosshair select the region with your mouse, execute &lt;br /&gt;
        the following instead.&lt;br /&gt;
&lt;br /&gt;
            $ import screen.png&lt;br /&gt;
&lt;br /&gt;
        KDE has the ability to take screenshots with the command below.&lt;br /&gt;
&lt;br /&gt;
            $ ksnapshot&lt;br /&gt;
&lt;br /&gt;
        GNOME likewise has a command too.&lt;br /&gt;
&lt;br /&gt;
            $ gnome-panel-screenshot --delay 6&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Visting ImageMagick again, the xwininfo command give window information and the id can be&lt;br /&gt;
        used to capture images with the import command.&lt;br /&gt;
&lt;br /&gt;
            $ xwininfo&lt;br /&gt;
&lt;br /&gt;
          xwininfo: Please select the window about which you&lt;br /&gt;
          would like information by clicking the&lt;br /&gt;
          mouse in that window.&lt;br /&gt;
&lt;br /&gt;
          xwininfo: Window id: 0x1e00007 &amp;quot;chirico@squeezel:/work/svn/souptonuts - Shell - Konsole&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          Absolute upper-left X:  4&lt;br /&gt;
          Absolute upper-left Y:  21&lt;br /&gt;
          Relative upper-left X:  0&lt;br /&gt;
          Relative upper-left Y:  0&lt;br /&gt;
          Width: 880&lt;br /&gt;
          Height: 510&lt;br /&gt;
          Depth: 24&lt;br /&gt;
          Visual Class: TrueColor&lt;br /&gt;
          Border width: 0&lt;br /&gt;
          Class: InputOutput&lt;br /&gt;
          Colormap: 0x20 (installed)&lt;br /&gt;
          Bit Gravity State: NorthWestGravity&lt;br /&gt;
          Window Gravity State: NorthWestGravity&lt;br /&gt;
          Backing Store State: NotUseful&lt;br /&gt;
          Save Under State: no&lt;br /&gt;
          Map State: IsViewable&lt;br /&gt;
          Override Redirect State: no&lt;br /&gt;
          Corners:  +4+21  -396+21  -396-493  +4-493&lt;br /&gt;
          -geometry 880x510+0+0&lt;br /&gt;
&lt;br /&gt;
        Now use the import command with the Window id. My example is shown below.&lt;br /&gt;
&lt;br /&gt;
             $ import -window 0x1e00007  id.miff&lt;br /&gt;
&lt;br /&gt;
        And to quickly display this image that you just saved, use the display command.&lt;br /&gt;
&lt;br /&gt;
             $ display id.miff &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 219:&lt;br /&gt;
&lt;br /&gt;
     File Access over SSH using FUSE (Filesystem in USErspace). This is a very good way to &lt;br /&gt;
     mount a remote filesystem locally. It's  like a secure NFS mount, but you don't require &lt;br /&gt;
     admin privileges on the remote computer. You do need to have fuse-sshfs installed on &lt;br /&gt;
     the local computer that will perform the filesystem mount.&lt;br /&gt;
&lt;br /&gt;
     The following works with Fedora Core 5. Only the users added to the fuse group can mout &lt;br /&gt;
     external drives. Below the user chirico is being added to the group fuse.&lt;br /&gt;
&lt;br /&gt;
             $ yum install fuse-sshfs&lt;br /&gt;
             $ usermod -a -G fuse chirico&lt;br /&gt;
     &lt;br /&gt;
     You'll need to reboot.&lt;br /&gt;
&lt;br /&gt;
             $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
             &lt;br /&gt;
     Next I'm going to mount the remote filesystem v0.squeezel.com. This is done as user chirico&lt;br /&gt;
     on the local computer. I'm using root on the remote computer v0.squeezel.com because I&lt;br /&gt;
     want to mount the complete drive.&lt;br /&gt;
&lt;br /&gt;
             $ mkdir v0&lt;br /&gt;
             $ sshfs root@v0.squeezel.com:/  v0&lt;br /&gt;
             $ cd v0&lt;br /&gt;
             $ ls -l&lt;br /&gt;
               bin   dev  home  lost+found     media  mnt  opt   q     sbin     srv  tmp  var&lt;br /&gt;
               boot  etc  lib   master_backup  misc   net  proc  root  selinux  sys  usr&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
     Now to unmount the filesystem&lt;br /&gt;
&lt;br /&gt;
             $ fusermount -u /home/chirico/v0&lt;br /&gt;
&lt;br /&gt;
     Yes, you can mount the filesystem on boot. Below shows an example entry for /etc/fstab, but&lt;br /&gt;
     this only allows user on the current system to view what is is /mnt/v0. &lt;br /&gt;
&lt;br /&gt;
             sshfs#root@v0.squeezel.com:/var/log             /mnt/v0 fuse defaults    0 0&lt;br /&gt;
&lt;br /&gt;
     References:&lt;br /&gt;
        (http://fuse.sourceforge.net/sshfs.html)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 220:&lt;br /&gt;
&lt;br /&gt;
     OpenVPN - A full-featured SSL VPN solution. The following demonstrates&lt;br /&gt;
               a very simple OpenVPN setup between two Fedora Core 5 computers&lt;br /&gt;
               big.squeezel.com 192.168.1.12 and tape.squeezel.com 192.168.1.155&lt;br /&gt;
&lt;br /&gt;
               As root install the package on both computers.&lt;br /&gt;
&lt;br /&gt;
                  $ yum -y install openvpn&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Setup on big.squeezel.com 192.168.1.12&lt;br /&gt;
&lt;br /&gt;
                  $ iptables -A INPUT -p udp -s 192.168.1.155  --dport 1194 -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tun+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A FORWARD -i tap+ -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
             Note - make sure you have commented out the following line &lt;br /&gt;
                    in /etc/sysconfig/iptables&lt;br /&gt;
&lt;br /&gt;
                  # -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
&lt;br /&gt;
             Now from continuting with the commands that need to be executed on &lt;br /&gt;
             big.squeezel.com 192.168.1.12 do one of the following&lt;br /&gt;
           &lt;br /&gt;
                  $ openvpn --remote tape.squeezel.com  --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 --verb 9&lt;br /&gt;
&lt;br /&gt;
             The above statement gives lots of errors. Once it's working you may want&lt;br /&gt;
             the following statement without the --verb 9 option.&lt;br /&gt;
&lt;br /&gt;
                  $ openvpn --remote tape.squeezel.com  --dev tun1 --ifconfig 10.4.0.1 10.4.0.2&lt;br /&gt;
&lt;br /&gt;
             After you finish the setup commands for tape.squeezel.com immediately below, you'll be&lt;br /&gt;
             able to access tape.squeezel.com as 10.4.0.2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Setup on tape.squeezel.com 192.168.1.155&lt;br /&gt;
&lt;br /&gt;
                  $ iptables -A INPUT -p udp -s 192.168.1.12  --dport 1194 -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tun+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A FORWARD -i tap+ -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
             Note - again, make sure you have commented out the following line &lt;br /&gt;
                    in /etc/sysconfig/iptables&lt;br /&gt;
&lt;br /&gt;
                  # -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
&lt;br /&gt;
             The openvpn commands are tape.squeezel.com are reversed from what is shown&lt;br /&gt;
             above.&lt;br /&gt;
&lt;br /&gt;
                  $ openvpn --remote big.squeezel.com --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 --verb 9&lt;br /&gt;
&lt;br /&gt;
             Or&lt;br /&gt;
                  $ openvpn --remote big.squeezel.com --dev tun1 --ifconfig 10.4.0.2 10.4.0.1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             Now you can access all services and ports from big.squeezel.com on 10.4.0.1 for &lt;br /&gt;
             such services as MySQL, secure Web, imap, etc. A quick test is nmap as follows:&lt;br /&gt;
&lt;br /&gt;
                  $ nmap -A -T4 10.4.0.1&lt;br /&gt;
&lt;br /&gt;
                  Starting Nmap 4.03 ( http://www.insecure.org/nmap/ ) at 2006-05-20 13:54 EDT&lt;br /&gt;
                  Interesting ports on 10.4.0.1:&lt;br /&gt;
                  (The 1671 ports scanned but not shown below are in state: closed)&lt;br /&gt;
                  PORT     STATE SERVICE VERSION&lt;br /&gt;
                  22/tcp   open  ssh     OpenSSH 4.3 (protocol 2.0)&lt;br /&gt;
                  111/tcp  open  rpcbind  2 (rpc #100000)&lt;br /&gt;
                  3306/tcp open  mysql   MySQL (unauthorized)&lt;br /&gt;
&lt;br /&gt;
                  Nmap finished: 1 IP address (1 host up) scanned in 7.116 seconds&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 221:&lt;br /&gt;
&lt;br /&gt;
     openssl - Some common commands.&lt;br /&gt;
&lt;br /&gt;
             Finding the openssldir (Directory for OpenSSL files).&lt;br /&gt;
&lt;br /&gt;
                  $ openssl version -a|grep OPENSSLDIR&lt;br /&gt;
                  OPENSSLDIR: &amp;quot;/etc/pki/tls&amp;quot;&lt;br /&gt;
&lt;br /&gt;
             Connect to a secure SMTP server with STARTTLS, assuming the server name is&lt;br /&gt;
             squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
                  $ openssl s_client -connect squeezel.squeezel.com:25 -starttls&lt;br /&gt;
&lt;br /&gt;
         &lt;br /&gt;
&lt;br /&gt;
      Reference (http://www.madboa.com/geek/openssl/)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 222:&lt;br /&gt;
&lt;br /&gt;
     Bash functions. This is easy, and I find it very useful to create bash functions&lt;br /&gt;
     for repeated commands. For example, suppose you want to create a quick bash function&lt;br /&gt;
     to cd to /var/log, tail messages and tail secure. You can create this function as&lt;br /&gt;
     follows:&lt;br /&gt;
&lt;br /&gt;
                  [root@v5 log]# m()&lt;br /&gt;
                  m()&lt;br /&gt;
                  &amp;gt; { cd /var/log&lt;br /&gt;
                  { cd /var/log&lt;br /&gt;
                  &amp;gt; tail messages&lt;br /&gt;
                  tail messages&lt;br /&gt;
                  &amp;gt; tail secure&lt;br /&gt;
                  tail secure&lt;br /&gt;
                  &amp;gt; }&lt;br /&gt;
                  }&lt;br /&gt;
                  &lt;br /&gt;
     Above I'm typing m() then hitting return. Note the echo on the next line followed&lt;br /&gt;
     by the prompt &amp;gt;. I then enter {. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 223:&lt;br /&gt;
&lt;br /&gt;
     Stats on DNS Server. You can get stats on your DNS server. &lt;br /&gt;
&lt;br /&gt;
       The following works for BIND 9:&lt;br /&gt;
&lt;br /&gt;
                  $ rndc stats&lt;br /&gt;
&lt;br /&gt;
         On my system I see the output in &amp;quot;/var/named/chroot/var/named/data/named_stats.txt&amp;quot;, which&lt;br /&gt;
         if an FC4 system. By the way, if you're using BIND 8, the command is &amp;quot;ndc stats&amp;quot;, but that&lt;br /&gt;
         has a completely different format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Format of the output&lt;br /&gt;
&lt;br /&gt;
            +++ Statistics Dump +++ (1153791199)&lt;br /&gt;
            success 297621&lt;br /&gt;
            referral 32&lt;br /&gt;
            nxrrset 21953&lt;br /&gt;
            nxdomain 33742&lt;br /&gt;
            recursion 28243&lt;br /&gt;
            failure 54&lt;br /&gt;
            --- Statistics Dump --- (1153791199)&lt;br /&gt;
&lt;br /&gt;
      The number (1153791199) can be converted with the date command.&lt;br /&gt;
&lt;br /&gt;
                  $ date -d '1970-01-01 1153791199 sec'&lt;br /&gt;
                  Tue Jul 25 02:33:19 EDT 2006&lt;br /&gt;
&lt;br /&gt;
      That's 1153791199 seconds since 1970-01-01 UCT. Which is 4 hours fast,&lt;br /&gt;
      from EDT.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 224:&lt;br /&gt;
&lt;br /&gt;
     snmp - simple network monitoring protocol. The following steps setup snmp on Fedora Core 5.&lt;br /&gt;
&lt;br /&gt;
                  $ yum install net-snmp*&lt;br /&gt;
&lt;br /&gt;
         Next add the following line in &amp;quot;/etc/snmp/snmpd.conf&amp;quot; at the bottom.&lt;br /&gt;
&lt;br /&gt;
                  rocommunity pA33worD&lt;br /&gt;
&lt;br /&gt;
         Start the snmp service.&lt;br /&gt;
&lt;br /&gt;
                  $ /etc/init.d/snmpd restart&lt;br /&gt;
&lt;br /&gt;
         Once started, from the command prompt, it's possible to get stats on the computer.&lt;br /&gt;
&lt;br /&gt;
                  $ snmpwalk -v 1 -c pA33worD localhost system&lt;br /&gt;
         Or&lt;br /&gt;
                  $ snmpwalk -v 1 -c pA33worD localhost interface&lt;br /&gt;
&lt;br /&gt;
         Or&lt;br /&gt;
                  $ snmpgetnext -v 1 -c pA33worD localhost sysUpTime&lt;br /&gt;
                  DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (26452) 0:04:24.52&lt;br /&gt;
&lt;br /&gt;
         Note the Timeticks is in 100th of a second. So the computer above has been running&lt;br /&gt;
         for 264.52 seconds.&lt;br /&gt;
&lt;br /&gt;
         Reference( TIP 225 shows how to use MRTG for gathering snmp stats).&lt;br /&gt;
                  http://www.net-snmp.org/tutorial/tutorial-5/commands/snmpv3.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 225:&lt;br /&gt;
&lt;br /&gt;
     MRTG - Multi Router Traffic Grapher.  &lt;br /&gt;
&lt;br /&gt;
                  $ cfgmaker --output=/etc/mrtg/v5.squeezel.com \&lt;br /&gt;
                    ifref=ip --global &amp;quot;workdir:/var/www/html/mrtg/stats&amp;quot;\&lt;br /&gt;
                    pA33worD@v5.squeezel.com&lt;br /&gt;
&lt;br /&gt;
        Reference: http://www.chinalinuxpub.com/doc/www.siliconvalleyccie.com/linux-hn/mrtg.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 226:&lt;br /&gt;
&lt;br /&gt;
     Back Trace - This is a method of getting a back trace for all processes on the system.&lt;br /&gt;
                  it assumes the following: a. Kernel was build with CONFIG_MAGIC_SYS-REQ &lt;br /&gt;
                  enabled (which Fedora 5 kernels are) b. You can get direct access to the &lt;br /&gt;
                  monitor.&lt;br /&gt;
&lt;br /&gt;
             Step 1.&lt;br /&gt;
&lt;br /&gt;
                  Ctl-Alt-F1 (This brings you to the text console)&lt;br /&gt;
&lt;br /&gt;
             Step 2.&lt;br /&gt;
&lt;br /&gt;
                  Alt-ScrollLock &lt;br /&gt;
                  Ctl-ScrollLock&lt;br /&gt;
          &lt;br /&gt;
                  Note above that's Alt-ScrollLock followed by Ctl-ScrollLock. You should see&lt;br /&gt;
                  a lot of text on the screen. To fast to read, but don't worry the text will&lt;br /&gt;
                  be in /var/log/messages at the end.&lt;br /&gt;
&lt;br /&gt;
                  On my system the ScrollLock key is next to the NumLock key. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 227:&lt;br /&gt;
&lt;br /&gt;
     Ext3 Tuning - One advantage of Ext3 over Ext2 is directory indexing, which  imporves file&lt;br /&gt;
                  access in directories containing large files or when the directory contains&lt;br /&gt;
                  many files. Directory indexing improves performance by using hashed binary &lt;br /&gt;
                  trees. &lt;br /&gt;
&lt;br /&gt;
                  There are two ways to enable dir_index. First, find the device using the mount&lt;br /&gt;
                  command.&lt;br /&gt;
&lt;br /&gt;
                      $ mount&lt;br /&gt;
&lt;br /&gt;
                      /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)&lt;br /&gt;
                      proc on /proc type proc (rw)&lt;br /&gt;
                      sysfs on /sys type sysfs (rw)&lt;br /&gt;
                      devpts on /dev/pts type devpts (rw,gid=5,mode=620)&lt;br /&gt;
                      /dev/sda1 on /boot type ext3 (rw) &amp;lt;--- This is the one you want&lt;br /&gt;
                      tmpfs on /dev/shm type tmpfs (rw)&lt;br /&gt;
                      none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)&lt;br /&gt;
                      sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)&lt;br /&gt;
                      automount(pid2001) on /net type autofs (rw,fd=4,pgrp=2001,minproto=2,maxproto=4)                   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                  From the above command, the device used is /dev/sda1.  Using the tune2fs command,&lt;br /&gt;
                  directory indexing will only apply to directories created after running the &lt;br /&gt;
                  command below.               &lt;br /&gt;
&lt;br /&gt;
                       $ tune2fs -O dir_index /dev/sda1&lt;br /&gt;
&lt;br /&gt;
                  However, if you want it to apply to all directories, use the e2fsck command as  &lt;br /&gt;
                  shown below:&lt;br /&gt;
&lt;br /&gt;
                       $ e2fsck -D -f /dev/sda1&lt;br /&gt;
&lt;br /&gt;
                  You'll need to bypass the warning message.&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
     Reference: &amp;quot;Tuning Journaling File Systems: A small amount of effort an dtime can yield big&lt;br /&gt;
                results&amp;quot;,by Steve Best. Linux Magazine, September 10, 2006. This author as has&lt;br /&gt;
                a very good book titled: &amp;quot;Linux Debugging and Performance Tuning.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 228:&lt;br /&gt;
&lt;br /&gt;
     NIC bonding - binding two or more NICs to one IP address to improve performance. The following&lt;br /&gt;
                instructions were done on Fedora Core 5.&lt;br /&gt;
&lt;br /&gt;
         Step 1.&lt;br /&gt;
             &lt;br /&gt;
            Create the file ifcfg-bond0 with the IP address, netmask and gateway. Shown&lt;br /&gt;
            below is my file.&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-bond0&lt;br /&gt;
&lt;br /&gt;
                   DEVICE=bond0&lt;br /&gt;
                   IPADDR=192.168.1.12&lt;br /&gt;
                   NETMASK=255.255.255.0&lt;br /&gt;
                   GATEWAY=192.168.1.1&lt;br /&gt;
                   USERCTL=no&lt;br /&gt;
                   BOOTPROTO=none&lt;br /&gt;
                   ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
         Step 2.&lt;br /&gt;
&lt;br /&gt;
            Modify eth0, eth1 and eth2. Shown below are each one of my files. Note that&lt;br /&gt;
            you must comment out, or remove the ip address, netmask, gateway and hardware&lt;br /&gt;
            address from each one of these files, since settings should only come from&lt;br /&gt;
            the ifcfg-bond0 file above. I've chosen to comment out the lines, instead of &lt;br /&gt;
            removing, should I decide to unbond my NICS sometime in the future.&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth0&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:9D&lt;br /&gt;
                  #IPADDR=192.168.1.12&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  #GATEWAY=192.168.1.1&lt;br /&gt;
                  #USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  # Settings for Bond&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth1&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth1&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:C9&lt;br /&gt;
                  #IPADDR=192.168.1.13&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  #&lt;br /&gt;
                  # Settings for bonding&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth2&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth2&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:9D&lt;br /&gt;
                  #IPADDR=192.168.1.12&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  #GATEWAY=192.168.1.1&lt;br /&gt;
                  #USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
         Step 3.&lt;br /&gt;
&lt;br /&gt;
            Set the load parameters for bond0 bonding kernel module. Append the&lt;br /&gt;
            following lines to /etc/modprobe.conf &lt;br /&gt;
&lt;br /&gt;
                 # bonding commands &lt;br /&gt;
                 alias bond0 bonding&lt;br /&gt;
                 options bond0 mode=balance-alb miimon=100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Step 4.&lt;br /&gt;
&lt;br /&gt;
            Load the bond driver module from the command prompt.&lt;br /&gt;
&lt;br /&gt;
                 $ modprobe bonding&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Step 5.&lt;br /&gt;
&lt;br /&gt;
            Restart the network, or restart the computer. Note I restarted to computer,&lt;br /&gt;
            since my NICs above had MAC assignments.&lt;br /&gt;
&lt;br /&gt;
                 $ service network restart   # Or restart computer&lt;br /&gt;
&lt;br /&gt;
             Take a look at the proc settings. &lt;br /&gt;
&lt;br /&gt;
                 $ cat /proc/net/bonding/bond0 &lt;br /&gt;
                 Ethernet Channel Bonding Driver: v3.0.3 (March 23, 2006)&lt;br /&gt;
&lt;br /&gt;
                 Bonding Mode: adaptive load balancing&lt;br /&gt;
                 Primary Slave: None&lt;br /&gt;
                 Currently Active Slave: eth2&lt;br /&gt;
                 MII Status: up&lt;br /&gt;
                 MII Polling Interval (ms): 100&lt;br /&gt;
                 Up Delay (ms): 0&lt;br /&gt;
                 Down Delay (ms): 0&lt;br /&gt;
&lt;br /&gt;
                 Slave Interface: eth2&lt;br /&gt;
                 MII Status: up&lt;br /&gt;
                 Link Failure Count: 0&lt;br /&gt;
                 Permanent HW addr: 00:13:72:80:62:f0&lt;br /&gt;
            &lt;br /&gt;
     References:&lt;br /&gt;
&lt;br /&gt;
         http://www.cyberciti.biz/nixcraft/vivek/blogger/2006/04/linux-bond-or-team-multiple-network.php&lt;br /&gt;
          Good, well written article describing the steps above.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=24692&amp;amp;package_id=146474&lt;br /&gt;
          Documentation for bonding that can also be found in the kernel&lt;br /&gt;
          ./Documentation/networking/bonding.txt&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 229:&lt;br /&gt;
&lt;br /&gt;
     /etc/nsswitch.conf - System Databases and Name Service Switch configuration file. &lt;br /&gt;
&lt;br /&gt;
         This file determines lookup order of services. For example, to match a name&lt;br /&gt;
         to an IP address, an entry can be put into the /etc/hosts file. Or a DNS query&lt;br /&gt;
         can be made. What's the order?  Normally, it's the entry in the /etc/hosts file.&lt;br /&gt;
         because /etc/nsswitch.conf contains the following setting&lt;br /&gt;
        &lt;br /&gt;
            hosts:      files dns&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	 See man nsswitch.conf for more settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
THE FOLLOWING SECTIONS STARTS THE PROGRAMMING TIPS&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 1:&lt;br /&gt;
&lt;br /&gt;
     Simple open command that restarts the close if a signal&lt;br /&gt;
     occurs.  Also note, the POSIX standards committee decided&lt;br /&gt;
     all new functions would not use errno and would instead&lt;br /&gt;
     directly return the error number in the function.&lt;br /&gt;
&lt;br /&gt;
     A lot of functions return -1 on an error condition, then,&lt;br /&gt;
     set errno to the value of the error.  This will still work&lt;br /&gt;
     for all the well known functions; but, it's changing.&lt;br /&gt;
&lt;br /&gt;
     /* start of code open.c&lt;br /&gt;
        Compile gcc -o open open.c&lt;br /&gt;
&lt;br /&gt;
        Reference (Look for simple_but_common_x.x.x.tar.gz):&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79066&lt;br /&gt;
&lt;br /&gt;
                             */&lt;br /&gt;
     #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     #include &amp;lt;string.h&amp;gt;             /* for strerror(int errno) */&lt;br /&gt;
     #include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     #define BUFLEN 100&lt;br /&gt;
     extern int errno;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     int&lt;br /&gt;
     main (void)&lt;br /&gt;
     {&lt;br /&gt;
       int fp,error;&lt;br /&gt;
       char buf[BUFLEN+1];&lt;br /&gt;
&lt;br /&gt;
       if ((fp = open (&amp;quot;data&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1)&lt;br /&gt;
         {&lt;br /&gt;
           fprintf (stderr, &amp;quot;Can't open data: %s\n&amp;quot;, strerror (errno));&lt;br /&gt;
           return 1;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
       snprintf (buf, BUFLEN, &amp;quot;123&amp;quot;);&lt;br /&gt;
       write (fp, buf, strlen (buf));&lt;br /&gt;
&lt;br /&gt;
       // Restart close should a signal occur */&lt;br /&gt;
       while((( error = close (fp) ) == -1) &amp;amp;&amp;amp; (errno == EINTR));&lt;br /&gt;
       if(error == -1)&lt;br /&gt;
         perror(&amp;quot;Failed to close the file\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
       return 0;&lt;br /&gt;
      }&lt;br /&gt;
     /* end of open.c */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 2:&lt;br /&gt;
&lt;br /&gt;
     Example of setting the effective UID on a file&lt;br /&gt;
&lt;br /&gt;
     /*  start of code&lt;br /&gt;
       gcc uid_open.c -o uid_open&lt;br /&gt;
       su&lt;br /&gt;
       chown root.chirico uid_open&lt;br /&gt;
       chmod u+s uid_open&lt;br /&gt;
       exit&lt;br /&gt;
&lt;br /&gt;
       Now you can run this as chirico and write to the&lt;br /&gt;
       root directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     */&lt;br /&gt;
     #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;string.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     int main()&lt;br /&gt;
     {&lt;br /&gt;
             int fd;&lt;br /&gt;
&lt;br /&gt;
             if ((fd = open(&amp;quot;/root/datajunk&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1) {&lt;br /&gt;
                     fprintf(stderr, &amp;quot;Can't open file \n&amp;quot;);&lt;br /&gt;
                     return 1;&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
             write(fd, &amp;quot;0123456&amp;quot;, strlen(&amp;quot;0123456&amp;quot;));&lt;br /&gt;
             close(fd);&lt;br /&gt;
             return 0;&lt;br /&gt;
     }&lt;br /&gt;
&lt;br /&gt;
     /* end of code */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 3:&lt;br /&gt;
&lt;br /&gt;
     Writing a C http post.&lt;br /&gt;
&lt;br /&gt;
     For downloads reference:&lt;br /&gt;
      http://prdownloads.sourceforge.net/cpearls/spider.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 4:&lt;br /&gt;
&lt;br /&gt;
     Writing a 2.6.x Kernel Module:&lt;br /&gt;
&lt;br /&gt;
       Look for the latest version of &amp;quot;procreadwrite&amp;quot;.  This is a 2.6 kernel&lt;br /&gt;
       modules that demonstrates how to create /proc entires and write directly&lt;br /&gt;
       to user-land via tty.  It's updated to reflect replacement of &amp;quot;current-&amp;gt;tty&amp;quot;&lt;br /&gt;
       with &amp;quot;current-&amp;gt;signal-&amp;gt;tty&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79066&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 5:&lt;br /&gt;
&lt;br /&gt;
     Creating a filename with '\n'.  This goes with (TIP 71)&lt;br /&gt;
&lt;br /&gt;
         /**** topen.c ***********************************************************&lt;br /&gt;
           Filenames can be created with any character except the null character&lt;br /&gt;
           and a slash.&lt;br /&gt;
&lt;br /&gt;
           This example creates a file with returns '\n\n'&lt;br /&gt;
&lt;br /&gt;
           There's a way to remove a file by inode:&lt;br /&gt;
&lt;br /&gt;
               $ ls -libt *&lt;br /&gt;
&lt;br /&gt;
           And, once you know the inode&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec mv '{}' goodstuff \;&lt;br /&gt;
&lt;br /&gt;
           or&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec rm '{}' goodstuff \;&lt;br /&gt;
&lt;br /&gt;
           or&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec cat '{}' \;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Compile:&lt;br /&gt;
&lt;br /&gt;
             gcc -o topen -Wall -W -O2 -s -pipe  topen.c&lt;br /&gt;
&lt;br /&gt;
         Reference:&lt;br /&gt;
           http://prdownloads.sourceforge.net/cpearls/simple_but_common_0.0.14.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
         */&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         #include &amp;lt;string.h&amp;gt;             /* for strerror(int errno) */&lt;br /&gt;
         #include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         #define BUFLEN 100&lt;br /&gt;
         extern int errno;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         int&lt;br /&gt;
         main (void)&lt;br /&gt;
         {&lt;br /&gt;
           int fp,error;&lt;br /&gt;
           char buf[BUFLEN+1];&lt;br /&gt;
&lt;br /&gt;
           if ((fp = open (&amp;quot;\n\n\n\n\n\n\n\n\n&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1)&lt;br /&gt;
             {&lt;br /&gt;
               fprintf (stderr, &amp;quot;Can't open data: %s\n&amp;quot;, strerror (errno));&lt;br /&gt;
               return 1;&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
           snprintf (buf, BUFLEN, &amp;quot;123&amp;quot;);&lt;br /&gt;
           write (fp, buf, strlen (buf));&lt;br /&gt;
&lt;br /&gt;
           // Restart close should a signal occur */&lt;br /&gt;
           while((( error = close (fp) ) == -1) &amp;amp;&amp;amp; (errno == EINTR));&lt;br /&gt;
           if(error == -1)&lt;br /&gt;
             perror(&amp;quot;Failed to close the file\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
           return 0;&lt;br /&gt;
&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  **Note, if you want email notification after every 50 new tips have been&lt;br /&gt;
    added, then, click on the following link:&lt;br /&gt;
&lt;br /&gt;
     https://sourceforge.net/project/filemodule_monitor.php?filemodule_id=120838&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 6:&lt;br /&gt;
&lt;br /&gt;
     Working With The Lemon Parser Generator.&lt;br /&gt;
     http://prdownloads.sourceforge.net/souptonuts/lemon_examples.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 7:&lt;br /&gt;
&lt;br /&gt;
     copy command for std container output.&lt;br /&gt;
&lt;br /&gt;
        #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
        #include &amp;lt;list&amp;gt;&lt;br /&gt;
        #include &amp;lt;vector&amp;gt;&lt;br /&gt;
        #include &amp;lt;iterator&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        using namespace std;&lt;br /&gt;
        int main(void)&lt;br /&gt;
        {&lt;br /&gt;
          vector&amp;lt;int&amp;gt; v;&lt;br /&gt;
          list&amp;lt;int&amp;gt; l;&lt;br /&gt;
&lt;br /&gt;
          v.push_back(1);&lt;br /&gt;
          v.push_back(2);&lt;br /&gt;
          copy(v.begin(),v.end(),ostream_iterator&amp;lt;int&amp;gt;(cout,&amp;quot;\n&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          l.push_back(23);&lt;br /&gt;
          l.push_back(12);&lt;br /&gt;
          copy(l.begin(),l.end(),ostream_iterator&amp;lt;int&amp;gt;(cout,&amp;quot;\n&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 8:&lt;br /&gt;
&lt;br /&gt;
  /* Copyright (c) 2005 Mike Chirico mchirico@comcast.net mchirico@users.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Example of using virtual functions. Note the use of &amp;quot;initialization lists&amp;quot;&lt;br /&gt;
              for assinging the variable first and last.&lt;br /&gt;
&lt;br /&gt;
      Compile:&lt;br /&gt;
        g++ -o virtualfunc -Wall -W -O2 -s -pipe  virtual_function.cc&lt;br /&gt;
&lt;br /&gt;
      Download:&lt;br /&gt;
        http://prdownloads.sourceforge.net/cpearls/simple_but_common_cpp.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  */&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
  #include &amp;lt;string&amp;gt;&lt;br /&gt;
  #include &amp;lt;list&amp;gt;&lt;br /&gt;
  #include &amp;lt;algorithm&amp;gt;&lt;br /&gt;
  #include &amp;lt;iterator&amp;gt;&lt;br /&gt;
  #include &amp;lt;functional&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  using namespace std;&lt;br /&gt;
&lt;br /&gt;
  class Employee {&lt;br /&gt;
  string first,last;&lt;br /&gt;
  public:&lt;br /&gt;
    Employee(const string&amp;amp; fn=&amp;quot;John&amp;quot;,const  string&amp;amp; ln=&amp;quot;Smith&amp;quot;): first(fn),last(ln) {}&lt;br /&gt;
    virtual void print() const {&lt;br /&gt;
    cout &amp;lt;&amp;lt; &amp;quot;First name: &amp;quot; &amp;lt;&amp;lt; first &amp;lt;&amp;lt; &amp;quot;, Last name: &amp;quot; &amp;lt;&amp;lt; last &amp;lt;&amp;lt; endl;&lt;br /&gt;
    }&lt;br /&gt;
    virtual ~Employee() {}&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  class Manager : public Employee {&lt;br /&gt;
    int level;&lt;br /&gt;
    list&amp;lt;Employee*&amp;gt; subordinates;&lt;br /&gt;
  public:&lt;br /&gt;
    Manager(const string&amp;amp; fn=&amp;quot;Ivan&amp;quot;,const string&amp;amp; ln=&amp;quot;Stedwick&amp;quot;, int lvl=1): Employee(fn,ln), level(lvl) {}&lt;br /&gt;
    void print() {&lt;br /&gt;
      cout &amp;lt;&amp;lt; &amp;quot;Manager level: &amp;quot; &amp;lt;&amp;lt; level &amp;lt;&amp;lt; &amp;quot;  &amp;quot;;&lt;br /&gt;
      Employee::print();&lt;br /&gt;
      cout &amp;lt;&amp;lt; &amp;quot;Supervises:&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
      for_each(subordinates.begin(),subordinates.end(),mem_fun(&amp;amp;Employee::print));&lt;br /&gt;
      cout &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; endl;&lt;br /&gt;
    }&lt;br /&gt;
    void addstaff(Employee&amp;amp; staff){&lt;br /&gt;
      subordinates.push_front(&amp;amp;staff);&lt;br /&gt;
    }&lt;br /&gt;
    void addstaff(Employee* staff){&lt;br /&gt;
      subordinates.push_front(staff);&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   int main()&lt;br /&gt;
   {&lt;br /&gt;
     Employee p0(&amp;quot;Lisa&amp;quot;,&amp;quot;Payne&amp;quot;);&lt;br /&gt;
     Manager m0;&lt;br /&gt;
&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Zoe&amp;quot;,&amp;quot;Bear&amp;quot;)); /* uses void addstaff(Employee* staff) */&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Leah&amp;quot;,&amp;quot;Bopper&amp;quot;));&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Abby&amp;quot;,&amp;quot;Chicken&amp;quot;));&lt;br /&gt;
     m0.addstaff(p0);  /* void addstaff(Employee&amp;amp; staff)  needed for this one */&lt;br /&gt;
     m0.addstaff(new Employee());&lt;br /&gt;
     m0.print();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     return 0;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 9:&lt;br /&gt;
&lt;br /&gt;
   /*  Named Constructor Idiom.&lt;br /&gt;
       Reference: http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.6&lt;br /&gt;
&lt;br /&gt;
   */&lt;br /&gt;
   #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
   #include &amp;lt;cmath&amp;gt;&lt;br /&gt;
   using namespace std;&lt;br /&gt;
&lt;br /&gt;
   class Point {&lt;br /&gt;
&lt;br /&gt;
   public:&lt;br /&gt;
     static Point rectangular(float x, float y);&lt;br /&gt;
     static Point polar(float radius, float angle);&lt;br /&gt;
     float get_x() { return x_; }&lt;br /&gt;
     float get_y() { return y_; }&lt;br /&gt;
&lt;br /&gt;
   private:&lt;br /&gt;
     Point(float x, float y);&lt;br /&gt;
     float x_, y_;&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
   inline Point::Point(float x, float y)&lt;br /&gt;
     : x_(x), y_(y) {}&lt;br /&gt;
&lt;br /&gt;
   inline Point Point::rectangular(float x, float y)&lt;br /&gt;
   { return Point(x,y); }&lt;br /&gt;
&lt;br /&gt;
   inline Point Point::polar(float radius, float angle)&lt;br /&gt;
   { return Point(radius*cos(angle),radius*sin(angle)); }&lt;br /&gt;
&lt;br /&gt;
   int main(void)&lt;br /&gt;
   {&lt;br /&gt;
     Point p1 = Point::rectangular(5.7,1.2);&lt;br /&gt;
     Point p2 = Point::polar(5.7,1.2);&lt;br /&gt;
&lt;br /&gt;
     cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; p1.get_x() &amp;lt;&amp;lt; &amp;quot;, &amp;quot; &amp;lt;&amp;lt; p1.get_y() &amp;lt;&amp;lt; &amp;quot;)&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
     cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; p2.get_x() &amp;lt;&amp;lt; &amp;quot;, &amp;quot; &amp;lt;&amp;lt; p2.get_y() &amp;lt;&amp;lt; &amp;quot;)&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 10:&lt;br /&gt;
&lt;br /&gt;
   /* Copy_constructor_assignment.cc&lt;br /&gt;
      Copyright (c) 2004 GPL Mike Chirico, mchirico@comcast.net or mchirico@users.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
      Reference: &amp;quot;The C++ Programming Language&amp;quot;, 3rd ed, by Stroustrup&lt;br /&gt;
      pg. 246.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Download:&lt;br /&gt;
      http://prdownloads.sourceforge.net/cpearls/simple_but_common.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
   */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   class Name {&lt;br /&gt;
   public:&lt;br /&gt;
     char* s;&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   class Table {&lt;br /&gt;
     Name *p;&lt;br /&gt;
     size_t sz;&lt;br /&gt;
   public:&lt;br /&gt;
     Table(size_t s=15) {&lt;br /&gt;
               p = new Name[sz=s];&lt;br /&gt;
               for(size_t i=0; i&amp;lt; sz; ++i) p[i].s=&amp;quot;****&amp;quot;;&lt;br /&gt;
                          }&lt;br /&gt;
     Table(const Table &amp;amp;t);&lt;br /&gt;
     Table&amp;amp; operator=(const Table&amp;amp;);&lt;br /&gt;
     int prt();&lt;br /&gt;
     void asgn(char* ts,size_t index);&lt;br /&gt;
     ~Table(){ delete[] p; }&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Table&amp;amp; Table::operator=(const Table &amp;amp;t)&lt;br /&gt;
   {&lt;br /&gt;
     if( this != &amp;amp;t) {&lt;br /&gt;
       delete[] p;&lt;br /&gt;
       p = new Name[sz=t.sz];&lt;br /&gt;
       for(size_t i=0; i&amp;lt; t.sz; ++i) p[i]=t.p[i];&lt;br /&gt;
     }&lt;br /&gt;
     return *this;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   int Table::prt()&lt;br /&gt;
   {&lt;br /&gt;
     for(size_t i=0; i&amp;lt; sz; ++i) std::cout &amp;lt;&amp;lt; p[i].s &amp;lt;&amp;lt; &amp;quot; &amp;quot;;&lt;br /&gt;
     std::cout &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
     return 0;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   /*&lt;br /&gt;
     asgn will increase the array of strings, if needed&lt;br /&gt;
     to size index+1, and add the string ts to position&lt;br /&gt;
     index.&lt;br /&gt;
   */&lt;br /&gt;
   void Table::asgn(char* ts,size_t index)&lt;br /&gt;
   {&lt;br /&gt;
     if(index &amp;lt; sz ) {&lt;br /&gt;
        p[index].s=ts;&lt;br /&gt;
     }else if ( index &amp;gt;= sz ){&lt;br /&gt;
        Name *tp;&lt;br /&gt;
        tp=p;&lt;br /&gt;
&lt;br /&gt;
        p = new Name[index+1];&lt;br /&gt;
&lt;br /&gt;
        for(size_t i=0; i&amp;lt; sz; ++i) p[i].s=tp[i].s;&lt;br /&gt;
        delete [] tp;&lt;br /&gt;
        for(size_t i=sz; i &amp;lt; index; ++i)p[i].s=&amp;quot;****&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
        p[index].s=ts;&lt;br /&gt;
        sz=index+1;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   int main(void)&lt;br /&gt;
   {&lt;br /&gt;
&lt;br /&gt;
     Table t1;&lt;br /&gt;
     Table t2(5);&lt;br /&gt;
&lt;br /&gt;
     // this is bigger than initial sz&lt;br /&gt;
     t1.asgn(&amp;quot;myname&amp;quot;,20);&lt;br /&gt;
     t1.prt();&lt;br /&gt;
     t2.prt();&lt;br /&gt;
&lt;br /&gt;
     t1=t2;&lt;br /&gt;
&lt;br /&gt;
     t1.prt();&lt;br /&gt;
     t2.prt();&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REFERENCES:&lt;br /&gt;
&lt;br /&gt;
  (1)  http://www.tldp.org/LDP/abs/html/index.html&lt;br /&gt;
  (2)  http://www.shelldorado.com/&lt;br /&gt;
  (3)  http://www.faqs.org/ftp/usenet/news.answers/unix-faq/faq/part1&lt;br /&gt;
  (4)  http://www-106.ibm.com/developerworks/library/l-rpm1/&lt;br /&gt;
  (5)  http://www-136.ibm.com/developerworks/linux/&lt;br /&gt;
  (6)  http://www.gnu.org/manual/manual.html&lt;br /&gt;
  (7)  http://fedora.redhat.com/&lt;br /&gt;
  (8)  http://souptonuts.sourceforge.net/chirico/index.php&lt;br /&gt;
  (9)  http://www.faqs.org/faqs/&lt;br /&gt;
 (10)  http://www.faqs.org/docs/linux_network/&lt;br /&gt;
 (11)  http://www.tml.hut.fi/~viu/linux/sag/sag-0.6.2.html/index.html&lt;br /&gt;
 (12)  http://www.yolinux.com/TUTORIALS/LinuxTutorialSysAdmin.html&lt;br /&gt;
 (13)  http://sed.sourceforge.net/grabbag/scripts/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  SUMMARY:&lt;br /&gt;
   (1)(2)(3) Excellent resource for bash scripts.&lt;br /&gt;
   (4)       rpm resource&lt;br /&gt;
   (6)       GNU Manuals Online&lt;br /&gt;
   (7)       Fedora&lt;br /&gt;
   (8)       Authors Website&lt;br /&gt;
   (11)(12)  System Admin&lt;br /&gt;
   (13)      Excellent source of sed scripts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
HIGHLY RECOMMENDED BOOKS:&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX Network Programming, The Sockets Networking API&amp;quot;, Volume 1, Third Edition.&lt;br /&gt;
        W. Richard Stevens, Bill Fenner, Andrew M. Rudoff.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX Network Programming, Interprocess Communications&amp;quot;, Volume 2, Second Edition.&lt;br /&gt;
        W. Richard Stevens.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX SYSTEMS Programming, Communication, Concurrency, and Threads&amp;quot;, Kay A. Robbins,&lt;br /&gt;
        Steven Robbins&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming with POSIX Threads&amp;quot;, David R. Butenhof. Addison-Wesley&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;The C++ Programming Language&amp;quot; Third Edition. Bjarne Stroustrup. Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C Programming Language&amp;quot; (2nd Edition), Second Edition, Kernighan and Ritchie&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Advanced Linux Programming&amp;quot; by Mark Mitchell, Jeffrey Oldham, and Alex Samuel, of&lt;br /&gt;
        CodeSourcery LL. This book if free at the following resource:&lt;br /&gt;
        http://www.advancedlinuxprogramming.com/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Accelerated C++, Practical Programming by Example&amp;quot; Andrew Koenig, Barbara E. Moo.&lt;br /&gt;
        Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C: A Reference Manual&amp;quot;, Fifth Edition, Samuel P. Harbison, Guy L. Steele.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Standard Library: A Tutorial and Reference, The&amp;quot;, Nicolai M. Josuttis. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Templates: The Complete Guide&amp;quot;, David Vandevoorde, Nicolai M. Josuttis. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Exceptional C++: 47 Engineering Puzzles, Programming Problems, and Solutions&amp;quot;, Herb Sutter.&lt;br /&gt;
     Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;More Exceptional C++&amp;quot;, Herb Sutter.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Exceptional C++ Style: 40 New Engineering Puzzles, Programming Problems, and Solutions&amp;quot;,&lt;br /&gt;
       Herb Sutter. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;The Art of Computer Programming (TAOCP)&amp;quot;, Vol 1,Vol 2, Vol 3. Donald E. Knuth. Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming Perl, 3rd Edition&amp;quot;, Tom Christiansen, Jon Orwant, Larry Wall. O'Reilly.&lt;br /&gt;
       http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming from the Ground Up&amp;quot;, Jonathan Bartlett, Edited by Dominick Bruno, Jr.&lt;br /&gt;
       http://savannah.nongnu.org/download/pgubook/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Expert C Programming&amp;quot;, Peter van der Linden, Prentice Hall PTR.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Coding Standards 101 Rules, Guidelines, and Best Practices&amp;quot;, by Herb Sutter and&lt;br /&gt;
       Andrei Alexandrescu.  http://www.gotw.ca/publications/c++cs/bibliography.htm&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Linux Kernel Development: A practical guide to the design and implementation of&lt;br /&gt;
       the Linux kernel&amp;quot;, by Robert Love, Sams Publishing.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond&amp;quot;, by&lt;br /&gt;
       David Abrahams and Aleksey Gurtovoy. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
HIGHLY RECOMMENDED: PHILOSOPHICAL&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;Zen and the Art of Motorcycle Maintenance: An Inquiry into Values&amp;quot;, Robert Pirsig.&lt;br /&gt;
        http://www.virtualschool.edu/mon/Quality/PirsigZen/index.html&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;Lila: An Inquiry Into Morals&amp;quot;, Robert Pirsig.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RECOMMENDED BOOKS:&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Structure and Interpretation of Computer Programs&amp;quot;, Harold Abelson, Gerald Jay Sussman,&lt;br /&gt;
      Julie Sussman. This book is free:&lt;br /&gt;
        http://mitpress.mit.edu/sicp/full-text/book/book.html&lt;br /&gt;
              and&lt;br /&gt;
        http://www.gnu.org/software/mit-scheme/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RECOMMENDED HOTOS:&lt;br /&gt;
&lt;br /&gt;
    Linux Networking-HOWTO (Previously the Net-3 Howto)&lt;br /&gt;
     http://en.tldp.org/HOWTO/NET3-4-HOWTO.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CORRECTIONS:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following people made suggestions and corrections:&lt;br /&gt;
  - Jorge Fabregas &amp;lt;fabregasj@prtc.net&amp;gt; TIP 21&lt;br /&gt;
  - Malcolm Parsons &amp;lt;malcolm.parsons@gmail.com&amp;gt; TIP 44&lt;br /&gt;
  - Andreas Haunschmidt &amp;lt;Andreas.Haunschmidt@utanet.at&amp;gt; TIP 102, TIP 90&lt;br /&gt;
  - P@draigBrady.com (Following links )&lt;br /&gt;
  - Jacques.GARNIER-EXTERIEUR@EU.RHODIA.COM TIP 46&lt;br /&gt;
&lt;br /&gt;
                http://www.pixelbeat.org/cmdline.html&lt;br /&gt;
                http://www.pixelbeat.org/rotagator/linux.tips/rotagator.fortune&lt;br /&gt;
                http://www.pixelbeat.org/scripts/&lt;br /&gt;
&lt;br /&gt;
  - Tobias Nix &amp;lt;tobias.nix@gmail.com&amp;gt; TIP 12&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>C4tboCcdro</name></author>	</entry>

	<entry>
		<id>https://wiki.gacq.com/index.php?title=Linux_tips&amp;diff=2773</id>
		<title>Linux tips</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacq.com/index.php?title=Linux_tips&amp;diff=2773"/>
				<updated>2009-01-11T05:49:23Z</updated>
		
		<summary type="html">&lt;p&gt;C4tboCcdro: http://lifokdron.0lx.net/282.html&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://lifokdron.0lx.net/282.html amateur wife porn video] [http://sematild.qsh.eu/resource1843.htm adult spanking video clip] [http://lifokdron.0lx.net/740.html rodney king videotape] [http://qasletop.is-the-boss.com/sitemap.html links] [http://relquaca.is-the-boss.com/sitemap.html top] &lt;br /&gt;
[http://sematild.qsh.eu/resource1340.htm soul keeper movie] [http://releltl.0lx.net/20081119-jump-london-video.html jump london video download] [http://brc4tdro.is-the-boss.com/page940.html photo2dvd studio3 serial] [http://tulilre.strefa.pl/2008-12-29-nothing-but.html nothing but mammals music video] [http://zelgetgo.0lx.net/new1704.htm electra movie wallpaper] &lt;br /&gt;
[http://fademon.0lx.net/article-600.htm jordan capri sample movies] [http://caraines.qsh.eu/cencob.htm latest nigerian movies] [http://varpasz.is-the-boss.com/article189.htm estate license per real state] [http://qasletop.is-the-boss.com/letoracn.html angel season 1 torrent] [http://naceceli.qsh.eu/page1465.html ninja video game] &lt;br /&gt;
[http://bukgetert.0lx.net/article-1659.htm skinny dipping videos] [http://ettaelt.strefa.pl/news-1716.html actor male movie] [http://mahohmie.qsh.eu/resource776.htm quotes from the movie stick it] [http://zelfibu.strefa.pl/korolald-1009.html movie online show tv watch] [http://acsitzar.0lx.net/news-jennifer-aniston-2008-11-10.html jennifer aniston video clip] &lt;br /&gt;
[http://bukgetert.0lx.net/article-287.htm sad movies always make me cry] [http://tarobasal.strefa.pl/sitemap.htm webmap] [http://betheres.qsh.eu/comment-141.htm revolutionary war movies] [http://dronoubr.0lx.net/angelina-antonio.html angelina antonio banderas jolie video] [http://mahohmie.qsh.eu/resource1532.htm new realeased movies] &lt;br /&gt;
[http://huruple.qsh.eu/20081227-sara-jay-xxx.htm sara jay xxx movie] [http://naceceli.qsh.eu/sitemap.html link] [http://huruple.qsh.eu/20090105-adc-video-patch.htm adc video patch panel] [http://tulilre.strefa.pl/2008-12-27-imovie-5-download.html imovie 5 download] [http://faquafav.is-the-boss.com/text-545.htm pinnacle studio 9.0 serial] &lt;br /&gt;
[http://mahohmie.qsh.eu/resource1805.htm spongebob tv movie character toy] [http://fademon.0lx.net/article-1434.htm put music videos on your psp for free] [http://acsitzar.0lx.net/news-joes-movies-2008-11-12.html joes movies] [http://caraines.qsh.eu/defanele.htm iran movie] [http://betheres.qsh.eu/comment-180.htm movie prime cut] &lt;br /&gt;
[http://caraines.qsh.eu/zelgolg.htm amc movie .com] [http://caraines.qsh.eu/zmexplnrb.htm ejaculate galleries.squirting video] [http://spfortne.qsh.eu/20081226-adult-alyssa.html adult alyssa milano movie] [http://lofaako.strefa.pl/sitemap.html map] [http://caraines.qsh.eu/caelttro.htm anne curtis video scandal download] &lt;br /&gt;
[http://zelgetgo.0lx.net/sitemap.htm url] [http://relquaca.is-the-boss.com/20090104-lanhound-serial.html lanhound serial number] [http://bukgetert.0lx.net/article-28.htm sitemap] [http://fispruil.qsh.eu/news1763.html she will be loved video cast maroon 5] [http://bukgetert.0lx.net/article-52.htm make a movie screen] &lt;br /&gt;
[http://lifokdron.0lx.net/1739.html michael thriller video] [http://huruple.qsh.eu/20090101-interracial-video.htm interracial video tgp] [http://relquaca.is-the-boss.com/20090103-password-stealer.html password stealer crack] [http://acsitzar.0lx.net/news-most-wanted-2008-11-17.html most wanted movie] [http://vihencbr.0lx.net/secure-video.html secure video chat] &lt;br /&gt;
[http://acsitzar.0lx.net/news-jethro-tull-videos-2008-11-19.html jethro tull videos] [http://bukgetert.0lx.net/sitemap.htm links] [http://lifokdron.0lx.net/504.html movie theater in virginia] [http://flheddin.qsh.eu/brfadron-453.html motivational military videos] [http://sematild.qsh.eu/resource322.htm real player video codecs] &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Mike Chirico (mchirico@users.sourceforge.net) or (mchirico@comcast.net)&lt;br /&gt;
Copyright (C) 2004 (GNU Free Documentation License)&lt;br /&gt;
Last Updated: Thu Dec 28 16:42:50 EST 2006&lt;br /&gt;
&lt;br /&gt;
The latest version of this document can be found at:&lt;br /&gt;
http://souptonuts.sourceforge.net/how_to_linux_and_open_source.htm&lt;br /&gt;
  or text version ( if you have trouble downloading the full document: over 140 pages )&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/How_to_Linux_and_Open_Source.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on Gmail with Postix and Fetchmail&lt;br /&gt;
http://souptonuts.sourceforge.net/postfix_tutorial.html&lt;br /&gt;
&lt;br /&gt;
For tips on using SQLite (over 25 pages)&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_sqlite_tutorial.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on MySQL reference:&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_mysql.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For a recommended reading list&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/Recommended_Reading.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on upgrading RedHat 9 or 8.0 to 2.6.x src kernel&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_26.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on Comcast Email with Home Linux Box&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_COMCAST_EMAIL.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  **Note, if you want email notification after every 50 new tips have been&lt;br /&gt;
    added, then, click on the following link:&lt;br /&gt;
     https://sourceforge.net/project/filemodule_monitor.php?filemodule_id=120838&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 1:&lt;br /&gt;
&lt;br /&gt;
     Is NTP Working?&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Test the current server):&lt;br /&gt;
&lt;br /&gt;
          Try issuing the following command:&lt;br /&gt;
&lt;br /&gt;
          $ ntpq -pn&lt;br /&gt;
&lt;br /&gt;
           remote refid st t when poll reach delay offset jitter&lt;br /&gt;
           ===================================================&lt;br /&gt;
           tock.usno.navy 0.0.0.0 16 u - 64 0 0.000 0.000 4000.00&lt;br /&gt;
&lt;br /&gt;
          The above is an example of a problem.&lt;br /&gt;
          Compare it to a working configuration.&lt;br /&gt;
&lt;br /&gt;
          $ ntpq -pn&lt;br /&gt;
&lt;br /&gt;
           remote refid st t when poll reach delay offset jitter&lt;br /&gt;
           ========================================================&lt;br /&gt;
           +128.4.40.12 128.4.40.10 2 u 107 128 377 25.642 3.350 1.012&lt;br /&gt;
           127.127.1.0 127.127.1.0 10 l 40 64 377 0.000 0.000 0.008&lt;br /&gt;
           +128.91.2.13 128.4.40.12 3 u 34 128 377 21.138 6.118 0.398&lt;br /&gt;
           *192.5.41.41 .USNO. 1 u 110 128 377 33.69 9.533 3.534&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Configure the /etc/ntp.conf):&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/ntp.conf&lt;br /&gt;
&lt;br /&gt;
            # My simple client-only ntp configuration.&lt;br /&gt;
            server timeserver1.upenn.edu&lt;br /&gt;
            # ping -a timeserver1.upenn.edu shows the IP address 128.91.2.13&lt;br /&gt;
            # which is used in the restrict below&lt;br /&gt;
            restrict 128.91.2.13&lt;br /&gt;
            server tock.usno.navy.mil&lt;br /&gt;
            restrict 192.5.41.41&lt;br /&gt;
            server 128.4.40.12&lt;br /&gt;
            restrict 128.4.40.12&lt;br /&gt;
            server 127.127.1.0 # local clock&lt;br /&gt;
            fudge 127.127.1.0 stratum 10&lt;br /&gt;
            driftfile /etc/ntp/drift&lt;br /&gt;
            restrict default ignore&lt;br /&gt;
            restrict 127.0.0.0 mask 255.0.0.0&lt;br /&gt;
            authenticate no&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Configure /etc/ntp/step-tickers):&lt;br /&gt;
&lt;br /&gt;
          The values for server above are placed in the &amp;quot;/etc/ntp/step-tickers&amp;quot; file&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/ntp/step-tickers&lt;br /&gt;
&lt;br /&gt;
              timeserver1.upenn.edu&lt;br /&gt;
              tock.usno.navy.mil&lt;br /&gt;
              128.4.40.12&lt;br /&gt;
&lt;br /&gt;
          The startup script /etc/rc.d/init.d/ntpd will grab the servers in this&lt;br /&gt;
          file and execute the ntpdate command as follows:&lt;br /&gt;
&lt;br /&gt;
             /usr/sbin/ntpdate -s -b -p 8 timeserver1.upenn.edu&lt;br /&gt;
&lt;br /&gt;
          Why? Because if the time is off ntpd will not start. The command above set the&lt;br /&gt;
          clock. If System Time deviates from true time by more than 1000 seconds, then,&lt;br /&gt;
          the ntpd daemon  will enter panic mode and exit.&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Restart the service and check):&lt;br /&gt;
&lt;br /&gt;
          Issue the restart command&lt;br /&gt;
&lt;br /&gt;
            /etc/init.d/ntpd restart&lt;br /&gt;
&lt;br /&gt;
          check the values for &amp;quot;ntpq -pn&amp;quot;,&lt;br /&gt;
          which should match step 1.&lt;br /&gt;
&lt;br /&gt;
             ntpq -pn&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE:&lt;br /&gt;
&lt;br /&gt;
          Time is always stored in the kernel as the number of seconds since&lt;br /&gt;
          midnight of the 1st of January 1970 UTC, regardless of whether the&lt;br /&gt;
          hardware clock is stored as UTC or not.  Conversions to local time&lt;br /&gt;
          are done at run-time. So, it's easy to get the time in different&lt;br /&gt;
          timezones for only the current session as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ export TZ=EST&lt;br /&gt;
              $ date&lt;br /&gt;
              Mon Aug  2 10:34:04 EST 2004&lt;br /&gt;
&lt;br /&gt;
              $ export TZ=NET&lt;br /&gt;
              $ date&lt;br /&gt;
              Mon Aug  2 15:34:18 NET 2004&lt;br /&gt;
&lt;br /&gt;
          The following are possible values for TZ:&lt;br /&gt;
&lt;br /&gt;
              Hours From Greenwich Mean Time (GMT) Value Description&lt;br /&gt;
              0 GMT Greenwich Mean Time&lt;br /&gt;
              +1 ECT European Central Time&lt;br /&gt;
              +2 EET European Eastern Time&lt;br /&gt;
              +2 ART&lt;br /&gt;
              +3 EAT Saudi Arabia&lt;br /&gt;
              +3.5 MET Iran&lt;br /&gt;
              +4 NET&lt;br /&gt;
              +5 PLT West Asia&lt;br /&gt;
              +5.5 IST India&lt;br /&gt;
              +6 BST Central Asia&lt;br /&gt;
              +7 VST Bangkok&lt;br /&gt;
              +8 CTT China&lt;br /&gt;
              +9 JST Japan&lt;br /&gt;
              +9.5 ACT Central Australia&lt;br /&gt;
              +10 AET Eastern Australia&lt;br /&gt;
              +11 SST Central Pacific&lt;br /&gt;
              +12 NST New Zealand&lt;br /&gt;
              -11 MIT Samoa&lt;br /&gt;
              -10 HST Hawaii&lt;br /&gt;
              -9 AST Alaska&lt;br /&gt;
              -8 PST Pacific Standard Time&lt;br /&gt;
              -7 PNT Arizona&lt;br /&gt;
              -7 MST Mountain Standard Time&lt;br /&gt;
              -6 CST Central Standard Time&lt;br /&gt;
              -5 EST Eastern Standard Time&lt;br /&gt;
              -5 IET Indiana East&lt;br /&gt;
              -4 PRT Atlantic Standard Time&lt;br /&gt;
              -3.5 CNT Newfoundland&lt;br /&gt;
              -3 AGT Eastern South America&lt;br /&gt;
              -3 BET Eastern South America&lt;br /&gt;
              -1 CAT Azores&lt;br /&gt;
&lt;br /&gt;
              DST timezone&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              0      BST for British Summer.&lt;br /&gt;
              +400   ADT for Atlantic Daylight.&lt;br /&gt;
              +500   EDT for Eastern Daylight.&lt;br /&gt;
              +600   CDT for Central Daylight.&lt;br /&gt;
              +700   MDT for Mountain Daylight.&lt;br /&gt;
              +800   PDT for Pacific Daylight.&lt;br /&gt;
              +900   YDT for Yukon Daylight.&lt;br /&gt;
              +1000  HDT for Hawaii Daylight.&lt;br /&gt;
              -100   MEST for Middle European Summer,&lt;br /&gt;
                         MESZ for Middle European Summer,&lt;br /&gt;
                         SST for Swedish Summer and FST for French Summer.&lt;br /&gt;
              -700   WADT for West Australian Daylight.&lt;br /&gt;
              -1000  EADT for Eastern Australian Daylight.&lt;br /&gt;
              -1200  NZDT for New Zealand Daylight.&lt;br /&gt;
&lt;br /&gt;
     The following is an example of setting the TZ environment variable&lt;br /&gt;
     for the timezone, only when timezone changes go into effect.&lt;br /&gt;
&lt;br /&gt;
               $ export TZ=EST+5EDT,M4.1.0/2,M10.5.0/2&lt;br /&gt;
&lt;br /&gt;
     Take a look at the last line &amp;quot;M10.5.0/2&amp;quot;. What does it mean? Here is the&lt;br /&gt;
     documentation&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Mm.w.d This  specifies  day  d (0 &amp;lt;= d &amp;lt;= 6) of week w (1 &amp;lt;= w &amp;lt;= 5) of&lt;br /&gt;
              month m (1 &amp;lt;= m &amp;lt;= 12).  Week 1 is the first week in which day d&lt;br /&gt;
              occurs and week 5 is the last week in which day d occurs.  Day 0&lt;br /&gt;
              is a Sunday.&lt;br /&gt;
&lt;br /&gt;
              The time fields specify when, in the local time  currently  in&lt;br /&gt;
              effect, the  change  to  the  other  time  occurs.   If omitted,&lt;br /&gt;
              the default is  02:00:00.&lt;br /&gt;
&lt;br /&gt;
      So this is what it means. M10 stands for October, the 5 is the fifth week&lt;br /&gt;
      that includes a Sunday (note 0 in M10.5.0/2 is Sunday). To see that it is&lt;br /&gt;
      the fifth week see the calendar below. The time change occurs a 2am in&lt;br /&gt;
      the morning.&lt;br /&gt;
&lt;br /&gt;
                                October&lt;br /&gt;
                         Su Mo Tu We Th Fr Sa&lt;br /&gt;
                                         1  2&lt;br /&gt;
                          3  4  5  6  7  8  9&lt;br /&gt;
                         10 11 12 13 14 15 16&lt;br /&gt;
                         17 18 19 20 21 22 23&lt;br /&gt;
                         24 25 26 27 28 29 30&lt;br /&gt;
                         31&lt;br /&gt;
&lt;br /&gt;
       Prove it. Take the following program sunrise, which can calcuates sunrise&lt;br /&gt;
       and sunset for an latitude and longitude. This program can be downloaded&lt;br /&gt;
       from the following location:&lt;br /&gt;
           http://sourceforge.net/direct-dl/mchirico/souptonuts/working_with_time.tar.gz&lt;br /&gt;
&lt;br /&gt;
       Below is a bash script that will run the program for the next 100 days.&lt;br /&gt;
&lt;br /&gt;
          #!/bin/bash&lt;br /&gt;
          #  program: next100days  Mike Chirico&lt;br /&gt;
          #  download:&lt;br /&gt;
          #  http://sourceforge.net/direct-dl/mchirico/souptonuts/working_with_time.tar.gz&lt;br /&gt;
          #&lt;br /&gt;
          #  This will calculate the sunrise and sunset for&lt;br /&gt;
          #  latitude     39.95  Note must convert to degrees&lt;br /&gt;
          #  longitude  75.15  Note must convert to degrees&lt;br /&gt;
          lat=39.95&lt;br /&gt;
          long=75.15&lt;br /&gt;
          for (( i=0; i &amp;lt;= 100; i++))&lt;br /&gt;
          do&lt;br /&gt;
            sunrise    `date -d &amp;quot;+$i day&amp;quot; &amp;quot;+%Y %m %d&amp;quot;` $lat $long&lt;br /&gt;
          done&lt;br /&gt;
&lt;br /&gt;
       Take a look at the following sample output.&lt;br /&gt;
&lt;br /&gt;
           $ export TZ=EST+5EDT,M4.1.0/2,M10.5.0/2&lt;br /&gt;
           $ ./next100days&lt;br /&gt;
&lt;br /&gt;
          Sunrise  08-24-2004  06:21:12   Sunset 08-24-2004  19:43:42&lt;br /&gt;
          Sunrise  08-25-2004  06:22:09   Sunset 08-25-2004  19:42:12&lt;br /&gt;
          Sunrise  08-26-2004  06:23:06   Sunset 08-26-2004  19:40:41&lt;br /&gt;
          Sunrise  08-27-2004  06:24:03   Sunset 08-27-2004  19:39:09&lt;br /&gt;
          Sunrise  08-28-2004  06:25:00   Sunset 08-28-2004  19:37:37&lt;br /&gt;
          Sunrise  08-29-2004  06:25:56   Sunset 08-29-2004  19:36:04&lt;br /&gt;
          Sunrise  08-30-2004  06:26:53   Sunset 08-30-2004  19:34:31&lt;br /&gt;
          Sunrise  08-31-2004  06:27:50   Sunset 08-31-2004  19:32:57&lt;br /&gt;
          Sunrise  09-01-2004  06:28:46   Sunset 09-01-2004  19:31:22&lt;br /&gt;
          Sunrise  09-02-2004  06:29:43   Sunset 09-02-2004  19:29:47&lt;br /&gt;
          ..[values omitted ]&lt;br /&gt;
          Sunrise  10-28-2004  07:25:31   Sunset 10-28-2004  18:02:34&lt;br /&gt;
          Sunrise  10-29-2004  07:26:38   Sunset 10-29-2004  18:01:19&lt;br /&gt;
          Sunrise  10-30-2004  07:27:46   Sunset 10-30-2004  18:00:06&lt;br /&gt;
          Sunrise  10-31-2004  06:28:53   Sunset 10-31-2004  16:58:54&lt;br /&gt;
          Sunrise  11-01-2004  06:30:01   Sunset 11-01-2004  16:57:44&lt;br /&gt;
          Sunrise  11-02-2004  06:31:10   Sunset 11-02-2004  16:56:35&lt;br /&gt;
&lt;br /&gt;
       Compare 10-30-2004 with 10-31-2004. Sunrise is an hour earlier because&lt;br /&gt;
       daylight saving time has ended, just as predicted.&lt;br /&gt;
&lt;br /&gt;
       There is an easier way to switch between timezones. Take a look at the&lt;br /&gt;
       directory zoneinfo as follows:&lt;br /&gt;
&lt;br /&gt;
            $ ls /usr/share/zoneinfo&lt;br /&gt;
&lt;br /&gt;
            Africa      Chile    Factory    Iceland      Mexico    posix       UCT&lt;br /&gt;
            America     CST6CDT  GB         Indian       Mideast   posixrules  Universal&lt;br /&gt;
            Antarctica  Cuba     GB-Eire    Iran         MST       PRC         US&lt;br /&gt;
            Arctic      EET      GMT        iso3166.tab  MST7MDT   PST8PDT     UTC&lt;br /&gt;
            Asia        Egypt    GMT0       Israel       Navajo    right       WET&lt;br /&gt;
            Atlantic    Eire     GMT-0      Jamaica      NZ        ROC         W-SU&lt;br /&gt;
            Australia   EST      GMT+0      Japan        NZ-CHAT   ROK         zone.tab&lt;br /&gt;
            Brazil      EST5EDT  Greenwich  Kwajalein    Pacific   Singapore   Zulu&lt;br /&gt;
            Canada      Etc      Hongkong   Libya        Poland    SystemV&lt;br /&gt;
            CET         Europe   HST        MET          Portugal  Turkey&lt;br /&gt;
&lt;br /&gt;
       TZ can be set to any one of these files. Some of these are directories and contain&lt;br /&gt;
       subdirectories, such as ./posix/America. This way you don not have to enter the&lt;br /&gt;
       timezone, offset, and range for dst, since it has already been calculated.&lt;br /&gt;
&lt;br /&gt;
           $ export TZ=:/usr/share/zoneinfo/posix/America/Aruba&lt;br /&gt;
           $ export TZ=:/usr/share/zoneinfo/Egypt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Reference:&lt;br /&gt;
          http://prdownloads.sourceforge.net/cpearls/date_calc.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
          Also see  (TIP 27).&lt;br /&gt;
          Also see  (TIP 103) using chrony which is very similiar to ntpd.&lt;br /&gt;
          Note time settings can usually be found in /etc/sysconfig/clock&lt;br /&gt;
         &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 2:&lt;br /&gt;
&lt;br /&gt;
     cpio works like tar, only better.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Create two directories with data ../dir1 an ../dir2)&lt;br /&gt;
&lt;br /&gt;
          mkdir -p ../dir1&lt;br /&gt;
          mkdir -p ../dir2&lt;br /&gt;
          cp /etc/*.conf ../dir1/.&lt;br /&gt;
          cp /etc/*.cnf ../dir2/.&lt;br /&gt;
&lt;br /&gt;
          Which will backup all your cnf and conf files.&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Piping the files to tar)&lt;br /&gt;
&lt;br /&gt;
          cpio works like tar but can take input&lt;br /&gt;
          from the &amp;quot;find&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar &amp;gt; test.tar&lt;br /&gt;
               or&lt;br /&gt;
           $ find ../dir1/ | cpio -o -H tar &amp;gt; test2.tar&lt;br /&gt;
&lt;br /&gt;
          Same command without the &amp;quot;&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar -F test.tar&lt;br /&gt;
              or&lt;br /&gt;
           $ find ../dir1/ | cpio -o -H tar -F test2.tar&lt;br /&gt;
&lt;br /&gt;
          Using append&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar -F test.tar&lt;br /&gt;
             or&lt;br /&gt;
           $ find ../dir2/ | cpio -o --format=tar --append -F test.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (List contents of the tar file)&lt;br /&gt;
&lt;br /&gt;
          $ cpio -it &amp;lt; test.tar&lt;br /&gt;
                or&lt;br /&gt;
          $ cpio -it -F test.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Extract the contents)&lt;br /&gt;
&lt;br /&gt;
          $ cpio -i -F test.tar&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 3:&lt;br /&gt;
&lt;br /&gt;
     Working with tar. The basics with encryption.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Using the tar command on the directory /stuff)&lt;br /&gt;
&lt;br /&gt;
          Suppose you have a directory /stuff&lt;br /&gt;
          To tar everything in stuff to create a &amp;quot;.tar&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
          $ tar -cvf stuff.tar stuff&lt;br /&gt;
&lt;br /&gt;
          Which will create &amp;quot;stuff.tar&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Using the tar command to create a &amp;quot;.tar.gz&amp;quot; of /stuff)&lt;br /&gt;
&lt;br /&gt;
          $ tar -czf stuff.tar.gz stuff&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (List the files in the archive)&lt;br /&gt;
&lt;br /&gt;
          $ tar -tzf stuff.tar.gz&lt;br /&gt;
               or&lt;br /&gt;
          $ tar -tf stuff.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (A way to list specific files)&lt;br /&gt;
&lt;br /&gt;
          Note, pipe the results to a file and edit&lt;br /&gt;
&lt;br /&gt;
           $ tar -tzf stuff.tar.gz &amp;gt; mout&lt;br /&gt;
&lt;br /&gt;
          Then, edit mout to only include the files you want&lt;br /&gt;
&lt;br /&gt;
           $ tar -T mout -xzf stuff.tar.gz&lt;br /&gt;
&lt;br /&gt;
          The above command will only get the files in mout.&lt;br /&gt;
          Of couse, if you want them all&lt;br /&gt;
&lt;br /&gt;
           $ tar -xzf stuff.tar.gz&lt;br /&gt;
&lt;br /&gt;
     STEP 5 (ENCRYPTION)&lt;br /&gt;
&lt;br /&gt;
           $ tar -zcvf - stuff|openssl des3 -salt -k secretpassword | dd of=stuff.des3&lt;br /&gt;
&lt;br /&gt;
          This will create stuff.des3...don't forget the password you&lt;br /&gt;
          put in place of  secretpassword. This can be done interactively as&lt;br /&gt;
          well.&lt;br /&gt;
&lt;br /&gt;
            $ dd if=stuff.des3 |openssl des3 -d -k secretpassword|tar zxf -&lt;br /&gt;
&lt;br /&gt;
     NOTE:  above there is a &amp;quot;-&amp;quot; at the end... this will&lt;br /&gt;
            extract everything.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 4:&lt;br /&gt;
&lt;br /&gt;
     Creating a Virtual File System and Mounting it with a Loopback Device.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Construct a 10MB file)&lt;br /&gt;
&lt;br /&gt;
           $ dd if=/dev/zero of=/tmp/disk-image count=20480&lt;br /&gt;
&lt;br /&gt;
          By default dd uses block of 512 so the size will be 20480*512&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Make an ext2 or ext3 file system) -- ext2 shown here.&lt;br /&gt;
&lt;br /&gt;
           $ mke2fs -q&lt;br /&gt;
&lt;br /&gt;
          or if you want ext3&lt;br /&gt;
&lt;br /&gt;
           $ mkfs -t ext3 -q /tmp/disk-image&lt;br /&gt;
&lt;br /&gt;
          yes, you can even use reiser, but you'll need to create a bigger&lt;br /&gt;
          disk image. Something like &amp;quot;dd if=/dev/zero of=/tmp/disk-image count=50480&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ mkfs -t reiserfs -q /tmp/disk-image&lt;br /&gt;
&lt;br /&gt;
          Hit yes for confirmation.  It only asks this because it's a file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Create a directory &amp;quot;virtual-fs&amp;quot; and mount. This has to be done as root)&lt;br /&gt;
&lt;br /&gt;
           $ mkdir /virtual-fs&lt;br /&gt;
           $ mount -o loop=/dev/loop0 /tmp/disk-image /virtual-fs&lt;br /&gt;
&lt;br /&gt;
         SPECIAL NOTE: if you mount a second device you will have to increase the&lt;br /&gt;
                       loop count: loop=/dev/loop1, loop=/dev/loop2, ... loop=/dev/loopn&lt;br /&gt;
&lt;br /&gt;
          Now it operates just like a disk. This virtual filesystem can be mounted&lt;br /&gt;
          when the system boots by adding the following to the &amp;quot;/etc/fstab&amp;quot; file. Then,&lt;br /&gt;
          to mount, just type &amp;quot;mount /virtual-fs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                 /tmp/disk-image /virtual-fs ext2               rw,loop=/dev/loop0 0 0&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (When done, umount it)&lt;br /&gt;
&lt;br /&gt;
           $ umount /virtual-fs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE: If you are using Fedora core 2, in the /etc/fstab you can take&lt;br /&gt;
              advantage of acl properties for this mount. Note the acl next to the&lt;br /&gt;
              rw entry. This is shown here with ext3.&lt;br /&gt;
&lt;br /&gt;
                 /tmp/disk-image     /virtual-fs ext3    rw,acl,loop=/dev/loop1 0 0&lt;br /&gt;
&lt;br /&gt;
              Also, if you are using Fedora core 2 and above, you can mount the file&lt;br /&gt;
              on a cryptoloop.&lt;br /&gt;
&lt;br /&gt;
                $ dd if=/dev/urandom of=disk-aes count=20480&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ modprobe loop&lt;br /&gt;
                $ modprobe cryptoloop&lt;br /&gt;
                $ modprobe aes&lt;br /&gt;
&lt;br /&gt;
                $ losetup -e aes /dev/loop0 disk-aes&lt;br /&gt;
                $ mkfs -t ext2 /dev/loop0&lt;br /&gt;
                $ mount -o loop,encryption=aes disk-aes &amp;lt;mount point&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              If you do not have Fedora core 2, then, you can build the kernel from source&lt;br /&gt;
              with some of the following options (not complete, yet)&lt;br /&gt;
               reference:&lt;br /&gt;
     http://cvs.sourceforge.net/viewcvs.py/cpearls/cpearls/src/posted_on_sf/acl/ehd.pdf?rev=1.1&amp;amp;view=log&lt;br /&gt;
&lt;br /&gt;
                      Cryptographic API Support (CONFIG_CRYPTO)&lt;br /&gt;
                      generic loop cryptographic (CONFIG_CRYPTOLOOP)&lt;br /&gt;
                      Cryptographic ciphers (CONFIG_CIPHERS)&lt;br /&gt;
                      Enable one or more  ciphers  (CONFIG CIPHER .*) such as AES.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     HELPFUL INFORMATION: It is possible to bind mount partitions, or associate the&lt;br /&gt;
                     mounted partition to a directory name.&lt;br /&gt;
&lt;br /&gt;
                  # mount --bind  /virtual-fs      /home/mchirico/vfs&lt;br /&gt;
&lt;br /&gt;
             Also, if you want to see what filesystems are currently mounted, &amp;quot;cat&amp;quot; the&lt;br /&gt;
             file &amp;quot;/etc/mtab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
                  $ cat /etc/mtab&lt;br /&gt;
&lt;br /&gt;
     Also see TIP 91.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 5:&lt;br /&gt;
&lt;br /&gt;
     Setting up 2 IP address on &amp;quot;One&amp;quot; NIC. This example is on ethernet.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (The settings for the initial IP address)&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
&lt;br /&gt;
            DEVICE=eth0&lt;br /&gt;
            BOOTPROTO=static&lt;br /&gt;
            BROADCAST=192.168.99.255&lt;br /&gt;
            IPADDR=192.168.1.155&lt;br /&gt;
            NETMASK=255.255.252.0&lt;br /&gt;
            NETWORK=192.168.1.0&lt;br /&gt;
            ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (2nd IP address: )&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/sysconfig/network-scripts/ifcfg-eth0:1&lt;br /&gt;
&lt;br /&gt;
            DEVICE=eth0:1&lt;br /&gt;
            BOOTPROTO=static&lt;br /&gt;
            BROADCAST=192.168.99.255&lt;br /&gt;
            IPADDR=192.168.1.182&lt;br /&gt;
            NETMASK=255.255.252.0&lt;br /&gt;
            NETWORK=192.168.1.0&lt;br /&gt;
            ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
     SUMMARY  Note, in STEP 1 the filename is &amp;quot;ifcfg-eth0&amp;quot;, whereas in&lt;br /&gt;
              STEP 2 it's &amp;quot;ifcfg-eth0:1&amp;quot; and also not the matching&lt;br /&gt;
              entries for &amp;quot;DEVICE=...&amp;quot;.  Also, obviously, the&lt;br /&gt;
              &amp;quot;IPADDR&amp;quot; is different as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 6:&lt;br /&gt;
&lt;br /&gt;
     Sharing Directories Among Several Users.&lt;br /&gt;
&lt;br /&gt;
     Several people are working on a project in &amp;quot;/home/share&amp;quot;&lt;br /&gt;
     and they need to create documents and programs so that&lt;br /&gt;
     others in the group can edit and execute these documents&lt;br /&gt;
     as needed. Also see (TIP 186) for adding existing users&lt;br /&gt;
     to groups.&lt;br /&gt;
&lt;br /&gt;
       $  /usr/sbin/groupadd share&lt;br /&gt;
       $  chown -R root.share /home/share&lt;br /&gt;
       $  /usr/bin/gpasswd -a &amp;lt;username&amp;gt; share&lt;br /&gt;
       $  chmod 2775 /home/share&lt;br /&gt;
&lt;br /&gt;
       $  ls -ld /home/share&lt;br /&gt;
             drwxrwsr-x    2 root     share        4096 Nov  8 16:19 /home/share&lt;br /&gt;
                   ^---------- Note the s bit, which was set with the chmod 2775&lt;br /&gt;
&lt;br /&gt;
       $  cat /etc/group&lt;br /&gt;
          ...&lt;br /&gt;
           share:x:502:chirico,donkey,zoe&lt;br /&gt;
          ...          ^------- users are added to this group.&lt;br /&gt;
&lt;br /&gt;
     The user may need to login again to get access. Or, if the user is currently&lt;br /&gt;
     logged in, they can run the following command:&lt;br /&gt;
&lt;br /&gt;
       $ su - &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Note, the above step is recommended over  &amp;quot;newgrp - share&amp;quot; since currently&lt;br /&gt;
     newgrp in FC2,FC3, and FC4 gets access to the group but the umask is not&lt;br /&gt;
     correctly formed.&lt;br /&gt;
&lt;br /&gt;
     As root you  can test their account.&lt;br /&gt;
&lt;br /&gt;
       $ su - &amp;lt;username&amp;gt;   &amp;quot;You need to '-' to pickup thier environment  '$ su - chirico' &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Note: SUID, SGID, Sticky bit. Only the left most octet is examined, and &amp;quot;chmod 755&amp;quot; is used&lt;br /&gt;
          as an example of the full command. But, anything else could be used as well. Normally&lt;br /&gt;
          you'd want executable permissions.&lt;br /&gt;
&lt;br /&gt;
        Octal digit  Binary value      Meaning                           Example usage&lt;br /&gt;
            0           000       all cleared                             $ chmod 0755 or chmod 755&lt;br /&gt;
            1           001       sticky                                  $ chmod 1755&lt;br /&gt;
            2           010       setgid                                  $ chmod 2755&lt;br /&gt;
            3           011       setgid, sticky                          $ chmod 3755&lt;br /&gt;
            4           100       setuid                                  $ chmod 4755&lt;br /&gt;
            5           101       setuid, sticky                          $ chmod 5755&lt;br /&gt;
            6           110       setuid, setgid                          $ chmod 6755&lt;br /&gt;
            7           111       setuid, setgid, sticky                  $ chmod 7755&lt;br /&gt;
&lt;br /&gt;
     A few examples applied to a directory below. In the first example all users in the group can&lt;br /&gt;
     add files to directory &amp;quot;dirA&amp;quot; and they can delete their own files. Users cannot delete other&lt;br /&gt;
     user's files.&lt;br /&gt;
&lt;br /&gt;
        Sticky bit:&lt;br /&gt;
           $ chmod 1770  dirA&lt;br /&gt;
&lt;br /&gt;
     Below files created within the directory have the group ID of the directory, rather than that&lt;br /&gt;
     of the default group setting for the user who created the file.&lt;br /&gt;
&lt;br /&gt;
        Set group ID bit:&lt;br /&gt;
           $ chmod 2755  dirB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 7:&lt;br /&gt;
&lt;br /&gt;
     Getting Infomation on Commands&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;info&amp;quot; is a great utility for getting information about the system.&lt;br /&gt;
     Here's a quick key on using &amp;quot;info&amp;quot; from the terminal prompt.&lt;br /&gt;
&lt;br /&gt;
       'q' exits.&lt;br /&gt;
       'u' moves up to the table of contents of the current section.&lt;br /&gt;
       'n' moves to the next chapter.&lt;br /&gt;
       'p' moves to the previous chapter.&lt;br /&gt;
       'space' goes into the selected section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The following is a good starting point:&lt;br /&gt;
&lt;br /&gt;
        $ info coreutils&lt;br /&gt;
&lt;br /&gt;
      Need to find out what a certain program does?&lt;br /&gt;
&lt;br /&gt;
        $ whatis  open&lt;br /&gt;
       open   (2)  - open and possibly create a file or device&lt;br /&gt;
       open   (3)  - perl pragma to set default PerlIO layers for input and output&lt;br /&gt;
       open   (3pm)  - perl pragma to set default PerlIO layers for input and output&lt;br /&gt;
       open   (n)  - Open a file-based or command pipeline channel&lt;br /&gt;
&lt;br /&gt;
      To get specific information about the open commmand&lt;br /&gt;
&lt;br /&gt;
        $ man 2 open&lt;br /&gt;
&lt;br /&gt;
       also try 'keyword' search, which is the same as the apropos command.&lt;br /&gt;
       For example, to find all the man pages on selinux, type the following:&lt;br /&gt;
&lt;br /&gt;
        $ man -k selinux&lt;br /&gt;
&lt;br /&gt;
       or the man full word search. Same as whatis command.&lt;br /&gt;
&lt;br /&gt;
        $ man -f &amp;lt;some string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       This is a hint once you are inside man.&lt;br /&gt;
&lt;br /&gt;
        space      moves forward one page&lt;br /&gt;
        b          moves backward&lt;br /&gt;
        y          scrolls up one line &amp;quot;yikes, I missed it!&amp;quot;&lt;br /&gt;
        g          goes to the beginning&lt;br /&gt;
        q          quits&lt;br /&gt;
        /&amp;lt;string&amp;gt;  search, repeat seach n&lt;br /&gt;
        m          mark, enter a letter like &amp;quot;a&amp;quot;, then, ' to go back&lt;br /&gt;
        '          enter a letter that is marked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       To get section numbers&lt;br /&gt;
&lt;br /&gt;
        $ man 8 ping&lt;br /&gt;
&lt;br /&gt;
       Note the numbers are used as follows&lt;br /&gt;
         (This is OpenBSD)&lt;br /&gt;
&lt;br /&gt;
         1  General Commands&lt;br /&gt;
         2  System Calls and Error Numbers&lt;br /&gt;
         3  C Libraries&lt;br /&gt;
         3p perl&lt;br /&gt;
         4  Devices and device drivers&lt;br /&gt;
         5  File Formats and config files&lt;br /&gt;
         6  Game instructions&lt;br /&gt;
         7  Miscellaneous information&lt;br /&gt;
         8  System maintenance&lt;br /&gt;
         9  Kernel internals&lt;br /&gt;
&lt;br /&gt;
       To find the man page directly, &amp;quot;ls&amp;quot; command:&lt;br /&gt;
&lt;br /&gt;
         $ whereis -m ls&lt;br /&gt;
         ls: /usr/share/man/man1/ls.1.gz /usr/share/man/man1/ls.1 /usr/share/man/man1p/ls.1p&lt;br /&gt;
&lt;br /&gt;
       To read this file directly, do the following:&lt;br /&gt;
&lt;br /&gt;
         $ man /usr/share/man/man1/ls.1.gz&lt;br /&gt;
&lt;br /&gt;
       If you want to know the manpath, execute manpath.&lt;br /&gt;
&lt;br /&gt;
         $ manpath&lt;br /&gt;
         /usr/share/man:/usr/X11R6/man:/usr/local/share/man:/usr/local/pgsql/man:/usr/man:/usr/local/man&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 8:&lt;br /&gt;
&lt;br /&gt;
     How to Put a &amp;quot;Running Job&amp;quot; in the Background.&lt;br /&gt;
&lt;br /&gt;
     You're running a job at the terminal prompt, and it's taking&lt;br /&gt;
     a very long time. You want to put the job in the backgroud.&lt;br /&gt;
&lt;br /&gt;
       &amp;quot;CTL - z&amp;quot; Temporarily suspends the job&lt;br /&gt;
       $ jobs     This will list all the jobs&lt;br /&gt;
       $ bg %jobnumber (bg %1)  To run in the background&lt;br /&gt;
       $ fg %jobnumber          To bring back in the foreground&lt;br /&gt;
&lt;br /&gt;
     Need to kill all jobs -- say you're using several suspended&lt;br /&gt;
     emacs sessions and you just want everything to exit.&lt;br /&gt;
&lt;br /&gt;
       $ kill -9  `jobs -p`&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;jobs -p&amp;quot; gives the process number of each job, and the&lt;br /&gt;
     kill -9 kills everything. Yes, sometimes &amp;quot;kill -9&amp;quot; is excessive&lt;br /&gt;
     and you should issue a &amp;quot;kill -15&amp;quot; that allows jobs to clean-up.&lt;br /&gt;
     However, for exacs session, I prefer &amp;quot;kill -9&amp;quot; and haven't had&lt;br /&gt;
     a problem.&lt;br /&gt;
&lt;br /&gt;
     Sometimes you need to list the process id along with job&lt;br /&gt;
     information. For instance, here's process id with the listing.&lt;br /&gt;
&lt;br /&gt;
       $ jobs -l&lt;br /&gt;
&lt;br /&gt;
     Note you can also renice a job, or give it lower priority.&lt;br /&gt;
&lt;br /&gt;
       $ nice -n +15 find . -ctime 2 -type f  -exec ls {} \; &amp;gt; last48hours&lt;br /&gt;
        ^z&lt;br /&gt;
       $  bg&lt;br /&gt;
&lt;br /&gt;
     So above that was a ctl-z to suppend. Then, bg to run it in&lt;br /&gt;
     the background. Now, if you want to change the priority lower&lt;br /&gt;
     you just renice it, once you know the process id.&lt;br /&gt;
&lt;br /&gt;
       $ jobs -pl&lt;br /&gt;
   [1]+ 29388 Running                 nice -n +15 find . -ctime 2 -exec ls -l {} \; &amp;gt;mout &amp;amp;&lt;br /&gt;
&lt;br /&gt;
       $ renice +30 -p 29388&lt;br /&gt;
        29388: old priority 15, new priority 19&lt;br /&gt;
&lt;br /&gt;
      19 was the lowest priority for this job. You cannot increase&lt;br /&gt;
      the priority unless you are root.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 9:&lt;br /&gt;
&lt;br /&gt;
     Need to Delete a File for Good -- not even GOD can recover.&lt;br /&gt;
&lt;br /&gt;
     You have a file &amp;quot;secret&amp;quot;.  The following makes it so no one&lt;br /&gt;
     can read it.  If the file was 12 bytes, it's now 4096 after it&lt;br /&gt;
     has been over written 100 times.  There's no way to recover this.&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z secret&lt;br /&gt;
&lt;br /&gt;
     Want to remove the file? Use the &amp;quot;u&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z -u test2&lt;br /&gt;
&lt;br /&gt;
     It can be applied to a device&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z -u /dev/fd0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       CAUTION: Note that shred relies on a very important assumption: that the file system  overwrites  data&lt;br /&gt;
       in  place.   This is the traditional way to do things, but many modern file system designs do not sat-&lt;br /&gt;
       isfy this assumption.  The following are examples of file systems on which shred is not effective,  or&lt;br /&gt;
       is not guaranteed to be effective in all file system modes:&lt;br /&gt;
&lt;br /&gt;
       * log-structured or journaled file systems, such as those supplied with&lt;br /&gt;
&lt;br /&gt;
              AIX and Solaris (and JFS, ReiserFS, XFS, Ext3, etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 52).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 10:&lt;br /&gt;
&lt;br /&gt;
     Who and What is doing What on Your System - finding open sockets,&lt;br /&gt;
     files etc.&lt;br /&gt;
&lt;br /&gt;
       $ lsof&lt;br /&gt;
          or as root&lt;br /&gt;
       $ watch lsof -i&lt;br /&gt;
&lt;br /&gt;
     To list all open Internet files, use:&lt;br /&gt;
&lt;br /&gt;
       $ lsof -i -U&lt;br /&gt;
&lt;br /&gt;
       (See TIP 118)&lt;br /&gt;
&lt;br /&gt;
     Also try fuser. Suppose you have a mounted file-system, and you need&lt;br /&gt;
     to umount it. To list the users on the file-system /work&lt;br /&gt;
&lt;br /&gt;
       $ fuser -u /work&lt;br /&gt;
&lt;br /&gt;
     To kill all processes accessing the file system /work  in  any way.&lt;br /&gt;
&lt;br /&gt;
       $ fuser -km /work&lt;br /&gt;
&lt;br /&gt;
     Or better yet, maybe you want to eject a cdrom on /mnt/cdrom&lt;br /&gt;
&lt;br /&gt;
       $ fuser -km /mnt/cdrom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     If you need IO load information about your system, you can execute&lt;br /&gt;
     iostat. But note, the very first iostat gives a snapshot since&lt;br /&gt;
     the last boot. You typically want the following command, which gives&lt;br /&gt;
     you 3 outputs every 5 seconds.&lt;br /&gt;
&lt;br /&gt;
       $ iostat -xtc 5 3&lt;br /&gt;
       Linux 2.6.12-1.1376_FC3smp (squeezel.squeezel.com) 	10/05/2005&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:04 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  0.97    0.06    1.94    0.62   96.41&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:09 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  0.60    0.00    1.70    0.00   97.70&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:14 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  1.00    0.00    1.60    0.00   97.39&lt;br /&gt;
&lt;br /&gt;
     vmstat reports memory statistics.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ vmstat&lt;br /&gt;
       $ ifconfig&lt;br /&gt;
       $ cat /proc/sys/vm/.. (entries under here)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      *NOTE: (TIP 77) shows sample usage of &amp;quot;ifconfig&amp;quot;. Also&lt;br /&gt;
       (TIP 84) shows sample output of &amp;quot;$ cat /proc/cpuinfo&amp;quot;. You can download iostat&lt;br /&gt;
       and other packages from (http://perso.wanadoo.fr/sebastien.godard/download_en.html).&lt;br /&gt;
       You also may want to look at iozone (TIP 178).&lt;br /&gt;
&lt;br /&gt;
     Also&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/meminfo&lt;br /&gt;
       $ cat /proc/stat&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/uptime&lt;br /&gt;
       1078623.55 1048008.34       First number is the number of seconds since boot.&lt;br /&gt;
                                   The second number is the number of idle seconds.&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/loadavg&lt;br /&gt;
       0.25 0.14 0.10 1/166 7778   This shows load at 1,5, and 15 minutes,&lt;br /&gt;
                                   a total of 1 current running process out&lt;br /&gt;
                                   from a total of 166. The 7778 is the last&lt;br /&gt;
                                   process id used.&lt;br /&gt;
                                   Ref: http://www.teamquest.com/resources/gunther/ldavg1.shtml&lt;br /&gt;
&lt;br /&gt;
     Or current process open file descriptors&lt;br /&gt;
&lt;br /&gt;
        $ ls -l /proc/self/fd/0&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lr-x------    1 chirico  chirico        64 Jun 29 13:17 3 -&amp;gt; /proc/26667/fd&lt;br /&gt;
&lt;br /&gt;
      So you could, $ echo &amp;quot;stuff&amp;quot; &amp;gt; /dev/pts/51, to get output. Note, tree is also&lt;br /&gt;
      helpful here:&lt;br /&gt;
&lt;br /&gt;
         $ tree /proc/self&lt;br /&gt;
&lt;br /&gt;
            /proc/self&lt;br /&gt;
            |-- auxv&lt;br /&gt;
            |-- cmdline&lt;br /&gt;
            |-- cwd -&amp;gt; /work/souptonuts/documentation/theBook&lt;br /&gt;
            |-- environ&lt;br /&gt;
            |-- exe -&amp;gt; /usr/bin/tree&lt;br /&gt;
            |-- fd&lt;br /&gt;
            |   |-- 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   |-- 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   |-- 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   `-- 3 -&amp;gt; /proc/26668/fd&lt;br /&gt;
            |-- maps&lt;br /&gt;
            |-- mem&lt;br /&gt;
            |-- mounts&lt;br /&gt;
            |-- root -&amp;gt; /&lt;br /&gt;
            |-- stat&lt;br /&gt;
            |-- statm&lt;br /&gt;
            |-- status&lt;br /&gt;
            |-- task&lt;br /&gt;
            |   `-- 26668&lt;br /&gt;
            |       |-- auxv&lt;br /&gt;
            |       |-- cmdline&lt;br /&gt;
            |       |-- cwd -&amp;gt; /work/souptonuts/documentation/theBook&lt;br /&gt;
            |       |-- environ&lt;br /&gt;
            |       |-- exe -&amp;gt; /usr/bin/tree&lt;br /&gt;
            |       |-- fd&lt;br /&gt;
            |       |   |-- 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   |-- 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   |-- 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   `-- 3 -&amp;gt; /proc/26668/task/26668/fd&lt;br /&gt;
            |       |-- maps&lt;br /&gt;
            |       |-- mem&lt;br /&gt;
            |       |-- mounts&lt;br /&gt;
            |       |-- root -&amp;gt; /&lt;br /&gt;
            |       |-- stat&lt;br /&gt;
            |       |-- statm&lt;br /&gt;
            |       |-- status&lt;br /&gt;
            |       `-- wchan&lt;br /&gt;
            `-- wchan&lt;br /&gt;
&lt;br /&gt;
            10 directories, 28 files&lt;br /&gt;
&lt;br /&gt;
     Need a listing of the system settings?&lt;br /&gt;
&lt;br /&gt;
       $ sysctl -a&lt;br /&gt;
&lt;br /&gt;
     Need IPC (Shared Memory Segments, Semaphore Arrays, Message Queue) status&lt;br /&gt;
     etc?&lt;br /&gt;
&lt;br /&gt;
       $ ipcs&lt;br /&gt;
       $ ipcs -l  &amp;quot;This gives limits&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Need to &amp;quot;watch&amp;quot; everything a user does?  The following watches donkey.&lt;br /&gt;
&lt;br /&gt;
       $ watch lsof -u donkey&lt;br /&gt;
&lt;br /&gt;
     Or, to see what in  going on in directory &amp;quot;/work/junk&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       $ watch lsof +D /work/junk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 11:&lt;br /&gt;
&lt;br /&gt;
     How to make a File &amp;quot;immutable&amp;quot; or &amp;quot;unalterable&amp;quot; -- it cannot be changed&lt;br /&gt;
     or deleted even by root. Note this works on (ext2/ext3) filesystems.&lt;br /&gt;
     And, yes, root can delete after it's changed back.&lt;br /&gt;
&lt;br /&gt;
     As root:&lt;br /&gt;
&lt;br /&gt;
       $ chattr +i filename&lt;br /&gt;
&lt;br /&gt;
     And to change it back:&lt;br /&gt;
&lt;br /&gt;
       $ chattr -i filename&lt;br /&gt;
&lt;br /&gt;
     List attributes&lt;br /&gt;
&lt;br /&gt;
       $ lsattr filename&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 12:&lt;br /&gt;
&lt;br /&gt;
     SSH - How to Generate the Key Pair.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     On the local server&lt;br /&gt;
&lt;br /&gt;
       $  ssh-keygen -t dsa -b 2048&lt;br /&gt;
&lt;br /&gt;
     This will create the two files:&lt;br /&gt;
&lt;br /&gt;
            .ssh/id_dsa (Private key)&lt;br /&gt;
            .ssh/id_dsa.pub  (Public key you can share)&lt;br /&gt;
&lt;br /&gt;
     Next insert &amp;quot;.ssh/id_dsa.pub&amp;quot; on the remote server&lt;br /&gt;
     in the file  &amp;quot;.ssh/authorized_keys&amp;quot; and &amp;quot;.ssh/authorized_keys2&amp;quot;&lt;br /&gt;
     and change the  permission of each file to (chmod 600). Plus, make&lt;br /&gt;
     sure the directory &amp;quot;.ssh&amp;quot; exists on the remote computer with 700 rights.&lt;br /&gt;
     Ok, assuming  192.168.1.155 is the remote server and &amp;quot;donkey&amp;quot; is the&lt;br /&gt;
     account on that remote server.&lt;br /&gt;
&lt;br /&gt;
       $ ssh donkey@192.168.1.155 &amp;quot;mkdir -p .ssh&amp;quot;&lt;br /&gt;
       $ ssh donkey@192.168.1.155 &amp;quot;chmod 700 .ssh&amp;quot;&lt;br /&gt;
       $ scp ./.ssh/id_dsa.pub  donkey@192.168.1.155:.ssh/newkey.pub&lt;br /&gt;
&lt;br /&gt;
     Now connect to that remote server &amp;quot;192.168.1.155&amp;quot; and add .ssh/newkey.pub&lt;br /&gt;
     to both &amp;quot;authorized_keys&amp;quot; and &amp;quot;authorized_keys2&amp;quot;.  When done, the permission&lt;br /&gt;
     on&lt;br /&gt;
       (This is on the remote server)&lt;br /&gt;
&lt;br /&gt;
        $chmod 600 .ssh/authorized_key*&lt;br /&gt;
&lt;br /&gt;
     Next, go back to the local server and issue the following:&lt;br /&gt;
&lt;br /&gt;
        $ ssh-agent $SHELL&lt;br /&gt;
        $ ssh-add&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;ssh-add&amp;quot; will allow you to enter the passphrase and it will&lt;br /&gt;
     save it for the current login session.&lt;br /&gt;
&lt;br /&gt;
     You don't have to enter a password when running &amp;quot;ssh-keygen&amp;quot; above. But,&lt;br /&gt;
     remember anyone with root access can &amp;quot;su - &amp;lt;username&amp;gt;&amp;quot; and then connect&lt;br /&gt;
     to your computers.  It's harder, however, not impossible, for root to do&lt;br /&gt;
     this if  you have a password.&lt;br /&gt;
&lt;br /&gt;
     (Reference TIP 151)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 13:&lt;br /&gt;
&lt;br /&gt;
     Securing the System: Don't allow root to login remotely.  Instead,&lt;br /&gt;
     the admin could login as another account, then, &amp;quot;su -&amp;quot;.  However,&lt;br /&gt;
     root can still login &amp;quot;from the local terminal&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     In the &amp;quot;/etc/ssh/sshd_config&amp;quot; file change the following lines:&lt;br /&gt;
&lt;br /&gt;
        Protocol 2&lt;br /&gt;
        PermitRootLogin no&lt;br /&gt;
        PermitEmptyPasswords no&lt;br /&gt;
&lt;br /&gt;
     Then, restart ssh&lt;br /&gt;
&lt;br /&gt;
        /etc/init.d/sshd restart&lt;br /&gt;
&lt;br /&gt;
     Why would you want to do this?  It's not possible for anyone to guess&lt;br /&gt;
     or keep trying the root account.  This is especially good for computers&lt;br /&gt;
     on the Internet. So, even if the &amp;quot;root&amp;quot; passwords is known, they can't&lt;br /&gt;
     get access to the system remotely.  Only from the terminal, which is locked&lt;br /&gt;
     in your computer room. However, if anyone has a account on the server,&lt;br /&gt;
     then, they can login under their  account then &amp;quot;su -&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Suppose you only want a limited number of users:  &amp;quot;mchirico&amp;quot; and &amp;quot;donkey&amp;quot;.&lt;br /&gt;
     Add the following line to &amp;quot;/etc/ssh/sshd_config&amp;quot;. Note, this allows access&lt;br /&gt;
     for chirico and donkey, but everyone else is denied.&lt;br /&gt;
&lt;br /&gt;
         #  Once you add AllowUsers - everyone else is denied.&lt;br /&gt;
         AllowUsers mchirico donkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 14:&lt;br /&gt;
&lt;br /&gt;
     Keep Logs Longer with Less Space.&lt;br /&gt;
&lt;br /&gt;
     Normally logs rotate monthly, over writing all the old data.  Here's a&lt;br /&gt;
     sample &amp;quot;/etc/logrotate.conf&amp;quot; that will keep 12 months of backup&lt;br /&gt;
     compressing the logfiles&lt;br /&gt;
&lt;br /&gt;
       $ cat /etc/logrotate.conf&lt;br /&gt;
&lt;br /&gt;
             # see &amp;quot;man logrotate&amp;quot; for details&lt;br /&gt;
             # rotate log files weekly&lt;br /&gt;
             #chirico changes to monthly&lt;br /&gt;
             monthly&lt;br /&gt;
&lt;br /&gt;
             # keep 4 weeks worth of backlogs&lt;br /&gt;
             # keep 12 months of backup&lt;br /&gt;
             rotate 12&lt;br /&gt;
&lt;br /&gt;
             # create new (empty) log files after rotating old ones&lt;br /&gt;
             create&lt;br /&gt;
&lt;br /&gt;
             # uncomment this if you want your log files compressed&lt;br /&gt;
             compress&lt;br /&gt;
&lt;br /&gt;
             # RPM packages drop log rotation information into this directory&lt;br /&gt;
             include /etc/logrotate.d&lt;br /&gt;
&lt;br /&gt;
             # no packages own wtmp -- we'll rotate them here&lt;br /&gt;
             /var/log/wtmp {&lt;br /&gt;
                 monthly&lt;br /&gt;
                 create 0664 root utmp&lt;br /&gt;
                 rotate 1&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
             # system-specific logs may be also be configured here.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Note: see tip 1. The clock should always be correctly set.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 15:&lt;br /&gt;
&lt;br /&gt;
     What Network Services are Running?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -atup&lt;br /&gt;
&lt;br /&gt;
     or&lt;br /&gt;
&lt;br /&gt;
          $ netstat -ap|grep LISTEN|less&lt;br /&gt;
&lt;br /&gt;
     This can be helpful to determine the services running.&lt;br /&gt;
&lt;br /&gt;
     Need stats on dropped UDP packets?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s -u&lt;br /&gt;
&lt;br /&gt;
     or TCP&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s -t&lt;br /&gt;
&lt;br /&gt;
     or summary of everything&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s&lt;br /&gt;
&lt;br /&gt;
     or looking for error rates on the interface?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -i&lt;br /&gt;
&lt;br /&gt;
     Listening interfaces?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -l&lt;br /&gt;
&lt;br /&gt;
     (Tip above provided by Amos Shapira)&lt;br /&gt;
&lt;br /&gt;
     Also see TIP 77.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 16:&lt;br /&gt;
&lt;br /&gt;
     Apache: Creating and Using an &amp;quot;.htaccess&amp;quot; File&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Below is a sample &amp;quot;.htaccess&amp;quot; file which goes in&lt;br /&gt;
     &amp;quot;/usr/local/apache/htdocs/chirico/alpha/.htaccess&amp;quot; for this&lt;br /&gt;
     example&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         AuthUserFile /usr/local/apache/htdocs/chirico/alpha/.htpasswd&lt;br /&gt;
         AuthGroupFile /dev/null&lt;br /&gt;
         AuthName &amp;quot;Your Name and regular password required&amp;quot;&lt;br /&gt;
         AuthType Basic&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;Limit GET POST&amp;gt;&lt;br /&gt;
         require valid-user&lt;br /&gt;
         &amp;lt;/Limit&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    In order for this to work /usr/local/apache/conf/httpd.conf must&lt;br /&gt;
    have the following line in it:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       #&lt;br /&gt;
       &amp;lt;Directory /usr/local/apache/htdocs/chirico/alpha&amp;gt;&lt;br /&gt;
           AllowOverride FileInfo AuthConfig Limit&lt;br /&gt;
           Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec&lt;br /&gt;
           &amp;lt;Limit GET POST OPTIONS PROPFIND&amp;gt;&lt;br /&gt;
               Order allow,deny&lt;br /&gt;
               Allow from all&lt;br /&gt;
           &amp;lt;/Limit&amp;gt;&lt;br /&gt;
           &amp;lt;LimitExcept GET POST OPTIONS PROPFIND&amp;gt;&lt;br /&gt;
               Order deny,allow&lt;br /&gt;
               Deny from all&lt;br /&gt;
           &amp;lt;/LimitExcept&amp;gt;&lt;br /&gt;
       &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Also, a password file must be created&lt;br /&gt;
&lt;br /&gt;
      $ /usr/local/apache/bin/htpasswd -c .htpasswd chirico&lt;br /&gt;
&lt;br /&gt;
    And enter the user names and passwords.&lt;br /&gt;
&lt;br /&gt;
    Next Reload Apache:&lt;br /&gt;
&lt;br /&gt;
      $ /etc/init.d/httpd reload&lt;br /&gt;
&lt;br /&gt;
    (Reference TIP 213 limit access to certain directories based on IP address).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 17:&lt;br /&gt;
&lt;br /&gt;
     Working with &amp;quot;mt&amp;quot; Commands: reading and writing to tape.&lt;br /&gt;
&lt;br /&gt;
     The following assumes the tape device is &amp;quot;/dev/st0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     STEP 1 ( rewind the tape)&lt;br /&gt;
&lt;br /&gt;
          # mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (check to see if you are at block 0)&lt;br /&gt;
&lt;br /&gt;
          # mt -f /dev/nst0 tell&lt;br /&gt;
            At block 0.&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Backup &amp;quot;tar compress&amp;quot;  directories &amp;quot;one&amp;quot;  and &amp;quot;two&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
          # tar -czf /dev/nst0 one two&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Check to see what block you are at)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
&lt;br /&gt;
       You should get something like block 2 at this point.&lt;br /&gt;
&lt;br /&gt;
     STEP 5 (Rewind the tape)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
     STEP 6 (List the files)&lt;br /&gt;
&lt;br /&gt;
           # tar -tzf /dev/nst0&lt;br /&gt;
              one/&lt;br /&gt;
              one/test&lt;br /&gt;
              two/&lt;br /&gt;
&lt;br /&gt;
     STEP 7 (Restore directory &amp;quot;one&amp;quot;  into directory &amp;quot;junk&amp;quot;).  Note, you&lt;br /&gt;
          have to first rewind the tape, since the last operation moved&lt;br /&gt;
          ahead 2 blocks. Check this with &amp;quot;mt -f /dev/nst0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           # cd junk&lt;br /&gt;
           # mt -f /dev/nst0 rewind&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
              At block 0.&lt;br /&gt;
           # tar -xzf /dev/nst0 one&lt;br /&gt;
&lt;br /&gt;
     STEP 8 (Next, take a look to see what block the tape is at)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
              At block 2.&lt;br /&gt;
&lt;br /&gt;
     STEP 9 (Now backup directories three  and four)&lt;br /&gt;
&lt;br /&gt;
           # tar -czf /dev/nst0 three four&lt;br /&gt;
&lt;br /&gt;
       After backing up the files, the tape should be past block 2.&lt;br /&gt;
       Check this.&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
             At block 4.&lt;br /&gt;
&lt;br /&gt;
          Currently the following exist:&lt;br /&gt;
&lt;br /&gt;
                At block 1:&lt;br /&gt;
                     one/&lt;br /&gt;
                    one/test&lt;br /&gt;
                    two/&lt;br /&gt;
&lt;br /&gt;
                At block 2:&lt;br /&gt;
                    three/&lt;br /&gt;
                    three/samplehere&lt;br /&gt;
                    four/&lt;br /&gt;
&lt;br /&gt;
                At block 4:&lt;br /&gt;
                    (* This is empty *)&lt;br /&gt;
&lt;br /&gt;
     A few notes. You can set the blocking factor and a label&lt;br /&gt;
     with tar. For example:&lt;br /&gt;
&lt;br /&gt;
      $ tar --label=&amp;quot;temp label&amp;quot; --create  --blocking-factor=128 --file=/dev/nst0 Notes&lt;br /&gt;
&lt;br /&gt;
     But note if you try to read it with the default, incorrect blocking&lt;br /&gt;
     factor, then, you will get the following error:&lt;br /&gt;
&lt;br /&gt;
        $ tar -t   --file=/dev/nst0&lt;br /&gt;
        tar: /dev/nst0: Cannot read: Cannot allocate memory&lt;br /&gt;
        tar: At beginning of tape, quitting now&lt;br /&gt;
        tar: Error is not recoverable: exiting now&lt;br /&gt;
&lt;br /&gt;
     However this is easily fixed with the correct blocking factor&lt;br /&gt;
&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ tar -t --blocking-factor=128 --file=/dev/nst0&lt;br /&gt;
         temp label&lt;br /&gt;
         Notes&lt;br /&gt;
&lt;br /&gt;
     Take advantage of the label command.&lt;br /&gt;
&lt;br /&gt;
         $ MYCOMMENTS=&amp;quot;Big_important_tape&amp;quot;&lt;br /&gt;
         $ tar --label=&amp;quot;$(date +%F)&amp;quot;+&amp;quot;${MYCOMMENTS}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Writing to tape on a remote 192.168.1.155 computer&lt;br /&gt;
&lt;br /&gt;
         $ tar cvzf - ./tmp | ssh -l chirico 192.168.1.155 '(mt -f /dev/nst0 rewind; dd of=/dev/st0 )'&lt;br /&gt;
&lt;br /&gt;
     Restoring the contents from tape on a remote computer&lt;br /&gt;
&lt;br /&gt;
         $ ssh -l chirico 192.168.1.155 '(mt -f /dev/nst0 rewind; dd if=/dev/st0  )'|tar xzf -&lt;br /&gt;
&lt;br /&gt;
     Getting data off of tape with dd command with odd blocking factor. Just set ibs very high&lt;br /&gt;
&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ tar --label=&amp;quot;Contenets of Notes&amp;quot; --create  --blocking-factor=128 --file=/dev/nst0 Notes&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ dd ibs=1048576 if=/dev/st0 of=notes.tar&lt;br /&gt;
&lt;br /&gt;
     The above will probably work with ibs=64k as well&lt;br /&gt;
&lt;br /&gt;
        (Also see TIP 136)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 18:&lt;br /&gt;
&lt;br /&gt;
     Encrypting Data to Tape using &amp;quot;tar&amp;quot; and &amp;quot;openssl&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     The following shows an example of writing the contents of &amp;quot;tapetest&amp;quot; to tape:&lt;br /&gt;
&lt;br /&gt;
        $ tar zcvf - tapetest|openssl des3 -salt  -k secretpassword | dd of=/dev/st0&lt;br /&gt;
&lt;br /&gt;
     Reading the data back:&lt;br /&gt;
&lt;br /&gt;
        $ dd if=/dev/st0|openssl des3 -d -k secretpassword|tar xzf -&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 19:&lt;br /&gt;
&lt;br /&gt;
     Mounting an ISO Image as a Filesystem -- this is great if you don't have the DVD&lt;br /&gt;
         hardware, but, need to get at the data.  The following show an example of&lt;br /&gt;
         mounting the Fedora core 2 as a file.&lt;br /&gt;
&lt;br /&gt;
         $ mkdir /iso0&lt;br /&gt;
         $ mount -o loop -t iso9660 /FC2-i386-DVD.iso  /iso0&lt;br /&gt;
&lt;br /&gt;
     Or to mount automatically at boot, add the following to &amp;quot;/etc/fstab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         /FC2-i386-DVD.iso /iso0     iso9660 rw,loop  0 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Reference: http://umn.dl.sourceforge.net/sourceforge/souptonuts/README_fedora.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 20:&lt;br /&gt;
&lt;br /&gt;
     Getting Information about the Hard drive and list all PCI devices.&lt;br /&gt;
&lt;br /&gt;
                $ hdparm /dev/hda&lt;br /&gt;
&lt;br /&gt;
                  /dev/hda:&lt;br /&gt;
                   multcount    = 16 (on)&lt;br /&gt;
                   IO_support   =  0 (default 16-bit)&lt;br /&gt;
                   unmaskirq    =  0 (off)&lt;br /&gt;
                   using_dma    =  1 (on)&lt;br /&gt;
                   keepsettings =  0 (off)&lt;br /&gt;
                   readonly     =  0 (off)&lt;br /&gt;
                   readahead    = 256 (on)&lt;br /&gt;
                   geometry     = 16383/255/63, sectors = 234375000, start = 0&lt;br /&gt;
&lt;br /&gt;
            or for SCSI&lt;br /&gt;
&lt;br /&gt;
                $ hdparm /dev/sda&lt;br /&gt;
&lt;br /&gt;
            Try it with the -i option for information&lt;br /&gt;
&lt;br /&gt;
                $ hdparm -i /dev/hda&lt;br /&gt;
&lt;br /&gt;
                /dev/hda:&lt;br /&gt;
&lt;br /&gt;
                Model=IC35L120AVV207-1, FwRev=V24OA66A, SerialNo=VNVD09G4CZ6E0T&lt;br /&gt;
                Config={ HardSect NotMFM HdSw&amp;gt;15uSec Fixed DTR&amp;gt;10Mbs }&lt;br /&gt;
                RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=52&lt;br /&gt;
                BuffType=DualPortCache, BuffSize=7965kB, MaxMultSect=16, MultSect=16&lt;br /&gt;
                CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=234375000&lt;br /&gt;
                IORDY=on/off, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}&lt;br /&gt;
                PIO modes:  pio0 pio1 pio2 pio3 pio4&lt;br /&gt;
                DMA modes:  mdma0 mdma1 mdma2&lt;br /&gt;
                UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5&lt;br /&gt;
                AdvancedPM=yes: disabled (255) WriteCache=enabled&lt;br /&gt;
                Drive conforms to: ATA/ATAPI-6 T13 1410D revision 3a:  2 3 4 5 6&lt;br /&gt;
&lt;br /&gt;
            How fast is your drive?&lt;br /&gt;
&lt;br /&gt;
                $ hdparm -tT /dev/hda&lt;br /&gt;
&lt;br /&gt;
                /dev/hda:&lt;br /&gt;
                Timing buffer-cache reads:   128 MB in  0.41 seconds =315.32 MB/sec&lt;br /&gt;
                Timing buffered disk reads:  64 MB in  1.19 seconds = 53.65 MB/sec&lt;br /&gt;
&lt;br /&gt;
            Need to find your device?&lt;br /&gt;
&lt;br /&gt;
                $ mount&lt;br /&gt;
                   or&lt;br /&gt;
                $ cat /proc/partitions&lt;br /&gt;
                   or&lt;br /&gt;
                $ dmesg | egrep '^(s|h)d'&lt;br /&gt;
&lt;br /&gt;
                   which for my system lists:&lt;br /&gt;
&lt;br /&gt;
                      hda: IC35L120AVV207-1, ATA DISK drive&lt;br /&gt;
                      hdc: Lite-On LTN486S 48x Max, ATAPI CD/DVD-ROM drive&lt;br /&gt;
                      hda: max request size: 1024KiB&lt;br /&gt;
                      hda: 234375000 sectors (120000 MB) w/7965KiB Cache, CHS=16383/255/63, UDMA(100)&lt;br /&gt;
&lt;br /&gt;
             By the way, if you want to turn on dma&lt;br /&gt;
&lt;br /&gt;
                 $ hdparm -d1 /dev/hda&lt;br /&gt;
                   setting using_dma to 1 (on)&lt;br /&gt;
                   using_dma    =  1 (on)&lt;br /&gt;
&lt;br /&gt;
         (Also see TIP 122 )&lt;br /&gt;
&lt;br /&gt;
     List all PCI devices&lt;br /&gt;
&lt;br /&gt;
                $ lspci -v&lt;br /&gt;
&lt;br /&gt;
          00:00.0 Host bridge: Intel Corp. 82845G/GL [Brookdale-G] Chipset Host Bridge (rev&lt;br /&gt;
                  Subsystem: Dell Computer Corporation: Unknown device 0160&lt;br /&gt;
                  Flags: bus master, fast devsel, latency 0&lt;br /&gt;
                  Memory at f0000000 (32-bit, prefetchable) [size=128M]&lt;br /&gt;
                  Capabilities: &amp;lt;available only to root&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              ... lots more ...&lt;br /&gt;
&lt;br /&gt;
           Note, there is also lspci -vv for even more information.&lt;br /&gt;
&lt;br /&gt;
          (Also see TIP 200)&lt;br /&gt;
&lt;br /&gt;
TIP 21:&lt;br /&gt;
&lt;br /&gt;
     Setting up &amp;quot;cron&amp;quot; Jobs.&lt;br /&gt;
&lt;br /&gt;
     If you want to use the emacs editor for editing cron jobs, then,&lt;br /&gt;
     set the following in your &amp;quot;/home/user/.bash_profile&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        EDITOR=emacs&lt;br /&gt;
&lt;br /&gt;
     Then, to edit cron jobs&lt;br /&gt;
&lt;br /&gt;
        $ crontab -e&lt;br /&gt;
&lt;br /&gt;
     You may want to put in the following header&lt;br /&gt;
&lt;br /&gt;
        #MINUTE(0-59) HOUR(0-23) DAYOFMONTH(1-31) MONTHOFYEAR(1-12) DAYOFWEEK(0-6) Note 0=Sun and 7=Sun&lt;br /&gt;
        #&lt;br /&gt;
        #14,15 10 * * 0   /usr/bin/somecommmand  &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     The sample &amp;quot;commented out command&amp;quot; will run at 10:14 and 10:15 every Sunday.  There will&lt;br /&gt;
     be no &amp;quot;mail&amp;quot; sent to the user because of the &amp;quot;&amp;gt;/dev/null 2&amp;gt;&amp;amp;1&amp;quot; entry.&lt;br /&gt;
&lt;br /&gt;
        $ crontab -l&lt;br /&gt;
&lt;br /&gt;
     The above will list all cron jobs. Or if you're root&lt;br /&gt;
&lt;br /&gt;
        $ crontab -l -u &amp;lt;username&amp;gt;&lt;br /&gt;
        $ crontab -e -u &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Reference &amp;quot;man 5 crontab&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
        The time and date fields are:&lt;br /&gt;
&lt;br /&gt;
                     field          allowed values&lt;br /&gt;
                     -----          --------------&lt;br /&gt;
                     minute         0-59&lt;br /&gt;
                     hour           0-23&lt;br /&gt;
                     day of month   1-31&lt;br /&gt;
                     month          1-12 (or names, see below)&lt;br /&gt;
                     day of week    0-7 (0 or 7 is Sun, or use names)&lt;br /&gt;
&lt;br /&gt;
              A field may be an asterisk (*), which always stands for ``first-last''.&lt;br /&gt;
&lt;br /&gt;
              Ranges of numbers are allowed.  Ranges are two numbers separated with a&lt;br /&gt;
              hyphen.   The  specified  range is inclusive.  For example, 8-11 for an&lt;br /&gt;
              ``hours'' entry specifies execution at hours 8, 9, 10 and 11.&lt;br /&gt;
&lt;br /&gt;
              Lists are allowed.  A list is a set of numbers (or ranges) separated by&lt;br /&gt;
              commas.  Examples: ``1,2,5,9'', ``0-4,8-12''.&lt;br /&gt;
&lt;br /&gt;
              Ranges can include &amp;quot;steps&amp;quot;, so &amp;quot;1-9/2&amp;quot; is the same as &amp;quot;1,3,5,7,9&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Note, you can run just every 5 minutes as follows:&lt;br /&gt;
&lt;br /&gt;
              */5 * * * * /etc/mrtg/domrtg  &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     To run jobs hourly,daily,weekly or monthly you can add shell scripts into the&lt;br /&gt;
     appropriate directory:&lt;br /&gt;
&lt;br /&gt;
             /etc/cron.hourly/&lt;br /&gt;
             /etc/cron.daily/&lt;br /&gt;
             /etc/cron.weekly/&lt;br /&gt;
             /etc/cron.monthly/&lt;br /&gt;
&lt;br /&gt;
     Note that the above are pre-configured schedules set in &amp;quot;/etc/crontab&amp;quot;, so&lt;br /&gt;
     if you want, you can change the schedule. Below is my /etc/crontab:&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/crontab&lt;br /&gt;
           SHELL=/bin/bash&lt;br /&gt;
           PATH=/sbin:/bin:/usr/sbin:/usr/bin&lt;br /&gt;
           MAILTO=root&lt;br /&gt;
           HOME=/&lt;br /&gt;
&lt;br /&gt;
           # run-parts&lt;br /&gt;
           01 * * * * root run-parts /etc/cron.hourly&lt;br /&gt;
           02 4 * * * root run-parts /etc/cron.daily&lt;br /&gt;
           22 4 * * 0 root run-parts /etc/cron.weekly&lt;br /&gt;
           42 4 1 * * root run-parts /etc/cron.monthly&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 22:&lt;br /&gt;
&lt;br /&gt;
     Keeping Files in Sync Between Servers.&lt;br /&gt;
&lt;br /&gt;
     The remote computer is &amp;quot;192.168.1.171&amp;quot; and has the account &amp;quot;donkey&amp;quot;.  You want&lt;br /&gt;
     to &amp;quot;keep in sync&amp;quot; the files under &amp;quot;/home/cu2000/Logs&amp;quot; on the remote computer&lt;br /&gt;
     with files on &amp;quot;/home/chirico/dev/MEDIA_Server&amp;quot; on the local computer.&lt;br /&gt;
&lt;br /&gt;
       $ rsync  -Lae ssh  donkey@192.168.1.171:/home/cu2000/Logs /home/chirico/dev/MEDIA_Server&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;rsync&amp;quot; is a convient command for keeping files in sync, and as shown here will work&lt;br /&gt;
     through ssh.  The -L option tells rsync to treat symbolic links like ordinary files.&lt;br /&gt;
&lt;br /&gt;
        Also see [http://www.rsnapshot.org/]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 23:&lt;br /&gt;
&lt;br /&gt;
     Looking up the Spelling of a Word.&lt;br /&gt;
&lt;br /&gt;
        $ look &amp;lt;partial spelling&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     so the following will list all words that&lt;br /&gt;
     start with stuff&lt;br /&gt;
&lt;br /&gt;
        $ look stuff&lt;br /&gt;
           stuff&lt;br /&gt;
           stuffage&lt;br /&gt;
           stuffata&lt;br /&gt;
           stuffed&lt;br /&gt;
           stuffender&lt;br /&gt;
           stuffer&lt;br /&gt;
           stuffers&lt;br /&gt;
           stuffgownsman&lt;br /&gt;
           stuffier&lt;br /&gt;
           stuffiest&lt;br /&gt;
           stuffily&lt;br /&gt;
           stuffiness&lt;br /&gt;
           stuffinesses&lt;br /&gt;
           stuffiness's&lt;br /&gt;
           stuffing&lt;br /&gt;
           stuffings&lt;br /&gt;
           stuffing's&lt;br /&gt;
           stuffless&lt;br /&gt;
           stuffs&lt;br /&gt;
           stuffy&lt;br /&gt;
&lt;br /&gt;
     It helps to have a large &amp;quot;linuxwords&amp;quot; dictionary.  You can download&lt;br /&gt;
     a much bigger dictionary from the following:&lt;br /&gt;
&lt;br /&gt;
              http://prdownloads.sourceforge.net/souptonuts/linuxwords.1.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
     Note: vim users can setup the .vimrc file with the following. Now when you type &lt;br /&gt;
       CTL-X CTL-T in insert mode, you'll get a thesaurus lookup.&lt;br /&gt;
&lt;br /&gt;
           set dictionary+=/usr/share/dict/words&lt;br /&gt;
           set thesaurus+=/usr/share/dict/words&lt;br /&gt;
&lt;br /&gt;
     Or, you can call aspell with the F6 command after putting the folling entry in your&lt;br /&gt;
     .vimrc file&lt;br /&gt;
&lt;br /&gt;
           :nmap &amp;lt;F6&amp;gt; :w&amp;lt;CR&amp;gt;:!aspell -e -c %&amp;lt;CR&amp;gt;:e&amp;lt;CR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Now, hit F6 when you're in vim, and you'll get a spell checker.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     There is also an X Windows dictionary that runs with the following command.&lt;br /&gt;
&lt;br /&gt;
           $ gnome-dictionary&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 24:&lt;br /&gt;
&lt;br /&gt;
     Find out if a Command is Aliased.&lt;br /&gt;
&lt;br /&gt;
         $ type -all &amp;lt;command&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Example:&lt;br /&gt;
&lt;br /&gt;
         $ type -all ls&lt;br /&gt;
            ls is aliased to `ls --color=tty'&lt;br /&gt;
            ls is /bin/ls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 25:&lt;br /&gt;
&lt;br /&gt;
     Create a Terminal Calculator&lt;br /&gt;
&lt;br /&gt;
      Put the following in your .bashrc file&lt;br /&gt;
&lt;br /&gt;
            function calc&lt;br /&gt;
            {&lt;br /&gt;
             echo &amp;quot;${1}&amp;quot;|bc -l;&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
      Or, run it at the shell prompt. Now&lt;br /&gt;
      &amp;quot;calc&amp;quot; from the shell will work as follows:&lt;br /&gt;
&lt;br /&gt;
            $ calc 3+45&lt;br /&gt;
               48&lt;br /&gt;
&lt;br /&gt;
      All functions  with a &amp;quot;(&amp;quot; or &amp;quot;)&amp;quot; must be enclosed&lt;br /&gt;
      in quotes.  For instance, to get the sin of .4&lt;br /&gt;
&lt;br /&gt;
            $ calc &amp;quot;s(.4)&amp;quot;&lt;br /&gt;
              .38941834230865049166&lt;br /&gt;
&lt;br /&gt;
          (See TIP 115 using the expr command)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 26:&lt;br /&gt;
&lt;br /&gt;
     Kill a User and All Their Current Processes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        #  This program will kill all processes from a&lt;br /&gt;
        #  user.  The user name is read from the command line.&lt;br /&gt;
        #&lt;br /&gt;
        #  This program also demonstrates reading a bash variable&lt;br /&gt;
        #  into an awk script.&lt;br /&gt;
        #&lt;br /&gt;
        #  Usage: kill9user &amp;lt;user&amp;gt;&lt;br /&gt;
        #&lt;br /&gt;
        kill -9 `ps aux|awk -v var=$1 '$1==var { print $2 }'`&lt;br /&gt;
&lt;br /&gt;
    or if you want want to create the above script the command&lt;br /&gt;
    below will kill the user &amp;quot;donkey&amp;quot; and all of his processes.&lt;br /&gt;
&lt;br /&gt;
        $ kill -9 `ps aux|awk -v var=&amp;quot;donkey&amp;quot; '$1==var { print $2 }'`&lt;br /&gt;
&lt;br /&gt;
    Check their cron jobs and &amp;quot;at&amp;quot; jobs, if you have a security issue.&lt;br /&gt;
&lt;br /&gt;
          $ crontab -u &amp;lt;user&amp;gt; -e&lt;br /&gt;
&lt;br /&gt;
    Lock the account:&lt;br /&gt;
&lt;br /&gt;
          $ passwd -l &amp;lt;user&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Remove all authorized_keys&lt;br /&gt;
&lt;br /&gt;
          $ rm /home/user/.shosts&lt;br /&gt;
          $ rm /home/user/.rhosts&lt;br /&gt;
          $ rm -rf /home/user/.ssh&lt;br /&gt;
          $ rm /home/user/.forward&lt;br /&gt;
&lt;br /&gt;
      or consider&lt;br /&gt;
&lt;br /&gt;
          $ mv /home/user  /home/safeuser&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Change the shell&lt;br /&gt;
&lt;br /&gt;
          $ chsh -s /bin/true &amp;lt;user&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Do an inventory&lt;br /&gt;
&lt;br /&gt;
          $ find / -user &amp;lt;user&amp;gt;  &amp;gt; list_of_user_files&lt;br /&gt;
&lt;br /&gt;
    NOTE: Also see (TIP 10).&lt;br /&gt;
&lt;br /&gt;
    To see all users, except the current user. Do not use the&lt;br /&gt;
    dash &amp;quot;ps -aux&amp;quot; is wrong but the following is correct:&lt;br /&gt;
&lt;br /&gt;
          $ ps aux| awk '!/'${USER}'/{printf(&amp;quot;%s \n&amp;quot;,$0)}'&lt;br /&gt;
&lt;br /&gt;
     or (ww = wide, wide output)&lt;br /&gt;
&lt;br /&gt;
          $ ps auwwx| awk '!/'${USER}'/{printf(&amp;quot;%s \n&amp;quot;,$0)}'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    The following codes may be useful:&lt;br /&gt;
&lt;br /&gt;
       D    Uninterruptible sleep (usually IO)&lt;br /&gt;
       R    Running or runnable (on run queue)&lt;br /&gt;
       S    Interruptible sleep (waiting for an event to complete)&lt;br /&gt;
       T    Stopped, either by a job control signal or because it is being traced.&lt;br /&gt;
       W    paging (not valid since the 2.6.xx kernel)&lt;br /&gt;
       X    dead (should never be seen)&lt;br /&gt;
       Z    Defunct (&amp;quot;zombie&amp;quot;) process, terminated but not reaped by its parent.&lt;br /&gt;
&lt;br /&gt;
    For BSD formats and when the stat keyword is used, additional&lt;br /&gt;
       characters may be displayed:&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;    high-priority (not nice to other users)&lt;br /&gt;
       N    low-priority (nice to other users)&lt;br /&gt;
       L    has pages locked into memory (for real-time and custom IO)&lt;br /&gt;
       s    is a session leader&lt;br /&gt;
       l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)&lt;br /&gt;
       +    is in the foreground process group&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Also see TIP 28. and TIP 89.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 27:&lt;br /&gt;
&lt;br /&gt;
     Format Dates for Logs and Files&lt;br /&gt;
&lt;br /&gt;
         $ date &amp;quot;+%m%d%y %A,%B %d %Y %X&amp;quot;&lt;br /&gt;
             061704 Thursday,June 17 2004 07:13:40 PM&lt;br /&gt;
&lt;br /&gt;
         $ date &amp;quot;+%m%d%Y&amp;quot;&lt;br /&gt;
             06172004&lt;br /&gt;
&lt;br /&gt;
         $ date -d '1 day ago' &amp;quot;+%m%d%Y&amp;quot;&lt;br /&gt;
             06162004&lt;br /&gt;
&lt;br /&gt;
         $ date -d '3 months 1 day  2 hour  15 minutes 2 seconds ago'&lt;br /&gt;
&lt;br /&gt;
      or to go into the future remove the &amp;quot;ago&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         $ date -d '3 months 1 day  2 hour  15 minutes 2 seconds '&lt;br /&gt;
&lt;br /&gt;
            Also the following works:&lt;br /&gt;
&lt;br /&gt;
                $ date -d '+2 year +1 month -1 week  +3 day -8 hour +2 min -5 seconds'&lt;br /&gt;
&lt;br /&gt;
      Quick question: If there are 100,000,000 stars in the visible sky, and you can&lt;br /&gt;
      count them, round the clock, at a rate of a star per second starting now, when&lt;br /&gt;
      would you finish counting?  Would you still be alive?&lt;br /&gt;
&lt;br /&gt;
                $ date -d '+100000000 seconds'&lt;br /&gt;
&lt;br /&gt;
      Sooner than you think!&lt;br /&gt;
&lt;br /&gt;
      This can be assigned to variables&lt;br /&gt;
&lt;br /&gt;
         $ mdate=`date -d '3 months 1 day  2 hour  15 minutes 2 seconds ' &amp;quot;+%m%d%Y_%A_%B_%D_%Y_%X&amp;quot;  `&lt;br /&gt;
         $ echo $mdate&lt;br /&gt;
             09182004_Saturday_September_09/18/04_2004_09:40:41 PM&lt;br /&gt;
             ^---- Easy to sort   ^-------^----- Easy to read&lt;br /&gt;
&lt;br /&gt;
      See TIP 28 below.&lt;br /&gt;
&lt;br /&gt;
      See TIP 87 when working with large delta time changes -40 years, or -200 years ago, or even&lt;br /&gt;
      1,000,000 days into the future.&lt;br /&gt;
&lt;br /&gt;
      Also see (TIP 1) for working with time zones.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 28:&lt;br /&gt;
&lt;br /&gt;
     Need Ascii Codes? For instance, for printing quotes:&lt;br /&gt;
&lt;br /&gt;
                         awk 'BEGIN { msg = &amp;quot;Don\047t Panic!&amp;quot;; printf &amp;quot;%s \n&amp;quot;,msg }'&lt;br /&gt;
              or&lt;br /&gt;
                         awk 'BEGIN { msg = &amp;quot;Don\x027t Panic!&amp;quot;; printf &amp;quot;%s \n&amp;quot;,msg }'&lt;br /&gt;
&lt;br /&gt;
     It's better to use \047, because certain characters that follow \x027 may cause problems.&lt;br /&gt;
&lt;br /&gt;
     For example, take a look at the following two lines. The first line prints a &amp;quot;}&amp;quot; caused&lt;br /&gt;
     by the extra D in \x027D. The the line immediately below does not work as expected.&lt;br /&gt;
&lt;br /&gt;
                      awk 'BEGIN {printf(&amp;quot;The D causes problems \x027D\n&amp;quot;)}'&lt;br /&gt;
&lt;br /&gt;
            However, the line below works fine:&lt;br /&gt;
&lt;br /&gt;
                      awk 'BEGIN {printf(&amp;quot;The D does not cause problems \047D\n&amp;quot;)}'&lt;br /&gt;
&lt;br /&gt;
     Or if you wanted to use the date command in &amp;quot;awk&amp;quot; to print date.time.nanosecond.timezone for&lt;br /&gt;
     each line of a file &amp;quot;test&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     The following date can be used in awk because the single quotes are enclosed within the&lt;br /&gt;
     double quotes.&lt;br /&gt;
&lt;br /&gt;
             date '+%m%d%Y.%H%M%S.%N%z'&lt;br /&gt;
&lt;br /&gt;
       $ awk 'BEGIN { &amp;quot;date '+%m%d%Y.%H%M%S.%N%z'&amp;quot; | getline MyDate  } { print MyDate,$0 }' &amp;lt; data&lt;br /&gt;
&lt;br /&gt;
     But it's also possible to replace  &amp;quot;+&amp;quot;  with  \x2B,  &amp;quot;%&amp;quot; with \x25, and &amp;quot;d&amp;quot; with \x64 as follows:&lt;br /&gt;
&lt;br /&gt;
       $ awk 'BEGIN { &amp;quot;date \x27\x2B\x25m\x25\x64\x25Y.\x25H\x25M\x25S.\x25N\x25z\x27&amp;quot; | getline MyDate  } { print MyDate,$0 }' &amp;lt; test&lt;br /&gt;
&lt;br /&gt;
             07062004.113820.346033000-0400 bob 71&lt;br /&gt;
             07062004.113820.346033000-0400 tom 43&lt;br /&gt;
             07062004.113820.346033000-0400 sal 34&lt;br /&gt;
             07062004.113820.346033000-0400 bob 89&lt;br /&gt;
             07062004.113820.346033000-0400 tom 66&lt;br /&gt;
             07062004.113820.346033000-0400 sal 99&lt;br /&gt;
&lt;br /&gt;
     For this example it's not needed because single quotes are used inside of double quotes; however, there may be times when&lt;br /&gt;
     hex replacement is easier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ man ascii&lt;br /&gt;
&lt;br /&gt;
        Oct   Dec   Hex   Char           Oct   Dec   Hex   Char&lt;br /&gt;
            -----------------------------------------------------------&lt;br /&gt;
            000   0     00    NUL '\0'       100   64    40    @&lt;br /&gt;
            001   1     01    SOH            101   65    41    A&lt;br /&gt;
            002   2     02    STX            102   66    42    B&lt;br /&gt;
            003   3     03    ETX            103   67    43    C&lt;br /&gt;
            004   4     04    EOT            104   68    44    D&lt;br /&gt;
            005   5     05    ENQ            105   69    45    E&lt;br /&gt;
            006   6     06    ACK            106   70    46    F&lt;br /&gt;
            007   7     07    BEL '\a'       107   71    47    G&lt;br /&gt;
            010   8     08    BS  '\b'       110   72    48    H&lt;br /&gt;
            011   9     09    HT  '\t'       111   73    49    I&lt;br /&gt;
            012   10    0A    LF  '\n'       112   74    4A    J&lt;br /&gt;
            013   11    0B    VT  '\v'       113   75    4B    K&lt;br /&gt;
            014   12    0C    FF  '\f'       114   76    4C    L&lt;br /&gt;
            015   13    0D    CR  '\r'       115   77    4D    M&lt;br /&gt;
            016   14    0E    SO             116   78    4E    N&lt;br /&gt;
            017   15    0F    SI             117   79    4F    O&lt;br /&gt;
            020   16    10    DLE            120   80    50    P&lt;br /&gt;
            021   17    11    DC1            121   81    51    Q&lt;br /&gt;
            022   18    12    DC2            122   82    52    R&lt;br /&gt;
            023   19    13    DC3            123   83    53    S&lt;br /&gt;
            024   20    14    DC4            124   84    54    T&lt;br /&gt;
            025   21    15    NAK            125   85    55    U&lt;br /&gt;
            026   22    16    SYN            126   86    56    V&lt;br /&gt;
            027   23    17    ETB            127   87    57    W&lt;br /&gt;
            030   24    18    CAN            130   88    58    X&lt;br /&gt;
            031   25    19    EM             131   89    59    Y&lt;br /&gt;
            032   26    1A    SUB            132   90    5A    Z&lt;br /&gt;
            033   27    1B    ESC            133   91    5B    [&lt;br /&gt;
            034   28    1C    FS             134   92    5C    \   '\\'&lt;br /&gt;
            035   29    1D    GS             135   93    5D    ]&lt;br /&gt;
            036   30    1E    RS             136   94    5E    ^&lt;br /&gt;
            037   31    1F    US             137   95    5F    _&lt;br /&gt;
            040   32    20    SPACE          140   96    60    `&lt;br /&gt;
            041   33    21    !              141   97    61    a&lt;br /&gt;
            042   34    22    &amp;quot;              142   98    62    b&lt;br /&gt;
            043   35    23    #              143   99    63    c&lt;br /&gt;
            044   36    24    $              144   100   64    d&lt;br /&gt;
            045   37    25    %              145   101   65    e&lt;br /&gt;
            046   38    26    &amp;amp;              146   102   66    f&lt;br /&gt;
            047   39    27    '              147   103   67    g&lt;br /&gt;
            050   40    28    (              150   104   68    h&lt;br /&gt;
            051   41    29    )              151   105   69    i&lt;br /&gt;
            052   42    2A    *              152   106   6A    j&lt;br /&gt;
            053   43    2B    +              153   107   6B    k&lt;br /&gt;
            054   44    2C    ,              154   108   6C    l&lt;br /&gt;
            055   45    2D    -              155   109   6D    m&lt;br /&gt;
            056   46    2E    .              156   110   6E    n&lt;br /&gt;
            057   47    2F    /              157   111   6F    o&lt;br /&gt;
            060   48    30    0              160   112   70    p&lt;br /&gt;
            061   49    31    1              161   113   71    q&lt;br /&gt;
            062   50    32    2              162   114   72    r&lt;br /&gt;
            063   51    33    3              163   115   73    s&lt;br /&gt;
            064   52    34    4              164   116   74    t&lt;br /&gt;
            065   53    35    5              165   117   75    u&lt;br /&gt;
            066   54    36    6              166   118   76    v&lt;br /&gt;
            067   55    37    7              167   119   77    w&lt;br /&gt;
            070   56    38    8              170   120   78    x&lt;br /&gt;
            071   57    39    9              171   121   79    y&lt;br /&gt;
            072   58    3A    :              172   122   7A    z&lt;br /&gt;
            073   59    3B    ;              173   123   7B    {&lt;br /&gt;
            074   60    3C    &amp;lt;              174   124   7C    |&lt;br /&gt;
            075   61    3D    =              175   125   7D    }&lt;br /&gt;
            076   62    3E    &amp;gt;              176   126   7E    ~&lt;br /&gt;
            077   63    3F    ?              177   127   7F    DEL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 29:&lt;br /&gt;
&lt;br /&gt;
     Need a WWW Browser for the Terminal Session? Try lynx or elinks.&lt;br /&gt;
&lt;br /&gt;
         $ lynx&lt;br /&gt;
&lt;br /&gt;
     Or to read all these tips, with the latest updates&lt;br /&gt;
&lt;br /&gt;
      $ lynx http://umn.dl.sourceforge.net/sourceforge/souptonuts/How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Or, better yet elinks.&lt;br /&gt;
&lt;br /&gt;
         $ elinks http://somepage.&lt;br /&gt;
&lt;br /&gt;
     You can get elinks at the following site:&lt;br /&gt;
&lt;br /&gt;
             http://elinks.or.cz/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 30:&lt;br /&gt;
&lt;br /&gt;
    screen - screen manager with VT100/ANSI terminal emulation&lt;br /&gt;
&lt;br /&gt;
         This is an excellent utility. But if you work a lot in Emacs,&lt;br /&gt;
         then, you should place the following in your ~./.bashrc&lt;br /&gt;
&lt;br /&gt;
             alias s='screen -e^Pa -D -R'&lt;br /&gt;
&lt;br /&gt;
         After loging in again (or source .bashrc) ,&lt;br /&gt;
         type the following to load &amp;quot;screen&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
             $ s&lt;br /&gt;
&lt;br /&gt;
         If you're using the not using the alias command above, substitute&lt;br /&gt;
         CTL-a for CTL-p below. :&lt;br /&gt;
&lt;br /&gt;
             CTL-p CTL-C       To get a new session&lt;br /&gt;
             CTL-p  &amp;quot;           To list sessions, and arrow keys to move&lt;br /&gt;
             CTL-p SHFT-A      To name sessions&lt;br /&gt;
             CTL-p S            To split screens&lt;br /&gt;
             CLT-p Q            To unsplit screens&lt;br /&gt;
             CLT-p TAB          To switch between screens&lt;br /&gt;
             CLT-p :resize n    To resize screen to n rows, on split screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Screen is very powerful.  Should you become disconneced, you can&lt;br /&gt;
         still resume work after loggin in.&lt;br /&gt;
&lt;br /&gt;
             $ man screen&lt;br /&gt;
&lt;br /&gt;
         The above command will give you more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 31:&lt;br /&gt;
&lt;br /&gt;
     Need to Find the Factors of a Number?&lt;br /&gt;
&lt;br /&gt;
           $ factor 2345678992&lt;br /&gt;
                2345678992: 2 2 2 2 6581 22277&lt;br /&gt;
&lt;br /&gt;
     It's a quick way to find out if a number is prime&lt;br /&gt;
&lt;br /&gt;
           $ factor 7867&lt;br /&gt;
                7867: 7867&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 32:&lt;br /&gt;
&lt;br /&gt;
     Less is More -- piping to less to scroll backword and forward&lt;br /&gt;
&lt;br /&gt;
      For large &amp;quot;ls&amp;quot; listings try the followin, then, use the arrow key&lt;br /&gt;
      to move up and down the list.&lt;br /&gt;
&lt;br /&gt;
           $ ls /some_large_dir/ | less&lt;br /&gt;
&lt;br /&gt;
                 or&lt;br /&gt;
&lt;br /&gt;
           $ cat some_large_file | less&lt;br /&gt;
&lt;br /&gt;
                 or&lt;br /&gt;
&lt;br /&gt;
           $ less some_large_file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 33:&lt;br /&gt;
&lt;br /&gt;
     C &amp;quot;indent&amp;quot; Settings for Kernel Development&lt;br /&gt;
&lt;br /&gt;
           $ indent -kr -i8  program.c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 34:&lt;br /&gt;
&lt;br /&gt;
     FTP auto-login.  &amp;quot;ftp&amp;quot; to a site and have the password stored.&lt;br /&gt;
&lt;br /&gt;
     For instance, here's a sample &amp;quot;.net&amp;quot; file in a user's home&lt;br /&gt;
     directory for uploading to sourceforge. Note, sourceforge will&lt;br /&gt;
     take any password, so m@temp.com is used here for login &amp;quot;anonymous&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ cat ~/.netrc&lt;br /&gt;
               machine upload.sourceforge.net login anonymous password m@temp.com&lt;br /&gt;
               default login anonymous password user@site&lt;br /&gt;
&lt;br /&gt;
     It might be a good idea to change the rights on this file&lt;br /&gt;
&lt;br /&gt;
           $ chmod 0400 ~/.netrc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         #!/bin/bash&lt;br /&gt;
         #&lt;br /&gt;
         #  Sample ftp automated script to download&lt;br /&gt;
         #  file to ${dwnld}&lt;br /&gt;
         #&lt;br /&gt;
         dwnld=&amp;quot;/work/faq/unix-faq&amp;quot;&lt;br /&gt;
         cd ${dwnld}&lt;br /&gt;
         ftp &amp;lt;&amp;lt; FTPSTRING&lt;br /&gt;
         prompt off&lt;br /&gt;
         open rtfm.mit.edu&lt;br /&gt;
         cd /pub/usenet-by-group/news.answers/unix-faq/faq&lt;br /&gt;
         mget contents&lt;br /&gt;
         mget diff&lt;br /&gt;
         mget part*&lt;br /&gt;
         bye&lt;br /&gt;
         FTPSTRING&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      (Also see TIP 114 for ncftpget, which is a very powerful restarting&lt;br /&gt;
                            ftp program)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 35:&lt;br /&gt;
&lt;br /&gt;
     Bash Brace Expansion&lt;br /&gt;
&lt;br /&gt;
           $ echo f{ee,ie,oe,um}&lt;br /&gt;
                fee fie foe fum&lt;br /&gt;
&lt;br /&gt;
     This works with almost any command&lt;br /&gt;
&lt;br /&gt;
           $ mkdir -p /work/junk/{one,two,three,four}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 36:&lt;br /&gt;
&lt;br /&gt;
     Getting a List of Users on the System&lt;br /&gt;
&lt;br /&gt;
           $ cut -d: -f1 /etc/passwd | sort&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 37:&lt;br /&gt;
&lt;br /&gt;
     Editing a Bash Command&lt;br /&gt;
&lt;br /&gt;
      Try typing a long command say, then, type &amp;quot;fc&amp;quot; for an easy way&lt;br /&gt;
      to edit the command.&lt;br /&gt;
&lt;br /&gt;
           $ find /etc -iname '*.cnf' -exec grep -H 'log' {} \;&lt;br /&gt;
           $ fc&lt;br /&gt;
&lt;br /&gt;
      &amp;quot;fc&amp;quot; will bring the last command typed into an editor, &amp;quot;emacs&amp;quot; if&lt;br /&gt;
      that's the default editor. Type &amp;quot;fc -l&amp;quot; to list last few commands.&lt;br /&gt;
&lt;br /&gt;
      To seach for a command, try typing &amp;quot;CTL-r&amp;quot; at the shell prompt for&lt;br /&gt;
      searching. &amp;quot;CTL-t&amp;quot; to transpose, say &amp;quot;sl&amp;quot; was typed by you want &amp;quot;ls&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Hints when using &amp;quot;fc: in emacs:&lt;br /&gt;
&lt;br /&gt;
           ESC-b     move one word backward&lt;br /&gt;
           ESC-f     move one word forward&lt;br /&gt;
           ESC-DEL   kill one word backward&lt;br /&gt;
           CTL-k     kill point to end&lt;br /&gt;
           CTL-y     un-yank killed region at point&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 38:&lt;br /&gt;
&lt;br /&gt;
     Moving around Directories.&lt;br /&gt;
&lt;br /&gt;
     Change to the home directory:&lt;br /&gt;
          $ cd ~&lt;br /&gt;
            or&lt;br /&gt;
          $ cd&lt;br /&gt;
&lt;br /&gt;
     To go back to the last directory&lt;br /&gt;
          $ cd -&lt;br /&gt;
&lt;br /&gt;
     Instead of &amp;quot;cd&amp;quot; to a directory try &amp;quot;pushd&amp;quot; and look&lt;br /&gt;
     at the heading...you can see a list of directories.&lt;br /&gt;
&lt;br /&gt;
          $ pushd /etc&lt;br /&gt;
          $ pushd /usr/local&lt;br /&gt;
&lt;br /&gt;
      Then, to get back &amp;quot;popd&amp;quot; or &amp;quot;popd 1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      To list all the directories pushed on the stack&lt;br /&gt;
      use the &amp;quot;dirs -v&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
          $ dirs -v&lt;br /&gt;
           0  /usr/local&lt;br /&gt;
           1  /etc&lt;br /&gt;
           2  /work/souptonuts/documentation/theBook&lt;br /&gt;
&lt;br /&gt;
      Now, if you &amp;quot;pushd +1&amp;quot; you will be moved to &amp;quot;/etc&amp;quot;, since&lt;br /&gt;
      is number &amp;quot;1&amp;quot; on the stack, and this directory will become&lt;br /&gt;
      &amp;quot;0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ pwd&lt;br /&gt;
           /usr/local&lt;br /&gt;
          $ pushd +1&lt;br /&gt;
          $ pwd&lt;br /&gt;
           /etc&lt;br /&gt;
&lt;br /&gt;
          $ dirs -v&lt;br /&gt;
           0  /etc&lt;br /&gt;
           1  /work/souptonuts/documentation/theBook&lt;br /&gt;
           2  /usr/local&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 39:&lt;br /&gt;
&lt;br /&gt;
     Need an Underscore after a Variable?&lt;br /&gt;
&lt;br /&gt;
       Enclose the variable in &amp;quot;{}&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $echo ${UID}_&lt;br /&gt;
&lt;br /&gt;
       Compare to&lt;br /&gt;
&lt;br /&gt;
          $echo $UID_&lt;br /&gt;
&lt;br /&gt;
       Also try the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ m=&amp;quot;my stuff here&amp;quot;&lt;br /&gt;
                $ echo -e ${m// /'\n'}&lt;br /&gt;
                        my&lt;br /&gt;
                        stuff&lt;br /&gt;
                        here&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 40:&lt;br /&gt;
&lt;br /&gt;
     Bash Variable Offset and String Operators&lt;br /&gt;
&lt;br /&gt;
        $ r=&amp;quot;this is stuff&amp;quot;&lt;br /&gt;
        $ echo ${r:3}&lt;br /&gt;
        $ echo ${r:5:2}&lt;br /&gt;
&lt;br /&gt;
      Note, ${varname:offset:length}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         ${varname:?message}  If varname exist and isn't null return value, else,&lt;br /&gt;
                              print var and message.&lt;br /&gt;
&lt;br /&gt;
           $ r=&amp;quot;new stuff&amp;quot;&lt;br /&gt;
           $ echo ${r:? &amp;quot;that's r for you&amp;quot;}&lt;br /&gt;
               new stuff&lt;br /&gt;
           $ unset r&lt;br /&gt;
           $ echo ${r:? &amp;quot;that's r for you&amp;quot;}&lt;br /&gt;
               bash: r:  that's r for you&lt;br /&gt;
&lt;br /&gt;
         ${varname:+word}    If varname exist and not null return word. Else, return null.&lt;br /&gt;
&lt;br /&gt;
         ${varname:-word}    If varname exist and not null return value. Else, return word.&lt;br /&gt;
&lt;br /&gt;
      Working with arrays in bash - bash arrays.&lt;br /&gt;
&lt;br /&gt;
           $ unset p&lt;br /&gt;
           $ p=(one two three)&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[@]}&amp;quot;&lt;br /&gt;
           one two three&lt;br /&gt;
&lt;br /&gt;
      or&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[*]}&amp;quot;&lt;br /&gt;
           one two three&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${#p[@]}&amp;quot;&lt;br /&gt;
           3&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[0]}&amp;quot;&lt;br /&gt;
           one&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[1]}&amp;quot;&lt;br /&gt;
           two&lt;br /&gt;
&lt;br /&gt;
            Also see (TIP 95)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 41:&lt;br /&gt;
&lt;br /&gt;
     Loops in Bash&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The command below loops through directories listed in $PATH.&lt;br /&gt;
&lt;br /&gt;
          $ path=$PATH:&lt;br /&gt;
          $ while [ $path ]; do echo &amp;quot; ${path%%:*} &amp;quot;; path=${path#*:}; done&lt;br /&gt;
&lt;br /&gt;
       The command below will also loop through directories in your path.&lt;br /&gt;
&lt;br /&gt;
          $IFS=:&lt;br /&gt;
          $ for dir in $PATH&lt;br /&gt;
          &amp;gt; do&lt;br /&gt;
          &amp;gt; ls -ld $dir&lt;br /&gt;
          &amp;gt; done&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Jun 10 20:16 /usr/local/bin&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Jun 13 23:12 /bin&lt;br /&gt;
              drwxr-xr-x    3 root     root        40960 Jun 12 08:00 /usr/bin&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Feb 14 03:12 /usr/X11R6/bin&lt;br /&gt;
              drwxrwxr-x    2 chirico  chirico      4096 Jun  6 13:06 /home/chirico/bin&lt;br /&gt;
&lt;br /&gt;
     Other ways of doing loops:&lt;br /&gt;
&lt;br /&gt;
        for (( i=1; i &amp;lt;= 20; i++))&lt;br /&gt;
                do&lt;br /&gt;
                        echo -n &amp;quot;$i &amp;quot;&lt;br /&gt;
                done&lt;br /&gt;
&lt;br /&gt;
     Note, to do it all on one line, do the following:&lt;br /&gt;
&lt;br /&gt;
        $ for (( i=1; i &amp;lt;= 20; i++)); do echo -n &amp;quot;$i&amp;quot;; done&lt;br /&gt;
&lt;br /&gt;
     Below, is an example of declaring i an integer so that you do not&lt;br /&gt;
     have to preface with let.&lt;br /&gt;
&lt;br /&gt;
          $ declare -i i&lt;br /&gt;
          $ i=5;&lt;br /&gt;
          $ while (( $i &amp;gt; 1 )); do&lt;br /&gt;
          &amp;gt; i=i-1&lt;br /&gt;
          &amp;gt; echo $i&lt;br /&gt;
          &amp;gt; done&lt;br /&gt;
          4&lt;br /&gt;
          3&lt;br /&gt;
          2&lt;br /&gt;
&lt;br /&gt;
     You can also use &amp;quot;while [ $i -gt 1 ]; do&amp;quot;  in place of &amp;quot;while (( $i &amp;gt; 1 )); do&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     To get a listing of all declared values&lt;br /&gt;
&lt;br /&gt;
          $ declare -i&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Try putting a few words in the file &amp;quot;test&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         $ while read filename; do echo  &amp;quot;- $filename &amp;quot;; done &amp;lt; test |nl -w1&lt;br /&gt;
&lt;br /&gt;
     Or, using an array&lt;br /&gt;
&lt;br /&gt;
                declare -a Array&lt;br /&gt;
                Array[0]=&amp;quot;zero&amp;quot;&lt;br /&gt;
                Array[1]=&amp;quot;one&amp;quot;&lt;br /&gt;
                Array[2]=&amp;quot;two&amp;quot;&lt;br /&gt;
                for i in `seq ${#Array[@]}`&lt;br /&gt;
                do&lt;br /&gt;
                  echo $Array[$i-1]&lt;br /&gt;
                done&lt;br /&gt;
&lt;br /&gt;
         Also see (TIP 95 and TIP 133).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 42:&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;diff&amp;quot; and &amp;quot;patch&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
        You have created a program &amp;quot;prog.c&amp;quot;, saved as this name and also copied&lt;br /&gt;
        to  &amp;quot;prog.c.old&amp;quot;. You post &amp;quot;prog.c&amp;quot; to users.  Next, you make changes&lt;br /&gt;
        to prog.c&lt;br /&gt;
&lt;br /&gt;
          $ diff -c prog.c.old prog.c &amp;gt; prog.patch&lt;br /&gt;
&lt;br /&gt;
        Now, users can get the latest updates by running.&lt;br /&gt;
&lt;br /&gt;
          $ patch &amp;lt; prog.patch&lt;br /&gt;
&lt;br /&gt;
        By the way, you can make backups of your data easily.&lt;br /&gt;
&lt;br /&gt;
          $ cp /etc/fstab{,.bak}&lt;br /&gt;
&lt;br /&gt;
        Now, you do your edits to &amp;quot;/etc/fstab&amp;quot; and if you need&lt;br /&gt;
        to go back to the original, you can find it at&lt;br /&gt;
        &amp;quot;/etc/fstab.bak&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 43:&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;cat&amp;quot; the Contents of Files Listed in a File, in That Order.&lt;br /&gt;
&lt;br /&gt;
       SETUP (Assume you have the following)&lt;br /&gt;
&lt;br /&gt;
              $ cat file_of_files&lt;br /&gt;
                  file1&lt;br /&gt;
                  file2&lt;br /&gt;
&lt;br /&gt;
              $ cat file1&lt;br /&gt;
                  This is the data in file1&lt;br /&gt;
&lt;br /&gt;
              $ cat file 2&lt;br /&gt;
                  This is the data in file2&lt;br /&gt;
&lt;br /&gt;
       So there are 3 files here &amp;quot;file_of_files&amp;quot; which contains the name of&lt;br /&gt;
       other files.  In this case &amp;quot;file1&amp;quot; and &amp;quot;file2&amp;quot;. And the contents of&lt;br /&gt;
       &amp;quot;file1&amp;quot; and &amp;quot;file2&amp;quot; is shown above.&lt;br /&gt;
&lt;br /&gt;
               $ cat file_of_files|xargs cat&lt;br /&gt;
                    This is the data in  file1&lt;br /&gt;
                    This is the data in  file2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 44:&lt;br /&gt;
&lt;br /&gt;
     Columns and Rows -- getting anything you want.&lt;br /&gt;
&lt;br /&gt;
     Assume you have the following file.&lt;br /&gt;
&lt;br /&gt;
        $ cat data&lt;br /&gt;
           1 2 3&lt;br /&gt;
           4 5&lt;br /&gt;
           6 7 8 9 10&lt;br /&gt;
           11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
     How to you get everything in  2 columns?&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l2&lt;br /&gt;
           1 2&lt;br /&gt;
           3 4&lt;br /&gt;
           5 6&lt;br /&gt;
           7 8&lt;br /&gt;
           9 10&lt;br /&gt;
           11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
    Three columns?&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l3&lt;br /&gt;
           1 2 3&lt;br /&gt;
           4 5 6&lt;br /&gt;
           7 8 9&lt;br /&gt;
           10 11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
    What's the row sum of the &amp;quot;three columns?&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
           6&lt;br /&gt;
           15&lt;br /&gt;
           24&lt;br /&gt;
           33&lt;br /&gt;
           27&lt;br /&gt;
&lt;br /&gt;
    or&lt;br /&gt;
&lt;br /&gt;
        $ tr ' ' '\n' &amp;lt; data |xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
&lt;br /&gt;
    NOTE &amp;quot;Steven Heiner's rule&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
             cat one_file | program&lt;br /&gt;
&lt;br /&gt;
           can always be rewritten as&lt;br /&gt;
&lt;br /&gt;
             program &amp;lt; one_file&lt;br /&gt;
&lt;br /&gt;
   Note: thanks to Steven Heiner (http://www.shelldorado.com/) the above can be&lt;br /&gt;
       shortened as follows:&lt;br /&gt;
&lt;br /&gt;
               $ tr ' ' '\n' &amp;lt; data|xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
&lt;br /&gt;
          Need to &amp;quot;tr&amp;quot; from the stdin?&lt;br /&gt;
&lt;br /&gt;
               $ tr &amp;quot;xy&amp;quot; &amp;quot;yx&amp;quot;| ... | ...&lt;br /&gt;
&lt;br /&gt;
       But there is a the &amp;quot;Stephane CHAZELAS&amp;quot; condition here&lt;br /&gt;
&lt;br /&gt;
         &amp;quot;Note that tr, sed, and awk mail fail on files containing '\0'&lt;br /&gt;
          sed and awk have unspecified behaviors if the input&lt;br /&gt;
          doesn't end in a '\n' (or to sum up, cat works for&lt;br /&gt;
          binary and text files, text utilities such as sed or awk&lt;br /&gt;
          work only for text files).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 45:&lt;br /&gt;
&lt;br /&gt;
     Auto Directory Spelling Corrections.&lt;br /&gt;
&lt;br /&gt;
      To turn this on:&lt;br /&gt;
&lt;br /&gt;
           $ shopt -s cdspell&lt;br /&gt;
&lt;br /&gt;
      Now mispell a directory in the cd command.&lt;br /&gt;
&lt;br /&gt;
           $ cd /usk/local&lt;br /&gt;
                   ^-------- still gets you to --&lt;br /&gt;
                                                |&lt;br /&gt;
                                            /usr/local&lt;br /&gt;
&lt;br /&gt;
      What other options can you set? The following will list&lt;br /&gt;
      all the options:&lt;br /&gt;
&lt;br /&gt;
           $ shopt -p&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 46:&lt;br /&gt;
&lt;br /&gt;
     Record Eveything Printed on Your Terminal Screen.&lt;br /&gt;
&lt;br /&gt;
            $ script -a &amp;lt;filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Now start doing stuff and &amp;quot;everything&amp;quot; is appended to &amp;lt;filename&amp;gt;.&lt;br /&gt;
     For example&lt;br /&gt;
&lt;br /&gt;
            $ script installation&lt;br /&gt;
&lt;br /&gt;
            $ (command)&lt;br /&gt;
&lt;br /&gt;
            $ (result)&lt;br /&gt;
&lt;br /&gt;
            $ ...&lt;br /&gt;
&lt;br /&gt;
            $ ...&lt;br /&gt;
&lt;br /&gt;
            $ (command)&lt;br /&gt;
&lt;br /&gt;
            $ (result)&lt;br /&gt;
&lt;br /&gt;
            $ exit&lt;br /&gt;
&lt;br /&gt;
     The whole session log is in the installation file that you can later&lt;br /&gt;
     read and/or cleanup and add to a documentation.&lt;br /&gt;
&lt;br /&gt;
     This command can also be used to redirect the contents to another user,&lt;br /&gt;
     but you must be root to do this.&lt;br /&gt;
&lt;br /&gt;
     Step 1 - find out what pts they are using.&lt;br /&gt;
&lt;br /&gt;
            $ w&lt;br /&gt;
&lt;br /&gt;
     Step 2 - Run script on that pts. After running this command below&lt;br /&gt;
              everything you type will appear on their screen.&lt;br /&gt;
&lt;br /&gt;
            $ script /dev/pts/4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Thanks to Jacques.GARNIER-EXTERIEUR@EU.RHODIA.COM for his contribution&lt;br /&gt;
     to this tip.&lt;br /&gt;
&lt;br /&gt;
     Also reference TIP 208.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 47:&lt;br /&gt;
&lt;br /&gt;
     Monitor all Network Traffic Except Your Current ssh Connection.&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX -s 1500 port not 22&lt;br /&gt;
&lt;br /&gt;
       Or to filter out port 123 as well getting the full length of the packet&lt;br /&gt;
       (-s 0), use the following:&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX -s 0 port not 22  and port not 123&lt;br /&gt;
&lt;br /&gt;
       Or to filter only a certain host say 81.169.158.205&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX  port not 22 and host 81.169.158.205&lt;br /&gt;
&lt;br /&gt;
     Just want ip addresses and a little bit of data, then,&lt;br /&gt;
     use this. The &amp;quot;-c 20&amp;quot; is to stop after 20 packets.&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN  -s 1500 port not 22 -c 20&lt;br /&gt;
&lt;br /&gt;
     If you're looking for sign of DOS attacks, the following show just the SYN&lt;br /&gt;
     packets on all interfaces:&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump 'tcp[13] &amp;amp; 2 == 2'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 48:&lt;br /&gt;
&lt;br /&gt;
     Where are the GNU Reference Manuals?&lt;br /&gt;
&lt;br /&gt;
           http://www.gnu.org/manual/manual.html&lt;br /&gt;
&lt;br /&gt;
     Also worth a look the &amp;quot;Linux Documentation Project&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           http://en.tldp.org/&lt;br /&gt;
&lt;br /&gt;
     and Red Hat manuals&lt;br /&gt;
&lt;br /&gt;
           http://www.redhat.com/docs/manuals/enterprise/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 49:&lt;br /&gt;
&lt;br /&gt;
     Setting or Changing the Library Path.&lt;br /&gt;
&lt;br /&gt;
     The following contains the settings to be added or deleted&lt;br /&gt;
&lt;br /&gt;
           /etc/ld.so.conf&lt;br /&gt;
&lt;br /&gt;
     After this file is edited, you must run the following:&lt;br /&gt;
&lt;br /&gt;
           $ ldconfig&lt;br /&gt;
&lt;br /&gt;
     See &amp;quot;man ldconfig&amp;quot; for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 50:&lt;br /&gt;
&lt;br /&gt;
     Working with Libraries in C&lt;br /&gt;
&lt;br /&gt;
     Assume the following 3 programs:&lt;br /&gt;
&lt;br /&gt;
      $ cat ./src/test.c&lt;br /&gt;
&lt;br /&gt;
         int test(int t)&lt;br /&gt;
         {&lt;br /&gt;
           printf(&amp;quot;%d\n&amp;quot;,t);&lt;br /&gt;
           return t;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      $ cat ./src/prog1.c&lt;br /&gt;
&lt;br /&gt;
         /*&lt;br /&gt;
          program: prog1.c&lt;br /&gt;
          dependences: test.c&lt;br /&gt;
&lt;br /&gt;
          compiling this program:&lt;br /&gt;
          gcc -o prog test.c prog1.c&lt;br /&gt;
&lt;br /&gt;
          Note the libpersonal include&lt;br /&gt;
          should be remove if NOT using the&lt;br /&gt;
          library&lt;br /&gt;
         */&lt;br /&gt;
&lt;br /&gt;
         #include &amp;lt;libpersonal.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         int&lt;br /&gt;
         main(int argc, char **argv)&lt;br /&gt;
         {&lt;br /&gt;
           test(45);&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
      $ cat ./include/libpersonal.h&lt;br /&gt;
&lt;br /&gt;
         extern int test(int);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Prog1.c needs the test function in  test.c&lt;br /&gt;
     To compile, so that both programs work together, do the following:&lt;br /&gt;
&lt;br /&gt;
          $ cd src&lt;br /&gt;
          $ gcc -o prog test.c prog1.c -I../include&lt;br /&gt;
&lt;br /&gt;
     However, if you want to create your own static library, then, run the following:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p ../lib&lt;br /&gt;
          $ gcc -c test.c  -o ../lib/test.o&lt;br /&gt;
          $ cd ../lib&lt;br /&gt;
          $ ar r libpersonal.a test.o&lt;br /&gt;
          $ ranlib libpersonal.a&lt;br /&gt;
&lt;br /&gt;
     or, the ar and ranlib command can be combined as follows:&lt;br /&gt;
&lt;br /&gt;
          $ ar rs libpersonal.a test.o&lt;br /&gt;
&lt;br /&gt;
     To compile the program with the static library:&lt;br /&gt;
&lt;br /&gt;
          $ cd ../src&lt;br /&gt;
          $ gcc -I../include -L../lib -o prog1 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     The -I../include  tells  gcc to look in the ../include directory for&lt;br /&gt;
     libpersonal.h. and -L../lib, tells gcc to look for the&lt;br /&gt;
     &amp;quot;libpersonal.a&amp;quot; library.&lt;br /&gt;
&lt;br /&gt;
           $ cd ..&lt;br /&gt;
           $ tree src lib include&lt;br /&gt;
           src&lt;br /&gt;
           |-- prog&lt;br /&gt;
           |-- prog1&lt;br /&gt;
           |-- prog1.c&lt;br /&gt;
           `-- test.c&lt;br /&gt;
           lib&lt;br /&gt;
           |-- libpersonal.a&lt;br /&gt;
           `-- test.o&lt;br /&gt;
           include&lt;br /&gt;
           `-- libpersonal.h&lt;br /&gt;
&lt;br /&gt;
     This was a STATIC library. Often times you will want to use a SHARED&lt;br /&gt;
     or dynamic library.&lt;br /&gt;
&lt;br /&gt;
     SHARED LIBRARY:&lt;br /&gt;
&lt;br /&gt;
     You must recompile test.c with -fpic option.&lt;br /&gt;
&lt;br /&gt;
          $ cd ../lib&lt;br /&gt;
          $ gcc -c -fpic ../src/test.c -o test.o&lt;br /&gt;
&lt;br /&gt;
     Next create the libpersonal.so file.&lt;br /&gt;
&lt;br /&gt;
          $ gcc -shared -o libpersonal.so test.o&lt;br /&gt;
&lt;br /&gt;
     Now, compile the source prog1.c as follows:&lt;br /&gt;
&lt;br /&gt;
          $ cd ../src&lt;br /&gt;
          $ gcc -Wl,-R../lib -L../lib -I../include -o prog2 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
     This should work fine. But, take a look at prog2 using the ldd command.&lt;br /&gt;
&lt;br /&gt;
          $ ldd prog2&lt;br /&gt;
&lt;br /&gt;
        libpersonal.so =&amp;gt; ../lib/libpersonal.so (0x40017000)&lt;br /&gt;
        libc.so.6 =&amp;gt; /lib/tls/libc.so.6 (0x42000000)&lt;br /&gt;
        /lib/ld-linux.so.2 =&amp;gt; /lib/ld-linux.so.2 (0x40000000)&lt;br /&gt;
&lt;br /&gt;
     If you move the program prog2 to a different location, it will not run.&lt;br /&gt;
     Instead you will get the following error:&lt;br /&gt;
&lt;br /&gt;
           prog2: error while loading shared libraries: libpersonal.so:&lt;br /&gt;
                     cannot open shared object file: No such file or directory&lt;br /&gt;
&lt;br /&gt;
     To fix this, you should specify the direct path to the library. And in my&lt;br /&gt;
     case it is rather long&lt;br /&gt;
&lt;br /&gt;
      $  gcc -Wl,-R/work/souptonuts/documentation/theBook/lib -L../lib -I../include -o prog2 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE: The -R must always follow the -Wl.  (-Wl,-R&amp;lt;directory&amp;gt;) They always go together&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 51:&lt;br /&gt;
&lt;br /&gt;
     Actively Monitor a File and Send Email when Expression Occurs.&lt;br /&gt;
&lt;br /&gt;
     This is a way to monitor &amp;quot;/var/log/messages&amp;quot; or any file for certain changes.&lt;br /&gt;
     The example below actively monitors &amp;quot;stuff&amp;quot; for the work &amp;quot;now&amp;quot; and as soon as&lt;br /&gt;
     &amp;quot;now&amp;quot; is added to the file, the contents of msg are sent to the user&lt;br /&gt;
     mikechirico@hotmail.com&lt;br /&gt;
&lt;br /&gt;
          $ tail -f stuff | \&lt;br /&gt;
              awk ' /now/ { system(&amp;quot;mail -s \&amp;quot;This is working\&amp;quot;  mikechirico@hotmail.com &amp;lt; msg&amp;quot;) }'&lt;br /&gt;
&lt;br /&gt;
     Or, you can run a program, say get headings on slashdot from the program &amp;quot;getslash.php&amp;quot; which&lt;br /&gt;
     runs on  &amp;quot;192.168.1.155&amp;quot; with account &amp;quot;chirico&amp;quot;. Assuming you have ssh keys setup, then, the following&lt;br /&gt;
     will send mail from the output:&lt;br /&gt;
&lt;br /&gt;
          $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;|mail -s &amp;quot;Slash cron Headlines&amp;quot;  mchirico@comcast.net&lt;br /&gt;
&lt;br /&gt;
     See (TIP 80) for scraping the headings on slash dot and how to get a copy of &amp;quot;getslash.php&amp;quot;.  If you still&lt;br /&gt;
     want to use awk:&lt;br /&gt;
&lt;br /&gt;
           $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;| \&lt;br /&gt;
                      awk '{ print $0 | &amp;quot;mail -s \x27 Slash Topics \x27 mchirico@comcast.net &amp;quot;}'&lt;br /&gt;
&lt;br /&gt;
     Note the &amp;quot;\x27&amp;quot; is a quote.  Maybe you only want articles dealing with &amp;quot;Linux&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
           $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;| \&lt;br /&gt;
                      awk '/Linux/{ print $0 | &amp;quot;mail -s \x27 Slash Topics \x27 mchirico@comcast.net &amp;quot;}'&lt;br /&gt;
&lt;br /&gt;
     For $60, you can get a numeric display from &amp;quot;delcom engineering&amp;quot; that you can send messages and&lt;br /&gt;
     data to.  I get weather information off the internet and send it to this device.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/projects/delcom/&lt;br /&gt;
&lt;br /&gt;
     (Reference TIP 151 for ssh tips)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 52:&lt;br /&gt;
&lt;br /&gt;
     Need to Keep Secrets? Encrypt it.&lt;br /&gt;
&lt;br /&gt;
      To Encrypt:&lt;br /&gt;
&lt;br /&gt;
            $ openssl des3 -salt -in file.txt -out file.des3&lt;br /&gt;
&lt;br /&gt;
      The above will prompt for a password, or you can put it in&lt;br /&gt;
      with a -k option, assuming you're on a trusted server.&lt;br /&gt;
&lt;br /&gt;
      To Decrypt&lt;br /&gt;
&lt;br /&gt;
            $  openssl des3 -d -salt -in file.des3 -out file.txt -k mypassword&lt;br /&gt;
&lt;br /&gt;
      Need to encrypt what you type? Enter the following, then start typing&lt;br /&gt;
      and  ^D to end.&lt;br /&gt;
&lt;br /&gt;
            $ openssl des3 -salt -out stuff.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 53:&lt;br /&gt;
&lt;br /&gt;
     Check that a File has Not Been Tampered With: Use Cryptographic Hashing Function.&lt;br /&gt;
&lt;br /&gt;
     The md5sum is popular but dated&lt;br /&gt;
&lt;br /&gt;
              $ md5sum file&lt;br /&gt;
&lt;br /&gt;
     Instead, use one of the following;&lt;br /&gt;
&lt;br /&gt;
              $ openssl dgst -sha1 -c file&lt;br /&gt;
&lt;br /&gt;
              $ openssl dgst -ripemd160 -c  file&lt;br /&gt;
&lt;br /&gt;
     All calls give a fixed length string or &amp;quot;message digest&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 54:&lt;br /&gt;
&lt;br /&gt;
     Need to View Information About a Secure Web Server? A SSL/TLS test.&lt;br /&gt;
&lt;br /&gt;
           $ openssl s_client -connect www.sourceforge.net:443&lt;br /&gt;
&lt;br /&gt;
     Above will give a long listing of certificates.&lt;br /&gt;
&lt;br /&gt;
     Note, it is also possible to get certificate information about a mail server&lt;br /&gt;
&lt;br /&gt;
           $ openssl s_client -connect mail.comcast.net:995 -showcerts&lt;br /&gt;
&lt;br /&gt;
     When you do the above command you get two certificates. If you copy&lt;br /&gt;
     past both certificates by taking the following contents include the&lt;br /&gt;
     begin and end show below:&lt;br /&gt;
&lt;br /&gt;
                 -----BEGIN CERTIFICATE-----&lt;br /&gt;
                 ....&lt;br /&gt;
                 -----END CERTIFICATE-----&lt;br /&gt;
&lt;br /&gt;
     Then create files &amp;quot;comcast0.pem&amp;quot; and &amp;quot;comcast1.pem&amp;quot; out of these certificaties and&lt;br /&gt;
     put them in a directory &amp;quot;/home/donkey/.certs&amp;quot;, then, with the openssl src package, in&lt;br /&gt;
     the &amp;quot;./tools/c_rehash&amp;quot; run&lt;br /&gt;
&lt;br /&gt;
            $ c_rehash .certs&lt;br /&gt;
            Doing .certs&lt;br /&gt;
            comcast0.pem =&amp;gt; 72f90dc0.0&lt;br /&gt;
            comcast1.pem =&amp;gt; f73e89fd.0&lt;br /&gt;
&lt;br /&gt;
     Now it's possible to have fetchmail work with these certs.&lt;br /&gt;
&lt;br /&gt;
       #&lt;br /&gt;
       #&lt;br /&gt;
       # Sample .fetchmailrc file for Comcast&lt;br /&gt;
       #&lt;br /&gt;
       # Check mail every 90 seconds&lt;br /&gt;
       set daemon 90&lt;br /&gt;
       set syslog&lt;br /&gt;
       set postmaster donkey&lt;br /&gt;
       #set bouncemail&lt;br /&gt;
       #&lt;br /&gt;
       # Comcast email is zdonkey but computer account is  just donkey&lt;br /&gt;
       #&lt;br /&gt;
       poll mail.comcast.net with proto POP3 and options no dns&lt;br /&gt;
              user 'zdonkey' with pass &amp;quot;somethin35&amp;quot;  is 'donkey' here options ssl sslcertck sslcertpath '/home/donkey/.certs'&lt;br /&gt;
              smtphost comcast.net&lt;br /&gt;
       # currently not used&lt;br /&gt;
       mda '/usr/bin/procmail -d %T'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     REFERENCE: http://www.openssl.org/&lt;br /&gt;
                http://www.catb.org/~esr/fetchmail/fetchmail-6.2.5.tar.gz&lt;br /&gt;
                http://www.madboa.com/geek/openssl/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 55:&lt;br /&gt;
&lt;br /&gt;
     cp --parents. What does this option do?&lt;br /&gt;
&lt;br /&gt;
     Assume you have the following directory structure&lt;br /&gt;
&lt;br /&gt;
            .&lt;br /&gt;
            |-- a&lt;br /&gt;
            |   `-- b&lt;br /&gt;
            |       `-- c&lt;br /&gt;
            |           `-- d&lt;br /&gt;
            |               |-- file1&lt;br /&gt;
            |               `-- file2&lt;br /&gt;
            `-- newdir&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Issue the following command:&lt;br /&gt;
&lt;br /&gt;
         $ cp --parents ./a/b/c/d/* ./newdir/&lt;br /&gt;
&lt;br /&gt;
     Now you have the following:&lt;br /&gt;
&lt;br /&gt;
            .&lt;br /&gt;
            |-- a&lt;br /&gt;
            |   `-- b&lt;br /&gt;
            |       `-- c&lt;br /&gt;
            |           `-- d&lt;br /&gt;
            |               |-- file1&lt;br /&gt;
            |               `-- file2&lt;br /&gt;
            `-- newdir&lt;br /&gt;
                `-- a&lt;br /&gt;
                    `-- b&lt;br /&gt;
                        `-- c&lt;br /&gt;
                            `-- d&lt;br /&gt;
                                |-- file1&lt;br /&gt;
                                `-- file2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 56:&lt;br /&gt;
&lt;br /&gt;
     Quickly Locating files.&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;locate&amp;quot; command quickly searches the indexed database for files.  It just&lt;br /&gt;
     gives the name of the files; but, if you need more information use it as follows&lt;br /&gt;
&lt;br /&gt;
         $ locate document|xargs ls -l&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;locate&amp;quot; database may only get updated every 24 hours.  For more recent finds,&lt;br /&gt;
     use the &amp;quot;find&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 57:&lt;br /&gt;
&lt;br /&gt;
     Using the &amp;quot;find&amp;quot; Command.&lt;br /&gt;
&lt;br /&gt;
     List only directories, max 2 nodes down that have &amp;quot;net&amp;quot; in the name&lt;br /&gt;
&lt;br /&gt;
       $ find /proc -type d -maxdepth 2 -iname '*net*'&lt;br /&gt;
&lt;br /&gt;
     Find all *.c and *.h files starting from the current &amp;quot;.&amp;quot; position.&lt;br /&gt;
&lt;br /&gt;
       $ find . \( -iname '*.c'  -o -iname '*.h' \) -print&lt;br /&gt;
&lt;br /&gt;
     Find all, but skip what's in &amp;quot;/CVS&amp;quot; and &amp;quot;/junk&amp;quot;. Start from &amp;quot;/work&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ find /work \( -iregex '.*/CVS'  -o -iregex '.*/junk' \)  -prune -o -print&lt;br /&gt;
&lt;br /&gt;
     Note -regex and -iregex work on the directory as well, which means&lt;br /&gt;
     you must consider the &amp;quot;./&amp;quot; that comes before all listings.&lt;br /&gt;
&lt;br /&gt;
     Here is another example. Find all files except what is under the CVS, including&lt;br /&gt;
     CVS listings. Also exclude &amp;quot;#&amp;quot; and &amp;quot;~&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       $ find . -regex '.*' ! \( -regex '.*CVS.*'  -o -regex '.*[#|~].*' \)&lt;br /&gt;
&lt;br /&gt;
     Find a *.c file, then run grep on it looking for &amp;quot;stdio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       $ find . -iname '*.c' -exec grep -H 'stdio.h' {} \;&lt;br /&gt;
         sample output --&amp;gt;  ./prog1.c:#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
                            ./test.c:#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Looking for the disk-hog on the whole system?&lt;br /&gt;
&lt;br /&gt;
       $ find /  -size +10000k 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
     Looking for files changed in the last 24 hours? Make sure you add the&lt;br /&gt;
     minus sign &amp;quot;-1&amp;quot;, otherwise, you will only find files changed exactly&lt;br /&gt;
     24 hours from now. With the &amp;quot;-1&amp;quot; you get files changed from now to 24&lt;br /&gt;
     hours.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ find  . -ctime -1  -printf &amp;quot;%a %f\n&amp;quot;&lt;br /&gt;
       Wed Oct  6 12:51:56 2004 .&lt;br /&gt;
       Wed Oct  6 12:35:16 2004 How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
     Or if you just want files.&lt;br /&gt;
&lt;br /&gt;
       $ find . -type f -ctime -1  -printf &amp;quot;%a %f\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Details on file status change in the last 48 hours, current directory. Also note &amp;quot;-atime -2&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
       $ find . -ctime -2 -type f -exec ls -l {} \;&lt;br /&gt;
&lt;br /&gt;
             NOTE: if you don't use -type f, you make get &amp;quot;.&amp;quot; returned, which&lt;br /&gt;
             when run through ls &amp;quot;ls .&amp;quot; may list more than what you want.&lt;br /&gt;
&lt;br /&gt;
             Also you may only want the current directory&lt;br /&gt;
&lt;br /&gt;
       $ find . -ctime -2 -type f -maxdepth 1 -exec ls -l {} \;&lt;br /&gt;
&lt;br /&gt;
     To find files modified within the last 5 to 10 minutes&lt;br /&gt;
&lt;br /&gt;
       $ find . -mmin +5 -mmin -10 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     For more example &amp;quot;find&amp;quot; commands, reference the following looking&lt;br /&gt;
     for the latest version of &amp;quot;bashscripts.x.x.x.tar.gz&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79320&amp;amp;package_id=80711&lt;br /&gt;
&lt;br /&gt;
     See &amp;quot;TIP 71&amp;quot; for examples of find using the inode feature. &amp;quot; $ find . -inum &amp;lt;inode&amp;gt; -exec rm -- '{}' \; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     If you don't want error messages, or need to redirect error messages &amp;quot;&amp;gt; /dev/null 2&amp;gt;&amp;amp;1&amp;quot;, or see&lt;br /&gt;
     &amp;quot;TIP 81&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 58:&lt;br /&gt;
&lt;br /&gt;
     Using the &amp;quot;rm&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
     How do you remove a file that has the name &amp;quot;-&amp;quot;.  For instance, if you run the command&lt;br /&gt;
     &amp;quot;$ cat &amp;gt; - &amp;quot; and type some text followed by ^d, how does the &amp;quot;-&amp;quot; file get deleted?&lt;br /&gt;
&lt;br /&gt;
        $ rm -- -&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;--&amp;quot; nullifies any rm options.&lt;br /&gt;
&lt;br /&gt;
     How do you delete the directory &amp;quot;one&amp;quot;, all it's sub-directories, and any data?&lt;br /&gt;
&lt;br /&gt;
        $ rm -rf ./one&lt;br /&gt;
&lt;br /&gt;
     Note, to selectively delete stuff on a directory, use the find command &amp;quot;TIP 57&amp;quot;.&lt;br /&gt;
     To delete by inode, see &amp;quot;TIP 71&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 59:&lt;br /&gt;
&lt;br /&gt;
     Giving ownership.&lt;br /&gt;
&lt;br /&gt;
     How do you give the user &amp;quot;donkey&amp;quot; ownership to all directories and files under&lt;br /&gt;
     &amp;quot;./fordonkey&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          $ chown -R donkey ./fordonkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 60:&lt;br /&gt;
&lt;br /&gt;
     Only Permit root login -- give others a message when they try to login.&lt;br /&gt;
&lt;br /&gt;
     Create the file &amp;quot;/etc/nologin&amp;quot; with &amp;quot;nologin&amp;quot; containing the contents&lt;br /&gt;
     of the message.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 61:&lt;br /&gt;
&lt;br /&gt;
     Limits: file size, open files, pipe size, stack size, max memory size&lt;br /&gt;
             cpu time, plus others.&lt;br /&gt;
&lt;br /&gt;
     To get a listing of current limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -a&lt;br /&gt;
             core file size        (blocks, -c) 0&lt;br /&gt;
             data seg size         (kbytes, -d) unlimited&lt;br /&gt;
             file size             (blocks, -f) unlimited&lt;br /&gt;
             max locked memory     (kbytes, -l) unlimited&lt;br /&gt;
             max memory size       (kbytes, -m) unlimited&lt;br /&gt;
             open files                    (-n) 1024&lt;br /&gt;
             pipe size          (512 bytes, -p) 8&lt;br /&gt;
             stack size            (kbytes, -s) 8192&lt;br /&gt;
             cpu time             (seconds, -t) unlimited&lt;br /&gt;
             max user processes            (-u) 8179&lt;br /&gt;
             virtual memory        (kbytes, -v) unlimited&lt;br /&gt;
&lt;br /&gt;
     Note as a user you can decrease your limits in the current&lt;br /&gt;
     shell session; but, you cannot increase.  This can be ideal&lt;br /&gt;
     for testing programs.  But, first you may want to create&lt;br /&gt;
     another shell &amp;quot;sh&amp;quot; so that you can &amp;quot;go back to where started&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -f 10&lt;br /&gt;
&lt;br /&gt;
     Now try&lt;br /&gt;
&lt;br /&gt;
          $ yes &amp;gt;&amp;gt; out&lt;br /&gt;
             File size limit exceeded&lt;br /&gt;
&lt;br /&gt;
     To set limits on users, make changes to &amp;quot;/etc/security/limits.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           bozo   - maxlogins 1&lt;br /&gt;
&lt;br /&gt;
     Will keep bozo from loging in more than once.&lt;br /&gt;
&lt;br /&gt;
     To list hard limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -Ha&lt;br /&gt;
&lt;br /&gt;
     To list soft limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -Sa&lt;br /&gt;
&lt;br /&gt;
     To restrict user access by time, day make changes to&lt;br /&gt;
             &amp;quot;/etc/security/time.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Also take a look at &amp;quot;/etc/profile&amp;quot; to see what other changes&lt;br /&gt;
     can be made, plus take a look under &amp;quot;/etc/security/*.conf&amp;quot; for&lt;br /&gt;
     other configuration files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 62:&lt;br /&gt;
&lt;br /&gt;
     Stupid &amp;quot;cat&amp;quot; Tricks.&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 43).&lt;br /&gt;
&lt;br /&gt;
     If you have multiple blank lines, squeeze these lines down to one,&lt;br /&gt;
     then, try the following:&lt;br /&gt;
&lt;br /&gt;
          $ cat -s &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to number the lines?&lt;br /&gt;
&lt;br /&gt;
          $ cat -n &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to show tabs?&lt;br /&gt;
&lt;br /&gt;
          $ cat -t &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Need to mark end of lines by &amp;quot;$&amp;quot;? The following was suggested by  (Amos Shapira)&lt;br /&gt;
&lt;br /&gt;
          $ cat -e &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to see all the ctl characters?&lt;br /&gt;
&lt;br /&gt;
          /* ctlgen.c&lt;br /&gt;
            Program to generate ctl characters.&lt;br /&gt;
&lt;br /&gt;
            Compile:&lt;br /&gt;
&lt;br /&gt;
               gcc -o ctlgen ctlgen.c&lt;br /&gt;
&lt;br /&gt;
            Run:&lt;br /&gt;
&lt;br /&gt;
               ./ctlgen &amp;gt; mout&lt;br /&gt;
&lt;br /&gt;
            Now see the characters:&lt;br /&gt;
&lt;br /&gt;
               cat -v mout&lt;br /&gt;
&lt;br /&gt;
            Here's a sample output:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               $ cat -v mout|tail&lt;br /&gt;
                   test M-v&lt;br /&gt;
                   test M-w&lt;br /&gt;
                   test M-x&lt;br /&gt;
                   test M-y&lt;br /&gt;
                   test M-z&lt;br /&gt;
                   test M-{&lt;br /&gt;
                   test M-|&lt;br /&gt;
                   test M-}&lt;br /&gt;
                   test M-~&lt;br /&gt;
                   test M-^?&lt;br /&gt;
&lt;br /&gt;
          */&lt;br /&gt;
          #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
          #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
          int main()&lt;br /&gt;
          {&lt;br /&gt;
            int i;&lt;br /&gt;
&lt;br /&gt;
            for(i=0; i &amp;lt; 256; ++i)&lt;br /&gt;
              printf(&amp;quot;test %c \n&amp;quot;,i);&lt;br /&gt;
&lt;br /&gt;
            return 0;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 63:&lt;br /&gt;
&lt;br /&gt;
     Guard against SYN attacks and &amp;quot;ping&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     As root do the following:&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/tcp_syncookies&lt;br /&gt;
&lt;br /&gt;
     Want to disable &amp;quot;ping&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_all&lt;br /&gt;
&lt;br /&gt;
     Disable broadcast/multicast &amp;quot;ping&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts&lt;br /&gt;
&lt;br /&gt;
     And to enable again:&lt;br /&gt;
&lt;br /&gt;
          echo 0 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_all&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 64:&lt;br /&gt;
&lt;br /&gt;
     Make changes to .bash_profile and need to update the current session?&lt;br /&gt;
&lt;br /&gt;
       $ source .bash_profile&lt;br /&gt;
&lt;br /&gt;
     With the above command, the user does not have to logout.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 65:&lt;br /&gt;
&lt;br /&gt;
     What are the Special Shell Variables?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        $#   The number of arguments.&lt;br /&gt;
        $@   All arguments, as separate words.&lt;br /&gt;
        $*   All arguments, as one word.&lt;br /&gt;
        $$   ID of the current process.&lt;br /&gt;
        $?   Exit status of the last command.&lt;br /&gt;
        $0,$1,..$9,${10},${11}...${N}    Positional parameters. After &amp;quot;9&amp;quot; you must use the ${k} syntax.&lt;br /&gt;
&lt;br /&gt;
     Note that 0 is true. For example if you execute the following, which is true you get zero.&lt;br /&gt;
&lt;br /&gt;
         $  [[ -f /etc/passwd ]]&lt;br /&gt;
         $  echo $?&lt;br /&gt;
         0&lt;br /&gt;
     And the following is false, which returns a 1.&lt;br /&gt;
&lt;br /&gt;
         $  [[ -f /etc/passwdjabberwisnohere ]]&lt;br /&gt;
         $  echo $?&lt;br /&gt;
         1&lt;br /&gt;
&lt;br /&gt;
     So true=0 and false=1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Sample program &amp;quot;mdo&amp;quot;  to show the difference between &amp;quot;$@&amp;quot; and &amp;quot;$*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        function myarg&lt;br /&gt;
        {&lt;br /&gt;
            echo &amp;quot;$# in myarg function&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
        echo -e &amp;quot;$# parameters on the cmd line\n&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;calling: myarg \&amp;quot;\$@\&amp;quot; and myarg \&amp;quot;\$*\&amp;quot;\n&amp;quot;&lt;br /&gt;
        myarg &amp;quot;$@&amp;quot;&lt;br /&gt;
        myarg &amp;quot;$*&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;\ncalling: myarg \$@ and myarg \$* without quotes\n&amp;quot;&lt;br /&gt;
        myarg $@&lt;br /&gt;
        myarg $*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The result of running &amp;quot;./mdo one two&amp;quot;. Note that when quoted, myarg &amp;quot;$*&amp;quot;,&lt;br /&gt;
      returns 1 ... all parameters are smushed together as one word.&lt;br /&gt;
&lt;br /&gt;
            [chirico@third-fl-71 theBook]$ ./mdo one two&lt;br /&gt;
            2 parameters on the cmd line&lt;br /&gt;
&lt;br /&gt;
            calling: myarg &amp;quot;$@&amp;quot; and myarg &amp;quot;$*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
            1 in myarg function&lt;br /&gt;
&lt;br /&gt;
            calling: myarg $@ and myarg $* without quotes&lt;br /&gt;
&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
&lt;br /&gt;
      Example program &amp;quot;mdo2&amp;quot; shows how the input separator can be changed.&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        IFS=|&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=,&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=\;&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=$1&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            [chirico@third-fl-71 theBook]$ ./mdo2 one two three four five&lt;br /&gt;
            one two three four five&lt;br /&gt;
&lt;br /&gt;
            one,two,three,four,five&lt;br /&gt;
&lt;br /&gt;
            one;two;three;four;five&lt;br /&gt;
&lt;br /&gt;
            oneotwoothreeofourofive&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 66:&lt;br /&gt;
&lt;br /&gt;
     Replace all &amp;quot;x&amp;quot; with &amp;quot;y&amp;quot; and all &amp;quot;y&amp;quot; with &amp;quot;x&amp;quot; in file data.&lt;br /&gt;
&lt;br /&gt;
        $ cata data&lt;br /&gt;
          x y&lt;br /&gt;
          y x&lt;br /&gt;
&lt;br /&gt;
        $ tr &amp;quot;xy&amp;quot;  &amp;quot;yx&amp;quot; &amp;lt; data&lt;br /&gt;
          y x&lt;br /&gt;
          x y&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 67:&lt;br /&gt;
&lt;br /&gt;
     On a Linux 2.6.x Kernel, how do you directly measure disk activity,&lt;br /&gt;
     and where is this information documented?&lt;br /&gt;
&lt;br /&gt;
          o The information is documented in the kernel source&lt;br /&gt;
               ./Documentation/iostats.txt&lt;br /&gt;
&lt;br /&gt;
          o The new way of getting this info in 2.6.x is&lt;br /&gt;
              $ cat /sys/block/hda/stat&lt;br /&gt;
            151121 5694 1932358 796675 37867 76770 916994 8353762 0 800672 9150437&lt;br /&gt;
&lt;br /&gt;
             Field  1 -- # of reads issued&lt;br /&gt;
                 This is the total number of reads completed successfully.&lt;br /&gt;
             Field  2 -- # of reads merged, field 6 -- # of writes merged&lt;br /&gt;
                 Reads and writes which are adjacent to each other may be merged for&lt;br /&gt;
                 efficiency.  Thus two 4K reads may become one 8K read before it is&lt;br /&gt;
                 ultimately handed to the disk, and so it will be counted (and queued)&lt;br /&gt;
                 as only one I/O.  This field lets you know how often this was done.&lt;br /&gt;
             Field  3 -- # of sectors read&lt;br /&gt;
                 This is the total number of sectors read successfully.&lt;br /&gt;
             Field  4 -- # of milliseconds spent reading&lt;br /&gt;
                 This is the total number of milliseconds spent by all reads (as&lt;br /&gt;
                 measured from __make_request() to end_that_request_last()).&lt;br /&gt;
             Field  5 -- # of writes completed&lt;br /&gt;
                 This is the total number of writes completed successfully.&lt;br /&gt;
             Field  7 -- # of sectors written&lt;br /&gt;
                 This is the total number of sectors written successfully.&lt;br /&gt;
             Field  8 -- # of milliseconds spent writing&lt;br /&gt;
                 This is the total number of milliseconds spent by all writes (as&lt;br /&gt;
                 measured from __make_request() to end_that_request_last()).&lt;br /&gt;
             Field  9 -- # of I/Os currently in progress&lt;br /&gt;
                 The only field that should go to zero. Incremented as requests are&lt;br /&gt;
                 given to appropriate request_queue_t and decremented as they finish.&lt;br /&gt;
             Field 10 -- # of milliseconds spent doing I/Os&lt;br /&gt;
                 This field is increases so long as field 9 is nonzero.&lt;br /&gt;
             Field 11 -- weighted # of milliseconds spent doing I/Os&lt;br /&gt;
                 This field is incremented at each I/O start, I/O completion, I/O&lt;br /&gt;
                 merge, or read of these stats by the number of I/Os in progress&lt;br /&gt;
                 (field 9) times the number of milliseconds spent doing I/O since the&lt;br /&gt;
                 last update of this field.  This can provide an easy measure of both&lt;br /&gt;
                 I/O completion time and the backlog that may be accumulating.&lt;br /&gt;
&lt;br /&gt;
       Note, this is device specific.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 68:&lt;br /&gt;
&lt;br /&gt;
     Passing Outbound Mail, plus Masquerading User and Hostname.&lt;br /&gt;
&lt;br /&gt;
     Here's a specific example:&lt;br /&gt;
&lt;br /&gt;
         How does one send and receive Comcast email from a home Linux box,&lt;br /&gt;
         which uses Comcast as the ISP, if the local account on the Linux&lt;br /&gt;
         box is different from the Comcast email.  For instance, the&lt;br /&gt;
         account on the Linux box is &amp;quot;chirico@third-fl-71&amp;quot; and the Comcast&lt;br /&gt;
         email account is &amp;quot;mchirico@comcast.net&amp;quot;.  Note both the hostname and&lt;br /&gt;
         username are different.&lt;br /&gt;
&lt;br /&gt;
         So, the user &amp;quot;chirico&amp;quot; using &amp;quot;mutt&amp;quot;, &amp;quot;elm&amp;quot; or any email program would&lt;br /&gt;
         like to send out email to say &amp;quot;donkey@comcast.net&amp;quot;; yet, donkey would&lt;br /&gt;
         see the email from &amp;quot;mchirico@comcast.net&amp;quot; and not &amp;quot;chirico@third-fl-71&amp;quot;&lt;br /&gt;
         but chirico@third-fl-71 would get the replies.&lt;br /&gt;
&lt;br /&gt;
         For a full description of how to solve this problem, including related&lt;br /&gt;
         &amp;quot;sendmail.mc&amp;quot;, &amp;quot;site.config.m4&amp;quot;, &amp;quot;genericstable&amp;quot;, &amp;quot;genericsdomain&amp;quot;,&lt;br /&gt;
         &amp;quot;.procmailrc&amp;quot;, and &amp;quot;.forward&amp;quot; files,  reference the following:&lt;br /&gt;
&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/README_COMCAST_EMAIL.txt?download&lt;br /&gt;
&lt;br /&gt;
         Included in the above link are instructions for building sendmail with&lt;br /&gt;
         &amp;quot;SASL&amp;quot; and &amp;quot;STARTTLS&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 69:&lt;br /&gt;
&lt;br /&gt;
     How do you remove just the last 2 lines from a file and save the result?&lt;br /&gt;
&lt;br /&gt;
         $ sed  '$d' file | sed '$d' &amp;gt; savefile&lt;br /&gt;
&lt;br /&gt;
     Or, as Amos Shapira pointed out, it's much easier with the head command.&lt;br /&gt;
&lt;br /&gt;
         $ head -2 file&lt;br /&gt;
&lt;br /&gt;
      And, of course, removing just the last line&lt;br /&gt;
&lt;br /&gt;
         $ sed '$d' file &amp;gt; savefile&lt;br /&gt;
&lt;br /&gt;
         (See REFERENCES (13))&lt;br /&gt;
&lt;br /&gt;
     How do you remove extra spaces at the end of a line?&lt;br /&gt;
&lt;br /&gt;
         $ sed 's/[ ]*$//g'&lt;br /&gt;
&lt;br /&gt;
     How do you remove blank lines, or lines with just spaces and tabs,&lt;br /&gt;
     saving the origional file as file.backup?&lt;br /&gt;
&lt;br /&gt;
         $ perl -pi.backup -e &amp;quot;s/^(\s)*\n//&amp;quot;  file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 70:&lt;br /&gt;
&lt;br /&gt;
     Generating Random Numbers.&lt;br /&gt;
&lt;br /&gt;
         $ od -vAn -N4 -tu4 &amp;lt; /dev/urandom&lt;br /&gt;
             3905158199&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 71:&lt;br /&gt;
&lt;br /&gt;
     Deleting a File by it's Inode Value.&lt;br /&gt;
&lt;br /&gt;
       See (PROGRAMMING TIP 5) for creating the file, or&lt;br /&gt;
&lt;br /&gt;
       $ cat &amp;gt; '\n\n\n\n\n\n\n'&lt;br /&gt;
         type some text&lt;br /&gt;
         ^D&lt;br /&gt;
&lt;br /&gt;
     To list the inode and display the characters.&lt;br /&gt;
&lt;br /&gt;
       $ ls -libt *&lt;br /&gt;
&lt;br /&gt;
     To remove by inode. Note the &amp;quot;--&amp;quot; option.  This&lt;br /&gt;
     will keep any special characters in the file from being&lt;br /&gt;
     interpreted at &amp;quot;rm&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
       $ find . -inum &amp;lt;inode&amp;gt; -exec rm -- '{}' \;&lt;br /&gt;
&lt;br /&gt;
     Or to check contents&lt;br /&gt;
&lt;br /&gt;
       $ find . -inum &amp;lt;inode&amp;gt; -exec cat '{}' \;&lt;br /&gt;
&lt;br /&gt;
     Reference:&lt;br /&gt;
         http://www.faqs.org/ftp/usenet/news.answers/unix-faq/faq/part2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 72:&lt;br /&gt;
&lt;br /&gt;
     Sending Attachments Using Mutt -- On the Command Line.&lt;br /&gt;
&lt;br /&gt;
        $ mutt -s &amp;quot;See Attachment&amp;quot; -a file.doc user@domain.net &amp;lt; message.txt&lt;br /&gt;
&lt;br /&gt;
          or just the message:&lt;br /&gt;
&lt;br /&gt;
        $ echo | mutt -a sample.tar.gz user@domain.net&lt;br /&gt;
&lt;br /&gt;
      Reference:&lt;br /&gt;
          http://www.shelldorado.com/articles/mailattachments.html&lt;br /&gt;
&lt;br /&gt;
        Also see (TIP 51).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 73:&lt;br /&gt;
&lt;br /&gt;
     Want to find out what functions a program calls?&lt;br /&gt;
&lt;br /&gt;
         $ strace &amp;lt;program&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Try this with &amp;quot;topen.c&amp;quot; (see PROGRAMMING TIP 5)&lt;br /&gt;
&lt;br /&gt;
         $ strace  ./topen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 74:&lt;br /&gt;
&lt;br /&gt;
     RPM Usage Summary.&lt;br /&gt;
&lt;br /&gt;
     Install. Full filename is needed.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -ivh Fedora/RPMS/postgresql-libs-7.4.2-1.i386.rpm&lt;br /&gt;
&lt;br /&gt;
     To view list of files installed with a particular package.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -ql postgresql-libs&lt;br /&gt;
                /usr/lib/libecpg.so.4&lt;br /&gt;
                /usr/lib/libecpg.so.4.1&lt;br /&gt;
                /usr/lib/libecpg_compat.so.1&lt;br /&gt;
                /usr/lib/libecpg_compat.so.1.1&lt;br /&gt;
                /usr/lib/libpgtypes.so.1&lt;br /&gt;
                ...&lt;br /&gt;
&lt;br /&gt;
     Or, to get the file listing from a package that is not installed use the&lt;br /&gt;
     &amp;quot;-p&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -pql /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/CHANGES&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/LICENSE&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/README&lt;br /&gt;
               /usr/share/man/man3/pcap.3.gz&lt;br /&gt;
&lt;br /&gt;
     For dependencies listing, use the &amp;quot;R&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qpR /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /sbin/ldconfig&lt;br /&gt;
               /sbin/ldconfig&lt;br /&gt;
               kernel &amp;gt;= 2.2.0&lt;br /&gt;
               libc.so.6&lt;br /&gt;
               libc.so.6(GLIBC_2.0)&lt;br /&gt;
               libc.so.6(GLIBC_2.1)&lt;br /&gt;
               libc.so.6(GLIBC_2.1.3)&lt;br /&gt;
               libc.so.6(GLIBC_2.3)&lt;br /&gt;
               openssl&lt;br /&gt;
               rpmlib(CompressedFileNames) &amp;lt;= 3.0.4-1&lt;br /&gt;
               rpmlib(PayloadFilesHavePrefix) &amp;lt;= 4.0-1&lt;br /&gt;
&lt;br /&gt;
     To check the integrity, use the &amp;quot;-K&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -K /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm: (sha1) dsa sha1 md5 gpg OK&lt;br /&gt;
&lt;br /&gt;
     To list all packages installed.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qa&lt;br /&gt;
&lt;br /&gt;
     To find out which file a package belongs to.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qf /usr/lib/libecpg.so.4.1&lt;br /&gt;
&lt;br /&gt;
     To uninstall a package&lt;br /&gt;
&lt;br /&gt;
         $ rpm -e&lt;br /&gt;
&lt;br /&gt;
     For building rpm packages reference the following:&lt;br /&gt;
       http://www-106.ibm.com/developerworks/library/l-rpm1/&lt;br /&gt;
&lt;br /&gt;
     To verify md5 sum so that you know it downloaded ok&lt;br /&gt;
&lt;br /&gt;
         $ rpm -K  *.rpm&lt;br /&gt;
&lt;br /&gt;
     The following is a good reference:&lt;br /&gt;
        http://www.rpm.org/max-rpm/s1-rpm-install-additional-options.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 75:&lt;br /&gt;
&lt;br /&gt;
     Listing Output from a Bash Script.&lt;br /&gt;
&lt;br /&gt;
     Add &amp;quot;set -x&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          #!/bin/bash&lt;br /&gt;
          set -x&lt;br /&gt;
          ls&lt;br /&gt;
          date&lt;br /&gt;
&lt;br /&gt;
     Will list the files and output as follows:&lt;br /&gt;
&lt;br /&gt;
           + ls&lt;br /&gt;
           ChangeLog  CVS  data  test&lt;br /&gt;
           + date&lt;br /&gt;
           Thu Jul  1 20:41:04 EDT 2004&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 76:&lt;br /&gt;
&lt;br /&gt;
     Using wget.&lt;br /&gt;
&lt;br /&gt;
     Grap a webpage and pipe it to less. For example suppose you wanted to pipe the&lt;br /&gt;
     contents of all these tips, directly from the web.&lt;br /&gt;
&lt;br /&gt;
      $ wget -O - http://sourceforge.net/direct-dl/mchirico/souptonuts/How_to_Linux_and_Open_Source.txt|less&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 77:&lt;br /&gt;
&lt;br /&gt;
     Finding IP address and MAC address.&lt;br /&gt;
&lt;br /&gt;
       $ /sbin/ifconfig&lt;br /&gt;
&lt;br /&gt;
     Note the following output &amp;quot;eth0&amp;quot; and &amp;quot;eth0:1&amp;quot; which means&lt;br /&gt;
     two IP addresses are tied to 1 NIC (Network Interface Card).&lt;br /&gt;
&lt;br /&gt;
             eth0      Link encap:Ethernet  HWaddr 00:50:DA:60:5B:AD&lt;br /&gt;
                       inet addr:192.168.1.155  Bcast:192.168.99.255  Mask:255.255.252.0&lt;br /&gt;
                       UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
                       RX packets:982757 errors:116 dropped:0 overruns:0 frame:116&lt;br /&gt;
                       TX packets:439297 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:1000&lt;br /&gt;
                       RX bytes:693529078 (661.4 Mb)  TX bytes:78400296 (74.7 Mb)&lt;br /&gt;
                       Interrupt:10 Base address:0xa800&lt;br /&gt;
&lt;br /&gt;
             eth0:1    Link encap:Ethernet  HWaddr 00:50:DA:60:5B:AD&lt;br /&gt;
                       inet addr:192.168.1.182  Bcast:192.168.3.255  Mask:255.255.252.0&lt;br /&gt;
                       UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
                       RX packets:982757 errors:116 dropped:0 overruns:0 frame:116&lt;br /&gt;
                       TX packets:439299 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:1000&lt;br /&gt;
                       RX bytes:693529078 (661.4 Mb)  TX bytes:78400636 (74.7 Mb)&lt;br /&gt;
                       Interrupt:10 Base address:0xa800&lt;br /&gt;
&lt;br /&gt;
             lo        Link encap:Local Loopback&lt;br /&gt;
                       inet addr:127.0.0.1  Mask:255.0.0.0&lt;br /&gt;
                       UP LOOPBACK RUNNING  MTU:16436  Metric:1&lt;br /&gt;
                       RX packets:785 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
                       TX packets:785 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:0&lt;br /&gt;
                       RX bytes:2372833 (2.2 Mb)  TX bytes:2372833 (2.2 Mb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 78:&lt;br /&gt;
&lt;br /&gt;
     DOS to UNIX and UNIX to DOS.&lt;br /&gt;
&lt;br /&gt;
        $ dos2unix file.txt&lt;br /&gt;
&lt;br /&gt;
     And to go the other way from UNIX to DOS&lt;br /&gt;
&lt;br /&gt;
        $ unix2dos unixfile&lt;br /&gt;
&lt;br /&gt;
     See the man page, since there are MAC options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     NOTE: If you're working file DOS files, you'll probably want to use&lt;br /&gt;
           &amp;quot;zip&amp;quot; instead of &amp;quot;gzip&amp;quot; so users on Windows can unzip them.&lt;br /&gt;
&lt;br /&gt;
              $ zip test.zip test.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 79:&lt;br /&gt;
&lt;br /&gt;
     Need to Run Interactive Commands? Try &amp;quot;expect&amp;quot;.&lt;br /&gt;
       http://expect.nist.gov/expect.tar.gz&lt;br /&gt;
&lt;br /&gt;
     This simple example waits for the input &amp;quot;hi&amp;quot;, in some form before&lt;br /&gt;
     returning, immediately, &amp;quot;hello there!&amp;quot;. Otherwise, it will wait for&lt;br /&gt;
     60 seconds, then, return &amp;quot;hello there!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/expect&lt;br /&gt;
          set timeout 60&lt;br /&gt;
          expect &amp;quot;hi\n&amp;quot;&lt;br /&gt;
          send &amp;quot;hello there!\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference:&lt;br /&gt;
        http://www.oreilly.com/catalog/expect/chapter/ch03.html&lt;br /&gt;
&lt;br /&gt;
        http://www.cotse.com/dlf/man/expect/bulletproof1.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 80:&lt;br /&gt;
&lt;br /&gt;
     Using PHP as a Command Line Scripting Language.&lt;br /&gt;
&lt;br /&gt;
     The following will grab the complete file from slashdot.&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/php -q&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;?php&lt;br /&gt;
         $fileName = &amp;quot;http://slashdot.org/slashdot.xml&amp;quot;;&lt;br /&gt;
         $rss = file($fileName) or die (&amp;quot;Cannot open file $fileName\n&amp;quot;);&lt;br /&gt;
         for ($index=0; $index &amp;lt; count($rss); $index++)&lt;br /&gt;
              {&lt;br /&gt;
              echo $rss[$index];&lt;br /&gt;
              }&lt;br /&gt;
         ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       Note, if you want an example that parses the XML of&lt;br /&gt;
       slashdot, then, download the following:&lt;br /&gt;
&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/php_scripts.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 81:&lt;br /&gt;
&lt;br /&gt;
     Discarding all output -- including stderr messages.&lt;br /&gt;
&lt;br /&gt;
         $ ls  &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     Or sending all output to a file&lt;br /&gt;
&lt;br /&gt;
         $ someprog &amp;gt; /tmp/file 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     Sometimes, find displays a lot of errors when searching through&lt;br /&gt;
     directories that the user doesn't have access to. To discard&lt;br /&gt;
     error messages &amp;quot;stderr&amp;quot;, which is normally file descripter &amp;quot;2&amp;quot;&lt;br /&gt;
     work the following:&lt;br /&gt;
&lt;br /&gt;
         $ find / -iname 'stuff' 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
          or to pipe results elsewhere&lt;br /&gt;
&lt;br /&gt;
         $ find / -iname 'stuff' &amp;gt; /tmp/results_of_find  2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 118).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 82:&lt;br /&gt;
&lt;br /&gt;
     Using MIX.  D. Knuth's  assembly language/machine-code instruction set used in&lt;br /&gt;
     his books to illustrate his algorithms.&lt;br /&gt;
&lt;br /&gt;
     Download the source:&lt;br /&gt;
&lt;br /&gt;
       http://sourceforge.net/project/showfiles.php?group_id=13897&lt;br /&gt;
&lt;br /&gt;
       $ ./configure&lt;br /&gt;
       $ make&lt;br /&gt;
       $ make install&lt;br /&gt;
&lt;br /&gt;
     Documentation can be found at the following link. The link on&lt;br /&gt;
     sourceforge is not correct, but, the one below works.&lt;br /&gt;
&lt;br /&gt;
       http://www.gnu.org/software/mdk/manual/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 83:&lt;br /&gt;
&lt;br /&gt;
     Gnuplot [ http://sourceforge.net/projects/gnuplot/ ].&lt;br /&gt;
&lt;br /&gt;
     This software is ideal for printing graphs.&lt;br /&gt;
&lt;br /&gt;
         gnuplot&amp;gt; set term png&lt;br /&gt;
         gnuplot&amp;gt; set output 'testcos.png'&lt;br /&gt;
         gnuplot&amp;gt; plot cos(x)*sin(x)&lt;br /&gt;
         gnuplot&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
     Or the following command can be put into &amp;quot;file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            $ cat &amp;gt; file&lt;br /&gt;
            set term png&lt;br /&gt;
            set output 'testcos.png'&lt;br /&gt;
            plot cos(x)*sin(x)&lt;br /&gt;
            exit&lt;br /&gt;
            ^D&lt;br /&gt;
&lt;br /&gt;
     Then, run as follows:&lt;br /&gt;
&lt;br /&gt;
            $ gnuplot file&lt;br /&gt;
&lt;br /&gt;
     Or, suppose you have the following file &amp;quot;/home/chirico/data&amp;quot;. Comments&lt;br /&gt;
     with &amp;quot;#&amp;quot; are not read by gnuplot.&lt;br /&gt;
&lt;br /&gt;
            # File /home/chirico/data&lt;br /&gt;
            #&lt;br /&gt;
            2005-07-26  1    2.3    3&lt;br /&gt;
            2005-07-27  2    3.4    5&lt;br /&gt;
            2005-07-28  3    4    6.6&lt;br /&gt;
            2005-07-29  4    6    2.5&lt;br /&gt;
&lt;br /&gt;
     And you have the following new &amp;quot;file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            set term png&lt;br /&gt;
            set xdata time&lt;br /&gt;
            set timefmt &amp;quot;%Y-%m-%d &amp;quot;&lt;br /&gt;
            set format x &amp;quot;%Y/%m/%d&amp;quot;&lt;br /&gt;
            set output '/var/www/html/chirico/gnuplot/data.png'&lt;br /&gt;
            plot '/home/chirico/data' using 1:2 w linespoints  title '1st col', \&lt;br /&gt;
             '/home/chirico/data' using 1:3 w linespoints  title '2nd col', \&lt;br /&gt;
             '/home/chirico/data' using 1:4 w linespoints  title '3rd col'&lt;br /&gt;
            exit&lt;br /&gt;
&lt;br /&gt;
     You can now get a graph of this data running the following:&lt;br /&gt;
&lt;br /&gt;
            $ gnuplot file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 84:&lt;br /&gt;
&lt;br /&gt;
     CPU Information - speed, processor, cache.&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/cpuinfo&lt;br /&gt;
&lt;br /&gt;
               processor       : 0&lt;br /&gt;
               vendor_id       : GenuineIntel&lt;br /&gt;
               cpu family      : 15&lt;br /&gt;
               model           : 2&lt;br /&gt;
               model name      : Intel(R) Pentium(R) 4 CPU 2.20GHz&lt;br /&gt;
               stepping        : 9&lt;br /&gt;
               cpu MHz         : 2193.221&lt;br /&gt;
               cache size      : 512 KB&lt;br /&gt;
               fdiv_bug        : no&lt;br /&gt;
               hlt_bug         : no&lt;br /&gt;
               f00f_bug        : no&lt;br /&gt;
               coma_bug        : no&lt;br /&gt;
               fpu             : yes&lt;br /&gt;
               fpu_exception   : yes&lt;br /&gt;
               cpuid level     : 2&lt;br /&gt;
               wp              : yes&lt;br /&gt;
               flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr&lt;br /&gt;
               bogomips        : 4325.37&lt;br /&gt;
&lt;br /&gt;
      &amp;quot;bogomips&amp;quot; is a rough but good way to quickly compare two computer speeds. True it's a&lt;br /&gt;
      bogus reading; but, a &amp;quot;good enough&amp;quot; for government work calculation.  See (TIP 10) for&lt;br /&gt;
      &amp;quot;vmstat&amp;quot; and &amp;quot;iostat&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 85:&lt;br /&gt;
&lt;br /&gt;
     POVRAY - Making Animated GIFs&lt;br /&gt;
&lt;br /&gt;
     To see this in action, reference:&lt;br /&gt;
      http://souptonuts.sourceforge.net/povray/orbit.pov.html&lt;br /&gt;
&lt;br /&gt;
     These are the basic command to create:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        $ povray orbit.ini -Iorbit.pov&lt;br /&gt;
        $ convert -delay 20 *.ppm orbit.gif&lt;br /&gt;
&lt;br /&gt;
     By the way, convert is a program from imagemagick, and it can&lt;br /&gt;
     be downloaded from ( http://www.imagemagick.org ).&lt;br /&gt;
&lt;br /&gt;
    The following is &amp;quot;orbit.pov&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          #include &amp;quot;colors.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;finish.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;metals.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;textures.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;stones.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;skies.inc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          camera {&lt;br /&gt;
            location &amp;lt; 2, 3, -8 &amp;gt;&lt;br /&gt;
            look_at  &amp;lt; 0, 0, 0 &amp;gt;&lt;br /&gt;
            focal_point &amp;lt;0, 0, 0&amp;gt;&lt;br /&gt;
            blur_samples 20&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          light_source {&lt;br /&gt;
                  &amp;lt; 0, 10, 0&amp;gt;&lt;br /&gt;
                  color White&lt;br /&gt;
                  area_light &amp;lt;2,0,0&amp;gt;,&amp;lt;0,0,2&amp;gt;, 2, 2&lt;br /&gt;
                  adaptive 1&lt;br /&gt;
                  fade_distance 8&lt;br /&gt;
                  fade_power 1&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          sky_sphere {&lt;br /&gt;
            S_Cloud3&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          plane { &amp;lt;0, 1, 0&amp;gt;, -1&lt;br /&gt;
                  texture {&lt;br /&gt;
                          pigment {&lt;br /&gt;
                                  checker color Blue, color White&lt;br /&gt;
                          }&lt;br /&gt;
                          finish {Phong_Glossy}&lt;br /&gt;
                  }&lt;br /&gt;
          }&lt;br /&gt;
          #declare ball0=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;0.5, 0.5, 0&amp;gt;, 1&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Yellow}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          #declare ball1=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;3, 2, 0&amp;gt;, 0.5&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Blue}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          #declare ball2=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;3, 1, 0&amp;gt;, 1&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Green}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          object {ball0 rotate 360*clock*y}&lt;br /&gt;
          object {ball1 rotate 720*clock*y}&lt;br /&gt;
          object {ball2 rotate 360*(1 - clock)*y}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    And, &amp;quot;orbit.ini&amp;quot; follows:&lt;br /&gt;
&lt;br /&gt;
          Output_File_Type=P&lt;br /&gt;
&lt;br /&gt;
          Width=320&lt;br /&gt;
          Height=240&lt;br /&gt;
&lt;br /&gt;
          Initial_Frame=1&lt;br /&gt;
          Final_Frame=10&lt;br /&gt;
          Antialias=true&lt;br /&gt;
&lt;br /&gt;
          Subset_Start_Frame=1&lt;br /&gt;
          Subset_End_Frame=10&lt;br /&gt;
&lt;br /&gt;
          Cyclic_Animation=on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 86:&lt;br /&gt;
&lt;br /&gt;
     GPG --  GnuPG&lt;br /&gt;
&lt;br /&gt;
        Reference: http://www.gnupg.org/documentation/faqs.html&lt;br /&gt;
                   http://codesorcery.net/mutt/mutt-gnupg-howto&lt;br /&gt;
                   http://www.gnupg.org/(en)/download/index.html&lt;br /&gt;
                   (SCRIPT 4) on following link:&lt;br /&gt;
                   http://prdownloads.sourceforge.net/souptonuts/README_common_script_commands.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Generage key:&lt;br /&gt;
&lt;br /&gt;
        $ gpg --gen-key&lt;br /&gt;
&lt;br /&gt;
     Generate public key ID and fingerprint&lt;br /&gt;
&lt;br /&gt;
        $ gpg --fingerprint&lt;br /&gt;
&lt;br /&gt;
     Get a list of keys:&lt;br /&gt;
&lt;br /&gt;
        $ gpg --list-keys&lt;br /&gt;
&lt;br /&gt;
          pub  1024D/A11C1499 2004-07-15 Mike Chirico &amp;lt;mchirico@comcast.net&amp;gt;&lt;br /&gt;
          sub  1024g/E1A3C2B3 2004-07-15&lt;br /&gt;
&lt;br /&gt;
     Encrypt&lt;br /&gt;
&lt;br /&gt;
        $ gpg -r Mike  --encrypt sample.txt&lt;br /&gt;
&lt;br /&gt;
       This will produce &amp;quot;sample.txt.asc&amp;quot;, which is a binary file.  Note, I can use &amp;quot;Mike&amp;quot; because that's the&lt;br /&gt;
       name on the list of keys. Again, it will be a binary file.&lt;br /&gt;
&lt;br /&gt;
     Encrypt using &amp;quot;ASCII-armored text&amp;quot;  (--armor), which is probably what you want when sending &amp;quot;in&amp;quot; the body of an&lt;br /&gt;
     email, or some document.&lt;br /&gt;
&lt;br /&gt;
        $ gpg  -r Mike  --encrypt --armor sample.txt&lt;br /&gt;
            or&lt;br /&gt;
        $ gpg -r Mike -e -a sample.txt&lt;br /&gt;
            or&lt;br /&gt;
        $ gpg --output somefile.asc --armor -r Mike  --encrypt --armor sample.txt&lt;br /&gt;
&lt;br /&gt;
     The above 3 statements will still produce &amp;quot;sample.txt.asc&amp;quot;, but look at it, or &amp;quot;$ cat sample.txt.asc&amp;quot; without &lt;br /&gt;
     fear, since there are no binary characters. Yes, you could even compile a program &amp;quot;$ g++ -o test test.c&amp;quot; , then,&lt;br /&gt;
     &amp;quot;$ gpg --output test.asc  -r Mike --encrypt --armor test&amp;quot;. However, when decrypting make sure to pipe&lt;br /&gt;
     the results.&lt;br /&gt;
&lt;br /&gt;
            $ gpg --decrypt test.asc &amp;gt; test&lt;br /&gt;
&lt;br /&gt;
     Export &amp;quot;public&amp;quot; key:&lt;br /&gt;
&lt;br /&gt;
           $ gpg --armor --export Mike &amp;gt; m1.asc&lt;br /&gt;
&lt;br /&gt;
     Signing the file &amp;quot;message.txt&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
           $ gpg --clearsign message.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Sending the key to the &amp;quot;key-server&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        First, list the keys.&lt;br /&gt;
&lt;br /&gt;
                $ gpg --list-keys&lt;br /&gt;
                    /home/chirico/.gnupg/pubring.gpg&lt;br /&gt;
                                 v------------------ Use this with &amp;quot;0x&amp;quot; in front -------&lt;br /&gt;
                  pub  1024D/A11C1499 2004-07-15 Mike Chirico  &amp;lt;mchirico@comcast.net&amp;gt;   |&lt;br /&gt;
                  sub  1024g/E1A3C2B3 2004-07-15                                        |&lt;br /&gt;
                                                                                        |&lt;br /&gt;
                                   v----------------------------------------------------&lt;br /&gt;
                $ gpg --send-keys 0xA11C1499&lt;br /&gt;
&lt;br /&gt;
             The above sends it to the keyserver defined in &amp;quot;/home/chirico/.gnupg/gpg.conf&amp;quot;.  Other key servers:&lt;br /&gt;
&lt;br /&gt;
                            wwwkeys.pgp.net&lt;br /&gt;
                            search.keyserver.net&lt;br /&gt;
                            pgp.ai.mit.edu&lt;br /&gt;
&lt;br /&gt;
             When you go to your user-group meetings, you need to bring 2 forms of ID, and&lt;br /&gt;
             list your Key fingerprint. Shown below is the command for getting this fingerprint.&lt;br /&gt;
&lt;br /&gt;
                $ gpg --fingerprint mchirico@comcast.net&lt;br /&gt;
                 pub   1024D/A11C1499 2004-07-15&lt;br /&gt;
                 Key fingerprint = 9D7F C80D BB7B 4BAB CCA4  1BE9 9056 5BEC A11C 1499&lt;br /&gt;
                 uid   Mike Chirico (http://souptonuts.sourceforge.net/chirico/index.php) &amp;lt;mchirico@comcast.net&amp;gt;&lt;br /&gt;
                 sub   1024g/E1A3C2B3 2004-07-15&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Receving keys:&lt;br /&gt;
&lt;br /&gt;
        The following will retrieve my mchirico@comcast.net key&lt;br /&gt;
&lt;br /&gt;
               $ gpg --recv-keys 0xA11C1499&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Special Note: If you get the following error &amp;quot;GPG: Warning: Using Insecure Memory&amp;quot; , then,&lt;br /&gt;
                   &amp;quot; chmod 4755 /path/to/gpg&amp;quot;  to setuid(root) permissioins on the gpg binary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     NOTE: If using mutt, just before sending with the &amp;quot;y&amp;quot; option, hit &amp;quot;p&amp;quot; to sign or encrypt.&lt;br /&gt;
&lt;br /&gt;
     It's possible to create a gpg/pgp email from the command line. For a tutorial on this,&lt;br /&gt;
     reference (SCRIPT 4) at the following link:&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/README_common_script_commands.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 87:&lt;br /&gt;
&lt;br /&gt;
     Working with Dates: Steffen Beyer has developed a Perl and C module for working with dates&lt;br /&gt;
&lt;br /&gt;
     This softare can be downloaded from the following location:&lt;br /&gt;
        http://www.engelschall.com/u/sb/download/pkg/Date-Calc-5.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
         $ wget http://www.engelschall.com/u/sb/download/pkg/Date-Calc-5.3.tar.gz&lt;br /&gt;
         $ tar -xzvf Date-Calc-5.3.tar.gz&lt;br /&gt;
         $ cd Date-Calc-5.3&lt;br /&gt;
         $ cp ./examples/cal.c .&lt;br /&gt;
         $ gcc cal.c DateCalc.c -o mcal&lt;br /&gt;
&lt;br /&gt;
     The file cal.c contains sample function calls from DateCalc.c.  Note, &amp;quot;DateCalc.c&amp;quot;&lt;br /&gt;
     is just a list of functions and includes for &amp;quot;DateCalc.h&amp;quot; and &amp;quot;ToolBox.h&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Or, and this may be easier, just download the following:&lt;br /&gt;
         http://prdownloads.sourceforge.net/cpearls/date_calc.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
     The above link contains a few examples.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 88:&lt;br /&gt;
&lt;br /&gt;
     Color patterns for mutt.&lt;br /&gt;
&lt;br /&gt;
     The colors can be changed in the /home/user/.muttrc file. The first field begins with&lt;br /&gt;
     color, the second field is the foreground color, and the third field is the background&lt;br /&gt;
     color, or default.&lt;br /&gt;
&lt;br /&gt;
     An example .muttrc for colors:&lt;br /&gt;
&lt;br /&gt;
       # color patterns for mutt&lt;br /&gt;
       color normal     white          black # normal text&lt;br /&gt;
       color indicator  black          yellow  # actual message&lt;br /&gt;
       color tree       brightmagenta  default # thread arrows&lt;br /&gt;
       color status     brightyellow         default # status line&lt;br /&gt;
       color error      brightred      default # errors&lt;br /&gt;
       color message    magenta        default # info messages&lt;br /&gt;
       color signature  magenta        default # signature&lt;br /&gt;
       color attachment brightyellow   red     # MIME attachments&lt;br /&gt;
       color search     brightyellow   red     # search matches&lt;br /&gt;
       color tilde      brightmagenta  default # ~ at bottom of msg&lt;br /&gt;
       color markers    red            default # + at beginning of wrapped lines&lt;br /&gt;
       color hdrdefault cyan           default # default header lines&lt;br /&gt;
       color bold       red            default # hiliting bold patterns in body&lt;br /&gt;
       color underline  green          default # hiliting underlined patterns in body&lt;br /&gt;
       color quoted     cyan           default # quoted text&lt;br /&gt;
       color quoted1    magenta        default&lt;br /&gt;
       color quoted2    red            default&lt;br /&gt;
       color quoted3    green          default&lt;br /&gt;
       color quoted4    magenta           default&lt;br /&gt;
       color quoted5    cyan           default&lt;br /&gt;
       color quoted6    magenta        default&lt;br /&gt;
       color quoted7    red            default&lt;br /&gt;
       color quoted8    green          default&lt;br /&gt;
       color quoted9    cyan           default&lt;br /&gt;
       color body   cyan  default  &amp;quot;((ftp|http|https)://|news:)[^ &amp;gt;)\&amp;quot;\t]+&amp;quot;&lt;br /&gt;
       color body   cyan  default  &amp;quot;[-a-z_0-9.+]+@[-a-z_0-9.]+&amp;quot;&lt;br /&gt;
       color body   red   default  &amp;quot;(^| )\\*[-a-z0-9*]+\\*[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color body   green default  &amp;quot;(^| )_[-a-z0-9_]+_[,.?]?[\n]&amp;quot;&lt;br /&gt;
       color body   red   default  &amp;quot;(^| )\\*[-a-z0-9*]+\\*[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color body   green default  &amp;quot;(^| )_[-a-z0-9_]+_[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color index  cyan  default  ~F         # Flagged&lt;br /&gt;
       color index  red   default  ~N         # New&lt;br /&gt;
       color index  magenta    default  ~T         # Tagged&lt;br /&gt;
       color index  cyan       default  ~D         # Deleted&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 190)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 89:&lt;br /&gt;
&lt;br /&gt;
     ps command in detail&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Here are the possible codes when using state &amp;quot;$ ps -e -o state,cmd&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             PROCESS STATE CODES&lt;br /&gt;
                  D   uninterruptible sleep (usually IO)&lt;br /&gt;
                  R   runnable (on run queue)&lt;br /&gt;
                  S   sleeping&lt;br /&gt;
                  T   traced or stopped&lt;br /&gt;
                  Z   a defunct (&amp;quot;zombie&amp;quot;) process&lt;br /&gt;
&lt;br /&gt;
                  &amp;lt;    high-priority (not nice to other users)&lt;br /&gt;
                  N    low-priority (nice to other users)&lt;br /&gt;
                  L    has pages locked into memory (for real-time and custom IO)&lt;br /&gt;
                  s    is a session leader&lt;br /&gt;
                  l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)&lt;br /&gt;
                  +    is in the foreground process group&lt;br /&gt;
&lt;br /&gt;
    For instance:&lt;br /&gt;
&lt;br /&gt;
     Note that the -o is for user defined, and -e is for select&lt;br /&gt;
     all process.&lt;br /&gt;
&lt;br /&gt;
       $ ps -e -o pid,state,start,time,etime,cmd&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
             9946 S 15:40:45 00:00:00    02:23:29 /bin/bash -i&lt;br /&gt;
             9985 T 15:41:24 00:00:01    02:22:50 emacs mout2&lt;br /&gt;
            10003 T 15:43:59 00:00:00    02:20:15 emacs NOTES&lt;br /&gt;
            10320 T 17:38:42 00:00:00       25:32 emacs stuff.c&lt;br /&gt;
         ...&lt;br /&gt;
&lt;br /&gt;
     You may want to command below, without the -e, which will give the&lt;br /&gt;
     process only under the current terminal.&lt;br /&gt;
&lt;br /&gt;
       $ ps -o pid,state,start,time,etime,cmd&lt;br /&gt;
&lt;br /&gt;
     Want to find what 's impacting your load?&lt;br /&gt;
&lt;br /&gt;
       $ ps -e -o %cpu,pid,state,start,time,etime,%cpu,%mem,cmd|sort -rn|less&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ ps aux&lt;br /&gt;
&lt;br /&gt;
            USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND&lt;br /&gt;
            root         1  0.0  0.0  1380  480 ?        S    Aug04   0:00 init [3]&lt;br /&gt;
            root         2  0.0  0.0     0    0 ?        SWN  Aug04   0:00 [ksoftirqd/0]&lt;br /&gt;
            root         3  0.0  0.0     0    0 ?        SW&amp;lt;  Aug04   0:00 [events/0]&lt;br /&gt;
            root         4  0.0  0.0     0    0 ?        SW&amp;lt;  Aug04   0:00 [khelper]&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     Or, if you want to see the environment add the -e option&lt;br /&gt;
&lt;br /&gt;
       $ ps aeux&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
            chirico   2735  0.0  0.1  4400 1492 pts/0    S    Aug04   0:00 -bash USER=chirico LOGNAME=chirico HOME=/home/chirico PATH=/usr/&lt;br /&gt;
            chirico   2771  0.0  0.0  4328  924 pts/0    S    Aug04   0:00 screen -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm S&lt;br /&gt;
            chirico   2772  0.0  0.6  9476 6352 ?        S    Aug04   0:54 SCREEN -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm S&lt;br /&gt;
            chirico   2773  0.0  0.1  4432 1548 pts/1    S    Aug04   0:10 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            chirico   2797  0.0  0.1  4416 1496 pts/2    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            root      2821  0.0  0.0  4100  952 pts/2    S    Aug04   0:00 su -&lt;br /&gt;
            root      2822  0.0  0.1  4384 1480 pts/2    S    Aug04   0:00 -bash&lt;br /&gt;
            chirico   2862  0.0  0.1  4428 1524 pts/3    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            sporkey   2946  0.0  0.2  6836 2960 ?        S    Aug04   0:15 fetchmail&lt;br /&gt;
            chirico   2952  0.0  0.1  4436 1552 pts/5    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            chirico   3880  0.0  0.1  4416 1496 pts/6    S    Aug05   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            root      3904  0.0  0.0  4100  956 pts/6    S    Aug05   0:00 su - donkey&lt;br /&gt;
            donkey    3905  0.0  0.1  4336 1452 pts/6    S    Aug05   0:00 -bash&lt;br /&gt;
            donkey    3938  0.0  0.2  6732 2856 ?        S    Aug05   0:14 fetchmail&lt;br /&gt;
            chirico   3944  0.0  0.1  4416 1496 pts/7    S    Aug05   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     There is also a -f &amp;quot;forrest&amp;quot; option. Also note below &amp;quot; -bash&amp;quot; is the start of a login shell.&lt;br /&gt;
&lt;br /&gt;
      $ ps aeuxwwf &lt;br /&gt;
     &lt;br /&gt;
     The ww option above gives a wide format with all variables. Use the above command if you plan&lt;br /&gt;
     to parse through a Perl script. Otherwise, it may be easier to do a quick read using the command&lt;br /&gt;
     below, without &amp;quot;ww&amp;quot;.    &lt;br /&gt;
&lt;br /&gt;
      $ ps aeuxf&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
            root      2339  0.0  0.1  3512 1444 ?        S    Dec01   0:00 /usr/sbin/sshd&lt;br /&gt;
            root     25651  0.0  0.1  6764 1980 ?        S    Dec23   0:00  \_ /usr/sbin/sshd&lt;br /&gt;
            chirico  25653  0.0  0.2  6840 2236 ?        S    Dec23   0:14      \_ /usr/sbin/sshd&lt;br /&gt;
            chirico  25654  0.0  0.1  4364 1440 pts/4    S    Dec23   0:00          \_ -bash USER=chirico LOGNAME=chirico HOME=/home/chirico&lt;br /&gt;
            chirico  25690  0.0  0.0  4328  920 pts/4    S    Dec23   0:00              \_ screen -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm&lt;br /&gt;
            root      2355  0.0  0.0  2068  904 ?        S    Dec01   0:00 xinetd -stayalive -pidfile /var/run/xinetd.pid&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     It is also possible to list the process by command line. For example, the following command will only list the emacs&lt;br /&gt;
     processes.&lt;br /&gt;
&lt;br /&gt;
      $ ps -fC emacs&lt;br /&gt;
       UID        PID  PPID  C STIME TTY          TIME CMD&lt;br /&gt;
       chirico   5049  5020  0 May11 pts/13   00:00:00 emacs -nw Notes&lt;br /&gt;
       chirico  12368  5104  0 May12 pts/18   00:00:00 emacs -nw dnotify.c&lt;br /&gt;
       chirico  19792 18028  0 May13 pts/20   00:00:00 emacs -nw hello.c&lt;br /&gt;
       chirico  14034 27367  0 18:52 pts/8    00:00:00 emacs -nw How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
     You may also want to consider using top in batch mode. Here the &amp;quot;-n 1&amp;quot; means refresh once,&lt;br /&gt;
     and the &amp;quot;b&amp;quot; is for batch. The &amp;quot;fmt -s&amp;quot; is to put it in a more readable format.&lt;br /&gt;
&lt;br /&gt;
       $ top -n 1 b |fmt  -s &amp;gt;&amp;gt;statfile&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 90:&lt;br /&gt;
&lt;br /&gt;
     Learning Assembly.&lt;br /&gt;
&lt;br /&gt;
     Once you have written the source, assuming the file is &amp;quot;exit.s&amp;quot;, it can be compiled as follows:&lt;br /&gt;
&lt;br /&gt;
            $ as exit.s -o exit.o&lt;br /&gt;
            $ ld exit.o -o exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Here is the program:&lt;br /&gt;
&lt;br /&gt;
         #&lt;br /&gt;
         #INPUT:  none&lt;br /&gt;
         #&lt;br /&gt;
         #OUTPUT:         returns a status code. This can be viewed&lt;br /&gt;
         # by typing&lt;br /&gt;
         #&lt;br /&gt;
         # echo $?&lt;br /&gt;
         #&lt;br /&gt;
         # after running the program&lt;br /&gt;
         #&lt;br /&gt;
         #VARIABLES:&lt;br /&gt;
         # %eax holds the system call number&lt;br /&gt;
         # (this is always the case)&lt;br /&gt;
         #&lt;br /&gt;
         # %ebx holds the return status&lt;br /&gt;
         #&lt;br /&gt;
                 .section .data&lt;br /&gt;
                 .section .text&lt;br /&gt;
&lt;br /&gt;
                 .globl _start&lt;br /&gt;
         _start:&lt;br /&gt;
                 movl $1, %eax # this is the linux kernel command&lt;br /&gt;
                 # number (system call) for exiting&lt;br /&gt;
                 # a program&lt;br /&gt;
                 movl $0, %ebx # this is the status number we will&lt;br /&gt;
                 # return to the operating system.&lt;br /&gt;
                 # Change this around and it will&lt;br /&gt;
                 # return different things to&lt;br /&gt;
                 # echo $?&lt;br /&gt;
                 int $0x80 # this wakes up the kernel to run&lt;br /&gt;
                 # the exit command&lt;br /&gt;
&lt;br /&gt;
     After running this program, you can get the exit code.&lt;br /&gt;
&lt;br /&gt;
            $ exit $?&lt;br /&gt;
            0&lt;br /&gt;
&lt;br /&gt;
     That is about all it does; but, get the book for more details. The&lt;br /&gt;
     book is free.&lt;br /&gt;
&lt;br /&gt;
          http://savannah.nongnu.org/download/pgubook/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 91:&lt;br /&gt;
&lt;br /&gt;
     Creating a sandbox for reiserfstune,debugreiserfs and ACL.  Also see TIP 4.&lt;br /&gt;
&lt;br /&gt;
     Assume you have a reisers files system created from a disk file, which&lt;br /&gt;
     means you have done something like the following:&lt;br /&gt;
&lt;br /&gt;
          # dd if=/dev/zero of=disk-rfs count=102400&lt;br /&gt;
          # losetup  /dev/loop4 ./disk-rfs&lt;br /&gt;
          # mkfs -t reiserfs /dev/loop4&lt;br /&gt;
          # mkdir /fs2&lt;br /&gt;
          # mount -o loop,acl ./disk-rfs /fs2&lt;br /&gt;
&lt;br /&gt;
     Now, you can run reiserfstune. But, first you will need to umount fs2&lt;br /&gt;
&lt;br /&gt;
          # umount /fs2&lt;br /&gt;
          # reiserfstune ./disk-rfs&lt;br /&gt;
&lt;br /&gt;
     Or you can run the debug command&lt;br /&gt;
&lt;br /&gt;
          # debugreiserfs -J ./disk-rfs&lt;br /&gt;
&lt;br /&gt;
     Now, suppose you run through a lot of the debug options on&lt;br /&gt;
     http://www.namesys.com/ and you destroy this file.&lt;br /&gt;
&lt;br /&gt;
     You can recreate the file and delete the loop device.&lt;br /&gt;
&lt;br /&gt;
          # dd if=/dev/zero of=disk-rfs count=102400&lt;br /&gt;
          # losetup -d /dev/loop4&lt;br /&gt;
          # mount -o loop,acl ./disk-rfs /fs2&lt;br /&gt;
&lt;br /&gt;
     Now, try working with some of the ACL options - you can only do this&lt;br /&gt;
     with the latest kernel and tools -- Fedora Core 2 will work.&lt;br /&gt;
&lt;br /&gt;
     Assume you have 3 users, donkey, chirico and bozo2. You can give&lt;br /&gt;
     everyone rights to this file system as follows:&lt;br /&gt;
&lt;br /&gt;
          # setfacl -R -m d:u:donkey:rwx,d:u:chirico:rwx,d:u:bozo2:rwx /fs2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 92:&lt;br /&gt;
&lt;br /&gt;
     SpamAssassin - Setup.&lt;br /&gt;
&lt;br /&gt;
     Step 1.&lt;br /&gt;
&lt;br /&gt;
           Installing the SpamAssassin CPAN utility. You will need to do this&lt;br /&gt;
           as root.&lt;br /&gt;
        &lt;br /&gt;
              $ su -&lt;br /&gt;
&lt;br /&gt;
           Once you have root privileges invoke cpan.&lt;br /&gt;
        &lt;br /&gt;
              # perl -MCPAN -e shell&lt;br /&gt;
&lt;br /&gt;
              cpan&amp;gt;&lt;br /&gt;
&lt;br /&gt;
           Now install with prerequisites policy set to ask.&lt;br /&gt;
        &lt;br /&gt;
              cpan&amp;gt; o conf prerequisites_policy ask&lt;br /&gt;
        &lt;br /&gt;
              cpan&amp;gt; install Mail::SpamAssassin&lt;br /&gt;
        &lt;br /&gt;
           You will get lots of output as the necessary modules are downloaded and&lt;br /&gt;
           compiled and installed.&lt;br /&gt;
&lt;br /&gt;
     Step 2.&lt;br /&gt;
&lt;br /&gt;
            Configuration.&lt;br /&gt;
&lt;br /&gt;
            Edit the following &amp;quot;/etc/mail/spamassassin/local.cf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            Here is a look at my file&lt;br /&gt;
&lt;br /&gt;
                $ cat /etc/mail/spamassassin/local.cf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                # This is the right place to customize your installation of SpamAssassin.&lt;br /&gt;
                #&lt;br /&gt;
                # See 'perldoc Mail::SpamAssassin::Conf' for details of what can be&lt;br /&gt;
                # tweaked.&lt;br /&gt;
                #&lt;br /&gt;
                ###########################################################################&lt;br /&gt;
                #&lt;br /&gt;
                # rewrite_subject 0&lt;br /&gt;
                # report_safe 1&lt;br /&gt;
                # trusted_networks 212.17.35.&lt;br /&gt;
                #&lt;br /&gt;
                &lt;br /&gt;
                # Below added from book&lt;br /&gt;
                # You may want to set this to 5, then, work your way down.&lt;br /&gt;
                # Currently I have this 3&lt;br /&gt;
                required_hits 3&lt;br /&gt;
                &lt;br /&gt;
                # This determines how spam is reported. Currently safe email is reported&lt;br /&gt;
                # in the message.&lt;br /&gt;
                report_safe 1&lt;br /&gt;
                &lt;br /&gt;
                # The will rewrite the tag of the spam message.&lt;br /&gt;
                rewrite_subject 1&lt;br /&gt;
                &lt;br /&gt;
                # By default, SpamAssassin will run RBL checks.  If your ISP already&lt;br /&gt;
                # does this, set this to 1.&lt;br /&gt;
                skip_rbl_checks 0&lt;br /&gt;
&lt;br /&gt;
     Step 3.&lt;br /&gt;
&lt;br /&gt;
            Update .procmail.&lt;br /&gt;
&lt;br /&gt;
            You should update the .procmail file as follows. Here is my /home/chirico/.procmail file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ cat /home/chirico/.procmailrc&lt;br /&gt;
&lt;br /&gt;
                PATH=/bin:/usr/bin:/usr/local/bin&lt;br /&gt;
                MAILDIR=/var/spool/mail&lt;br /&gt;
                DEFAULT=/var/spool/mail/chirico&lt;br /&gt;
                LOGFILE=/home/chirico/MailBAG&lt;br /&gt;
                MYHOME=/home/chirico&lt;br /&gt;
                #  Must have folder MailTRASH&lt;br /&gt;
                TRASH=/home/chirico/MailTRASH&lt;br /&gt;
                &lt;br /&gt;
                # Will get everything from this mail&lt;br /&gt;
                :0&lt;br /&gt;
                * ^From:.*sporkey@comcast.net&lt;br /&gt;
                        $DEFAULT&lt;br /&gt;
                &lt;br /&gt;
                # Spamassassin&lt;br /&gt;
                :0fw&lt;br /&gt;
                * &amp;lt;300000&lt;br /&gt;
                |/usr/local/bin/spamassassin&lt;br /&gt;
&lt;br /&gt;
      Reference:&lt;br /&gt;
        http://pm-doc.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 93:&lt;br /&gt;
&lt;br /&gt;
     Make Graphs: using dot and neato.&lt;br /&gt;
&lt;br /&gt;
       $ dot -Tpng dotfile -o myout.png&lt;br /&gt;
&lt;br /&gt;
     To see the output reference the following:&lt;br /&gt;
       http://souptonuts.sourceforge.net/code/myout.png&lt;br /&gt;
&lt;br /&gt;
     Where &amp;quot;dotfile&amp;quot; is the following:&lt;br /&gt;
&lt;br /&gt;
       $ cat dotfile&lt;br /&gt;
&lt;br /&gt;
       digraph g&lt;br /&gt;
       {&lt;br /&gt;
               node [shape = record];&lt;br /&gt;
&lt;br /&gt;
               node0 [ label =&amp;quot;&amp;lt;f0&amp;gt; stuff | &amp;lt;f1&amp;gt; J | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node1 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; E | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node4 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; C | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node6 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; I | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node2 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; U | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node5 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; N | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node9 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; Y | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node8 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; W | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node10 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; Z | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node7 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; A | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node3 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; G | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node0&amp;quot;:f0 -&amp;gt; &amp;quot;node1&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node0&amp;quot;:f2 -&amp;gt; &amp;quot;node2&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node1&amp;quot;:f0 -&amp;gt; &amp;quot;node4&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node1&amp;quot;:f2 -&amp;gt; &amp;quot;node6&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node4&amp;quot;:f0 -&amp;gt; &amp;quot;node7&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node4&amp;quot;:f2 -&amp;gt; &amp;quot;node3&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node2&amp;quot;:f0 -&amp;gt; &amp;quot;node5&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node2&amp;quot;:f2 -&amp;gt; &amp;quot;node9&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node9&amp;quot;:f0 -&amp;gt; &amp;quot;node8&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node9&amp;quot;:f2 -&amp;gt; &amp;quot;node10&amp;quot;:f1;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
     Checkout the following article:&lt;br /&gt;
        http://www.linuxjournal.com/article.php?sid=7275&lt;br /&gt;
&lt;br /&gt;
     To download this software&lt;br /&gt;
        http://www.graphviz.org/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 94:&lt;br /&gt;
&lt;br /&gt;
     Makefile: working with conditions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     First note that all the indentations of the file must be&lt;br /&gt;
     a single tab. There cannot be any spaces, or make will&lt;br /&gt;
     not run.&lt;br /&gt;
&lt;br /&gt;
       $ cat Makefile&lt;br /&gt;
&lt;br /&gt;
        # Compiler flags&lt;br /&gt;
        sqliteLIB := $(shell ls /usr/local/lib/libsqlite.so)&lt;br /&gt;
        sqlite3LIB := $(shell ls /usr/local/lib/libsqlite3.so)&lt;br /&gt;
        # all assumes sqlite and sqlite3 are installed&lt;br /&gt;
        #&lt;br /&gt;
&lt;br /&gt;
        test:&lt;br /&gt;
        ifeq (&amp;quot;$(sqlite3LIB)&amp;quot;,&amp;quot;/usr/local/lib/libsqlite3.so&amp;quot;)&lt;br /&gt;
             @echo -e &amp;quot;True -- we found the file&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
             @echo &amp;quot;False -- we did not find the file&amp;quot;&lt;br /&gt;
        endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     So, if I run make I will get the following output.&lt;br /&gt;
&lt;br /&gt;
       $ make&lt;br /&gt;
       True -- we found the file&lt;br /&gt;
&lt;br /&gt;
     This is because I have a file /usr/local/lib/libsqlite3.so on my system.&lt;br /&gt;
     Note how the assignment is made, with the shell command&lt;br /&gt;
&lt;br /&gt;
           sqlite3LIB := $(shell ls /usr/local/lib/libsqlite3.so)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 95:&lt;br /&gt;
&lt;br /&gt;
     Bash: Conditional Expressions&lt;br /&gt;
&lt;br /&gt;
          if [ -e /etc/ntp.conf ]&lt;br /&gt;
            then&lt;br /&gt;
              echo &amp;quot;You have the ntp config file&amp;quot;&lt;br /&gt;
            else&lt;br /&gt;
              echo &amp;quot;You do not have the ntp config file&amp;quot;&lt;br /&gt;
          fi&lt;br /&gt;
&lt;br /&gt;
       Now using an AND condition inside the [ ]. By the way, above, you&lt;br /&gt;
       can put the &amp;quot;then&amp;quot; on the same line as the if &amp;quot;if [ -e /etc/ntp.conf ]; then&amp;quot;&lt;br /&gt;
       as long as you use the &amp;quot;;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           if [ \( -e /etc/ntp.conf \) -a \( -e /etc/ntp/ntpservers \) ]&lt;br /&gt;
             then&lt;br /&gt;
               echo &amp;quot;You have ntp config and ntpservers&amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp.conf ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntp.conf &amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp/ntpservers ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntpservers &amp;quot;&lt;br /&gt;
             else&lt;br /&gt;
               echo &amp;quot; you have neither ntp.conf or ntpservers&amp;quot;&lt;br /&gt;
           fi&lt;br /&gt;
&lt;br /&gt;
        A few things to note above. Else if statement is written as &amp;quot;elif&amp;quot;, and when&lt;br /&gt;
        dealing with &amp;quot;(&amp;quot; you will need to insert &amp;quot;\(&amp;quot;. By the way &amp;quot;-o&amp;quot; can replace &amp;quot;-a&amp;quot;&lt;br /&gt;
        and the &amp;quot;-o&amp;quot; is for OR condition. AND can be done as follows too.&lt;br /&gt;
&lt;br /&gt;
           if [ -e /etc/ntp.conf ] &amp;amp;&amp;amp; [ -e /etc/ntp/ntpservers ]&lt;br /&gt;
             then&lt;br /&gt;
               echo &amp;quot;You have ntp config and ntpservers&amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp.conf ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntp.conf &amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp/ntpservers ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntpservers &amp;quot;&lt;br /&gt;
             else&lt;br /&gt;
               echo &amp;quot; you have neither ntp.conf or ntpservers&amp;quot;&lt;br /&gt;
           fi&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (files).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             -b file      True if file exists and is a block file&lt;br /&gt;
             -c file      True if file exists and is a character device file&lt;br /&gt;
             -d file      True if file exists and is a directory&lt;br /&gt;
             -e file      True if file exists&lt;br /&gt;
             -f file      True if file exists and is a regular file&lt;br /&gt;
             -g file      True if file exists and is set goup id&lt;br /&gt;
             -G file      True if owned by the effective group ID&lt;br /&gt;
&lt;br /&gt;
             -k file      True if &amp;quot;sticky&amp;quot; bit is set and file exists&lt;br /&gt;
             -L file      True if file exists and is a symbolic link&lt;br /&gt;
             -n string    True if string is non-null&lt;br /&gt;
&lt;br /&gt;
             -O file      Ture if file exists and is owned by the effective user ID&lt;br /&gt;
&lt;br /&gt;
             -p file      True if file is a named pipe (FIFO)&lt;br /&gt;
             -r file      True if file is readable&lt;br /&gt;
             -s file      True if file has size &amp;gt; 0&lt;br /&gt;
             -S file      True if file exists and is a socket&lt;br /&gt;
&lt;br /&gt;
             -t file      True if file is open and refers to a terminal.&lt;br /&gt;
             -u file      True if setuid bit is set&lt;br /&gt;
             -w file      True if file exists and is writeable&lt;br /&gt;
             -x file      True if file executable&lt;br /&gt;
             -x dir       True if directory can be searched&lt;br /&gt;
&lt;br /&gt;
             file1 -nt file2     True if file1 modification date newer than file2&lt;br /&gt;
             file1 -ot file2     True if file1 modification date older than file2&lt;br /&gt;
             file1 -ef file2     True if file1 and file2 have same inode&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (Integers).&lt;br /&gt;
&lt;br /&gt;
             -lt  Less than&lt;br /&gt;
             -le  Less than or equal&lt;br /&gt;
             -eq  Equal&lt;br /&gt;
             -ge  Greater than or equal&lt;br /&gt;
             -gt  Greater than&lt;br /&gt;
             -ne  Not equal&lt;br /&gt;
&lt;br /&gt;
          Example usage.&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
             {&lt;br /&gt;
               while read num value; do&lt;br /&gt;
                if [ $num -gt  2 ]; then&lt;br /&gt;
                  echo $value&lt;br /&gt;
                fi&lt;br /&gt;
               done&lt;br /&gt;
             } &amp;lt; somefile&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (Strings).&lt;br /&gt;
&lt;br /&gt;
             str1 = str2      str1 matches str2&lt;br /&gt;
             str1 != str2     str1 does not matches str2&lt;br /&gt;
             str1 &amp;lt; str2      str1 is less than str2&lt;br /&gt;
             str1 &amp;gt;  str2     str1 is greater than str2&lt;br /&gt;
             -n str1          str1 is not null (length greater than 0)&lt;br /&gt;
             -z str1          str1 is null (las length 0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 96:&lt;br /&gt;
&lt;br /&gt;
     CVS: Working with cvs&lt;br /&gt;
&lt;br /&gt;
      INITIAL REPOSITORY:&lt;br /&gt;
&lt;br /&gt;
       To create a repository, and this is normally done by the system admin. This&lt;br /&gt;
       is NOT creating a project to checkout, but the location where everything&lt;br /&gt;
       will be stored! The initial repository!&lt;br /&gt;
&lt;br /&gt;
             cvs -d repository_root_directory init&lt;br /&gt;
&lt;br /&gt;
       Or here is a specific example:&lt;br /&gt;
&lt;br /&gt;
             cvs -d /work/cvsREPOSITORY/   init&lt;br /&gt;
&lt;br /&gt;
       Creating a directory tree from scratch. For a new project, the easiest thing to&lt;br /&gt;
       do is probably to create an empty directory structure, like this:&lt;br /&gt;
&lt;br /&gt;
             $ mkdir sqlite_examples&lt;br /&gt;
             $ mkdir sqlite_examples/man&lt;br /&gt;
             $ mkdir sqlite_examples/testing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       After that, you use the import command to create the&lt;br /&gt;
       corresponding (empty) directory structure inside the repository:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             $ cd &amp;lt;directory&amp;gt;&lt;br /&gt;
             $ cvs -d repository_root_directory import  -m &amp;quot;Created directory structure&amp;quot; yoyodyne/dir yoyo start&lt;br /&gt;
&lt;br /&gt;
       Or, here is a specific example.&lt;br /&gt;
&lt;br /&gt;
             $  cd sqlite_examples&lt;br /&gt;
             $  cvs  -d /work/cvsREPOSITORY/ import -m 'test SQlite'  sqlite_examples sqlite_examples start&lt;br /&gt;
&lt;br /&gt;
       Now, you can delete the directory sqlite_examples, or go to another directory and type&lt;br /&gt;
       the following:&lt;br /&gt;
&lt;br /&gt;
             $ cvs -d /work/cvsREPOSITORY/ co sqlite_examples&lt;br /&gt;
&lt;br /&gt;
     COOL TOOLS:&lt;br /&gt;
&lt;br /&gt;
           1. cvsps&lt;br /&gt;
           2. cvsreport&lt;br /&gt;
&lt;br /&gt;
         cvsps which you can find at http://www.cobite.com/cvsps/cvsps-2.0rc1.tar.gz&lt;br /&gt;
&lt;br /&gt;
             $ cvsps -f README_sqlite_tutorial.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 97:&lt;br /&gt;
&lt;br /&gt;
     Common vi and vim commands&lt;br /&gt;
&lt;br /&gt;
           Command mode ESC&lt;br /&gt;
&lt;br /&gt;
                dd       delete&lt;br /&gt;
                u        undelete&lt;br /&gt;
                y        yank (copy to buffer)&lt;br /&gt;
                p/P      p before cursor/P after cursor&lt;br /&gt;
&lt;br /&gt;
                Ctl-g    show current line number&lt;br /&gt;
                shft-G   end of file&lt;br /&gt;
              n shft-G   move to line n&lt;br /&gt;
&lt;br /&gt;
               /stuff/   search&lt;br /&gt;
                  n   repeat in same direction&lt;br /&gt;
                  N   repeat in opposite direction&lt;br /&gt;
                  /return  repeat seach forward&lt;br /&gt;
                  ?return  repeat seach backward&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;dyy  Yank current line to buffer d&lt;br /&gt;
               &amp;quot;a7yy Yank next 7 lines to buffer a&lt;br /&gt;
                    or&lt;br /&gt;
               :1,7ya a  Yank [ya] lines 1,7 to buffer a&lt;br /&gt;
               :1,7ya b  Yank [ya] lines 1,7 to buffer b&lt;br /&gt;
&lt;br /&gt;
               :5 pu b   Put [pu] buffer b after line 5&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;dP   Put the content of buffer d before cursor&lt;br /&gt;
               &amp;quot;ap   Put the contents of buffer a after cursor&lt;br /&gt;
&lt;br /&gt;
               :1,4 w! file2  Write lines 1,4 to file2&lt;br /&gt;
               :1,3&lt;br /&gt;
&lt;br /&gt;
               :set nu     Display line numbers&lt;br /&gt;
               :set nonum  Turns off display&lt;br /&gt;
&lt;br /&gt;
               :e &amp;lt;filename&amp;gt; Edit a file in a new buffer&lt;br /&gt;
&lt;br /&gt;
            vim&lt;br /&gt;
               :split&lt;br /&gt;
               :split &amp;lt;filename&amp;gt;&lt;br /&gt;
               :sp &amp;lt;filename&amp;gt;&lt;br /&gt;
               :split new&lt;br /&gt;
&lt;br /&gt;
                   ctl-w   To move between windows&lt;br /&gt;
                   ctl-w+&lt;br /&gt;
                   ctl-w-  To change size&lt;br /&gt;
                   ctl+wv  Split windows vertically&lt;br /&gt;
                   ctl-wq  Close window&lt;br /&gt;
&lt;br /&gt;
               :only       To view only 1 window&lt;br /&gt;
&lt;br /&gt;
            vim dictionary - put the following command in ~/.vimrc&lt;br /&gt;
&lt;br /&gt;
                   set dictionary+=/usr/share/dict/words&lt;br /&gt;
                   set thesaurus+=/usr/share/dict/words&lt;br /&gt;
              &lt;br /&gt;
               Now, after you type a word &amp;lt;ctl-x&amp;gt;&amp;lt;ctl-k&amp;gt;&amp;lt;ctl-n&amp;gt; and to &lt;br /&gt;
               go back in the listing &amp;lt;ctl-p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                   butter&amp;lt;ctl-x&amp;gt;&amp;lt;ctl-k&amp;gt;&amp;lt;ctl-n&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 98:&lt;br /&gt;
&lt;br /&gt;
     Using apt-get&lt;br /&gt;
&lt;br /&gt;
          $ apt-get update&lt;br /&gt;
          $ apt-get -s install &amp;lt;pkage&amp;gt;    &amp;lt;---- if everything is ok, then, remove the s&lt;br /&gt;
&lt;br /&gt;
     Note you may want to use dpkg to purge if you have to do a reinstall.&lt;br /&gt;
&lt;br /&gt;
          $ dpkg --purge exim4-base&lt;br /&gt;
          $ dpkg --purge exim4-config&lt;br /&gt;
          $ apt-get install exim4&lt;br /&gt;
&lt;br /&gt;
          $ dpkg-reconfigure exim4-config&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 99:&lt;br /&gt;
&lt;br /&gt;
     Mounting a cdrom on openbsd and installing packages&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /cdrom&lt;br /&gt;
          $ mount /dev/cd0a /cdrom&lt;br /&gt;
          $ cd /cdrom&lt;br /&gt;
&lt;br /&gt;
     To add packages&lt;br /&gt;
&lt;br /&gt;
          $ pkg_add -v  &amp;lt;directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Mounting a cdrom on linux to a user's home sub-directory:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /home/chirico/cdrom&lt;br /&gt;
          $ mount /dev/cdrom /home/chirico/cdrom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 100:&lt;br /&gt;
&lt;br /&gt;
    Creating a boot floppy for knoppix cd:&lt;br /&gt;
&lt;br /&gt;
          $ dd if=/mnt/cdrom/KNOPPIX/boot.img of=/dev/fd0 bs=1440k&lt;br /&gt;
&lt;br /&gt;
    References:&lt;br /&gt;
        http://www.knoppix.net/docs/index.php/BootFloppyHowTo&lt;br /&gt;
&lt;br /&gt;
    For a lot of the knoppix how-to's&lt;br /&gt;
        http://www.knoppix.net/docs/index.php/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 101:&lt;br /&gt;
&lt;br /&gt;
    Diction and Style Tools for Linux  http://ftp.gnu.org/gnu/diction/&lt;br /&gt;
&lt;br /&gt;
        $ diction mytext|less&lt;br /&gt;
&lt;br /&gt;
    Or, this can be done interactively&lt;br /&gt;
&lt;br /&gt;
        $ diction&lt;br /&gt;
        This is more text to read and you can do with it&lt;br /&gt;
        what you want.&lt;br /&gt;
        (stdin):1: This is more text to read and you [can -&amp;gt; (do not confuse with &amp;quot;may&amp;quot;)] do with it what you want.&lt;br /&gt;
&lt;br /&gt;
    DESCRIPTION&lt;br /&gt;
       Diction finds all sentences in a document, that contain phrases from  a&lt;br /&gt;
       database  of  frequently  misused,  bad  or  wordy diction.  It further&lt;br /&gt;
       checks for double words.  If no files are given, the document  is  read&lt;br /&gt;
       from  standard input.  Each found phrase is enclosed in [ ] (brackets).&lt;br /&gt;
       Suggestions and advice, if any, are printed headed by a right arrow -&amp;gt;.&lt;br /&gt;
       A  sentence is a sequence of words, that starts with a capitalised word&lt;br /&gt;
       and ends with a full stop, double colon, question mark or  exclaimation&lt;br /&gt;
       mark.  A single letter followed by a dot is considered an abbreviation,&lt;br /&gt;
       so it does not terminate a sentence.   Various  multi-letter  abbrevia-&lt;br /&gt;
       tions are recognized, they do not terminate a sentence as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 102:&lt;br /&gt;
&lt;br /&gt;
    Using a mail alias.&lt;br /&gt;
&lt;br /&gt;
       Suppose all root mail on your system to go to one root account root@main.com&lt;br /&gt;
&lt;br /&gt;
       In the following file:&lt;br /&gt;
&lt;br /&gt;
             /etc/aliases&lt;br /&gt;
&lt;br /&gt;
       Add this line&lt;br /&gt;
&lt;br /&gt;
             root:    root@main.com&lt;br /&gt;
&lt;br /&gt;
       Next, run newaliases [/usr/bin/newaliases] as follows:&lt;br /&gt;
&lt;br /&gt;
             $ newaliases&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Special note: It's possible to send mail to more than one address. Suppose you want&lt;br /&gt;
                     mail going to root@main.com above, plus you want it going to user donkey&lt;br /&gt;
                     on the local system.&lt;br /&gt;
&lt;br /&gt;
             root:  root@main.com donkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 103:&lt;br /&gt;
&lt;br /&gt;
    Chrony - this service is similiar to ntp. It keeps accurate time&lt;br /&gt;
            on your computer against a very accurate clock in across&lt;br /&gt;
            a network with various time delays.&lt;br /&gt;
&lt;br /&gt;
    Reference: http://go.to/chrony&lt;br /&gt;
&lt;br /&gt;
        In the file &amp;quot;/etc/chrony/chrony.conf&amp;quot; add/replace the following&lt;br /&gt;
&lt;br /&gt;
             server 146.186.218.60&lt;br /&gt;
             server 128.118.25.3&lt;br /&gt;
             server 128.2.129.21&lt;br /&gt;
&lt;br /&gt;
        Next start the chrony service&lt;br /&gt;
&lt;br /&gt;
           $ /etc/init.d/chrony restart&lt;br /&gt;
&lt;br /&gt;
     Next verify that this is working. It may take 20 or 30 minutes to update&lt;br /&gt;
     the clock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Shell command:&lt;br /&gt;
       # chronyc&lt;br /&gt;
       chronyc&amp;gt; sourcestats&lt;br /&gt;
       210 Number of sources = 3&lt;br /&gt;
       Name/IP Address            NP  NR  Span  Frequency   Freq Skew   Std Dev&lt;br /&gt;
       ========================================================================&lt;br /&gt;
       b50.cede.psu.edu            2   0    64       0.000    2000.000  4000ms&lt;br /&gt;
       otc2.psu.edu                2   0    66       0.000    2000.000  4000ms&lt;br /&gt;
       FS3.ECE.CMU.EDU             2   0    64       0.000    2000.000  4000ms&lt;br /&gt;
       chronyc&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    It is probably best to let chrony do its work. However, if you want to&lt;br /&gt;
    set both the hardware and software clock, the following will work:&lt;br /&gt;
&lt;br /&gt;
      Sets the hardware clock&lt;br /&gt;
        # hwclock --set --date=&amp;quot;12/10/04 10:18:05&amp;quot;&lt;br /&gt;
      Sync the hardware clock to software&lt;br /&gt;
        # hwclock --hctosys&lt;br /&gt;
&lt;br /&gt;
    Normally the system keep accurate time with the software clock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 104:&lt;br /&gt;
&lt;br /&gt;
    NFS mount&lt;br /&gt;
&lt;br /&gt;
     SERVER (192.168.1.182)&lt;br /&gt;
&lt;br /&gt;
       Make sure nfs is running on the server&lt;br /&gt;
 &lt;br /&gt;
           $ /etc/init.d/nfs restart&lt;br /&gt;
&lt;br /&gt;
       At the server the contents of /etc/exports for&lt;br /&gt;
       allowing 2 computers (192.168.1.171 and 192.168.1.71)&lt;br /&gt;
       to access the home directory of this server. Note that&lt;br /&gt;
       read write (rw) access is allowed.&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/exports&lt;br /&gt;
         /home   192.168.1.171(rw)&lt;br /&gt;
         /home   192.168.1.71(rw)&lt;br /&gt;
&lt;br /&gt;
       Or, if you have a lot of clients on 192.168.1.* then consider&lt;br /&gt;
       the following:&lt;br /&gt;
&lt;br /&gt;
          /home 192.168.1.0/255.255.252.0(rw)&lt;br /&gt;
&lt;br /&gt;
       Next, still at the server, run the exportfs command&lt;br /&gt;
&lt;br /&gt;
          $ exportfs -rv&lt;br /&gt;
&lt;br /&gt;
       IPTABLES (lokkit). If you're using fedora with default lokkit firewall&lt;br /&gt;
                then you can put the following under &amp;quot;Other ports&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                  Other ports nfs:tcp nfs:udp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       If the above does not work or you are not using lokkit&lt;br /&gt;
        IPTABLES (values in /etc/sysconfig/iptables on SERVER )&lt;br /&gt;
&lt;br /&gt;
        # NFS Need to accept fragmented packets and may not have header&lt;br /&gt;
        #             so you will not know where they are coming from&lt;br /&gt;
        -A INPUT -f -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -m tcp -s 192.168.1.171 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -s 192.168.1.171 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -m udp -s 192.168.1.171 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -s 192.168.1.171 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        &lt;br /&gt;
        -A INPUT -f -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -m tcp -s 192.168.1.71 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -s 192.168.1.71 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -m udp -s 192.168.1.71 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -s 192.168.1.71 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        (Reference: http://nfs.sourceforge.net/nfs-howto/server.html)&lt;br /&gt;
                  and&lt;br /&gt;
        (Reference: http://nfs.sourceforge.net/nfs-howto/security.html)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     CLIENT1 (192.168.1.171)&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /home2&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/fstab&lt;br /&gt;
         192.168.1.182:/home          /home2     nfs     rw 0 0&lt;br /&gt;
&lt;br /&gt;
          $ mount -a -t nfs&lt;br /&gt;
&lt;br /&gt;
        Or to do a one time mounting by hand&lt;br /&gt;
&lt;br /&gt;
          $ mount -t nfs 192.168.1.182:/home  /home2&lt;br /&gt;
&lt;br /&gt;
        Now /home2 on the client will be /home on the server&lt;br /&gt;
&lt;br /&gt;
        Reference:&lt;br /&gt;
          http://nfs.sourceforge.net/nfs-howto/index.html&lt;br /&gt;
&lt;br /&gt;
     MONITOR NFS:&lt;br /&gt;
&lt;br /&gt;
        To monitor the client:&lt;br /&gt;
&lt;br /&gt;
          $ nfsstat -c&lt;br /&gt;
&lt;br /&gt;
           Also note you can &amp;quot;cat /proc/net/rpc/nfs&amp;quot; as well.&lt;br /&gt;
&lt;br /&gt;
       To monitor the server (note the -s instead of the -c).&lt;br /&gt;
&lt;br /&gt;
         $ nfsstat -s&lt;br /&gt;
&lt;br /&gt;
           Also note you can &amp;quot;cat /proc/net/rpc/nfsd&amp;quot; as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       The following &amp;quot;cat&amp;quot; command is done on the NFS server, and shows which&lt;br /&gt;
       clients are mounting. This does not go with examples above. By the way,&lt;br /&gt;
       &amp;quot;root_squash&amp;quot; is the default, and means that root access on the clients is&lt;br /&gt;
       denied. So, how does the client root get access to these filesystems? You have&lt;br /&gt;
       to &amp;quot;su - &amp;lt;someuser&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
              $ cat /proc/fs/nfs/exports&lt;br /&gt;
              # Version 1.1&lt;br /&gt;
              # Path Client(Flags) # IPs&lt;br /&gt;
              /home   192.168.1.102(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   squeezel.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   192.168.1.106(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   livingroom.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   10.8.0.1(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   closet.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
&lt;br /&gt;
     (Reference: http://www.vanemery.com/Linux/NFSv4/NFSv4-no-rpcsec.html#automount )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 105:&lt;br /&gt;
&lt;br /&gt;
      Ports used for Microsoft products&lt;br /&gt;
               http://www.microsoft.com/canada/smallbiz/sgc/articles/ref_net_ports_ms_prod.mspx?pf=true&lt;br /&gt;
          Firewalling?&lt;br /&gt;
               http://www.microsoft.com/technet/prodtechnol/windowsserver2003/library/ServerHelp/428c1bbf-2ceb-4f76-a1ef-0219982eca10.mspx&lt;br /&gt;
&lt;br /&gt;
      To find out common port mappings, take a look at &amp;quot;/etc/services&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 106:&lt;br /&gt;
&lt;br /&gt;
      Man pages: If man pages are formatting incorrectly with PuTTY, try editing&lt;br /&gt;
      the &amp;quot;/etc/man.config&amp;quot; file with the following changes:&lt;br /&gt;
&lt;br /&gt;
           NROFF /usr/bin/groff -Tlatin1 -mandoc&lt;br /&gt;
           NEQN /usr/bin/geqn -Tlatin1&lt;br /&gt;
&lt;br /&gt;
         (Reference TIP 7 for using man)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 107:&lt;br /&gt;
&lt;br /&gt;
      Valgrind: check for memory leaks in your programs. (http://valgrind.org/)&lt;br /&gt;
&lt;br /&gt;
       This is how you can run it on the program &amp;quot;a.out&amp;quot; for valgrind version 2.2.0&lt;br /&gt;
&lt;br /&gt;
         $ valgrind --logfile=valgrind.output   --tool=memcheck ./a.out&lt;br /&gt;
&lt;br /&gt;
       This is how you write the logfile &amp;quot;--log-file&amp;quot; for valgrind-3.0.1&lt;br /&gt;
&lt;br /&gt;
         $ valgrind  --log-file=valgrind --leak-check=yes --tool=memcheck ./a.out&lt;br /&gt;
&lt;br /&gt;
       With C++ programs with gcc 3.4 and later that use STL, export GLIBCXX_FORCE_NEW &lt;br /&gt;
       only when testing to disable memory caching. Remember to enable for production&lt;br /&gt;
       as this will have a performance penalty. Reference  http://valgrind.org/docs/FAQ/ &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 108:&lt;br /&gt;
&lt;br /&gt;
      Runlevel Configuring.&lt;br /&gt;
&lt;br /&gt;
       These two programs, run as root give you a ncurses GUI to what will&lt;br /&gt;
       run on your system on boot.&lt;br /&gt;
&lt;br /&gt;
            # ntsysv&lt;br /&gt;
&lt;br /&gt;
            # chkconfig&lt;br /&gt;
&lt;br /&gt;
       Note, you can also set these manually. For example, normally you will&lt;br /&gt;
       have files in &amp;quot;/etc/init.d/&amp;quot; that will take parameters like &amp;quot;start&amp;quot;,&amp;quot;stop&amp;quot;&lt;br /&gt;
       &amp;quot;restart&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       Take a look at &amp;quot;/etc/init.d/mysql&amp;quot; this file will start and stop the&lt;br /&gt;
       mysql daemon. So, how does know which run levels, and the order it gets&lt;br /&gt;
       loaded in the run level to other programs? By the K&amp;lt;number&amp;gt; and S&amp;lt;number&amp;gt;&lt;br /&gt;
       values.&lt;br /&gt;
&lt;br /&gt;
            $ ls /etc/rc3.d/*mysql&lt;br /&gt;
&lt;br /&gt;
                /etc/rc3.d/K85mysql&lt;br /&gt;
                /etc/rc3.d/S85mysql&lt;br /&gt;
&lt;br /&gt;
       So here on my system the start value is 85. Looking in /etc/rc3.d, which is&lt;br /&gt;
       run level 3, any program with a lower number S84something will get loaded&lt;br /&gt;
       before mysql.&lt;br /&gt;
&lt;br /&gt;
       I manually set the run level as follows for mysql.&lt;br /&gt;
&lt;br /&gt;
            # cd /etc/rc3.d&lt;br /&gt;
            # ln -s ../init.d/mysql S85mysql&lt;br /&gt;
            # ln -s ../init.d/mysql K85mysql&lt;br /&gt;
&lt;br /&gt;
            # cd /etc/rc5.d&lt;br /&gt;
            # ln -s ../init.d/mysql S85mysql&lt;br /&gt;
            # ln -s ../init.d/mysql K85mysql&lt;br /&gt;
&lt;br /&gt;
       Note that I could have chose other numbers as well. &amp;quot;ntsysv&amp;quot; gives&lt;br /&gt;
       you a graphical interface.&lt;br /&gt;
&lt;br /&gt;
       This is a way of doing this with &amp;quot;chkconfig&amp;quot; at the command prompt.&lt;br /&gt;
&lt;br /&gt;
            # chkconfig --list mysqld&lt;br /&gt;
            mysqld          0:off   1:off   2:off   3:on    4:off   5:on    6:off&lt;br /&gt;
&lt;br /&gt;
       Above you can see it's on. Here's how we would have turned this on with chkconfig.&lt;br /&gt;
&lt;br /&gt;
            # chkconfig --level 35 mysqld on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 109:&lt;br /&gt;
&lt;br /&gt;
       File Alteration Monitor - Gamin a FAM replacement&lt;br /&gt;
        http://www.gnome.org/~veillard/gamin/&lt;br /&gt;
        http://www.gnome.org/~veillard/gamin/sources/&lt;br /&gt;
       ******  EXAMPLE NOT COMPLETE *****&lt;br /&gt;
&lt;br /&gt;
       Working with fam  - file alteration monitor.  Mail uses this to signify&lt;br /&gt;
           a change in a file's status.&lt;br /&gt;
&lt;br /&gt;
        Below is the sample C program ftest.c which can be compiled as&lt;br /&gt;
        follows:&lt;br /&gt;
&lt;br /&gt;
              $ gcc -o ftest ftest.c  -lfam&lt;br /&gt;
&lt;br /&gt;
        You will need to work with this as root&lt;br /&gt;
&lt;br /&gt;
              #  ./ftest &amp;lt;somefile absolute path&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Reference:&lt;br /&gt;
            http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?db=man&amp;amp;fname=/usr/share/catman/p_man/cat3x/fam.z&lt;br /&gt;
            http://www.devchannel.org/devtoolschannel/04/05/13/2146252.shtml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 110:&lt;br /&gt;
&lt;br /&gt;
       glibc - this is the main library used by C, and the following&lt;br /&gt;
        link below gives you examples on everything from sockets,math,&lt;br /&gt;
        date and time functions, user environment, and much more.&lt;br /&gt;
&lt;br /&gt;
         http://www.gnu.org/software/libc/manual/html_mono/libc.html&lt;br /&gt;
&lt;br /&gt;
       How do you know which version of glibc you are running?&lt;br /&gt;
&lt;br /&gt;
          #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
          #include &amp;lt;gnu/libc-version.h&amp;gt;&lt;br /&gt;
          int main (void)&lt;br /&gt;
           {&lt;br /&gt;
             puts (gnu_get_libc_version ());&lt;br /&gt;
             return 0;&lt;br /&gt;
           }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 111:&lt;br /&gt;
&lt;br /&gt;
       nslookup and dig - query Internet name servers interactively.&lt;br /&gt;
&lt;br /&gt;
         $ nslookup&lt;br /&gt;
         &amp;gt;chirico.org&lt;br /&gt;
         Server:        68.80.0.6&lt;br /&gt;
         Address:       68.80.0.6#53&lt;br /&gt;
&lt;br /&gt;
         Name: chirico.org&lt;br /&gt;
         Address: 66.35.250.210&lt;br /&gt;
         &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      The nslookup command will query the dns server is &amp;quot;/etc/resolve.conf&amp;quot;&lt;br /&gt;
      However, you can force a certain dns with &amp;quot;- server&amp;quot;.  For example the&lt;br /&gt;
      command below goes to the server named dilbert&lt;br /&gt;
&lt;br /&gt;
         $ nslookup - dilbert&lt;br /&gt;
         &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      dig:&lt;br /&gt;
&lt;br /&gt;
      dig gives you more information. You should probably use dig instead&lt;br /&gt;
      of nslookup.&lt;br /&gt;
&lt;br /&gt;
      Below I am forcing the lookup from DNS 68.80.0.6 of the name chirico.org, and&lt;br /&gt;
      note that the query time is return too.&lt;br /&gt;
&lt;br /&gt;
         $ dig @68.80.0.6  +qr chirico.org&lt;br /&gt;
&lt;br /&gt;
         ; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.2.1 &amp;lt;&amp;lt;&amp;gt;&amp;gt; @68.80.0.6 +qr chirico.org&lt;br /&gt;
         ;; global options:  printcmd&lt;br /&gt;
         ;; Sending:&lt;br /&gt;
         ;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 55908&lt;br /&gt;
         ;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0&lt;br /&gt;
        &lt;br /&gt;
         ;; QUESTION SECTION:&lt;br /&gt;
         ;chirico.org.                   IN      A&lt;br /&gt;
        &lt;br /&gt;
         ;; Got answer:&lt;br /&gt;
         ;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 55908&lt;br /&gt;
         ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
        &lt;br /&gt;
         ;; QUESTION SECTION:&lt;br /&gt;
         ;chirico.org.                   IN      A&lt;br /&gt;
        &lt;br /&gt;
         ;; ANSWER SECTION:&lt;br /&gt;
         chirico.org.            5538    IN      A       66.35.250.210&lt;br /&gt;
        &lt;br /&gt;
         ;; AUTHORITY SECTION:&lt;br /&gt;
         chirico.org.            30599   IN      NS      ns78.worldnic.com.&lt;br /&gt;
         chirico.org.            30599   IN      NS      ns77.worldnic.com.&lt;br /&gt;
        &lt;br /&gt;
         ;; ADDITIONAL SECTION:&lt;br /&gt;
         ns78.worldnic.com.      16022   IN      A       216.168.225.218&lt;br /&gt;
         ns77.worldnic.com.      7       IN      A       216.168.228.41&lt;br /&gt;
        &lt;br /&gt;
         ;; Query time: 155 msec&lt;br /&gt;
         ;; SERVER: 68.80.0.6#53(68.80.0.6)&lt;br /&gt;
         ;; WHEN: Thu Dec 23 07:48:23 2004&lt;br /&gt;
         ;; MSG SIZE  rcvd: 127&lt;br /&gt;
&lt;br /&gt;
      So what if you wanted to know what name the IP address 66.35.250.210&lt;br /&gt;
      resolves to, when using dns 68.80.0.12.&lt;br /&gt;
&lt;br /&gt;
          $ dig @68.80.0.12 -x 66.35.250.210&lt;br /&gt;
          ...&lt;br /&gt;
          ;; ANSWER SECTION:&lt;br /&gt;
          210.250.35.66.in-addr.arpa. 3600 IN   CNAME   210.0/24.250.35.66.in-addr.arpa.&lt;br /&gt;
          210.0/24.250.35.66.in-addr.arpa. 3600 IN PTR  vhost.sourceforge.net.&lt;br /&gt;
&lt;br /&gt;
      Above you can see it resolved to &amp;quot;vhost.sourceforge.net&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      Reference ( http://www.tldp.org/HOWTO/DNS-HOWTO-5.html )&lt;br /&gt;
        Also see TIP 223.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 112:&lt;br /&gt;
&lt;br /&gt;
       Using GNU Autotools - so you can produce the familiar &amp;quot;./configure&amp;quot;  &amp;quot;make&amp;quot;  and &amp;quot;make install&amp;quot;&lt;br /&gt;
                             commands. There is also a &amp;quot;make dist&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                The program sqlite3api.cc and the rest of this code can be found at&lt;br /&gt;
                 http://prdownloads.sourceforge.net/cpearls/autotools.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         A &amp;quot;Makefile.am&amp;quot; is required:&lt;br /&gt;
&lt;br /&gt;
            bin_PROGRAMS = sprog&lt;br /&gt;
            sprog_SOURCES = sqlite3api.cc&lt;br /&gt;
            sprog_LDADD = @INCLUDES@ @SQLIBOBJS@&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         In addition, a &amp;quot;configure.in&amp;quot; file is required. Note, AC_CHECK_LIB will&lt;br /&gt;
         check the &amp;quot;libsqlite3.so&amp;quot; file for the &amp;quot;sqlite3_open&amp;quot; file. Note that&lt;br /&gt;
         &amp;quot;sqlite3&amp;quot;, is a shortcut for &amp;quot;libsqlite3&amp;quot; by convention. If this file&lt;br /&gt;
         is not found, AC_CHECK_FILE looks for &amp;quot;/usr/local/lib/libsqlite3.a&amp;quot;. If&lt;br /&gt;
         this is found, then, &amp;quot;-lsqlite3&amp;quot; is added to the LIBS environment variable.&lt;br /&gt;
         Also, &amp;quot;-I/usr/local/include&amp;quot; and &amp;quot;-L/usr/local/lib&amp;quot; will be added on the&lt;br /&gt;
         command line. This is common when some one does not have the library in&lt;br /&gt;
         the path.  (See TIP 49)&lt;br /&gt;
&lt;br /&gt;
            dnl Process this file with autoconf to produce a configure script.&lt;br /&gt;
            AC_INIT(sqlite3api.cc)&lt;br /&gt;
            AM_INIT_AUTOMAKE(sqliteprog, 1.0)&lt;br /&gt;
            AC_PROG_CXX&lt;br /&gt;
            CXXFLAGS='-Wall -W -O2 -s -pipe'&lt;br /&gt;
            AC_CHECK_LIB(sqlite3,sqlite3_open,[],found=no)&lt;br /&gt;
             if test &amp;quot;$found&amp;quot; = &amp;quot;no&amp;quot;; then&lt;br /&gt;
               AC_CHECK_FILE(/usr/local/lib/libsqlite3.a, found=yes)&lt;br /&gt;
               if test &amp;quot;$found&amp;quot; = &amp;quot;yes&amp;quot;; then&lt;br /&gt;
                 LIBS=&amp;quot;$LIBS -lsqlite3&amp;quot;&lt;br /&gt;
                 INCLUDES=&amp;quot;$INCLUDES -I/usr/local/include&amp;quot;&lt;br /&gt;
                 EXTRALIB='-L/usr/local/lib'&lt;br /&gt;
                else&lt;br /&gt;
                 echo &amp;quot;Are you SURE sqlite3 is installed?&amp;quot;&lt;br /&gt;
               fi&lt;br /&gt;
             fi&lt;br /&gt;
            SQLIBOBJS='-Wl,-R/usr/local/lib'&lt;br /&gt;
            AC_SUBST(INCLUDES)&lt;br /&gt;
            AC_SUBST(SQLIBOBJS)&lt;br /&gt;
            AC_SUBST(EXTRALIB)&lt;br /&gt;
            AC_OUTPUT(Makefile)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         To build the configure file, just run the following:&lt;br /&gt;
&lt;br /&gt;
             $ aclocal&lt;br /&gt;
             $ autoconf&lt;br /&gt;
             $ touch NEWS README AUTHORS ChangeLog&lt;br /&gt;
             $ automake --add-missing&lt;br /&gt;
&lt;br /&gt;
         Now if you want to make a tar.gz file &amp;quot;sqliteprog-1.0.tar.gz&amp;quot;, then&lt;br /&gt;
         all you have to run is the following:&lt;br /&gt;
&lt;br /&gt;
             $ make dist&lt;br /&gt;
&lt;br /&gt;
         Note: did you ever want to save all the output from a ./configure? Well, it&lt;br /&gt;
               is automatically saved in the &amp;quot;config.log&amp;quot; file. In fact, this file may&lt;br /&gt;
               contain a lot more than what you saw on the screen.&lt;br /&gt;
&lt;br /&gt;
               Also, you may need to rerun ./configure. But before you do, delete&lt;br /&gt;
               the &amp;quot;config.cache&amp;quot; file to get a clean build.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 113:&lt;br /&gt;
&lt;br /&gt;
       EMACS - common emacs commands.&lt;br /&gt;
&lt;br /&gt;
         M is the ESC&lt;br /&gt;
         C or c is the Ctl&lt;br /&gt;
&lt;br /&gt;
        Shell - when working in a shell. &amp;quot;M-x rename-uniquely&amp;quot; is good for split screen editing.&lt;br /&gt;
&lt;br /&gt;
          M-x rename-uniquely   Use this for multiple shells (renames buffer so it's not the same shell)&lt;br /&gt;
          C-c C-z               Send job in background (when working in a shell)&lt;br /&gt;
          C-c C-o               commit-kill-output (gets rid of a lot of shell output)&lt;br /&gt;
          C-c C-r               reposition at beginning of output&lt;br /&gt;
          C-c C-e               reposition at end of output&lt;br /&gt;
          M-x send-invisible    Hide passwords - use this before typing a password&lt;br /&gt;
&lt;br /&gt;
         Note: if the shell prompt does not show up correctly, then, you may want to creat a &amp;quot;.emacs_bash&amp;quot;&lt;br /&gt;
               file with the following contents:&lt;br /&gt;
&lt;br /&gt;
                          PS1=&amp;quot;emacs:\W \$ &amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Directories  (C-x d) give you a directory listing. You know all those annoying &amp;quot;~&amp;quot; and &amp;quot;#&amp;quot;&lt;br /&gt;
                     file that you get? You can easily delete these when in &amp;quot;dired&amp;quot; mode by hitting&lt;br /&gt;
                     &amp;quot;~&amp;quot;, then  &amp;quot;d&amp;quot; to flag it for delete. Then, hit &amp;quot;x&amp;quot; to and confirm deletion.&lt;br /&gt;
&lt;br /&gt;
                     These are other command that work on highlighted files in &amp;quot;dired&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
                          R   rename&lt;br /&gt;
                          v   view&lt;br /&gt;
                          Z   compress the file&lt;br /&gt;
                          +   create directory&lt;br /&gt;
&lt;br /&gt;
        Other common commands:&lt;br /&gt;
&lt;br /&gt;
          c-x l          list the line you are on, and how many lines in the document.&lt;br /&gt;
                         You will get something like: Page has 4881 lines (4440 + 442),&lt;br /&gt;
                         which means you are on the 4440 line.&lt;br /&gt;
&lt;br /&gt;
          c-x rm bookmark make&lt;br /&gt;
          c-x rb bookmark bounce&lt;br /&gt;
        &lt;br /&gt;
          c-x rb notes&lt;br /&gt;
          c-x rb emacs&lt;br /&gt;
        &lt;br /&gt;
          c-x / &amp;lt;r&amp;gt; (save position in register &amp;lt;r&amp;gt;)&lt;br /&gt;
          c-x j &amp;lt;r&amp;gt; (jump to position in register &amp;lt;r&amp;gt;)&lt;br /&gt;
          c-x r SPC 1 (mark current point in register 1)&lt;br /&gt;
          c-x r j 1 (jump to marked point in register 1)&lt;br /&gt;
          c-x r t &amp;lt;string&amp;gt;  (insert string into register)&lt;br /&gt;
        &lt;br /&gt;
          c-x r s 1 (save marked region in register 1)&lt;br /&gt;
          c-x r i 1 (insert marked region)&lt;br /&gt;
        &lt;br /&gt;
          c-x c-o (delete all blank lines, except one)&lt;br /&gt;
        &lt;br /&gt;
          c-x z (repeat the last command ... stop with an a)&lt;br /&gt;
          c-x zz (repeat the last command twice)&lt;br /&gt;
&lt;br /&gt;
          rectangle&lt;br /&gt;
          ---------&lt;br /&gt;
          C-SPC&lt;br /&gt;
          goto the next region&lt;br /&gt;
          C-x&lt;br /&gt;
          C-x&lt;br /&gt;
          then, C-x r r &amp;quot;name of register&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
          to insert the register&lt;br /&gt;
          C-x r i &amp;quot;name of register&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
          macros:&lt;br /&gt;
          -------&lt;br /&gt;
          c-x (    start macro&lt;br /&gt;
          c-x )    end macro&lt;br /&gt;
          c-x e    execute macro&lt;br /&gt;
        &lt;br /&gt;
          mail:&lt;br /&gt;
          -----&lt;br /&gt;
          c-x m   mail&lt;br /&gt;
          c-c c-s send&lt;br /&gt;
        &lt;br /&gt;
          C-x C-e&lt;br /&gt;
          (insert &amp;quot;\n\nExtra Line of text&amp;quot;)&lt;br /&gt;
        &lt;br /&gt;
          ;; chirico functions in .emacs&lt;br /&gt;
          ;; This creates an html template&lt;br /&gt;
          (defun my-html ()&lt;br /&gt;
          (interactive)&lt;br /&gt;
          (insert &amp;quot;&amp;lt;html&amp;gt;&lt;br /&gt;
          &amp;lt;head&amp;gt;&lt;br /&gt;
          &amp;lt;META HTTP-EQUIV=\&amp;quot;Pragma\&amp;quot; CONTENT=\&amp;quot;no-cache\&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;META HTTP-EQUIV=\&amp;quot;Expires\&amp;quot; CONTENT=\&amp;quot;-1\&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;/head&amp;gt;&lt;br /&gt;
          &amp;lt;body bgcolor=\&amp;quot;#ffffff\&amp;quot;&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
          &amp;lt;/body&amp;gt;&lt;br /&gt;
          &amp;lt;/html&amp;gt;&amp;quot;)&lt;br /&gt;
          )&lt;br /&gt;
&lt;br /&gt;
     Backspace issues when using &amp;quot;emacs -nw&amp;quot;? They putting the following in your &amp;quot;~/.emacs&amp;quot; file&lt;br /&gt;
&lt;br /&gt;
             (global-set-key &amp;quot;\C-d&amp;quot; 'backward-delete-char)&lt;br /&gt;
             (global-set-key &amp;quot;\C-h&amp;quot; 'backward-delete-char)&lt;br /&gt;
             (global-set-key (kbd &amp;quot;DEL&amp;quot;) 'delete-char)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 114:&lt;br /&gt;
&lt;br /&gt;
        ncftpget - an intelligent ftp client (http://www.ncftp.com/). Also&lt;br /&gt;
                   check your fedora or debian install. This package allows&lt;br /&gt;
                   you to easily download packages from ftp sites.&lt;br /&gt;
&lt;br /&gt;
          This is an example of connect to an ftp site, with a subdirectory, and&lt;br /&gt;
          downloading all in one command.&lt;br /&gt;
&lt;br /&gt;
           $ ncftpget ftp://ftp.gnu.org/pub/gnu/gcc/gcc-3.2.3/gcc-3.2.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
          Of if you want to get the fedora core 3 installs&lt;br /&gt;
&lt;br /&gt;
           $ ncftpget ftp://ftp.linux.ncsu.edu/pub/fedora/linux/core/3/i386/iso/FC3*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 115:&lt;br /&gt;
&lt;br /&gt;
        expr - evaluate expressions. You can use this on the command line&lt;br /&gt;
&lt;br /&gt;
           $ expr 6 + 4&lt;br /&gt;
           10&lt;br /&gt;
&lt;br /&gt;
         Note the spaces. Without spaces, you get the following:&lt;br /&gt;
&lt;br /&gt;
           $ expr 6+4&lt;br /&gt;
           6+4&lt;br /&gt;
&lt;br /&gt;
         If you're using &amp;quot;*&amp;quot;, you'll need a &amp;quot;\&amp;quot; before it&lt;br /&gt;
&lt;br /&gt;
           $ expr 10 \* 10&lt;br /&gt;
           100&lt;br /&gt;
&lt;br /&gt;
         This also works for variables&lt;br /&gt;
&lt;br /&gt;
           $ var1=34&lt;br /&gt;
           $ expr $var1 + 3&lt;br /&gt;
           37&lt;br /&gt;
&lt;br /&gt;
         or&lt;br /&gt;
&lt;br /&gt;
           $ var1=2&lt;br /&gt;
           $ var1=`expr $var1 \* 2`&lt;br /&gt;
           $ echo $var1&lt;br /&gt;
           4&lt;br /&gt;
&lt;br /&gt;
         see (TIP 25) you can get the cosine(.23)&lt;br /&gt;
&lt;br /&gt;
           $ var1=`echo &amp;quot;c(.23)&amp;quot;|bc -l`&lt;br /&gt;
           $ echo $var1&lt;br /&gt;
           .97366639500537483696&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         You can also do substrings:&lt;br /&gt;
&lt;br /&gt;
           $ expr substr &amp;quot;BigBear&amp;quot; 4 4&lt;br /&gt;
           Bear&lt;br /&gt;
&lt;br /&gt;
         And length of strings&lt;br /&gt;
&lt;br /&gt;
           $ mstr=&amp;quot;12345&amp;quot;&lt;br /&gt;
           $ expr length $mstr&lt;br /&gt;
           5&lt;br /&gt;
&lt;br /&gt;
         Regular expressions&lt;br /&gt;
&lt;br /&gt;
           $ expr &amp;quot;a3&amp;quot; : [a-z][1-9]&lt;br /&gt;
           2&lt;br /&gt;
&lt;br /&gt;
         Or you can get a bit fancy&lt;br /&gt;
&lt;br /&gt;
           $ myexpr=&amp;quot;[a-z][1-9]&amp;quot;&lt;br /&gt;
           $ echo $myexpr&lt;br /&gt;
           [a-z][1-9]&lt;br /&gt;
&lt;br /&gt;
           $ expr &amp;quot;a3&amp;quot; : $myexpr&lt;br /&gt;
           2&lt;br /&gt;
&lt;br /&gt;
         This may not be the best way to find out if it is Friday, but&lt;br /&gt;
         it seems to work. It's more of an exercise in xargs.&lt;br /&gt;
&lt;br /&gt;
           $ date&lt;br /&gt;
           Fri Dec 31 16:44:47 EST 2004&lt;br /&gt;
           $ date|xargs -i expr {} : &amp;quot;[Fri]&amp;quot;&lt;br /&gt;
           1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 116:&lt;br /&gt;
&lt;br /&gt;
        eval&lt;br /&gt;
&lt;br /&gt;
           $ mypipe=&amp;quot;|&amp;quot;&lt;br /&gt;
           $ eval ls $mypipe wc&lt;br /&gt;
           6       6     129&lt;br /&gt;
&lt;br /&gt;
        Did you catch that? The above statement is the same as&lt;br /&gt;
&lt;br /&gt;
           $ ls | wc&lt;br /&gt;
&lt;br /&gt;
        Where &amp;quot;|&amp;quot; is put into the variable $mypipe&lt;br /&gt;
&lt;br /&gt;
        (also see TIP 118)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 117:&lt;br /&gt;
&lt;br /&gt;
        lxr, glimpse, patchset - tools for reading the kernel source&lt;br /&gt;
&lt;br /&gt;
          This example puts some of the files in /home/src since my home&lt;br /&gt;
          partition is the largest. Plus, you do not want to over write&lt;br /&gt;
          the source in /usr/src/ If you want to put your files elsewhere&lt;br /&gt;
          just substitute /home/src for your desired directory.&lt;br /&gt;
&lt;br /&gt;
         patchset -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ export SRCDIR=/home/src&lt;br /&gt;
            $ cd $SRCDIR&lt;br /&gt;
            $ wget http://www.csn.ul.ie/~mel/projects/patchset/patchset-0.5.tar.gz&lt;br /&gt;
            $ export PATH=$PATH:$SRCDIR/patchset-0.5/bin&lt;br /&gt;
&lt;br /&gt;
          Now edit &amp;quot;/home/src/patchset-0.5/etc/patchset.conf&amp;quot; and set WWW_USER to&lt;br /&gt;
          whatever your website runs as&lt;br /&gt;
&lt;br /&gt;
                  export WWW_USER=nobody&lt;br /&gt;
&lt;br /&gt;
          Getting kernel source. The last step builds and asks a lot of questions. Enter&lt;br /&gt;
          yes to things that interest you, since this is what you will see in the source&lt;br /&gt;
          code. It is not going to build for booting. The &amp;quot;downlaod -p&amp;quot; is for downloading&lt;br /&gt;
          a patch.&lt;br /&gt;
&lt;br /&gt;
            $ download 2.6.10&lt;br /&gt;
            $ createset 2.6.10&lt;br /&gt;
            $ make-kernel -b 2.6.10&lt;br /&gt;
&lt;br /&gt;
        glimpse -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ mkdir -p /home/src/glimpse&lt;br /&gt;
            $ cd /home/src/glimpse&lt;br /&gt;
            $ wget http://webglimpse.net/trial/glimpse-latest.tar.gz&lt;br /&gt;
            $ tar -xzf glimpse-latest.tar.gz&lt;br /&gt;
            $ cd glimpse-4.18.0&lt;br /&gt;
            $ ./configure; make&lt;br /&gt;
            $ make install&lt;br /&gt;
&lt;br /&gt;
        lxr -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ make -p /home/src/lxr&lt;br /&gt;
            $ cd /home/src/lxr&lt;br /&gt;
            $ wget http://heanet.dl.sourceforge.net/sourceforge/lxr/lxr-0.3.1.tar.gz&lt;br /&gt;
            $ cd lxr-0.3&lt;br /&gt;
&lt;br /&gt;
          Edit &amp;quot;Makefile&amp;quot; and set PERLBIN to &amp;quot;/usr/bin/perl&amp;quot; or the where perl is&lt;br /&gt;
          on your system. Also set INSTALLPREFIX to &amp;quot;/var/www/lxr&amp;quot;.  Then, as root&lt;br /&gt;
          do the following:&lt;br /&gt;
&lt;br /&gt;
            $ make install&lt;br /&gt;
&lt;br /&gt;
         Apache changes&lt;br /&gt;
&lt;br /&gt;
          Next edit the apache httpd.conf. On my system it is&lt;br /&gt;
          &amp;quot;/usr/local/apache2/conf/httpd.conf&amp;quot;, but if you did a fedora install&lt;br /&gt;
          I think this file is located at &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             Alias  /lxr/ &amp;quot;/var/www/lxr/&amp;quot;&lt;br /&gt;
             &amp;lt;Directory &amp;quot;/var/www/lxr/&amp;quot;&amp;gt;&lt;br /&gt;
               Options ExecCGI Indexes Includes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride all&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
&lt;br /&gt;
              &amp;lt;Files ~ (search|source|ident|diff|find)&amp;gt;&lt;br /&gt;
                    SetHandler cgi-script&lt;br /&gt;
              &amp;lt;/Files&amp;gt;&lt;br /&gt;
             &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          lxr - continued &amp;quot;/var/www/lxr/http/lxr.conf&amp;quot; changes.  The following contains&lt;br /&gt;
                my lxr.conf with changes made to almost every variable. Make sure you use&lt;br /&gt;
                your website in place of 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
                 # Configuration file.&lt;br /&gt;
                &lt;br /&gt;
                 # Define typed variable &amp;quot;v&amp;quot;, read valueset from file.&lt;br /&gt;
                 variable: v, Version, [/var/www/lxr/source/versions], [/var/www/lxr/source/defversion]&lt;br /&gt;
                &lt;br /&gt;
                 # Define typed variable &amp;quot;a&amp;quot;.  First value is default.&lt;br /&gt;
                 variable: a, Architecture, (i386, alpha, m68k, mips, ppc, sparc, sparc64)&lt;br /&gt;
                &lt;br /&gt;
                 # Define the base url for the LXR files.&lt;br /&gt;
                 baseurl: http://192.168.1.71/lxr/http/&lt;br /&gt;
                &lt;br /&gt;
                 # These are the templates for the HTML heading, directory listing and&lt;br /&gt;
                 # footer, respectively.&lt;br /&gt;
                 htmlhead: /var/www/lxr/http/template-head&lt;br /&gt;
                 htmltail: /var/www/lxr/http/template-tail&lt;br /&gt;
                 htmldir:  /var/www/lxr/http/template-dir&lt;br /&gt;
                &lt;br /&gt;
                 # The source is here.&lt;br /&gt;
                 sourceroot: /var/www/lxr/source/$v/&lt;br /&gt;
                 srcrootname: Linux&lt;br /&gt;
                &lt;br /&gt;
                 # &amp;quot;#include &amp;lt;foo.h&amp;gt;&amp;quot; is mapped to this directory (in the LXR source&lt;br /&gt;
                 # tree)&lt;br /&gt;
                 incprefix: /include&lt;br /&gt;
                &lt;br /&gt;
                 # The database files go here.&lt;br /&gt;
                 dbdir: /var/www/lxr/source/$v/&lt;br /&gt;
                &lt;br /&gt;
                 # Glimpse can be found here.&lt;br /&gt;
                 glimpsebin: /usr/local/bin/glimpse&lt;br /&gt;
                &lt;br /&gt;
                 # The power of regexps.  This is pretty Linux-specific, but quite&lt;br /&gt;
                 # useful.  Tinker with it and see what it does.  (How's that for&lt;br /&gt;
                 # documentation?)&lt;br /&gt;
                 map: /include/asm[^\/]*/ /include/asm-$a/&lt;br /&gt;
                 map: /arch/[^\/]+/ /arch/$a/&lt;br /&gt;
&lt;br /&gt;
         Now you should be ready to run &amp;quot;make-lxr&amp;quot;. Make sure the path is setup to patchset,&lt;br /&gt;
         which is repeated here. The last step take awhile.&lt;br /&gt;
&lt;br /&gt;
            $ export SRCDIR=/home/src&lt;br /&gt;
            $ cd $SRCDIR&lt;br /&gt;
            $ export PATH=$PATH:$SRCDIR/patchset-0.5/bin&lt;br /&gt;
&lt;br /&gt;
            $  make-lxr 2.6.10&lt;br /&gt;
&lt;br /&gt;
         Now you need to index the source. Below the ./glimpse_* file will be put in&lt;br /&gt;
         root. Checkout the -H option if you do not want them here on a temporary&lt;br /&gt;
         bases of if you run out of room.&lt;br /&gt;
&lt;br /&gt;
            $ glimpseindex -o -t -w 5000 /var/www/lxr/source/2.6.10 &amp;gt;&amp;amp; .glimpse_out&lt;br /&gt;
&lt;br /&gt;
         Since the above put the files under /root/.glimpse_* they should be moved&lt;br /&gt;
&lt;br /&gt;
            $ mv /root/.glimps_* /var/www/lxr/source/2.6.10/.&lt;br /&gt;
            $ chown -R nobody.nobody ./.glimpse_*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 118:&lt;br /&gt;
&lt;br /&gt;
        exec - you can change standard output and input without starting a new&lt;br /&gt;
               process.&lt;br /&gt;
&lt;br /&gt;
          The exec redirect the output from ls and date to a file. Nothing&lt;br /&gt;
          is show on the terminal until &amp;quot;exec &amp;gt; /dev/tty&amp;quot; is performed&lt;br /&gt;
&lt;br /&gt;
            $ exec &amp;gt; mfile&lt;br /&gt;
            $ ls&lt;br /&gt;
            $ date&lt;br /&gt;
            $ exec &amp;gt; /dev/tty&lt;br /&gt;
&lt;br /&gt;
          This is an example of assigning file descriptor 3 to file &amp;quot;output3&amp;quot; for&lt;br /&gt;
          output, then, redirecting &amp;quot;ls&amp;quot; to this descriptor. Finally, file descriptor&lt;br /&gt;
          3 is used for input, and the contents are read into the cat command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
            $ exec 3&amp;gt;output3&lt;br /&gt;
            $ ls  &amp;gt;&amp;amp; 3&lt;br /&gt;
            $ exec 3&amp;lt;output3&lt;br /&gt;
            $ cat &amp;lt;&amp;amp;3&lt;br /&gt;
            ChangeLog&lt;br /&gt;
            CVS&lt;br /&gt;
            How_to_Linux_and_Open_Source.txt&lt;br /&gt;
            How_to_Linux_and_Open_Source.txt.~1.193.~&lt;br /&gt;
            mfile&lt;br /&gt;
            mfile2&lt;br /&gt;
            mfile3&lt;br /&gt;
            mftp&lt;br /&gt;
            output3&lt;br /&gt;
&lt;br /&gt;
        Could you redirect the output to 3 files and stderr?&lt;br /&gt;
&lt;br /&gt;
            $ exec 3&amp;gt;output3&lt;br /&gt;
            $ exec 4&amp;gt;output4&lt;br /&gt;
            $ exec 5&amp;gt;output5&lt;br /&gt;
&lt;br /&gt;
            $ ls &amp;gt;&amp;amp; 3 &amp;gt;&amp;amp; 4 &amp;gt;&amp;amp; 5 &amp;gt;&amp;amp; 2   // Nope, can't do this.&lt;br /&gt;
            output3  output4  output5&lt;br /&gt;
&lt;br /&gt;
         Instead, you should do the following:&lt;br /&gt;
&lt;br /&gt;
            $ ls | tee output3 | tee output4 |tee output5&lt;br /&gt;
&lt;br /&gt;
         Closing the &amp;quot;output&amp;quot; file descriptor&lt;br /&gt;
&lt;br /&gt;
            $ &amp;gt;&amp;amp;3-&lt;br /&gt;
&lt;br /&gt;
         Closing the &amp;quot;input&amp;quot; file descriptor&lt;br /&gt;
&lt;br /&gt;
            $ 3&amp;lt;&amp;amp;-&lt;br /&gt;
&lt;br /&gt;
         See what is still open on 0-10&lt;br /&gt;
&lt;br /&gt;
            $ lsof -a -p $$ -d 0-10&lt;br /&gt;
&lt;br /&gt;
         Recursion - the following counts to 5, then, quits.&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
            sleep 1&lt;br /&gt;
            declare -x n&lt;br /&gt;
            let n=${n:=0}+1&lt;br /&gt;
            [ $n -le 5 ] &amp;amp;&amp;amp; echo &amp;quot;$n&amp;quot; &amp;amp;&amp;amp;  exec $0&lt;br /&gt;
&lt;br /&gt;
         There are some real-life applications for this technique, as follows:&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
            declare -x N&lt;br /&gt;
            declare -x n&lt;br /&gt;
            N=${N:=$(od -vAn -N1 -tu4 &amp;lt; /dev/urandom)}&lt;br /&gt;
            let n=${n:=0}+1&lt;br /&gt;
            [ $(($n%2)) -eq 0 ] &amp;amp;&amp;amp; echo &amp;quot;She Loves Me!&amp;quot; || echo &amp;quot;She Loves Me NOT!&amp;quot;&lt;br /&gt;
            [ $n -lt $N ] &amp;amp;&amp;amp;  exec $0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 119:&lt;br /&gt;
&lt;br /&gt;
        runlevel - need to know the current runlevel?&lt;br /&gt;
&lt;br /&gt;
           $ who -r&lt;br /&gt;
           run-level 3  Dec 31 19:02                   last=S&lt;br /&gt;
&lt;br /&gt;
        Need to know the architecture?&lt;br /&gt;
&lt;br /&gt;
          $ arch&lt;br /&gt;
          i686&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 120:&lt;br /&gt;
&lt;br /&gt;
        at - executes commands at a specified time.&lt;br /&gt;
&lt;br /&gt;
         A few examples here. The 1970 program will run&lt;br /&gt;
         next Auguest 2 even though the year 1970 has long past.&lt;br /&gt;
&lt;br /&gt;
          $ at 6:30am Jan 12 &amp;lt; program&lt;br /&gt;
          $ at noon tomorrow &amp;lt; program&lt;br /&gt;
          $ at 1970 pm August 2 &amp;lt; program&lt;br /&gt;
&lt;br /&gt;
        This is an interactive way to use the command:&lt;br /&gt;
&lt;br /&gt;
          $ at now + 6 minutes&lt;br /&gt;
          warning: commands will be executed using (in order) a) $SHELL b) login shell c) /bin/sh&lt;br /&gt;
          at&amp;gt; ls&lt;br /&gt;
          at&amp;gt; date &amp;gt; /tmp/5min&lt;br /&gt;
          at&amp;gt; ^D&lt;br /&gt;
          job 3 at 2005-01-01 08:50&lt;br /&gt;
&lt;br /&gt;
        What jobs are in the queue?&lt;br /&gt;
&lt;br /&gt;
          $ atq&lt;br /&gt;
&lt;br /&gt;
        or&lt;br /&gt;
&lt;br /&gt;
          $ at -l&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 121:&lt;br /&gt;
&lt;br /&gt;
        Creating a Manpage&lt;br /&gt;
&lt;br /&gt;
         As root you can copy the following to /usr/local/man/man1/soup.1 which will&lt;br /&gt;
         give you a manpage for soup.&lt;br /&gt;
&lt;br /&gt;
              .\&amp;quot; Manpage for souptonuts.&lt;br /&gt;
              .\&amp;quot; Contact mchirico@users.sourceforge.com to correct errors or omissions.&lt;br /&gt;
              .TH man 1 &amp;quot;04 January 2005&amp;quot; &amp;quot;1.0&amp;quot; &amp;quot;souptonuts man page&amp;quot;&lt;br /&gt;
              .SH NAME&lt;br /&gt;
              soup \- man page for souptonuts&lt;br /&gt;
              .SH SYNOPSIS&lt;br /&gt;
              soup&lt;br /&gt;
              .SH DESCRIPTION&lt;br /&gt;
              souptonuts is a collection of linux and open&lt;br /&gt;
              source tips.&lt;br /&gt;
              off for golf.&lt;br /&gt;
              .SH OPTIONS&lt;br /&gt;
              The souptonuts does not take any options.&lt;br /&gt;
              .SH SEE ALSO&lt;br /&gt;
              doughnut(1), golf(8)&lt;br /&gt;
              .SH BUGS&lt;br /&gt;
              No known bugs at this time.&lt;br /&gt;
              .SH AUTHOR&lt;br /&gt;
              Mike Chirico (mchirico@comcast.net mchirico@users.sourceforge.net)&lt;br /&gt;
&lt;br /&gt;
         So, to view this man page&lt;br /&gt;
&lt;br /&gt;
            $ man soup&lt;br /&gt;
&lt;br /&gt;
         It's also possible to compress&lt;br /&gt;
&lt;br /&gt;
            $ gzip /usr/local/man/man1/soup.1&lt;br /&gt;
&lt;br /&gt;
         For plenty of examples look at the other man pages. Also the following&lt;br /&gt;
         is helpful. The last one is a tutorial &amp;quot;man 7 mdoc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            $ man manpath&lt;br /&gt;
            $ man groff&lt;br /&gt;
            $ man 7 mdoc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 122:&lt;br /&gt;
&lt;br /&gt;
        dmesg - print out boot messages, or what is in the kernel ring buffer.&lt;br /&gt;
&lt;br /&gt;
          If you missed the messages on boot-up, you can use dmesg to print them.&lt;br /&gt;
&lt;br /&gt;
            $ dmesg &amp;gt; boot.msg&lt;br /&gt;
&lt;br /&gt;
          Or to print, then, clear the ring&lt;br /&gt;
&lt;br /&gt;
            # dmesg -c &amp;gt; boot.msg&lt;br /&gt;
&lt;br /&gt;
          (also see TIP 20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 123:&lt;br /&gt;
&lt;br /&gt;
        gnus - emacs email nntp news reader (comcast as example with NO TLS or SSL)&lt;br /&gt;
&lt;br /&gt;
          First check that you can connect to the news group:&lt;br /&gt;
&lt;br /&gt;
                 $ telnet newsgroups.comcast.net 119&lt;br /&gt;
                 Trying 216.196.97.136...&lt;br /&gt;
                 Connected to newsgroups.comcast.net.&lt;br /&gt;
                 Escape character is '^]'.&lt;br /&gt;
                 200 News.GigaNews.Com&lt;br /&gt;
&lt;br /&gt;
          If you want to check for TLS or SSL see (TIP 54).&lt;br /&gt;
&lt;br /&gt;
          Here is a very simple configuration example without encryption. It&lt;br /&gt;
          appears that comcast does not support ssl or TLS.&lt;br /&gt;
&lt;br /&gt;
          In the &amp;quot;~/.emacs&amp;quot; file you would add the following to get comcast&lt;br /&gt;
          news groups&lt;br /&gt;
&lt;br /&gt;
             (setq gnus-select-method '(nntp &amp;quot;newsgroups.comcast.net&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
          Then, create an &amp;quot;~/.authinfo&amp;quot; file with the following settings using&lt;br /&gt;
          you own username and password.&lt;br /&gt;
&lt;br /&gt;
             machine newsgroups.comcast.net login borkey@comcast.net  password borkeypass0rd&lt;br /&gt;
&lt;br /&gt;
          Next create a &amp;quot;~/.newsrc&amp;quot; with your groups&lt;br /&gt;
&lt;br /&gt;
             news.announce.newusers:&lt;br /&gt;
             comp.lang.c++.moderated! 1-500&lt;br /&gt;
             comp.unix.programmer! 1-500&lt;br /&gt;
             comp.unix.shell! 1-500&lt;br /&gt;
             gnu.emacs.gnus! 1-500&lt;br /&gt;
&lt;br /&gt;
          Finally, create a &amp;quot;~/.gnus&amp;quot; with the following email settings for you&lt;br /&gt;
&lt;br /&gt;
             (setq user-mail-address &amp;quot;mchirico@comcast.net&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
             (defun my-message-mode-setup ()&lt;br /&gt;
               (setq fill-column 72)&lt;br /&gt;
               (turn-on-auto-fill))&lt;br /&gt;
               (add-hook 'message-mode-hook 'my-message-mode-setup)&lt;br /&gt;
&lt;br /&gt;
          To get into gnus&lt;br /&gt;
&lt;br /&gt;
              E-x gnus&lt;br /&gt;
&lt;br /&gt;
          The following are common gnus commands&lt;br /&gt;
&lt;br /&gt;
                RET  view the article under the cursor&lt;br /&gt;
&lt;br /&gt;
                A A (shift-a, shift a): List all newsgroups known&lt;br /&gt;
                                        to the server.&lt;br /&gt;
&lt;br /&gt;
                l (lower-case L)      : List only  subscribed groups&lt;br /&gt;
                                        with unread articles.&lt;br /&gt;
&lt;br /&gt;
                L                     : List all newsgroups in .newsrc file.&lt;br /&gt;
&lt;br /&gt;
                g                     : See if new articles have arrived.&lt;br /&gt;
&lt;br /&gt;
            Some commands for reading&lt;br /&gt;
&lt;br /&gt;
                n  next unread article&lt;br /&gt;
&lt;br /&gt;
                p  previous article&lt;br /&gt;
&lt;br /&gt;
                SPC  scroll down  moves to next unread&lt;br /&gt;
                     when at the bottom of the article&lt;br /&gt;
&lt;br /&gt;
                del  scroll up&lt;br /&gt;
&lt;br /&gt;
                F  follow-up to group on the article you are&lt;br /&gt;
                   reading now.&lt;br /&gt;
&lt;br /&gt;
                f  follow-up to group without citing the article&lt;br /&gt;
&lt;br /&gt;
                R  reply by mail and cite the article&lt;br /&gt;
&lt;br /&gt;
                r  reply by mail without citing the article&lt;br /&gt;
&lt;br /&gt;
                m  new mail&lt;br /&gt;
&lt;br /&gt;
                a  new posting&lt;br /&gt;
&lt;br /&gt;
                c  Catchup&lt;br /&gt;
&lt;br /&gt;
                C-u / t  Show only young headers&lt;br /&gt;
                         / t without C-u limits the summary&lt;br /&gt;
                         to old headers&lt;br /&gt;
&lt;br /&gt;
                T T  toggle threading&lt;br /&gt;
&lt;br /&gt;
                C-u g  Display raw article&lt;br /&gt;
                       hit g to return to normal view&lt;br /&gt;
&lt;br /&gt;
                t  Show all headers  it's a toggle&lt;br /&gt;
&lt;br /&gt;
                W w  Wordwrap the current article&lt;br /&gt;
&lt;br /&gt;
                W r  Decode ROT13  a toggle&lt;br /&gt;
&lt;br /&gt;
                ^  fetch parent of article&lt;br /&gt;
&lt;br /&gt;
                L  create a scorefile-entry based&lt;br /&gt;
                   on the current article (low score)&lt;br /&gt;
                   ? gives you information what each char means&lt;br /&gt;
&lt;br /&gt;
                I  like L but high score&lt;br /&gt;
&lt;br /&gt;
          Commands to send email&lt;br /&gt;
&lt;br /&gt;
            C-c C-c  send message&lt;br /&gt;
&lt;br /&gt;
            C-c C-d  save message as draft&lt;br /&gt;
&lt;br /&gt;
            C-c C-k  kill message&lt;br /&gt;
&lt;br /&gt;
            C-c C-m f  attach file&lt;br /&gt;
&lt;br /&gt;
            M-q  reformat paragraph&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 124:&lt;br /&gt;
&lt;br /&gt;
        Sending Email from telnet&lt;br /&gt;
&lt;br /&gt;
           Note, if you are on the computer you can sometime use the local loopback.&lt;br /&gt;
           In fact, sometimes you can only use the local loop back 127.0.0.1 in&lt;br /&gt;
           place of &amp;quot;bozo.company.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            1     [mchirico@soup Notes]$ telnet bozo.company.com 25&lt;br /&gt;
            2     Trying 192.168.0.204...&lt;br /&gt;
            3     Connected to bozo.company.com.&lt;br /&gt;
            4     Escape character is '^]'.&lt;br /&gt;
            5     220 bozo.company.com ESMTP Postfix (Postfix-20010228-pl03) (Mandrake Linux)&lt;br /&gt;
            6     HELO fakedomain.com&lt;br /&gt;
            7     HELO fakedomain.com         // server echo&lt;br /&gt;
            8     250 bozo.company.com&lt;br /&gt;
            9     MAIL FROM: test@fakedomain.com&lt;br /&gt;
           10     MAIL FROM: test@fakedomain.com   // server echo&lt;br /&gt;
           11     250 Ok&lt;br /&gt;
           12     RCPT TO: mchirico@someother.com&lt;br /&gt;
           13     RCPT TO: mchirico@someother.com   // server echo&lt;br /&gt;
           14     250 Ok&lt;br /&gt;
           15     DATA&lt;br /&gt;
           16     DATA    // echo&lt;br /&gt;
           17     354 Enter mail, end with &amp;quot;.&amp;quot; on a line by itself&lt;br /&gt;
           18     This is a test message&lt;br /&gt;
           19     This is a test message&lt;br /&gt;
           20     to send&lt;br /&gt;
           21     to send&lt;br /&gt;
           22     .&lt;br /&gt;
           23     250 2.0.0 j0B0uH3L018469 Message accepted for delivery&lt;br /&gt;
&lt;br /&gt;
          Above on line 6 you can type in any domain name. Line 7 is an echo. All&lt;br /&gt;
          echos are listed in the comment field.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 125:&lt;br /&gt;
&lt;br /&gt;
          IP forwarding, IP Masquerade&lt;br /&gt;
&lt;br /&gt;
             # echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
             # ipchains -F forward&lt;br /&gt;
             # ipchains -P forward DENY&lt;br /&gt;
             # ipchains -A forward -s 192.168.0.0/24 -j MASQ&lt;br /&gt;
             # ipchains -A forward -i eth1 -j MASQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          This assumes that your internal network is 192.168.0.0 on eth1, and the&lt;br /&gt;
          internet is connected to eth0.&lt;br /&gt;
&lt;br /&gt;
          (Also See TIP 182)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 126:&lt;br /&gt;
&lt;br /&gt;
         Setting KDE as the default desktop manager&lt;br /&gt;
&lt;br /&gt;
               Edit &amp;quot;/etc/sysconfig/desktop&amp;quot; to include the two lines:&lt;br /&gt;
&lt;br /&gt;
                 DESKTOP=&amp;quot;KDE&amp;quot;&lt;br /&gt;
                 DISPLAYMANAGER=&amp;quot;KDE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 127:&lt;br /&gt;
&lt;br /&gt;
        Have a file and you do not know whay type it is (tar, gz, ASCII, binary) ?&lt;br /&gt;
        Use the file command.  Below it is used on the file &amp;quot;mftp&amp;quot;&lt;br /&gt;
&lt;br /&gt;
               $ file mftp&lt;br /&gt;
               mftp: Bourne-Again shell script text executable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 128:&lt;br /&gt;
&lt;br /&gt;
        Software RAID: Two good references&lt;br /&gt;
&lt;br /&gt;
          http://www.tldp.org/HOWTO/Software-RAID-HOWTO-1.html&lt;br /&gt;
          http://lists.us.dell.com/pipermail/linux-poweredge/2003-July/014331.html&lt;br /&gt;
&lt;br /&gt;
        Note, you must setup grub for each RAID 1 device. Suppose you have&lt;br /&gt;
        2 SCSI drives (sda and sdb). By default grub is setup on sda; but, you&lt;br /&gt;
        need to enable it for sdb (/dev/hdb for ide) as follows:&lt;br /&gt;
&lt;br /&gt;
           grub&amp;gt;device (hd0) /dev/sdb&lt;br /&gt;
           grub&amp;gt;root (hd0,0)&lt;br /&gt;
           grub&amp;gt;setup (hd0)&lt;br /&gt;
&lt;br /&gt;
           Checking if &amp;quot;/boot/grub/stage1&amp;quot; exists... no&lt;br /&gt;
           Checking if &amp;quot;/grub/stage1&amp;quot; exists... yes&lt;br /&gt;
           Checking if &amp;quot;/grub/stage2&amp;quot; exists... yes&lt;br /&gt;
           Checking if &amp;quot;/grub/e2fs_stage1_5&amp;quot; exists.. yes&lt;br /&gt;
           Running &amp;quot;embed /grub/e2fs_stage1_5 (hd0)&amp;quot;... 16 sectors are embedded.&lt;br /&gt;
          succeeded&lt;br /&gt;
           Running &amp;quot;install /grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/grub/stage2 /grub/grub&lt;br /&gt;
         .conf&amp;quot;... succeeded.&lt;br /&gt;
         Done.&lt;br /&gt;
&lt;br /&gt;
          grub&amp;gt;&lt;br /&gt;
          grub&amp;gt;quit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Checking to see if everything is working:&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
        Checking the drives&lt;br /&gt;
&lt;br /&gt;
          $ sfdisk -d /dev/sdb&lt;br /&gt;
          $ sfdisk -d /dev/sda&lt;br /&gt;
&lt;br /&gt;
          $ fdisk -l /dev/sda  &amp;quot;This will give general information&amp;quot;&lt;br /&gt;
          $ fdisk -l           &amp;quot;General information for all drives&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Adding raid (assume you want to add the first drive &amp;quot;sda1&amp;quot;, or if it is the second&lt;br /&gt;
                    drive then substitute &amp;quot;sda2&amp;quot; below )&lt;br /&gt;
&lt;br /&gt;
          $ raidhotadd /dev/md0 /dev/sda1&lt;br /&gt;
          $ raidhotadd /dev/md1 /dev/sda2&lt;br /&gt;
          $ raidhotadd /dev/md2 /dev/sda3&lt;br /&gt;
&lt;br /&gt;
        This is an example of an cat /proc/mdstat that is working. Note that&lt;br /&gt;
        there is a listing for both sda1[0] and sdb1[1]&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
                Personalities : [raid1]&lt;br /&gt;
                read_ahead 1024 sectors&lt;br /&gt;
                Event: 12&lt;br /&gt;
                md0 : active raid1 sda1[0] sdb1[1]&lt;br /&gt;
                      104320 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md1 : active raid1 sda2[0] sdb2[1]&lt;br /&gt;
                      1044160 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md2 : active raid1 sda3[0] sdb3[1]&lt;br /&gt;
                      34411136 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        Compare that to this where md2 is missing sdb3&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
                Personalities : [raid1]&lt;br /&gt;
                read_ahead 1024 sectors&lt;br /&gt;
                Event: 9&lt;br /&gt;
                md0 : active raid1 sda1[0] sdb1[1]&lt;br /&gt;
                      104320 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md1 : active raid1 sda2[0] sdb2[1]&lt;br /&gt;
                      1044160 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md2 : active raid1 sdb3[1]        &amp;lt;---- HERE&lt;br /&gt;
                      34411136 blocks [2/1] [_U]&lt;br /&gt;
&lt;br /&gt;
                unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        If you are rebuilding an array, you can watch it by doing the following:&lt;br /&gt;
&lt;br /&gt;
           $ watch -n1 cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
        Need to know the raid setup?&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/raidtab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 129:&lt;br /&gt;
&lt;br /&gt;
        Resetting Redhat Linux Passwords using GRUB&lt;br /&gt;
&lt;br /&gt;
           1. Press 'e'&lt;br /&gt;
           2. Press 'e' again&lt;br /&gt;
           3. Append 'single' to the kernel version listing&lt;br /&gt;
&lt;br /&gt;
          See&lt;br /&gt;
             http://linuxgazette.net/107/tomar.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 130:&lt;br /&gt;
&lt;br /&gt;
        mtr - matt's traceroute. This is an advanced traceroute that keeps&lt;br /&gt;
              [http://www.bitwizard.nl/mtr/]&lt;br /&gt;
                  $ mtr www.yahoo.com&lt;br /&gt;
&lt;br /&gt;
                                              Matt's traceroute  [v0.52]&lt;br /&gt;
                     third-fl-71.localdomain                            Thu Jan 20 11:05:57 2005&lt;br /&gt;
                     Keys:  D - Display mode    R - Restart statistics    Q - Quit&lt;br /&gt;
                                                            Packets               Pings&lt;br /&gt;
                     Hostname                            %Loss  Rcv  Snt  Last Best  Avg  Worst&lt;br /&gt;
                      1. 192.168.1.1                        0%    3    3     0    0    0      1&lt;br /&gt;
                      2. ???&lt;br /&gt;
                      3. fe-2-6-rr01.willogrove5.pa.pa01    0%    3    3     8    7    7      8&lt;br /&gt;
                      4. srp-8-1-ar01.willowgrove1.pa.pa    0%    2    2     8    8    8      8&lt;br /&gt;
                      5. pos7-3-cr01.torresdale.pa.core.    0%    2    2     8    8    8      8&lt;br /&gt;
                      6. 12.119.53.53                       0%    2    2    12   12   12     13&lt;br /&gt;
                      7. tbr1-p012401.phlpa.ip.att.net      0%    2    2    12   12   13     13&lt;br /&gt;
                      8. tbr1-cl8.n54ny.ip.att.net          0%    2    2    13   13   13     13&lt;br /&gt;
                      9. ggr2-p310.n54ny.ip.att.net         0%    2    2    12   12   13     14&lt;br /&gt;
                     10. so-1-0-0.gar4.NewYork1.Level3.n    0%    2    2    14   14   37     61&lt;br /&gt;
                     11. ae-1-54.bbr2.NewYork1.Level3.ne    0%    2    2    13   12   13     13&lt;br /&gt;
                     12. ge-0-3-0.bbr2.Washington1.Level    0%    2    2    19   19   19     19&lt;br /&gt;
                     13. ge-1-1-51.car1.Washington1.Leve    0%    2    2    18   18   19     20&lt;br /&gt;
                     14. 4.79.228.6                         0%    2    2    21   19   20     21&lt;br /&gt;
                     15. UNKNOWN-216-109-120-201.yahoo.c    0%    2    2    21   20   20     21&lt;br /&gt;
                     16. w2.rc.vip.dcn.yahoo.com            0%    2    2    23   21   22     23&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 131:&lt;br /&gt;
&lt;br /&gt;
        chfn - change finger information&lt;br /&gt;
&lt;br /&gt;
            $ chfn&lt;br /&gt;
&lt;br /&gt;
          Next you are asked for a password and user information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 132:&lt;br /&gt;
&lt;br /&gt;
        chsh - change login shell&lt;br /&gt;
&lt;br /&gt;
          First, you may want to get a listing of all the possible&lt;br /&gt;
          shells.&lt;br /&gt;
&lt;br /&gt;
             $ chsh -l&lt;br /&gt;
&lt;br /&gt;
               /bin/sh&lt;br /&gt;
               /bin/bash&lt;br /&gt;
               /sbin/nologin&lt;br /&gt;
               /bin/ash&lt;br /&gt;
               /bin/bsh&lt;br /&gt;
               /bin/ksh&lt;br /&gt;
               /usr/bin/ksh&lt;br /&gt;
               /usr/bin/pdksh&lt;br /&gt;
               /bin/tcsh&lt;br /&gt;
               /bin/csh&lt;br /&gt;
               /bin/zsh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 133:&lt;br /&gt;
&lt;br /&gt;
        bash - working with binary, hex and base 3.&lt;br /&gt;
&lt;br /&gt;
         For the variable must be declare as an integer. Then&lt;br /&gt;
         specify the  &amp;lt;base&amp;gt;#&amp;lt;value&amp;gt;. The example below is 22 in&lt;br /&gt;
         base 3.&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n&lt;br /&gt;
              $ n=3#22&lt;br /&gt;
              $ echo $n&lt;br /&gt;
                8&lt;br /&gt;
&lt;br /&gt;
           Base 16 (hex)&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n2&lt;br /&gt;
              $ n2=16#a&lt;br /&gt;
              $ echo $n2&lt;br /&gt;
                10&lt;br /&gt;
&lt;br /&gt;
           Base 8 (octal)&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n3&lt;br /&gt;
              $ n3=8#11&lt;br /&gt;
              $ echo $n3&lt;br /&gt;
                9   Note 8+1=9&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 134:&lt;br /&gt;
&lt;br /&gt;
        monitoring IP traffic. Try iptraf http://iptraf.seul.org/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 135:&lt;br /&gt;
&lt;br /&gt;
        enscript - convert text files to PostScript&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 136:&lt;br /&gt;
&lt;br /&gt;
        dd and tar - blocking factor. How to determine the blocking factor, block size&lt;br /&gt;
                   so that tar and dd can work together.&lt;br /&gt;
&lt;br /&gt;
        Step 1: Create a large file on local disk, in a directory &amp;quot;1&amp;quot; that will eventually&lt;br /&gt;
                be written to tape. This will be created with dd as follows:&lt;br /&gt;
&lt;br /&gt;
                $ mkdir 1&lt;br /&gt;
                $ dd if=/dev/zero of=disk-image count=40960&lt;br /&gt;
                  40960+0 records in&lt;br /&gt;
                  40960+0 records out&lt;br /&gt;
&lt;br /&gt;
                $ cd ..&lt;br /&gt;
&lt;br /&gt;
        Step 2: tar the directory and contents to tape. First rewind the tape. These examples&lt;br /&gt;
                use /dev/nst0 as the location of the tape. Make sure to substitute your values&lt;br /&gt;
                if needed.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ tar --label=&amp;quot;Test 1&amp;quot; --create --blocking-factor=128 --file=/dev/nst0 1&lt;br /&gt;
&lt;br /&gt;
        Step 3: Read data from the tape using a block size of 128k. If you get an I/O error, which&lt;br /&gt;
                could happend if you used a different blocking factor above, then, you may need&lt;br /&gt;
                to increase the bs to 256, or 512 etc. as needed.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=/dev/nst0 bs=128k of=testblocksz count=1&lt;br /&gt;
                 0+1 records in&lt;br /&gt;
                 0+1 records out&lt;br /&gt;
&lt;br /&gt;
                $ ls -l testblocksz&lt;br /&gt;
                 -rw-r--r--    1 root     root        65536 Feb  9 10:41 testblocksz&lt;br /&gt;
&lt;br /&gt;
                $ ls -lh testblocksz&lt;br /&gt;
                 -rw-r--r--    1 root     root          64k Feb  9 10:41 testblocksz&lt;br /&gt;
&lt;br /&gt;
               Note above that the size 65536 is equal to 64k. That &amp;quot;h&amp;quot; switch in &amp;quot;ls&amp;quot; is for&lt;br /&gt;
               human readable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 4: tar uses a multiplier of 512*blocking-factor to get block size. Again&lt;br /&gt;
&lt;br /&gt;
                 512 * blocking-factor = block size used in dd command.&lt;br /&gt;
&lt;br /&gt;
              Putting in the values, we see that&lt;br /&gt;
&lt;br /&gt;
                 512 * 128 = 65536&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 5: So what does this tell you? You can now use these numbers to &amp;quot;dd&amp;quot; files&lt;br /&gt;
              to tape. But, first tar will be used to create the file locally.&lt;br /&gt;
&lt;br /&gt;
                $ tar --label=&amp;quot;Test 1&amp;quot; --create --blocking-factor=128 --file=test.tar 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 6: Send this to tape with the dd command. Remember 64k is equal to 65536.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=test.tar bs=64k of=/dev/nst0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 7: Now test that it can be read with tar command using blocking-factor=128.&lt;br /&gt;
             Note the &amp;quot;t&amp;quot; command in tar is for tell. It will not write data.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ tar -tvf /dev/nst0 --blocking-factor=128&lt;br /&gt;
                 V--------- 0/0               0 2005-02-09 10:38:20 Test 1--Volume Header--&lt;br /&gt;
                 drwxr-xr-x root/root         0 2005-02-09 10:34:10 1/&lt;br /&gt;
                 -rw-r--r-- root/root  20971520 2005-02-09 10:34:11 1/disk-image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 8: Reading tape data with dd. Most of the time a high &amp;quot;ibs&amp;quot; input block size&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=/dev/nst0 of=outfromdd.tar ibs=64k&lt;br /&gt;
                 321+0 records in&lt;br /&gt;
                 41088+0 records out&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 9: Verify that outfromdd.tar can be read by tar with blocking-factor=128&lt;br /&gt;
&lt;br /&gt;
                $ tar -tvf outfromdd.tar --blocking-factor=128&lt;br /&gt;
                 V--------- 0/0               0 2005-02-09 10:38:20 Test 1--Volume Header--&lt;br /&gt;
                 drwxr-xr-x root/root         0 2005-02-09 10:34:10 1/&lt;br /&gt;
                 -rw-r--r-- root/root  20971520 2005-02-09 10:34:11 1/disk-image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       PULLING FILES:  The dd command can be used to pull files.&lt;br /&gt;
&lt;br /&gt;
              ssh target_address dd if=remotefile | dd of=localfile&lt;br /&gt;
&lt;br /&gt;
           Or, a specific example of getting a file from a computer called hamlet.&lt;br /&gt;
&lt;br /&gt;
              $ ssh root@hamlet  dd if=/home/cvs/test | dd of=/home/storage/test&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        GOING BACKWARD AND FORWARD ON TAPE:&lt;br /&gt;
&lt;br /&gt;
             Go to end of data&lt;br /&gt;
              $ mt -f /dev/nst0  eod&lt;br /&gt;
&lt;br /&gt;
             Previous record&lt;br /&gt;
              $ mt -f /dev/nst0  bsfm 1&lt;br /&gt;
&lt;br /&gt;
             Forward record&lt;br /&gt;
              $ mt -f /dev/nst0  fsf 1&lt;br /&gt;
&lt;br /&gt;
             Rewind&lt;br /&gt;
              $ mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
             Tell&lt;br /&gt;
              $ mt -f /dev/nst0 tell&lt;br /&gt;
&lt;br /&gt;
         (Reference TIP 151 - for how to get around firewalls)&lt;br /&gt;
&lt;br /&gt;
         Below is a script that I use to backup computers via ssh. The&lt;br /&gt;
         tape drive is on &amp;quot;nis&amp;quot; and the extra space is on &amp;quot;hamlet&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                #!/bin/bash&lt;br /&gt;
                # Program to backup server remotely&lt;br /&gt;
                # Assume remote server is nis, you are on squeezel&lt;br /&gt;
                #&lt;br /&gt;
                # Recover from tape&lt;br /&gt;
                #&lt;br /&gt;
                #   dd if=/dev/nst0 of=test.tar.gz bs=64k&lt;br /&gt;
                #&lt;br /&gt;
                filename=&amp;quot;support1.$(date &amp;quot;+%m%d%y%H%M&amp;quot;).tar.gz&amp;quot;&lt;br /&gt;
                DIRTOBACKUP=/var/www&lt;br /&gt;
                #tar cvzf - $DIRTOBACKUP | ssh  root@nis  '(mt -f /dev/nst0 rewind; dd of=/dev/nst0 bs=64k )'&lt;br /&gt;
                tar cvzf - $DIRTOBACKUP | ssh  support1@hamlet &amp;quot;dd of=/home/support1/backups/${filename} &amp;quot;&lt;br /&gt;
&lt;br /&gt;
         Another example program, below, pushes the last &amp;quot;.tar.gz&amp;quot; file to tape:&lt;br /&gt;
&lt;br /&gt;
                #!/bin/bash&lt;br /&gt;
                # Program to push files to tape&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                # Notes on recovering from tape&lt;br /&gt;
                #&lt;br /&gt;
                #   dd if=/dev/nst0 of=test.tar.gz ibs=64k&lt;br /&gt;
                #    or&lt;br /&gt;
                #  $ ssh root@tapeserver &amp;quot;mt -f /dev/nst0 rewind&amp;quot;&lt;br /&gt;
                #  $ ssh root@tapeserver &amp;quot;dd if=/dev/nst0 ibs=64k&amp;quot;|dd of=cvs1.tar.gz&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                # First rewind tape&lt;br /&gt;
                ssh root@tapeserver 'mt -f /dev/nst0 rewind'&lt;br /&gt;
                #&lt;br /&gt;
                # Grab only the last file&lt;br /&gt;
                file=$(find /home/cvs  -iname 'cvs*.tar.gz'|sort|tail -n 1)&lt;br /&gt;
                dd if=${file}|ssh root@tapeserver 'dd of=/dev/nst0 bs=64k'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 137:&lt;br /&gt;
&lt;br /&gt;
        Apache - redirecting pages. All changes are in httpd.conf&lt;br /&gt;
&lt;br /&gt;
               RedirectMatch (.*)\.gif$ http://www.anotherserver.com$1.jpg&lt;br /&gt;
&lt;br /&gt;
               Redirect /service http://foo2.bar.com/service&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 138:&lt;br /&gt;
&lt;br /&gt;
        samba mounts via ssh - mounting a samba share through an ssh tunnel, going&lt;br /&gt;
               through an intermediate computer, that accepts ssh. We'll call this&lt;br /&gt;
               intermediate computer middle [65.219.4.23], and we want to get to&lt;br /&gt;
               destination [192.168.0.81]. The user will be mchirico.&lt;br /&gt;
&lt;br /&gt;
          STEP 1:&lt;br /&gt;
&lt;br /&gt;
               $ mkdir -p /samba/share&lt;br /&gt;
&lt;br /&gt;
          STEP 2:&lt;br /&gt;
&lt;br /&gt;
            This has to be done as root, since we are using a lower port.&lt;br /&gt;
&lt;br /&gt;
               $ ssh -N -L 139:192.168.0.81:139 mchirico@65.219.4.23&lt;br /&gt;
&lt;br /&gt;
          STEP 3:&lt;br /&gt;
&lt;br /&gt;
              umount /samba/sales&lt;br /&gt;
              /bin/mount -t smbfs -o  username=donkey,workgroup=donkeydomain,&lt;br /&gt;
                      password=passw0rk1,port=139,dmask=770,fmask=660,&lt;br /&gt;
                      netbiosname=homecpu //localhost/share /samba/share&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 139:&lt;br /&gt;
&lt;br /&gt;
        Music on Fedora Core -- How to play music on http://magnatune.com with &amp;quot;xmms&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           The following command will show the sound driver:&lt;br /&gt;
&lt;br /&gt;
              $ lspci|grep -i audio&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          STEP 1:&lt;br /&gt;
&lt;br /&gt;
                Unmute amixer with the following command:&lt;br /&gt;
&lt;br /&gt;
              $ amixer set Master 100% unmute&lt;br /&gt;
              $ amixer set PCM 100%  unmute&lt;br /&gt;
&lt;br /&gt;
                Note you can also get a graphical interface with &amp;quot;alsamixer&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              $ alsamixer&lt;br /&gt;
&lt;br /&gt;
                 h,F1   -- for help&lt;br /&gt;
                 Esc    -- exit&lt;br /&gt;
                 Tab    -- move to selections&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          STEP 2:&lt;br /&gt;
&lt;br /&gt;
                Test a sound file &amp;quot;*.au&amp;quot; with aplay. To quickly find files on your system use&lt;br /&gt;
                the &amp;quot;locate *.au&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
                  $ aplay /usr/lib/python2.3/test/audiotest.au&lt;br /&gt;
&lt;br /&gt;
          STEP 3:&lt;br /&gt;
&lt;br /&gt;
                Install &amp;quot;xmms-mp3-1.2.10-9.2.1.fc3.rf.i386.rpm&amp;quot; which does not come with Fedora because&lt;br /&gt;
                of GPL license restrictions.  The latest version of this package can be found&lt;br /&gt;
                at the following url:&lt;br /&gt;
&lt;br /&gt;
                  http://rpmseek.com/rpm-pl/xmms-mp3.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                  $ rpm -ivh xmms-mp3-1.2.10-9.2.1.fc3.rf.i386.rpm&lt;br /&gt;
&lt;br /&gt;
          STEP 4:&lt;br /&gt;
&lt;br /&gt;
                Go to magnatun &amp;quot;http://magnatune.com/&amp;quot;, select genre and make sure xmms&lt;br /&gt;
                is the default player.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 140:&lt;br /&gt;
&lt;br /&gt;
        Routing -- getting access to a network 1 hop away. You are currently on the 192 network&lt;br /&gt;
                   and you want access to the 172.21.0.0 network that has a computer straddling&lt;br /&gt;
                   the two, with /proc/sys/net/ipv4/ip_forward set to 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               $ route add -net 172.21.0.0 netmask 255.255.255.0 gw 192.168.0.204&lt;br /&gt;
&lt;br /&gt;
         To undo:&lt;br /&gt;
&lt;br /&gt;
               $ route del -net 172.21.0.0 netmask 255.255.255.0 gw 192.168.0.204&lt;br /&gt;
&lt;br /&gt;
         Now you can ping 172.21.0.21.&lt;br /&gt;
&lt;br /&gt;
         Does not work?&lt;br /&gt;
&lt;br /&gt;
         Go on to 192.168.0.204 and execute the following commands:&lt;br /&gt;
&lt;br /&gt;
               $ echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
               $ cat /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
               1&lt;br /&gt;
&lt;br /&gt;
         To Look at the the gateway, execute the following command.&lt;br /&gt;
&lt;br /&gt;
               $ netstat -r&lt;br /&gt;
&lt;br /&gt;
         References: &lt;br /&gt;
&lt;br /&gt;
               http://lartc.org/lartc.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 141:&lt;br /&gt;
&lt;br /&gt;
        RAM disk -- creating a filesystem in RAM.&lt;br /&gt;
&lt;br /&gt;
               $ mkfs -t ext3 -q /dev/ram1 4096&lt;br /&gt;
               $ mkdir -p /fsram&lt;br /&gt;
               $ mount /dev/ram1 /fsram -o defaults,rw&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 142:&lt;br /&gt;
&lt;br /&gt;
        Create a Live Linux CDROM  using  BusyBox and OpenSSH.&lt;br /&gt;
&lt;br /&gt;
            These steps are rather long. A complete tutorial is given at&lt;br /&gt;
            the following link:&lt;br /&gt;
             http://prdownloads.sourceforge.net/souptonuts/instructions_boot_system.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 143:&lt;br /&gt;
&lt;br /&gt;
      SystemImager (http://www.systemimager.org/) SystemImager is software that automates Linux installs,&lt;br /&gt;
                       software distribution, and production deployment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 144:&lt;br /&gt;
&lt;br /&gt;
      Mounted a filesystem in rescue mode, yet, you cannot read and write?  Remount.&lt;br /&gt;
&lt;br /&gt;
             $ mount -o remount /&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 145:&lt;br /&gt;
&lt;br /&gt;
      Nmap commands to check for Microsoft VPN connection.&lt;br /&gt;
&lt;br /&gt;
         $ nmap -sO -p 47 vpn1.someserver.com&lt;br /&gt;
         $ nmap -sS -p T:1723 vpn1.someserver.com&lt;br /&gt;
&lt;br /&gt;
      By the way, with nmap you can specify multiple ports. Below&lt;br /&gt;
      is an example of multiple ports; but, use the commands above&lt;br /&gt;
      for Microsoft VPN services.&lt;br /&gt;
&lt;br /&gt;
         $ nmap -sS -p T:1723-3000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 146:&lt;br /&gt;
&lt;br /&gt;
      Perl and ssh - monitoring systems. The output from ssh can be parsed. Below is&lt;br /&gt;
      a simple procedure to just to read the ssh ouput into perl.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #&lt;br /&gt;
          $pid = open $readme, &amp;quot;ssh root\@hamlet df -lh|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
          while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
           print $_&lt;br /&gt;
          }&lt;br /&gt;
          close $readme&lt;br /&gt;
&lt;br /&gt;
      But note, you probably want to do something more complex. Below is a more robust&lt;br /&gt;
      example that bypassed all the fortune, heading junk that you may encounter when&lt;br /&gt;
      logging in.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #&lt;br /&gt;
          $pid = open $readme, &amp;quot;ssh root\@hamlet df -lh 2&amp;gt;/dev/null|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
          while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
           print $_&lt;br /&gt;
          }&lt;br /&gt;
          close $readme&lt;br /&gt;
&lt;br /&gt;
      NO! you CANNOT do bidirectional communication with the open statement. Note the &amp;quot;|&amp;quot; before&lt;br /&gt;
      and after below, which cannot be done.&lt;br /&gt;
&lt;br /&gt;
          # Cannot do this!&lt;br /&gt;
          $pid = open $readme, &amp;quot;|ssh root\@hamlet df -lh 2&amp;gt;/dev/null|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
      Below is a simple Perl example working with arrays:&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          @ArrayOfArray = (&lt;br /&gt;
                   [ &amp;quot;ant&amp;quot;, &amp;quot;bee&amp;quot; ],&lt;br /&gt;
                   [ &amp;quot;mouse&amp;quot;, &amp;quot;mole&amp;quot;, &amp;quot;rat&amp;quot; ],&lt;br /&gt;
                   [ &amp;quot;duck&amp;quot;, &amp;quot;goose&amp;quot;, &amp;quot;flamingo&amp;quot; ],&lt;br /&gt;
                   [  &amp;quot;rose&amp;quot;,&amp;quot;carnation&amp;quot;,&amp;quot;sunflower&amp;quot;],&lt;br /&gt;
                  );&lt;br /&gt;
&lt;br /&gt;
          for $i ( 0 .. $#ArrayOfArray ) {&lt;br /&gt;
              for $j ( 0 .. $#{$ArrayOfArray[$i]} ) {&lt;br /&gt;
                  print &amp;quot;Element $i $j is $ArrayOfArray[$i][$j]\n&amp;quot;;&lt;br /&gt;
              }&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          # Or this is another way to list elements&lt;br /&gt;
          foreach( @ArrayOfArray ) {&lt;br /&gt;
             foreach $i (0..$#$_) {&lt;br /&gt;
                print &amp;quot;$_-&amp;gt;[$i] &amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
             print &amp;quot;\n&amp;quot;;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Below is an example of working with Hash of Arrays:&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #  ./program &amp;lt; /etc/passwd&lt;br /&gt;
          while(&amp;lt;&amp;gt;){&lt;br /&gt;
              next unless s/^(.*?):\s*//;&lt;br /&gt;
              $HoA{$1} = [ split(/:/) ];&lt;br /&gt;
          }&lt;br /&gt;
          for $i (keys %HoA ) {&lt;br /&gt;
              print &amp;quot;$i: @{ $HoA{$i} } \n&amp;quot;;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
      Example of regular expression. This is my most used regular expression - I like&lt;br /&gt;
      this sample. See the &amp;quot;www.unix.org.ua&amp;quot; link at the end of this tip.&lt;br /&gt;
&lt;br /&gt;
          &amp;quot;hot cross buns&amp;quot; =~ /cross/;&lt;br /&gt;
          print &amp;quot;Matched: &amp;lt;$`&amp;gt; $&amp;amp; &amp;lt;$'&amp;gt;\n&amp;quot;;    # Matched: &amp;lt;hot &amp;gt; cross &amp;lt; buns&amp;gt;&lt;br /&gt;
          print &amp;quot;Left:    &amp;lt;$`&amp;gt;\n&amp;quot;;            # Left:    &amp;lt;hot &amp;gt;&lt;br /&gt;
          print &amp;quot;Match:   &amp;lt;$&amp;amp;&amp;gt;\n&amp;quot;;            # Match:   &amp;lt;cross&amp;gt;&lt;br /&gt;
          print &amp;quot;Right:   &amp;lt;$'&amp;gt;\n&amp;quot;;            # Right:   &amp;lt; buns&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      If you're looking for Perl information, type &amp;quot;man perl&amp;quot;, which will show you how&lt;br /&gt;
      to get even more information. Or better yet, take a look at the following&lt;br /&gt;
      link:&lt;br /&gt;
&lt;br /&gt;
          http://www.unix.org.ua/orelly/perl/prog3/ch09_01.htm&lt;br /&gt;
               also&lt;br /&gt;
          http://www.stonehenge.com/merlyn/UnixReview/&lt;br /&gt;
&lt;br /&gt;
      For a quick example on using Perl with SQLite, see the following links:&lt;br /&gt;
&lt;br /&gt;
          http://prdownloads.sourceforge.net/souptonuts/README_sqlite_tutorial.html?download&lt;br /&gt;
            or&lt;br /&gt;
          http://freshmeat.net/articles/view/1428/&lt;br /&gt;
            or&lt;br /&gt;
          http://www.perl.com/pub/a/1999/09/refererents.html&lt;br /&gt;
&lt;br /&gt;
      Standard input for files. This example will read from stdin, or open a file if given as&lt;br /&gt;
      an argument, and convert all &amp;quot;&amp;lt;&amp;quot; to &amp;quot;&amp;amp;lt;&amp;quot; and &amp;quot;&amp;gt;&amp;quot; to &amp;quot;&amp;amp;gt;&amp;quot;, which can be handy when&lt;br /&gt;
      converting text files to html files. Note the &amp;quot;while(&amp;lt;&amp;gt;)&amp;quot; will take multiple file names&lt;br /&gt;
      on the command line.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          while(&amp;lt;&amp;gt;) {&lt;br /&gt;
             s/&amp;amp;amp;/&amp;amp;amp;amp;/g;&lt;br /&gt;
             s/&amp;amp;lt;/&amp;amp;amp;lt;/g;&lt;br /&gt;
             s/&amp;amp;gt;/&amp;amp;amp;gt;/g;&lt;br /&gt;
             s/&amp;lt;/&amp;amp;lt;/g;&lt;br /&gt;
             s/&amp;gt;/&amp;amp;gt;/g;&lt;br /&gt;
             print;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
      Perl Debugger is very useful for testing commands and works like an interpreter, just&lt;br /&gt;
      like python. So to get into the Perl Debugger execute the command below, &amp;quot;q&amp;quot; to quit.&lt;br /&gt;
&lt;br /&gt;
          $ perl -de 0&lt;br /&gt;
&lt;br /&gt;
      Reference TIP 170&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 147:&lt;br /&gt;
&lt;br /&gt;
      Shutdown&lt;br /&gt;
&lt;br /&gt;
          # shutdown 8:00 -- Shutdown at 8:00&lt;br /&gt;
&lt;br /&gt;
          # shutdown +13  -- Shutdown after 13min&lt;br /&gt;
&lt;br /&gt;
          # shutdown -r now  -- Shutdown now and restart&lt;br /&gt;
&lt;br /&gt;
          # shutdown -k +2  -- &amp;quot;The system is going DOWN to maintenance mode in 2 minutes!&amp;quot;&lt;br /&gt;
                              The above is only a warning.&lt;br /&gt;
&lt;br /&gt;
          # shutdown -h now   -- Shutdown now and halt&lt;br /&gt;
&lt;br /&gt;
          # shutdown -c    -- Cancel shutdown&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 148:&lt;br /&gt;
&lt;br /&gt;
      ac -  print statistics about users connect time&lt;br /&gt;
&lt;br /&gt;
          $ ac -p    -- print hour usage by user (individual)&lt;br /&gt;
          $ ac -dy   -- print daily usage&lt;br /&gt;
&lt;br /&gt;
       Options can also be combined&lt;br /&gt;
&lt;br /&gt;
          $ ac -dyp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 149:&lt;br /&gt;
&lt;br /&gt;
      Smart Monitoring Tools:&lt;br /&gt;
      Disk failing? Or want to know the temperature of your hard-drive?&lt;br /&gt;
&lt;br /&gt;
         http://smartmontools.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
      For a good, quick tutorial, see the Linux Journal article&lt;br /&gt;
        http://www.linuxjournal.com/article/6983&lt;br /&gt;
&lt;br /&gt;
      Below are some common commands:&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -i /dev/hda&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -Hc /dev/hda&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -A /dev/hda&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 150:&lt;br /&gt;
&lt;br /&gt;
      Monitor dhcp trafic - dhcpdump and tcpdump.&lt;br /&gt;
&lt;br /&gt;
      Download dhcpdump&lt;br /&gt;
&lt;br /&gt;
         $ wget  http://voxel.dl.sourceforge.net/sourceforge/mavetju/dhcpdump-1.5.tar.gz&lt;br /&gt;
         $ ./configure&lt;br /&gt;
         $ make &amp;amp;&amp;amp; make install&lt;br /&gt;
&lt;br /&gt;
     Once it's installed, you can monitor all dhcp traffic as follows, if done with root.&lt;br /&gt;
&lt;br /&gt;
         $ tcpdump -lenx -i eth0 -s 1500 port bootps or port bootpc| dhcpdump&lt;br /&gt;
&lt;br /&gt;
     The above assumes you are using eth0 (ethernet port 0).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 151:&lt;br /&gt;
&lt;br /&gt;
      Breaking Firewalls with ssh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      A sample .ssh/config file (note this must have chmod 600 rights)&lt;br /&gt;
&lt;br /&gt;
           ## Server1 ##&lt;br /&gt;
           Host 130.21.19.227&lt;br /&gt;
               LocalForward 20000 192.168.0.66:80&lt;br /&gt;
               LocalForward 22000 192.168.0.66:22&lt;br /&gt;
&lt;br /&gt;
      With the above &amp;quot;~/.ssh/config&amp;quot; file, after sshing into 130.21.19.227 it&lt;br /&gt;
      is then possible to ssh into nearby computers directly.&lt;br /&gt;
&lt;br /&gt;
         $ ssh -l mchirico 130.21.19.227&lt;br /&gt;
         $ scp -P 22000 authorized_keys* mchirico@localhost:.&lt;br /&gt;
         $ ssh -l mchirico localhost -p 22000&lt;br /&gt;
&lt;br /&gt;
      For the complete article reference the following link:&lt;br /&gt;
        http://souptonuts.sourceforge.net/sshtips.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 152:&lt;br /&gt;
&lt;br /&gt;
      Renaming files - suppose you want to rename all the &amp;quot;.htm&amp;quot; files to &amp;quot;.html&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          $ rename .htm .html *.htm&lt;br /&gt;
&lt;br /&gt;
      Or, suppose you files file1, file2, file3 ...&lt;br /&gt;
&lt;br /&gt;
          $ touch file1 file2 file3 file4 file5 file6&lt;br /&gt;
          $ rename file file. file*&lt;br /&gt;
&lt;br /&gt;
      The above command will give you &amp;quot;file.1&amp;quot;, &amp;quot;file.2&amp;quot; ... &amp;quot;file.6&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 153:&lt;br /&gt;
&lt;br /&gt;
      Renaming files with Perl - this is taken from &amp;quot;Programming Perl 3rd Edition&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          # rename - change filenames&lt;br /&gt;
          $op = shift;&lt;br /&gt;
          for (@ARGV) {&lt;br /&gt;
              $was = $_;&lt;br /&gt;
              eval $op;&lt;br /&gt;
              die if $@;&lt;br /&gt;
              # next line calls built-in function, not the script&lt;br /&gt;
              rename($was,$_) unless $was eq $_;&lt;br /&gt;
           }&lt;br /&gt;
&lt;br /&gt;
      The above Perl program can be used as follows:&lt;br /&gt;
&lt;br /&gt;
           $ rename 's/\.orig$//'    *.orig&lt;br /&gt;
           $ rename 'y/A-Z/a-z/ unless /^Make/' *&lt;br /&gt;
&lt;br /&gt;
      Also reference:&lt;br /&gt;
           http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 154:&lt;br /&gt;
&lt;br /&gt;
      R project (http://www.r-project.org)&lt;br /&gt;
&lt;br /&gt;
      To start R, just type &amp;quot;R&amp;quot; at the command prompt and &amp;quot;q()&amp;quot; to quit. Below&lt;br /&gt;
      2 is raised to powers 0 through 6 and thrown into an array.&lt;br /&gt;
&lt;br /&gt;
           $ R&lt;br /&gt;
           &amp;gt; N &amp;lt;- 2^(0:6)&lt;br /&gt;
           &amp;gt; N&lt;br /&gt;
           [1]  1  2  4  8 16 32 64&lt;br /&gt;
           &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      There is a summary summary() command.&lt;br /&gt;
&lt;br /&gt;
           &amp;gt; summary(N)&lt;br /&gt;
           Min. 1st Qu.  Median    Mean 3rd Qu.    Max.&lt;br /&gt;
           1.00    3.00    8.00   18.14   24.00   64.00&lt;br /&gt;
&lt;br /&gt;
      Note that the array begins as 1 and not 0&lt;br /&gt;
&lt;br /&gt;
           &amp;gt; N[1:3]&lt;br /&gt;
           [1] 1 2 4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 155:&lt;br /&gt;
&lt;br /&gt;
      ls - listing files by size, with the biggest file listed last&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           $ ls --sort=size -lhr&lt;br /&gt;
&lt;br /&gt;
      The above command sorts files by size, listing the contents in&lt;br /&gt;
      &amp;quot;h&amp;quot; human readable format in reverse order.&lt;br /&gt;
&lt;br /&gt;
      Note the options:  --sort={none,time,size,extension}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 156:&lt;br /&gt;
&lt;br /&gt;
     Perl - program to clean up old versions of files&lt;br /&gt;
&lt;br /&gt;
       #!/usr/bin/perl&lt;br /&gt;
       #   Copyright (c) GPL 2005 Mike Chirico&lt;br /&gt;
       # This program deletes old files from several directories&lt;br /&gt;
       # and within each directory there must be x number of copies&lt;br /&gt;
       # each y number of bytes&lt;br /&gt;
       #&lt;br /&gt;
&lt;br /&gt;
       sub delete_old_ones {&lt;br /&gt;
           $directory_and_file=$_[0];&lt;br /&gt;
           $save_count=$_[1];&lt;br /&gt;
           $bytes_in_file=$_[2];&lt;br /&gt;
         # Don't change setting here of '-lt'&lt;br /&gt;
           $pid = open $readme, &amp;quot;ls -lt $directory_and_file|&amp;quot; or die &amp;quot;Could not execute\n&amp;quot;;&lt;br /&gt;
           while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
               my @fields = split;&lt;br /&gt;
              # Make sure we have $save_count good ones with data&lt;br /&gt;
               if ($fields[4] &amp;gt; $bytes_in_file &amp;amp;&amp;amp; $save_count &amp;gt; 0) {&lt;br /&gt;
                   $save_count--;&lt;br /&gt;
                   print &amp;quot;Kept files: $fields[4] $fields[8]\n&amp;quot;;&lt;br /&gt;
               }&lt;br /&gt;
              # delete the old ones&lt;br /&gt;
              if ($save_count &amp;lt;= 0 )&lt;br /&gt;
              {&lt;br /&gt;
                  print &amp;quot;Deleted files: $fields[4] $fields[8]\n&amp;quot;;&lt;br /&gt;
                  unlink $fields[8];&lt;br /&gt;
              }&lt;br /&gt;
           }&lt;br /&gt;
           close $readme;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       @AofA = (&lt;br /&gt;
          [ &amp;quot;/home/cvs/backups/*.gz&amp;quot;, &amp;quot;6&amp;quot;,196621 ],&lt;br /&gt;
          [ &amp;quot;/home/mail/backups/*.gz&amp;quot;,&amp;quot;5&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/snort/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/server1/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/actserver/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/server2/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
                );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       foreach( @AofA ) {&lt;br /&gt;
           &amp;amp;delete_old_ones($_-&amp;gt;[0],$_-&amp;gt;[1],$_-&amp;gt;[2]);&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
     Reference TIP 170 and the following link:&lt;br /&gt;
       http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 157:&lt;br /&gt;
&lt;br /&gt;
     Graphics and Visualization Software that runs on Linux&lt;br /&gt;
        http://www.tldp.org/HOWTO/Scientific-Computing-with-GNU-Linux/graphvis.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 158:&lt;br /&gt;
&lt;br /&gt;
     Keeping files in sync going both ways. Unlike rsync, this is not a one way mirror&lt;br /&gt;
     option.&lt;br /&gt;
&lt;br /&gt;
     You will need ocaml installed first.&lt;br /&gt;
&lt;br /&gt;
       $ wget http://caml.inria.fr/pub/distrib/ocaml-3.08/ocaml-3.08.3.tar.gz&lt;br /&gt;
       $ tar -xzf ocaml-3.08.3.tar.gz&lt;br /&gt;
       $ cd ocaml-3.08.3&lt;br /&gt;
&lt;br /&gt;
       $ ./configure&lt;br /&gt;
       $ make world&lt;br /&gt;
       $ make opt&lt;br /&gt;
       $ make install&lt;br /&gt;
&lt;br /&gt;
     Next, get unison and put it in a different directory.&lt;br /&gt;
     [http://www.cis.upenn.edu/~bcpierce/unison/]&lt;br /&gt;
&lt;br /&gt;
       $ wget http://www.cis.upenn.edu/~bcpierce/unison/download/stable/latest/unison-2.10.2.tar.gz&lt;br /&gt;
       $ tar -xzf unison-2.10.2.tar.gz&lt;br /&gt;
       $ cd unison-2.10.2&lt;br /&gt;
       $ make UISTYLE=text&lt;br /&gt;
       $ su&lt;br /&gt;
       # cp unison /usr/local/bin/.&lt;br /&gt;
&lt;br /&gt;
     Note, you have to copy the file manually.&lt;br /&gt;
&lt;br /&gt;
     See the following article [http://www.linuxjournal.com/article/7712]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 159:&lt;br /&gt;
&lt;br /&gt;
     Dump ext2/ext3 filesystem information with &amp;quot;dumpe2fs&amp;quot;. Perform the mount command&lt;br /&gt;
     and query away.&lt;br /&gt;
&lt;br /&gt;
       $ dumpe2fs /dev/sda1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 160:&lt;br /&gt;
&lt;br /&gt;
     sysreport - a script that generates an HTML report on the system configuration. It&lt;br /&gt;
     gathers information about the hardware and is somewhat redhat specific. The utility&lt;br /&gt;
     should be run as root.&lt;br /&gt;
&lt;br /&gt;
       $ /usr/sbin/sysreport&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 161:&lt;br /&gt;
&lt;br /&gt;
     Key Bindings Using bind.  You can bind, say, ctl-t to a command.&lt;br /&gt;
&lt;br /&gt;
     Add the following to you &amp;quot;~/.inputrc&amp;quot; file, just as it is typed below with quotes.&lt;br /&gt;
&lt;br /&gt;
           &amp;quot;\C-t&amp;quot;: ls -l&lt;br /&gt;
&lt;br /&gt;
     Next, run the command&lt;br /&gt;
&lt;br /&gt;
           $ bind -f .inputrc&lt;br /&gt;
&lt;br /&gt;
     Or, you can do everything on the command line; however, it won't be there the next time&lt;br /&gt;
     you log in. Below is the way to do everything on the command line.&lt;br /&gt;
&lt;br /&gt;
           $ bind -x '&amp;quot;\C-t&amp;quot;:ls -l'&lt;br /&gt;
&lt;br /&gt;
     To unbind use the &amp;quot;-r&amp;quot; option. Single quotes are not needed.&lt;br /&gt;
&lt;br /&gt;
           $ bind -r &amp;quot;\C-t&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Getting a list of all bindings can be done as follows, and not this can be redirected&lt;br /&gt;
     to the &amp;quot;.inputrc&amp;quot; file for further editing.&lt;br /&gt;
&lt;br /&gt;
           $ bind -p &amp;gt; .inputrc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 162:&lt;br /&gt;
&lt;br /&gt;
     awk - common awk commands.&lt;br /&gt;
&lt;br /&gt;
     Find device names &amp;quot;sd&amp;quot; or with major number 4 and device name &amp;quot;tty&amp;quot;. Print the&lt;br /&gt;
     record number NR, plus the major number and minor number.&lt;br /&gt;
&lt;br /&gt;
          $ awk '$2 == &amp;quot;sd&amp;quot;||$1 == 4 &amp;amp;&amp;amp; $2 == &amp;quot;tty&amp;quot; { print NR,$1,$2}' /proc/devices&lt;br /&gt;
&lt;br /&gt;
     Find device name equal to &amp;quot;sound&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ awk '/sound/{print NR,$1,$2}' /proc/devices&lt;br /&gt;
&lt;br /&gt;
     Print the 5th record, first field, in file test&lt;br /&gt;
&lt;br /&gt;
          $ awk 'NR==5{print $1}' test&lt;br /&gt;
&lt;br /&gt;
     Print a record, skip 4 records, print a record etc from file1&lt;br /&gt;
&lt;br /&gt;
          $ awk '(NR-1) % 4 == 0 {print $1}' file1&lt;br /&gt;
&lt;br /&gt;
     Print all records except the last one from file1&lt;br /&gt;
&lt;br /&gt;
          $ tac file1|awk 'NR &amp;gt; 1 {print $0}'|tac&lt;br /&gt;
&lt;br /&gt;
     Print A,B,C ..Z on each line, cycling back to A if greater than 26 lines&lt;br /&gt;
&lt;br /&gt;
          $ awk '{ print substr(&amp;quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&amp;quot;,(NR-1)%26+1,1),$0}' file1&lt;br /&gt;
&lt;br /&gt;
     Number of bytes in a directory.&lt;br /&gt;
&lt;br /&gt;
          $ ls -l|awk 'BEGIN{ c=0}{ c+=$5} END{ print c}'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 163:&lt;br /&gt;
&lt;br /&gt;
     Configuring Remote Logging.  If you have several servers on 192.168.1.0, you can setup remote logging&lt;br /&gt;
     as follows.&lt;br /&gt;
&lt;br /&gt;
     MAIN LOG SERVER (192.168.1.81):&lt;br /&gt;
&lt;br /&gt;
        Firewall - allow UDP port 514 on the main server that will receive the logs.&lt;br /&gt;
&lt;br /&gt;
          $ iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 514 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        Edit &amp;quot;/etc/sysconfig/syslog&amp;quot; and add the &amp;quot;-r&amp;quot; option to SYSLOGD_OPTIONS as shown below.&lt;br /&gt;
&lt;br /&gt;
          SYSLOGD_OPTIONS=&amp;quot;-r -m -0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Note, the &amp;quot;-r&amp;quot; is to allow remote logging and  &amp;quot;-m 0&amp;quot; specifies that that the syslog process should&lt;br /&gt;
        not write regular timestamps.  I prefer to only write timestamps for the clients.&lt;br /&gt;
&lt;br /&gt;
        Next, restart the logging process&lt;br /&gt;
&lt;br /&gt;
          $ service syslog restart&lt;br /&gt;
&lt;br /&gt;
     CLIENT LOG SERVER:&lt;br /&gt;
&lt;br /&gt;
        Edit &amp;quot;/etc/syslog.conf&amp;quot; and add the ip address of the log server, or put in the hostname.&lt;br /&gt;
&lt;br /&gt;
            *.* @192.168.1.81&lt;br /&gt;
&lt;br /&gt;
        Next, restart the logging process&lt;br /&gt;
&lt;br /&gt;
          $ service syslog restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 164:&lt;br /&gt;
&lt;br /&gt;
     kudzu - hardware on your system. To probe the hardware on your system without doing&lt;br /&gt;
             anything, issue the following command.&lt;br /&gt;
&lt;br /&gt;
          $ kudzu -p&lt;br /&gt;
&lt;br /&gt;
      But wait, a lot of this information is already recorded in the following file&lt;br /&gt;
&lt;br /&gt;
            /etc/sysconfig/hwconf&lt;br /&gt;
&lt;br /&gt;
      You can also use lspci to list all PCI devices.&lt;br /&gt;
&lt;br /&gt;
          $ lspci&lt;br /&gt;
&lt;br /&gt;
      Also, take a look at the script /etc/sbin/sysreport, since this script has a lot of&lt;br /&gt;
      info gathering commands. You can pick and choose what you want, or run the complete&lt;br /&gt;
      report.&lt;br /&gt;
&lt;br /&gt;
      If you just want information on the NIC&lt;br /&gt;
&lt;br /&gt;
          $ ip link show eth0&lt;br /&gt;
          2: eth0: &amp;lt;BROADCAST,MULTICAST,UP&amp;gt; mtu 1500 qdisc pfifo_fast qlen 1000&lt;br /&gt;
          link/ether 00:11:11:8a:be:3f brd ff:ff:ff:ff:ff:ff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 165:&lt;br /&gt;
&lt;br /&gt;
     cfengine - a very power agent for monitoring and administrating both a single computer&lt;br /&gt;
              and or multiple computers. [ http://www.cfengine.org/ ]&lt;br /&gt;
&lt;br /&gt;
     The following is a quick example on downloading and installing cfengine.&lt;br /&gt;
&lt;br /&gt;
          $ ncftpget ftp://ftp.iu.hio.no/pub/cfengine/cfengine-2.1.15.tar.gz&lt;br /&gt;
          $ md5sum cfengine-2.1.15.tar.gz&lt;br /&gt;
          f03de82709f84c3d6d916b6e557321f9  cfengine-2.1.15.tar.gz&lt;br /&gt;
&lt;br /&gt;
          $ tar -xzf cfengine-2.1.15.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You need to have a current version of BerkeleyDB (http://downloads.sleepycat.com/db-4.3.28.tar.gz).&lt;br /&gt;
     Note that BerkeleyDB has a funny install. You cd to the &amp;quot;build_unix&amp;quot; directory, then,&lt;br /&gt;
&lt;br /&gt;
          Installing BerkeleyDB if needed:&lt;br /&gt;
                 $ wget http://downloads.sleepycat.com/db-4.3.28.tar.gz&lt;br /&gt;
                 $ tar -xzf db-4.3.28.tar.gz&lt;br /&gt;
                 $ cd db-4.3.28/build_unix/&lt;br /&gt;
                 $ ../dist/configure&lt;br /&gt;
                 make&lt;br /&gt;
                 make install&lt;br /&gt;
&lt;br /&gt;
     You also need a current version of OpenSSL. For instructions on how to install OpenSSL see&lt;br /&gt;
     (http://souptonuts.sourceforge.net/postfix_tutorial.html).&lt;br /&gt;
&lt;br /&gt;
     See (TIP 49) on putting &amp;quot;/usr/local/BerkeleyDB.4.3/lib&amp;quot; in the &amp;quot;/etc/ld.so.conf&amp;quot; file. Or&lt;br /&gt;
     once BerkeleyDB is installed, you can put the location on the command line as follows:&lt;br /&gt;
&lt;br /&gt;
     Configuring cfengine with direct reference to BerkeleyDB.4.3.  First cd to the cfengine source.&lt;br /&gt;
&lt;br /&gt;
          $ ./configure --with-berkeleydb=/usr/local/BerkeleyDB.4.3/lib&lt;br /&gt;
          $ make&lt;br /&gt;
          $ make install&lt;br /&gt;
&lt;br /&gt;
     Next create the following directories:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /var/cfengine/bin&lt;br /&gt;
          $ mkdir -p /var/cfengine/inputs&lt;br /&gt;
&lt;br /&gt;
     Copy needed files (cfagent, cfdoc, cfenvd, cfenvgraph, cfexecd, cfkey, cfrun, cfservd, cfshow):&lt;br /&gt;
&lt;br /&gt;
          $ cp /usr/local/sbin/cf* /var/cfengine/bin&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You'll also need to generate keys. As root, execute the following:&lt;br /&gt;
&lt;br /&gt;
          $ cfkey&lt;br /&gt;
&lt;br /&gt;
     The command above will write the public and private keys in&lt;br /&gt;
     &amp;quot;/var/cfengine/ppkeys&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You probably want (cfexecd, cfservd, and cfenvd) running on all servers. If you&lt;br /&gt;
     add the following to &amp;quot;/etc/rc.local&amp;quot; these daemons will start on reboot.&lt;br /&gt;
&lt;br /&gt;
           # Lines in /etc/rc.local&lt;br /&gt;
           /usr/local/sbin/cfexecd&lt;br /&gt;
           /usr/local/sbin/cfservd&lt;br /&gt;
           /usr/local/sbin/cfenvd&lt;br /&gt;
&lt;br /&gt;
     Also, make sure you run each command now as follows:&lt;br /&gt;
&lt;br /&gt;
          $ /usr/local/sbin/cfexecd&lt;br /&gt;
          $ /usr/local/sbin/cfservd&lt;br /&gt;
          $ /usr/local/sbin/cfenvd&lt;br /&gt;
&lt;br /&gt;
     Firewall settings must be adjusted to allows 5308 for tcp/udp. My local network&lt;br /&gt;
     is 192.168.1.0, so I'm opening it up for all my computers.&lt;br /&gt;
&lt;br /&gt;
          $ iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 5308 -j ACCEPT&lt;br /&gt;
          $ iptables -A INPUT -p tcp -s 192.168.1.0/24  --dport 5308 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
     A set of keys needs to be on the server and hosts. For example, my key on &amp;quot;tape.squeezel.com&amp;quot;&lt;br /&gt;
     should be copied over to the server &amp;quot;squeezel.squeezel.com&amp;quot; as follows:&lt;br /&gt;
&lt;br /&gt;
     This is done from tape.squeezel.com&lt;br /&gt;
&lt;br /&gt;
          $ scp /var/cfengine/ppkeys/localhost.pub  root@squeezel.squeezel.com:/var/cfengine/ppkeys/root-tape.squeezel.com.pub&lt;br /&gt;
          $ scp root@squeezel.squeezel.com:/var/cfengine/ppkeys/localhost.pub /var/cfengine/ppkeys/root-squeezel.squeezel.com.pub&lt;br /&gt;
&lt;br /&gt;
     Also, &amp;quot;/var/cfengine/inputs/cfrun.hosts&amp;quot; on the server &amp;quot;squeezel.squeezel.com&amp;quot; must contain&lt;br /&gt;
     all the computers that will get updated. This is &amp;quot;cfrun.hosts&amp;quot; on &amp;quot;squeezel.squeezel.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          closet.squeezel.com&lt;br /&gt;
          tape.squeezel.com&lt;br /&gt;
&lt;br /&gt;
     Once I'm done, from &amp;quot;tape.squeezel.com&amp;quot; I can run the following test:&lt;br /&gt;
&lt;br /&gt;
          $ cfrun squeezel.squeezel.com -v&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 166:&lt;br /&gt;
&lt;br /&gt;
     cfengine - a quick example. This example will be run as root. You create the file &amp;quot;cfagent.conf&amp;quot; in&lt;br /&gt;
     &amp;quot;/var/cfengine/inputs/&amp;quot;. The example below will checksum all the files in /home/chirico/deleteme/tripwire,&lt;br /&gt;
     it will also comment out the line &amp;quot;finger&amp;quot; in any file located in /tmp/testdir/stuff, also appending&lt;br /&gt;
     the command in this file &amp;quot; Edit change with cfengine&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          # /var/cfengine/inputs/cfagent.conf&lt;br /&gt;
          #&lt;br /&gt;
          # You run this with the following:&lt;br /&gt;
          #   cfagent -vK&lt;br /&gt;
        &lt;br /&gt;
          control:&lt;br /&gt;
                 actionsequence = ( files tidy editfiles )&lt;br /&gt;
                 ChecksumDatabase = ( /var/cfengine/cache.db )&lt;br /&gt;
                 # Below, true to update md5&lt;br /&gt;
                 ChecksumUpdates = ( true )&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
          files:&lt;br /&gt;
                 /home/chirico/deleteme/tripwire checksum=md5 recurse=inf&lt;br /&gt;
                 /home/chirico/deleteme/tripwire/moredata checksum=md5 recurse=inf&lt;br /&gt;
                 #/home/chirico/deleteme/tripwire/compress  recurse=inf include=*.txt acti on=compress&lt;br /&gt;
                   # If the database isn't secure, nothing is secure...&lt;br /&gt;
                 /var/cfengine/cache.db  mode=600 owner=root action=fixall&lt;br /&gt;
        &lt;br /&gt;
          tidy:&lt;br /&gt;
                 /home/chirico/deleteme/tripwire pattern=*~ recurse=inf age=0&lt;br /&gt;
                 # You must put an age. 0 runs now.&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
          editfiles:&lt;br /&gt;
        &lt;br /&gt;
                {  /tmp/testdir/stuff&lt;br /&gt;
&lt;br /&gt;
                   HashCommentLinesContaining &amp;quot;finger&amp;quot;&lt;br /&gt;
                   AppendIfNoSuchLine &amp;quot;# Edit Change with cfengine &amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     A few further notes on the above. The command &amp;quot;actionsequence = ( files tidy editfiles) tells the order&lt;br /&gt;
     of what to execute. The heading &amp;quot;tidy:&amp;quot; deletes files, and of course, &amp;quot;editfiles&amp;quot; does the editing of files.&lt;br /&gt;
&lt;br /&gt;
     To run the example, execute the following command. The  &amp;quot;-K&amp;quot; causes the lock file to be ignored.&lt;br /&gt;
&lt;br /&gt;
            $ cfagent -vK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 167:&lt;br /&gt;
&lt;br /&gt;
     Implementing Disk Quotas - a quick example that can easily be done on a live system for testing. There&lt;br /&gt;
     is no need to reboot, since you'll be creating a virtual filesystem.&lt;br /&gt;
&lt;br /&gt;
     Do the following as root. First create a mount point.&lt;br /&gt;
&lt;br /&gt;
            # mkdir -p /quota&lt;br /&gt;
&lt;br /&gt;
     Next, create 20M file. Since I have many of these files, I created a special directory &amp;quot;/usr/disk-img&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            # mkdir -p /usr/disk-img&lt;br /&gt;
            # dd if=/dev/zero of=/usr/disk-img/disk-quota.ext3 count=40960&lt;br /&gt;
&lt;br /&gt;
     The dd command above create a 20 MB file because, by default, dd uses a block size of 512 bytes. That makes&lt;br /&gt;
     the size: 40960*512=20971520.&lt;br /&gt;
&lt;br /&gt;
     Next, format this as an ext3 filesystem&lt;br /&gt;
&lt;br /&gt;
            # /sbin/mkfs -t ext3 -q /usr/disk-img/disk-quota.ext3 -F&lt;br /&gt;
&lt;br /&gt;
     Add the following line to &amp;quot;/etc/fstab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            /usr/disk-img/disk-quota.ext3    /quota ext3    rw,loop,usrquota,grpquota  0 0&lt;br /&gt;
&lt;br /&gt;
     Now, mount this filesystem&lt;br /&gt;
&lt;br /&gt;
            # mount /quota&lt;br /&gt;
&lt;br /&gt;
     Take a look at it:&lt;br /&gt;
&lt;br /&gt;
            # ls -l /quota&lt;br /&gt;
            lost+found&lt;br /&gt;
&lt;br /&gt;
     Now, run &amp;quot;quotacheck&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            # quotacheck -vug /quota&lt;br /&gt;
&lt;br /&gt;
     You'll get errors the first time this is run, because you have no quota files.&lt;br /&gt;
     But, run it a second time and you'll see something similiar to the following:&lt;br /&gt;
&lt;br /&gt;
            # quotacheck -vug /quota&lt;br /&gt;
            quotacheck: Scanning /dev/loop2 [/quota] done&lt;br /&gt;
            quotacheck: Checked 3 directories and 4 files&lt;br /&gt;
&lt;br /&gt;
     Now take a look at the files:&lt;br /&gt;
&lt;br /&gt;
            # ls -l /quota&lt;br /&gt;
            total 26&lt;br /&gt;
            -rw-------  1 root root  6144 Jun 14 12:23 aquota.group&lt;br /&gt;
            -rw-------  1 root root  6144 Jun 14 12:23 aquota.user&lt;br /&gt;
            drwx------  2 root root 12288 Jun 14 12:18 lost+found&lt;br /&gt;
&lt;br /&gt;
     Next use &amp;quot;edquota&amp;quot; to grant the user &amp;quot;chirico&amp;quot; a certain quota&lt;br /&gt;
&lt;br /&gt;
            # edquota -f /quota chirico&lt;br /&gt;
&lt;br /&gt;
     This will bring up a menu, and here I have edited so that user &amp;quot;chirico&amp;quot;&lt;br /&gt;
     has a soft limit of 120*512=61K, and a soft limit of 2 inodes and a hard limit of 5.&lt;br /&gt;
&lt;br /&gt;
             Disk quotas for user chirico (uid 500):&lt;br /&gt;
             Filesystem                   blocks       soft       hard     inodes     soft     hard&lt;br /&gt;
             /dev/loop2                        2        120        150         1        2         3&lt;br /&gt;
&lt;br /&gt;
     Next, turn quotas on with the following command:&lt;br /&gt;
&lt;br /&gt;
             $ quotaon /quota&lt;br /&gt;
&lt;br /&gt;
     If you need to turn off quotas, the command is &amp;quot;quotaoff -a&amp;quot; for all filesystems. You'll run into&lt;br /&gt;
     errors if you try to run quotacheck, say &amp;quot;quotacheck -avug&amp;quot; because this tries to unmount and mount&lt;br /&gt;
     the filesystem. You need to turn off quotas first &amp;quot;quotaoff /quota&amp;quot;. Note you only need to run&lt;br /&gt;
     quotacheck once, or when doing maintenance after a system crash.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      To get a report on the quote, runn &amp;quot;repquota&amp;quot; as follows:&lt;br /&gt;
&lt;br /&gt;
           $ repquota /quota&lt;br /&gt;
            *** Report for user quotas on device /dev/loop0&lt;br /&gt;
            Block grace time: 7days; Inode grace time: 7days&lt;br /&gt;
                                    Block limits                File limits&lt;br /&gt;
            User            used    soft    hard  grace    used  soft  hard  grace&lt;br /&gt;
            ----------------------------------------------------------------------&lt;br /&gt;
            root      --    1189       0       0              2     0     0&lt;br /&gt;
            chirico   -+      93       0       0              4     2     5  6days&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Note above that user &amp;quot;chirico&amp;quot; has used 4 on the file limits. This user has a hard&lt;br /&gt;
      limit of 5. So when this user tries to create 2 more files (bring this over the limit of 5)&lt;br /&gt;
      then he will get the following error as demonstrated below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           [chirico@squeezel chirico]$ touch one&lt;br /&gt;
           [chirico@squeezel chirico]$ touch two&lt;br /&gt;
           loop0: write failed, user file limit reached.&lt;br /&gt;
           touch: cannot touch `two': Disk quota exceeded&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Now, if repquota (run by root) is executed it shows the following:&lt;br /&gt;
&lt;br /&gt;
           $ repquota /quota&lt;br /&gt;
           *** Report for user quotas on device /dev/loop0&lt;br /&gt;
           Block grace time: 7days; Inode grace time: 7days&lt;br /&gt;
                                   Block limits                File limits&lt;br /&gt;
           User            used    soft    hard  grace    used  soft  hard  grace&lt;br /&gt;
           ----------------------------------------------------------------------&lt;br /&gt;
           root      --    1189       0       0              2     0     0&lt;br /&gt;
           chirico   -+      94       0       0              5     2     5  6days&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Note the &amp;quot;+&amp;quot; sign above. User &amp;quot;chirico&amp;quot; is above the File soft limits, and in this case&lt;br /&gt;
      above the hard limits.&lt;br /&gt;
&lt;br /&gt;
      To warn user by sending email to them, run &amp;quot;warnquota&amp;quot;, but you need check that&lt;br /&gt;
      &amp;quot;/etc/warnquota.conf&amp;quot; is setup correctly. For the example above, this file should&lt;br /&gt;
      look as follows:&lt;br /&gt;
&lt;br /&gt;
            $ cat /etc/quotatab&lt;br /&gt;
            #&lt;br /&gt;
            #  This is sample quotatab (/etc/quotatab)&lt;br /&gt;
            #  Here you can specify description of each device for user&lt;br /&gt;
            #&lt;br /&gt;
            #  Comments begin with hash in the beginning of the line&lt;br /&gt;
&lt;br /&gt;
            # Example of description&lt;br /&gt;
            /dev/loop0: This is loopback device&lt;br /&gt;
&lt;br /&gt;
      Just run the following as root:&lt;br /&gt;
&lt;br /&gt;
            $ warnquota&lt;br /&gt;
&lt;br /&gt;
      By the way, if you want to change the grace period, it can only be done on a filesystem&lt;br /&gt;
      basis. Not per user.&lt;br /&gt;
&lt;br /&gt;
            $  edquota -t&lt;br /&gt;
&lt;br /&gt;
      Users can run &amp;quot;quota&amp;quot; to see their usage as follows:&lt;br /&gt;
&lt;br /&gt;
            [chirico@squeezel ~]$ quota&lt;br /&gt;
            Disk quotas for user chirico (uid 500):&lt;br /&gt;
                 Filesystem  blocks   quota   limit   grace   files   quota   limit   grace&lt;br /&gt;
                 /dev/loop0      94       0       0               5      10      50&lt;br /&gt;
&lt;br /&gt;
      As you can see from above, I changed my inode limit to 50.&lt;br /&gt;
&lt;br /&gt;
      What about running this on the whole filesystem? Yes, below is an example where I'm running&lt;br /&gt;
      this on FC3, on the root of the filesystem &amp;quot;/&amp;quot;. This assumes that you have installed the&lt;br /&gt;
      quota package. Try doing &amp;quot;rpm -q quota&amp;quot; to see if this package is installed.&lt;br /&gt;
&lt;br /&gt;
        Step 1:&lt;br /&gt;
&lt;br /&gt;
           Check to make sure the quota software is installed. You can either do a &amp;quot;whereis quota&amp;quot;,&lt;br /&gt;
           or check for the rpm package.&lt;br /&gt;
&lt;br /&gt;
             $ whereis quota&lt;br /&gt;
             whereis quota&lt;br /&gt;
             quota: /usr/bin/quota /usr/share/man/man1/quota.1.gz&lt;br /&gt;
&lt;br /&gt;
           Checking for the rpm package.&lt;br /&gt;
&lt;br /&gt;
            $ rpm -q quota&lt;br /&gt;
            quota-3.12-5&lt;br /&gt;
&lt;br /&gt;
        Step 2:&lt;br /&gt;
&lt;br /&gt;
           Edit /etc/fstab and add usrquota and grpquota options for &amp;quot;/dev/VolGroup00/LogVol00&amp;quot;,&lt;br /&gt;
           which is shown on the first line below:&lt;br /&gt;
&lt;br /&gt;
             /dev/VolGroup00/LogVol00 /                      ext3    defaults,usrquota,grpquota        1 1&lt;br /&gt;
             LABEL=/boot             /boot                   ext3    defaults        1 2&lt;br /&gt;
             none                    /dev/pts                devpts  gid=5,mode=620  0 0&lt;br /&gt;
             none                    /dev/shm                tmpfs   defaults        0 0&lt;br /&gt;
             none                    /proc                   proc    defaults        0 0&lt;br /&gt;
             none                    /sys                    sysfs   defaults        0 0&lt;br /&gt;
             /dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0&lt;br /&gt;
&lt;br /&gt;
        Step 3:&lt;br /&gt;
&lt;br /&gt;
           Remount the filesystem as follows:&lt;br /&gt;
&lt;br /&gt;
             $ mount -o remount /&lt;br /&gt;
&lt;br /&gt;
        Step 4:&lt;br /&gt;
&lt;br /&gt;
           Run quotacheck with the &amp;quot;-m&amp;quot; option. Like the above statement, this will have to be run with&lt;br /&gt;
           root priviliges. This creates the quota database files, and it can take a long time if it is&lt;br /&gt;
           a large full filesystem.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             $ quotacheck -cugm /&lt;br /&gt;
&lt;br /&gt;
        Step 5:&lt;br /&gt;
&lt;br /&gt;
           This step is optional, but it's good to know if you need to recalculate quotas because of a&lt;br /&gt;
           system crash. It's demonstrated here, because at this point quota's have not been turned on.&lt;br /&gt;
           Again, note the &amp;quot;m&amp;quot; option below.&lt;br /&gt;
&lt;br /&gt;
             $ quotacheck -avumg&lt;br /&gt;
&lt;br /&gt;
        Step 6:&lt;br /&gt;
&lt;br /&gt;
           Set limits for specific users or groups using the &amp;quot;edquota&amp;quot; command. Shown below is the command&lt;br /&gt;
           to setup quotas for user &amp;quot;chirico&amp;quot;. Shown below this user has used 161560 blocks, he has a soft&lt;br /&gt;
           limit of 1161560 and a hard limit of 900000. He has used 3085 inodes and has a soft limit of 10000&lt;br /&gt;
           and a hard limit of 12000.&lt;br /&gt;
&lt;br /&gt;
             $ edquota -f / chirico&lt;br /&gt;
&lt;br /&gt;
             Disk quotas for user chirico (uid 500):&lt;br /&gt;
               Filesystem                   blocks       soft       hard     inodes     soft     hard&lt;br /&gt;
               /dev/mapper/VolGroup00-LogVol00     161560    1161560     900000       3085    10000    12000&lt;br /&gt;
&lt;br /&gt;
           You can put quotas on groups as well. The following is done as root. See (TIP 186 and TIP 6) for creating&lt;br /&gt;
           groups and adding users to groups.&lt;br /&gt;
&lt;br /&gt;
             $ edquota -g share&lt;br /&gt;
&lt;br /&gt;
           If you create a sharable directory for anyone in the group &amp;quot;share&amp;quot; (TIP 6), quota restrictions against&lt;br /&gt;
           group &amp;quot;share&amp;quot; will only apply to files added in the &amp;quot;/home/share&amp;quot; directory. When user &amp;quot;chirico&amp;quot; creates&lt;br /&gt;
           files in &amp;quot;/home/share&amp;quot; they also go against this user quota as well. However, when files are created in&lt;br /&gt;
           his home directory they do not go against the &amp;quot;share&amp;quot; group.&lt;br /&gt;
&lt;br /&gt;
           Note - if you get errors when trying to run &amp;quot;edquota -g share&amp;quot;, turn quotas off &amp;quot;quotaoff /&amp;quot; and&lt;br /&gt;
                  run &amp;quot;quotacheck -avugm&amp;quot;. Then, turn the quotas back on &amp;quot;quotaon /&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           You can see the status of the group quota with the following command:&lt;br /&gt;
&lt;br /&gt;
             $ quota -g share&lt;br /&gt;
&lt;br /&gt;
        Step 7:&lt;br /&gt;
&lt;br /&gt;
           Turn on quotas with the &amp;quot;qutoaon&amp;quot; command. This command needs to be done with root privileges.&lt;br /&gt;
&lt;br /&gt;
             $ quotaon /&lt;br /&gt;
&lt;br /&gt;
        Step 8:&lt;br /&gt;
&lt;br /&gt;
           Check &amp;quot;/etc/quotatab&amp;quot; file for the correct entries. Note that when you do the &amp;quot;mount&amp;quot; command&lt;br /&gt;
           the filesystem returned needs to match what is in the &amp;quot;quotatab&amp;quot; file. I have noticed that this&lt;br /&gt;
           is not the case by default.&lt;br /&gt;
&lt;br /&gt;
             $ mount&lt;br /&gt;
             /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw,usrquota,grpquota)&lt;br /&gt;
&lt;br /&gt;
           So the &amp;quot;/etc/quotatab&amp;quot; must contain the following line.&lt;br /&gt;
&lt;br /&gt;
             /dev/mapper/VolGroup00-LogVol00: This is the Volume group&lt;br /&gt;
&lt;br /&gt;
        Step 9:&lt;br /&gt;
&lt;br /&gt;
           Run &amp;quot;warnquota&amp;quot; as a check that the &amp;quot;/etc/quotatab&amp;quot; files is setup correctly.&lt;br /&gt;
&lt;br /&gt;
              $ warnquota&lt;br /&gt;
&lt;br /&gt;
        Step 10:&lt;br /&gt;
&lt;br /&gt;
           Setup a daily cron job for running &amp;quot;warnquota&amp;quot;. The following should be placed&lt;br /&gt;
           in &amp;quot;/etc/cron.daily&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              #!/bin/sh&lt;br /&gt;
              # Place this file in /etc/cron.daily&lt;br /&gt;
              # with rights 0755&lt;br /&gt;
              /usr/sbin/warnquota&lt;br /&gt;
              EXITVALUE=$?&lt;br /&gt;
              if [ $EXITVALUE != 0 ]; then&lt;br /&gt;
                 /usr/bin/logger -t warnquota &amp;quot;ALERT exited abnormally with [$EXITVALUE]&amp;quot;&lt;br /&gt;
              fi&lt;br /&gt;
              exit 0&lt;br /&gt;
&lt;br /&gt;
      References:&lt;br /&gt;
        http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/sysadmin-guide/ch-disk-quotas.html&lt;br /&gt;
        (TIP 6, TIP 186, and TIP 205)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 168:&lt;br /&gt;
&lt;br /&gt;
     rdist - remote file distribution client program. You can use this program in combination with&lt;br /&gt;
     ssh. This program does more than just copy files. Once a file has been copied, you can dictate&lt;br /&gt;
     other actions to be performed. Or you can hold off copying all together if the destination is&lt;br /&gt;
     running low on inodes, or disk space.&lt;br /&gt;
&lt;br /&gt;
     For the purpose of this example, all commands will been run on &amp;quot;squeezel.squeezel.com&amp;quot;, and the&lt;br /&gt;
     computers that will be updated are &amp;quot;tape.squeezel.com&amp;quot; and &amp;quot;closet.squeezel.com&amp;quot;. Obviously, you&lt;br /&gt;
     would substitute your computer names.&lt;br /&gt;
&lt;br /&gt;
     It helps to setup ssh keys on each computer first. Reference [http://souptonuts.sourceforge.net/sshtips.htm]&lt;br /&gt;
     and (TIP 12).&lt;br /&gt;
&lt;br /&gt;
     Step 1: Create the Configuration file myDistfile&lt;br /&gt;
&lt;br /&gt;
       Below is my sample &amp;quot;myDistfile&amp;quot;. This file will access hosts &amp;quot;tape.squeezel.com&amp;quot; using username chirico&lt;br /&gt;
       and &amp;quot;closet.squeezel.com&amp;quot; with the username running this command, and copy the&lt;br /&gt;
       files &amp;quot;/home/chirico/file1&amp;quot; and &amp;quot;/home/chirico/file2&amp;quot; to the these two servers creating the&lt;br /&gt;
       directory ~/tmpdir if it doesn't exist. Once these files are updated, a mail check (&amp;quot;sendmail -bv&amp;quot;)&lt;br /&gt;
       will be performed, and mail will be sent to &amp;quot;chirico@squeezel&amp;quot;. This happens twice, once for each file.&lt;br /&gt;
&lt;br /&gt;
       Note, the line &amp;quot;/home/chirico/file2 -&amp;gt; tape.squeezel.com&amp;quot; which moves the file &amp;quot;file2&amp;quot; to&lt;br /&gt;
       tape.squeezel.com renaming the file to &amp;quot;tapedest&amp;quot; in the directory &amp;quot;/home/chirico&amp;quot;. Once this file&lt;br /&gt;
       is copied, the rights are modified to &amp;quot;chmod +r&amp;quot;.  Likewise, &amp;quot;/home/chirico/file2 -&amp;gt; closet.squeezel.com&amp;quot;&lt;br /&gt;
       copies the file file2, which is renamed as closetdest.&lt;br /&gt;
&lt;br /&gt;
                 # Contents of myDistfile&lt;br /&gt;
                 HOSTS = ( chirico@tape.squeezel.com closet.squeezel.com )&lt;br /&gt;
&lt;br /&gt;
                 FILES = ( /home/chirico/file1 /home/chirico/file2 )&lt;br /&gt;
&lt;br /&gt;
                 ${FILES} -&amp;gt; ${HOSTS}&lt;br /&gt;
                    # Directory tmpdir will be created if it doesn't exist&lt;br /&gt;
                    install tmpdir ;&lt;br /&gt;
                    special /home/chirico/file1  &amp;quot;/usr/sbin/sendmail -bv mchirico@gmail.com&amp;quot;;&lt;br /&gt;
                    notify chirico@squeezel;&lt;br /&gt;
&lt;br /&gt;
                 /home/chirico/file2 -&amp;gt; tape.squeezel.com&lt;br /&gt;
                    install  /home/chirico/tapedest;&lt;br /&gt;
                    special  /home/chirico/tapedest &amp;quot;chmod +r /home/chirico/tapedest&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
                 /home/chirico/file2 -&amp;gt; closet.squeezel.com&lt;br /&gt;
                    install /home/chirico/closetdest;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 2: Command from squeezel.squeezel.com to run myDistfile above&lt;br /&gt;
&lt;br /&gt;
       Below is the command that will execute the contents in &amp;quot;myDistfile&amp;quot;. This command is run from the&lt;br /&gt;
       computer &amp;quot;squeezel.squeezel.com&amp;quot;. All output will go in the file &amp;quot;cmd1rdist.log&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ rdist -P /usr/local/bin/ssh -f ./myDistfile -l file=./cmd1rdist.log=all&lt;br /&gt;
&lt;br /&gt;
       Obviously you want a secure copy (using scp), so the -P option uses ssh as your secure&lt;br /&gt;
       transport mechanism.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 169:&lt;br /&gt;
&lt;br /&gt;
     Restricting root logins (/etc/securetty). ctl-alt-F4 will give you a prompt for tty3. Note&lt;br /&gt;
     that it is one number less. Take a look at the contents of &amp;quot;/etc/securetty&amp;quot;. To prevent&lt;br /&gt;
     root from logging in on this device, take out tty3 from this listing. Note, you can always&lt;br /&gt;
     login as another user, then, su to root.  Below is an example of the default&lt;br /&gt;
     &amp;quot;/etc/securetty&amp;quot; that allows root to login to everything.&lt;br /&gt;
&lt;br /&gt;
         [root@squeezel ~]# cat /etc/securetty&lt;br /&gt;
         console&lt;br /&gt;
         vc/1&lt;br /&gt;
         vc/2&lt;br /&gt;
         vc/3&lt;br /&gt;
         vc/4&lt;br /&gt;
         vc/5&lt;br /&gt;
         vc/6&lt;br /&gt;
         vc/7&lt;br /&gt;
         vc/8&lt;br /&gt;
         vc/9&lt;br /&gt;
         vc/10&lt;br /&gt;
         vc/11&lt;br /&gt;
         tty1&lt;br /&gt;
         tty2&lt;br /&gt;
         tty3&lt;br /&gt;
         tty4&lt;br /&gt;
         tty5&lt;br /&gt;
         tty6&lt;br /&gt;
         tty7&lt;br /&gt;
         tty8&lt;br /&gt;
         tty9&lt;br /&gt;
         tty10&lt;br /&gt;
         tty11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 170:&lt;br /&gt;
&lt;br /&gt;
     Perl map function. Try the following to get a quick take on this function,&lt;br /&gt;
     which increments each value in the array a;&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map {$_++} @a;&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot; } @a;&lt;br /&gt;
&lt;br /&gt;
     or&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     And you can easily make modifications, like reversing the order&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     Plus there is a grep() function that works on each element as well&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse grep{ $_ &amp;gt; 3} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     To get only odd numbers in reverse order:&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse grep{ !($_ % 2)} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference: http://www-128.ibm.com/developerworks/linux/library/l-road4.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 171:&lt;br /&gt;
&lt;br /&gt;
     Perl - subroutine call and shifting through variables. A simple and useful&lt;br /&gt;
     technique.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          sub test {&lt;br /&gt;
            local $mval;&lt;br /&gt;
            while( $mval = shift ) {&lt;br /&gt;
              print &amp;quot; $mval\n&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          test(&amp;quot;one&amp;quot;,&amp;quot;two&amp;quot;,&amp;quot;three&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 172:&lt;br /&gt;
&lt;br /&gt;
     Tcp wrappers - First &amp;quot;/etc/hosts.allow&amp;quot; is check, and if there is an entry in this file, no more&lt;br /&gt;
     checking it done.  If are no matches in &amp;quot;/etc/hosts.allow&amp;quot;, the &amp;quot;/etc/hosts.deny&amp;quot; file is checked&lt;br /&gt;
     and if a match is found, that service is blocked for that host.&lt;br /&gt;
&lt;br /&gt;
     Example &amp;quot;/etc/hosts.deny&amp;quot; file:&lt;br /&gt;
&lt;br /&gt;
         sshd: 192.168.1.171&lt;br /&gt;
&lt;br /&gt;
     The above file blocks access to computer 192.168.1.171. It's also possible to run commands when&lt;br /&gt;
     someone from this computer tries to ssh in. This example sends mail.&lt;br /&gt;
&lt;br /&gt;
         sshd: 192.168.1.171: spawn (echo -e &amp;quot;%d %h %H %u&amp;quot;| /bin/mail -s 'hosts.deny entry' root)&lt;br /&gt;
&lt;br /&gt;
     Of course, you can also run commands in the &amp;quot;/etc/hosts.allow&amp;quot; if you wanted mail sent for a successful&lt;br /&gt;
     login.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 173:&lt;br /&gt;
&lt;br /&gt;
     pgrep, pkill - look up or signal process based on name and other attributes.&lt;br /&gt;
&lt;br /&gt;
     To quick find all instances of ssh running, for user root, execute the following&lt;br /&gt;
     command:&lt;br /&gt;
&lt;br /&gt;
           $ pgrep -u root -l ssh&lt;br /&gt;
&lt;br /&gt;
     To kill a process, or send a signal use the &amp;quot;pkill&amp;quot; option. For example, to&lt;br /&gt;
     make syslog reread its configuration file:&lt;br /&gt;
&lt;br /&gt;
           $ pkill -HUP syslogd&lt;br /&gt;
&lt;br /&gt;
     Another command command is &amp;quot;pidof&amp;quot; that can tell you how many processes are running.&lt;br /&gt;
     This can be useful for detecting DOS attacks.&lt;br /&gt;
&lt;br /&gt;
           $ pidof sshd&lt;br /&gt;
           4783 4781 30008 30006 29888 29886 2246&lt;br /&gt;
&lt;br /&gt;
     Above there are 7 sshd's running. Reference &amp;quot;Tcpdump, Raw Socket and Libpap Tutorial&amp;quot;&lt;br /&gt;
     at [http://souptonuts.sourceforge.net/tcpdump_tutorial.html].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 174:&lt;br /&gt;
&lt;br /&gt;
     Password Cracking - tools to check your users passwords:&lt;br /&gt;
&lt;br /&gt;
      John The Ripper&lt;br /&gt;
        http://www.openwall.com/john/&lt;br /&gt;
&lt;br /&gt;
      Crack&lt;br /&gt;
        http://www.crypticide.com/users/alecm/&lt;br /&gt;
&lt;br /&gt;
      Slurpie&lt;br /&gt;
        http://www.ussrback.com/distributed.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 175:&lt;br /&gt;
&lt;br /&gt;
     Password Aging - setting the number of days a password is valid.&lt;br /&gt;
&lt;br /&gt;
         $ chage -M 90 &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 176:&lt;br /&gt;
&lt;br /&gt;
     Kernel Performance Tuning - /Documentation/sysctl/vm.txt documents kernel settings to&lt;br /&gt;
     improve performance. Below are some examples.&lt;br /&gt;
&lt;br /&gt;
       overcommit_memory:  0 -- default estimates the amount of memory for malloc&lt;br /&gt;
                           1 -- kernel pretends there is always enough memory until it runs out&lt;br /&gt;
                           3 -- never overcommit&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/overcommit_memory&lt;br /&gt;
          0&lt;br /&gt;
&lt;br /&gt;
       page-cluster:&lt;br /&gt;
            The Linux VM subsystem avoids excessive disk seeks by reading&lt;br /&gt;
            multiple pages on a page fault. The number of pages it reads&lt;br /&gt;
            is dependent on the amount of memory in your machine.&lt;br /&gt;
        &lt;br /&gt;
            The number of pages the kernel reads in at once is equal to&lt;br /&gt;
            2 ^ page-cluster. Values above 2 ^ 5 don't make much sense&lt;br /&gt;
            for swap because we only cluster swap data in 32-page groups.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/page-cluster&lt;br /&gt;
          3&lt;br /&gt;
&lt;br /&gt;
       min_free_kbytes:&lt;br /&gt;
            This is used to force the Linux VM to keep a minimum number&lt;br /&gt;
            of kilobytes free.  The VM uses this number to compute a pages_min&lt;br /&gt;
            value for each lowmem zone in the system.  Each lowmem zone gets&lt;br /&gt;
            a number of reserved free pages based proportionally on its size.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/min_free_kbytes&lt;br /&gt;
          3831&lt;br /&gt;
&lt;br /&gt;
       max_map_count:&lt;br /&gt;
            This file contains the maximum number of memory map areas a process&lt;br /&gt;
            may have. Memory map areas are used as a side-effect of calling&lt;br /&gt;
            malloc, directly by mmap and mprotect, and also when loading shared&lt;br /&gt;
            libraries.&lt;br /&gt;
&lt;br /&gt;
            While most applications need less than a thousand maps, certain&lt;br /&gt;
            programs, particularly malloc debuggers, may consume lots of them,&lt;br /&gt;
            e.g., up to one or two maps per allocation.&lt;br /&gt;
&lt;br /&gt;
            The default value is 65536.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/max_map_count&lt;br /&gt;
          65536&lt;br /&gt;
&lt;br /&gt;
        Also see http://people.redhat.com/alikins/system_tuning.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 177:&lt;br /&gt;
&lt;br /&gt;
     IO Scheduler - /Documentation/block/as-iosched.txt documents kernel settings for disk&lt;br /&gt;
     performance.&lt;br /&gt;
&lt;br /&gt;
     If you're not sure what partitions you have &amp;quot;$ cat /proc/partitions&amp;quot;. This example&lt;br /&gt;
     assumes hda, and you can see some of the kernel settings:&lt;br /&gt;
&lt;br /&gt;
          $ ls /sys/block/hda/queue/iosched&lt;br /&gt;
          back_seek_max  back_seek_penalty  clear_elapsed  fifo_batch_expire  fifo_expire_async&lt;br /&gt;
           fifo_expire_sync  find_best_crq  key_type  quantum  queued&lt;br /&gt;
&lt;br /&gt;
     References: http://lwn.net/Articles/102505/&lt;br /&gt;
                 http://bhhdoa.org.au/pipermail/ck/2004-September/000961.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 178:&lt;br /&gt;
&lt;br /&gt;
     iozone -- getting data on disk performance (http://www.iozone.org/). This is a very&lt;br /&gt;
     comprehensive package.&lt;br /&gt;
&lt;br /&gt;
           $ wget http://www.iozone.org/src/current/iozone3_242.tar&lt;br /&gt;
           $ tar -xf iozone3_242.tar&lt;br /&gt;
           $ cd iozone3_242/src/current&lt;br /&gt;
           $ make linux&lt;br /&gt;
&lt;br /&gt;
     At this point you should read the documentation. There is no &amp;quot;make install&amp;quot;. You&lt;br /&gt;
     copy it to each filesystem you want to run this program on. Below are some quick&lt;br /&gt;
     start commands.&lt;br /&gt;
&lt;br /&gt;
       Good comprehensive test.&lt;br /&gt;
&lt;br /&gt;
           $ iozone -a&lt;br /&gt;
&lt;br /&gt;
       I prefer this for small filesystems. It limits the record size to 10000 and does&lt;br /&gt;
       the output in operations per second (higher numbers mean faster drive).&lt;br /&gt;
&lt;br /&gt;
           $ ./iozone -a -s 10000 -O&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 179:&lt;br /&gt;
&lt;br /&gt;
     history - bash command to get a history of all commands typed. But, here is a way&lt;br /&gt;
     that you can get date and time listed as well.&lt;br /&gt;
&lt;br /&gt;
           $ HISTTIMEFORMAT=&amp;quot;%y/%m/%d %T &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Defining the environment variable above give you the date/time info when you&lt;br /&gt;
     execute history:&lt;br /&gt;
&lt;br /&gt;
           $ history&lt;br /&gt;
              ...&lt;br /&gt;
               175  05/06/30 12:51:46 grep '141.162.' mout &amp;gt; mout2&lt;br /&gt;
               176  05/06/30 12:51:48 e mout2&lt;br /&gt;
               177  05/06/30 12:56:59 ls&lt;br /&gt;
               178  05/06/30 12:57:02 ls&lt;br /&gt;
               179  05/06/30 12:57:39 ls&lt;br /&gt;
               180  05/06/30 12:57:49 ls -l&lt;br /&gt;
               181  05/06/30 13:01:10 history&lt;br /&gt;
               182  05/06/30 13:01:20 HISTTIMEFORMAT=&amp;quot;%y/%m/%d %T &amp;quot;&lt;br /&gt;
               183  05/06/30 13:01:23 history&lt;br /&gt;
              ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 180:&lt;br /&gt;
&lt;br /&gt;
     .config - Fedora Core getting the .config to rebuild the kernel. You can find&lt;br /&gt;
     this file, the &amp;quot;.config&amp;quot; file at the following location:&lt;br /&gt;
&lt;br /&gt;
          $ ls &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Or, to see the contents&lt;br /&gt;
&lt;br /&gt;
          $ cat &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     This can be important, if you're planning to build your own kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 181:&lt;br /&gt;
&lt;br /&gt;
     Listing control key settings.&lt;br /&gt;
&lt;br /&gt;
          $ stty -a&lt;br /&gt;
          speed 38400 baud; rows 0; columns 0; line = 0;&lt;br /&gt;
          intr = ^C; quit = ^\; erase = &amp;lt;undef&amp;gt;; kill = &amp;lt;undef&amp;gt;; eof = ^D; eol = &amp;lt;undef&amp;gt;; eol2 = &amp;lt;undef&amp;gt;; start = ^Q;&lt;br /&gt;
          stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;&lt;br /&gt;
          -parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts&lt;br /&gt;
          -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel&lt;br /&gt;
          opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0&lt;br /&gt;
          isig icanon iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 182:&lt;br /&gt;
&lt;br /&gt;
     iptables DNAT and SNAT. You have a webserver on 192.168.1.71. When people query this webserver, you want them&lt;br /&gt;
     to goto 192.168.1.81, with no indication that they are going to another web server. In fact, they always make&lt;br /&gt;
     their web hits to 192.168.1.71.&lt;br /&gt;
&lt;br /&gt;
     The following is the iptables commands:&lt;br /&gt;
&lt;br /&gt;
        $ echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
        $ iptables -t nat -A PREROUTING -d 192.168.1.71 -p tcp --dport 80 -j DNAT --to 192.168.1.81&lt;br /&gt;
        $ iptables -t nat -A POSTROUTING -d 192.168.1.81 -s 192.168.1.0/24 -p tcp --dport 80 -j SNAT --to 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
     Change 192.168.1.0/24 to whatever source you expect the web browser to come in on. Below is the tcpdump showing&lt;br /&gt;
     all traffic is relayed via 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
         [root@closet iptables]# tcpdump -nN port 80&lt;br /&gt;
&lt;br /&gt;
         17:34:58.790398 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: S 3620106373:3620106373(0) win 16384 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790465 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: S 3620106373:3620106373(0) win 16384 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790703 IP 192.168.1.81.80 &amp;gt; 192.168.1.71.1158: S 1973665156:1973665156(0) ack 3620106374 win 5840 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790720 IP 192.168.1.71.80 &amp;gt; 192.168.1.102.1158: S 1973665156:1973665156(0) ack 3620106374 win 5840 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790951 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: . ack 1 win 17520&lt;br /&gt;
         17:34:58.790965 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: . ack 1 win 17520&lt;br /&gt;
         17:34:58.791451 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: P 1:327(326) ack 1 win 17520&lt;br /&gt;
         17:34:58.791472 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: P 1:327(326) ack 1 win 17520&lt;br /&gt;
         17:34:58.791973 IP 192.168.1.81.80 &amp;gt; 192.168.1.71.1158: . ack 327 win 6432&lt;br /&gt;
&lt;br /&gt;
     Above the web client is on &amp;quot;192.168.1.102&amp;quot;. You can see that the 1st server &amp;quot;192.168.1.71&amp;quot; then goes out to&lt;br /&gt;
     the 2nd server &amp;quot;192.168.1.81&amp;quot; on the second line. The third line shows the 2nd server &amp;quot;192.168.1.81&amp;quot; responding to&lt;br /&gt;
     the 1st server, and the forth line passes this data back to the web client &amp;quot;192.168.1.102&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Note: You can save your current iptables setting with the following command:&lt;br /&gt;
&lt;br /&gt;
         $ iptables-save &amp;gt; iptables_store&lt;br /&gt;
&lt;br /&gt;
       The big advantage is that you can store the counters as well.&lt;br /&gt;
&lt;br /&gt;
         $ iptables-save -c &amp;gt; iptables_store_w_cnts&lt;br /&gt;
&lt;br /&gt;
       To restore the file, use the following:&lt;br /&gt;
&lt;br /&gt;
         $ iptables-restore -c &amp;lt; iptables_store_w_cnts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 183:&lt;br /&gt;
&lt;br /&gt;
     mailstats - display mail statistics. This file reads data from &amp;quot;/var/log/mail/statistics&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         [root@closet ~]# mailstats&lt;br /&gt;
         Statistics from Sat Jun 25 15:59:52 2005&lt;br /&gt;
          M   msgsfr  bytes_from   msgsto    bytes_to  msgsrej msgsdis msgsqur  Mailer&lt;br /&gt;
          4        1          2K        0          0K        0       0       0  esmtp&lt;br /&gt;
          9        0          0K        1          2K        0       0       0  local&lt;br /&gt;
         =====================================================================&lt;br /&gt;
          T        1          2K        1          2K        0       0       0&lt;br /&gt;
          C        1                    0                    0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 184:&lt;br /&gt;
&lt;br /&gt;
     Profiling C Applications - Assume you have the following program p1.c:&lt;br /&gt;
&lt;br /&gt;
         /* Program  p1.c */&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
         t1(int i)&lt;br /&gt;
         {&lt;br /&gt;
                 printf(&amp;quot;t1:%d\n&amp;quot;, i);&lt;br /&gt;
         }&lt;br /&gt;
        &lt;br /&gt;
         t2(int j)&lt;br /&gt;
         {&lt;br /&gt;
                 printf(&amp;quot;t2:%d\n&amp;quot;, j);&lt;br /&gt;
         }&lt;br /&gt;
        &lt;br /&gt;
         int main(void)&lt;br /&gt;
         {&lt;br /&gt;
                 int i, j;&lt;br /&gt;
        &lt;br /&gt;
                 for (i = 0; i &amp;lt; 5; ++i) {&lt;br /&gt;
                         t1(i);&lt;br /&gt;
                         for (j = 0; j &amp;lt; 2; ++j) {&lt;br /&gt;
                                 t2(j);&lt;br /&gt;
                         }&lt;br /&gt;
                 }&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
     Compile the program as follows:&lt;br /&gt;
&lt;br /&gt;
        $ gcc -pg -g -o p1 p1.c&lt;br /&gt;
        $ ./p1&lt;br /&gt;
        t1:0&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:1&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:2&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:3&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:4&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
&lt;br /&gt;
     Next, to get the profile graph.&lt;br /&gt;
&lt;br /&gt;
        $ gprof -p -b p1&lt;br /&gt;
        Flat profile:&lt;br /&gt;
        &lt;br /&gt;
        Each sample counts as 0.01 seconds.&lt;br /&gt;
         no time accumulated&lt;br /&gt;
        &lt;br /&gt;
          %   cumulative   self              self     total&lt;br /&gt;
         time   seconds   seconds    calls  Ts/call  Ts/call  name&lt;br /&gt;
          0.00      0.00     0.00       10     0.00     0.00  t2&lt;br /&gt;
          0.00      0.00     0.00        5     0.00     0.00  t1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Above note the 10 calls to t2 and 5 calls to t1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 185:&lt;br /&gt;
&lt;br /&gt;
     CDPATH - this is a bash variable like PATH that defines a search path&lt;br /&gt;
              for the cd command.&lt;br /&gt;
&lt;br /&gt;
     Suppose you have the following directory structure:&lt;br /&gt;
&lt;br /&gt;
             /home/chirico/stuff&lt;br /&gt;
                               |-- dirA&lt;br /&gt;
                               `-- dirB&lt;br /&gt;
&lt;br /&gt;
     Assume you define CDPATH as follows:&lt;br /&gt;
&lt;br /&gt;
             CDPATH=/home/chirico/stuff&lt;br /&gt;
&lt;br /&gt;
     Now, no matter what directory you are in if you use the cd command below&lt;br /&gt;
     you will automatically move to &amp;quot;/home/chirico/stuff/dirA&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             $ cd dirA&lt;br /&gt;
&lt;br /&gt;
     Note you could be in &amp;quot;/etc&amp;quot; and will move directly to &amp;quot;/home/chirico/stuff/dirA&amp;quot;.&lt;br /&gt;
     This command has the same format as PATH - multiple entries are separated by a colon.&lt;br /&gt;
     If the current directory contain a sub-directory dirA, then, it gets priority.&lt;br /&gt;
&lt;br /&gt;
     The following is part of my .bash_profile&lt;br /&gt;
&lt;br /&gt;
             CDPATH=/work/cpearls/src/posted_on_sf/:/work/souptonuts/documentation/:/home/chirico/deleteme/&lt;br /&gt;
             export PATH CVS_RSH EDITOR JAVA_HOME CDPATH&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 186:&lt;br /&gt;
&lt;br /&gt;
     Groups - add groups and users to groups. The following shows how to create the group &amp;quot;share&amp;quot;&lt;br /&gt;
              and add the user &amp;quot;chirico&amp;quot; to this group. The following should be done as root, and&lt;br /&gt;
              assumes the account &amp;quot;chirico&amp;quot; already exits.&lt;br /&gt;
&lt;br /&gt;
             $ groupadd share&lt;br /&gt;
             $ usermod -G share chirico&lt;br /&gt;
&lt;br /&gt;
     Note the change made to &amp;quot;/etc/group&amp;quot; below:&lt;br /&gt;
&lt;br /&gt;
             $ cat /etc/group|grep 'share'&lt;br /&gt;
             share:x:616:chirico&lt;br /&gt;
&lt;br /&gt;
     If the user chirico is currently logged in, he should run the following&lt;br /&gt;
     command to immediately have group &amp;quot;share&amp;quot; rights. Or, the next time he logs&lt;br /&gt;
     in he will have access to this group.&lt;br /&gt;
&lt;br /&gt;
             $ newgrp share&lt;br /&gt;
&lt;br /&gt;
     Reference the following (TIP 6, TIP 167).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 187:&lt;br /&gt;
&lt;br /&gt;
     oprofile - steps for running oprofile on Fedora.&lt;br /&gt;
&lt;br /&gt;
     Step 1:&lt;br /&gt;
&lt;br /&gt;
       Find out what version of the kernel you are running.&lt;br /&gt;
&lt;br /&gt;
           $ uname -a&lt;br /&gt;
           Linux closet.squeezel.com 2.6.12-1.1398_FC4 #1 Fri Jul 15 00:52:32 EDT 2005 i686 i686 i386 GNU/Linux&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 2:&lt;br /&gt;
&lt;br /&gt;
       Download the source in a chosen directory. Above, I'm running 2.6.12-1, but I'm going to go for 2.6.12.3, since&lt;br /&gt;
       it's a little later. You want the signed file as well.&lt;br /&gt;
&lt;br /&gt;
           $ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.12.3.tar.gz&lt;br /&gt;
           $ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.12.3.tar.gz.sign&lt;br /&gt;
&lt;br /&gt;
       Now, check the signature.&lt;br /&gt;
&lt;br /&gt;
           $ gpg --verify linux-2.6.12.3.tar.gz.sign linux-2.6.12.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 3:&lt;br /&gt;
&lt;br /&gt;
       Unpack the file.&lt;br /&gt;
&lt;br /&gt;
           $ tar -xzf linux-2.6.12.3.tar.gz&lt;br /&gt;
           $ cd cd linux-2.6.12.3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 4:&lt;br /&gt;
&lt;br /&gt;
       Copy the &amp;quot;.config&amp;quot; used to compile your previous kernel. You should find it&lt;br /&gt;
       in the following direcotry &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       Copy it to the linux-2.6.12.3 directory.&lt;br /&gt;
&lt;br /&gt;
           $ cp &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot; .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 5:&lt;br /&gt;
&lt;br /&gt;
       Run make as follows. It will ask for a few questions on &amp;quot;make oldconfig&amp;quot;. The&lt;br /&gt;
       make installs below will have to be done with root privileges.&lt;br /&gt;
&lt;br /&gt;
          $ make oldconfig&lt;br /&gt;
          $ make bzImage&lt;br /&gt;
          $ make modules&lt;br /&gt;
          $ make modules_install&lt;br /&gt;
          $ make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 6:&lt;br /&gt;
&lt;br /&gt;
       Edit the &amp;quot;/boot/grub/grub.conf&amp;quot; and set default = 0  as shown below in this&lt;br /&gt;
       file.&lt;br /&gt;
&lt;br /&gt;
            default=0&lt;br /&gt;
            timeout=5&lt;br /&gt;
            splashimage=(hd0,2)/grub/splash.xpm.gz&lt;br /&gt;
            hiddenmenu&lt;br /&gt;
            title Fedora Core (2.6.12.3)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.12.3 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.12.3.img&lt;br /&gt;
            title Fedora Core (2.6.12-1.1398_FC4)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.12-1.1398_FC4 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.12-1.1398_FC4.img&lt;br /&gt;
            title Fedora Core (2.6.11-1.1369_FC4)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.11-1.1369_FC4 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.11-1.1369_FC4.img&lt;br /&gt;
            title Other&lt;br /&gt;
                    rootnoverify (hd0,1)&lt;br /&gt;
                    chainloader +1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 7:&lt;br /&gt;
&lt;br /&gt;
       Shutdown with the restart option.&lt;br /&gt;
&lt;br /&gt;
           $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 8:&lt;br /&gt;
&lt;br /&gt;
       Run opcontrol. The commands below are done as root.  My kernel was compiled in the following&lt;br /&gt;
       directory &amp;quot;/home/kernel/linux-2.6.12.3/&amp;quot;, so I'll run opcontrol as follows:&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --vmlinux=/home/kernel/linux-2.6.12.3/vmlinux&lt;br /&gt;
&lt;br /&gt;
       Now start.&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --start&lt;br /&gt;
           Using 2.6+ OProfile kernel interface.&lt;br /&gt;
           Reading module info.&lt;br /&gt;
           Using log file /var/lib/oprofile/oprofiled.log&lt;br /&gt;
           Daemon started.&lt;br /&gt;
           Profiler running.&lt;br /&gt;
&lt;br /&gt;
       Shutdown opcontrol.&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --shutdown&lt;br /&gt;
&lt;br /&gt;
       Run report.&lt;br /&gt;
&lt;br /&gt;
           $ opreport&lt;br /&gt;
&lt;br /&gt;
           CPU: CPU with timer interrupt, speed 0 MHz (estimated)&lt;br /&gt;
           Profiling through timer interrupt&lt;br /&gt;
                     TIMER:0|&lt;br /&gt;
             samples|      %|&lt;br /&gt;
           ------------------&lt;br /&gt;
              156088 99.8746 vmlinux&lt;br /&gt;
                  60  0.0384 libc-2.3.5.so&lt;br /&gt;
                  30  0.0192 oprofiled&lt;br /&gt;
                  23  0.0147 libcrypto.so.0.9.7f&lt;br /&gt;
                  13  0.0083 bash&lt;br /&gt;
                  12  0.0077 screen&lt;br /&gt;
                  10  0.0064 sshd&lt;br /&gt;
                   9  0.0058 ssh&lt;br /&gt;
                   6  0.0038 ip_tables&lt;br /&gt;
                   6  0.0038 libncurses.so.5.4&lt;br /&gt;
                   5  0.0032 b44&lt;br /&gt;
                   5  0.0032 ext3&lt;br /&gt;
                   5  0.0032 ld-2.3.5.so&lt;br /&gt;
                   4  0.0026 ip_conntrack&lt;br /&gt;
                   4  0.0026 jbd&lt;br /&gt;
                   2  0.0013 grep&lt;br /&gt;
                   1 6.4e-04 libdns.so.20.0.2&lt;br /&gt;
                   1 6.4e-04 libisc.so.9.1.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Reference the following for more documentation:&lt;br /&gt;
             http://oprofile.sourceforge.net/doc/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 188:&lt;br /&gt;
&lt;br /&gt;
     cyrus-imapd with Postfix using sasldb for authentication. For this example&lt;br /&gt;
     the server is tape.squeezel.com and the user is chirico.&lt;br /&gt;
&lt;br /&gt;
        Step 1:&lt;br /&gt;
        &lt;br /&gt;
                   $ yum install cyrus-imapd&lt;br /&gt;
                   $ yum install cyrus-imapd-utils&lt;br /&gt;
        &lt;br /&gt;
            You need &amp;quot;cyrus-imapd-utils&amp;quot; for cyradm.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 2:&lt;br /&gt;
        &lt;br /&gt;
          Edit /etc/imapd.conf&lt;br /&gt;
        &lt;br /&gt;
               configdirectory: /var/lib/imap&lt;br /&gt;
               partition-default: /var/spool/imap&lt;br /&gt;
               admins: cyrus&lt;br /&gt;
               sievedir: /var/lib/imap/sieve&lt;br /&gt;
               sendmail: /usr/sbin/sendmail&lt;br /&gt;
               hashimapspool: true&lt;br /&gt;
               # Chirico Commented the below line&lt;br /&gt;
               # sasl_pwcheck_method: saslauthd&lt;br /&gt;
               # Because using sasldb&lt;br /&gt;
               sasl_pwcheck_method: auxprop&lt;br /&gt;
               sasl_auxprop_plugin: sasldb&lt;br /&gt;
               #  Chirico end change&lt;br /&gt;
               sasl_mech_list: PLAIN&lt;br /&gt;
               tls_cert_file: /usr/share/ssl/certs/cyrus-imapd.pem&lt;br /&gt;
               tls_key_file: /usr/share/ssl/certs/cyrus-imapd.pem&lt;br /&gt;
               tls_ca_file: /usr/share/ssl/certs/ca-bundle.crt&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 3:&lt;br /&gt;
        &lt;br /&gt;
           Create a user and password:&lt;br /&gt;
        &lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` cyrus&lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` chirico&lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` allmail&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
           This will automatically create the file /etc/sasldb2. But look&lt;br /&gt;
           at the default rights, assuming you ran saslpasswd2 as root:&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /etc/sasldb2&lt;br /&gt;
                 -rw-r-----  1 root root 12288 Jul 31 09:50 /etc/sasldb2&lt;br /&gt;
        &lt;br /&gt;
           We need to correct this in step 4.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 4:&lt;br /&gt;
        &lt;br /&gt;
                 $ chown root.mail /etc/sasldb2&lt;br /&gt;
                 $ ls -l /etc/sasldb2&lt;br /&gt;
                 -rw-r-----  1 root mail 12288 Jul 31 09:50 /etc/sasldb2&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 5:&lt;br /&gt;
        &lt;br /&gt;
            Update &amp;quot;/etc/postfix/main.cf&amp;quot;. Note in /etc/imapd.conf the configdirectory&lt;br /&gt;
            points to /var/lib/imap, and if I look at this directory I see the&lt;br /&gt;
            socket directory. However, after staring /etc/init.d/cyrus-imapd  there&lt;br /&gt;
            will be a socket file &amp;quot;/var/lib/imap/socket/lmtp&amp;quot;. (See step 6).&lt;br /&gt;
        &lt;br /&gt;
                  mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp&lt;br /&gt;
                  mailbox_transport = cyrus&lt;br /&gt;
        &lt;br /&gt;
            Restart postfix.&lt;br /&gt;
        &lt;br /&gt;
                  /etc/init.d/postfix restart&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 6:&lt;br /&gt;
&lt;br /&gt;
            Start cyrus-imapd and look for the socket file.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
                   $ /etc/init.d/cyrus-imapd restart&lt;br /&gt;
                   Shutting down cyrus-imapd:                                 [  OK  ]&lt;br /&gt;
                   Starting cyrus-imapd: preparing databases... done.         [  OK  ]&lt;br /&gt;
        &lt;br /&gt;
            Now you should see the lmtp file:&lt;br /&gt;
        &lt;br /&gt;
                   $ ls -l /var/lib/imap/socket/lmtp&lt;br /&gt;
                   srwxrwxrwx  1 root root 0 Jul 31 10:04 /var/lib/imap/socket/lmtp&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 7:&lt;br /&gt;
        &lt;br /&gt;
            Add users. Note, you may have to go back to step 3 to add them to /etc/sasldb2&lt;br /&gt;
            as well.&lt;br /&gt;
        &lt;br /&gt;
                   $ su - cyrus&lt;br /&gt;
                   $ cyradm tape.squeezel.com&lt;br /&gt;
                   tape.squeezel.com&amp;gt; cm user.chirico&lt;br /&gt;
                   tape.squeezel.com&amp;gt; quit&lt;br /&gt;
        &lt;br /&gt;
            Now got back as root, and check that everything was created correctly.&lt;br /&gt;
        &lt;br /&gt;
                   $ ls /var/spool/imap/c/user/&lt;br /&gt;
                   total 8&lt;br /&gt;
                   drwx------  2 cyrus mail 4096 Jul 31 10:21 chirico&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 8:&lt;br /&gt;
        &lt;br /&gt;
             Run a mail test. We'll do this as root to the chirico account.&lt;br /&gt;
        &lt;br /&gt;
                   $ mail -s 'First test'  chirico&lt;br /&gt;
                   first test&lt;br /&gt;
                   .&lt;br /&gt;
        &lt;br /&gt;
             Now, still as root check the maillog. Normally everything should work.&lt;br /&gt;
        &lt;br /&gt;
                  $ tail /var/log/maillog&lt;br /&gt;
        &lt;br /&gt;
             However, I got the following error below.&lt;br /&gt;
&lt;br /&gt;
                     Jul 31 10:29:03 tape postfix/cleanup[30124]: AE7CB1B34A4: message-id=&amp;lt;20050731142903.AE7CB1B34A4@tape.squeezel.com&amp;gt;&lt;br /&gt;
                     Jul 31 10:29:03 tape postfix/qmgr[30120]: AE7CB1B34A4: from=&amp;lt;root@tape.squeezel.com&amp;gt;, size=315, nrcpt=1 (queue active)&lt;br /&gt;
                     Jul 31 10:29:03 tape pipe[30128]: fatal: pipe_comand: execvp /cyrus/bin/deliver: No such file or directory&lt;br /&gt;
&lt;br /&gt;
             If you get a similiar error, you may need to adjust the settting in /etc/postfix/master.cf&lt;br /&gt;
        &lt;br /&gt;
                 # This is the problem in /etc/postfix/master.cf&lt;br /&gt;
                 cyrus     unix  -       n       n       -       -       pipe&lt;br /&gt;
                   user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}&lt;br /&gt;
        &lt;br /&gt;
             My deliver file is the following&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
                 -rwxr-xr-x  1 root root 846228 Apr  4 18:59 /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
        &lt;br /&gt;
             So I need to change my /etc/postfix/master.cf as follows:&lt;br /&gt;
        &lt;br /&gt;
                 # Fix because by deliver file is under  /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
                 cyrus     unix  -       n       n       -       -       pipe&lt;br /&gt;
                   user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -r ${sender} -m ${extension} ${user}&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
             If changes were needed, like I had to do, restart postfix&lt;br /&gt;
        &lt;br /&gt;
                 $ /etc/init.d/postfix restart&lt;br /&gt;
        &lt;br /&gt;
             Now, if everything works, you should start to see numbers in the spool directory like &amp;quot;1.&amp;quot; and&lt;br /&gt;
             &amp;quot;2.&amp;quot;.&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /var/spool/imap/c/user/chirico/&lt;br /&gt;
                 total 40&lt;br /&gt;
                 -rw-------  1 cyrus mail  545 Jul 31 10:44 1.&lt;br /&gt;
                 -rw-------  1 cyrus mail  547 Jul 31 10:45 2.&lt;br /&gt;
                 -rw-------  1 cyrus mail 1276 Jul 31 10:45 cyrus.cache&lt;br /&gt;
                 -rw-------  1 cyrus mail  153 Jul 31 10:21 cyrus.header&lt;br /&gt;
                 -rw-------  1 cyrus mail  196 Jul 31 10:45 cyrus.index&lt;br /&gt;
&lt;br /&gt;
        Step 9:&lt;br /&gt;
        &lt;br /&gt;
             Local firewall.&lt;br /&gt;
        &lt;br /&gt;
                 # imap&lt;br /&gt;
                iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 143 -j ACCEPT&lt;br /&gt;
                iptables -A INPUT -p tcp -s 192.168.1.0/24  --dport 143 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        Step 10:&lt;br /&gt;
        &lt;br /&gt;
             Configure cyrus-imapd to start for run-level 3 and 5.&lt;br /&gt;
&lt;br /&gt;
                 # chkconfig --level 35 cyrus-imapd on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       HINTS - &lt;br /&gt;
&lt;br /&gt;
        Something to watch out for:&lt;br /&gt;
&lt;br /&gt;
              Something to watch out for: If a user creates a .forward file in their shell account with the&lt;br /&gt;
              following entry, then, mail will not get mail relayed to cyrus.&lt;br /&gt;
&lt;br /&gt;
                  &amp;quot;|exec /usr/bin/procmail&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             The /etc/maillog will show something like this:&lt;br /&gt;
&lt;br /&gt;
                    to=&amp;lt;chirico@squeezel.squeezel.com&amp;gt;, orig_to=&amp;lt;chirico&amp;gt;, relay=local, delay=0,&lt;br /&gt;
                          status=sent (delivered to command: exec /usr/bin/procmail)&lt;br /&gt;
&lt;br /&gt;
             Remove the &amp;quot;.forward&amp;quot; file from their home directory and you'll get the following:&lt;br /&gt;
&lt;br /&gt;
                    to=&amp;lt;chirico@squeezel.squeezel.com&amp;gt;, relay=cyrus, delay=0,&lt;br /&gt;
                          status=sent (squeezel.squeezel.com)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              mutt with IMAP?  (See TIP 190)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 189:&lt;br /&gt;
&lt;br /&gt;
     expand - convert tabs to spaces in a file.&lt;br /&gt;
&lt;br /&gt;
             $ expand How_to_Linux_and_Open_Source.txt &amp;gt; notabs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 190:&lt;br /&gt;
&lt;br /&gt;
     mutt with imap - assume you have setup imap (see tip 188). Now how do you configure&lt;br /&gt;
                      your &amp;quot;.muttrc&amp;quot; file to automatically connect, securely to the IMAP server?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       &lt;br /&gt;
     Below is an example of my &amp;quot;.muttrc&amp;quot; file. For this example, assume my password is &amp;quot;S0m3paSSw0r9&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             $ cat .muttrc&lt;br /&gt;
             set spoolfile = &amp;quot;imaps://chirico:S0m3paSSw0r9@squeezel.squeezel.com/&lt;br /&gt;
             set imap_force_ssl=yes&lt;br /&gt;
             set certificate_file=~/.mutt/certificates/72d31154.0&lt;br /&gt;
&lt;br /&gt;
     Now, you want to copy the certificate as a &amp;quot;file.pem&amp;quot; and run &amp;quot;c_rehash&amp;quot; to convert this&lt;br /&gt;
     file to a number. See the article. See the following article on how to do this under the &lt;br /&gt;
     fetchmail section.&lt;br /&gt;
&lt;br /&gt;
          http://souptonuts.sourceforge.net/postfix_tutorial.html&lt;br /&gt;
&lt;br /&gt;
     This is a quick summary of creating this key.&lt;br /&gt;
&lt;br /&gt;
             $ openssl s_client -connect squeezel.squeezel.com:995 -showcerts &amp;gt; file.pem&lt;br /&gt;
             $ c_rehash ~/.mutt/certificates&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 191:&lt;br /&gt;
&lt;br /&gt;
     Apache - CGI scripts.  There are two ways to enable CGI scripts. The second method is the&lt;br /&gt;
              prefered method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           First way, the easy way. Look for the &amp;quot;http.conf&amp;quot; file. On Fedora Core, this file can be&lt;br /&gt;
           found under &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;. Edit this file as follows to make &lt;br /&gt;
           &amp;quot;http://squeezel.squeezel.com/chirico-cgi/&amp;quot; execute scripts.&lt;br /&gt;
&lt;br /&gt;
                     ScriptAlias /chirico-cgi/ &amp;quot;/home/chirico/cgi-bin/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           Second way, the better way. Instead of doing the above, make the following change in &lt;br /&gt;
           &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                     &amp;lt;Directory /home/chirico/cgi-bin&amp;gt;&lt;br /&gt;
                      Options +ExecCGI&lt;br /&gt;
                      SetHandler chirico-cgi&lt;br /&gt;
                     &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Running a test script. Now copy the following test script into the directory &amp;quot;/home/chirico/cgi-bin&amp;quot;&lt;br /&gt;
        and change the rights to execute for the user running this.&lt;br /&gt;
&lt;br /&gt;
                  #!/bin/sh&lt;br /&gt;
                  # Save as test.cgi&lt;br /&gt;
                  #  chown apache.apache test.cgi&lt;br /&gt;
                  #  chmod 700 test.cgi&lt;br /&gt;
                  echo &amp;quot;Content-Type: text/html&amp;quot;&lt;br /&gt;
                  echo&lt;br /&gt;
                  echo &amp;quot;Hello world from user &amp;lt;b&amp;gt;`whoami`&amp;lt;/b&amp;gt;! &amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 192:&lt;br /&gt;
&lt;br /&gt;
     Bash - using getopts for your bash scripts.&lt;br /&gt;
&lt;br /&gt;
                   #!/bin/bash&lt;br /&gt;
                   while getopts &amp;quot;ab:cd:&amp;quot; Option&lt;br /&gt;
                   # b and d take arguments&lt;br /&gt;
                   #&lt;br /&gt;
                   do&lt;br /&gt;
                     case $Option in&lt;br /&gt;
                       a) echo -e &amp;quot;a = $OPTIND&amp;quot;;;&lt;br /&gt;
                       b) echo -e &amp;quot;b = $OPTIND $OPTARG&amp;quot;;;&lt;br /&gt;
                       c) echo -e &amp;quot;c = $OPTIND&amp;quot;;;&lt;br /&gt;
                       d) echo -e &amp;quot;d = $OPTIND $OPTARG&amp;quot;;;&lt;br /&gt;
                    esac&lt;br /&gt;
                  done&lt;br /&gt;
                  shift $(($OPTIND - 1))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 193:&lt;br /&gt;
&lt;br /&gt;
     Sieve - creating sieve recipes with &amp;quot;sieveshell&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     The following sieve script put all jefferson.edu mail into the &lt;br /&gt;
     folder jefferson. This assumes that I have already created the IMP &lt;br /&gt;
     directory, or mail box (INBOX.jefferson), which can be done in mutt &lt;br /&gt;
     with the &amp;quot;C&amp;quot; command. Below is an example of finding &amp;quot;jefferson.edu&amp;quot;&lt;br /&gt;
     anywhere in the header. &lt;br /&gt;
&lt;br /&gt;
         # This is a file named jefferson.siv&lt;br /&gt;
         require [&amp;quot;fileinto&amp;quot;];&lt;br /&gt;
         if header :contains &amp;quot;Received&amp;quot; &amp;quot;from jefferson.edu&amp;quot; {&lt;br /&gt;
           fileinto &amp;quot;INBOX.jefferson&amp;quot;;&lt;br /&gt;
           stop;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
     Now, from the command propt execute &amp;quot;sieveshell&amp;quot; with the hostname of the&lt;br /&gt;
     imap server. My server is squeezel.squeezel.com, so I would execute the &lt;br /&gt;
     following:&lt;br /&gt;
&lt;br /&gt;
          $ sieveshell squeezel.squeezel.com&lt;br /&gt;
          connecting to squeezel.squeezel.com&lt;br /&gt;
          Please enter your password:****&lt;br /&gt;
          &amp;gt; put jefferson.siv&lt;br /&gt;
          &amp;gt; activate jefferson.siv&lt;br /&gt;
          &amp;gt; list&lt;br /&gt;
          jefferson.siv  &amp;lt;- active script&lt;br /&gt;
          &amp;gt; quit&lt;br /&gt;
&lt;br /&gt;
     Note the put brings in the script. And you need to activiate it.&lt;br /&gt;
&lt;br /&gt;
     You can activate a sieve script for any user on your system if you are&lt;br /&gt;
     root. This is an example of activating a script for user chirico. Assume&lt;br /&gt;
     below the root prompt is &amp;quot;#&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          # sieveshell -a chirico -u chirico squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
     You can also automate everything from a bash script. But note after&lt;br /&gt;
     the -e the commands, and not a file with the commands, follows within&lt;br /&gt;
     quotes. This is the script I use for my home system.&lt;br /&gt;
&lt;br /&gt;
         #!/bin/bash&lt;br /&gt;
         sieveshell -a chirico -u chirico -e 'deactivate&lt;br /&gt;
         delete chirico.siv&lt;br /&gt;
         put chirico.siv&lt;br /&gt;
         activate chirico.siv&lt;br /&gt;
         list&lt;br /&gt;
         '  squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     References:&lt;br /&gt;
         http://wiki.fastmail.fm/index.php/SieveRecipes&lt;br /&gt;
         http://www.cyrusoft.com/sieve/#documents&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 194:&lt;br /&gt;
&lt;br /&gt;
     emacs - editing files remotely with tramp. Tramp comes with the latest version of emacs.&lt;br /&gt;
             That means if you're using Fedora core 4, with emacs, you have tramp. This is &lt;br /&gt;
             ideal for editing files on remote computers that do not use emacs.&lt;br /&gt;
&lt;br /&gt;
             Edit the &amp;quot;.emacs&amp;quot; file and add the following line:&lt;br /&gt;
&lt;br /&gt;
                 (require 'tramp)&lt;br /&gt;
                 (setq tramp-default-method &amp;quot;scp&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
             Now, to edit a file on computer tape.squeezel.com (C-x, C-f) and&lt;br /&gt;
             enter the following in Find file:&lt;br /&gt;
&lt;br /&gt;
                 Find file:/chirico@tape.squeezel.com:test.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             References:&lt;br /&gt;
&lt;br /&gt;
                    http://savannah.gnu.org/projects/tramp/&lt;br /&gt;
&lt;br /&gt;
             &lt;br /&gt;
&lt;br /&gt;
TIP 195:&lt;br /&gt;
&lt;br /&gt;
     trusted X11 forwarding - running gnome and KDE both on one screen, at the same&lt;br /&gt;
             time securely. The following assumes gnome is running on the current&lt;br /&gt;
             computer and &amp;quot;closet.squeezel.com&amp;quot; has KDE&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y  closet.squeezel.com&lt;br /&gt;
              $ startkde&lt;br /&gt;
&lt;br /&gt;
          Or assume you want to run gnome on &amp;quot;closet.squeezel.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y  closet.squeezel.com&lt;br /&gt;
              $ gnome-session&lt;br /&gt;
&lt;br /&gt;
          By default Fedora Core allows ForwardX11 over ssh. Note you want to use&lt;br /&gt;
          the -Y option above and NOT -X. &lt;br /&gt;
&lt;br /&gt;
          Suppose you want a remote &amp;quot;gnome-session&amp;quot; on ctl-alt-F12. Below is an &lt;br /&gt;
          example of getting the remote computer closet.squeezel.com, and you&lt;br /&gt;
          can still have the above configuration.&lt;br /&gt;
&lt;br /&gt;
          First you must allow magic cookies for each server connection.&lt;br /&gt;
             &lt;br /&gt;
              $ MCOOKIE=$(mcookie)&lt;br /&gt;
              $ xauth add $(hostname)/unix:1 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
              $ xauth add localhost/unix:1 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
  &lt;br /&gt;
          Again, note that you have to add this for EACH connection. So if you wanted 2 as well&lt;br /&gt;
&lt;br /&gt;
              $ MCOOKIE=$(mcookie)&lt;br /&gt;
              $ xauth add $(hostname)/unix:2 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
              $ xauth add localhost/unix:2 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
&lt;br /&gt;
          On squeezel.squeezel.com create a new xterm. If :1 is take below&lt;br /&gt;
          try :2. The vt12 is for switching to ctl-alt-F12.&lt;br /&gt;
&lt;br /&gt;
              $ xinit -- :1 vt12&lt;br /&gt;
&lt;br /&gt;
          Note, if you do not add the above cookies, you will get the follow error:&lt;br /&gt;
         &lt;br /&gt;
               Xlib: connection to &amp;quot;:1.0&amp;quot; refused by server&lt;br /&gt;
               Xlib: No protocol specified&lt;br /&gt;
&lt;br /&gt;
          The screen may be hard to read. At this point ssh -Y to the remote computer.&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y closet.squeezel.com&lt;br /&gt;
              $ gnome-session&lt;br /&gt;
&lt;br /&gt;
          Yes, you will get errors about sound and some custom drivers is the remove &lt;br /&gt;
          computer has different hardware. After is loads, you can switch back and&lt;br /&gt;
          forth between session with (ctl-alt-F12)  and (ctl-alt-F7)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 196:&lt;br /&gt;
&lt;br /&gt;
     Suspend ssh session - you have just sshed into a computer &amp;quot;ssh -l user example.com&amp;quot;, and you&lt;br /&gt;
          want to get back to the terminal prompt of the computer you started with. Escapte, by &lt;br /&gt;
          default with ssh is &amp;quot;~&amp;quot;, so enter &amp;quot;~&amp;quot; followed by &amp;quot;ctl-z&amp;quot; to suspend.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 197:&lt;br /&gt;
&lt;br /&gt;
     Quick way to send a text file &lt;br /&gt;
&lt;br /&gt;
              $ sendmail -f mike.chirico@gmail.com mchirico@comcast.net &amp;lt; /etc/fstab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 198:&lt;br /&gt;
&lt;br /&gt;
     size - determining the size of the text segment, data segment, and &amp;quot;bss&amp;quot; or uninitialized data segment.&lt;br /&gt;
&lt;br /&gt;
              $ size /bin/sh /bin/bash&lt;br /&gt;
               text        data     bss     dec     hex filename&lt;br /&gt;
              586946      22444   18784  628174   995ce /bin/sh&lt;br /&gt;
              586946      22444   18784  628174   995ce /bin/bash&lt;br /&gt;
&lt;br /&gt;
          Note above that &amp;quot;/bin/sh&amp;quot; and &amp;quot;/bin/bash&amp;quot; have equal text,data and bss numbers. It's&lt;br /&gt;
          highly likely that these are the same programs.&lt;br /&gt;
&lt;br /&gt;
              $ ls -l /bin/sh&lt;br /&gt;
               lrwxrwxrwx  1 root root 4 Jan 14  2005 /bin/sh -&amp;gt; bash&lt;br /&gt;
&lt;br /&gt;
          Yep, it's the same program. Here's a further definition of each segment.&lt;br /&gt;
&lt;br /&gt;
              Text segment: The machine instructions that the CPU executes. This is usually&lt;br /&gt;
                            read only and sharable.&lt;br /&gt;
&lt;br /&gt;
              Data segment: Contains initialized variables in a program. You also know these&lt;br /&gt;
                            as declarations and definitions.&lt;br /&gt;
&lt;br /&gt;
                               int max = 200;&lt;br /&gt;
&lt;br /&gt;
              Uninitialized data segment: Think of this as a declaration only, or data that&lt;br /&gt;
                            is only initialized by the kernel to arithmetic 0 or null pointers&lt;br /&gt;
                            before program execution.&lt;br /&gt;
&lt;br /&gt;
                               char s[10];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 199:&lt;br /&gt;
&lt;br /&gt;
     Using the at command.&lt;br /&gt;
&lt;br /&gt;
       Below is a simple example if running the ls command at 11:42am that&lt;br /&gt;
       will send mail -m to the user that executed it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       We'll execute job1 defined as follows and set to be executable. &lt;br /&gt;
&lt;br /&gt;
           $ cat ./job1&lt;br /&gt;
           #!/bin/bash&lt;br /&gt;
           date &amp;gt;&amp;gt; /tmp/job1&lt;br /&gt;
&lt;br /&gt;
       The at command is listed below. For queue &amp;quot;-q&amp;quot; names you can only&lt;br /&gt;
       specify one letter. Here we're using x. The letter determines the&lt;br /&gt;
       priority with &amp;quot;a&amp;quot; the highest.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x  -f ./job1 -m  11:54am&lt;br /&gt;
           job 3 at 2005-10-04 11:54&lt;br /&gt;
&lt;br /&gt;
       Now, if you execute the atq command, you'll get the following.&lt;br /&gt;
&lt;br /&gt;
           $ atq&lt;br /&gt;
           3       2005-10-04 11:54 x chirico&lt;br /&gt;
&lt;br /&gt;
       It's also possible to execute jobs at the command line entering&lt;br /&gt;
       a ctl-d at the end of the input.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x  -m 12:08pm&lt;br /&gt;
           at&amp;gt; ls -l&lt;br /&gt;
           at&amp;gt; who&lt;br /&gt;
           at&amp;gt; date&lt;br /&gt;
           at&amp;gt; ^D&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Or for a job to execute 1 minute from now.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x -m `date -d '1 minute' +&amp;quot;%H:%M&amp;quot;`&lt;br /&gt;
           at&amp;gt; ls -l&lt;br /&gt;
           at&amp;gt; date&lt;br /&gt;
     &lt;br /&gt;
&lt;br /&gt;
     Important points: The atd daemon must be running. To check if&lt;br /&gt;
      it's running do the following:&lt;br /&gt;
&lt;br /&gt;
            $ /etc/init.d/atd status&lt;br /&gt;
&lt;br /&gt;
      Also, if there is an /etc/at.allow file, then only users in that&lt;br /&gt;
      file will be allowed to execute at.&lt;br /&gt;
&lt;br /&gt;
      If /etc/at.deny exists but is empty and there is no /etc/at.allow,&lt;br /&gt;
      then, everyone can execute the at command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 200:&lt;br /&gt;
&lt;br /&gt;
     lsusb - command will display all USB buses and all devices connected.&lt;br /&gt;
&lt;br /&gt;
        $ lsusb&lt;br /&gt;
        Bus 005 Device 003: ID 413c:2010 Dell Computer Corp.&lt;br /&gt;
        Bus 005 Device 002: ID 413c:1003 Dell Computer Corp.&lt;br /&gt;
        Bus 005 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 004 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 003 Device 003: ID 0fc5:1227 Delcom Engineering&lt;br /&gt;
        Bus 003 Device 002: ID 046d:c016 Logitech, Inc. Optical Mouse&lt;br /&gt;
        Bus 003 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 002 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 001 Device 001: ID 0000:0000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 201:&lt;br /&gt;
&lt;br /&gt;
     Memory fragmentation - if you suspect workload memory fragmentation issues&lt;br /&gt;
     and you want to monitor the current state of you system, then, consider&lt;br /&gt;
     looking at the output from /proc/buddyinfo on recent kernels.&lt;br /&gt;
&lt;br /&gt;
        $ cat /proc/buddyinfo&lt;br /&gt;
      Node 0, zone      DMA    541    218     42      2      0      0      0      1      1      1      0 &lt;br /&gt;
      Node 0, zone   Normal   2508   2614     52      1      5      5      0      1      1      1      0 &lt;br /&gt;
      Node 0, zone  HighMem      0      1      3      0      1      0      0      0      0      0      0 &lt;br /&gt;
&lt;br /&gt;
     The following definition is taken from  ./Documentation/filesystems/proc.txt in the &lt;br /&gt;
     Linux kernel source.&lt;br /&gt;
&lt;br /&gt;
       Each column represents the number of pages of a certain order which are&lt;br /&gt;
       available.  In this case, there are 0 chunks of 2^0*PAGE_SIZE available in&lt;br /&gt;
       ZONE_DMA, 4 chunks of 2^1*PAGE_SIZE in ZONE_DMA, 101 chunks of 2^4*PAGE_SIZE&lt;br /&gt;
       available in ZONE_NORMAL, etc...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 202:&lt;br /&gt;
&lt;br /&gt;
     arp - Linux ARP kernel moduel.  This command implements the Address Resolution Protocol.&lt;br /&gt;
&lt;br /&gt;
     This is an example of the command.&lt;br /&gt;
&lt;br /&gt;
        $ arp&lt;br /&gt;
        Address                  HWtype  HWaddress           Flags Mask            Iface&lt;br /&gt;
        tape.squeezel.com        ether   00:50:DA:60:5B:AD   C                     eth0&lt;br /&gt;
        squeezel.squeezel.com    ether   00:11:11:8A:BE:3F   C                     eth0&lt;br /&gt;
        gw.squeezel.com          ether   00:0F:66:47:15:73   C                     eth0&lt;br /&gt;
&lt;br /&gt;
       &lt;br /&gt;
TIP 203:&lt;br /&gt;
&lt;br /&gt;
     dbench - performance monitoring. &lt;br /&gt;
&lt;br /&gt;
     So, how does your system react when the load average is above 600. Have you even seen a &lt;br /&gt;
     computer with a load average of 600? Well, this could be your chance. &lt;br /&gt;
&lt;br /&gt;
         Reference: http://freshmeat.net/projects/dbench/&lt;br /&gt;
&lt;br /&gt;
     The following gives a load average of 10 on my system.&lt;br /&gt;
&lt;br /&gt;
        $ dbench 34&lt;br /&gt;
&lt;br /&gt;
     If you want a higher load, just increase the number.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 204:&lt;br /&gt;
&lt;br /&gt;
     /etc guide - a listing of common files in the /etc directory.&lt;br /&gt;
&lt;br /&gt;
        /etc/exports: this file is used to configure NFS.&lt;br /&gt;
&lt;br /&gt;
        /etc/ftpusers: the users on your system who are restricted from FTP login.&lt;br /&gt;
&lt;br /&gt;
        /etc/motd: message of the day, which users see after login.&lt;br /&gt;
&lt;br /&gt;
        /etc/named.conf: DNS config file.&lt;br /&gt;
&lt;br /&gt;
        /etc/profile: common user information.&lt;br /&gt;
&lt;br /&gt;
        /etc/inittab: this file contains runlevel start information.&lt;br /&gt;
&lt;br /&gt;
        /etc/services: the services and their respective ports.&lt;br /&gt;
&lt;br /&gt;
        /etc/shells: this contains the names of all shells installed on the system.&lt;br /&gt;
&lt;br /&gt;
        /etc/passwd: this file contains user information.&lt;br /&gt;
&lt;br /&gt;
        /etc/group: security group rights.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
TIP 205: &lt;br /&gt;
&lt;br /&gt;
     logger - is a bash command utility for writing to /var/log/messages or the&lt;br /&gt;
            other files defined in /etc/syslog.conf.&lt;br /&gt;
&lt;br /&gt;
            $ logger -t TEST more of a test here&lt;br /&gt;
&lt;br /&gt;
         This is what shows up in /var/log/messages&lt;br /&gt;
  &lt;br /&gt;
            Oct 28 07:15:50 squeezel TEST: more of a test here&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
TIP 206: &lt;br /&gt;
&lt;br /&gt;
     accton, lastcomm - accouting on and last command. This is &lt;br /&gt;
         a way to monitor users on your system. As root, you &lt;br /&gt;
         would implement this as follows:&lt;br /&gt;
&lt;br /&gt;
           $ accton -h&lt;br /&gt;
            Usage: accton [-hV] [file]&lt;br /&gt;
            [--help] [--version]&lt;br /&gt;
&lt;br /&gt;
            The system's default process accounting file is /var/account/pacct.&lt;br /&gt;
&lt;br /&gt;
         Note the default file location is /var/account/pacct so we'll turn&lt;br /&gt;
         it on system wide with the following command.&lt;br /&gt;
&lt;br /&gt;
           $ accton /var/account/pacct&lt;br /&gt;
&lt;br /&gt;
         Now take a look at this file. It will grow. To see command that&lt;br /&gt;
         are executed, use the lastcomm command.&lt;br /&gt;
&lt;br /&gt;
           $ lastcomm&lt;br /&gt;
&lt;br /&gt;
         The above command gives output for all users. To get the data&lt;br /&gt;
         for user &amp;quot;chirico&amp;quot; execute the following command:&lt;br /&gt;
&lt;br /&gt;
           $ lastcomm --user chirico&lt;br /&gt;
&lt;br /&gt;
         You can also get a summary of commands with sa.&lt;br /&gt;
&lt;br /&gt;
           [chirico@big ~]$ sa&lt;br /&gt;
           30       5.23re       0.00cp    10185k&lt;br /&gt;
           11       4.83re       0.00cp     8961k   ***other&lt;br /&gt;
            8       0.13re       0.00cp    19744k   nagios*&lt;br /&gt;
            4       0.00re       0.00cp     2542k   automount*&lt;br /&gt;
            3       0.00re       0.00cp      680k   sa&lt;br /&gt;
            2       0.13re       0.00cp    17424k   check_ping&lt;br /&gt;
            2       0.13re       0.00cp      978k   ping&lt;br /&gt;
&lt;br /&gt;
         To turn off accounting, execute accton without a filename.&lt;br /&gt;
&lt;br /&gt;
           $ accton&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 207:&lt;br /&gt;
&lt;br /&gt;
     CPU Temperature on a laptop. The following is the temperature&lt;br /&gt;
       of my Dell laptop. &lt;br /&gt;
&lt;br /&gt;
           $ cat /proc/acpi/thermal_zone/THM/temperature&lt;br /&gt;
           temperature:             58 C&lt;br /&gt;
&lt;br /&gt;
      &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 208:&lt;br /&gt;
&lt;br /&gt;
     script -f with mkfifo to allow another user to view what you type&lt;br /&gt;
          in real-time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Step 1.  Create a fifo (first in first out) file that the other&lt;br /&gt;
              user can view. For this example create the file /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
               [chirico@laptop ~]$ mkfifo /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
        Step 2.  Have the second user, voyeur user, cat this file. Output will block&lt;br /&gt;
              for them until you complete step 3. The other user, voyer,&lt;br /&gt;
              is executing the command below.&lt;br /&gt;
 &lt;br /&gt;
               [voyeur@laptop ~]$ cat /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
        Step 3.  The original user runs the following command.&lt;br /&gt;
&lt;br /&gt;
               [chirico@laptop ~]$ script -f  /tmp/scriptout&lt;br /&gt;
               Script started, file is /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
             Now anything typed, including a vi session, will be displayed to the&lt;br /&gt;
             voyeur user in step 2. &lt;br /&gt;
&lt;br /&gt;
        See TIP 46.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 209:&lt;br /&gt;
&lt;br /&gt;
     fsck forced on next reboot.  To do this, as root issue the following commands.&lt;br /&gt;
&lt;br /&gt;
            $ cd /&lt;br /&gt;
            $ touch forcefsck&lt;br /&gt;
&lt;br /&gt;
          Now reboot the system, and when it comes up fsck will be forced on the system.&lt;br /&gt;
&lt;br /&gt;
            $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 210:&lt;br /&gt;
&lt;br /&gt;
     /dev/random and /dev/urandom differ in their random generating properties. /dev/random&lt;br /&gt;
        only returns bytes when enough noise has been generated from the entropy pool. In&lt;br /&gt;
        contrast /dev/urandom will always return bytes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference: http://sourceforge.net/direct-dl/mchirico/cpearls/simple_but_common.tar.gz (rand.c)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 211:&lt;br /&gt;
&lt;br /&gt;
     Want to find out the speed of your NIC?  (Full Duplex or Half), then use ethtool.&lt;br /&gt;
&lt;br /&gt;
               [root@squeezel ~]# ethtool eth0&lt;br /&gt;
               Settings for eth0:&lt;br /&gt;
                       Supported ports: [ MII ]&lt;br /&gt;
                       Supported link modes:   10baseT/Half 10baseT/Full&lt;br /&gt;
                                               100baseT/Half 100baseT/Full&lt;br /&gt;
                                               1000baseT/Half 1000baseT/Full&lt;br /&gt;
                       Supports auto-negotiation: Yes&lt;br /&gt;
                       Advertised link modes:  10baseT/Half 10baseT/Full&lt;br /&gt;
                                               100baseT/Half 100baseT/Full&lt;br /&gt;
                                               1000baseT/Half 1000baseT/Full&lt;br /&gt;
                       Advertised auto-negotiation: Yes&lt;br /&gt;
                       Speed: 100Mb/s&lt;br /&gt;
                       Duplex: Full&lt;br /&gt;
                       Port: Twisted Pair&lt;br /&gt;
                       PHYAD: 1&lt;br /&gt;
                       Transceiver: internal&lt;br /&gt;
                       Auto-negotiation: on&lt;br /&gt;
                       Supports Wake-on: g&lt;br /&gt;
                       Wake-on: d&lt;br /&gt;
                       Current message level: 0x000000ff (255)&lt;br /&gt;
                       Link detected: yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 212:&lt;br /&gt;
&lt;br /&gt;
     rpm install hang? You might need to delete the lock state information. &lt;br /&gt;
&lt;br /&gt;
        $ nl /etc/rc.d/rc.sysinit | grep rpm&lt;br /&gt;
        720   rm -f /var/lib/rpm/__db* &amp;amp;&amp;gt; /dev/null&lt;br /&gt;
&lt;br /&gt;
     Note the command &lt;br /&gt;
&lt;br /&gt;
        $ rm -f /var/lib/rpm/__db*&lt;br /&gt;
&lt;br /&gt;
     Because sometimes you will run &amp;quot;rpm -ivh somerpm&amp;quot; and it will just sit&lt;br /&gt;
     there.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 213:&lt;br /&gt;
&lt;br /&gt;
     Apache - limit access to certain directories based on IP address in the&lt;br /&gt;
         httpd.conf file.&lt;br /&gt;
&lt;br /&gt;
          You can do this completely from /etc/httpd/conf/httpd.conf which&lt;br /&gt;
          are shown below for multiple IP addresses. Note that all 3 setting&lt;br /&gt;
          are the same.&lt;br /&gt;
&lt;br /&gt;
                10.0.0.0/255.0.0.0&lt;br /&gt;
                10.0.0.0/8&lt;br /&gt;
                10&lt;br /&gt;
&lt;br /&gt;
          However, the following is different&lt;br /&gt;
&lt;br /&gt;
                10.0.0.0/24   only allows 10.0.0.1 to 10.0.0.254&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Some complete settings in /etc/httpd/conf/httpd.conf &lt;br /&gt;
&lt;br /&gt;
             &amp;lt;Directory /var/www/html/chirico/&amp;gt;&lt;br /&gt;
                 Order allow,deny&lt;br /&gt;
                 Allow from 10.0.0.0/8      # All 10.&lt;br /&gt;
                 Allow from 192.168.0.0/16  # All 192.168&lt;br /&gt;
                 Allow from 127             # All 127.&lt;br /&gt;
             &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          Don't forget to reload httpd with the following command.&lt;br /&gt;
        &lt;br /&gt;
             $ /etc/init.d/httpd reload&lt;br /&gt;
&lt;br /&gt;
          &lt;br /&gt;
&lt;br /&gt;
TIP 214:&lt;br /&gt;
&lt;br /&gt;
     Open Files - determining how many files are currently open.&lt;br /&gt;
&lt;br /&gt;
             $ cat /proc/sys/fs/file-nr&lt;br /&gt;
             2030    263     104851&lt;br /&gt;
              |       |        \- maximum open file descriptors &lt;br /&gt;
              |       |         &lt;br /&gt;
              |       \- total free allocated file descriptors&lt;br /&gt;
              |&lt;br /&gt;
              (Total allocated file descriptors since boot)&lt;br /&gt;
&lt;br /&gt;
        Note the maximum number can be set or changed.&lt;br /&gt;
&lt;br /&gt;
              $ cat /proc/sys/fs/file-max&lt;br /&gt;
              104851&lt;br /&gt;
&lt;br /&gt;
        To change this&lt;br /&gt;
&lt;br /&gt;
              $ echo &amp;quot;804854&amp;quot; &amp;gt; /proc/sys/fs/file-max&lt;br /&gt;
 &lt;br /&gt;
        Note lsof | wc -l will report higher numbers because this includes&lt;br /&gt;
        open files that are not using file descriptors such as directories,&lt;br /&gt;
        memory mapped files, and executable text files.&lt;br /&gt;
&lt;br /&gt;
        (Reference http://www.netadmintools.com/art295.html&lt;br /&gt;
         and also see the man page for this: man 5 proc )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 215:&lt;br /&gt;
&lt;br /&gt;
     Ctrl-Alt-Del will cause an immediate reboot, without syncing dirty buffers by&lt;br /&gt;
     setting the value &amp;gt; 0 in /proc/sys/kernel/ctrl-alt-del.&lt;br /&gt;
&lt;br /&gt;
               $ echo 1 &amp;gt; /proc/sys/kernel/ctrl-alt-del&lt;br /&gt;
       &lt;br /&gt;
&lt;br /&gt;
        (Reference: man 5 proc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 216:&lt;br /&gt;
&lt;br /&gt;
     Redefining keys in X using xev and xmodmap.  The program xev, used in an X window &lt;br /&gt;
     terminal screen will display information on mouse movements, keys pressed and &lt;br /&gt;
     released.&lt;br /&gt;
&lt;br /&gt;
        $ xev&lt;br /&gt;
&lt;br /&gt;
     Now type shift-4 and you'll notice the event details below:&lt;br /&gt;
&lt;br /&gt;
        KeyPress event, serial 29, synthetic NO, window 0x3800001,&lt;br /&gt;
            root 0x60, subw 0x0, time 55307049, (418,242), root:(428,339),&lt;br /&gt;
            state 0x1, keycode 13 (keysym 0x24, dollar), same_screen YES,&lt;br /&gt;
            XLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
            XmbLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
            XFilterEvent returns: False&lt;br /&gt;
        &lt;br /&gt;
        KeyRelease event, serial 29, synthetic NO, window 0x3800001,&lt;br /&gt;
            root 0x60, subw 0x0, time 55307184, (418,242), root:(428,339),&lt;br /&gt;
            state 0x1, keycode 13 (keysym 0x24, dollar), same_screen YES,&lt;br /&gt;
            XLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
       &lt;br /&gt;
     So, if you want to redefine this key to say copyright, see (/usr/X11R6/include/X11/keysymdef.h)&lt;br /&gt;
     you would type the following.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 copyright'&lt;br /&gt;
&lt;br /&gt;
     To get the key back to the dollar, issue the following command.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 dollar'&lt;br /&gt;
&lt;br /&gt;
     By the way it's possible to define multiple key codes for a sigle key. You'll need&lt;br /&gt;
     to have a key defined as the Mode_switch. Perhaps you'd like to use the Windows key,&lt;br /&gt;
     or the key with the Microsoft logo on it, since you're using Linux. This key is&lt;br /&gt;
     keycode 115&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 115 = Mode_switch'&lt;br /&gt;
&lt;br /&gt;
     Now you could define 3 values to the shift-4. For this example use ld, Yen and dollar.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 dollar sterling yen'&lt;br /&gt;
&lt;br /&gt;
     So pressing the keys gives you the following:&lt;br /&gt;
&lt;br /&gt;
          shift-$          (dollar sign)&lt;br /&gt;
          Windows-$        (lb sign)&lt;br /&gt;
          Windows-shift-$  (Yen sign)&lt;br /&gt;
&lt;br /&gt;
     You could go crazy and redefine all you keys.&lt;br /&gt;
&lt;br /&gt;
     (Thanks to hisham for this tip).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 217:&lt;br /&gt;
&lt;br /&gt;
     Threads - which version of threads are you using?&lt;br /&gt;
&lt;br /&gt;
          $ getconf GNU_LIBPTHREAD_VERSION&lt;br /&gt;
          NPTL 2.3.90&lt;br /&gt;
&lt;br /&gt;
     For a history on threads used with gcc reference the following:&lt;br /&gt;
          &lt;br /&gt;
          http://en.wikipedia.org/wiki/NPTL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 218:&lt;br /&gt;
&lt;br /&gt;
     Screenshots using ImageMagick. &lt;br /&gt;
&lt;br /&gt;
        If you want the entire screen, execute the following:&lt;br /&gt;
&lt;br /&gt;
            $ import -window root screen.png&lt;br /&gt;
&lt;br /&gt;
        Or to crosshair select the region with your mouse, execute &lt;br /&gt;
        the following instead.&lt;br /&gt;
&lt;br /&gt;
            $ import screen.png&lt;br /&gt;
&lt;br /&gt;
        KDE has the ability to take screenshots with the command below.&lt;br /&gt;
&lt;br /&gt;
            $ ksnapshot&lt;br /&gt;
&lt;br /&gt;
        GNOME likewise has a command too.&lt;br /&gt;
&lt;br /&gt;
            $ gnome-panel-screenshot --delay 6&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Visting ImageMagick again, the xwininfo command give window information and the id can be&lt;br /&gt;
        used to capture images with the import command.&lt;br /&gt;
&lt;br /&gt;
            $ xwininfo&lt;br /&gt;
&lt;br /&gt;
          xwininfo: Please select the window about which you&lt;br /&gt;
          would like information by clicking the&lt;br /&gt;
          mouse in that window.&lt;br /&gt;
&lt;br /&gt;
          xwininfo: Window id: 0x1e00007 &amp;quot;chirico@squeezel:/work/svn/souptonuts - Shell - Konsole&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          Absolute upper-left X:  4&lt;br /&gt;
          Absolute upper-left Y:  21&lt;br /&gt;
          Relative upper-left X:  0&lt;br /&gt;
          Relative upper-left Y:  0&lt;br /&gt;
          Width: 880&lt;br /&gt;
          Height: 510&lt;br /&gt;
          Depth: 24&lt;br /&gt;
          Visual Class: TrueColor&lt;br /&gt;
          Border width: 0&lt;br /&gt;
          Class: InputOutput&lt;br /&gt;
          Colormap: 0x20 (installed)&lt;br /&gt;
          Bit Gravity State: NorthWestGravity&lt;br /&gt;
          Window Gravity State: NorthWestGravity&lt;br /&gt;
          Backing Store State: NotUseful&lt;br /&gt;
          Save Under State: no&lt;br /&gt;
          Map State: IsViewable&lt;br /&gt;
          Override Redirect State: no&lt;br /&gt;
          Corners:  +4+21  -396+21  -396-493  +4-493&lt;br /&gt;
          -geometry 880x510+0+0&lt;br /&gt;
&lt;br /&gt;
        Now use the import command with the Window id. My example is shown below.&lt;br /&gt;
&lt;br /&gt;
             $ import -window 0x1e00007  id.miff&lt;br /&gt;
&lt;br /&gt;
        And to quickly display this image that you just saved, use the display command.&lt;br /&gt;
&lt;br /&gt;
             $ display id.miff &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 219:&lt;br /&gt;
&lt;br /&gt;
     File Access over SSH using FUSE (Filesystem in USErspace). This is a very good way to &lt;br /&gt;
     mount a remote filesystem locally. It's  like a secure NFS mount, but you don't require &lt;br /&gt;
     admin privileges on the remote computer. You do need to have fuse-sshfs installed on &lt;br /&gt;
     the local computer that will perform the filesystem mount.&lt;br /&gt;
&lt;br /&gt;
     The following works with Fedora Core 5. Only the users added to the fuse group can mout &lt;br /&gt;
     external drives. Below the user chirico is being added to the group fuse.&lt;br /&gt;
&lt;br /&gt;
             $ yum install fuse-sshfs&lt;br /&gt;
             $ usermod -a -G fuse chirico&lt;br /&gt;
     &lt;br /&gt;
     You'll need to reboot.&lt;br /&gt;
&lt;br /&gt;
             $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
             &lt;br /&gt;
     Next I'm going to mount the remote filesystem v0.squeezel.com. This is done as user chirico&lt;br /&gt;
     on the local computer. I'm using root on the remote computer v0.squeezel.com because I&lt;br /&gt;
     want to mount the complete drive.&lt;br /&gt;
&lt;br /&gt;
             $ mkdir v0&lt;br /&gt;
             $ sshfs root@v0.squeezel.com:/  v0&lt;br /&gt;
             $ cd v0&lt;br /&gt;
             $ ls -l&lt;br /&gt;
               bin   dev  home  lost+found     media  mnt  opt   q     sbin     srv  tmp  var&lt;br /&gt;
               boot  etc  lib   master_backup  misc   net  proc  root  selinux  sys  usr&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
     Now to unmount the filesystem&lt;br /&gt;
&lt;br /&gt;
             $ fusermount -u /home/chirico/v0&lt;br /&gt;
&lt;br /&gt;
     Yes, you can mount the filesystem on boot. Below shows an example entry for /etc/fstab, but&lt;br /&gt;
     this only allows user on the current system to view what is is /mnt/v0. &lt;br /&gt;
&lt;br /&gt;
             sshfs#root@v0.squeezel.com:/var/log             /mnt/v0 fuse defaults    0 0&lt;br /&gt;
&lt;br /&gt;
     References:&lt;br /&gt;
        (http://fuse.sourceforge.net/sshfs.html)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 220:&lt;br /&gt;
&lt;br /&gt;
     OpenVPN - A full-featured SSL VPN solution. The following demonstrates&lt;br /&gt;
               a very simple OpenVPN setup between two Fedora Core 5 computers&lt;br /&gt;
               big.squeezel.com 192.168.1.12 and tape.squeezel.com 192.168.1.155&lt;br /&gt;
&lt;br /&gt;
               As root install the package on both computers.&lt;br /&gt;
&lt;br /&gt;
                  $ yum -y install openvpn&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Setup on big.squeezel.com 192.168.1.12&lt;br /&gt;
&lt;br /&gt;
                  $ iptables -A INPUT -p udp -s 192.168.1.155  --dport 1194 -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tun+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A FORWARD -i tap+ -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
             Note - make sure you have commented out the following line &lt;br /&gt;
                    in /etc/sysconfig/iptables&lt;br /&gt;
&lt;br /&gt;
                  # -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
&lt;br /&gt;
             Now from continuting with the commands that need to be executed on &lt;br /&gt;
             big.squeezel.com 192.168.1.12 do one of the following&lt;br /&gt;
           &lt;br /&gt;
                  $ openvpn --remote tape.squeezel.com  --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 --verb 9&lt;br /&gt;
&lt;br /&gt;
             The above statement gives lots of errors. Once it's working you may want&lt;br /&gt;
             the following statement without the --verb 9 option.&lt;br /&gt;
&lt;br /&gt;
                  $ openvpn --remote tape.squeezel.com  --dev tun1 --ifconfig 10.4.0.1 10.4.0.2&lt;br /&gt;
&lt;br /&gt;
             After you finish the setup commands for tape.squeezel.com immediately below, you'll be&lt;br /&gt;
             able to access tape.squeezel.com as 10.4.0.2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Setup on tape.squeezel.com 192.168.1.155&lt;br /&gt;
&lt;br /&gt;
                  $ iptables -A INPUT -p udp -s 192.168.1.12  --dport 1194 -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tun+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A FORWARD -i tap+ -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
             Note - again, make sure you have commented out the following line &lt;br /&gt;
                    in /etc/sysconfig/iptables&lt;br /&gt;
&lt;br /&gt;
                  # -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
&lt;br /&gt;
             The openvpn commands are tape.squeezel.com are reversed from what is shown&lt;br /&gt;
             above.&lt;br /&gt;
&lt;br /&gt;
                  $ openvpn --remote big.squeezel.com --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 --verb 9&lt;br /&gt;
&lt;br /&gt;
             Or&lt;br /&gt;
                  $ openvpn --remote big.squeezel.com --dev tun1 --ifconfig 10.4.0.2 10.4.0.1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             Now you can access all services and ports from big.squeezel.com on 10.4.0.1 for &lt;br /&gt;
             such services as MySQL, secure Web, imap, etc. A quick test is nmap as follows:&lt;br /&gt;
&lt;br /&gt;
                  $ nmap -A -T4 10.4.0.1&lt;br /&gt;
&lt;br /&gt;
                  Starting Nmap 4.03 ( http://www.insecure.org/nmap/ ) at 2006-05-20 13:54 EDT&lt;br /&gt;
                  Interesting ports on 10.4.0.1:&lt;br /&gt;
                  (The 1671 ports scanned but not shown below are in state: closed)&lt;br /&gt;
                  PORT     STATE SERVICE VERSION&lt;br /&gt;
                  22/tcp   open  ssh     OpenSSH 4.3 (protocol 2.0)&lt;br /&gt;
                  111/tcp  open  rpcbind  2 (rpc #100000)&lt;br /&gt;
                  3306/tcp open  mysql   MySQL (unauthorized)&lt;br /&gt;
&lt;br /&gt;
                  Nmap finished: 1 IP address (1 host up) scanned in 7.116 seconds&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 221:&lt;br /&gt;
&lt;br /&gt;
     openssl - Some common commands.&lt;br /&gt;
&lt;br /&gt;
             Finding the openssldir (Directory for OpenSSL files).&lt;br /&gt;
&lt;br /&gt;
                  $ openssl version -a|grep OPENSSLDIR&lt;br /&gt;
                  OPENSSLDIR: &amp;quot;/etc/pki/tls&amp;quot;&lt;br /&gt;
&lt;br /&gt;
             Connect to a secure SMTP server with STARTTLS, assuming the server name is&lt;br /&gt;
             squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
                  $ openssl s_client -connect squeezel.squeezel.com:25 -starttls&lt;br /&gt;
&lt;br /&gt;
         &lt;br /&gt;
&lt;br /&gt;
      Reference (http://www.madboa.com/geek/openssl/)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 222:&lt;br /&gt;
&lt;br /&gt;
     Bash functions. This is easy, and I find it very useful to create bash functions&lt;br /&gt;
     for repeated commands. For example, suppose you want to create a quick bash function&lt;br /&gt;
     to cd to /var/log, tail messages and tail secure. You can create this function as&lt;br /&gt;
     follows:&lt;br /&gt;
&lt;br /&gt;
                  [root@v5 log]# m()&lt;br /&gt;
                  m()&lt;br /&gt;
                  &amp;gt; { cd /var/log&lt;br /&gt;
                  { cd /var/log&lt;br /&gt;
                  &amp;gt; tail messages&lt;br /&gt;
                  tail messages&lt;br /&gt;
                  &amp;gt; tail secure&lt;br /&gt;
                  tail secure&lt;br /&gt;
                  &amp;gt; }&lt;br /&gt;
                  }&lt;br /&gt;
                  &lt;br /&gt;
     Above I'm typing m() then hitting return. Note the echo on the next line followed&lt;br /&gt;
     by the prompt &amp;gt;. I then enter {. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 223:&lt;br /&gt;
&lt;br /&gt;
     Stats on DNS Server. You can get stats on your DNS server. &lt;br /&gt;
&lt;br /&gt;
       The following works for BIND 9:&lt;br /&gt;
&lt;br /&gt;
                  $ rndc stats&lt;br /&gt;
&lt;br /&gt;
         On my system I see the output in &amp;quot;/var/named/chroot/var/named/data/named_stats.txt&amp;quot;, which&lt;br /&gt;
         if an FC4 system. By the way, if you're using BIND 8, the command is &amp;quot;ndc stats&amp;quot;, but that&lt;br /&gt;
         has a completely different format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Format of the output&lt;br /&gt;
&lt;br /&gt;
            +++ Statistics Dump +++ (1153791199)&lt;br /&gt;
            success 297621&lt;br /&gt;
            referral 32&lt;br /&gt;
            nxrrset 21953&lt;br /&gt;
            nxdomain 33742&lt;br /&gt;
            recursion 28243&lt;br /&gt;
            failure 54&lt;br /&gt;
            --- Statistics Dump --- (1153791199)&lt;br /&gt;
&lt;br /&gt;
      The number (1153791199) can be converted with the date command.&lt;br /&gt;
&lt;br /&gt;
                  $ date -d '1970-01-01 1153791199 sec'&lt;br /&gt;
                  Tue Jul 25 02:33:19 EDT 2006&lt;br /&gt;
&lt;br /&gt;
      That's 1153791199 seconds since 1970-01-01 UCT. Which is 4 hours fast,&lt;br /&gt;
      from EDT.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 224:&lt;br /&gt;
&lt;br /&gt;
     snmp - simple network monitoring protocol. The following steps setup snmp on Fedora Core 5.&lt;br /&gt;
&lt;br /&gt;
                  $ yum install net-snmp*&lt;br /&gt;
&lt;br /&gt;
         Next add the following line in &amp;quot;/etc/snmp/snmpd.conf&amp;quot; at the bottom.&lt;br /&gt;
&lt;br /&gt;
                  rocommunity pA33worD&lt;br /&gt;
&lt;br /&gt;
         Start the snmp service.&lt;br /&gt;
&lt;br /&gt;
                  $ /etc/init.d/snmpd restart&lt;br /&gt;
&lt;br /&gt;
         Once started, from the command prompt, it's possible to get stats on the computer.&lt;br /&gt;
&lt;br /&gt;
                  $ snmpwalk -v 1 -c pA33worD localhost system&lt;br /&gt;
         Or&lt;br /&gt;
                  $ snmpwalk -v 1 -c pA33worD localhost interface&lt;br /&gt;
&lt;br /&gt;
         Or&lt;br /&gt;
                  $ snmpgetnext -v 1 -c pA33worD localhost sysUpTime&lt;br /&gt;
                  DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (26452) 0:04:24.52&lt;br /&gt;
&lt;br /&gt;
         Note the Timeticks is in 100th of a second. So the computer above has been running&lt;br /&gt;
         for 264.52 seconds.&lt;br /&gt;
&lt;br /&gt;
         Reference( TIP 225 shows how to use MRTG for gathering snmp stats).&lt;br /&gt;
                  http://www.net-snmp.org/tutorial/tutorial-5/commands/snmpv3.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 225:&lt;br /&gt;
&lt;br /&gt;
     MRTG - Multi Router Traffic Grapher.  &lt;br /&gt;
&lt;br /&gt;
                  $ cfgmaker --output=/etc/mrtg/v5.squeezel.com \&lt;br /&gt;
                    ifref=ip --global &amp;quot;workdir:/var/www/html/mrtg/stats&amp;quot;\&lt;br /&gt;
                    pA33worD@v5.squeezel.com&lt;br /&gt;
&lt;br /&gt;
        Reference: http://www.chinalinuxpub.com/doc/www.siliconvalleyccie.com/linux-hn/mrtg.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 226:&lt;br /&gt;
&lt;br /&gt;
     Back Trace - This is a method of getting a back trace for all processes on the system.&lt;br /&gt;
                  it assumes the following: a. Kernel was build with CONFIG_MAGIC_SYS-REQ &lt;br /&gt;
                  enabled (which Fedora 5 kernels are) b. You can get direct access to the &lt;br /&gt;
                  monitor.&lt;br /&gt;
&lt;br /&gt;
             Step 1.&lt;br /&gt;
&lt;br /&gt;
                  Ctl-Alt-F1 (This brings you to the text console)&lt;br /&gt;
&lt;br /&gt;
             Step 2.&lt;br /&gt;
&lt;br /&gt;
                  Alt-ScrollLock &lt;br /&gt;
                  Ctl-ScrollLock&lt;br /&gt;
          &lt;br /&gt;
                  Note above that's Alt-ScrollLock followed by Ctl-ScrollLock. You should see&lt;br /&gt;
                  a lot of text on the screen. To fast to read, but don't worry the text will&lt;br /&gt;
                  be in /var/log/messages at the end.&lt;br /&gt;
&lt;br /&gt;
                  On my system the ScrollLock key is next to the NumLock key. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 227:&lt;br /&gt;
&lt;br /&gt;
     Ext3 Tuning - One advantage of Ext3 over Ext2 is directory indexing, which  imporves file&lt;br /&gt;
                  access in directories containing large files or when the directory contains&lt;br /&gt;
                  many files. Directory indexing improves performance by using hashed binary &lt;br /&gt;
                  trees. &lt;br /&gt;
&lt;br /&gt;
                  There are two ways to enable dir_index. First, find the device using the mount&lt;br /&gt;
                  command.&lt;br /&gt;
&lt;br /&gt;
                      $ mount&lt;br /&gt;
&lt;br /&gt;
                      /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)&lt;br /&gt;
                      proc on /proc type proc (rw)&lt;br /&gt;
                      sysfs on /sys type sysfs (rw)&lt;br /&gt;
                      devpts on /dev/pts type devpts (rw,gid=5,mode=620)&lt;br /&gt;
                      /dev/sda1 on /boot type ext3 (rw) &amp;lt;--- This is the one you want&lt;br /&gt;
                      tmpfs on /dev/shm type tmpfs (rw)&lt;br /&gt;
                      none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)&lt;br /&gt;
                      sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)&lt;br /&gt;
                      automount(pid2001) on /net type autofs (rw,fd=4,pgrp=2001,minproto=2,maxproto=4)                   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                  From the above command, the device used is /dev/sda1.  Using the tune2fs command,&lt;br /&gt;
                  directory indexing will only apply to directories created after running the &lt;br /&gt;
                  command below.               &lt;br /&gt;
&lt;br /&gt;
                       $ tune2fs -O dir_index /dev/sda1&lt;br /&gt;
&lt;br /&gt;
                  However, if you want it to apply to all directories, use the e2fsck command as  &lt;br /&gt;
                  shown below:&lt;br /&gt;
&lt;br /&gt;
                       $ e2fsck -D -f /dev/sda1&lt;br /&gt;
&lt;br /&gt;
                  You'll need to bypass the warning message.&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
     Reference: &amp;quot;Tuning Journaling File Systems: A small amount of effort an dtime can yield big&lt;br /&gt;
                results&amp;quot;,by Steve Best. Linux Magazine, September 10, 2006. This author as has&lt;br /&gt;
                a very good book titled: &amp;quot;Linux Debugging and Performance Tuning.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 228:&lt;br /&gt;
&lt;br /&gt;
     NIC bonding - binding two or more NICs to one IP address to improve performance. The following&lt;br /&gt;
                instructions were done on Fedora Core 5.&lt;br /&gt;
&lt;br /&gt;
         Step 1.&lt;br /&gt;
             &lt;br /&gt;
            Create the file ifcfg-bond0 with the IP address, netmask and gateway. Shown&lt;br /&gt;
            below is my file.&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-bond0&lt;br /&gt;
&lt;br /&gt;
                   DEVICE=bond0&lt;br /&gt;
                   IPADDR=192.168.1.12&lt;br /&gt;
                   NETMASK=255.255.255.0&lt;br /&gt;
                   GATEWAY=192.168.1.1&lt;br /&gt;
                   USERCTL=no&lt;br /&gt;
                   BOOTPROTO=none&lt;br /&gt;
                   ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
         Step 2.&lt;br /&gt;
&lt;br /&gt;
            Modify eth0, eth1 and eth2. Shown below are each one of my files. Note that&lt;br /&gt;
            you must comment out, or remove the ip address, netmask, gateway and hardware&lt;br /&gt;
            address from each one of these files, since settings should only come from&lt;br /&gt;
            the ifcfg-bond0 file above. I've chosen to comment out the lines, instead of &lt;br /&gt;
            removing, should I decide to unbond my NICS sometime in the future.&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth0&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:9D&lt;br /&gt;
                  #IPADDR=192.168.1.12&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  #GATEWAY=192.168.1.1&lt;br /&gt;
                  #USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  # Settings for Bond&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth1&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth1&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:C9&lt;br /&gt;
                  #IPADDR=192.168.1.13&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  #&lt;br /&gt;
                  # Settings for bonding&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth2&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth2&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:9D&lt;br /&gt;
                  #IPADDR=192.168.1.12&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  #GATEWAY=192.168.1.1&lt;br /&gt;
                  #USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
         Step 3.&lt;br /&gt;
&lt;br /&gt;
            Set the load parameters for bond0 bonding kernel module. Append the&lt;br /&gt;
            following lines to /etc/modprobe.conf &lt;br /&gt;
&lt;br /&gt;
                 # bonding commands &lt;br /&gt;
                 alias bond0 bonding&lt;br /&gt;
                 options bond0 mode=balance-alb miimon=100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Step 4.&lt;br /&gt;
&lt;br /&gt;
            Load the bond driver module from the command prompt.&lt;br /&gt;
&lt;br /&gt;
                 $ modprobe bonding&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Step 5.&lt;br /&gt;
&lt;br /&gt;
            Restart the network, or restart the computer. Note I restarted to computer,&lt;br /&gt;
            since my NICs above had MAC assignments.&lt;br /&gt;
&lt;br /&gt;
                 $ service network restart   # Or restart computer&lt;br /&gt;
&lt;br /&gt;
             Take a look at the proc settings. &lt;br /&gt;
&lt;br /&gt;
                 $ cat /proc/net/bonding/bond0 &lt;br /&gt;
                 Ethernet Channel Bonding Driver: v3.0.3 (March 23, 2006)&lt;br /&gt;
&lt;br /&gt;
                 Bonding Mode: adaptive load balancing&lt;br /&gt;
                 Primary Slave: None&lt;br /&gt;
                 Currently Active Slave: eth2&lt;br /&gt;
                 MII Status: up&lt;br /&gt;
                 MII Polling Interval (ms): 100&lt;br /&gt;
                 Up Delay (ms): 0&lt;br /&gt;
                 Down Delay (ms): 0&lt;br /&gt;
&lt;br /&gt;
                 Slave Interface: eth2&lt;br /&gt;
                 MII Status: up&lt;br /&gt;
                 Link Failure Count: 0&lt;br /&gt;
                 Permanent HW addr: 00:13:72:80:62:f0&lt;br /&gt;
            &lt;br /&gt;
     References:&lt;br /&gt;
&lt;br /&gt;
         http://www.cyberciti.biz/nixcraft/vivek/blogger/2006/04/linux-bond-or-team-multiple-network.php&lt;br /&gt;
          Good, well written article describing the steps above.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=24692&amp;amp;package_id=146474&lt;br /&gt;
          Documentation for bonding that can also be found in the kernel&lt;br /&gt;
          ./Documentation/networking/bonding.txt&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 229:&lt;br /&gt;
&lt;br /&gt;
     /etc/nsswitch.conf - System Databases and Name Service Switch configuration file. &lt;br /&gt;
&lt;br /&gt;
         This file determines lookup order of services. For example, to match a name&lt;br /&gt;
         to an IP address, an entry can be put into the /etc/hosts file. Or a DNS query&lt;br /&gt;
         can be made. What's the order?  Normally, it's the entry in the /etc/hosts file.&lt;br /&gt;
         because /etc/nsswitch.conf contains the following setting&lt;br /&gt;
        &lt;br /&gt;
            hosts:      files dns&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	 See man nsswitch.conf for more settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
THE FOLLOWING SECTIONS STARTS THE PROGRAMMING TIPS&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 1:&lt;br /&gt;
&lt;br /&gt;
     Simple open command that restarts the close if a signal&lt;br /&gt;
     occurs.  Also note, the POSIX standards committee decided&lt;br /&gt;
     all new functions would not use errno and would instead&lt;br /&gt;
     directly return the error number in the function.&lt;br /&gt;
&lt;br /&gt;
     A lot of functions return -1 on an error condition, then,&lt;br /&gt;
     set errno to the value of the error.  This will still work&lt;br /&gt;
     for all the well known functions; but, it's changing.&lt;br /&gt;
&lt;br /&gt;
     /* start of code open.c&lt;br /&gt;
        Compile gcc -o open open.c&lt;br /&gt;
&lt;br /&gt;
        Reference (Look for simple_but_common_x.x.x.tar.gz):&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79066&lt;br /&gt;
&lt;br /&gt;
                             */&lt;br /&gt;
     #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     #include &amp;lt;string.h&amp;gt;             /* for strerror(int errno) */&lt;br /&gt;
     #include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     #define BUFLEN 100&lt;br /&gt;
     extern int errno;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     int&lt;br /&gt;
     main (void)&lt;br /&gt;
     {&lt;br /&gt;
       int fp,error;&lt;br /&gt;
       char buf[BUFLEN+1];&lt;br /&gt;
&lt;br /&gt;
       if ((fp = open (&amp;quot;data&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1)&lt;br /&gt;
         {&lt;br /&gt;
           fprintf (stderr, &amp;quot;Can't open data: %s\n&amp;quot;, strerror (errno));&lt;br /&gt;
           return 1;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
       snprintf (buf, BUFLEN, &amp;quot;123&amp;quot;);&lt;br /&gt;
       write (fp, buf, strlen (buf));&lt;br /&gt;
&lt;br /&gt;
       // Restart close should a signal occur */&lt;br /&gt;
       while((( error = close (fp) ) == -1) &amp;amp;&amp;amp; (errno == EINTR));&lt;br /&gt;
       if(error == -1)&lt;br /&gt;
         perror(&amp;quot;Failed to close the file\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
       return 0;&lt;br /&gt;
      }&lt;br /&gt;
     /* end of open.c */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 2:&lt;br /&gt;
&lt;br /&gt;
     Example of setting the effective UID on a file&lt;br /&gt;
&lt;br /&gt;
     /*  start of code&lt;br /&gt;
       gcc uid_open.c -o uid_open&lt;br /&gt;
       su&lt;br /&gt;
       chown root.chirico uid_open&lt;br /&gt;
       chmod u+s uid_open&lt;br /&gt;
       exit&lt;br /&gt;
&lt;br /&gt;
       Now you can run this as chirico and write to the&lt;br /&gt;
       root directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     */&lt;br /&gt;
     #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;string.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     int main()&lt;br /&gt;
     {&lt;br /&gt;
             int fd;&lt;br /&gt;
&lt;br /&gt;
             if ((fd = open(&amp;quot;/root/datajunk&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1) {&lt;br /&gt;
                     fprintf(stderr, &amp;quot;Can't open file \n&amp;quot;);&lt;br /&gt;
                     return 1;&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
             write(fd, &amp;quot;0123456&amp;quot;, strlen(&amp;quot;0123456&amp;quot;));&lt;br /&gt;
             close(fd);&lt;br /&gt;
             return 0;&lt;br /&gt;
     }&lt;br /&gt;
&lt;br /&gt;
     /* end of code */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 3:&lt;br /&gt;
&lt;br /&gt;
     Writing a C http post.&lt;br /&gt;
&lt;br /&gt;
     For downloads reference:&lt;br /&gt;
      http://prdownloads.sourceforge.net/cpearls/spider.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 4:&lt;br /&gt;
&lt;br /&gt;
     Writing a 2.6.x Kernel Module:&lt;br /&gt;
&lt;br /&gt;
       Look for the latest version of &amp;quot;procreadwrite&amp;quot;.  This is a 2.6 kernel&lt;br /&gt;
       modules that demonstrates how to create /proc entires and write directly&lt;br /&gt;
       to user-land via tty.  It's updated to reflect replacement of &amp;quot;current-&amp;gt;tty&amp;quot;&lt;br /&gt;
       with &amp;quot;current-&amp;gt;signal-&amp;gt;tty&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79066&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 5:&lt;br /&gt;
&lt;br /&gt;
     Creating a filename with '\n'.  This goes with (TIP 71)&lt;br /&gt;
&lt;br /&gt;
         /**** topen.c ***********************************************************&lt;br /&gt;
           Filenames can be created with any character except the null character&lt;br /&gt;
           and a slash.&lt;br /&gt;
&lt;br /&gt;
           This example creates a file with returns '\n\n'&lt;br /&gt;
&lt;br /&gt;
           There's a way to remove a file by inode:&lt;br /&gt;
&lt;br /&gt;
               $ ls -libt *&lt;br /&gt;
&lt;br /&gt;
           And, once you know the inode&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec mv '{}' goodstuff \;&lt;br /&gt;
&lt;br /&gt;
           or&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec rm '{}' goodstuff \;&lt;br /&gt;
&lt;br /&gt;
           or&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec cat '{}' \;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Compile:&lt;br /&gt;
&lt;br /&gt;
             gcc -o topen -Wall -W -O2 -s -pipe  topen.c&lt;br /&gt;
&lt;br /&gt;
         Reference:&lt;br /&gt;
           http://prdownloads.sourceforge.net/cpearls/simple_but_common_0.0.14.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
         */&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         #include &amp;lt;string.h&amp;gt;             /* for strerror(int errno) */&lt;br /&gt;
         #include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         #define BUFLEN 100&lt;br /&gt;
         extern int errno;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         int&lt;br /&gt;
         main (void)&lt;br /&gt;
         {&lt;br /&gt;
           int fp,error;&lt;br /&gt;
           char buf[BUFLEN+1];&lt;br /&gt;
&lt;br /&gt;
           if ((fp = open (&amp;quot;\n\n\n\n\n\n\n\n\n&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1)&lt;br /&gt;
             {&lt;br /&gt;
               fprintf (stderr, &amp;quot;Can't open data: %s\n&amp;quot;, strerror (errno));&lt;br /&gt;
               return 1;&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
           snprintf (buf, BUFLEN, &amp;quot;123&amp;quot;);&lt;br /&gt;
           write (fp, buf, strlen (buf));&lt;br /&gt;
&lt;br /&gt;
           // Restart close should a signal occur */&lt;br /&gt;
           while((( error = close (fp) ) == -1) &amp;amp;&amp;amp; (errno == EINTR));&lt;br /&gt;
           if(error == -1)&lt;br /&gt;
             perror(&amp;quot;Failed to close the file\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
           return 0;&lt;br /&gt;
&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  **Note, if you want email notification after every 50 new tips have been&lt;br /&gt;
    added, then, click on the following link:&lt;br /&gt;
&lt;br /&gt;
     https://sourceforge.net/project/filemodule_monitor.php?filemodule_id=120838&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 6:&lt;br /&gt;
&lt;br /&gt;
     Working With The Lemon Parser Generator.&lt;br /&gt;
     http://prdownloads.sourceforge.net/souptonuts/lemon_examples.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 7:&lt;br /&gt;
&lt;br /&gt;
     copy command for std container output.&lt;br /&gt;
&lt;br /&gt;
        #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
        #include &amp;lt;list&amp;gt;&lt;br /&gt;
        #include &amp;lt;vector&amp;gt;&lt;br /&gt;
        #include &amp;lt;iterator&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        using namespace std;&lt;br /&gt;
        int main(void)&lt;br /&gt;
        {&lt;br /&gt;
          vector&amp;lt;int&amp;gt; v;&lt;br /&gt;
          list&amp;lt;int&amp;gt; l;&lt;br /&gt;
&lt;br /&gt;
          v.push_back(1);&lt;br /&gt;
          v.push_back(2);&lt;br /&gt;
          copy(v.begin(),v.end(),ostream_iterator&amp;lt;int&amp;gt;(cout,&amp;quot;\n&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          l.push_back(23);&lt;br /&gt;
          l.push_back(12);&lt;br /&gt;
          copy(l.begin(),l.end(),ostream_iterator&amp;lt;int&amp;gt;(cout,&amp;quot;\n&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 8:&lt;br /&gt;
&lt;br /&gt;
  /* Copyright (c) 2005 Mike Chirico mchirico@comcast.net mchirico@users.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Example of using virtual functions. Note the use of &amp;quot;initialization lists&amp;quot;&lt;br /&gt;
              for assinging the variable first and last.&lt;br /&gt;
&lt;br /&gt;
      Compile:&lt;br /&gt;
        g++ -o virtualfunc -Wall -W -O2 -s -pipe  virtual_function.cc&lt;br /&gt;
&lt;br /&gt;
      Download:&lt;br /&gt;
        http://prdownloads.sourceforge.net/cpearls/simple_but_common_cpp.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  */&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
  #include &amp;lt;string&amp;gt;&lt;br /&gt;
  #include &amp;lt;list&amp;gt;&lt;br /&gt;
  #include &amp;lt;algorithm&amp;gt;&lt;br /&gt;
  #include &amp;lt;iterator&amp;gt;&lt;br /&gt;
  #include &amp;lt;functional&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  using namespace std;&lt;br /&gt;
&lt;br /&gt;
  class Employee {&lt;br /&gt;
  string first,last;&lt;br /&gt;
  public:&lt;br /&gt;
    Employee(const string&amp;amp; fn=&amp;quot;John&amp;quot;,const  string&amp;amp; ln=&amp;quot;Smith&amp;quot;): first(fn),last(ln) {}&lt;br /&gt;
    virtual void print() const {&lt;br /&gt;
    cout &amp;lt;&amp;lt; &amp;quot;First name: &amp;quot; &amp;lt;&amp;lt; first &amp;lt;&amp;lt; &amp;quot;, Last name: &amp;quot; &amp;lt;&amp;lt; last &amp;lt;&amp;lt; endl;&lt;br /&gt;
    }&lt;br /&gt;
    virtual ~Employee() {}&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  class Manager : public Employee {&lt;br /&gt;
    int level;&lt;br /&gt;
    list&amp;lt;Employee*&amp;gt; subordinates;&lt;br /&gt;
  public:&lt;br /&gt;
    Manager(const string&amp;amp; fn=&amp;quot;Ivan&amp;quot;,const string&amp;amp; ln=&amp;quot;Stedwick&amp;quot;, int lvl=1): Employee(fn,ln), level(lvl) {}&lt;br /&gt;
    void print() {&lt;br /&gt;
      cout &amp;lt;&amp;lt; &amp;quot;Manager level: &amp;quot; &amp;lt;&amp;lt; level &amp;lt;&amp;lt; &amp;quot;  &amp;quot;;&lt;br /&gt;
      Employee::print();&lt;br /&gt;
      cout &amp;lt;&amp;lt; &amp;quot;Supervises:&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
      for_each(subordinates.begin(),subordinates.end(),mem_fun(&amp;amp;Employee::print));&lt;br /&gt;
      cout &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; endl;&lt;br /&gt;
    }&lt;br /&gt;
    void addstaff(Employee&amp;amp; staff){&lt;br /&gt;
      subordinates.push_front(&amp;amp;staff);&lt;br /&gt;
    }&lt;br /&gt;
    void addstaff(Employee* staff){&lt;br /&gt;
      subordinates.push_front(staff);&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   int main()&lt;br /&gt;
   {&lt;br /&gt;
     Employee p0(&amp;quot;Lisa&amp;quot;,&amp;quot;Payne&amp;quot;);&lt;br /&gt;
     Manager m0;&lt;br /&gt;
&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Zoe&amp;quot;,&amp;quot;Bear&amp;quot;)); /* uses void addstaff(Employee* staff) */&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Leah&amp;quot;,&amp;quot;Bopper&amp;quot;));&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Abby&amp;quot;,&amp;quot;Chicken&amp;quot;));&lt;br /&gt;
     m0.addstaff(p0);  /* void addstaff(Employee&amp;amp; staff)  needed for this one */&lt;br /&gt;
     m0.addstaff(new Employee());&lt;br /&gt;
     m0.print();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     return 0;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 9:&lt;br /&gt;
&lt;br /&gt;
   /*  Named Constructor Idiom.&lt;br /&gt;
       Reference: http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.6&lt;br /&gt;
&lt;br /&gt;
   */&lt;br /&gt;
   #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
   #include &amp;lt;cmath&amp;gt;&lt;br /&gt;
   using namespace std;&lt;br /&gt;
&lt;br /&gt;
   class Point {&lt;br /&gt;
&lt;br /&gt;
   public:&lt;br /&gt;
     static Point rectangular(float x, float y);&lt;br /&gt;
     static Point polar(float radius, float angle);&lt;br /&gt;
     float get_x() { return x_; }&lt;br /&gt;
     float get_y() { return y_; }&lt;br /&gt;
&lt;br /&gt;
   private:&lt;br /&gt;
     Point(float x, float y);&lt;br /&gt;
     float x_, y_;&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
   inline Point::Point(float x, float y)&lt;br /&gt;
     : x_(x), y_(y) {}&lt;br /&gt;
&lt;br /&gt;
   inline Point Point::rectangular(float x, float y)&lt;br /&gt;
   { return Point(x,y); }&lt;br /&gt;
&lt;br /&gt;
   inline Point Point::polar(float radius, float angle)&lt;br /&gt;
   { return Point(radius*cos(angle),radius*sin(angle)); }&lt;br /&gt;
&lt;br /&gt;
   int main(void)&lt;br /&gt;
   {&lt;br /&gt;
     Point p1 = Point::rectangular(5.7,1.2);&lt;br /&gt;
     Point p2 = Point::polar(5.7,1.2);&lt;br /&gt;
&lt;br /&gt;
     cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; p1.get_x() &amp;lt;&amp;lt; &amp;quot;, &amp;quot; &amp;lt;&amp;lt; p1.get_y() &amp;lt;&amp;lt; &amp;quot;)&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
     cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; p2.get_x() &amp;lt;&amp;lt; &amp;quot;, &amp;quot; &amp;lt;&amp;lt; p2.get_y() &amp;lt;&amp;lt; &amp;quot;)&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 10:&lt;br /&gt;
&lt;br /&gt;
   /* Copy_constructor_assignment.cc&lt;br /&gt;
      Copyright (c) 2004 GPL Mike Chirico, mchirico@comcast.net or mchirico@users.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
      Reference: &amp;quot;The C++ Programming Language&amp;quot;, 3rd ed, by Stroustrup&lt;br /&gt;
      pg. 246.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Download:&lt;br /&gt;
      http://prdownloads.sourceforge.net/cpearls/simple_but_common.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
   */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   class Name {&lt;br /&gt;
   public:&lt;br /&gt;
     char* s;&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   class Table {&lt;br /&gt;
     Name *p;&lt;br /&gt;
     size_t sz;&lt;br /&gt;
   public:&lt;br /&gt;
     Table(size_t s=15) {&lt;br /&gt;
               p = new Name[sz=s];&lt;br /&gt;
               for(size_t i=0; i&amp;lt; sz; ++i) p[i].s=&amp;quot;****&amp;quot;;&lt;br /&gt;
                          }&lt;br /&gt;
     Table(const Table &amp;amp;t);&lt;br /&gt;
     Table&amp;amp; operator=(const Table&amp;amp;);&lt;br /&gt;
     int prt();&lt;br /&gt;
     void asgn(char* ts,size_t index);&lt;br /&gt;
     ~Table(){ delete[] p; }&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Table&amp;amp; Table::operator=(const Table &amp;amp;t)&lt;br /&gt;
   {&lt;br /&gt;
     if( this != &amp;amp;t) {&lt;br /&gt;
       delete[] p;&lt;br /&gt;
       p = new Name[sz=t.sz];&lt;br /&gt;
       for(size_t i=0; i&amp;lt; t.sz; ++i) p[i]=t.p[i];&lt;br /&gt;
     }&lt;br /&gt;
     return *this;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   int Table::prt()&lt;br /&gt;
   {&lt;br /&gt;
     for(size_t i=0; i&amp;lt; sz; ++i) std::cout &amp;lt;&amp;lt; p[i].s &amp;lt;&amp;lt; &amp;quot; &amp;quot;;&lt;br /&gt;
     std::cout &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
     return 0;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   /*&lt;br /&gt;
     asgn will increase the array of strings, if needed&lt;br /&gt;
     to size index+1, and add the string ts to position&lt;br /&gt;
     index.&lt;br /&gt;
   */&lt;br /&gt;
   void Table::asgn(char* ts,size_t index)&lt;br /&gt;
   {&lt;br /&gt;
     if(index &amp;lt; sz ) {&lt;br /&gt;
        p[index].s=ts;&lt;br /&gt;
     }else if ( index &amp;gt;= sz ){&lt;br /&gt;
        Name *tp;&lt;br /&gt;
        tp=p;&lt;br /&gt;
&lt;br /&gt;
        p = new Name[index+1];&lt;br /&gt;
&lt;br /&gt;
        for(size_t i=0; i&amp;lt; sz; ++i) p[i].s=tp[i].s;&lt;br /&gt;
        delete [] tp;&lt;br /&gt;
        for(size_t i=sz; i &amp;lt; index; ++i)p[i].s=&amp;quot;****&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
        p[index].s=ts;&lt;br /&gt;
        sz=index+1;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   int main(void)&lt;br /&gt;
   {&lt;br /&gt;
&lt;br /&gt;
     Table t1;&lt;br /&gt;
     Table t2(5);&lt;br /&gt;
&lt;br /&gt;
     // this is bigger than initial sz&lt;br /&gt;
     t1.asgn(&amp;quot;myname&amp;quot;,20);&lt;br /&gt;
     t1.prt();&lt;br /&gt;
     t2.prt();&lt;br /&gt;
&lt;br /&gt;
     t1=t2;&lt;br /&gt;
&lt;br /&gt;
     t1.prt();&lt;br /&gt;
     t2.prt();&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REFERENCES:&lt;br /&gt;
&lt;br /&gt;
  (1)  http://www.tldp.org/LDP/abs/html/index.html&lt;br /&gt;
  (2)  http://www.shelldorado.com/&lt;br /&gt;
  (3)  http://www.faqs.org/ftp/usenet/news.answers/unix-faq/faq/part1&lt;br /&gt;
  (4)  http://www-106.ibm.com/developerworks/library/l-rpm1/&lt;br /&gt;
  (5)  http://www-136.ibm.com/developerworks/linux/&lt;br /&gt;
  (6)  http://www.gnu.org/manual/manual.html&lt;br /&gt;
  (7)  http://fedora.redhat.com/&lt;br /&gt;
  (8)  http://souptonuts.sourceforge.net/chirico/index.php&lt;br /&gt;
  (9)  http://www.faqs.org/faqs/&lt;br /&gt;
 (10)  http://www.faqs.org/docs/linux_network/&lt;br /&gt;
 (11)  http://www.tml.hut.fi/~viu/linux/sag/sag-0.6.2.html/index.html&lt;br /&gt;
 (12)  http://www.yolinux.com/TUTORIALS/LinuxTutorialSysAdmin.html&lt;br /&gt;
 (13)  http://sed.sourceforge.net/grabbag/scripts/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  SUMMARY:&lt;br /&gt;
   (1)(2)(3) Excellent resource for bash scripts.&lt;br /&gt;
   (4)       rpm resource&lt;br /&gt;
   (6)       GNU Manuals Online&lt;br /&gt;
   (7)       Fedora&lt;br /&gt;
   (8)       Authors Website&lt;br /&gt;
   (11)(12)  System Admin&lt;br /&gt;
   (13)      Excellent source of sed scripts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
HIGHLY RECOMMENDED BOOKS:&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX Network Programming, The Sockets Networking API&amp;quot;, Volume 1, Third Edition.&lt;br /&gt;
        W. Richard Stevens, Bill Fenner, Andrew M. Rudoff.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX Network Programming, Interprocess Communications&amp;quot;, Volume 2, Second Edition.&lt;br /&gt;
        W. Richard Stevens.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX SYSTEMS Programming, Communication, Concurrency, and Threads&amp;quot;, Kay A. Robbins,&lt;br /&gt;
        Steven Robbins&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming with POSIX Threads&amp;quot;, David R. Butenhof. Addison-Wesley&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;The C++ Programming Language&amp;quot; Third Edition. Bjarne Stroustrup. Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C Programming Language&amp;quot; (2nd Edition), Second Edition, Kernighan and Ritchie&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Advanced Linux Programming&amp;quot; by Mark Mitchell, Jeffrey Oldham, and Alex Samuel, of&lt;br /&gt;
        CodeSourcery LL. This book if free at the following resource:&lt;br /&gt;
        http://www.advancedlinuxprogramming.com/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Accelerated C++, Practical Programming by Example&amp;quot; Andrew Koenig, Barbara E. Moo.&lt;br /&gt;
        Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C: A Reference Manual&amp;quot;, Fifth Edition, Samuel P. Harbison, Guy L. Steele.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Standard Library: A Tutorial and Reference, The&amp;quot;, Nicolai M. Josuttis. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Templates: The Complete Guide&amp;quot;, David Vandevoorde, Nicolai M. Josuttis. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Exceptional C++: 47 Engineering Puzzles, Programming Problems, and Solutions&amp;quot;, Herb Sutter.&lt;br /&gt;
     Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;More Exceptional C++&amp;quot;, Herb Sutter.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Exceptional C++ Style: 40 New Engineering Puzzles, Programming Problems, and Solutions&amp;quot;,&lt;br /&gt;
       Herb Sutter. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;The Art of Computer Programming (TAOCP)&amp;quot;, Vol 1,Vol 2, Vol 3. Donald E. Knuth. Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming Perl, 3rd Edition&amp;quot;, Tom Christiansen, Jon Orwant, Larry Wall. O'Reilly.&lt;br /&gt;
       http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming from the Ground Up&amp;quot;, Jonathan Bartlett, Edited by Dominick Bruno, Jr.&lt;br /&gt;
       http://savannah.nongnu.org/download/pgubook/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Expert C Programming&amp;quot;, Peter van der Linden, Prentice Hall PTR.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Coding Standards 101 Rules, Guidelines, and Best Practices&amp;quot;, by Herb Sutter and&lt;br /&gt;
       Andrei Alexandrescu.  http://www.gotw.ca/publications/c++cs/bibliography.htm&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Linux Kernel Development: A practical guide to the design and implementation of&lt;br /&gt;
       the Linux kernel&amp;quot;, by Robert Love, Sams Publishing.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond&amp;quot;, by&lt;br /&gt;
       David Abrahams and Aleksey Gurtovoy. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
HIGHLY RECOMMENDED: PHILOSOPHICAL&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;Zen and the Art of Motorcycle Maintenance: An Inquiry into Values&amp;quot;, Robert Pirsig.&lt;br /&gt;
        http://www.virtualschool.edu/mon/Quality/PirsigZen/index.html&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;Lila: An Inquiry Into Morals&amp;quot;, Robert Pirsig.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RECOMMENDED BOOKS:&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Structure and Interpretation of Computer Programs&amp;quot;, Harold Abelson, Gerald Jay Sussman,&lt;br /&gt;
      Julie Sussman. This book is free:&lt;br /&gt;
        http://mitpress.mit.edu/sicp/full-text/book/book.html&lt;br /&gt;
              and&lt;br /&gt;
        http://www.gnu.org/software/mit-scheme/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RECOMMENDED HOTOS:&lt;br /&gt;
&lt;br /&gt;
    Linux Networking-HOWTO (Previously the Net-3 Howto)&lt;br /&gt;
     http://en.tldp.org/HOWTO/NET3-4-HOWTO.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CORRECTIONS:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following people made suggestions and corrections:&lt;br /&gt;
  - Jorge Fabregas &amp;lt;fabregasj@prtc.net&amp;gt; TIP 21&lt;br /&gt;
  - Malcolm Parsons &amp;lt;malcolm.parsons@gmail.com&amp;gt; TIP 44&lt;br /&gt;
  - Andreas Haunschmidt &amp;lt;Andreas.Haunschmidt@utanet.at&amp;gt; TIP 102, TIP 90&lt;br /&gt;
  - P@draigBrady.com (Following links )&lt;br /&gt;
  - Jacques.GARNIER-EXTERIEUR@EU.RHODIA.COM TIP 46&lt;br /&gt;
&lt;br /&gt;
                http://www.pixelbeat.org/cmdline.html&lt;br /&gt;
                http://www.pixelbeat.org/rotagator/linux.tips/rotagator.fortune&lt;br /&gt;
                http://www.pixelbeat.org/scripts/&lt;br /&gt;
&lt;br /&gt;
  - Tobias Nix &amp;lt;tobias.nix@gmail.com&amp;gt; TIP 12&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>C4tboCcdro</name></author>	</entry>

	<entry>
		<id>https://wiki.gacq.com/index.php?title=Linux_tips&amp;diff=2771</id>
		<title>Linux tips</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacq.com/index.php?title=Linux_tips&amp;diff=2771"/>
				<updated>2009-01-11T00:22:44Z</updated>
		
		<summary type="html">&lt;p&gt;C4tboCcdro: http://sematild.qsh.eu/resource1340.htm&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://sematild.qsh.eu/resource1340.htm soul keeper movie] [http://releltl.0lx.net/20081119-jump-london-video.html jump london video download] [http://brc4tdro.is-the-boss.com/page940.html photo2dvd studio3 serial] [http://tulilre.strefa.pl/2008-12-29-nothing-but.html nothing but mammals music video] [http://zelgetgo.0lx.net/new1704.htm electra movie wallpaper] &lt;br /&gt;
[http://fademon.0lx.net/article-600.htm jordan capri sample movies] [http://caraines.qsh.eu/cencob.htm latest nigerian movies] [http://varpasz.is-the-boss.com/article189.htm estate license per real state] [http://qasletop.is-the-boss.com/letoracn.html angel season 1 torrent] [http://naceceli.qsh.eu/page1465.html ninja video game] &lt;br /&gt;
[http://bukgetert.0lx.net/article-1659.htm skinny dipping videos] [http://ettaelt.strefa.pl/news-1716.html actor male movie] [http://mahohmie.qsh.eu/resource776.htm quotes from the movie stick it] [http://zelfibu.strefa.pl/korolald-1009.html movie online show tv watch] [http://acsitzar.0lx.net/news-jennifer-aniston-2008-11-10.html jennifer aniston video clip] &lt;br /&gt;
[http://bukgetert.0lx.net/article-287.htm sad movies always make me cry] [http://tarobasal.strefa.pl/sitemap.htm webmap] [http://betheres.qsh.eu/comment-141.htm revolutionary war movies] [http://dronoubr.0lx.net/angelina-antonio.html angelina antonio banderas jolie video] [http://mahohmie.qsh.eu/resource1532.htm new realeased movies] &lt;br /&gt;
[http://huruple.qsh.eu/20081227-sara-jay-xxx.htm sara jay xxx movie] [http://naceceli.qsh.eu/sitemap.html link] [http://huruple.qsh.eu/20090105-adc-video-patch.htm adc video patch panel] [http://tulilre.strefa.pl/2008-12-27-imovie-5-download.html imovie 5 download] [http://faquafav.is-the-boss.com/text-545.htm pinnacle studio 9.0 serial] &lt;br /&gt;
[http://mahohmie.qsh.eu/resource1805.htm spongebob tv movie character toy] [http://fademon.0lx.net/article-1434.htm put music videos on your psp for free] [http://acsitzar.0lx.net/news-joes-movies-2008-11-12.html joes movies] [http://caraines.qsh.eu/defanele.htm iran movie] [http://betheres.qsh.eu/comment-180.htm movie prime cut] &lt;br /&gt;
[http://caraines.qsh.eu/zelgolg.htm amc movie .com] [http://caraines.qsh.eu/zmexplnrb.htm ejaculate galleries.squirting video] [http://spfortne.qsh.eu/20081226-adult-alyssa.html adult alyssa milano movie] [http://lofaako.strefa.pl/sitemap.html map] [http://caraines.qsh.eu/caelttro.htm anne curtis video scandal download] &lt;br /&gt;
[http://zelgetgo.0lx.net/sitemap.htm url] [http://relquaca.is-the-boss.com/20090104-lanhound-serial.html lanhound serial number] [http://bukgetert.0lx.net/article-28.htm sitemap] [http://fispruil.qsh.eu/news1763.html she will be loved video cast maroon 5] [http://bukgetert.0lx.net/article-52.htm make a movie screen] &lt;br /&gt;
[http://lifokdron.0lx.net/1739.html michael thriller video] [http://huruple.qsh.eu/20090101-interracial-video.htm interracial video tgp] [http://relquaca.is-the-boss.com/20090103-password-stealer.html password stealer crack] [http://acsitzar.0lx.net/news-most-wanted-2008-11-17.html most wanted movie] [http://vihencbr.0lx.net/secure-video.html secure video chat] &lt;br /&gt;
[http://acsitzar.0lx.net/news-jethro-tull-videos-2008-11-19.html jethro tull videos] [http://bukgetert.0lx.net/sitemap.htm links] [http://lifokdron.0lx.net/504.html movie theater in virginia] [http://flheddin.qsh.eu/brfadron-453.html motivational military videos] [http://sematild.qsh.eu/resource322.htm real player video codecs] &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Mike Chirico (mchirico@users.sourceforge.net) or (mchirico@comcast.net)&lt;br /&gt;
Copyright (C) 2004 (GNU Free Documentation License)&lt;br /&gt;
Last Updated: Thu Dec 28 16:42:50 EST 2006&lt;br /&gt;
&lt;br /&gt;
The latest version of this document can be found at:&lt;br /&gt;
http://souptonuts.sourceforge.net/how_to_linux_and_open_source.htm&lt;br /&gt;
  or text version ( if you have trouble downloading the full document: over 140 pages )&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/How_to_Linux_and_Open_Source.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on Gmail with Postix and Fetchmail&lt;br /&gt;
http://souptonuts.sourceforge.net/postfix_tutorial.html&lt;br /&gt;
&lt;br /&gt;
For tips on using SQLite (over 25 pages)&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_sqlite_tutorial.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on MySQL reference:&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_mysql.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For a recommended reading list&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/Recommended_Reading.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on upgrading RedHat 9 or 8.0 to 2.6.x src kernel&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_26.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on Comcast Email with Home Linux Box&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_COMCAST_EMAIL.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  **Note, if you want email notification after every 50 new tips have been&lt;br /&gt;
    added, then, click on the following link:&lt;br /&gt;
     https://sourceforge.net/project/filemodule_monitor.php?filemodule_id=120838&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 1:&lt;br /&gt;
&lt;br /&gt;
     Is NTP Working?&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Test the current server):&lt;br /&gt;
&lt;br /&gt;
          Try issuing the following command:&lt;br /&gt;
&lt;br /&gt;
          $ ntpq -pn&lt;br /&gt;
&lt;br /&gt;
           remote refid st t when poll reach delay offset jitter&lt;br /&gt;
           ===================================================&lt;br /&gt;
           tock.usno.navy 0.0.0.0 16 u - 64 0 0.000 0.000 4000.00&lt;br /&gt;
&lt;br /&gt;
          The above is an example of a problem.&lt;br /&gt;
          Compare it to a working configuration.&lt;br /&gt;
&lt;br /&gt;
          $ ntpq -pn&lt;br /&gt;
&lt;br /&gt;
           remote refid st t when poll reach delay offset jitter&lt;br /&gt;
           ========================================================&lt;br /&gt;
           +128.4.40.12 128.4.40.10 2 u 107 128 377 25.642 3.350 1.012&lt;br /&gt;
           127.127.1.0 127.127.1.0 10 l 40 64 377 0.000 0.000 0.008&lt;br /&gt;
           +128.91.2.13 128.4.40.12 3 u 34 128 377 21.138 6.118 0.398&lt;br /&gt;
           *192.5.41.41 .USNO. 1 u 110 128 377 33.69 9.533 3.534&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Configure the /etc/ntp.conf):&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/ntp.conf&lt;br /&gt;
&lt;br /&gt;
            # My simple client-only ntp configuration.&lt;br /&gt;
            server timeserver1.upenn.edu&lt;br /&gt;
            # ping -a timeserver1.upenn.edu shows the IP address 128.91.2.13&lt;br /&gt;
            # which is used in the restrict below&lt;br /&gt;
            restrict 128.91.2.13&lt;br /&gt;
            server tock.usno.navy.mil&lt;br /&gt;
            restrict 192.5.41.41&lt;br /&gt;
            server 128.4.40.12&lt;br /&gt;
            restrict 128.4.40.12&lt;br /&gt;
            server 127.127.1.0 # local clock&lt;br /&gt;
            fudge 127.127.1.0 stratum 10&lt;br /&gt;
            driftfile /etc/ntp/drift&lt;br /&gt;
            restrict default ignore&lt;br /&gt;
            restrict 127.0.0.0 mask 255.0.0.0&lt;br /&gt;
            authenticate no&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Configure /etc/ntp/step-tickers):&lt;br /&gt;
&lt;br /&gt;
          The values for server above are placed in the &amp;quot;/etc/ntp/step-tickers&amp;quot; file&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/ntp/step-tickers&lt;br /&gt;
&lt;br /&gt;
              timeserver1.upenn.edu&lt;br /&gt;
              tock.usno.navy.mil&lt;br /&gt;
              128.4.40.12&lt;br /&gt;
&lt;br /&gt;
          The startup script /etc/rc.d/init.d/ntpd will grab the servers in this&lt;br /&gt;
          file and execute the ntpdate command as follows:&lt;br /&gt;
&lt;br /&gt;
             /usr/sbin/ntpdate -s -b -p 8 timeserver1.upenn.edu&lt;br /&gt;
&lt;br /&gt;
          Why? Because if the time is off ntpd will not start. The command above set the&lt;br /&gt;
          clock. If System Time deviates from true time by more than 1000 seconds, then,&lt;br /&gt;
          the ntpd daemon  will enter panic mode and exit.&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Restart the service and check):&lt;br /&gt;
&lt;br /&gt;
          Issue the restart command&lt;br /&gt;
&lt;br /&gt;
            /etc/init.d/ntpd restart&lt;br /&gt;
&lt;br /&gt;
          check the values for &amp;quot;ntpq -pn&amp;quot;,&lt;br /&gt;
          which should match step 1.&lt;br /&gt;
&lt;br /&gt;
             ntpq -pn&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE:&lt;br /&gt;
&lt;br /&gt;
          Time is always stored in the kernel as the number of seconds since&lt;br /&gt;
          midnight of the 1st of January 1970 UTC, regardless of whether the&lt;br /&gt;
          hardware clock is stored as UTC or not.  Conversions to local time&lt;br /&gt;
          are done at run-time. So, it's easy to get the time in different&lt;br /&gt;
          timezones for only the current session as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ export TZ=EST&lt;br /&gt;
              $ date&lt;br /&gt;
              Mon Aug  2 10:34:04 EST 2004&lt;br /&gt;
&lt;br /&gt;
              $ export TZ=NET&lt;br /&gt;
              $ date&lt;br /&gt;
              Mon Aug  2 15:34:18 NET 2004&lt;br /&gt;
&lt;br /&gt;
          The following are possible values for TZ:&lt;br /&gt;
&lt;br /&gt;
              Hours From Greenwich Mean Time (GMT) Value Description&lt;br /&gt;
              0 GMT Greenwich Mean Time&lt;br /&gt;
              +1 ECT European Central Time&lt;br /&gt;
              +2 EET European Eastern Time&lt;br /&gt;
              +2 ART&lt;br /&gt;
              +3 EAT Saudi Arabia&lt;br /&gt;
              +3.5 MET Iran&lt;br /&gt;
              +4 NET&lt;br /&gt;
              +5 PLT West Asia&lt;br /&gt;
              +5.5 IST India&lt;br /&gt;
              +6 BST Central Asia&lt;br /&gt;
              +7 VST Bangkok&lt;br /&gt;
              +8 CTT China&lt;br /&gt;
              +9 JST Japan&lt;br /&gt;
              +9.5 ACT Central Australia&lt;br /&gt;
              +10 AET Eastern Australia&lt;br /&gt;
              +11 SST Central Pacific&lt;br /&gt;
              +12 NST New Zealand&lt;br /&gt;
              -11 MIT Samoa&lt;br /&gt;
              -10 HST Hawaii&lt;br /&gt;
              -9 AST Alaska&lt;br /&gt;
              -8 PST Pacific Standard Time&lt;br /&gt;
              -7 PNT Arizona&lt;br /&gt;
              -7 MST Mountain Standard Time&lt;br /&gt;
              -6 CST Central Standard Time&lt;br /&gt;
              -5 EST Eastern Standard Time&lt;br /&gt;
              -5 IET Indiana East&lt;br /&gt;
              -4 PRT Atlantic Standard Time&lt;br /&gt;
              -3.5 CNT Newfoundland&lt;br /&gt;
              -3 AGT Eastern South America&lt;br /&gt;
              -3 BET Eastern South America&lt;br /&gt;
              -1 CAT Azores&lt;br /&gt;
&lt;br /&gt;
              DST timezone&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              0      BST for British Summer.&lt;br /&gt;
              +400   ADT for Atlantic Daylight.&lt;br /&gt;
              +500   EDT for Eastern Daylight.&lt;br /&gt;
              +600   CDT for Central Daylight.&lt;br /&gt;
              +700   MDT for Mountain Daylight.&lt;br /&gt;
              +800   PDT for Pacific Daylight.&lt;br /&gt;
              +900   YDT for Yukon Daylight.&lt;br /&gt;
              +1000  HDT for Hawaii Daylight.&lt;br /&gt;
              -100   MEST for Middle European Summer,&lt;br /&gt;
                         MESZ for Middle European Summer,&lt;br /&gt;
                         SST for Swedish Summer and FST for French Summer.&lt;br /&gt;
              -700   WADT for West Australian Daylight.&lt;br /&gt;
              -1000  EADT for Eastern Australian Daylight.&lt;br /&gt;
              -1200  NZDT for New Zealand Daylight.&lt;br /&gt;
&lt;br /&gt;
     The following is an example of setting the TZ environment variable&lt;br /&gt;
     for the timezone, only when timezone changes go into effect.&lt;br /&gt;
&lt;br /&gt;
               $ export TZ=EST+5EDT,M4.1.0/2,M10.5.0/2&lt;br /&gt;
&lt;br /&gt;
     Take a look at the last line &amp;quot;M10.5.0/2&amp;quot;. What does it mean? Here is the&lt;br /&gt;
     documentation&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Mm.w.d This  specifies  day  d (0 &amp;lt;= d &amp;lt;= 6) of week w (1 &amp;lt;= w &amp;lt;= 5) of&lt;br /&gt;
              month m (1 &amp;lt;= m &amp;lt;= 12).  Week 1 is the first week in which day d&lt;br /&gt;
              occurs and week 5 is the last week in which day d occurs.  Day 0&lt;br /&gt;
              is a Sunday.&lt;br /&gt;
&lt;br /&gt;
              The time fields specify when, in the local time  currently  in&lt;br /&gt;
              effect, the  change  to  the  other  time  occurs.   If omitted,&lt;br /&gt;
              the default is  02:00:00.&lt;br /&gt;
&lt;br /&gt;
      So this is what it means. M10 stands for October, the 5 is the fifth week&lt;br /&gt;
      that includes a Sunday (note 0 in M10.5.0/2 is Sunday). To see that it is&lt;br /&gt;
      the fifth week see the calendar below. The time change occurs a 2am in&lt;br /&gt;
      the morning.&lt;br /&gt;
&lt;br /&gt;
                                October&lt;br /&gt;
                         Su Mo Tu We Th Fr Sa&lt;br /&gt;
                                         1  2&lt;br /&gt;
                          3  4  5  6  7  8  9&lt;br /&gt;
                         10 11 12 13 14 15 16&lt;br /&gt;
                         17 18 19 20 21 22 23&lt;br /&gt;
                         24 25 26 27 28 29 30&lt;br /&gt;
                         31&lt;br /&gt;
&lt;br /&gt;
       Prove it. Take the following program sunrise, which can calcuates sunrise&lt;br /&gt;
       and sunset for an latitude and longitude. This program can be downloaded&lt;br /&gt;
       from the following location:&lt;br /&gt;
           http://sourceforge.net/direct-dl/mchirico/souptonuts/working_with_time.tar.gz&lt;br /&gt;
&lt;br /&gt;
       Below is a bash script that will run the program for the next 100 days.&lt;br /&gt;
&lt;br /&gt;
          #!/bin/bash&lt;br /&gt;
          #  program: next100days  Mike Chirico&lt;br /&gt;
          #  download:&lt;br /&gt;
          #  http://sourceforge.net/direct-dl/mchirico/souptonuts/working_with_time.tar.gz&lt;br /&gt;
          #&lt;br /&gt;
          #  This will calculate the sunrise and sunset for&lt;br /&gt;
          #  latitude     39.95  Note must convert to degrees&lt;br /&gt;
          #  longitude  75.15  Note must convert to degrees&lt;br /&gt;
          lat=39.95&lt;br /&gt;
          long=75.15&lt;br /&gt;
          for (( i=0; i &amp;lt;= 100; i++))&lt;br /&gt;
          do&lt;br /&gt;
            sunrise    `date -d &amp;quot;+$i day&amp;quot; &amp;quot;+%Y %m %d&amp;quot;` $lat $long&lt;br /&gt;
          done&lt;br /&gt;
&lt;br /&gt;
       Take a look at the following sample output.&lt;br /&gt;
&lt;br /&gt;
           $ export TZ=EST+5EDT,M4.1.0/2,M10.5.0/2&lt;br /&gt;
           $ ./next100days&lt;br /&gt;
&lt;br /&gt;
          Sunrise  08-24-2004  06:21:12   Sunset 08-24-2004  19:43:42&lt;br /&gt;
          Sunrise  08-25-2004  06:22:09   Sunset 08-25-2004  19:42:12&lt;br /&gt;
          Sunrise  08-26-2004  06:23:06   Sunset 08-26-2004  19:40:41&lt;br /&gt;
          Sunrise  08-27-2004  06:24:03   Sunset 08-27-2004  19:39:09&lt;br /&gt;
          Sunrise  08-28-2004  06:25:00   Sunset 08-28-2004  19:37:37&lt;br /&gt;
          Sunrise  08-29-2004  06:25:56   Sunset 08-29-2004  19:36:04&lt;br /&gt;
          Sunrise  08-30-2004  06:26:53   Sunset 08-30-2004  19:34:31&lt;br /&gt;
          Sunrise  08-31-2004  06:27:50   Sunset 08-31-2004  19:32:57&lt;br /&gt;
          Sunrise  09-01-2004  06:28:46   Sunset 09-01-2004  19:31:22&lt;br /&gt;
          Sunrise  09-02-2004  06:29:43   Sunset 09-02-2004  19:29:47&lt;br /&gt;
          ..[values omitted ]&lt;br /&gt;
          Sunrise  10-28-2004  07:25:31   Sunset 10-28-2004  18:02:34&lt;br /&gt;
          Sunrise  10-29-2004  07:26:38   Sunset 10-29-2004  18:01:19&lt;br /&gt;
          Sunrise  10-30-2004  07:27:46   Sunset 10-30-2004  18:00:06&lt;br /&gt;
          Sunrise  10-31-2004  06:28:53   Sunset 10-31-2004  16:58:54&lt;br /&gt;
          Sunrise  11-01-2004  06:30:01   Sunset 11-01-2004  16:57:44&lt;br /&gt;
          Sunrise  11-02-2004  06:31:10   Sunset 11-02-2004  16:56:35&lt;br /&gt;
&lt;br /&gt;
       Compare 10-30-2004 with 10-31-2004. Sunrise is an hour earlier because&lt;br /&gt;
       daylight saving time has ended, just as predicted.&lt;br /&gt;
&lt;br /&gt;
       There is an easier way to switch between timezones. Take a look at the&lt;br /&gt;
       directory zoneinfo as follows:&lt;br /&gt;
&lt;br /&gt;
            $ ls /usr/share/zoneinfo&lt;br /&gt;
&lt;br /&gt;
            Africa      Chile    Factory    Iceland      Mexico    posix       UCT&lt;br /&gt;
            America     CST6CDT  GB         Indian       Mideast   posixrules  Universal&lt;br /&gt;
            Antarctica  Cuba     GB-Eire    Iran         MST       PRC         US&lt;br /&gt;
            Arctic      EET      GMT        iso3166.tab  MST7MDT   PST8PDT     UTC&lt;br /&gt;
            Asia        Egypt    GMT0       Israel       Navajo    right       WET&lt;br /&gt;
            Atlantic    Eire     GMT-0      Jamaica      NZ        ROC         W-SU&lt;br /&gt;
            Australia   EST      GMT+0      Japan        NZ-CHAT   ROK         zone.tab&lt;br /&gt;
            Brazil      EST5EDT  Greenwich  Kwajalein    Pacific   Singapore   Zulu&lt;br /&gt;
            Canada      Etc      Hongkong   Libya        Poland    SystemV&lt;br /&gt;
            CET         Europe   HST        MET          Portugal  Turkey&lt;br /&gt;
&lt;br /&gt;
       TZ can be set to any one of these files. Some of these are directories and contain&lt;br /&gt;
       subdirectories, such as ./posix/America. This way you don not have to enter the&lt;br /&gt;
       timezone, offset, and range for dst, since it has already been calculated.&lt;br /&gt;
&lt;br /&gt;
           $ export TZ=:/usr/share/zoneinfo/posix/America/Aruba&lt;br /&gt;
           $ export TZ=:/usr/share/zoneinfo/Egypt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Reference:&lt;br /&gt;
          http://prdownloads.sourceforge.net/cpearls/date_calc.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
          Also see  (TIP 27).&lt;br /&gt;
          Also see  (TIP 103) using chrony which is very similiar to ntpd.&lt;br /&gt;
          Note time settings can usually be found in /etc/sysconfig/clock&lt;br /&gt;
         &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 2:&lt;br /&gt;
&lt;br /&gt;
     cpio works like tar, only better.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Create two directories with data ../dir1 an ../dir2)&lt;br /&gt;
&lt;br /&gt;
          mkdir -p ../dir1&lt;br /&gt;
          mkdir -p ../dir2&lt;br /&gt;
          cp /etc/*.conf ../dir1/.&lt;br /&gt;
          cp /etc/*.cnf ../dir2/.&lt;br /&gt;
&lt;br /&gt;
          Which will backup all your cnf and conf files.&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Piping the files to tar)&lt;br /&gt;
&lt;br /&gt;
          cpio works like tar but can take input&lt;br /&gt;
          from the &amp;quot;find&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar &amp;gt; test.tar&lt;br /&gt;
               or&lt;br /&gt;
           $ find ../dir1/ | cpio -o -H tar &amp;gt; test2.tar&lt;br /&gt;
&lt;br /&gt;
          Same command without the &amp;quot;&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar -F test.tar&lt;br /&gt;
              or&lt;br /&gt;
           $ find ../dir1/ | cpio -o -H tar -F test2.tar&lt;br /&gt;
&lt;br /&gt;
          Using append&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar -F test.tar&lt;br /&gt;
             or&lt;br /&gt;
           $ find ../dir2/ | cpio -o --format=tar --append -F test.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (List contents of the tar file)&lt;br /&gt;
&lt;br /&gt;
          $ cpio -it &amp;lt; test.tar&lt;br /&gt;
                or&lt;br /&gt;
          $ cpio -it -F test.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Extract the contents)&lt;br /&gt;
&lt;br /&gt;
          $ cpio -i -F test.tar&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 3:&lt;br /&gt;
&lt;br /&gt;
     Working with tar. The basics with encryption.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Using the tar command on the directory /stuff)&lt;br /&gt;
&lt;br /&gt;
          Suppose you have a directory /stuff&lt;br /&gt;
          To tar everything in stuff to create a &amp;quot;.tar&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
          $ tar -cvf stuff.tar stuff&lt;br /&gt;
&lt;br /&gt;
          Which will create &amp;quot;stuff.tar&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Using the tar command to create a &amp;quot;.tar.gz&amp;quot; of /stuff)&lt;br /&gt;
&lt;br /&gt;
          $ tar -czf stuff.tar.gz stuff&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (List the files in the archive)&lt;br /&gt;
&lt;br /&gt;
          $ tar -tzf stuff.tar.gz&lt;br /&gt;
               or&lt;br /&gt;
          $ tar -tf stuff.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (A way to list specific files)&lt;br /&gt;
&lt;br /&gt;
          Note, pipe the results to a file and edit&lt;br /&gt;
&lt;br /&gt;
           $ tar -tzf stuff.tar.gz &amp;gt; mout&lt;br /&gt;
&lt;br /&gt;
          Then, edit mout to only include the files you want&lt;br /&gt;
&lt;br /&gt;
           $ tar -T mout -xzf stuff.tar.gz&lt;br /&gt;
&lt;br /&gt;
          The above command will only get the files in mout.&lt;br /&gt;
          Of couse, if you want them all&lt;br /&gt;
&lt;br /&gt;
           $ tar -xzf stuff.tar.gz&lt;br /&gt;
&lt;br /&gt;
     STEP 5 (ENCRYPTION)&lt;br /&gt;
&lt;br /&gt;
           $ tar -zcvf - stuff|openssl des3 -salt -k secretpassword | dd of=stuff.des3&lt;br /&gt;
&lt;br /&gt;
          This will create stuff.des3...don't forget the password you&lt;br /&gt;
          put in place of  secretpassword. This can be done interactively as&lt;br /&gt;
          well.&lt;br /&gt;
&lt;br /&gt;
            $ dd if=stuff.des3 |openssl des3 -d -k secretpassword|tar zxf -&lt;br /&gt;
&lt;br /&gt;
     NOTE:  above there is a &amp;quot;-&amp;quot; at the end... this will&lt;br /&gt;
            extract everything.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 4:&lt;br /&gt;
&lt;br /&gt;
     Creating a Virtual File System and Mounting it with a Loopback Device.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Construct a 10MB file)&lt;br /&gt;
&lt;br /&gt;
           $ dd if=/dev/zero of=/tmp/disk-image count=20480&lt;br /&gt;
&lt;br /&gt;
          By default dd uses block of 512 so the size will be 20480*512&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Make an ext2 or ext3 file system) -- ext2 shown here.&lt;br /&gt;
&lt;br /&gt;
           $ mke2fs -q&lt;br /&gt;
&lt;br /&gt;
          or if you want ext3&lt;br /&gt;
&lt;br /&gt;
           $ mkfs -t ext3 -q /tmp/disk-image&lt;br /&gt;
&lt;br /&gt;
          yes, you can even use reiser, but you'll need to create a bigger&lt;br /&gt;
          disk image. Something like &amp;quot;dd if=/dev/zero of=/tmp/disk-image count=50480&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ mkfs -t reiserfs -q /tmp/disk-image&lt;br /&gt;
&lt;br /&gt;
          Hit yes for confirmation.  It only asks this because it's a file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Create a directory &amp;quot;virtual-fs&amp;quot; and mount. This has to be done as root)&lt;br /&gt;
&lt;br /&gt;
           $ mkdir /virtual-fs&lt;br /&gt;
           $ mount -o loop=/dev/loop0 /tmp/disk-image /virtual-fs&lt;br /&gt;
&lt;br /&gt;
         SPECIAL NOTE: if you mount a second device you will have to increase the&lt;br /&gt;
                       loop count: loop=/dev/loop1, loop=/dev/loop2, ... loop=/dev/loopn&lt;br /&gt;
&lt;br /&gt;
          Now it operates just like a disk. This virtual filesystem can be mounted&lt;br /&gt;
          when the system boots by adding the following to the &amp;quot;/etc/fstab&amp;quot; file. Then,&lt;br /&gt;
          to mount, just type &amp;quot;mount /virtual-fs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                 /tmp/disk-image /virtual-fs ext2               rw,loop=/dev/loop0 0 0&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (When done, umount it)&lt;br /&gt;
&lt;br /&gt;
           $ umount /virtual-fs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE: If you are using Fedora core 2, in the /etc/fstab you can take&lt;br /&gt;
              advantage of acl properties for this mount. Note the acl next to the&lt;br /&gt;
              rw entry. This is shown here with ext3.&lt;br /&gt;
&lt;br /&gt;
                 /tmp/disk-image     /virtual-fs ext3    rw,acl,loop=/dev/loop1 0 0&lt;br /&gt;
&lt;br /&gt;
              Also, if you are using Fedora core 2 and above, you can mount the file&lt;br /&gt;
              on a cryptoloop.&lt;br /&gt;
&lt;br /&gt;
                $ dd if=/dev/urandom of=disk-aes count=20480&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ modprobe loop&lt;br /&gt;
                $ modprobe cryptoloop&lt;br /&gt;
                $ modprobe aes&lt;br /&gt;
&lt;br /&gt;
                $ losetup -e aes /dev/loop0 disk-aes&lt;br /&gt;
                $ mkfs -t ext2 /dev/loop0&lt;br /&gt;
                $ mount -o loop,encryption=aes disk-aes &amp;lt;mount point&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              If you do not have Fedora core 2, then, you can build the kernel from source&lt;br /&gt;
              with some of the following options (not complete, yet)&lt;br /&gt;
               reference:&lt;br /&gt;
     http://cvs.sourceforge.net/viewcvs.py/cpearls/cpearls/src/posted_on_sf/acl/ehd.pdf?rev=1.1&amp;amp;view=log&lt;br /&gt;
&lt;br /&gt;
                      Cryptographic API Support (CONFIG_CRYPTO)&lt;br /&gt;
                      generic loop cryptographic (CONFIG_CRYPTOLOOP)&lt;br /&gt;
                      Cryptographic ciphers (CONFIG_CIPHERS)&lt;br /&gt;
                      Enable one or more  ciphers  (CONFIG CIPHER .*) such as AES.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     HELPFUL INFORMATION: It is possible to bind mount partitions, or associate the&lt;br /&gt;
                     mounted partition to a directory name.&lt;br /&gt;
&lt;br /&gt;
                  # mount --bind  /virtual-fs      /home/mchirico/vfs&lt;br /&gt;
&lt;br /&gt;
             Also, if you want to see what filesystems are currently mounted, &amp;quot;cat&amp;quot; the&lt;br /&gt;
             file &amp;quot;/etc/mtab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
                  $ cat /etc/mtab&lt;br /&gt;
&lt;br /&gt;
     Also see TIP 91.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 5:&lt;br /&gt;
&lt;br /&gt;
     Setting up 2 IP address on &amp;quot;One&amp;quot; NIC. This example is on ethernet.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (The settings for the initial IP address)&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
&lt;br /&gt;
            DEVICE=eth0&lt;br /&gt;
            BOOTPROTO=static&lt;br /&gt;
            BROADCAST=192.168.99.255&lt;br /&gt;
            IPADDR=192.168.1.155&lt;br /&gt;
            NETMASK=255.255.252.0&lt;br /&gt;
            NETWORK=192.168.1.0&lt;br /&gt;
            ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (2nd IP address: )&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/sysconfig/network-scripts/ifcfg-eth0:1&lt;br /&gt;
&lt;br /&gt;
            DEVICE=eth0:1&lt;br /&gt;
            BOOTPROTO=static&lt;br /&gt;
            BROADCAST=192.168.99.255&lt;br /&gt;
            IPADDR=192.168.1.182&lt;br /&gt;
            NETMASK=255.255.252.0&lt;br /&gt;
            NETWORK=192.168.1.0&lt;br /&gt;
            ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
     SUMMARY  Note, in STEP 1 the filename is &amp;quot;ifcfg-eth0&amp;quot;, whereas in&lt;br /&gt;
              STEP 2 it's &amp;quot;ifcfg-eth0:1&amp;quot; and also not the matching&lt;br /&gt;
              entries for &amp;quot;DEVICE=...&amp;quot;.  Also, obviously, the&lt;br /&gt;
              &amp;quot;IPADDR&amp;quot; is different as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 6:&lt;br /&gt;
&lt;br /&gt;
     Sharing Directories Among Several Users.&lt;br /&gt;
&lt;br /&gt;
     Several people are working on a project in &amp;quot;/home/share&amp;quot;&lt;br /&gt;
     and they need to create documents and programs so that&lt;br /&gt;
     others in the group can edit and execute these documents&lt;br /&gt;
     as needed. Also see (TIP 186) for adding existing users&lt;br /&gt;
     to groups.&lt;br /&gt;
&lt;br /&gt;
       $  /usr/sbin/groupadd share&lt;br /&gt;
       $  chown -R root.share /home/share&lt;br /&gt;
       $  /usr/bin/gpasswd -a &amp;lt;username&amp;gt; share&lt;br /&gt;
       $  chmod 2775 /home/share&lt;br /&gt;
&lt;br /&gt;
       $  ls -ld /home/share&lt;br /&gt;
             drwxrwsr-x    2 root     share        4096 Nov  8 16:19 /home/share&lt;br /&gt;
                   ^---------- Note the s bit, which was set with the chmod 2775&lt;br /&gt;
&lt;br /&gt;
       $  cat /etc/group&lt;br /&gt;
          ...&lt;br /&gt;
           share:x:502:chirico,donkey,zoe&lt;br /&gt;
          ...          ^------- users are added to this group.&lt;br /&gt;
&lt;br /&gt;
     The user may need to login again to get access. Or, if the user is currently&lt;br /&gt;
     logged in, they can run the following command:&lt;br /&gt;
&lt;br /&gt;
       $ su - &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Note, the above step is recommended over  &amp;quot;newgrp - share&amp;quot; since currently&lt;br /&gt;
     newgrp in FC2,FC3, and FC4 gets access to the group but the umask is not&lt;br /&gt;
     correctly formed.&lt;br /&gt;
&lt;br /&gt;
     As root you  can test their account.&lt;br /&gt;
&lt;br /&gt;
       $ su - &amp;lt;username&amp;gt;   &amp;quot;You need to '-' to pickup thier environment  '$ su - chirico' &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Note: SUID, SGID, Sticky bit. Only the left most octet is examined, and &amp;quot;chmod 755&amp;quot; is used&lt;br /&gt;
          as an example of the full command. But, anything else could be used as well. Normally&lt;br /&gt;
          you'd want executable permissions.&lt;br /&gt;
&lt;br /&gt;
        Octal digit  Binary value      Meaning                           Example usage&lt;br /&gt;
            0           000       all cleared                             $ chmod 0755 or chmod 755&lt;br /&gt;
            1           001       sticky                                  $ chmod 1755&lt;br /&gt;
            2           010       setgid                                  $ chmod 2755&lt;br /&gt;
            3           011       setgid, sticky                          $ chmod 3755&lt;br /&gt;
            4           100       setuid                                  $ chmod 4755&lt;br /&gt;
            5           101       setuid, sticky                          $ chmod 5755&lt;br /&gt;
            6           110       setuid, setgid                          $ chmod 6755&lt;br /&gt;
            7           111       setuid, setgid, sticky                  $ chmod 7755&lt;br /&gt;
&lt;br /&gt;
     A few examples applied to a directory below. In the first example all users in the group can&lt;br /&gt;
     add files to directory &amp;quot;dirA&amp;quot; and they can delete their own files. Users cannot delete other&lt;br /&gt;
     user's files.&lt;br /&gt;
&lt;br /&gt;
        Sticky bit:&lt;br /&gt;
           $ chmod 1770  dirA&lt;br /&gt;
&lt;br /&gt;
     Below files created within the directory have the group ID of the directory, rather than that&lt;br /&gt;
     of the default group setting for the user who created the file.&lt;br /&gt;
&lt;br /&gt;
        Set group ID bit:&lt;br /&gt;
           $ chmod 2755  dirB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 7:&lt;br /&gt;
&lt;br /&gt;
     Getting Infomation on Commands&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;info&amp;quot; is a great utility for getting information about the system.&lt;br /&gt;
     Here's a quick key on using &amp;quot;info&amp;quot; from the terminal prompt.&lt;br /&gt;
&lt;br /&gt;
       'q' exits.&lt;br /&gt;
       'u' moves up to the table of contents of the current section.&lt;br /&gt;
       'n' moves to the next chapter.&lt;br /&gt;
       'p' moves to the previous chapter.&lt;br /&gt;
       'space' goes into the selected section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The following is a good starting point:&lt;br /&gt;
&lt;br /&gt;
        $ info coreutils&lt;br /&gt;
&lt;br /&gt;
      Need to find out what a certain program does?&lt;br /&gt;
&lt;br /&gt;
        $ whatis  open&lt;br /&gt;
       open   (2)  - open and possibly create a file or device&lt;br /&gt;
       open   (3)  - perl pragma to set default PerlIO layers for input and output&lt;br /&gt;
       open   (3pm)  - perl pragma to set default PerlIO layers for input and output&lt;br /&gt;
       open   (n)  - Open a file-based or command pipeline channel&lt;br /&gt;
&lt;br /&gt;
      To get specific information about the open commmand&lt;br /&gt;
&lt;br /&gt;
        $ man 2 open&lt;br /&gt;
&lt;br /&gt;
       also try 'keyword' search, which is the same as the apropos command.&lt;br /&gt;
       For example, to find all the man pages on selinux, type the following:&lt;br /&gt;
&lt;br /&gt;
        $ man -k selinux&lt;br /&gt;
&lt;br /&gt;
       or the man full word search. Same as whatis command.&lt;br /&gt;
&lt;br /&gt;
        $ man -f &amp;lt;some string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       This is a hint once you are inside man.&lt;br /&gt;
&lt;br /&gt;
        space      moves forward one page&lt;br /&gt;
        b          moves backward&lt;br /&gt;
        y          scrolls up one line &amp;quot;yikes, I missed it!&amp;quot;&lt;br /&gt;
        g          goes to the beginning&lt;br /&gt;
        q          quits&lt;br /&gt;
        /&amp;lt;string&amp;gt;  search, repeat seach n&lt;br /&gt;
        m          mark, enter a letter like &amp;quot;a&amp;quot;, then, ' to go back&lt;br /&gt;
        '          enter a letter that is marked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       To get section numbers&lt;br /&gt;
&lt;br /&gt;
        $ man 8 ping&lt;br /&gt;
&lt;br /&gt;
       Note the numbers are used as follows&lt;br /&gt;
         (This is OpenBSD)&lt;br /&gt;
&lt;br /&gt;
         1  General Commands&lt;br /&gt;
         2  System Calls and Error Numbers&lt;br /&gt;
         3  C Libraries&lt;br /&gt;
         3p perl&lt;br /&gt;
         4  Devices and device drivers&lt;br /&gt;
         5  File Formats and config files&lt;br /&gt;
         6  Game instructions&lt;br /&gt;
         7  Miscellaneous information&lt;br /&gt;
         8  System maintenance&lt;br /&gt;
         9  Kernel internals&lt;br /&gt;
&lt;br /&gt;
       To find the man page directly, &amp;quot;ls&amp;quot; command:&lt;br /&gt;
&lt;br /&gt;
         $ whereis -m ls&lt;br /&gt;
         ls: /usr/share/man/man1/ls.1.gz /usr/share/man/man1/ls.1 /usr/share/man/man1p/ls.1p&lt;br /&gt;
&lt;br /&gt;
       To read this file directly, do the following:&lt;br /&gt;
&lt;br /&gt;
         $ man /usr/share/man/man1/ls.1.gz&lt;br /&gt;
&lt;br /&gt;
       If you want to know the manpath, execute manpath.&lt;br /&gt;
&lt;br /&gt;
         $ manpath&lt;br /&gt;
         /usr/share/man:/usr/X11R6/man:/usr/local/share/man:/usr/local/pgsql/man:/usr/man:/usr/local/man&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 8:&lt;br /&gt;
&lt;br /&gt;
     How to Put a &amp;quot;Running Job&amp;quot; in the Background.&lt;br /&gt;
&lt;br /&gt;
     You're running a job at the terminal prompt, and it's taking&lt;br /&gt;
     a very long time. You want to put the job in the backgroud.&lt;br /&gt;
&lt;br /&gt;
       &amp;quot;CTL - z&amp;quot; Temporarily suspends the job&lt;br /&gt;
       $ jobs     This will list all the jobs&lt;br /&gt;
       $ bg %jobnumber (bg %1)  To run in the background&lt;br /&gt;
       $ fg %jobnumber          To bring back in the foreground&lt;br /&gt;
&lt;br /&gt;
     Need to kill all jobs -- say you're using several suspended&lt;br /&gt;
     emacs sessions and you just want everything to exit.&lt;br /&gt;
&lt;br /&gt;
       $ kill -9  `jobs -p`&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;jobs -p&amp;quot; gives the process number of each job, and the&lt;br /&gt;
     kill -9 kills everything. Yes, sometimes &amp;quot;kill -9&amp;quot; is excessive&lt;br /&gt;
     and you should issue a &amp;quot;kill -15&amp;quot; that allows jobs to clean-up.&lt;br /&gt;
     However, for exacs session, I prefer &amp;quot;kill -9&amp;quot; and haven't had&lt;br /&gt;
     a problem.&lt;br /&gt;
&lt;br /&gt;
     Sometimes you need to list the process id along with job&lt;br /&gt;
     information. For instance, here's process id with the listing.&lt;br /&gt;
&lt;br /&gt;
       $ jobs -l&lt;br /&gt;
&lt;br /&gt;
     Note you can also renice a job, or give it lower priority.&lt;br /&gt;
&lt;br /&gt;
       $ nice -n +15 find . -ctime 2 -type f  -exec ls {} \; &amp;gt; last48hours&lt;br /&gt;
        ^z&lt;br /&gt;
       $  bg&lt;br /&gt;
&lt;br /&gt;
     So above that was a ctl-z to suppend. Then, bg to run it in&lt;br /&gt;
     the background. Now, if you want to change the priority lower&lt;br /&gt;
     you just renice it, once you know the process id.&lt;br /&gt;
&lt;br /&gt;
       $ jobs -pl&lt;br /&gt;
   [1]+ 29388 Running                 nice -n +15 find . -ctime 2 -exec ls -l {} \; &amp;gt;mout &amp;amp;&lt;br /&gt;
&lt;br /&gt;
       $ renice +30 -p 29388&lt;br /&gt;
        29388: old priority 15, new priority 19&lt;br /&gt;
&lt;br /&gt;
      19 was the lowest priority for this job. You cannot increase&lt;br /&gt;
      the priority unless you are root.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 9:&lt;br /&gt;
&lt;br /&gt;
     Need to Delete a File for Good -- not even GOD can recover.&lt;br /&gt;
&lt;br /&gt;
     You have a file &amp;quot;secret&amp;quot;.  The following makes it so no one&lt;br /&gt;
     can read it.  If the file was 12 bytes, it's now 4096 after it&lt;br /&gt;
     has been over written 100 times.  There's no way to recover this.&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z secret&lt;br /&gt;
&lt;br /&gt;
     Want to remove the file? Use the &amp;quot;u&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z -u test2&lt;br /&gt;
&lt;br /&gt;
     It can be applied to a device&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z -u /dev/fd0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       CAUTION: Note that shred relies on a very important assumption: that the file system  overwrites  data&lt;br /&gt;
       in  place.   This is the traditional way to do things, but many modern file system designs do not sat-&lt;br /&gt;
       isfy this assumption.  The following are examples of file systems on which shred is not effective,  or&lt;br /&gt;
       is not guaranteed to be effective in all file system modes:&lt;br /&gt;
&lt;br /&gt;
       * log-structured or journaled file systems, such as those supplied with&lt;br /&gt;
&lt;br /&gt;
              AIX and Solaris (and JFS, ReiserFS, XFS, Ext3, etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 52).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 10:&lt;br /&gt;
&lt;br /&gt;
     Who and What is doing What on Your System - finding open sockets,&lt;br /&gt;
     files etc.&lt;br /&gt;
&lt;br /&gt;
       $ lsof&lt;br /&gt;
          or as root&lt;br /&gt;
       $ watch lsof -i&lt;br /&gt;
&lt;br /&gt;
     To list all open Internet files, use:&lt;br /&gt;
&lt;br /&gt;
       $ lsof -i -U&lt;br /&gt;
&lt;br /&gt;
       (See TIP 118)&lt;br /&gt;
&lt;br /&gt;
     Also try fuser. Suppose you have a mounted file-system, and you need&lt;br /&gt;
     to umount it. To list the users on the file-system /work&lt;br /&gt;
&lt;br /&gt;
       $ fuser -u /work&lt;br /&gt;
&lt;br /&gt;
     To kill all processes accessing the file system /work  in  any way.&lt;br /&gt;
&lt;br /&gt;
       $ fuser -km /work&lt;br /&gt;
&lt;br /&gt;
     Or better yet, maybe you want to eject a cdrom on /mnt/cdrom&lt;br /&gt;
&lt;br /&gt;
       $ fuser -km /mnt/cdrom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     If you need IO load information about your system, you can execute&lt;br /&gt;
     iostat. But note, the very first iostat gives a snapshot since&lt;br /&gt;
     the last boot. You typically want the following command, which gives&lt;br /&gt;
     you 3 outputs every 5 seconds.&lt;br /&gt;
&lt;br /&gt;
       $ iostat -xtc 5 3&lt;br /&gt;
       Linux 2.6.12-1.1376_FC3smp (squeezel.squeezel.com) 	10/05/2005&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:04 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  0.97    0.06    1.94    0.62   96.41&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:09 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  0.60    0.00    1.70    0.00   97.70&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:14 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  1.00    0.00    1.60    0.00   97.39&lt;br /&gt;
&lt;br /&gt;
     vmstat reports memory statistics.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ vmstat&lt;br /&gt;
       $ ifconfig&lt;br /&gt;
       $ cat /proc/sys/vm/.. (entries under here)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      *NOTE: (TIP 77) shows sample usage of &amp;quot;ifconfig&amp;quot;. Also&lt;br /&gt;
       (TIP 84) shows sample output of &amp;quot;$ cat /proc/cpuinfo&amp;quot;. You can download iostat&lt;br /&gt;
       and other packages from (http://perso.wanadoo.fr/sebastien.godard/download_en.html).&lt;br /&gt;
       You also may want to look at iozone (TIP 178).&lt;br /&gt;
&lt;br /&gt;
     Also&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/meminfo&lt;br /&gt;
       $ cat /proc/stat&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/uptime&lt;br /&gt;
       1078623.55 1048008.34       First number is the number of seconds since boot.&lt;br /&gt;
                                   The second number is the number of idle seconds.&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/loadavg&lt;br /&gt;
       0.25 0.14 0.10 1/166 7778   This shows load at 1,5, and 15 minutes,&lt;br /&gt;
                                   a total of 1 current running process out&lt;br /&gt;
                                   from a total of 166. The 7778 is the last&lt;br /&gt;
                                   process id used.&lt;br /&gt;
                                   Ref: http://www.teamquest.com/resources/gunther/ldavg1.shtml&lt;br /&gt;
&lt;br /&gt;
     Or current process open file descriptors&lt;br /&gt;
&lt;br /&gt;
        $ ls -l /proc/self/fd/0&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lr-x------    1 chirico  chirico        64 Jun 29 13:17 3 -&amp;gt; /proc/26667/fd&lt;br /&gt;
&lt;br /&gt;
      So you could, $ echo &amp;quot;stuff&amp;quot; &amp;gt; /dev/pts/51, to get output. Note, tree is also&lt;br /&gt;
      helpful here:&lt;br /&gt;
&lt;br /&gt;
         $ tree /proc/self&lt;br /&gt;
&lt;br /&gt;
            /proc/self&lt;br /&gt;
            |-- auxv&lt;br /&gt;
            |-- cmdline&lt;br /&gt;
            |-- cwd -&amp;gt; /work/souptonuts/documentation/theBook&lt;br /&gt;
            |-- environ&lt;br /&gt;
            |-- exe -&amp;gt; /usr/bin/tree&lt;br /&gt;
            |-- fd&lt;br /&gt;
            |   |-- 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   |-- 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   |-- 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   `-- 3 -&amp;gt; /proc/26668/fd&lt;br /&gt;
            |-- maps&lt;br /&gt;
            |-- mem&lt;br /&gt;
            |-- mounts&lt;br /&gt;
            |-- root -&amp;gt; /&lt;br /&gt;
            |-- stat&lt;br /&gt;
            |-- statm&lt;br /&gt;
            |-- status&lt;br /&gt;
            |-- task&lt;br /&gt;
            |   `-- 26668&lt;br /&gt;
            |       |-- auxv&lt;br /&gt;
            |       |-- cmdline&lt;br /&gt;
            |       |-- cwd -&amp;gt; /work/souptonuts/documentation/theBook&lt;br /&gt;
            |       |-- environ&lt;br /&gt;
            |       |-- exe -&amp;gt; /usr/bin/tree&lt;br /&gt;
            |       |-- fd&lt;br /&gt;
            |       |   |-- 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   |-- 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   |-- 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   `-- 3 -&amp;gt; /proc/26668/task/26668/fd&lt;br /&gt;
            |       |-- maps&lt;br /&gt;
            |       |-- mem&lt;br /&gt;
            |       |-- mounts&lt;br /&gt;
            |       |-- root -&amp;gt; /&lt;br /&gt;
            |       |-- stat&lt;br /&gt;
            |       |-- statm&lt;br /&gt;
            |       |-- status&lt;br /&gt;
            |       `-- wchan&lt;br /&gt;
            `-- wchan&lt;br /&gt;
&lt;br /&gt;
            10 directories, 28 files&lt;br /&gt;
&lt;br /&gt;
     Need a listing of the system settings?&lt;br /&gt;
&lt;br /&gt;
       $ sysctl -a&lt;br /&gt;
&lt;br /&gt;
     Need IPC (Shared Memory Segments, Semaphore Arrays, Message Queue) status&lt;br /&gt;
     etc?&lt;br /&gt;
&lt;br /&gt;
       $ ipcs&lt;br /&gt;
       $ ipcs -l  &amp;quot;This gives limits&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Need to &amp;quot;watch&amp;quot; everything a user does?  The following watches donkey.&lt;br /&gt;
&lt;br /&gt;
       $ watch lsof -u donkey&lt;br /&gt;
&lt;br /&gt;
     Or, to see what in  going on in directory &amp;quot;/work/junk&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       $ watch lsof +D /work/junk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 11:&lt;br /&gt;
&lt;br /&gt;
     How to make a File &amp;quot;immutable&amp;quot; or &amp;quot;unalterable&amp;quot; -- it cannot be changed&lt;br /&gt;
     or deleted even by root. Note this works on (ext2/ext3) filesystems.&lt;br /&gt;
     And, yes, root can delete after it's changed back.&lt;br /&gt;
&lt;br /&gt;
     As root:&lt;br /&gt;
&lt;br /&gt;
       $ chattr +i filename&lt;br /&gt;
&lt;br /&gt;
     And to change it back:&lt;br /&gt;
&lt;br /&gt;
       $ chattr -i filename&lt;br /&gt;
&lt;br /&gt;
     List attributes&lt;br /&gt;
&lt;br /&gt;
       $ lsattr filename&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 12:&lt;br /&gt;
&lt;br /&gt;
     SSH - How to Generate the Key Pair.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     On the local server&lt;br /&gt;
&lt;br /&gt;
       $  ssh-keygen -t dsa -b 2048&lt;br /&gt;
&lt;br /&gt;
     This will create the two files:&lt;br /&gt;
&lt;br /&gt;
            .ssh/id_dsa (Private key)&lt;br /&gt;
            .ssh/id_dsa.pub  (Public key you can share)&lt;br /&gt;
&lt;br /&gt;
     Next insert &amp;quot;.ssh/id_dsa.pub&amp;quot; on the remote server&lt;br /&gt;
     in the file  &amp;quot;.ssh/authorized_keys&amp;quot; and &amp;quot;.ssh/authorized_keys2&amp;quot;&lt;br /&gt;
     and change the  permission of each file to (chmod 600). Plus, make&lt;br /&gt;
     sure the directory &amp;quot;.ssh&amp;quot; exists on the remote computer with 700 rights.&lt;br /&gt;
     Ok, assuming  192.168.1.155 is the remote server and &amp;quot;donkey&amp;quot; is the&lt;br /&gt;
     account on that remote server.&lt;br /&gt;
&lt;br /&gt;
       $ ssh donkey@192.168.1.155 &amp;quot;mkdir -p .ssh&amp;quot;&lt;br /&gt;
       $ ssh donkey@192.168.1.155 &amp;quot;chmod 700 .ssh&amp;quot;&lt;br /&gt;
       $ scp ./.ssh/id_dsa.pub  donkey@192.168.1.155:.ssh/newkey.pub&lt;br /&gt;
&lt;br /&gt;
     Now connect to that remote server &amp;quot;192.168.1.155&amp;quot; and add .ssh/newkey.pub&lt;br /&gt;
     to both &amp;quot;authorized_keys&amp;quot; and &amp;quot;authorized_keys2&amp;quot;.  When done, the permission&lt;br /&gt;
     on&lt;br /&gt;
       (This is on the remote server)&lt;br /&gt;
&lt;br /&gt;
        $chmod 600 .ssh/authorized_key*&lt;br /&gt;
&lt;br /&gt;
     Next, go back to the local server and issue the following:&lt;br /&gt;
&lt;br /&gt;
        $ ssh-agent $SHELL&lt;br /&gt;
        $ ssh-add&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;ssh-add&amp;quot; will allow you to enter the passphrase and it will&lt;br /&gt;
     save it for the current login session.&lt;br /&gt;
&lt;br /&gt;
     You don't have to enter a password when running &amp;quot;ssh-keygen&amp;quot; above. But,&lt;br /&gt;
     remember anyone with root access can &amp;quot;su - &amp;lt;username&amp;gt;&amp;quot; and then connect&lt;br /&gt;
     to your computers.  It's harder, however, not impossible, for root to do&lt;br /&gt;
     this if  you have a password.&lt;br /&gt;
&lt;br /&gt;
     (Reference TIP 151)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 13:&lt;br /&gt;
&lt;br /&gt;
     Securing the System: Don't allow root to login remotely.  Instead,&lt;br /&gt;
     the admin could login as another account, then, &amp;quot;su -&amp;quot;.  However,&lt;br /&gt;
     root can still login &amp;quot;from the local terminal&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     In the &amp;quot;/etc/ssh/sshd_config&amp;quot; file change the following lines:&lt;br /&gt;
&lt;br /&gt;
        Protocol 2&lt;br /&gt;
        PermitRootLogin no&lt;br /&gt;
        PermitEmptyPasswords no&lt;br /&gt;
&lt;br /&gt;
     Then, restart ssh&lt;br /&gt;
&lt;br /&gt;
        /etc/init.d/sshd restart&lt;br /&gt;
&lt;br /&gt;
     Why would you want to do this?  It's not possible for anyone to guess&lt;br /&gt;
     or keep trying the root account.  This is especially good for computers&lt;br /&gt;
     on the Internet. So, even if the &amp;quot;root&amp;quot; passwords is known, they can't&lt;br /&gt;
     get access to the system remotely.  Only from the terminal, which is locked&lt;br /&gt;
     in your computer room. However, if anyone has a account on the server,&lt;br /&gt;
     then, they can login under their  account then &amp;quot;su -&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Suppose you only want a limited number of users:  &amp;quot;mchirico&amp;quot; and &amp;quot;donkey&amp;quot;.&lt;br /&gt;
     Add the following line to &amp;quot;/etc/ssh/sshd_config&amp;quot;. Note, this allows access&lt;br /&gt;
     for chirico and donkey, but everyone else is denied.&lt;br /&gt;
&lt;br /&gt;
         #  Once you add AllowUsers - everyone else is denied.&lt;br /&gt;
         AllowUsers mchirico donkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 14:&lt;br /&gt;
&lt;br /&gt;
     Keep Logs Longer with Less Space.&lt;br /&gt;
&lt;br /&gt;
     Normally logs rotate monthly, over writing all the old data.  Here's a&lt;br /&gt;
     sample &amp;quot;/etc/logrotate.conf&amp;quot; that will keep 12 months of backup&lt;br /&gt;
     compressing the logfiles&lt;br /&gt;
&lt;br /&gt;
       $ cat /etc/logrotate.conf&lt;br /&gt;
&lt;br /&gt;
             # see &amp;quot;man logrotate&amp;quot; for details&lt;br /&gt;
             # rotate log files weekly&lt;br /&gt;
             #chirico changes to monthly&lt;br /&gt;
             monthly&lt;br /&gt;
&lt;br /&gt;
             # keep 4 weeks worth of backlogs&lt;br /&gt;
             # keep 12 months of backup&lt;br /&gt;
             rotate 12&lt;br /&gt;
&lt;br /&gt;
             # create new (empty) log files after rotating old ones&lt;br /&gt;
             create&lt;br /&gt;
&lt;br /&gt;
             # uncomment this if you want your log files compressed&lt;br /&gt;
             compress&lt;br /&gt;
&lt;br /&gt;
             # RPM packages drop log rotation information into this directory&lt;br /&gt;
             include /etc/logrotate.d&lt;br /&gt;
&lt;br /&gt;
             # no packages own wtmp -- we'll rotate them here&lt;br /&gt;
             /var/log/wtmp {&lt;br /&gt;
                 monthly&lt;br /&gt;
                 create 0664 root utmp&lt;br /&gt;
                 rotate 1&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
             # system-specific logs may be also be configured here.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Note: see tip 1. The clock should always be correctly set.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 15:&lt;br /&gt;
&lt;br /&gt;
     What Network Services are Running?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -atup&lt;br /&gt;
&lt;br /&gt;
     or&lt;br /&gt;
&lt;br /&gt;
          $ netstat -ap|grep LISTEN|less&lt;br /&gt;
&lt;br /&gt;
     This can be helpful to determine the services running.&lt;br /&gt;
&lt;br /&gt;
     Need stats on dropped UDP packets?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s -u&lt;br /&gt;
&lt;br /&gt;
     or TCP&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s -t&lt;br /&gt;
&lt;br /&gt;
     or summary of everything&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s&lt;br /&gt;
&lt;br /&gt;
     or looking for error rates on the interface?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -i&lt;br /&gt;
&lt;br /&gt;
     Listening interfaces?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -l&lt;br /&gt;
&lt;br /&gt;
     (Tip above provided by Amos Shapira)&lt;br /&gt;
&lt;br /&gt;
     Also see TIP 77.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 16:&lt;br /&gt;
&lt;br /&gt;
     Apache: Creating and Using an &amp;quot;.htaccess&amp;quot; File&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Below is a sample &amp;quot;.htaccess&amp;quot; file which goes in&lt;br /&gt;
     &amp;quot;/usr/local/apache/htdocs/chirico/alpha/.htaccess&amp;quot; for this&lt;br /&gt;
     example&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         AuthUserFile /usr/local/apache/htdocs/chirico/alpha/.htpasswd&lt;br /&gt;
         AuthGroupFile /dev/null&lt;br /&gt;
         AuthName &amp;quot;Your Name and regular password required&amp;quot;&lt;br /&gt;
         AuthType Basic&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;Limit GET POST&amp;gt;&lt;br /&gt;
         require valid-user&lt;br /&gt;
         &amp;lt;/Limit&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    In order for this to work /usr/local/apache/conf/httpd.conf must&lt;br /&gt;
    have the following line in it:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       #&lt;br /&gt;
       &amp;lt;Directory /usr/local/apache/htdocs/chirico/alpha&amp;gt;&lt;br /&gt;
           AllowOverride FileInfo AuthConfig Limit&lt;br /&gt;
           Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec&lt;br /&gt;
           &amp;lt;Limit GET POST OPTIONS PROPFIND&amp;gt;&lt;br /&gt;
               Order allow,deny&lt;br /&gt;
               Allow from all&lt;br /&gt;
           &amp;lt;/Limit&amp;gt;&lt;br /&gt;
           &amp;lt;LimitExcept GET POST OPTIONS PROPFIND&amp;gt;&lt;br /&gt;
               Order deny,allow&lt;br /&gt;
               Deny from all&lt;br /&gt;
           &amp;lt;/LimitExcept&amp;gt;&lt;br /&gt;
       &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Also, a password file must be created&lt;br /&gt;
&lt;br /&gt;
      $ /usr/local/apache/bin/htpasswd -c .htpasswd chirico&lt;br /&gt;
&lt;br /&gt;
    And enter the user names and passwords.&lt;br /&gt;
&lt;br /&gt;
    Next Reload Apache:&lt;br /&gt;
&lt;br /&gt;
      $ /etc/init.d/httpd reload&lt;br /&gt;
&lt;br /&gt;
    (Reference TIP 213 limit access to certain directories based on IP address).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 17:&lt;br /&gt;
&lt;br /&gt;
     Working with &amp;quot;mt&amp;quot; Commands: reading and writing to tape.&lt;br /&gt;
&lt;br /&gt;
     The following assumes the tape device is &amp;quot;/dev/st0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     STEP 1 ( rewind the tape)&lt;br /&gt;
&lt;br /&gt;
          # mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (check to see if you are at block 0)&lt;br /&gt;
&lt;br /&gt;
          # mt -f /dev/nst0 tell&lt;br /&gt;
            At block 0.&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Backup &amp;quot;tar compress&amp;quot;  directories &amp;quot;one&amp;quot;  and &amp;quot;two&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
          # tar -czf /dev/nst0 one two&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Check to see what block you are at)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
&lt;br /&gt;
       You should get something like block 2 at this point.&lt;br /&gt;
&lt;br /&gt;
     STEP 5 (Rewind the tape)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
     STEP 6 (List the files)&lt;br /&gt;
&lt;br /&gt;
           # tar -tzf /dev/nst0&lt;br /&gt;
              one/&lt;br /&gt;
              one/test&lt;br /&gt;
              two/&lt;br /&gt;
&lt;br /&gt;
     STEP 7 (Restore directory &amp;quot;one&amp;quot;  into directory &amp;quot;junk&amp;quot;).  Note, you&lt;br /&gt;
          have to first rewind the tape, since the last operation moved&lt;br /&gt;
          ahead 2 blocks. Check this with &amp;quot;mt -f /dev/nst0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           # cd junk&lt;br /&gt;
           # mt -f /dev/nst0 rewind&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
              At block 0.&lt;br /&gt;
           # tar -xzf /dev/nst0 one&lt;br /&gt;
&lt;br /&gt;
     STEP 8 (Next, take a look to see what block the tape is at)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
              At block 2.&lt;br /&gt;
&lt;br /&gt;
     STEP 9 (Now backup directories three  and four)&lt;br /&gt;
&lt;br /&gt;
           # tar -czf /dev/nst0 three four&lt;br /&gt;
&lt;br /&gt;
       After backing up the files, the tape should be past block 2.&lt;br /&gt;
       Check this.&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
             At block 4.&lt;br /&gt;
&lt;br /&gt;
          Currently the following exist:&lt;br /&gt;
&lt;br /&gt;
                At block 1:&lt;br /&gt;
                     one/&lt;br /&gt;
                    one/test&lt;br /&gt;
                    two/&lt;br /&gt;
&lt;br /&gt;
                At block 2:&lt;br /&gt;
                    three/&lt;br /&gt;
                    three/samplehere&lt;br /&gt;
                    four/&lt;br /&gt;
&lt;br /&gt;
                At block 4:&lt;br /&gt;
                    (* This is empty *)&lt;br /&gt;
&lt;br /&gt;
     A few notes. You can set the blocking factor and a label&lt;br /&gt;
     with tar. For example:&lt;br /&gt;
&lt;br /&gt;
      $ tar --label=&amp;quot;temp label&amp;quot; --create  --blocking-factor=128 --file=/dev/nst0 Notes&lt;br /&gt;
&lt;br /&gt;
     But note if you try to read it with the default, incorrect blocking&lt;br /&gt;
     factor, then, you will get the following error:&lt;br /&gt;
&lt;br /&gt;
        $ tar -t   --file=/dev/nst0&lt;br /&gt;
        tar: /dev/nst0: Cannot read: Cannot allocate memory&lt;br /&gt;
        tar: At beginning of tape, quitting now&lt;br /&gt;
        tar: Error is not recoverable: exiting now&lt;br /&gt;
&lt;br /&gt;
     However this is easily fixed with the correct blocking factor&lt;br /&gt;
&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ tar -t --blocking-factor=128 --file=/dev/nst0&lt;br /&gt;
         temp label&lt;br /&gt;
         Notes&lt;br /&gt;
&lt;br /&gt;
     Take advantage of the label command.&lt;br /&gt;
&lt;br /&gt;
         $ MYCOMMENTS=&amp;quot;Big_important_tape&amp;quot;&lt;br /&gt;
         $ tar --label=&amp;quot;$(date +%F)&amp;quot;+&amp;quot;${MYCOMMENTS}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Writing to tape on a remote 192.168.1.155 computer&lt;br /&gt;
&lt;br /&gt;
         $ tar cvzf - ./tmp | ssh -l chirico 192.168.1.155 '(mt -f /dev/nst0 rewind; dd of=/dev/st0 )'&lt;br /&gt;
&lt;br /&gt;
     Restoring the contents from tape on a remote computer&lt;br /&gt;
&lt;br /&gt;
         $ ssh -l chirico 192.168.1.155 '(mt -f /dev/nst0 rewind; dd if=/dev/st0  )'|tar xzf -&lt;br /&gt;
&lt;br /&gt;
     Getting data off of tape with dd command with odd blocking factor. Just set ibs very high&lt;br /&gt;
&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ tar --label=&amp;quot;Contenets of Notes&amp;quot; --create  --blocking-factor=128 --file=/dev/nst0 Notes&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ dd ibs=1048576 if=/dev/st0 of=notes.tar&lt;br /&gt;
&lt;br /&gt;
     The above will probably work with ibs=64k as well&lt;br /&gt;
&lt;br /&gt;
        (Also see TIP 136)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 18:&lt;br /&gt;
&lt;br /&gt;
     Encrypting Data to Tape using &amp;quot;tar&amp;quot; and &amp;quot;openssl&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     The following shows an example of writing the contents of &amp;quot;tapetest&amp;quot; to tape:&lt;br /&gt;
&lt;br /&gt;
        $ tar zcvf - tapetest|openssl des3 -salt  -k secretpassword | dd of=/dev/st0&lt;br /&gt;
&lt;br /&gt;
     Reading the data back:&lt;br /&gt;
&lt;br /&gt;
        $ dd if=/dev/st0|openssl des3 -d -k secretpassword|tar xzf -&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 19:&lt;br /&gt;
&lt;br /&gt;
     Mounting an ISO Image as a Filesystem -- this is great if you don't have the DVD&lt;br /&gt;
         hardware, but, need to get at the data.  The following show an example of&lt;br /&gt;
         mounting the Fedora core 2 as a file.&lt;br /&gt;
&lt;br /&gt;
         $ mkdir /iso0&lt;br /&gt;
         $ mount -o loop -t iso9660 /FC2-i386-DVD.iso  /iso0&lt;br /&gt;
&lt;br /&gt;
     Or to mount automatically at boot, add the following to &amp;quot;/etc/fstab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         /FC2-i386-DVD.iso /iso0     iso9660 rw,loop  0 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Reference: http://umn.dl.sourceforge.net/sourceforge/souptonuts/README_fedora.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 20:&lt;br /&gt;
&lt;br /&gt;
     Getting Information about the Hard drive and list all PCI devices.&lt;br /&gt;
&lt;br /&gt;
                $ hdparm /dev/hda&lt;br /&gt;
&lt;br /&gt;
                  /dev/hda:&lt;br /&gt;
                   multcount    = 16 (on)&lt;br /&gt;
                   IO_support   =  0 (default 16-bit)&lt;br /&gt;
                   unmaskirq    =  0 (off)&lt;br /&gt;
                   using_dma    =  1 (on)&lt;br /&gt;
                   keepsettings =  0 (off)&lt;br /&gt;
                   readonly     =  0 (off)&lt;br /&gt;
                   readahead    = 256 (on)&lt;br /&gt;
                   geometry     = 16383/255/63, sectors = 234375000, start = 0&lt;br /&gt;
&lt;br /&gt;
            or for SCSI&lt;br /&gt;
&lt;br /&gt;
                $ hdparm /dev/sda&lt;br /&gt;
&lt;br /&gt;
            Try it with the -i option for information&lt;br /&gt;
&lt;br /&gt;
                $ hdparm -i /dev/hda&lt;br /&gt;
&lt;br /&gt;
                /dev/hda:&lt;br /&gt;
&lt;br /&gt;
                Model=IC35L120AVV207-1, FwRev=V24OA66A, SerialNo=VNVD09G4CZ6E0T&lt;br /&gt;
                Config={ HardSect NotMFM HdSw&amp;gt;15uSec Fixed DTR&amp;gt;10Mbs }&lt;br /&gt;
                RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=52&lt;br /&gt;
                BuffType=DualPortCache, BuffSize=7965kB, MaxMultSect=16, MultSect=16&lt;br /&gt;
                CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=234375000&lt;br /&gt;
                IORDY=on/off, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}&lt;br /&gt;
                PIO modes:  pio0 pio1 pio2 pio3 pio4&lt;br /&gt;
                DMA modes:  mdma0 mdma1 mdma2&lt;br /&gt;
                UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5&lt;br /&gt;
                AdvancedPM=yes: disabled (255) WriteCache=enabled&lt;br /&gt;
                Drive conforms to: ATA/ATAPI-6 T13 1410D revision 3a:  2 3 4 5 6&lt;br /&gt;
&lt;br /&gt;
            How fast is your drive?&lt;br /&gt;
&lt;br /&gt;
                $ hdparm -tT /dev/hda&lt;br /&gt;
&lt;br /&gt;
                /dev/hda:&lt;br /&gt;
                Timing buffer-cache reads:   128 MB in  0.41 seconds =315.32 MB/sec&lt;br /&gt;
                Timing buffered disk reads:  64 MB in  1.19 seconds = 53.65 MB/sec&lt;br /&gt;
&lt;br /&gt;
            Need to find your device?&lt;br /&gt;
&lt;br /&gt;
                $ mount&lt;br /&gt;
                   or&lt;br /&gt;
                $ cat /proc/partitions&lt;br /&gt;
                   or&lt;br /&gt;
                $ dmesg | egrep '^(s|h)d'&lt;br /&gt;
&lt;br /&gt;
                   which for my system lists:&lt;br /&gt;
&lt;br /&gt;
                      hda: IC35L120AVV207-1, ATA DISK drive&lt;br /&gt;
                      hdc: Lite-On LTN486S 48x Max, ATAPI CD/DVD-ROM drive&lt;br /&gt;
                      hda: max request size: 1024KiB&lt;br /&gt;
                      hda: 234375000 sectors (120000 MB) w/7965KiB Cache, CHS=16383/255/63, UDMA(100)&lt;br /&gt;
&lt;br /&gt;
             By the way, if you want to turn on dma&lt;br /&gt;
&lt;br /&gt;
                 $ hdparm -d1 /dev/hda&lt;br /&gt;
                   setting using_dma to 1 (on)&lt;br /&gt;
                   using_dma    =  1 (on)&lt;br /&gt;
&lt;br /&gt;
         (Also see TIP 122 )&lt;br /&gt;
&lt;br /&gt;
     List all PCI devices&lt;br /&gt;
&lt;br /&gt;
                $ lspci -v&lt;br /&gt;
&lt;br /&gt;
          00:00.0 Host bridge: Intel Corp. 82845G/GL [Brookdale-G] Chipset Host Bridge (rev&lt;br /&gt;
                  Subsystem: Dell Computer Corporation: Unknown device 0160&lt;br /&gt;
                  Flags: bus master, fast devsel, latency 0&lt;br /&gt;
                  Memory at f0000000 (32-bit, prefetchable) [size=128M]&lt;br /&gt;
                  Capabilities: &amp;lt;available only to root&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              ... lots more ...&lt;br /&gt;
&lt;br /&gt;
           Note, there is also lspci -vv for even more information.&lt;br /&gt;
&lt;br /&gt;
          (Also see TIP 200)&lt;br /&gt;
&lt;br /&gt;
TIP 21:&lt;br /&gt;
&lt;br /&gt;
     Setting up &amp;quot;cron&amp;quot; Jobs.&lt;br /&gt;
&lt;br /&gt;
     If you want to use the emacs editor for editing cron jobs, then,&lt;br /&gt;
     set the following in your &amp;quot;/home/user/.bash_profile&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        EDITOR=emacs&lt;br /&gt;
&lt;br /&gt;
     Then, to edit cron jobs&lt;br /&gt;
&lt;br /&gt;
        $ crontab -e&lt;br /&gt;
&lt;br /&gt;
     You may want to put in the following header&lt;br /&gt;
&lt;br /&gt;
        #MINUTE(0-59) HOUR(0-23) DAYOFMONTH(1-31) MONTHOFYEAR(1-12) DAYOFWEEK(0-6) Note 0=Sun and 7=Sun&lt;br /&gt;
        #&lt;br /&gt;
        #14,15 10 * * 0   /usr/bin/somecommmand  &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     The sample &amp;quot;commented out command&amp;quot; will run at 10:14 and 10:15 every Sunday.  There will&lt;br /&gt;
     be no &amp;quot;mail&amp;quot; sent to the user because of the &amp;quot;&amp;gt;/dev/null 2&amp;gt;&amp;amp;1&amp;quot; entry.&lt;br /&gt;
&lt;br /&gt;
        $ crontab -l&lt;br /&gt;
&lt;br /&gt;
     The above will list all cron jobs. Or if you're root&lt;br /&gt;
&lt;br /&gt;
        $ crontab -l -u &amp;lt;username&amp;gt;&lt;br /&gt;
        $ crontab -e -u &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Reference &amp;quot;man 5 crontab&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
        The time and date fields are:&lt;br /&gt;
&lt;br /&gt;
                     field          allowed values&lt;br /&gt;
                     -----          --------------&lt;br /&gt;
                     minute         0-59&lt;br /&gt;
                     hour           0-23&lt;br /&gt;
                     day of month   1-31&lt;br /&gt;
                     month          1-12 (or names, see below)&lt;br /&gt;
                     day of week    0-7 (0 or 7 is Sun, or use names)&lt;br /&gt;
&lt;br /&gt;
              A field may be an asterisk (*), which always stands for ``first-last''.&lt;br /&gt;
&lt;br /&gt;
              Ranges of numbers are allowed.  Ranges are two numbers separated with a&lt;br /&gt;
              hyphen.   The  specified  range is inclusive.  For example, 8-11 for an&lt;br /&gt;
              ``hours'' entry specifies execution at hours 8, 9, 10 and 11.&lt;br /&gt;
&lt;br /&gt;
              Lists are allowed.  A list is a set of numbers (or ranges) separated by&lt;br /&gt;
              commas.  Examples: ``1,2,5,9'', ``0-4,8-12''.&lt;br /&gt;
&lt;br /&gt;
              Ranges can include &amp;quot;steps&amp;quot;, so &amp;quot;1-9/2&amp;quot; is the same as &amp;quot;1,3,5,7,9&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Note, you can run just every 5 minutes as follows:&lt;br /&gt;
&lt;br /&gt;
              */5 * * * * /etc/mrtg/domrtg  &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     To run jobs hourly,daily,weekly or monthly you can add shell scripts into the&lt;br /&gt;
     appropriate directory:&lt;br /&gt;
&lt;br /&gt;
             /etc/cron.hourly/&lt;br /&gt;
             /etc/cron.daily/&lt;br /&gt;
             /etc/cron.weekly/&lt;br /&gt;
             /etc/cron.monthly/&lt;br /&gt;
&lt;br /&gt;
     Note that the above are pre-configured schedules set in &amp;quot;/etc/crontab&amp;quot;, so&lt;br /&gt;
     if you want, you can change the schedule. Below is my /etc/crontab:&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/crontab&lt;br /&gt;
           SHELL=/bin/bash&lt;br /&gt;
           PATH=/sbin:/bin:/usr/sbin:/usr/bin&lt;br /&gt;
           MAILTO=root&lt;br /&gt;
           HOME=/&lt;br /&gt;
&lt;br /&gt;
           # run-parts&lt;br /&gt;
           01 * * * * root run-parts /etc/cron.hourly&lt;br /&gt;
           02 4 * * * root run-parts /etc/cron.daily&lt;br /&gt;
           22 4 * * 0 root run-parts /etc/cron.weekly&lt;br /&gt;
           42 4 1 * * root run-parts /etc/cron.monthly&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 22:&lt;br /&gt;
&lt;br /&gt;
     Keeping Files in Sync Between Servers.&lt;br /&gt;
&lt;br /&gt;
     The remote computer is &amp;quot;192.168.1.171&amp;quot; and has the account &amp;quot;donkey&amp;quot;.  You want&lt;br /&gt;
     to &amp;quot;keep in sync&amp;quot; the files under &amp;quot;/home/cu2000/Logs&amp;quot; on the remote computer&lt;br /&gt;
     with files on &amp;quot;/home/chirico/dev/MEDIA_Server&amp;quot; on the local computer.&lt;br /&gt;
&lt;br /&gt;
       $ rsync  -Lae ssh  donkey@192.168.1.171:/home/cu2000/Logs /home/chirico/dev/MEDIA_Server&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;rsync&amp;quot; is a convient command for keeping files in sync, and as shown here will work&lt;br /&gt;
     through ssh.  The -L option tells rsync to treat symbolic links like ordinary files.&lt;br /&gt;
&lt;br /&gt;
        Also see [http://www.rsnapshot.org/]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 23:&lt;br /&gt;
&lt;br /&gt;
     Looking up the Spelling of a Word.&lt;br /&gt;
&lt;br /&gt;
        $ look &amp;lt;partial spelling&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     so the following will list all words that&lt;br /&gt;
     start with stuff&lt;br /&gt;
&lt;br /&gt;
        $ look stuff&lt;br /&gt;
           stuff&lt;br /&gt;
           stuffage&lt;br /&gt;
           stuffata&lt;br /&gt;
           stuffed&lt;br /&gt;
           stuffender&lt;br /&gt;
           stuffer&lt;br /&gt;
           stuffers&lt;br /&gt;
           stuffgownsman&lt;br /&gt;
           stuffier&lt;br /&gt;
           stuffiest&lt;br /&gt;
           stuffily&lt;br /&gt;
           stuffiness&lt;br /&gt;
           stuffinesses&lt;br /&gt;
           stuffiness's&lt;br /&gt;
           stuffing&lt;br /&gt;
           stuffings&lt;br /&gt;
           stuffing's&lt;br /&gt;
           stuffless&lt;br /&gt;
           stuffs&lt;br /&gt;
           stuffy&lt;br /&gt;
&lt;br /&gt;
     It helps to have a large &amp;quot;linuxwords&amp;quot; dictionary.  You can download&lt;br /&gt;
     a much bigger dictionary from the following:&lt;br /&gt;
&lt;br /&gt;
              http://prdownloads.sourceforge.net/souptonuts/linuxwords.1.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
     Note: vim users can setup the .vimrc file with the following. Now when you type &lt;br /&gt;
       CTL-X CTL-T in insert mode, you'll get a thesaurus lookup.&lt;br /&gt;
&lt;br /&gt;
           set dictionary+=/usr/share/dict/words&lt;br /&gt;
           set thesaurus+=/usr/share/dict/words&lt;br /&gt;
&lt;br /&gt;
     Or, you can call aspell with the F6 command after putting the folling entry in your&lt;br /&gt;
     .vimrc file&lt;br /&gt;
&lt;br /&gt;
           :nmap &amp;lt;F6&amp;gt; :w&amp;lt;CR&amp;gt;:!aspell -e -c %&amp;lt;CR&amp;gt;:e&amp;lt;CR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Now, hit F6 when you're in vim, and you'll get a spell checker.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     There is also an X Windows dictionary that runs with the following command.&lt;br /&gt;
&lt;br /&gt;
           $ gnome-dictionary&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 24:&lt;br /&gt;
&lt;br /&gt;
     Find out if a Command is Aliased.&lt;br /&gt;
&lt;br /&gt;
         $ type -all &amp;lt;command&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Example:&lt;br /&gt;
&lt;br /&gt;
         $ type -all ls&lt;br /&gt;
            ls is aliased to `ls --color=tty'&lt;br /&gt;
            ls is /bin/ls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 25:&lt;br /&gt;
&lt;br /&gt;
     Create a Terminal Calculator&lt;br /&gt;
&lt;br /&gt;
      Put the following in your .bashrc file&lt;br /&gt;
&lt;br /&gt;
            function calc&lt;br /&gt;
            {&lt;br /&gt;
             echo &amp;quot;${1}&amp;quot;|bc -l;&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
      Or, run it at the shell prompt. Now&lt;br /&gt;
      &amp;quot;calc&amp;quot; from the shell will work as follows:&lt;br /&gt;
&lt;br /&gt;
            $ calc 3+45&lt;br /&gt;
               48&lt;br /&gt;
&lt;br /&gt;
      All functions  with a &amp;quot;(&amp;quot; or &amp;quot;)&amp;quot; must be enclosed&lt;br /&gt;
      in quotes.  For instance, to get the sin of .4&lt;br /&gt;
&lt;br /&gt;
            $ calc &amp;quot;s(.4)&amp;quot;&lt;br /&gt;
              .38941834230865049166&lt;br /&gt;
&lt;br /&gt;
          (See TIP 115 using the expr command)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 26:&lt;br /&gt;
&lt;br /&gt;
     Kill a User and All Their Current Processes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        #  This program will kill all processes from a&lt;br /&gt;
        #  user.  The user name is read from the command line.&lt;br /&gt;
        #&lt;br /&gt;
        #  This program also demonstrates reading a bash variable&lt;br /&gt;
        #  into an awk script.&lt;br /&gt;
        #&lt;br /&gt;
        #  Usage: kill9user &amp;lt;user&amp;gt;&lt;br /&gt;
        #&lt;br /&gt;
        kill -9 `ps aux|awk -v var=$1 '$1==var { print $2 }'`&lt;br /&gt;
&lt;br /&gt;
    or if you want want to create the above script the command&lt;br /&gt;
    below will kill the user &amp;quot;donkey&amp;quot; and all of his processes.&lt;br /&gt;
&lt;br /&gt;
        $ kill -9 `ps aux|awk -v var=&amp;quot;donkey&amp;quot; '$1==var { print $2 }'`&lt;br /&gt;
&lt;br /&gt;
    Check their cron jobs and &amp;quot;at&amp;quot; jobs, if you have a security issue.&lt;br /&gt;
&lt;br /&gt;
          $ crontab -u &amp;lt;user&amp;gt; -e&lt;br /&gt;
&lt;br /&gt;
    Lock the account:&lt;br /&gt;
&lt;br /&gt;
          $ passwd -l &amp;lt;user&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Remove all authorized_keys&lt;br /&gt;
&lt;br /&gt;
          $ rm /home/user/.shosts&lt;br /&gt;
          $ rm /home/user/.rhosts&lt;br /&gt;
          $ rm -rf /home/user/.ssh&lt;br /&gt;
          $ rm /home/user/.forward&lt;br /&gt;
&lt;br /&gt;
      or consider&lt;br /&gt;
&lt;br /&gt;
          $ mv /home/user  /home/safeuser&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Change the shell&lt;br /&gt;
&lt;br /&gt;
          $ chsh -s /bin/true &amp;lt;user&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Do an inventory&lt;br /&gt;
&lt;br /&gt;
          $ find / -user &amp;lt;user&amp;gt;  &amp;gt; list_of_user_files&lt;br /&gt;
&lt;br /&gt;
    NOTE: Also see (TIP 10).&lt;br /&gt;
&lt;br /&gt;
    To see all users, except the current user. Do not use the&lt;br /&gt;
    dash &amp;quot;ps -aux&amp;quot; is wrong but the following is correct:&lt;br /&gt;
&lt;br /&gt;
          $ ps aux| awk '!/'${USER}'/{printf(&amp;quot;%s \n&amp;quot;,$0)}'&lt;br /&gt;
&lt;br /&gt;
     or (ww = wide, wide output)&lt;br /&gt;
&lt;br /&gt;
          $ ps auwwx| awk '!/'${USER}'/{printf(&amp;quot;%s \n&amp;quot;,$0)}'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    The following codes may be useful:&lt;br /&gt;
&lt;br /&gt;
       D    Uninterruptible sleep (usually IO)&lt;br /&gt;
       R    Running or runnable (on run queue)&lt;br /&gt;
       S    Interruptible sleep (waiting for an event to complete)&lt;br /&gt;
       T    Stopped, either by a job control signal or because it is being traced.&lt;br /&gt;
       W    paging (not valid since the 2.6.xx kernel)&lt;br /&gt;
       X    dead (should never be seen)&lt;br /&gt;
       Z    Defunct (&amp;quot;zombie&amp;quot;) process, terminated but not reaped by its parent.&lt;br /&gt;
&lt;br /&gt;
    For BSD formats and when the stat keyword is used, additional&lt;br /&gt;
       characters may be displayed:&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;    high-priority (not nice to other users)&lt;br /&gt;
       N    low-priority (nice to other users)&lt;br /&gt;
       L    has pages locked into memory (for real-time and custom IO)&lt;br /&gt;
       s    is a session leader&lt;br /&gt;
       l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)&lt;br /&gt;
       +    is in the foreground process group&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Also see TIP 28. and TIP 89.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 27:&lt;br /&gt;
&lt;br /&gt;
     Format Dates for Logs and Files&lt;br /&gt;
&lt;br /&gt;
         $ date &amp;quot;+%m%d%y %A,%B %d %Y %X&amp;quot;&lt;br /&gt;
             061704 Thursday,June 17 2004 07:13:40 PM&lt;br /&gt;
&lt;br /&gt;
         $ date &amp;quot;+%m%d%Y&amp;quot;&lt;br /&gt;
             06172004&lt;br /&gt;
&lt;br /&gt;
         $ date -d '1 day ago' &amp;quot;+%m%d%Y&amp;quot;&lt;br /&gt;
             06162004&lt;br /&gt;
&lt;br /&gt;
         $ date -d '3 months 1 day  2 hour  15 minutes 2 seconds ago'&lt;br /&gt;
&lt;br /&gt;
      or to go into the future remove the &amp;quot;ago&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         $ date -d '3 months 1 day  2 hour  15 minutes 2 seconds '&lt;br /&gt;
&lt;br /&gt;
            Also the following works:&lt;br /&gt;
&lt;br /&gt;
                $ date -d '+2 year +1 month -1 week  +3 day -8 hour +2 min -5 seconds'&lt;br /&gt;
&lt;br /&gt;
      Quick question: If there are 100,000,000 stars in the visible sky, and you can&lt;br /&gt;
      count them, round the clock, at a rate of a star per second starting now, when&lt;br /&gt;
      would you finish counting?  Would you still be alive?&lt;br /&gt;
&lt;br /&gt;
                $ date -d '+100000000 seconds'&lt;br /&gt;
&lt;br /&gt;
      Sooner than you think!&lt;br /&gt;
&lt;br /&gt;
      This can be assigned to variables&lt;br /&gt;
&lt;br /&gt;
         $ mdate=`date -d '3 months 1 day  2 hour  15 minutes 2 seconds ' &amp;quot;+%m%d%Y_%A_%B_%D_%Y_%X&amp;quot;  `&lt;br /&gt;
         $ echo $mdate&lt;br /&gt;
             09182004_Saturday_September_09/18/04_2004_09:40:41 PM&lt;br /&gt;
             ^---- Easy to sort   ^-------^----- Easy to read&lt;br /&gt;
&lt;br /&gt;
      See TIP 28 below.&lt;br /&gt;
&lt;br /&gt;
      See TIP 87 when working with large delta time changes -40 years, or -200 years ago, or even&lt;br /&gt;
      1,000,000 days into the future.&lt;br /&gt;
&lt;br /&gt;
      Also see (TIP 1) for working with time zones.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 28:&lt;br /&gt;
&lt;br /&gt;
     Need Ascii Codes? For instance, for printing quotes:&lt;br /&gt;
&lt;br /&gt;
                         awk 'BEGIN { msg = &amp;quot;Don\047t Panic!&amp;quot;; printf &amp;quot;%s \n&amp;quot;,msg }'&lt;br /&gt;
              or&lt;br /&gt;
                         awk 'BEGIN { msg = &amp;quot;Don\x027t Panic!&amp;quot;; printf &amp;quot;%s \n&amp;quot;,msg }'&lt;br /&gt;
&lt;br /&gt;
     It's better to use \047, because certain characters that follow \x027 may cause problems.&lt;br /&gt;
&lt;br /&gt;
     For example, take a look at the following two lines. The first line prints a &amp;quot;}&amp;quot; caused&lt;br /&gt;
     by the extra D in \x027D. The the line immediately below does not work as expected.&lt;br /&gt;
&lt;br /&gt;
                      awk 'BEGIN {printf(&amp;quot;The D causes problems \x027D\n&amp;quot;)}'&lt;br /&gt;
&lt;br /&gt;
            However, the line below works fine:&lt;br /&gt;
&lt;br /&gt;
                      awk 'BEGIN {printf(&amp;quot;The D does not cause problems \047D\n&amp;quot;)}'&lt;br /&gt;
&lt;br /&gt;
     Or if you wanted to use the date command in &amp;quot;awk&amp;quot; to print date.time.nanosecond.timezone for&lt;br /&gt;
     each line of a file &amp;quot;test&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     The following date can be used in awk because the single quotes are enclosed within the&lt;br /&gt;
     double quotes.&lt;br /&gt;
&lt;br /&gt;
             date '+%m%d%Y.%H%M%S.%N%z'&lt;br /&gt;
&lt;br /&gt;
       $ awk 'BEGIN { &amp;quot;date '+%m%d%Y.%H%M%S.%N%z'&amp;quot; | getline MyDate  } { print MyDate,$0 }' &amp;lt; data&lt;br /&gt;
&lt;br /&gt;
     But it's also possible to replace  &amp;quot;+&amp;quot;  with  \x2B,  &amp;quot;%&amp;quot; with \x25, and &amp;quot;d&amp;quot; with \x64 as follows:&lt;br /&gt;
&lt;br /&gt;
       $ awk 'BEGIN { &amp;quot;date \x27\x2B\x25m\x25\x64\x25Y.\x25H\x25M\x25S.\x25N\x25z\x27&amp;quot; | getline MyDate  } { print MyDate,$0 }' &amp;lt; test&lt;br /&gt;
&lt;br /&gt;
             07062004.113820.346033000-0400 bob 71&lt;br /&gt;
             07062004.113820.346033000-0400 tom 43&lt;br /&gt;
             07062004.113820.346033000-0400 sal 34&lt;br /&gt;
             07062004.113820.346033000-0400 bob 89&lt;br /&gt;
             07062004.113820.346033000-0400 tom 66&lt;br /&gt;
             07062004.113820.346033000-0400 sal 99&lt;br /&gt;
&lt;br /&gt;
     For this example it's not needed because single quotes are used inside of double quotes; however, there may be times when&lt;br /&gt;
     hex replacement is easier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ man ascii&lt;br /&gt;
&lt;br /&gt;
        Oct   Dec   Hex   Char           Oct   Dec   Hex   Char&lt;br /&gt;
            -----------------------------------------------------------&lt;br /&gt;
            000   0     00    NUL '\0'       100   64    40    @&lt;br /&gt;
            001   1     01    SOH            101   65    41    A&lt;br /&gt;
            002   2     02    STX            102   66    42    B&lt;br /&gt;
            003   3     03    ETX            103   67    43    C&lt;br /&gt;
            004   4     04    EOT            104   68    44    D&lt;br /&gt;
            005   5     05    ENQ            105   69    45    E&lt;br /&gt;
            006   6     06    ACK            106   70    46    F&lt;br /&gt;
            007   7     07    BEL '\a'       107   71    47    G&lt;br /&gt;
            010   8     08    BS  '\b'       110   72    48    H&lt;br /&gt;
            011   9     09    HT  '\t'       111   73    49    I&lt;br /&gt;
            012   10    0A    LF  '\n'       112   74    4A    J&lt;br /&gt;
            013   11    0B    VT  '\v'       113   75    4B    K&lt;br /&gt;
            014   12    0C    FF  '\f'       114   76    4C    L&lt;br /&gt;
            015   13    0D    CR  '\r'       115   77    4D    M&lt;br /&gt;
            016   14    0E    SO             116   78    4E    N&lt;br /&gt;
            017   15    0F    SI             117   79    4F    O&lt;br /&gt;
            020   16    10    DLE            120   80    50    P&lt;br /&gt;
            021   17    11    DC1            121   81    51    Q&lt;br /&gt;
            022   18    12    DC2            122   82    52    R&lt;br /&gt;
            023   19    13    DC3            123   83    53    S&lt;br /&gt;
            024   20    14    DC4            124   84    54    T&lt;br /&gt;
            025   21    15    NAK            125   85    55    U&lt;br /&gt;
            026   22    16    SYN            126   86    56    V&lt;br /&gt;
            027   23    17    ETB            127   87    57    W&lt;br /&gt;
            030   24    18    CAN            130   88    58    X&lt;br /&gt;
            031   25    19    EM             131   89    59    Y&lt;br /&gt;
            032   26    1A    SUB            132   90    5A    Z&lt;br /&gt;
            033   27    1B    ESC            133   91    5B    [&lt;br /&gt;
            034   28    1C    FS             134   92    5C    \   '\\'&lt;br /&gt;
            035   29    1D    GS             135   93    5D    ]&lt;br /&gt;
            036   30    1E    RS             136   94    5E    ^&lt;br /&gt;
            037   31    1F    US             137   95    5F    _&lt;br /&gt;
            040   32    20    SPACE          140   96    60    `&lt;br /&gt;
            041   33    21    !              141   97    61    a&lt;br /&gt;
            042   34    22    &amp;quot;              142   98    62    b&lt;br /&gt;
            043   35    23    #              143   99    63    c&lt;br /&gt;
            044   36    24    $              144   100   64    d&lt;br /&gt;
            045   37    25    %              145   101   65    e&lt;br /&gt;
            046   38    26    &amp;amp;              146   102   66    f&lt;br /&gt;
            047   39    27    '              147   103   67    g&lt;br /&gt;
            050   40    28    (              150   104   68    h&lt;br /&gt;
            051   41    29    )              151   105   69    i&lt;br /&gt;
            052   42    2A    *              152   106   6A    j&lt;br /&gt;
            053   43    2B    +              153   107   6B    k&lt;br /&gt;
            054   44    2C    ,              154   108   6C    l&lt;br /&gt;
            055   45    2D    -              155   109   6D    m&lt;br /&gt;
            056   46    2E    .              156   110   6E    n&lt;br /&gt;
            057   47    2F    /              157   111   6F    o&lt;br /&gt;
            060   48    30    0              160   112   70    p&lt;br /&gt;
            061   49    31    1              161   113   71    q&lt;br /&gt;
            062   50    32    2              162   114   72    r&lt;br /&gt;
            063   51    33    3              163   115   73    s&lt;br /&gt;
            064   52    34    4              164   116   74    t&lt;br /&gt;
            065   53    35    5              165   117   75    u&lt;br /&gt;
            066   54    36    6              166   118   76    v&lt;br /&gt;
            067   55    37    7              167   119   77    w&lt;br /&gt;
            070   56    38    8              170   120   78    x&lt;br /&gt;
            071   57    39    9              171   121   79    y&lt;br /&gt;
            072   58    3A    :              172   122   7A    z&lt;br /&gt;
            073   59    3B    ;              173   123   7B    {&lt;br /&gt;
            074   60    3C    &amp;lt;              174   124   7C    |&lt;br /&gt;
            075   61    3D    =              175   125   7D    }&lt;br /&gt;
            076   62    3E    &amp;gt;              176   126   7E    ~&lt;br /&gt;
            077   63    3F    ?              177   127   7F    DEL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 29:&lt;br /&gt;
&lt;br /&gt;
     Need a WWW Browser for the Terminal Session? Try lynx or elinks.&lt;br /&gt;
&lt;br /&gt;
         $ lynx&lt;br /&gt;
&lt;br /&gt;
     Or to read all these tips, with the latest updates&lt;br /&gt;
&lt;br /&gt;
      $ lynx http://umn.dl.sourceforge.net/sourceforge/souptonuts/How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Or, better yet elinks.&lt;br /&gt;
&lt;br /&gt;
         $ elinks http://somepage.&lt;br /&gt;
&lt;br /&gt;
     You can get elinks at the following site:&lt;br /&gt;
&lt;br /&gt;
             http://elinks.or.cz/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 30:&lt;br /&gt;
&lt;br /&gt;
    screen - screen manager with VT100/ANSI terminal emulation&lt;br /&gt;
&lt;br /&gt;
         This is an excellent utility. But if you work a lot in Emacs,&lt;br /&gt;
         then, you should place the following in your ~./.bashrc&lt;br /&gt;
&lt;br /&gt;
             alias s='screen -e^Pa -D -R'&lt;br /&gt;
&lt;br /&gt;
         After loging in again (or source .bashrc) ,&lt;br /&gt;
         type the following to load &amp;quot;screen&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
             $ s&lt;br /&gt;
&lt;br /&gt;
         If you're using the not using the alias command above, substitute&lt;br /&gt;
         CTL-a for CTL-p below. :&lt;br /&gt;
&lt;br /&gt;
             CTL-p CTL-C       To get a new session&lt;br /&gt;
             CTL-p  &amp;quot;           To list sessions, and arrow keys to move&lt;br /&gt;
             CTL-p SHFT-A      To name sessions&lt;br /&gt;
             CTL-p S            To split screens&lt;br /&gt;
             CLT-p Q            To unsplit screens&lt;br /&gt;
             CLT-p TAB          To switch between screens&lt;br /&gt;
             CLT-p :resize n    To resize screen to n rows, on split screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Screen is very powerful.  Should you become disconneced, you can&lt;br /&gt;
         still resume work after loggin in.&lt;br /&gt;
&lt;br /&gt;
             $ man screen&lt;br /&gt;
&lt;br /&gt;
         The above command will give you more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 31:&lt;br /&gt;
&lt;br /&gt;
     Need to Find the Factors of a Number?&lt;br /&gt;
&lt;br /&gt;
           $ factor 2345678992&lt;br /&gt;
                2345678992: 2 2 2 2 6581 22277&lt;br /&gt;
&lt;br /&gt;
     It's a quick way to find out if a number is prime&lt;br /&gt;
&lt;br /&gt;
           $ factor 7867&lt;br /&gt;
                7867: 7867&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 32:&lt;br /&gt;
&lt;br /&gt;
     Less is More -- piping to less to scroll backword and forward&lt;br /&gt;
&lt;br /&gt;
      For large &amp;quot;ls&amp;quot; listings try the followin, then, use the arrow key&lt;br /&gt;
      to move up and down the list.&lt;br /&gt;
&lt;br /&gt;
           $ ls /some_large_dir/ | less&lt;br /&gt;
&lt;br /&gt;
                 or&lt;br /&gt;
&lt;br /&gt;
           $ cat some_large_file | less&lt;br /&gt;
&lt;br /&gt;
                 or&lt;br /&gt;
&lt;br /&gt;
           $ less some_large_file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 33:&lt;br /&gt;
&lt;br /&gt;
     C &amp;quot;indent&amp;quot; Settings for Kernel Development&lt;br /&gt;
&lt;br /&gt;
           $ indent -kr -i8  program.c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 34:&lt;br /&gt;
&lt;br /&gt;
     FTP auto-login.  &amp;quot;ftp&amp;quot; to a site and have the password stored.&lt;br /&gt;
&lt;br /&gt;
     For instance, here's a sample &amp;quot;.net&amp;quot; file in a user's home&lt;br /&gt;
     directory for uploading to sourceforge. Note, sourceforge will&lt;br /&gt;
     take any password, so m@temp.com is used here for login &amp;quot;anonymous&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ cat ~/.netrc&lt;br /&gt;
               machine upload.sourceforge.net login anonymous password m@temp.com&lt;br /&gt;
               default login anonymous password user@site&lt;br /&gt;
&lt;br /&gt;
     It might be a good idea to change the rights on this file&lt;br /&gt;
&lt;br /&gt;
           $ chmod 0400 ~/.netrc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         #!/bin/bash&lt;br /&gt;
         #&lt;br /&gt;
         #  Sample ftp automated script to download&lt;br /&gt;
         #  file to ${dwnld}&lt;br /&gt;
         #&lt;br /&gt;
         dwnld=&amp;quot;/work/faq/unix-faq&amp;quot;&lt;br /&gt;
         cd ${dwnld}&lt;br /&gt;
         ftp &amp;lt;&amp;lt; FTPSTRING&lt;br /&gt;
         prompt off&lt;br /&gt;
         open rtfm.mit.edu&lt;br /&gt;
         cd /pub/usenet-by-group/news.answers/unix-faq/faq&lt;br /&gt;
         mget contents&lt;br /&gt;
         mget diff&lt;br /&gt;
         mget part*&lt;br /&gt;
         bye&lt;br /&gt;
         FTPSTRING&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      (Also see TIP 114 for ncftpget, which is a very powerful restarting&lt;br /&gt;
                            ftp program)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 35:&lt;br /&gt;
&lt;br /&gt;
     Bash Brace Expansion&lt;br /&gt;
&lt;br /&gt;
           $ echo f{ee,ie,oe,um}&lt;br /&gt;
                fee fie foe fum&lt;br /&gt;
&lt;br /&gt;
     This works with almost any command&lt;br /&gt;
&lt;br /&gt;
           $ mkdir -p /work/junk/{one,two,three,four}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 36:&lt;br /&gt;
&lt;br /&gt;
     Getting a List of Users on the System&lt;br /&gt;
&lt;br /&gt;
           $ cut -d: -f1 /etc/passwd | sort&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 37:&lt;br /&gt;
&lt;br /&gt;
     Editing a Bash Command&lt;br /&gt;
&lt;br /&gt;
      Try typing a long command say, then, type &amp;quot;fc&amp;quot; for an easy way&lt;br /&gt;
      to edit the command.&lt;br /&gt;
&lt;br /&gt;
           $ find /etc -iname '*.cnf' -exec grep -H 'log' {} \;&lt;br /&gt;
           $ fc&lt;br /&gt;
&lt;br /&gt;
      &amp;quot;fc&amp;quot; will bring the last command typed into an editor, &amp;quot;emacs&amp;quot; if&lt;br /&gt;
      that's the default editor. Type &amp;quot;fc -l&amp;quot; to list last few commands.&lt;br /&gt;
&lt;br /&gt;
      To seach for a command, try typing &amp;quot;CTL-r&amp;quot; at the shell prompt for&lt;br /&gt;
      searching. &amp;quot;CTL-t&amp;quot; to transpose, say &amp;quot;sl&amp;quot; was typed by you want &amp;quot;ls&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Hints when using &amp;quot;fc: in emacs:&lt;br /&gt;
&lt;br /&gt;
           ESC-b     move one word backward&lt;br /&gt;
           ESC-f     move one word forward&lt;br /&gt;
           ESC-DEL   kill one word backward&lt;br /&gt;
           CTL-k     kill point to end&lt;br /&gt;
           CTL-y     un-yank killed region at point&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 38:&lt;br /&gt;
&lt;br /&gt;
     Moving around Directories.&lt;br /&gt;
&lt;br /&gt;
     Change to the home directory:&lt;br /&gt;
          $ cd ~&lt;br /&gt;
            or&lt;br /&gt;
          $ cd&lt;br /&gt;
&lt;br /&gt;
     To go back to the last directory&lt;br /&gt;
          $ cd -&lt;br /&gt;
&lt;br /&gt;
     Instead of &amp;quot;cd&amp;quot; to a directory try &amp;quot;pushd&amp;quot; and look&lt;br /&gt;
     at the heading...you can see a list of directories.&lt;br /&gt;
&lt;br /&gt;
          $ pushd /etc&lt;br /&gt;
          $ pushd /usr/local&lt;br /&gt;
&lt;br /&gt;
      Then, to get back &amp;quot;popd&amp;quot; or &amp;quot;popd 1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      To list all the directories pushed on the stack&lt;br /&gt;
      use the &amp;quot;dirs -v&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
          $ dirs -v&lt;br /&gt;
           0  /usr/local&lt;br /&gt;
           1  /etc&lt;br /&gt;
           2  /work/souptonuts/documentation/theBook&lt;br /&gt;
&lt;br /&gt;
      Now, if you &amp;quot;pushd +1&amp;quot; you will be moved to &amp;quot;/etc&amp;quot;, since&lt;br /&gt;
      is number &amp;quot;1&amp;quot; on the stack, and this directory will become&lt;br /&gt;
      &amp;quot;0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ pwd&lt;br /&gt;
           /usr/local&lt;br /&gt;
          $ pushd +1&lt;br /&gt;
          $ pwd&lt;br /&gt;
           /etc&lt;br /&gt;
&lt;br /&gt;
          $ dirs -v&lt;br /&gt;
           0  /etc&lt;br /&gt;
           1  /work/souptonuts/documentation/theBook&lt;br /&gt;
           2  /usr/local&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 39:&lt;br /&gt;
&lt;br /&gt;
     Need an Underscore after a Variable?&lt;br /&gt;
&lt;br /&gt;
       Enclose the variable in &amp;quot;{}&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $echo ${UID}_&lt;br /&gt;
&lt;br /&gt;
       Compare to&lt;br /&gt;
&lt;br /&gt;
          $echo $UID_&lt;br /&gt;
&lt;br /&gt;
       Also try the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ m=&amp;quot;my stuff here&amp;quot;&lt;br /&gt;
                $ echo -e ${m// /'\n'}&lt;br /&gt;
                        my&lt;br /&gt;
                        stuff&lt;br /&gt;
                        here&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 40:&lt;br /&gt;
&lt;br /&gt;
     Bash Variable Offset and String Operators&lt;br /&gt;
&lt;br /&gt;
        $ r=&amp;quot;this is stuff&amp;quot;&lt;br /&gt;
        $ echo ${r:3}&lt;br /&gt;
        $ echo ${r:5:2}&lt;br /&gt;
&lt;br /&gt;
      Note, ${varname:offset:length}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         ${varname:?message}  If varname exist and isn't null return value, else,&lt;br /&gt;
                              print var and message.&lt;br /&gt;
&lt;br /&gt;
           $ r=&amp;quot;new stuff&amp;quot;&lt;br /&gt;
           $ echo ${r:? &amp;quot;that's r for you&amp;quot;}&lt;br /&gt;
               new stuff&lt;br /&gt;
           $ unset r&lt;br /&gt;
           $ echo ${r:? &amp;quot;that's r for you&amp;quot;}&lt;br /&gt;
               bash: r:  that's r for you&lt;br /&gt;
&lt;br /&gt;
         ${varname:+word}    If varname exist and not null return word. Else, return null.&lt;br /&gt;
&lt;br /&gt;
         ${varname:-word}    If varname exist and not null return value. Else, return word.&lt;br /&gt;
&lt;br /&gt;
      Working with arrays in bash - bash arrays.&lt;br /&gt;
&lt;br /&gt;
           $ unset p&lt;br /&gt;
           $ p=(one two three)&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[@]}&amp;quot;&lt;br /&gt;
           one two three&lt;br /&gt;
&lt;br /&gt;
      or&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[*]}&amp;quot;&lt;br /&gt;
           one two three&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${#p[@]}&amp;quot;&lt;br /&gt;
           3&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[0]}&amp;quot;&lt;br /&gt;
           one&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[1]}&amp;quot;&lt;br /&gt;
           two&lt;br /&gt;
&lt;br /&gt;
            Also see (TIP 95)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 41:&lt;br /&gt;
&lt;br /&gt;
     Loops in Bash&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The command below loops through directories listed in $PATH.&lt;br /&gt;
&lt;br /&gt;
          $ path=$PATH:&lt;br /&gt;
          $ while [ $path ]; do echo &amp;quot; ${path%%:*} &amp;quot;; path=${path#*:}; done&lt;br /&gt;
&lt;br /&gt;
       The command below will also loop through directories in your path.&lt;br /&gt;
&lt;br /&gt;
          $IFS=:&lt;br /&gt;
          $ for dir in $PATH&lt;br /&gt;
          &amp;gt; do&lt;br /&gt;
          &amp;gt; ls -ld $dir&lt;br /&gt;
          &amp;gt; done&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Jun 10 20:16 /usr/local/bin&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Jun 13 23:12 /bin&lt;br /&gt;
              drwxr-xr-x    3 root     root        40960 Jun 12 08:00 /usr/bin&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Feb 14 03:12 /usr/X11R6/bin&lt;br /&gt;
              drwxrwxr-x    2 chirico  chirico      4096 Jun  6 13:06 /home/chirico/bin&lt;br /&gt;
&lt;br /&gt;
     Other ways of doing loops:&lt;br /&gt;
&lt;br /&gt;
        for (( i=1; i &amp;lt;= 20; i++))&lt;br /&gt;
                do&lt;br /&gt;
                        echo -n &amp;quot;$i &amp;quot;&lt;br /&gt;
                done&lt;br /&gt;
&lt;br /&gt;
     Note, to do it all on one line, do the following:&lt;br /&gt;
&lt;br /&gt;
        $ for (( i=1; i &amp;lt;= 20; i++)); do echo -n &amp;quot;$i&amp;quot;; done&lt;br /&gt;
&lt;br /&gt;
     Below, is an example of declaring i an integer so that you do not&lt;br /&gt;
     have to preface with let.&lt;br /&gt;
&lt;br /&gt;
          $ declare -i i&lt;br /&gt;
          $ i=5;&lt;br /&gt;
          $ while (( $i &amp;gt; 1 )); do&lt;br /&gt;
          &amp;gt; i=i-1&lt;br /&gt;
          &amp;gt; echo $i&lt;br /&gt;
          &amp;gt; done&lt;br /&gt;
          4&lt;br /&gt;
          3&lt;br /&gt;
          2&lt;br /&gt;
&lt;br /&gt;
     You can also use &amp;quot;while [ $i -gt 1 ]; do&amp;quot;  in place of &amp;quot;while (( $i &amp;gt; 1 )); do&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     To get a listing of all declared values&lt;br /&gt;
&lt;br /&gt;
          $ declare -i&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Try putting a few words in the file &amp;quot;test&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         $ while read filename; do echo  &amp;quot;- $filename &amp;quot;; done &amp;lt; test |nl -w1&lt;br /&gt;
&lt;br /&gt;
     Or, using an array&lt;br /&gt;
&lt;br /&gt;
                declare -a Array&lt;br /&gt;
                Array[0]=&amp;quot;zero&amp;quot;&lt;br /&gt;
                Array[1]=&amp;quot;one&amp;quot;&lt;br /&gt;
                Array[2]=&amp;quot;two&amp;quot;&lt;br /&gt;
                for i in `seq ${#Array[@]}`&lt;br /&gt;
                do&lt;br /&gt;
                  echo $Array[$i-1]&lt;br /&gt;
                done&lt;br /&gt;
&lt;br /&gt;
         Also see (TIP 95 and TIP 133).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 42:&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;diff&amp;quot; and &amp;quot;patch&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
        You have created a program &amp;quot;prog.c&amp;quot;, saved as this name and also copied&lt;br /&gt;
        to  &amp;quot;prog.c.old&amp;quot;. You post &amp;quot;prog.c&amp;quot; to users.  Next, you make changes&lt;br /&gt;
        to prog.c&lt;br /&gt;
&lt;br /&gt;
          $ diff -c prog.c.old prog.c &amp;gt; prog.patch&lt;br /&gt;
&lt;br /&gt;
        Now, users can get the latest updates by running.&lt;br /&gt;
&lt;br /&gt;
          $ patch &amp;lt; prog.patch&lt;br /&gt;
&lt;br /&gt;
        By the way, you can make backups of your data easily.&lt;br /&gt;
&lt;br /&gt;
          $ cp /etc/fstab{,.bak}&lt;br /&gt;
&lt;br /&gt;
        Now, you do your edits to &amp;quot;/etc/fstab&amp;quot; and if you need&lt;br /&gt;
        to go back to the original, you can find it at&lt;br /&gt;
        &amp;quot;/etc/fstab.bak&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 43:&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;cat&amp;quot; the Contents of Files Listed in a File, in That Order.&lt;br /&gt;
&lt;br /&gt;
       SETUP (Assume you have the following)&lt;br /&gt;
&lt;br /&gt;
              $ cat file_of_files&lt;br /&gt;
                  file1&lt;br /&gt;
                  file2&lt;br /&gt;
&lt;br /&gt;
              $ cat file1&lt;br /&gt;
                  This is the data in file1&lt;br /&gt;
&lt;br /&gt;
              $ cat file 2&lt;br /&gt;
                  This is the data in file2&lt;br /&gt;
&lt;br /&gt;
       So there are 3 files here &amp;quot;file_of_files&amp;quot; which contains the name of&lt;br /&gt;
       other files.  In this case &amp;quot;file1&amp;quot; and &amp;quot;file2&amp;quot;. And the contents of&lt;br /&gt;
       &amp;quot;file1&amp;quot; and &amp;quot;file2&amp;quot; is shown above.&lt;br /&gt;
&lt;br /&gt;
               $ cat file_of_files|xargs cat&lt;br /&gt;
                    This is the data in  file1&lt;br /&gt;
                    This is the data in  file2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 44:&lt;br /&gt;
&lt;br /&gt;
     Columns and Rows -- getting anything you want.&lt;br /&gt;
&lt;br /&gt;
     Assume you have the following file.&lt;br /&gt;
&lt;br /&gt;
        $ cat data&lt;br /&gt;
           1 2 3&lt;br /&gt;
           4 5&lt;br /&gt;
           6 7 8 9 10&lt;br /&gt;
           11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
     How to you get everything in  2 columns?&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l2&lt;br /&gt;
           1 2&lt;br /&gt;
           3 4&lt;br /&gt;
           5 6&lt;br /&gt;
           7 8&lt;br /&gt;
           9 10&lt;br /&gt;
           11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
    Three columns?&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l3&lt;br /&gt;
           1 2 3&lt;br /&gt;
           4 5 6&lt;br /&gt;
           7 8 9&lt;br /&gt;
           10 11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
    What's the row sum of the &amp;quot;three columns?&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
           6&lt;br /&gt;
           15&lt;br /&gt;
           24&lt;br /&gt;
           33&lt;br /&gt;
           27&lt;br /&gt;
&lt;br /&gt;
    or&lt;br /&gt;
&lt;br /&gt;
        $ tr ' ' '\n' &amp;lt; data |xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
&lt;br /&gt;
    NOTE &amp;quot;Steven Heiner's rule&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
             cat one_file | program&lt;br /&gt;
&lt;br /&gt;
           can always be rewritten as&lt;br /&gt;
&lt;br /&gt;
             program &amp;lt; one_file&lt;br /&gt;
&lt;br /&gt;
   Note: thanks to Steven Heiner (http://www.shelldorado.com/) the above can be&lt;br /&gt;
       shortened as follows:&lt;br /&gt;
&lt;br /&gt;
               $ tr ' ' '\n' &amp;lt; data|xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
&lt;br /&gt;
          Need to &amp;quot;tr&amp;quot; from the stdin?&lt;br /&gt;
&lt;br /&gt;
               $ tr &amp;quot;xy&amp;quot; &amp;quot;yx&amp;quot;| ... | ...&lt;br /&gt;
&lt;br /&gt;
       But there is a the &amp;quot;Stephane CHAZELAS&amp;quot; condition here&lt;br /&gt;
&lt;br /&gt;
         &amp;quot;Note that tr, sed, and awk mail fail on files containing '\0'&lt;br /&gt;
          sed and awk have unspecified behaviors if the input&lt;br /&gt;
          doesn't end in a '\n' (or to sum up, cat works for&lt;br /&gt;
          binary and text files, text utilities such as sed or awk&lt;br /&gt;
          work only for text files).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 45:&lt;br /&gt;
&lt;br /&gt;
     Auto Directory Spelling Corrections.&lt;br /&gt;
&lt;br /&gt;
      To turn this on:&lt;br /&gt;
&lt;br /&gt;
           $ shopt -s cdspell&lt;br /&gt;
&lt;br /&gt;
      Now mispell a directory in the cd command.&lt;br /&gt;
&lt;br /&gt;
           $ cd /usk/local&lt;br /&gt;
                   ^-------- still gets you to --&lt;br /&gt;
                                                |&lt;br /&gt;
                                            /usr/local&lt;br /&gt;
&lt;br /&gt;
      What other options can you set? The following will list&lt;br /&gt;
      all the options:&lt;br /&gt;
&lt;br /&gt;
           $ shopt -p&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 46:&lt;br /&gt;
&lt;br /&gt;
     Record Eveything Printed on Your Terminal Screen.&lt;br /&gt;
&lt;br /&gt;
            $ script -a &amp;lt;filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Now start doing stuff and &amp;quot;everything&amp;quot; is appended to &amp;lt;filename&amp;gt;.&lt;br /&gt;
     For example&lt;br /&gt;
&lt;br /&gt;
            $ script installation&lt;br /&gt;
&lt;br /&gt;
            $ (command)&lt;br /&gt;
&lt;br /&gt;
            $ (result)&lt;br /&gt;
&lt;br /&gt;
            $ ...&lt;br /&gt;
&lt;br /&gt;
            $ ...&lt;br /&gt;
&lt;br /&gt;
            $ (command)&lt;br /&gt;
&lt;br /&gt;
            $ (result)&lt;br /&gt;
&lt;br /&gt;
            $ exit&lt;br /&gt;
&lt;br /&gt;
     The whole session log is in the installation file that you can later&lt;br /&gt;
     read and/or cleanup and add to a documentation.&lt;br /&gt;
&lt;br /&gt;
     This command can also be used to redirect the contents to another user,&lt;br /&gt;
     but you must be root to do this.&lt;br /&gt;
&lt;br /&gt;
     Step 1 - find out what pts they are using.&lt;br /&gt;
&lt;br /&gt;
            $ w&lt;br /&gt;
&lt;br /&gt;
     Step 2 - Run script on that pts. After running this command below&lt;br /&gt;
              everything you type will appear on their screen.&lt;br /&gt;
&lt;br /&gt;
            $ script /dev/pts/4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Thanks to Jacques.GARNIER-EXTERIEUR@EU.RHODIA.COM for his contribution&lt;br /&gt;
     to this tip.&lt;br /&gt;
&lt;br /&gt;
     Also reference TIP 208.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 47:&lt;br /&gt;
&lt;br /&gt;
     Monitor all Network Traffic Except Your Current ssh Connection.&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX -s 1500 port not 22&lt;br /&gt;
&lt;br /&gt;
       Or to filter out port 123 as well getting the full length of the packet&lt;br /&gt;
       (-s 0), use the following:&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX -s 0 port not 22  and port not 123&lt;br /&gt;
&lt;br /&gt;
       Or to filter only a certain host say 81.169.158.205&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX  port not 22 and host 81.169.158.205&lt;br /&gt;
&lt;br /&gt;
     Just want ip addresses and a little bit of data, then,&lt;br /&gt;
     use this. The &amp;quot;-c 20&amp;quot; is to stop after 20 packets.&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN  -s 1500 port not 22 -c 20&lt;br /&gt;
&lt;br /&gt;
     If you're looking for sign of DOS attacks, the following show just the SYN&lt;br /&gt;
     packets on all interfaces:&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump 'tcp[13] &amp;amp; 2 == 2'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 48:&lt;br /&gt;
&lt;br /&gt;
     Where are the GNU Reference Manuals?&lt;br /&gt;
&lt;br /&gt;
           http://www.gnu.org/manual/manual.html&lt;br /&gt;
&lt;br /&gt;
     Also worth a look the &amp;quot;Linux Documentation Project&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           http://en.tldp.org/&lt;br /&gt;
&lt;br /&gt;
     and Red Hat manuals&lt;br /&gt;
&lt;br /&gt;
           http://www.redhat.com/docs/manuals/enterprise/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 49:&lt;br /&gt;
&lt;br /&gt;
     Setting or Changing the Library Path.&lt;br /&gt;
&lt;br /&gt;
     The following contains the settings to be added or deleted&lt;br /&gt;
&lt;br /&gt;
           /etc/ld.so.conf&lt;br /&gt;
&lt;br /&gt;
     After this file is edited, you must run the following:&lt;br /&gt;
&lt;br /&gt;
           $ ldconfig&lt;br /&gt;
&lt;br /&gt;
     See &amp;quot;man ldconfig&amp;quot; for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 50:&lt;br /&gt;
&lt;br /&gt;
     Working with Libraries in C&lt;br /&gt;
&lt;br /&gt;
     Assume the following 3 programs:&lt;br /&gt;
&lt;br /&gt;
      $ cat ./src/test.c&lt;br /&gt;
&lt;br /&gt;
         int test(int t)&lt;br /&gt;
         {&lt;br /&gt;
           printf(&amp;quot;%d\n&amp;quot;,t);&lt;br /&gt;
           return t;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      $ cat ./src/prog1.c&lt;br /&gt;
&lt;br /&gt;
         /*&lt;br /&gt;
          program: prog1.c&lt;br /&gt;
          dependences: test.c&lt;br /&gt;
&lt;br /&gt;
          compiling this program:&lt;br /&gt;
          gcc -o prog test.c prog1.c&lt;br /&gt;
&lt;br /&gt;
          Note the libpersonal include&lt;br /&gt;
          should be remove if NOT using the&lt;br /&gt;
          library&lt;br /&gt;
         */&lt;br /&gt;
&lt;br /&gt;
         #include &amp;lt;libpersonal.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         int&lt;br /&gt;
         main(int argc, char **argv)&lt;br /&gt;
         {&lt;br /&gt;
           test(45);&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
      $ cat ./include/libpersonal.h&lt;br /&gt;
&lt;br /&gt;
         extern int test(int);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Prog1.c needs the test function in  test.c&lt;br /&gt;
     To compile, so that both programs work together, do the following:&lt;br /&gt;
&lt;br /&gt;
          $ cd src&lt;br /&gt;
          $ gcc -o prog test.c prog1.c -I../include&lt;br /&gt;
&lt;br /&gt;
     However, if you want to create your own static library, then, run the following:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p ../lib&lt;br /&gt;
          $ gcc -c test.c  -o ../lib/test.o&lt;br /&gt;
          $ cd ../lib&lt;br /&gt;
          $ ar r libpersonal.a test.o&lt;br /&gt;
          $ ranlib libpersonal.a&lt;br /&gt;
&lt;br /&gt;
     or, the ar and ranlib command can be combined as follows:&lt;br /&gt;
&lt;br /&gt;
          $ ar rs libpersonal.a test.o&lt;br /&gt;
&lt;br /&gt;
     To compile the program with the static library:&lt;br /&gt;
&lt;br /&gt;
          $ cd ../src&lt;br /&gt;
          $ gcc -I../include -L../lib -o prog1 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     The -I../include  tells  gcc to look in the ../include directory for&lt;br /&gt;
     libpersonal.h. and -L../lib, tells gcc to look for the&lt;br /&gt;
     &amp;quot;libpersonal.a&amp;quot; library.&lt;br /&gt;
&lt;br /&gt;
           $ cd ..&lt;br /&gt;
           $ tree src lib include&lt;br /&gt;
           src&lt;br /&gt;
           |-- prog&lt;br /&gt;
           |-- prog1&lt;br /&gt;
           |-- prog1.c&lt;br /&gt;
           `-- test.c&lt;br /&gt;
           lib&lt;br /&gt;
           |-- libpersonal.a&lt;br /&gt;
           `-- test.o&lt;br /&gt;
           include&lt;br /&gt;
           `-- libpersonal.h&lt;br /&gt;
&lt;br /&gt;
     This was a STATIC library. Often times you will want to use a SHARED&lt;br /&gt;
     or dynamic library.&lt;br /&gt;
&lt;br /&gt;
     SHARED LIBRARY:&lt;br /&gt;
&lt;br /&gt;
     You must recompile test.c with -fpic option.&lt;br /&gt;
&lt;br /&gt;
          $ cd ../lib&lt;br /&gt;
          $ gcc -c -fpic ../src/test.c -o test.o&lt;br /&gt;
&lt;br /&gt;
     Next create the libpersonal.so file.&lt;br /&gt;
&lt;br /&gt;
          $ gcc -shared -o libpersonal.so test.o&lt;br /&gt;
&lt;br /&gt;
     Now, compile the source prog1.c as follows:&lt;br /&gt;
&lt;br /&gt;
          $ cd ../src&lt;br /&gt;
          $ gcc -Wl,-R../lib -L../lib -I../include -o prog2 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
     This should work fine. But, take a look at prog2 using the ldd command.&lt;br /&gt;
&lt;br /&gt;
          $ ldd prog2&lt;br /&gt;
&lt;br /&gt;
        libpersonal.so =&amp;gt; ../lib/libpersonal.so (0x40017000)&lt;br /&gt;
        libc.so.6 =&amp;gt; /lib/tls/libc.so.6 (0x42000000)&lt;br /&gt;
        /lib/ld-linux.so.2 =&amp;gt; /lib/ld-linux.so.2 (0x40000000)&lt;br /&gt;
&lt;br /&gt;
     If you move the program prog2 to a different location, it will not run.&lt;br /&gt;
     Instead you will get the following error:&lt;br /&gt;
&lt;br /&gt;
           prog2: error while loading shared libraries: libpersonal.so:&lt;br /&gt;
                     cannot open shared object file: No such file or directory&lt;br /&gt;
&lt;br /&gt;
     To fix this, you should specify the direct path to the library. And in my&lt;br /&gt;
     case it is rather long&lt;br /&gt;
&lt;br /&gt;
      $  gcc -Wl,-R/work/souptonuts/documentation/theBook/lib -L../lib -I../include -o prog2 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE: The -R must always follow the -Wl.  (-Wl,-R&amp;lt;directory&amp;gt;) They always go together&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 51:&lt;br /&gt;
&lt;br /&gt;
     Actively Monitor a File and Send Email when Expression Occurs.&lt;br /&gt;
&lt;br /&gt;
     This is a way to monitor &amp;quot;/var/log/messages&amp;quot; or any file for certain changes.&lt;br /&gt;
     The example below actively monitors &amp;quot;stuff&amp;quot; for the work &amp;quot;now&amp;quot; and as soon as&lt;br /&gt;
     &amp;quot;now&amp;quot; is added to the file, the contents of msg are sent to the user&lt;br /&gt;
     mikechirico@hotmail.com&lt;br /&gt;
&lt;br /&gt;
          $ tail -f stuff | \&lt;br /&gt;
              awk ' /now/ { system(&amp;quot;mail -s \&amp;quot;This is working\&amp;quot;  mikechirico@hotmail.com &amp;lt; msg&amp;quot;) }'&lt;br /&gt;
&lt;br /&gt;
     Or, you can run a program, say get headings on slashdot from the program &amp;quot;getslash.php&amp;quot; which&lt;br /&gt;
     runs on  &amp;quot;192.168.1.155&amp;quot; with account &amp;quot;chirico&amp;quot;. Assuming you have ssh keys setup, then, the following&lt;br /&gt;
     will send mail from the output:&lt;br /&gt;
&lt;br /&gt;
          $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;|mail -s &amp;quot;Slash cron Headlines&amp;quot;  mchirico@comcast.net&lt;br /&gt;
&lt;br /&gt;
     See (TIP 80) for scraping the headings on slash dot and how to get a copy of &amp;quot;getslash.php&amp;quot;.  If you still&lt;br /&gt;
     want to use awk:&lt;br /&gt;
&lt;br /&gt;
           $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;| \&lt;br /&gt;
                      awk '{ print $0 | &amp;quot;mail -s \x27 Slash Topics \x27 mchirico@comcast.net &amp;quot;}'&lt;br /&gt;
&lt;br /&gt;
     Note the &amp;quot;\x27&amp;quot; is a quote.  Maybe you only want articles dealing with &amp;quot;Linux&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
           $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;| \&lt;br /&gt;
                      awk '/Linux/{ print $0 | &amp;quot;mail -s \x27 Slash Topics \x27 mchirico@comcast.net &amp;quot;}'&lt;br /&gt;
&lt;br /&gt;
     For $60, you can get a numeric display from &amp;quot;delcom engineering&amp;quot; that you can send messages and&lt;br /&gt;
     data to.  I get weather information off the internet and send it to this device.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/projects/delcom/&lt;br /&gt;
&lt;br /&gt;
     (Reference TIP 151 for ssh tips)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 52:&lt;br /&gt;
&lt;br /&gt;
     Need to Keep Secrets? Encrypt it.&lt;br /&gt;
&lt;br /&gt;
      To Encrypt:&lt;br /&gt;
&lt;br /&gt;
            $ openssl des3 -salt -in file.txt -out file.des3&lt;br /&gt;
&lt;br /&gt;
      The above will prompt for a password, or you can put it in&lt;br /&gt;
      with a -k option, assuming you're on a trusted server.&lt;br /&gt;
&lt;br /&gt;
      To Decrypt&lt;br /&gt;
&lt;br /&gt;
            $  openssl des3 -d -salt -in file.des3 -out file.txt -k mypassword&lt;br /&gt;
&lt;br /&gt;
      Need to encrypt what you type? Enter the following, then start typing&lt;br /&gt;
      and  ^D to end.&lt;br /&gt;
&lt;br /&gt;
            $ openssl des3 -salt -out stuff.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 53:&lt;br /&gt;
&lt;br /&gt;
     Check that a File has Not Been Tampered With: Use Cryptographic Hashing Function.&lt;br /&gt;
&lt;br /&gt;
     The md5sum is popular but dated&lt;br /&gt;
&lt;br /&gt;
              $ md5sum file&lt;br /&gt;
&lt;br /&gt;
     Instead, use one of the following;&lt;br /&gt;
&lt;br /&gt;
              $ openssl dgst -sha1 -c file&lt;br /&gt;
&lt;br /&gt;
              $ openssl dgst -ripemd160 -c  file&lt;br /&gt;
&lt;br /&gt;
     All calls give a fixed length string or &amp;quot;message digest&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 54:&lt;br /&gt;
&lt;br /&gt;
     Need to View Information About a Secure Web Server? A SSL/TLS test.&lt;br /&gt;
&lt;br /&gt;
           $ openssl s_client -connect www.sourceforge.net:443&lt;br /&gt;
&lt;br /&gt;
     Above will give a long listing of certificates.&lt;br /&gt;
&lt;br /&gt;
     Note, it is also possible to get certificate information about a mail server&lt;br /&gt;
&lt;br /&gt;
           $ openssl s_client -connect mail.comcast.net:995 -showcerts&lt;br /&gt;
&lt;br /&gt;
     When you do the above command you get two certificates. If you copy&lt;br /&gt;
     past both certificates by taking the following contents include the&lt;br /&gt;
     begin and end show below:&lt;br /&gt;
&lt;br /&gt;
                 -----BEGIN CERTIFICATE-----&lt;br /&gt;
                 ....&lt;br /&gt;
                 -----END CERTIFICATE-----&lt;br /&gt;
&lt;br /&gt;
     Then create files &amp;quot;comcast0.pem&amp;quot; and &amp;quot;comcast1.pem&amp;quot; out of these certificaties and&lt;br /&gt;
     put them in a directory &amp;quot;/home/donkey/.certs&amp;quot;, then, with the openssl src package, in&lt;br /&gt;
     the &amp;quot;./tools/c_rehash&amp;quot; run&lt;br /&gt;
&lt;br /&gt;
            $ c_rehash .certs&lt;br /&gt;
            Doing .certs&lt;br /&gt;
            comcast0.pem =&amp;gt; 72f90dc0.0&lt;br /&gt;
            comcast1.pem =&amp;gt; f73e89fd.0&lt;br /&gt;
&lt;br /&gt;
     Now it's possible to have fetchmail work with these certs.&lt;br /&gt;
&lt;br /&gt;
       #&lt;br /&gt;
       #&lt;br /&gt;
       # Sample .fetchmailrc file for Comcast&lt;br /&gt;
       #&lt;br /&gt;
       # Check mail every 90 seconds&lt;br /&gt;
       set daemon 90&lt;br /&gt;
       set syslog&lt;br /&gt;
       set postmaster donkey&lt;br /&gt;
       #set bouncemail&lt;br /&gt;
       #&lt;br /&gt;
       # Comcast email is zdonkey but computer account is  just donkey&lt;br /&gt;
       #&lt;br /&gt;
       poll mail.comcast.net with proto POP3 and options no dns&lt;br /&gt;
              user 'zdonkey' with pass &amp;quot;somethin35&amp;quot;  is 'donkey' here options ssl sslcertck sslcertpath '/home/donkey/.certs'&lt;br /&gt;
              smtphost comcast.net&lt;br /&gt;
       # currently not used&lt;br /&gt;
       mda '/usr/bin/procmail -d %T'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     REFERENCE: http://www.openssl.org/&lt;br /&gt;
                http://www.catb.org/~esr/fetchmail/fetchmail-6.2.5.tar.gz&lt;br /&gt;
                http://www.madboa.com/geek/openssl/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 55:&lt;br /&gt;
&lt;br /&gt;
     cp --parents. What does this option do?&lt;br /&gt;
&lt;br /&gt;
     Assume you have the following directory structure&lt;br /&gt;
&lt;br /&gt;
            .&lt;br /&gt;
            |-- a&lt;br /&gt;
            |   `-- b&lt;br /&gt;
            |       `-- c&lt;br /&gt;
            |           `-- d&lt;br /&gt;
            |               |-- file1&lt;br /&gt;
            |               `-- file2&lt;br /&gt;
            `-- newdir&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Issue the following command:&lt;br /&gt;
&lt;br /&gt;
         $ cp --parents ./a/b/c/d/* ./newdir/&lt;br /&gt;
&lt;br /&gt;
     Now you have the following:&lt;br /&gt;
&lt;br /&gt;
            .&lt;br /&gt;
            |-- a&lt;br /&gt;
            |   `-- b&lt;br /&gt;
            |       `-- c&lt;br /&gt;
            |           `-- d&lt;br /&gt;
            |               |-- file1&lt;br /&gt;
            |               `-- file2&lt;br /&gt;
            `-- newdir&lt;br /&gt;
                `-- a&lt;br /&gt;
                    `-- b&lt;br /&gt;
                        `-- c&lt;br /&gt;
                            `-- d&lt;br /&gt;
                                |-- file1&lt;br /&gt;
                                `-- file2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 56:&lt;br /&gt;
&lt;br /&gt;
     Quickly Locating files.&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;locate&amp;quot; command quickly searches the indexed database for files.  It just&lt;br /&gt;
     gives the name of the files; but, if you need more information use it as follows&lt;br /&gt;
&lt;br /&gt;
         $ locate document|xargs ls -l&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;locate&amp;quot; database may only get updated every 24 hours.  For more recent finds,&lt;br /&gt;
     use the &amp;quot;find&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 57:&lt;br /&gt;
&lt;br /&gt;
     Using the &amp;quot;find&amp;quot; Command.&lt;br /&gt;
&lt;br /&gt;
     List only directories, max 2 nodes down that have &amp;quot;net&amp;quot; in the name&lt;br /&gt;
&lt;br /&gt;
       $ find /proc -type d -maxdepth 2 -iname '*net*'&lt;br /&gt;
&lt;br /&gt;
     Find all *.c and *.h files starting from the current &amp;quot;.&amp;quot; position.&lt;br /&gt;
&lt;br /&gt;
       $ find . \( -iname '*.c'  -o -iname '*.h' \) -print&lt;br /&gt;
&lt;br /&gt;
     Find all, but skip what's in &amp;quot;/CVS&amp;quot; and &amp;quot;/junk&amp;quot;. Start from &amp;quot;/work&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ find /work \( -iregex '.*/CVS'  -o -iregex '.*/junk' \)  -prune -o -print&lt;br /&gt;
&lt;br /&gt;
     Note -regex and -iregex work on the directory as well, which means&lt;br /&gt;
     you must consider the &amp;quot;./&amp;quot; that comes before all listings.&lt;br /&gt;
&lt;br /&gt;
     Here is another example. Find all files except what is under the CVS, including&lt;br /&gt;
     CVS listings. Also exclude &amp;quot;#&amp;quot; and &amp;quot;~&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       $ find . -regex '.*' ! \( -regex '.*CVS.*'  -o -regex '.*[#|~].*' \)&lt;br /&gt;
&lt;br /&gt;
     Find a *.c file, then run grep on it looking for &amp;quot;stdio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       $ find . -iname '*.c' -exec grep -H 'stdio.h' {} \;&lt;br /&gt;
         sample output --&amp;gt;  ./prog1.c:#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
                            ./test.c:#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Looking for the disk-hog on the whole system?&lt;br /&gt;
&lt;br /&gt;
       $ find /  -size +10000k 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
     Looking for files changed in the last 24 hours? Make sure you add the&lt;br /&gt;
     minus sign &amp;quot;-1&amp;quot;, otherwise, you will only find files changed exactly&lt;br /&gt;
     24 hours from now. With the &amp;quot;-1&amp;quot; you get files changed from now to 24&lt;br /&gt;
     hours.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ find  . -ctime -1  -printf &amp;quot;%a %f\n&amp;quot;&lt;br /&gt;
       Wed Oct  6 12:51:56 2004 .&lt;br /&gt;
       Wed Oct  6 12:35:16 2004 How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
     Or if you just want files.&lt;br /&gt;
&lt;br /&gt;
       $ find . -type f -ctime -1  -printf &amp;quot;%a %f\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Details on file status change in the last 48 hours, current directory. Also note &amp;quot;-atime -2&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
       $ find . -ctime -2 -type f -exec ls -l {} \;&lt;br /&gt;
&lt;br /&gt;
             NOTE: if you don't use -type f, you make get &amp;quot;.&amp;quot; returned, which&lt;br /&gt;
             when run through ls &amp;quot;ls .&amp;quot; may list more than what you want.&lt;br /&gt;
&lt;br /&gt;
             Also you may only want the current directory&lt;br /&gt;
&lt;br /&gt;
       $ find . -ctime -2 -type f -maxdepth 1 -exec ls -l {} \;&lt;br /&gt;
&lt;br /&gt;
     To find files modified within the last 5 to 10 minutes&lt;br /&gt;
&lt;br /&gt;
       $ find . -mmin +5 -mmin -10 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     For more example &amp;quot;find&amp;quot; commands, reference the following looking&lt;br /&gt;
     for the latest version of &amp;quot;bashscripts.x.x.x.tar.gz&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79320&amp;amp;package_id=80711&lt;br /&gt;
&lt;br /&gt;
     See &amp;quot;TIP 71&amp;quot; for examples of find using the inode feature. &amp;quot; $ find . -inum &amp;lt;inode&amp;gt; -exec rm -- '{}' \; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     If you don't want error messages, or need to redirect error messages &amp;quot;&amp;gt; /dev/null 2&amp;gt;&amp;amp;1&amp;quot;, or see&lt;br /&gt;
     &amp;quot;TIP 81&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 58:&lt;br /&gt;
&lt;br /&gt;
     Using the &amp;quot;rm&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
     How do you remove a file that has the name &amp;quot;-&amp;quot;.  For instance, if you run the command&lt;br /&gt;
     &amp;quot;$ cat &amp;gt; - &amp;quot; and type some text followed by ^d, how does the &amp;quot;-&amp;quot; file get deleted?&lt;br /&gt;
&lt;br /&gt;
        $ rm -- -&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;--&amp;quot; nullifies any rm options.&lt;br /&gt;
&lt;br /&gt;
     How do you delete the directory &amp;quot;one&amp;quot;, all it's sub-directories, and any data?&lt;br /&gt;
&lt;br /&gt;
        $ rm -rf ./one&lt;br /&gt;
&lt;br /&gt;
     Note, to selectively delete stuff on a directory, use the find command &amp;quot;TIP 57&amp;quot;.&lt;br /&gt;
     To delete by inode, see &amp;quot;TIP 71&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 59:&lt;br /&gt;
&lt;br /&gt;
     Giving ownership.&lt;br /&gt;
&lt;br /&gt;
     How do you give the user &amp;quot;donkey&amp;quot; ownership to all directories and files under&lt;br /&gt;
     &amp;quot;./fordonkey&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          $ chown -R donkey ./fordonkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 60:&lt;br /&gt;
&lt;br /&gt;
     Only Permit root login -- give others a message when they try to login.&lt;br /&gt;
&lt;br /&gt;
     Create the file &amp;quot;/etc/nologin&amp;quot; with &amp;quot;nologin&amp;quot; containing the contents&lt;br /&gt;
     of the message.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 61:&lt;br /&gt;
&lt;br /&gt;
     Limits: file size, open files, pipe size, stack size, max memory size&lt;br /&gt;
             cpu time, plus others.&lt;br /&gt;
&lt;br /&gt;
     To get a listing of current limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -a&lt;br /&gt;
             core file size        (blocks, -c) 0&lt;br /&gt;
             data seg size         (kbytes, -d) unlimited&lt;br /&gt;
             file size             (blocks, -f) unlimited&lt;br /&gt;
             max locked memory     (kbytes, -l) unlimited&lt;br /&gt;
             max memory size       (kbytes, -m) unlimited&lt;br /&gt;
             open files                    (-n) 1024&lt;br /&gt;
             pipe size          (512 bytes, -p) 8&lt;br /&gt;
             stack size            (kbytes, -s) 8192&lt;br /&gt;
             cpu time             (seconds, -t) unlimited&lt;br /&gt;
             max user processes            (-u) 8179&lt;br /&gt;
             virtual memory        (kbytes, -v) unlimited&lt;br /&gt;
&lt;br /&gt;
     Note as a user you can decrease your limits in the current&lt;br /&gt;
     shell session; but, you cannot increase.  This can be ideal&lt;br /&gt;
     for testing programs.  But, first you may want to create&lt;br /&gt;
     another shell &amp;quot;sh&amp;quot; so that you can &amp;quot;go back to where started&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -f 10&lt;br /&gt;
&lt;br /&gt;
     Now try&lt;br /&gt;
&lt;br /&gt;
          $ yes &amp;gt;&amp;gt; out&lt;br /&gt;
             File size limit exceeded&lt;br /&gt;
&lt;br /&gt;
     To set limits on users, make changes to &amp;quot;/etc/security/limits.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           bozo   - maxlogins 1&lt;br /&gt;
&lt;br /&gt;
     Will keep bozo from loging in more than once.&lt;br /&gt;
&lt;br /&gt;
     To list hard limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -Ha&lt;br /&gt;
&lt;br /&gt;
     To list soft limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -Sa&lt;br /&gt;
&lt;br /&gt;
     To restrict user access by time, day make changes to&lt;br /&gt;
             &amp;quot;/etc/security/time.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Also take a look at &amp;quot;/etc/profile&amp;quot; to see what other changes&lt;br /&gt;
     can be made, plus take a look under &amp;quot;/etc/security/*.conf&amp;quot; for&lt;br /&gt;
     other configuration files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 62:&lt;br /&gt;
&lt;br /&gt;
     Stupid &amp;quot;cat&amp;quot; Tricks.&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 43).&lt;br /&gt;
&lt;br /&gt;
     If you have multiple blank lines, squeeze these lines down to one,&lt;br /&gt;
     then, try the following:&lt;br /&gt;
&lt;br /&gt;
          $ cat -s &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to number the lines?&lt;br /&gt;
&lt;br /&gt;
          $ cat -n &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to show tabs?&lt;br /&gt;
&lt;br /&gt;
          $ cat -t &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Need to mark end of lines by &amp;quot;$&amp;quot;? The following was suggested by  (Amos Shapira)&lt;br /&gt;
&lt;br /&gt;
          $ cat -e &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to see all the ctl characters?&lt;br /&gt;
&lt;br /&gt;
          /* ctlgen.c&lt;br /&gt;
            Program to generate ctl characters.&lt;br /&gt;
&lt;br /&gt;
            Compile:&lt;br /&gt;
&lt;br /&gt;
               gcc -o ctlgen ctlgen.c&lt;br /&gt;
&lt;br /&gt;
            Run:&lt;br /&gt;
&lt;br /&gt;
               ./ctlgen &amp;gt; mout&lt;br /&gt;
&lt;br /&gt;
            Now see the characters:&lt;br /&gt;
&lt;br /&gt;
               cat -v mout&lt;br /&gt;
&lt;br /&gt;
            Here's a sample output:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               $ cat -v mout|tail&lt;br /&gt;
                   test M-v&lt;br /&gt;
                   test M-w&lt;br /&gt;
                   test M-x&lt;br /&gt;
                   test M-y&lt;br /&gt;
                   test M-z&lt;br /&gt;
                   test M-{&lt;br /&gt;
                   test M-|&lt;br /&gt;
                   test M-}&lt;br /&gt;
                   test M-~&lt;br /&gt;
                   test M-^?&lt;br /&gt;
&lt;br /&gt;
          */&lt;br /&gt;
          #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
          #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
          int main()&lt;br /&gt;
          {&lt;br /&gt;
            int i;&lt;br /&gt;
&lt;br /&gt;
            for(i=0; i &amp;lt; 256; ++i)&lt;br /&gt;
              printf(&amp;quot;test %c \n&amp;quot;,i);&lt;br /&gt;
&lt;br /&gt;
            return 0;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 63:&lt;br /&gt;
&lt;br /&gt;
     Guard against SYN attacks and &amp;quot;ping&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     As root do the following:&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/tcp_syncookies&lt;br /&gt;
&lt;br /&gt;
     Want to disable &amp;quot;ping&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_all&lt;br /&gt;
&lt;br /&gt;
     Disable broadcast/multicast &amp;quot;ping&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts&lt;br /&gt;
&lt;br /&gt;
     And to enable again:&lt;br /&gt;
&lt;br /&gt;
          echo 0 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_all&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 64:&lt;br /&gt;
&lt;br /&gt;
     Make changes to .bash_profile and need to update the current session?&lt;br /&gt;
&lt;br /&gt;
       $ source .bash_profile&lt;br /&gt;
&lt;br /&gt;
     With the above command, the user does not have to logout.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 65:&lt;br /&gt;
&lt;br /&gt;
     What are the Special Shell Variables?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        $#   The number of arguments.&lt;br /&gt;
        $@   All arguments, as separate words.&lt;br /&gt;
        $*   All arguments, as one word.&lt;br /&gt;
        $$   ID of the current process.&lt;br /&gt;
        $?   Exit status of the last command.&lt;br /&gt;
        $0,$1,..$9,${10},${11}...${N}    Positional parameters. After &amp;quot;9&amp;quot; you must use the ${k} syntax.&lt;br /&gt;
&lt;br /&gt;
     Note that 0 is true. For example if you execute the following, which is true you get zero.&lt;br /&gt;
&lt;br /&gt;
         $  [[ -f /etc/passwd ]]&lt;br /&gt;
         $  echo $?&lt;br /&gt;
         0&lt;br /&gt;
     And the following is false, which returns a 1.&lt;br /&gt;
&lt;br /&gt;
         $  [[ -f /etc/passwdjabberwisnohere ]]&lt;br /&gt;
         $  echo $?&lt;br /&gt;
         1&lt;br /&gt;
&lt;br /&gt;
     So true=0 and false=1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Sample program &amp;quot;mdo&amp;quot;  to show the difference between &amp;quot;$@&amp;quot; and &amp;quot;$*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        function myarg&lt;br /&gt;
        {&lt;br /&gt;
            echo &amp;quot;$# in myarg function&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
        echo -e &amp;quot;$# parameters on the cmd line\n&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;calling: myarg \&amp;quot;\$@\&amp;quot; and myarg \&amp;quot;\$*\&amp;quot;\n&amp;quot;&lt;br /&gt;
        myarg &amp;quot;$@&amp;quot;&lt;br /&gt;
        myarg &amp;quot;$*&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;\ncalling: myarg \$@ and myarg \$* without quotes\n&amp;quot;&lt;br /&gt;
        myarg $@&lt;br /&gt;
        myarg $*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The result of running &amp;quot;./mdo one two&amp;quot;. Note that when quoted, myarg &amp;quot;$*&amp;quot;,&lt;br /&gt;
      returns 1 ... all parameters are smushed together as one word.&lt;br /&gt;
&lt;br /&gt;
            [chirico@third-fl-71 theBook]$ ./mdo one two&lt;br /&gt;
            2 parameters on the cmd line&lt;br /&gt;
&lt;br /&gt;
            calling: myarg &amp;quot;$@&amp;quot; and myarg &amp;quot;$*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
            1 in myarg function&lt;br /&gt;
&lt;br /&gt;
            calling: myarg $@ and myarg $* without quotes&lt;br /&gt;
&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
&lt;br /&gt;
      Example program &amp;quot;mdo2&amp;quot; shows how the input separator can be changed.&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        IFS=|&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=,&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=\;&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=$1&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            [chirico@third-fl-71 theBook]$ ./mdo2 one two three four five&lt;br /&gt;
            one two three four five&lt;br /&gt;
&lt;br /&gt;
            one,two,three,four,five&lt;br /&gt;
&lt;br /&gt;
            one;two;three;four;five&lt;br /&gt;
&lt;br /&gt;
            oneotwoothreeofourofive&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 66:&lt;br /&gt;
&lt;br /&gt;
     Replace all &amp;quot;x&amp;quot; with &amp;quot;y&amp;quot; and all &amp;quot;y&amp;quot; with &amp;quot;x&amp;quot; in file data.&lt;br /&gt;
&lt;br /&gt;
        $ cata data&lt;br /&gt;
          x y&lt;br /&gt;
          y x&lt;br /&gt;
&lt;br /&gt;
        $ tr &amp;quot;xy&amp;quot;  &amp;quot;yx&amp;quot; &amp;lt; data&lt;br /&gt;
          y x&lt;br /&gt;
          x y&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 67:&lt;br /&gt;
&lt;br /&gt;
     On a Linux 2.6.x Kernel, how do you directly measure disk activity,&lt;br /&gt;
     and where is this information documented?&lt;br /&gt;
&lt;br /&gt;
          o The information is documented in the kernel source&lt;br /&gt;
               ./Documentation/iostats.txt&lt;br /&gt;
&lt;br /&gt;
          o The new way of getting this info in 2.6.x is&lt;br /&gt;
              $ cat /sys/block/hda/stat&lt;br /&gt;
            151121 5694 1932358 796675 37867 76770 916994 8353762 0 800672 9150437&lt;br /&gt;
&lt;br /&gt;
             Field  1 -- # of reads issued&lt;br /&gt;
                 This is the total number of reads completed successfully.&lt;br /&gt;
             Field  2 -- # of reads merged, field 6 -- # of writes merged&lt;br /&gt;
                 Reads and writes which are adjacent to each other may be merged for&lt;br /&gt;
                 efficiency.  Thus two 4K reads may become one 8K read before it is&lt;br /&gt;
                 ultimately handed to the disk, and so it will be counted (and queued)&lt;br /&gt;
                 as only one I/O.  This field lets you know how often this was done.&lt;br /&gt;
             Field  3 -- # of sectors read&lt;br /&gt;
                 This is the total number of sectors read successfully.&lt;br /&gt;
             Field  4 -- # of milliseconds spent reading&lt;br /&gt;
                 This is the total number of milliseconds spent by all reads (as&lt;br /&gt;
                 measured from __make_request() to end_that_request_last()).&lt;br /&gt;
             Field  5 -- # of writes completed&lt;br /&gt;
                 This is the total number of writes completed successfully.&lt;br /&gt;
             Field  7 -- # of sectors written&lt;br /&gt;
                 This is the total number of sectors written successfully.&lt;br /&gt;
             Field  8 -- # of milliseconds spent writing&lt;br /&gt;
                 This is the total number of milliseconds spent by all writes (as&lt;br /&gt;
                 measured from __make_request() to end_that_request_last()).&lt;br /&gt;
             Field  9 -- # of I/Os currently in progress&lt;br /&gt;
                 The only field that should go to zero. Incremented as requests are&lt;br /&gt;
                 given to appropriate request_queue_t and decremented as they finish.&lt;br /&gt;
             Field 10 -- # of milliseconds spent doing I/Os&lt;br /&gt;
                 This field is increases so long as field 9 is nonzero.&lt;br /&gt;
             Field 11 -- weighted # of milliseconds spent doing I/Os&lt;br /&gt;
                 This field is incremented at each I/O start, I/O completion, I/O&lt;br /&gt;
                 merge, or read of these stats by the number of I/Os in progress&lt;br /&gt;
                 (field 9) times the number of milliseconds spent doing I/O since the&lt;br /&gt;
                 last update of this field.  This can provide an easy measure of both&lt;br /&gt;
                 I/O completion time and the backlog that may be accumulating.&lt;br /&gt;
&lt;br /&gt;
       Note, this is device specific.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 68:&lt;br /&gt;
&lt;br /&gt;
     Passing Outbound Mail, plus Masquerading User and Hostname.&lt;br /&gt;
&lt;br /&gt;
     Here's a specific example:&lt;br /&gt;
&lt;br /&gt;
         How does one send and receive Comcast email from a home Linux box,&lt;br /&gt;
         which uses Comcast as the ISP, if the local account on the Linux&lt;br /&gt;
         box is different from the Comcast email.  For instance, the&lt;br /&gt;
         account on the Linux box is &amp;quot;chirico@third-fl-71&amp;quot; and the Comcast&lt;br /&gt;
         email account is &amp;quot;mchirico@comcast.net&amp;quot;.  Note both the hostname and&lt;br /&gt;
         username are different.&lt;br /&gt;
&lt;br /&gt;
         So, the user &amp;quot;chirico&amp;quot; using &amp;quot;mutt&amp;quot;, &amp;quot;elm&amp;quot; or any email program would&lt;br /&gt;
         like to send out email to say &amp;quot;donkey@comcast.net&amp;quot;; yet, donkey would&lt;br /&gt;
         see the email from &amp;quot;mchirico@comcast.net&amp;quot; and not &amp;quot;chirico@third-fl-71&amp;quot;&lt;br /&gt;
         but chirico@third-fl-71 would get the replies.&lt;br /&gt;
&lt;br /&gt;
         For a full description of how to solve this problem, including related&lt;br /&gt;
         &amp;quot;sendmail.mc&amp;quot;, &amp;quot;site.config.m4&amp;quot;, &amp;quot;genericstable&amp;quot;, &amp;quot;genericsdomain&amp;quot;,&lt;br /&gt;
         &amp;quot;.procmailrc&amp;quot;, and &amp;quot;.forward&amp;quot; files,  reference the following:&lt;br /&gt;
&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/README_COMCAST_EMAIL.txt?download&lt;br /&gt;
&lt;br /&gt;
         Included in the above link are instructions for building sendmail with&lt;br /&gt;
         &amp;quot;SASL&amp;quot; and &amp;quot;STARTTLS&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 69:&lt;br /&gt;
&lt;br /&gt;
     How do you remove just the last 2 lines from a file and save the result?&lt;br /&gt;
&lt;br /&gt;
         $ sed  '$d' file | sed '$d' &amp;gt; savefile&lt;br /&gt;
&lt;br /&gt;
     Or, as Amos Shapira pointed out, it's much easier with the head command.&lt;br /&gt;
&lt;br /&gt;
         $ head -2 file&lt;br /&gt;
&lt;br /&gt;
      And, of course, removing just the last line&lt;br /&gt;
&lt;br /&gt;
         $ sed '$d' file &amp;gt; savefile&lt;br /&gt;
&lt;br /&gt;
         (See REFERENCES (13))&lt;br /&gt;
&lt;br /&gt;
     How do you remove extra spaces at the end of a line?&lt;br /&gt;
&lt;br /&gt;
         $ sed 's/[ ]*$//g'&lt;br /&gt;
&lt;br /&gt;
     How do you remove blank lines, or lines with just spaces and tabs,&lt;br /&gt;
     saving the origional file as file.backup?&lt;br /&gt;
&lt;br /&gt;
         $ perl -pi.backup -e &amp;quot;s/^(\s)*\n//&amp;quot;  file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 70:&lt;br /&gt;
&lt;br /&gt;
     Generating Random Numbers.&lt;br /&gt;
&lt;br /&gt;
         $ od -vAn -N4 -tu4 &amp;lt; /dev/urandom&lt;br /&gt;
             3905158199&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 71:&lt;br /&gt;
&lt;br /&gt;
     Deleting a File by it's Inode Value.&lt;br /&gt;
&lt;br /&gt;
       See (PROGRAMMING TIP 5) for creating the file, or&lt;br /&gt;
&lt;br /&gt;
       $ cat &amp;gt; '\n\n\n\n\n\n\n'&lt;br /&gt;
         type some text&lt;br /&gt;
         ^D&lt;br /&gt;
&lt;br /&gt;
     To list the inode and display the characters.&lt;br /&gt;
&lt;br /&gt;
       $ ls -libt *&lt;br /&gt;
&lt;br /&gt;
     To remove by inode. Note the &amp;quot;--&amp;quot; option.  This&lt;br /&gt;
     will keep any special characters in the file from being&lt;br /&gt;
     interpreted at &amp;quot;rm&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
       $ find . -inum &amp;lt;inode&amp;gt; -exec rm -- '{}' \;&lt;br /&gt;
&lt;br /&gt;
     Or to check contents&lt;br /&gt;
&lt;br /&gt;
       $ find . -inum &amp;lt;inode&amp;gt; -exec cat '{}' \;&lt;br /&gt;
&lt;br /&gt;
     Reference:&lt;br /&gt;
         http://www.faqs.org/ftp/usenet/news.answers/unix-faq/faq/part2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 72:&lt;br /&gt;
&lt;br /&gt;
     Sending Attachments Using Mutt -- On the Command Line.&lt;br /&gt;
&lt;br /&gt;
        $ mutt -s &amp;quot;See Attachment&amp;quot; -a file.doc user@domain.net &amp;lt; message.txt&lt;br /&gt;
&lt;br /&gt;
          or just the message:&lt;br /&gt;
&lt;br /&gt;
        $ echo | mutt -a sample.tar.gz user@domain.net&lt;br /&gt;
&lt;br /&gt;
      Reference:&lt;br /&gt;
          http://www.shelldorado.com/articles/mailattachments.html&lt;br /&gt;
&lt;br /&gt;
        Also see (TIP 51).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 73:&lt;br /&gt;
&lt;br /&gt;
     Want to find out what functions a program calls?&lt;br /&gt;
&lt;br /&gt;
         $ strace &amp;lt;program&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Try this with &amp;quot;topen.c&amp;quot; (see PROGRAMMING TIP 5)&lt;br /&gt;
&lt;br /&gt;
         $ strace  ./topen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 74:&lt;br /&gt;
&lt;br /&gt;
     RPM Usage Summary.&lt;br /&gt;
&lt;br /&gt;
     Install. Full filename is needed.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -ivh Fedora/RPMS/postgresql-libs-7.4.2-1.i386.rpm&lt;br /&gt;
&lt;br /&gt;
     To view list of files installed with a particular package.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -ql postgresql-libs&lt;br /&gt;
                /usr/lib/libecpg.so.4&lt;br /&gt;
                /usr/lib/libecpg.so.4.1&lt;br /&gt;
                /usr/lib/libecpg_compat.so.1&lt;br /&gt;
                /usr/lib/libecpg_compat.so.1.1&lt;br /&gt;
                /usr/lib/libpgtypes.so.1&lt;br /&gt;
                ...&lt;br /&gt;
&lt;br /&gt;
     Or, to get the file listing from a package that is not installed use the&lt;br /&gt;
     &amp;quot;-p&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -pql /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/CHANGES&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/LICENSE&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/README&lt;br /&gt;
               /usr/share/man/man3/pcap.3.gz&lt;br /&gt;
&lt;br /&gt;
     For dependencies listing, use the &amp;quot;R&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qpR /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /sbin/ldconfig&lt;br /&gt;
               /sbin/ldconfig&lt;br /&gt;
               kernel &amp;gt;= 2.2.0&lt;br /&gt;
               libc.so.6&lt;br /&gt;
               libc.so.6(GLIBC_2.0)&lt;br /&gt;
               libc.so.6(GLIBC_2.1)&lt;br /&gt;
               libc.so.6(GLIBC_2.1.3)&lt;br /&gt;
               libc.so.6(GLIBC_2.3)&lt;br /&gt;
               openssl&lt;br /&gt;
               rpmlib(CompressedFileNames) &amp;lt;= 3.0.4-1&lt;br /&gt;
               rpmlib(PayloadFilesHavePrefix) &amp;lt;= 4.0-1&lt;br /&gt;
&lt;br /&gt;
     To check the integrity, use the &amp;quot;-K&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -K /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm: (sha1) dsa sha1 md5 gpg OK&lt;br /&gt;
&lt;br /&gt;
     To list all packages installed.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qa&lt;br /&gt;
&lt;br /&gt;
     To find out which file a package belongs to.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qf /usr/lib/libecpg.so.4.1&lt;br /&gt;
&lt;br /&gt;
     To uninstall a package&lt;br /&gt;
&lt;br /&gt;
         $ rpm -e&lt;br /&gt;
&lt;br /&gt;
     For building rpm packages reference the following:&lt;br /&gt;
       http://www-106.ibm.com/developerworks/library/l-rpm1/&lt;br /&gt;
&lt;br /&gt;
     To verify md5 sum so that you know it downloaded ok&lt;br /&gt;
&lt;br /&gt;
         $ rpm -K  *.rpm&lt;br /&gt;
&lt;br /&gt;
     The following is a good reference:&lt;br /&gt;
        http://www.rpm.org/max-rpm/s1-rpm-install-additional-options.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 75:&lt;br /&gt;
&lt;br /&gt;
     Listing Output from a Bash Script.&lt;br /&gt;
&lt;br /&gt;
     Add &amp;quot;set -x&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          #!/bin/bash&lt;br /&gt;
          set -x&lt;br /&gt;
          ls&lt;br /&gt;
          date&lt;br /&gt;
&lt;br /&gt;
     Will list the files and output as follows:&lt;br /&gt;
&lt;br /&gt;
           + ls&lt;br /&gt;
           ChangeLog  CVS  data  test&lt;br /&gt;
           + date&lt;br /&gt;
           Thu Jul  1 20:41:04 EDT 2004&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 76:&lt;br /&gt;
&lt;br /&gt;
     Using wget.&lt;br /&gt;
&lt;br /&gt;
     Grap a webpage and pipe it to less. For example suppose you wanted to pipe the&lt;br /&gt;
     contents of all these tips, directly from the web.&lt;br /&gt;
&lt;br /&gt;
      $ wget -O - http://sourceforge.net/direct-dl/mchirico/souptonuts/How_to_Linux_and_Open_Source.txt|less&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 77:&lt;br /&gt;
&lt;br /&gt;
     Finding IP address and MAC address.&lt;br /&gt;
&lt;br /&gt;
       $ /sbin/ifconfig&lt;br /&gt;
&lt;br /&gt;
     Note the following output &amp;quot;eth0&amp;quot; and &amp;quot;eth0:1&amp;quot; which means&lt;br /&gt;
     two IP addresses are tied to 1 NIC (Network Interface Card).&lt;br /&gt;
&lt;br /&gt;
             eth0      Link encap:Ethernet  HWaddr 00:50:DA:60:5B:AD&lt;br /&gt;
                       inet addr:192.168.1.155  Bcast:192.168.99.255  Mask:255.255.252.0&lt;br /&gt;
                       UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
                       RX packets:982757 errors:116 dropped:0 overruns:0 frame:116&lt;br /&gt;
                       TX packets:439297 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:1000&lt;br /&gt;
                       RX bytes:693529078 (661.4 Mb)  TX bytes:78400296 (74.7 Mb)&lt;br /&gt;
                       Interrupt:10 Base address:0xa800&lt;br /&gt;
&lt;br /&gt;
             eth0:1    Link encap:Ethernet  HWaddr 00:50:DA:60:5B:AD&lt;br /&gt;
                       inet addr:192.168.1.182  Bcast:192.168.3.255  Mask:255.255.252.0&lt;br /&gt;
                       UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
                       RX packets:982757 errors:116 dropped:0 overruns:0 frame:116&lt;br /&gt;
                       TX packets:439299 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:1000&lt;br /&gt;
                       RX bytes:693529078 (661.4 Mb)  TX bytes:78400636 (74.7 Mb)&lt;br /&gt;
                       Interrupt:10 Base address:0xa800&lt;br /&gt;
&lt;br /&gt;
             lo        Link encap:Local Loopback&lt;br /&gt;
                       inet addr:127.0.0.1  Mask:255.0.0.0&lt;br /&gt;
                       UP LOOPBACK RUNNING  MTU:16436  Metric:1&lt;br /&gt;
                       RX packets:785 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
                       TX packets:785 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:0&lt;br /&gt;
                       RX bytes:2372833 (2.2 Mb)  TX bytes:2372833 (2.2 Mb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 78:&lt;br /&gt;
&lt;br /&gt;
     DOS to UNIX and UNIX to DOS.&lt;br /&gt;
&lt;br /&gt;
        $ dos2unix file.txt&lt;br /&gt;
&lt;br /&gt;
     And to go the other way from UNIX to DOS&lt;br /&gt;
&lt;br /&gt;
        $ unix2dos unixfile&lt;br /&gt;
&lt;br /&gt;
     See the man page, since there are MAC options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     NOTE: If you're working file DOS files, you'll probably want to use&lt;br /&gt;
           &amp;quot;zip&amp;quot; instead of &amp;quot;gzip&amp;quot; so users on Windows can unzip them.&lt;br /&gt;
&lt;br /&gt;
              $ zip test.zip test.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 79:&lt;br /&gt;
&lt;br /&gt;
     Need to Run Interactive Commands? Try &amp;quot;expect&amp;quot;.&lt;br /&gt;
       http://expect.nist.gov/expect.tar.gz&lt;br /&gt;
&lt;br /&gt;
     This simple example waits for the input &amp;quot;hi&amp;quot;, in some form before&lt;br /&gt;
     returning, immediately, &amp;quot;hello there!&amp;quot;. Otherwise, it will wait for&lt;br /&gt;
     60 seconds, then, return &amp;quot;hello there!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/expect&lt;br /&gt;
          set timeout 60&lt;br /&gt;
          expect &amp;quot;hi\n&amp;quot;&lt;br /&gt;
          send &amp;quot;hello there!\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference:&lt;br /&gt;
        http://www.oreilly.com/catalog/expect/chapter/ch03.html&lt;br /&gt;
&lt;br /&gt;
        http://www.cotse.com/dlf/man/expect/bulletproof1.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 80:&lt;br /&gt;
&lt;br /&gt;
     Using PHP as a Command Line Scripting Language.&lt;br /&gt;
&lt;br /&gt;
     The following will grab the complete file from slashdot.&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/php -q&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;?php&lt;br /&gt;
         $fileName = &amp;quot;http://slashdot.org/slashdot.xml&amp;quot;;&lt;br /&gt;
         $rss = file($fileName) or die (&amp;quot;Cannot open file $fileName\n&amp;quot;);&lt;br /&gt;
         for ($index=0; $index &amp;lt; count($rss); $index++)&lt;br /&gt;
              {&lt;br /&gt;
              echo $rss[$index];&lt;br /&gt;
              }&lt;br /&gt;
         ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       Note, if you want an example that parses the XML of&lt;br /&gt;
       slashdot, then, download the following:&lt;br /&gt;
&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/php_scripts.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 81:&lt;br /&gt;
&lt;br /&gt;
     Discarding all output -- including stderr messages.&lt;br /&gt;
&lt;br /&gt;
         $ ls  &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     Or sending all output to a file&lt;br /&gt;
&lt;br /&gt;
         $ someprog &amp;gt; /tmp/file 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     Sometimes, find displays a lot of errors when searching through&lt;br /&gt;
     directories that the user doesn't have access to. To discard&lt;br /&gt;
     error messages &amp;quot;stderr&amp;quot;, which is normally file descripter &amp;quot;2&amp;quot;&lt;br /&gt;
     work the following:&lt;br /&gt;
&lt;br /&gt;
         $ find / -iname 'stuff' 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
          or to pipe results elsewhere&lt;br /&gt;
&lt;br /&gt;
         $ find / -iname 'stuff' &amp;gt; /tmp/results_of_find  2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 118).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 82:&lt;br /&gt;
&lt;br /&gt;
     Using MIX.  D. Knuth's  assembly language/machine-code instruction set used in&lt;br /&gt;
     his books to illustrate his algorithms.&lt;br /&gt;
&lt;br /&gt;
     Download the source:&lt;br /&gt;
&lt;br /&gt;
       http://sourceforge.net/project/showfiles.php?group_id=13897&lt;br /&gt;
&lt;br /&gt;
       $ ./configure&lt;br /&gt;
       $ make&lt;br /&gt;
       $ make install&lt;br /&gt;
&lt;br /&gt;
     Documentation can be found at the following link. The link on&lt;br /&gt;
     sourceforge is not correct, but, the one below works.&lt;br /&gt;
&lt;br /&gt;
       http://www.gnu.org/software/mdk/manual/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 83:&lt;br /&gt;
&lt;br /&gt;
     Gnuplot [ http://sourceforge.net/projects/gnuplot/ ].&lt;br /&gt;
&lt;br /&gt;
     This software is ideal for printing graphs.&lt;br /&gt;
&lt;br /&gt;
         gnuplot&amp;gt; set term png&lt;br /&gt;
         gnuplot&amp;gt; set output 'testcos.png'&lt;br /&gt;
         gnuplot&amp;gt; plot cos(x)*sin(x)&lt;br /&gt;
         gnuplot&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
     Or the following command can be put into &amp;quot;file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            $ cat &amp;gt; file&lt;br /&gt;
            set term png&lt;br /&gt;
            set output 'testcos.png'&lt;br /&gt;
            plot cos(x)*sin(x)&lt;br /&gt;
            exit&lt;br /&gt;
            ^D&lt;br /&gt;
&lt;br /&gt;
     Then, run as follows:&lt;br /&gt;
&lt;br /&gt;
            $ gnuplot file&lt;br /&gt;
&lt;br /&gt;
     Or, suppose you have the following file &amp;quot;/home/chirico/data&amp;quot;. Comments&lt;br /&gt;
     with &amp;quot;#&amp;quot; are not read by gnuplot.&lt;br /&gt;
&lt;br /&gt;
            # File /home/chirico/data&lt;br /&gt;
            #&lt;br /&gt;
            2005-07-26  1    2.3    3&lt;br /&gt;
            2005-07-27  2    3.4    5&lt;br /&gt;
            2005-07-28  3    4    6.6&lt;br /&gt;
            2005-07-29  4    6    2.5&lt;br /&gt;
&lt;br /&gt;
     And you have the following new &amp;quot;file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            set term png&lt;br /&gt;
            set xdata time&lt;br /&gt;
            set timefmt &amp;quot;%Y-%m-%d &amp;quot;&lt;br /&gt;
            set format x &amp;quot;%Y/%m/%d&amp;quot;&lt;br /&gt;
            set output '/var/www/html/chirico/gnuplot/data.png'&lt;br /&gt;
            plot '/home/chirico/data' using 1:2 w linespoints  title '1st col', \&lt;br /&gt;
             '/home/chirico/data' using 1:3 w linespoints  title '2nd col', \&lt;br /&gt;
             '/home/chirico/data' using 1:4 w linespoints  title '3rd col'&lt;br /&gt;
            exit&lt;br /&gt;
&lt;br /&gt;
     You can now get a graph of this data running the following:&lt;br /&gt;
&lt;br /&gt;
            $ gnuplot file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 84:&lt;br /&gt;
&lt;br /&gt;
     CPU Information - speed, processor, cache.&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/cpuinfo&lt;br /&gt;
&lt;br /&gt;
               processor       : 0&lt;br /&gt;
               vendor_id       : GenuineIntel&lt;br /&gt;
               cpu family      : 15&lt;br /&gt;
               model           : 2&lt;br /&gt;
               model name      : Intel(R) Pentium(R) 4 CPU 2.20GHz&lt;br /&gt;
               stepping        : 9&lt;br /&gt;
               cpu MHz         : 2193.221&lt;br /&gt;
               cache size      : 512 KB&lt;br /&gt;
               fdiv_bug        : no&lt;br /&gt;
               hlt_bug         : no&lt;br /&gt;
               f00f_bug        : no&lt;br /&gt;
               coma_bug        : no&lt;br /&gt;
               fpu             : yes&lt;br /&gt;
               fpu_exception   : yes&lt;br /&gt;
               cpuid level     : 2&lt;br /&gt;
               wp              : yes&lt;br /&gt;
               flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr&lt;br /&gt;
               bogomips        : 4325.37&lt;br /&gt;
&lt;br /&gt;
      &amp;quot;bogomips&amp;quot; is a rough but good way to quickly compare two computer speeds. True it's a&lt;br /&gt;
      bogus reading; but, a &amp;quot;good enough&amp;quot; for government work calculation.  See (TIP 10) for&lt;br /&gt;
      &amp;quot;vmstat&amp;quot; and &amp;quot;iostat&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 85:&lt;br /&gt;
&lt;br /&gt;
     POVRAY - Making Animated GIFs&lt;br /&gt;
&lt;br /&gt;
     To see this in action, reference:&lt;br /&gt;
      http://souptonuts.sourceforge.net/povray/orbit.pov.html&lt;br /&gt;
&lt;br /&gt;
     These are the basic command to create:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        $ povray orbit.ini -Iorbit.pov&lt;br /&gt;
        $ convert -delay 20 *.ppm orbit.gif&lt;br /&gt;
&lt;br /&gt;
     By the way, convert is a program from imagemagick, and it can&lt;br /&gt;
     be downloaded from ( http://www.imagemagick.org ).&lt;br /&gt;
&lt;br /&gt;
    The following is &amp;quot;orbit.pov&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          #include &amp;quot;colors.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;finish.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;metals.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;textures.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;stones.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;skies.inc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          camera {&lt;br /&gt;
            location &amp;lt; 2, 3, -8 &amp;gt;&lt;br /&gt;
            look_at  &amp;lt; 0, 0, 0 &amp;gt;&lt;br /&gt;
            focal_point &amp;lt;0, 0, 0&amp;gt;&lt;br /&gt;
            blur_samples 20&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          light_source {&lt;br /&gt;
                  &amp;lt; 0, 10, 0&amp;gt;&lt;br /&gt;
                  color White&lt;br /&gt;
                  area_light &amp;lt;2,0,0&amp;gt;,&amp;lt;0,0,2&amp;gt;, 2, 2&lt;br /&gt;
                  adaptive 1&lt;br /&gt;
                  fade_distance 8&lt;br /&gt;
                  fade_power 1&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          sky_sphere {&lt;br /&gt;
            S_Cloud3&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          plane { &amp;lt;0, 1, 0&amp;gt;, -1&lt;br /&gt;
                  texture {&lt;br /&gt;
                          pigment {&lt;br /&gt;
                                  checker color Blue, color White&lt;br /&gt;
                          }&lt;br /&gt;
                          finish {Phong_Glossy}&lt;br /&gt;
                  }&lt;br /&gt;
          }&lt;br /&gt;
          #declare ball0=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;0.5, 0.5, 0&amp;gt;, 1&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Yellow}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          #declare ball1=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;3, 2, 0&amp;gt;, 0.5&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Blue}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          #declare ball2=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;3, 1, 0&amp;gt;, 1&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Green}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          object {ball0 rotate 360*clock*y}&lt;br /&gt;
          object {ball1 rotate 720*clock*y}&lt;br /&gt;
          object {ball2 rotate 360*(1 - clock)*y}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    And, &amp;quot;orbit.ini&amp;quot; follows:&lt;br /&gt;
&lt;br /&gt;
          Output_File_Type=P&lt;br /&gt;
&lt;br /&gt;
          Width=320&lt;br /&gt;
          Height=240&lt;br /&gt;
&lt;br /&gt;
          Initial_Frame=1&lt;br /&gt;
          Final_Frame=10&lt;br /&gt;
          Antialias=true&lt;br /&gt;
&lt;br /&gt;
          Subset_Start_Frame=1&lt;br /&gt;
          Subset_End_Frame=10&lt;br /&gt;
&lt;br /&gt;
          Cyclic_Animation=on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 86:&lt;br /&gt;
&lt;br /&gt;
     GPG --  GnuPG&lt;br /&gt;
&lt;br /&gt;
        Reference: http://www.gnupg.org/documentation/faqs.html&lt;br /&gt;
                   http://codesorcery.net/mutt/mutt-gnupg-howto&lt;br /&gt;
                   http://www.gnupg.org/(en)/download/index.html&lt;br /&gt;
                   (SCRIPT 4) on following link:&lt;br /&gt;
                   http://prdownloads.sourceforge.net/souptonuts/README_common_script_commands.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Generage key:&lt;br /&gt;
&lt;br /&gt;
        $ gpg --gen-key&lt;br /&gt;
&lt;br /&gt;
     Generate public key ID and fingerprint&lt;br /&gt;
&lt;br /&gt;
        $ gpg --fingerprint&lt;br /&gt;
&lt;br /&gt;
     Get a list of keys:&lt;br /&gt;
&lt;br /&gt;
        $ gpg --list-keys&lt;br /&gt;
&lt;br /&gt;
          pub  1024D/A11C1499 2004-07-15 Mike Chirico &amp;lt;mchirico@comcast.net&amp;gt;&lt;br /&gt;
          sub  1024g/E1A3C2B3 2004-07-15&lt;br /&gt;
&lt;br /&gt;
     Encrypt&lt;br /&gt;
&lt;br /&gt;
        $ gpg -r Mike  --encrypt sample.txt&lt;br /&gt;
&lt;br /&gt;
       This will produce &amp;quot;sample.txt.asc&amp;quot;, which is a binary file.  Note, I can use &amp;quot;Mike&amp;quot; because that's the&lt;br /&gt;
       name on the list of keys. Again, it will be a binary file.&lt;br /&gt;
&lt;br /&gt;
     Encrypt using &amp;quot;ASCII-armored text&amp;quot;  (--armor), which is probably what you want when sending &amp;quot;in&amp;quot; the body of an&lt;br /&gt;
     email, or some document.&lt;br /&gt;
&lt;br /&gt;
        $ gpg  -r Mike  --encrypt --armor sample.txt&lt;br /&gt;
            or&lt;br /&gt;
        $ gpg -r Mike -e -a sample.txt&lt;br /&gt;
            or&lt;br /&gt;
        $ gpg --output somefile.asc --armor -r Mike  --encrypt --armor sample.txt&lt;br /&gt;
&lt;br /&gt;
     The above 3 statements will still produce &amp;quot;sample.txt.asc&amp;quot;, but look at it, or &amp;quot;$ cat sample.txt.asc&amp;quot; without &lt;br /&gt;
     fear, since there are no binary characters. Yes, you could even compile a program &amp;quot;$ g++ -o test test.c&amp;quot; , then,&lt;br /&gt;
     &amp;quot;$ gpg --output test.asc  -r Mike --encrypt --armor test&amp;quot;. However, when decrypting make sure to pipe&lt;br /&gt;
     the results.&lt;br /&gt;
&lt;br /&gt;
            $ gpg --decrypt test.asc &amp;gt; test&lt;br /&gt;
&lt;br /&gt;
     Export &amp;quot;public&amp;quot; key:&lt;br /&gt;
&lt;br /&gt;
           $ gpg --armor --export Mike &amp;gt; m1.asc&lt;br /&gt;
&lt;br /&gt;
     Signing the file &amp;quot;message.txt&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
           $ gpg --clearsign message.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Sending the key to the &amp;quot;key-server&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        First, list the keys.&lt;br /&gt;
&lt;br /&gt;
                $ gpg --list-keys&lt;br /&gt;
                    /home/chirico/.gnupg/pubring.gpg&lt;br /&gt;
                                 v------------------ Use this with &amp;quot;0x&amp;quot; in front -------&lt;br /&gt;
                  pub  1024D/A11C1499 2004-07-15 Mike Chirico  &amp;lt;mchirico@comcast.net&amp;gt;   |&lt;br /&gt;
                  sub  1024g/E1A3C2B3 2004-07-15                                        |&lt;br /&gt;
                                                                                        |&lt;br /&gt;
                                   v----------------------------------------------------&lt;br /&gt;
                $ gpg --send-keys 0xA11C1499&lt;br /&gt;
&lt;br /&gt;
             The above sends it to the keyserver defined in &amp;quot;/home/chirico/.gnupg/gpg.conf&amp;quot;.  Other key servers:&lt;br /&gt;
&lt;br /&gt;
                            wwwkeys.pgp.net&lt;br /&gt;
                            search.keyserver.net&lt;br /&gt;
                            pgp.ai.mit.edu&lt;br /&gt;
&lt;br /&gt;
             When you go to your user-group meetings, you need to bring 2 forms of ID, and&lt;br /&gt;
             list your Key fingerprint. Shown below is the command for getting this fingerprint.&lt;br /&gt;
&lt;br /&gt;
                $ gpg --fingerprint mchirico@comcast.net&lt;br /&gt;
                 pub   1024D/A11C1499 2004-07-15&lt;br /&gt;
                 Key fingerprint = 9D7F C80D BB7B 4BAB CCA4  1BE9 9056 5BEC A11C 1499&lt;br /&gt;
                 uid   Mike Chirico (http://souptonuts.sourceforge.net/chirico/index.php) &amp;lt;mchirico@comcast.net&amp;gt;&lt;br /&gt;
                 sub   1024g/E1A3C2B3 2004-07-15&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Receving keys:&lt;br /&gt;
&lt;br /&gt;
        The following will retrieve my mchirico@comcast.net key&lt;br /&gt;
&lt;br /&gt;
               $ gpg --recv-keys 0xA11C1499&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Special Note: If you get the following error &amp;quot;GPG: Warning: Using Insecure Memory&amp;quot; , then,&lt;br /&gt;
                   &amp;quot; chmod 4755 /path/to/gpg&amp;quot;  to setuid(root) permissioins on the gpg binary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     NOTE: If using mutt, just before sending with the &amp;quot;y&amp;quot; option, hit &amp;quot;p&amp;quot; to sign or encrypt.&lt;br /&gt;
&lt;br /&gt;
     It's possible to create a gpg/pgp email from the command line. For a tutorial on this,&lt;br /&gt;
     reference (SCRIPT 4) at the following link:&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/README_common_script_commands.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 87:&lt;br /&gt;
&lt;br /&gt;
     Working with Dates: Steffen Beyer has developed a Perl and C module for working with dates&lt;br /&gt;
&lt;br /&gt;
     This softare can be downloaded from the following location:&lt;br /&gt;
        http://www.engelschall.com/u/sb/download/pkg/Date-Calc-5.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
         $ wget http://www.engelschall.com/u/sb/download/pkg/Date-Calc-5.3.tar.gz&lt;br /&gt;
         $ tar -xzvf Date-Calc-5.3.tar.gz&lt;br /&gt;
         $ cd Date-Calc-5.3&lt;br /&gt;
         $ cp ./examples/cal.c .&lt;br /&gt;
         $ gcc cal.c DateCalc.c -o mcal&lt;br /&gt;
&lt;br /&gt;
     The file cal.c contains sample function calls from DateCalc.c.  Note, &amp;quot;DateCalc.c&amp;quot;&lt;br /&gt;
     is just a list of functions and includes for &amp;quot;DateCalc.h&amp;quot; and &amp;quot;ToolBox.h&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Or, and this may be easier, just download the following:&lt;br /&gt;
         http://prdownloads.sourceforge.net/cpearls/date_calc.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
     The above link contains a few examples.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 88:&lt;br /&gt;
&lt;br /&gt;
     Color patterns for mutt.&lt;br /&gt;
&lt;br /&gt;
     The colors can be changed in the /home/user/.muttrc file. The first field begins with&lt;br /&gt;
     color, the second field is the foreground color, and the third field is the background&lt;br /&gt;
     color, or default.&lt;br /&gt;
&lt;br /&gt;
     An example .muttrc for colors:&lt;br /&gt;
&lt;br /&gt;
       # color patterns for mutt&lt;br /&gt;
       color normal     white          black # normal text&lt;br /&gt;
       color indicator  black          yellow  # actual message&lt;br /&gt;
       color tree       brightmagenta  default # thread arrows&lt;br /&gt;
       color status     brightyellow         default # status line&lt;br /&gt;
       color error      brightred      default # errors&lt;br /&gt;
       color message    magenta        default # info messages&lt;br /&gt;
       color signature  magenta        default # signature&lt;br /&gt;
       color attachment brightyellow   red     # MIME attachments&lt;br /&gt;
       color search     brightyellow   red     # search matches&lt;br /&gt;
       color tilde      brightmagenta  default # ~ at bottom of msg&lt;br /&gt;
       color markers    red            default # + at beginning of wrapped lines&lt;br /&gt;
       color hdrdefault cyan           default # default header lines&lt;br /&gt;
       color bold       red            default # hiliting bold patterns in body&lt;br /&gt;
       color underline  green          default # hiliting underlined patterns in body&lt;br /&gt;
       color quoted     cyan           default # quoted text&lt;br /&gt;
       color quoted1    magenta        default&lt;br /&gt;
       color quoted2    red            default&lt;br /&gt;
       color quoted3    green          default&lt;br /&gt;
       color quoted4    magenta           default&lt;br /&gt;
       color quoted5    cyan           default&lt;br /&gt;
       color quoted6    magenta        default&lt;br /&gt;
       color quoted7    red            default&lt;br /&gt;
       color quoted8    green          default&lt;br /&gt;
       color quoted9    cyan           default&lt;br /&gt;
       color body   cyan  default  &amp;quot;((ftp|http|https)://|news:)[^ &amp;gt;)\&amp;quot;\t]+&amp;quot;&lt;br /&gt;
       color body   cyan  default  &amp;quot;[-a-z_0-9.+]+@[-a-z_0-9.]+&amp;quot;&lt;br /&gt;
       color body   red   default  &amp;quot;(^| )\\*[-a-z0-9*]+\\*[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color body   green default  &amp;quot;(^| )_[-a-z0-9_]+_[,.?]?[\n]&amp;quot;&lt;br /&gt;
       color body   red   default  &amp;quot;(^| )\\*[-a-z0-9*]+\\*[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color body   green default  &amp;quot;(^| )_[-a-z0-9_]+_[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color index  cyan  default  ~F         # Flagged&lt;br /&gt;
       color index  red   default  ~N         # New&lt;br /&gt;
       color index  magenta    default  ~T         # Tagged&lt;br /&gt;
       color index  cyan       default  ~D         # Deleted&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 190)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 89:&lt;br /&gt;
&lt;br /&gt;
     ps command in detail&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Here are the possible codes when using state &amp;quot;$ ps -e -o state,cmd&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             PROCESS STATE CODES&lt;br /&gt;
                  D   uninterruptible sleep (usually IO)&lt;br /&gt;
                  R   runnable (on run queue)&lt;br /&gt;
                  S   sleeping&lt;br /&gt;
                  T   traced or stopped&lt;br /&gt;
                  Z   a defunct (&amp;quot;zombie&amp;quot;) process&lt;br /&gt;
&lt;br /&gt;
                  &amp;lt;    high-priority (not nice to other users)&lt;br /&gt;
                  N    low-priority (nice to other users)&lt;br /&gt;
                  L    has pages locked into memory (for real-time and custom IO)&lt;br /&gt;
                  s    is a session leader&lt;br /&gt;
                  l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)&lt;br /&gt;
                  +    is in the foreground process group&lt;br /&gt;
&lt;br /&gt;
    For instance:&lt;br /&gt;
&lt;br /&gt;
     Note that the -o is for user defined, and -e is for select&lt;br /&gt;
     all process.&lt;br /&gt;
&lt;br /&gt;
       $ ps -e -o pid,state,start,time,etime,cmd&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
             9946 S 15:40:45 00:00:00    02:23:29 /bin/bash -i&lt;br /&gt;
             9985 T 15:41:24 00:00:01    02:22:50 emacs mout2&lt;br /&gt;
            10003 T 15:43:59 00:00:00    02:20:15 emacs NOTES&lt;br /&gt;
            10320 T 17:38:42 00:00:00       25:32 emacs stuff.c&lt;br /&gt;
         ...&lt;br /&gt;
&lt;br /&gt;
     You may want to command below, without the -e, which will give the&lt;br /&gt;
     process only under the current terminal.&lt;br /&gt;
&lt;br /&gt;
       $ ps -o pid,state,start,time,etime,cmd&lt;br /&gt;
&lt;br /&gt;
     Want to find what 's impacting your load?&lt;br /&gt;
&lt;br /&gt;
       $ ps -e -o %cpu,pid,state,start,time,etime,%cpu,%mem,cmd|sort -rn|less&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ ps aux&lt;br /&gt;
&lt;br /&gt;
            USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND&lt;br /&gt;
            root         1  0.0  0.0  1380  480 ?        S    Aug04   0:00 init [3]&lt;br /&gt;
            root         2  0.0  0.0     0    0 ?        SWN  Aug04   0:00 [ksoftirqd/0]&lt;br /&gt;
            root         3  0.0  0.0     0    0 ?        SW&amp;lt;  Aug04   0:00 [events/0]&lt;br /&gt;
            root         4  0.0  0.0     0    0 ?        SW&amp;lt;  Aug04   0:00 [khelper]&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     Or, if you want to see the environment add the -e option&lt;br /&gt;
&lt;br /&gt;
       $ ps aeux&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
            chirico   2735  0.0  0.1  4400 1492 pts/0    S    Aug04   0:00 -bash USER=chirico LOGNAME=chirico HOME=/home/chirico PATH=/usr/&lt;br /&gt;
            chirico   2771  0.0  0.0  4328  924 pts/0    S    Aug04   0:00 screen -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm S&lt;br /&gt;
            chirico   2772  0.0  0.6  9476 6352 ?        S    Aug04   0:54 SCREEN -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm S&lt;br /&gt;
            chirico   2773  0.0  0.1  4432 1548 pts/1    S    Aug04   0:10 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            chirico   2797  0.0  0.1  4416 1496 pts/2    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            root      2821  0.0  0.0  4100  952 pts/2    S    Aug04   0:00 su -&lt;br /&gt;
            root      2822  0.0  0.1  4384 1480 pts/2    S    Aug04   0:00 -bash&lt;br /&gt;
            chirico   2862  0.0  0.1  4428 1524 pts/3    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            sporkey   2946  0.0  0.2  6836 2960 ?        S    Aug04   0:15 fetchmail&lt;br /&gt;
            chirico   2952  0.0  0.1  4436 1552 pts/5    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            chirico   3880  0.0  0.1  4416 1496 pts/6    S    Aug05   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            root      3904  0.0  0.0  4100  956 pts/6    S    Aug05   0:00 su - donkey&lt;br /&gt;
            donkey    3905  0.0  0.1  4336 1452 pts/6    S    Aug05   0:00 -bash&lt;br /&gt;
            donkey    3938  0.0  0.2  6732 2856 ?        S    Aug05   0:14 fetchmail&lt;br /&gt;
            chirico   3944  0.0  0.1  4416 1496 pts/7    S    Aug05   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     There is also a -f &amp;quot;forrest&amp;quot; option. Also note below &amp;quot; -bash&amp;quot; is the start of a login shell.&lt;br /&gt;
&lt;br /&gt;
      $ ps aeuxwwf &lt;br /&gt;
     &lt;br /&gt;
     The ww option above gives a wide format with all variables. Use the above command if you plan&lt;br /&gt;
     to parse through a Perl script. Otherwise, it may be easier to do a quick read using the command&lt;br /&gt;
     below, without &amp;quot;ww&amp;quot;.    &lt;br /&gt;
&lt;br /&gt;
      $ ps aeuxf&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
            root      2339  0.0  0.1  3512 1444 ?        S    Dec01   0:00 /usr/sbin/sshd&lt;br /&gt;
            root     25651  0.0  0.1  6764 1980 ?        S    Dec23   0:00  \_ /usr/sbin/sshd&lt;br /&gt;
            chirico  25653  0.0  0.2  6840 2236 ?        S    Dec23   0:14      \_ /usr/sbin/sshd&lt;br /&gt;
            chirico  25654  0.0  0.1  4364 1440 pts/4    S    Dec23   0:00          \_ -bash USER=chirico LOGNAME=chirico HOME=/home/chirico&lt;br /&gt;
            chirico  25690  0.0  0.0  4328  920 pts/4    S    Dec23   0:00              \_ screen -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm&lt;br /&gt;
            root      2355  0.0  0.0  2068  904 ?        S    Dec01   0:00 xinetd -stayalive -pidfile /var/run/xinetd.pid&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     It is also possible to list the process by command line. For example, the following command will only list the emacs&lt;br /&gt;
     processes.&lt;br /&gt;
&lt;br /&gt;
      $ ps -fC emacs&lt;br /&gt;
       UID        PID  PPID  C STIME TTY          TIME CMD&lt;br /&gt;
       chirico   5049  5020  0 May11 pts/13   00:00:00 emacs -nw Notes&lt;br /&gt;
       chirico  12368  5104  0 May12 pts/18   00:00:00 emacs -nw dnotify.c&lt;br /&gt;
       chirico  19792 18028  0 May13 pts/20   00:00:00 emacs -nw hello.c&lt;br /&gt;
       chirico  14034 27367  0 18:52 pts/8    00:00:00 emacs -nw How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
     You may also want to consider using top in batch mode. Here the &amp;quot;-n 1&amp;quot; means refresh once,&lt;br /&gt;
     and the &amp;quot;b&amp;quot; is for batch. The &amp;quot;fmt -s&amp;quot; is to put it in a more readable format.&lt;br /&gt;
&lt;br /&gt;
       $ top -n 1 b |fmt  -s &amp;gt;&amp;gt;statfile&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 90:&lt;br /&gt;
&lt;br /&gt;
     Learning Assembly.&lt;br /&gt;
&lt;br /&gt;
     Once you have written the source, assuming the file is &amp;quot;exit.s&amp;quot;, it can be compiled as follows:&lt;br /&gt;
&lt;br /&gt;
            $ as exit.s -o exit.o&lt;br /&gt;
            $ ld exit.o -o exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Here is the program:&lt;br /&gt;
&lt;br /&gt;
         #&lt;br /&gt;
         #INPUT:  none&lt;br /&gt;
         #&lt;br /&gt;
         #OUTPUT:         returns a status code. This can be viewed&lt;br /&gt;
         # by typing&lt;br /&gt;
         #&lt;br /&gt;
         # echo $?&lt;br /&gt;
         #&lt;br /&gt;
         # after running the program&lt;br /&gt;
         #&lt;br /&gt;
         #VARIABLES:&lt;br /&gt;
         # %eax holds the system call number&lt;br /&gt;
         # (this is always the case)&lt;br /&gt;
         #&lt;br /&gt;
         # %ebx holds the return status&lt;br /&gt;
         #&lt;br /&gt;
                 .section .data&lt;br /&gt;
                 .section .text&lt;br /&gt;
&lt;br /&gt;
                 .globl _start&lt;br /&gt;
         _start:&lt;br /&gt;
                 movl $1, %eax # this is the linux kernel command&lt;br /&gt;
                 # number (system call) for exiting&lt;br /&gt;
                 # a program&lt;br /&gt;
                 movl $0, %ebx # this is the status number we will&lt;br /&gt;
                 # return to the operating system.&lt;br /&gt;
                 # Change this around and it will&lt;br /&gt;
                 # return different things to&lt;br /&gt;
                 # echo $?&lt;br /&gt;
                 int $0x80 # this wakes up the kernel to run&lt;br /&gt;
                 # the exit command&lt;br /&gt;
&lt;br /&gt;
     After running this program, you can get the exit code.&lt;br /&gt;
&lt;br /&gt;
            $ exit $?&lt;br /&gt;
            0&lt;br /&gt;
&lt;br /&gt;
     That is about all it does; but, get the book for more details. The&lt;br /&gt;
     book is free.&lt;br /&gt;
&lt;br /&gt;
          http://savannah.nongnu.org/download/pgubook/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 91:&lt;br /&gt;
&lt;br /&gt;
     Creating a sandbox for reiserfstune,debugreiserfs and ACL.  Also see TIP 4.&lt;br /&gt;
&lt;br /&gt;
     Assume you have a reisers files system created from a disk file, which&lt;br /&gt;
     means you have done something like the following:&lt;br /&gt;
&lt;br /&gt;
          # dd if=/dev/zero of=disk-rfs count=102400&lt;br /&gt;
          # losetup  /dev/loop4 ./disk-rfs&lt;br /&gt;
          # mkfs -t reiserfs /dev/loop4&lt;br /&gt;
          # mkdir /fs2&lt;br /&gt;
          # mount -o loop,acl ./disk-rfs /fs2&lt;br /&gt;
&lt;br /&gt;
     Now, you can run reiserfstune. But, first you will need to umount fs2&lt;br /&gt;
&lt;br /&gt;
          # umount /fs2&lt;br /&gt;
          # reiserfstune ./disk-rfs&lt;br /&gt;
&lt;br /&gt;
     Or you can run the debug command&lt;br /&gt;
&lt;br /&gt;
          # debugreiserfs -J ./disk-rfs&lt;br /&gt;
&lt;br /&gt;
     Now, suppose you run through a lot of the debug options on&lt;br /&gt;
     http://www.namesys.com/ and you destroy this file.&lt;br /&gt;
&lt;br /&gt;
     You can recreate the file and delete the loop device.&lt;br /&gt;
&lt;br /&gt;
          # dd if=/dev/zero of=disk-rfs count=102400&lt;br /&gt;
          # losetup -d /dev/loop4&lt;br /&gt;
          # mount -o loop,acl ./disk-rfs /fs2&lt;br /&gt;
&lt;br /&gt;
     Now, try working with some of the ACL options - you can only do this&lt;br /&gt;
     with the latest kernel and tools -- Fedora Core 2 will work.&lt;br /&gt;
&lt;br /&gt;
     Assume you have 3 users, donkey, chirico and bozo2. You can give&lt;br /&gt;
     everyone rights to this file system as follows:&lt;br /&gt;
&lt;br /&gt;
          # setfacl -R -m d:u:donkey:rwx,d:u:chirico:rwx,d:u:bozo2:rwx /fs2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 92:&lt;br /&gt;
&lt;br /&gt;
     SpamAssassin - Setup.&lt;br /&gt;
&lt;br /&gt;
     Step 1.&lt;br /&gt;
&lt;br /&gt;
           Installing the SpamAssassin CPAN utility. You will need to do this&lt;br /&gt;
           as root.&lt;br /&gt;
        &lt;br /&gt;
              $ su -&lt;br /&gt;
&lt;br /&gt;
           Once you have root privileges invoke cpan.&lt;br /&gt;
        &lt;br /&gt;
              # perl -MCPAN -e shell&lt;br /&gt;
&lt;br /&gt;
              cpan&amp;gt;&lt;br /&gt;
&lt;br /&gt;
           Now install with prerequisites policy set to ask.&lt;br /&gt;
        &lt;br /&gt;
              cpan&amp;gt; o conf prerequisites_policy ask&lt;br /&gt;
        &lt;br /&gt;
              cpan&amp;gt; install Mail::SpamAssassin&lt;br /&gt;
        &lt;br /&gt;
           You will get lots of output as the necessary modules are downloaded and&lt;br /&gt;
           compiled and installed.&lt;br /&gt;
&lt;br /&gt;
     Step 2.&lt;br /&gt;
&lt;br /&gt;
            Configuration.&lt;br /&gt;
&lt;br /&gt;
            Edit the following &amp;quot;/etc/mail/spamassassin/local.cf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            Here is a look at my file&lt;br /&gt;
&lt;br /&gt;
                $ cat /etc/mail/spamassassin/local.cf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                # This is the right place to customize your installation of SpamAssassin.&lt;br /&gt;
                #&lt;br /&gt;
                # See 'perldoc Mail::SpamAssassin::Conf' for details of what can be&lt;br /&gt;
                # tweaked.&lt;br /&gt;
                #&lt;br /&gt;
                ###########################################################################&lt;br /&gt;
                #&lt;br /&gt;
                # rewrite_subject 0&lt;br /&gt;
                # report_safe 1&lt;br /&gt;
                # trusted_networks 212.17.35.&lt;br /&gt;
                #&lt;br /&gt;
                &lt;br /&gt;
                # Below added from book&lt;br /&gt;
                # You may want to set this to 5, then, work your way down.&lt;br /&gt;
                # Currently I have this 3&lt;br /&gt;
                required_hits 3&lt;br /&gt;
                &lt;br /&gt;
                # This determines how spam is reported. Currently safe email is reported&lt;br /&gt;
                # in the message.&lt;br /&gt;
                report_safe 1&lt;br /&gt;
                &lt;br /&gt;
                # The will rewrite the tag of the spam message.&lt;br /&gt;
                rewrite_subject 1&lt;br /&gt;
                &lt;br /&gt;
                # By default, SpamAssassin will run RBL checks.  If your ISP already&lt;br /&gt;
                # does this, set this to 1.&lt;br /&gt;
                skip_rbl_checks 0&lt;br /&gt;
&lt;br /&gt;
     Step 3.&lt;br /&gt;
&lt;br /&gt;
            Update .procmail.&lt;br /&gt;
&lt;br /&gt;
            You should update the .procmail file as follows. Here is my /home/chirico/.procmail file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ cat /home/chirico/.procmailrc&lt;br /&gt;
&lt;br /&gt;
                PATH=/bin:/usr/bin:/usr/local/bin&lt;br /&gt;
                MAILDIR=/var/spool/mail&lt;br /&gt;
                DEFAULT=/var/spool/mail/chirico&lt;br /&gt;
                LOGFILE=/home/chirico/MailBAG&lt;br /&gt;
                MYHOME=/home/chirico&lt;br /&gt;
                #  Must have folder MailTRASH&lt;br /&gt;
                TRASH=/home/chirico/MailTRASH&lt;br /&gt;
                &lt;br /&gt;
                # Will get everything from this mail&lt;br /&gt;
                :0&lt;br /&gt;
                * ^From:.*sporkey@comcast.net&lt;br /&gt;
                        $DEFAULT&lt;br /&gt;
                &lt;br /&gt;
                # Spamassassin&lt;br /&gt;
                :0fw&lt;br /&gt;
                * &amp;lt;300000&lt;br /&gt;
                |/usr/local/bin/spamassassin&lt;br /&gt;
&lt;br /&gt;
      Reference:&lt;br /&gt;
        http://pm-doc.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 93:&lt;br /&gt;
&lt;br /&gt;
     Make Graphs: using dot and neato.&lt;br /&gt;
&lt;br /&gt;
       $ dot -Tpng dotfile -o myout.png&lt;br /&gt;
&lt;br /&gt;
     To see the output reference the following:&lt;br /&gt;
       http://souptonuts.sourceforge.net/code/myout.png&lt;br /&gt;
&lt;br /&gt;
     Where &amp;quot;dotfile&amp;quot; is the following:&lt;br /&gt;
&lt;br /&gt;
       $ cat dotfile&lt;br /&gt;
&lt;br /&gt;
       digraph g&lt;br /&gt;
       {&lt;br /&gt;
               node [shape = record];&lt;br /&gt;
&lt;br /&gt;
               node0 [ label =&amp;quot;&amp;lt;f0&amp;gt; stuff | &amp;lt;f1&amp;gt; J | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node1 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; E | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node4 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; C | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node6 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; I | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node2 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; U | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node5 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; N | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node9 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; Y | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node8 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; W | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node10 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; Z | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node7 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; A | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node3 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; G | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node0&amp;quot;:f0 -&amp;gt; &amp;quot;node1&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node0&amp;quot;:f2 -&amp;gt; &amp;quot;node2&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node1&amp;quot;:f0 -&amp;gt; &amp;quot;node4&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node1&amp;quot;:f2 -&amp;gt; &amp;quot;node6&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node4&amp;quot;:f0 -&amp;gt; &amp;quot;node7&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node4&amp;quot;:f2 -&amp;gt; &amp;quot;node3&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node2&amp;quot;:f0 -&amp;gt; &amp;quot;node5&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node2&amp;quot;:f2 -&amp;gt; &amp;quot;node9&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node9&amp;quot;:f0 -&amp;gt; &amp;quot;node8&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node9&amp;quot;:f2 -&amp;gt; &amp;quot;node10&amp;quot;:f1;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
     Checkout the following article:&lt;br /&gt;
        http://www.linuxjournal.com/article.php?sid=7275&lt;br /&gt;
&lt;br /&gt;
     To download this software&lt;br /&gt;
        http://www.graphviz.org/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 94:&lt;br /&gt;
&lt;br /&gt;
     Makefile: working with conditions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     First note that all the indentations of the file must be&lt;br /&gt;
     a single tab. There cannot be any spaces, or make will&lt;br /&gt;
     not run.&lt;br /&gt;
&lt;br /&gt;
       $ cat Makefile&lt;br /&gt;
&lt;br /&gt;
        # Compiler flags&lt;br /&gt;
        sqliteLIB := $(shell ls /usr/local/lib/libsqlite.so)&lt;br /&gt;
        sqlite3LIB := $(shell ls /usr/local/lib/libsqlite3.so)&lt;br /&gt;
        # all assumes sqlite and sqlite3 are installed&lt;br /&gt;
        #&lt;br /&gt;
&lt;br /&gt;
        test:&lt;br /&gt;
        ifeq (&amp;quot;$(sqlite3LIB)&amp;quot;,&amp;quot;/usr/local/lib/libsqlite3.so&amp;quot;)&lt;br /&gt;
             @echo -e &amp;quot;True -- we found the file&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
             @echo &amp;quot;False -- we did not find the file&amp;quot;&lt;br /&gt;
        endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     So, if I run make I will get the following output.&lt;br /&gt;
&lt;br /&gt;
       $ make&lt;br /&gt;
       True -- we found the file&lt;br /&gt;
&lt;br /&gt;
     This is because I have a file /usr/local/lib/libsqlite3.so on my system.&lt;br /&gt;
     Note how the assignment is made, with the shell command&lt;br /&gt;
&lt;br /&gt;
           sqlite3LIB := $(shell ls /usr/local/lib/libsqlite3.so)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 95:&lt;br /&gt;
&lt;br /&gt;
     Bash: Conditional Expressions&lt;br /&gt;
&lt;br /&gt;
          if [ -e /etc/ntp.conf ]&lt;br /&gt;
            then&lt;br /&gt;
              echo &amp;quot;You have the ntp config file&amp;quot;&lt;br /&gt;
            else&lt;br /&gt;
              echo &amp;quot;You do not have the ntp config file&amp;quot;&lt;br /&gt;
          fi&lt;br /&gt;
&lt;br /&gt;
       Now using an AND condition inside the [ ]. By the way, above, you&lt;br /&gt;
       can put the &amp;quot;then&amp;quot; on the same line as the if &amp;quot;if [ -e /etc/ntp.conf ]; then&amp;quot;&lt;br /&gt;
       as long as you use the &amp;quot;;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           if [ \( -e /etc/ntp.conf \) -a \( -e /etc/ntp/ntpservers \) ]&lt;br /&gt;
             then&lt;br /&gt;
               echo &amp;quot;You have ntp config and ntpservers&amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp.conf ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntp.conf &amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp/ntpservers ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntpservers &amp;quot;&lt;br /&gt;
             else&lt;br /&gt;
               echo &amp;quot; you have neither ntp.conf or ntpservers&amp;quot;&lt;br /&gt;
           fi&lt;br /&gt;
&lt;br /&gt;
        A few things to note above. Else if statement is written as &amp;quot;elif&amp;quot;, and when&lt;br /&gt;
        dealing with &amp;quot;(&amp;quot; you will need to insert &amp;quot;\(&amp;quot;. By the way &amp;quot;-o&amp;quot; can replace &amp;quot;-a&amp;quot;&lt;br /&gt;
        and the &amp;quot;-o&amp;quot; is for OR condition. AND can be done as follows too.&lt;br /&gt;
&lt;br /&gt;
           if [ -e /etc/ntp.conf ] &amp;amp;&amp;amp; [ -e /etc/ntp/ntpservers ]&lt;br /&gt;
             then&lt;br /&gt;
               echo &amp;quot;You have ntp config and ntpservers&amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp.conf ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntp.conf &amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp/ntpservers ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntpservers &amp;quot;&lt;br /&gt;
             else&lt;br /&gt;
               echo &amp;quot; you have neither ntp.conf or ntpservers&amp;quot;&lt;br /&gt;
           fi&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (files).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             -b file      True if file exists and is a block file&lt;br /&gt;
             -c file      True if file exists and is a character device file&lt;br /&gt;
             -d file      True if file exists and is a directory&lt;br /&gt;
             -e file      True if file exists&lt;br /&gt;
             -f file      True if file exists and is a regular file&lt;br /&gt;
             -g file      True if file exists and is set goup id&lt;br /&gt;
             -G file      True if owned by the effective group ID&lt;br /&gt;
&lt;br /&gt;
             -k file      True if &amp;quot;sticky&amp;quot; bit is set and file exists&lt;br /&gt;
             -L file      True if file exists and is a symbolic link&lt;br /&gt;
             -n string    True if string is non-null&lt;br /&gt;
&lt;br /&gt;
             -O file      Ture if file exists and is owned by the effective user ID&lt;br /&gt;
&lt;br /&gt;
             -p file      True if file is a named pipe (FIFO)&lt;br /&gt;
             -r file      True if file is readable&lt;br /&gt;
             -s file      True if file has size &amp;gt; 0&lt;br /&gt;
             -S file      True if file exists and is a socket&lt;br /&gt;
&lt;br /&gt;
             -t file      True if file is open and refers to a terminal.&lt;br /&gt;
             -u file      True if setuid bit is set&lt;br /&gt;
             -w file      True if file exists and is writeable&lt;br /&gt;
             -x file      True if file executable&lt;br /&gt;
             -x dir       True if directory can be searched&lt;br /&gt;
&lt;br /&gt;
             file1 -nt file2     True if file1 modification date newer than file2&lt;br /&gt;
             file1 -ot file2     True if file1 modification date older than file2&lt;br /&gt;
             file1 -ef file2     True if file1 and file2 have same inode&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (Integers).&lt;br /&gt;
&lt;br /&gt;
             -lt  Less than&lt;br /&gt;
             -le  Less than or equal&lt;br /&gt;
             -eq  Equal&lt;br /&gt;
             -ge  Greater than or equal&lt;br /&gt;
             -gt  Greater than&lt;br /&gt;
             -ne  Not equal&lt;br /&gt;
&lt;br /&gt;
          Example usage.&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
             {&lt;br /&gt;
               while read num value; do&lt;br /&gt;
                if [ $num -gt  2 ]; then&lt;br /&gt;
                  echo $value&lt;br /&gt;
                fi&lt;br /&gt;
               done&lt;br /&gt;
             } &amp;lt; somefile&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (Strings).&lt;br /&gt;
&lt;br /&gt;
             str1 = str2      str1 matches str2&lt;br /&gt;
             str1 != str2     str1 does not matches str2&lt;br /&gt;
             str1 &amp;lt; str2      str1 is less than str2&lt;br /&gt;
             str1 &amp;gt;  str2     str1 is greater than str2&lt;br /&gt;
             -n str1          str1 is not null (length greater than 0)&lt;br /&gt;
             -z str1          str1 is null (las length 0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 96:&lt;br /&gt;
&lt;br /&gt;
     CVS: Working with cvs&lt;br /&gt;
&lt;br /&gt;
      INITIAL REPOSITORY:&lt;br /&gt;
&lt;br /&gt;
       To create a repository, and this is normally done by the system admin. This&lt;br /&gt;
       is NOT creating a project to checkout, but the location where everything&lt;br /&gt;
       will be stored! The initial repository!&lt;br /&gt;
&lt;br /&gt;
             cvs -d repository_root_directory init&lt;br /&gt;
&lt;br /&gt;
       Or here is a specific example:&lt;br /&gt;
&lt;br /&gt;
             cvs -d /work/cvsREPOSITORY/   init&lt;br /&gt;
&lt;br /&gt;
       Creating a directory tree from scratch. For a new project, the easiest thing to&lt;br /&gt;
       do is probably to create an empty directory structure, like this:&lt;br /&gt;
&lt;br /&gt;
             $ mkdir sqlite_examples&lt;br /&gt;
             $ mkdir sqlite_examples/man&lt;br /&gt;
             $ mkdir sqlite_examples/testing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       After that, you use the import command to create the&lt;br /&gt;
       corresponding (empty) directory structure inside the repository:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             $ cd &amp;lt;directory&amp;gt;&lt;br /&gt;
             $ cvs -d repository_root_directory import  -m &amp;quot;Created directory structure&amp;quot; yoyodyne/dir yoyo start&lt;br /&gt;
&lt;br /&gt;
       Or, here is a specific example.&lt;br /&gt;
&lt;br /&gt;
             $  cd sqlite_examples&lt;br /&gt;
             $  cvs  -d /work/cvsREPOSITORY/ import -m 'test SQlite'  sqlite_examples sqlite_examples start&lt;br /&gt;
&lt;br /&gt;
       Now, you can delete the directory sqlite_examples, or go to another directory and type&lt;br /&gt;
       the following:&lt;br /&gt;
&lt;br /&gt;
             $ cvs -d /work/cvsREPOSITORY/ co sqlite_examples&lt;br /&gt;
&lt;br /&gt;
     COOL TOOLS:&lt;br /&gt;
&lt;br /&gt;
           1. cvsps&lt;br /&gt;
           2. cvsreport&lt;br /&gt;
&lt;br /&gt;
         cvsps which you can find at http://www.cobite.com/cvsps/cvsps-2.0rc1.tar.gz&lt;br /&gt;
&lt;br /&gt;
             $ cvsps -f README_sqlite_tutorial.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 97:&lt;br /&gt;
&lt;br /&gt;
     Common vi and vim commands&lt;br /&gt;
&lt;br /&gt;
           Command mode ESC&lt;br /&gt;
&lt;br /&gt;
                dd       delete&lt;br /&gt;
                u        undelete&lt;br /&gt;
                y        yank (copy to buffer)&lt;br /&gt;
                p/P      p before cursor/P after cursor&lt;br /&gt;
&lt;br /&gt;
                Ctl-g    show current line number&lt;br /&gt;
                shft-G   end of file&lt;br /&gt;
              n shft-G   move to line n&lt;br /&gt;
&lt;br /&gt;
               /stuff/   search&lt;br /&gt;
                  n   repeat in same direction&lt;br /&gt;
                  N   repeat in opposite direction&lt;br /&gt;
                  /return  repeat seach forward&lt;br /&gt;
                  ?return  repeat seach backward&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;dyy  Yank current line to buffer d&lt;br /&gt;
               &amp;quot;a7yy Yank next 7 lines to buffer a&lt;br /&gt;
                    or&lt;br /&gt;
               :1,7ya a  Yank [ya] lines 1,7 to buffer a&lt;br /&gt;
               :1,7ya b  Yank [ya] lines 1,7 to buffer b&lt;br /&gt;
&lt;br /&gt;
               :5 pu b   Put [pu] buffer b after line 5&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;dP   Put the content of buffer d before cursor&lt;br /&gt;
               &amp;quot;ap   Put the contents of buffer a after cursor&lt;br /&gt;
&lt;br /&gt;
               :1,4 w! file2  Write lines 1,4 to file2&lt;br /&gt;
               :1,3&lt;br /&gt;
&lt;br /&gt;
               :set nu     Display line numbers&lt;br /&gt;
               :set nonum  Turns off display&lt;br /&gt;
&lt;br /&gt;
               :e &amp;lt;filename&amp;gt; Edit a file in a new buffer&lt;br /&gt;
&lt;br /&gt;
            vim&lt;br /&gt;
               :split&lt;br /&gt;
               :split &amp;lt;filename&amp;gt;&lt;br /&gt;
               :sp &amp;lt;filename&amp;gt;&lt;br /&gt;
               :split new&lt;br /&gt;
&lt;br /&gt;
                   ctl-w   To move between windows&lt;br /&gt;
                   ctl-w+&lt;br /&gt;
                   ctl-w-  To change size&lt;br /&gt;
                   ctl+wv  Split windows vertically&lt;br /&gt;
                   ctl-wq  Close window&lt;br /&gt;
&lt;br /&gt;
               :only       To view only 1 window&lt;br /&gt;
&lt;br /&gt;
            vim dictionary - put the following command in ~/.vimrc&lt;br /&gt;
&lt;br /&gt;
                   set dictionary+=/usr/share/dict/words&lt;br /&gt;
                   set thesaurus+=/usr/share/dict/words&lt;br /&gt;
              &lt;br /&gt;
               Now, after you type a word &amp;lt;ctl-x&amp;gt;&amp;lt;ctl-k&amp;gt;&amp;lt;ctl-n&amp;gt; and to &lt;br /&gt;
               go back in the listing &amp;lt;ctl-p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                   butter&amp;lt;ctl-x&amp;gt;&amp;lt;ctl-k&amp;gt;&amp;lt;ctl-n&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 98:&lt;br /&gt;
&lt;br /&gt;
     Using apt-get&lt;br /&gt;
&lt;br /&gt;
          $ apt-get update&lt;br /&gt;
          $ apt-get -s install &amp;lt;pkage&amp;gt;    &amp;lt;---- if everything is ok, then, remove the s&lt;br /&gt;
&lt;br /&gt;
     Note you may want to use dpkg to purge if you have to do a reinstall.&lt;br /&gt;
&lt;br /&gt;
          $ dpkg --purge exim4-base&lt;br /&gt;
          $ dpkg --purge exim4-config&lt;br /&gt;
          $ apt-get install exim4&lt;br /&gt;
&lt;br /&gt;
          $ dpkg-reconfigure exim4-config&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 99:&lt;br /&gt;
&lt;br /&gt;
     Mounting a cdrom on openbsd and installing packages&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /cdrom&lt;br /&gt;
          $ mount /dev/cd0a /cdrom&lt;br /&gt;
          $ cd /cdrom&lt;br /&gt;
&lt;br /&gt;
     To add packages&lt;br /&gt;
&lt;br /&gt;
          $ pkg_add -v  &amp;lt;directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Mounting a cdrom on linux to a user's home sub-directory:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /home/chirico/cdrom&lt;br /&gt;
          $ mount /dev/cdrom /home/chirico/cdrom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 100:&lt;br /&gt;
&lt;br /&gt;
    Creating a boot floppy for knoppix cd:&lt;br /&gt;
&lt;br /&gt;
          $ dd if=/mnt/cdrom/KNOPPIX/boot.img of=/dev/fd0 bs=1440k&lt;br /&gt;
&lt;br /&gt;
    References:&lt;br /&gt;
        http://www.knoppix.net/docs/index.php/BootFloppyHowTo&lt;br /&gt;
&lt;br /&gt;
    For a lot of the knoppix how-to's&lt;br /&gt;
        http://www.knoppix.net/docs/index.php/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 101:&lt;br /&gt;
&lt;br /&gt;
    Diction and Style Tools for Linux  http://ftp.gnu.org/gnu/diction/&lt;br /&gt;
&lt;br /&gt;
        $ diction mytext|less&lt;br /&gt;
&lt;br /&gt;
    Or, this can be done interactively&lt;br /&gt;
&lt;br /&gt;
        $ diction&lt;br /&gt;
        This is more text to read and you can do with it&lt;br /&gt;
        what you want.&lt;br /&gt;
        (stdin):1: This is more text to read and you [can -&amp;gt; (do not confuse with &amp;quot;may&amp;quot;)] do with it what you want.&lt;br /&gt;
&lt;br /&gt;
    DESCRIPTION&lt;br /&gt;
       Diction finds all sentences in a document, that contain phrases from  a&lt;br /&gt;
       database  of  frequently  misused,  bad  or  wordy diction.  It further&lt;br /&gt;
       checks for double words.  If no files are given, the document  is  read&lt;br /&gt;
       from  standard input.  Each found phrase is enclosed in [ ] (brackets).&lt;br /&gt;
       Suggestions and advice, if any, are printed headed by a right arrow -&amp;gt;.&lt;br /&gt;
       A  sentence is a sequence of words, that starts with a capitalised word&lt;br /&gt;
       and ends with a full stop, double colon, question mark or  exclaimation&lt;br /&gt;
       mark.  A single letter followed by a dot is considered an abbreviation,&lt;br /&gt;
       so it does not terminate a sentence.   Various  multi-letter  abbrevia-&lt;br /&gt;
       tions are recognized, they do not terminate a sentence as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 102:&lt;br /&gt;
&lt;br /&gt;
    Using a mail alias.&lt;br /&gt;
&lt;br /&gt;
       Suppose all root mail on your system to go to one root account root@main.com&lt;br /&gt;
&lt;br /&gt;
       In the following file:&lt;br /&gt;
&lt;br /&gt;
             /etc/aliases&lt;br /&gt;
&lt;br /&gt;
       Add this line&lt;br /&gt;
&lt;br /&gt;
             root:    root@main.com&lt;br /&gt;
&lt;br /&gt;
       Next, run newaliases [/usr/bin/newaliases] as follows:&lt;br /&gt;
&lt;br /&gt;
             $ newaliases&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Special note: It's possible to send mail to more than one address. Suppose you want&lt;br /&gt;
                     mail going to root@main.com above, plus you want it going to user donkey&lt;br /&gt;
                     on the local system.&lt;br /&gt;
&lt;br /&gt;
             root:  root@main.com donkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 103:&lt;br /&gt;
&lt;br /&gt;
    Chrony - this service is similiar to ntp. It keeps accurate time&lt;br /&gt;
            on your computer against a very accurate clock in across&lt;br /&gt;
            a network with various time delays.&lt;br /&gt;
&lt;br /&gt;
    Reference: http://go.to/chrony&lt;br /&gt;
&lt;br /&gt;
        In the file &amp;quot;/etc/chrony/chrony.conf&amp;quot; add/replace the following&lt;br /&gt;
&lt;br /&gt;
             server 146.186.218.60&lt;br /&gt;
             server 128.118.25.3&lt;br /&gt;
             server 128.2.129.21&lt;br /&gt;
&lt;br /&gt;
        Next start the chrony service&lt;br /&gt;
&lt;br /&gt;
           $ /etc/init.d/chrony restart&lt;br /&gt;
&lt;br /&gt;
     Next verify that this is working. It may take 20 or 30 minutes to update&lt;br /&gt;
     the clock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Shell command:&lt;br /&gt;
       # chronyc&lt;br /&gt;
       chronyc&amp;gt; sourcestats&lt;br /&gt;
       210 Number of sources = 3&lt;br /&gt;
       Name/IP Address            NP  NR  Span  Frequency   Freq Skew   Std Dev&lt;br /&gt;
       ========================================================================&lt;br /&gt;
       b50.cede.psu.edu            2   0    64       0.000    2000.000  4000ms&lt;br /&gt;
       otc2.psu.edu                2   0    66       0.000    2000.000  4000ms&lt;br /&gt;
       FS3.ECE.CMU.EDU             2   0    64       0.000    2000.000  4000ms&lt;br /&gt;
       chronyc&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    It is probably best to let chrony do its work. However, if you want to&lt;br /&gt;
    set both the hardware and software clock, the following will work:&lt;br /&gt;
&lt;br /&gt;
      Sets the hardware clock&lt;br /&gt;
        # hwclock --set --date=&amp;quot;12/10/04 10:18:05&amp;quot;&lt;br /&gt;
      Sync the hardware clock to software&lt;br /&gt;
        # hwclock --hctosys&lt;br /&gt;
&lt;br /&gt;
    Normally the system keep accurate time with the software clock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 104:&lt;br /&gt;
&lt;br /&gt;
    NFS mount&lt;br /&gt;
&lt;br /&gt;
     SERVER (192.168.1.182)&lt;br /&gt;
&lt;br /&gt;
       Make sure nfs is running on the server&lt;br /&gt;
 &lt;br /&gt;
           $ /etc/init.d/nfs restart&lt;br /&gt;
&lt;br /&gt;
       At the server the contents of /etc/exports for&lt;br /&gt;
       allowing 2 computers (192.168.1.171 and 192.168.1.71)&lt;br /&gt;
       to access the home directory of this server. Note that&lt;br /&gt;
       read write (rw) access is allowed.&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/exports&lt;br /&gt;
         /home   192.168.1.171(rw)&lt;br /&gt;
         /home   192.168.1.71(rw)&lt;br /&gt;
&lt;br /&gt;
       Or, if you have a lot of clients on 192.168.1.* then consider&lt;br /&gt;
       the following:&lt;br /&gt;
&lt;br /&gt;
          /home 192.168.1.0/255.255.252.0(rw)&lt;br /&gt;
&lt;br /&gt;
       Next, still at the server, run the exportfs command&lt;br /&gt;
&lt;br /&gt;
          $ exportfs -rv&lt;br /&gt;
&lt;br /&gt;
       IPTABLES (lokkit). If you're using fedora with default lokkit firewall&lt;br /&gt;
                then you can put the following under &amp;quot;Other ports&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                  Other ports nfs:tcp nfs:udp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       If the above does not work or you are not using lokkit&lt;br /&gt;
        IPTABLES (values in /etc/sysconfig/iptables on SERVER )&lt;br /&gt;
&lt;br /&gt;
        # NFS Need to accept fragmented packets and may not have header&lt;br /&gt;
        #             so you will not know where they are coming from&lt;br /&gt;
        -A INPUT -f -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -m tcp -s 192.168.1.171 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -s 192.168.1.171 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -m udp -s 192.168.1.171 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -s 192.168.1.171 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        &lt;br /&gt;
        -A INPUT -f -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -m tcp -s 192.168.1.71 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -s 192.168.1.71 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -m udp -s 192.168.1.71 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -s 192.168.1.71 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        (Reference: http://nfs.sourceforge.net/nfs-howto/server.html)&lt;br /&gt;
                  and&lt;br /&gt;
        (Reference: http://nfs.sourceforge.net/nfs-howto/security.html)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     CLIENT1 (192.168.1.171)&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /home2&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/fstab&lt;br /&gt;
         192.168.1.182:/home          /home2     nfs     rw 0 0&lt;br /&gt;
&lt;br /&gt;
          $ mount -a -t nfs&lt;br /&gt;
&lt;br /&gt;
        Or to do a one time mounting by hand&lt;br /&gt;
&lt;br /&gt;
          $ mount -t nfs 192.168.1.182:/home  /home2&lt;br /&gt;
&lt;br /&gt;
        Now /home2 on the client will be /home on the server&lt;br /&gt;
&lt;br /&gt;
        Reference:&lt;br /&gt;
          http://nfs.sourceforge.net/nfs-howto/index.html&lt;br /&gt;
&lt;br /&gt;
     MONITOR NFS:&lt;br /&gt;
&lt;br /&gt;
        To monitor the client:&lt;br /&gt;
&lt;br /&gt;
          $ nfsstat -c&lt;br /&gt;
&lt;br /&gt;
           Also note you can &amp;quot;cat /proc/net/rpc/nfs&amp;quot; as well.&lt;br /&gt;
&lt;br /&gt;
       To monitor the server (note the -s instead of the -c).&lt;br /&gt;
&lt;br /&gt;
         $ nfsstat -s&lt;br /&gt;
&lt;br /&gt;
           Also note you can &amp;quot;cat /proc/net/rpc/nfsd&amp;quot; as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       The following &amp;quot;cat&amp;quot; command is done on the NFS server, and shows which&lt;br /&gt;
       clients are mounting. This does not go with examples above. By the way,&lt;br /&gt;
       &amp;quot;root_squash&amp;quot; is the default, and means that root access on the clients is&lt;br /&gt;
       denied. So, how does the client root get access to these filesystems? You have&lt;br /&gt;
       to &amp;quot;su - &amp;lt;someuser&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
              $ cat /proc/fs/nfs/exports&lt;br /&gt;
              # Version 1.1&lt;br /&gt;
              # Path Client(Flags) # IPs&lt;br /&gt;
              /home   192.168.1.102(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   squeezel.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   192.168.1.106(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   livingroom.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   10.8.0.1(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   closet.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
&lt;br /&gt;
     (Reference: http://www.vanemery.com/Linux/NFSv4/NFSv4-no-rpcsec.html#automount )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 105:&lt;br /&gt;
&lt;br /&gt;
      Ports used for Microsoft products&lt;br /&gt;
               http://www.microsoft.com/canada/smallbiz/sgc/articles/ref_net_ports_ms_prod.mspx?pf=true&lt;br /&gt;
          Firewalling?&lt;br /&gt;
               http://www.microsoft.com/technet/prodtechnol/windowsserver2003/library/ServerHelp/428c1bbf-2ceb-4f76-a1ef-0219982eca10.mspx&lt;br /&gt;
&lt;br /&gt;
      To find out common port mappings, take a look at &amp;quot;/etc/services&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 106:&lt;br /&gt;
&lt;br /&gt;
      Man pages: If man pages are formatting incorrectly with PuTTY, try editing&lt;br /&gt;
      the &amp;quot;/etc/man.config&amp;quot; file with the following changes:&lt;br /&gt;
&lt;br /&gt;
           NROFF /usr/bin/groff -Tlatin1 -mandoc&lt;br /&gt;
           NEQN /usr/bin/geqn -Tlatin1&lt;br /&gt;
&lt;br /&gt;
         (Reference TIP 7 for using man)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 107:&lt;br /&gt;
&lt;br /&gt;
      Valgrind: check for memory leaks in your programs. (http://valgrind.org/)&lt;br /&gt;
&lt;br /&gt;
       This is how you can run it on the program &amp;quot;a.out&amp;quot; for valgrind version 2.2.0&lt;br /&gt;
&lt;br /&gt;
         $ valgrind --logfile=valgrind.output   --tool=memcheck ./a.out&lt;br /&gt;
&lt;br /&gt;
       This is how you write the logfile &amp;quot;--log-file&amp;quot; for valgrind-3.0.1&lt;br /&gt;
&lt;br /&gt;
         $ valgrind  --log-file=valgrind --leak-check=yes --tool=memcheck ./a.out&lt;br /&gt;
&lt;br /&gt;
       With C++ programs with gcc 3.4 and later that use STL, export GLIBCXX_FORCE_NEW &lt;br /&gt;
       only when testing to disable memory caching. Remember to enable for production&lt;br /&gt;
       as this will have a performance penalty. Reference  http://valgrind.org/docs/FAQ/ &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 108:&lt;br /&gt;
&lt;br /&gt;
      Runlevel Configuring.&lt;br /&gt;
&lt;br /&gt;
       These two programs, run as root give you a ncurses GUI to what will&lt;br /&gt;
       run on your system on boot.&lt;br /&gt;
&lt;br /&gt;
            # ntsysv&lt;br /&gt;
&lt;br /&gt;
            # chkconfig&lt;br /&gt;
&lt;br /&gt;
       Note, you can also set these manually. For example, normally you will&lt;br /&gt;
       have files in &amp;quot;/etc/init.d/&amp;quot; that will take parameters like &amp;quot;start&amp;quot;,&amp;quot;stop&amp;quot;&lt;br /&gt;
       &amp;quot;restart&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       Take a look at &amp;quot;/etc/init.d/mysql&amp;quot; this file will start and stop the&lt;br /&gt;
       mysql daemon. So, how does know which run levels, and the order it gets&lt;br /&gt;
       loaded in the run level to other programs? By the K&amp;lt;number&amp;gt; and S&amp;lt;number&amp;gt;&lt;br /&gt;
       values.&lt;br /&gt;
&lt;br /&gt;
            $ ls /etc/rc3.d/*mysql&lt;br /&gt;
&lt;br /&gt;
                /etc/rc3.d/K85mysql&lt;br /&gt;
                /etc/rc3.d/S85mysql&lt;br /&gt;
&lt;br /&gt;
       So here on my system the start value is 85. Looking in /etc/rc3.d, which is&lt;br /&gt;
       run level 3, any program with a lower number S84something will get loaded&lt;br /&gt;
       before mysql.&lt;br /&gt;
&lt;br /&gt;
       I manually set the run level as follows for mysql.&lt;br /&gt;
&lt;br /&gt;
            # cd /etc/rc3.d&lt;br /&gt;
            # ln -s ../init.d/mysql S85mysql&lt;br /&gt;
            # ln -s ../init.d/mysql K85mysql&lt;br /&gt;
&lt;br /&gt;
            # cd /etc/rc5.d&lt;br /&gt;
            # ln -s ../init.d/mysql S85mysql&lt;br /&gt;
            # ln -s ../init.d/mysql K85mysql&lt;br /&gt;
&lt;br /&gt;
       Note that I could have chose other numbers as well. &amp;quot;ntsysv&amp;quot; gives&lt;br /&gt;
       you a graphical interface.&lt;br /&gt;
&lt;br /&gt;
       This is a way of doing this with &amp;quot;chkconfig&amp;quot; at the command prompt.&lt;br /&gt;
&lt;br /&gt;
            # chkconfig --list mysqld&lt;br /&gt;
            mysqld          0:off   1:off   2:off   3:on    4:off   5:on    6:off&lt;br /&gt;
&lt;br /&gt;
       Above you can see it's on. Here's how we would have turned this on with chkconfig.&lt;br /&gt;
&lt;br /&gt;
            # chkconfig --level 35 mysqld on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 109:&lt;br /&gt;
&lt;br /&gt;
       File Alteration Monitor - Gamin a FAM replacement&lt;br /&gt;
        http://www.gnome.org/~veillard/gamin/&lt;br /&gt;
        http://www.gnome.org/~veillard/gamin/sources/&lt;br /&gt;
       ******  EXAMPLE NOT COMPLETE *****&lt;br /&gt;
&lt;br /&gt;
       Working with fam  - file alteration monitor.  Mail uses this to signify&lt;br /&gt;
           a change in a file's status.&lt;br /&gt;
&lt;br /&gt;
        Below is the sample C program ftest.c which can be compiled as&lt;br /&gt;
        follows:&lt;br /&gt;
&lt;br /&gt;
              $ gcc -o ftest ftest.c  -lfam&lt;br /&gt;
&lt;br /&gt;
        You will need to work with this as root&lt;br /&gt;
&lt;br /&gt;
              #  ./ftest &amp;lt;somefile absolute path&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Reference:&lt;br /&gt;
            http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?db=man&amp;amp;fname=/usr/share/catman/p_man/cat3x/fam.z&lt;br /&gt;
            http://www.devchannel.org/devtoolschannel/04/05/13/2146252.shtml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 110:&lt;br /&gt;
&lt;br /&gt;
       glibc - this is the main library used by C, and the following&lt;br /&gt;
        link below gives you examples on everything from sockets,math,&lt;br /&gt;
        date and time functions, user environment, and much more.&lt;br /&gt;
&lt;br /&gt;
         http://www.gnu.org/software/libc/manual/html_mono/libc.html&lt;br /&gt;
&lt;br /&gt;
       How do you know which version of glibc you are running?&lt;br /&gt;
&lt;br /&gt;
          #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
          #include &amp;lt;gnu/libc-version.h&amp;gt;&lt;br /&gt;
          int main (void)&lt;br /&gt;
           {&lt;br /&gt;
             puts (gnu_get_libc_version ());&lt;br /&gt;
             return 0;&lt;br /&gt;
           }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 111:&lt;br /&gt;
&lt;br /&gt;
       nslookup and dig - query Internet name servers interactively.&lt;br /&gt;
&lt;br /&gt;
         $ nslookup&lt;br /&gt;
         &amp;gt;chirico.org&lt;br /&gt;
         Server:        68.80.0.6&lt;br /&gt;
         Address:       68.80.0.6#53&lt;br /&gt;
&lt;br /&gt;
         Name: chirico.org&lt;br /&gt;
         Address: 66.35.250.210&lt;br /&gt;
         &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      The nslookup command will query the dns server is &amp;quot;/etc/resolve.conf&amp;quot;&lt;br /&gt;
      However, you can force a certain dns with &amp;quot;- server&amp;quot;.  For example the&lt;br /&gt;
      command below goes to the server named dilbert&lt;br /&gt;
&lt;br /&gt;
         $ nslookup - dilbert&lt;br /&gt;
         &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      dig:&lt;br /&gt;
&lt;br /&gt;
      dig gives you more information. You should probably use dig instead&lt;br /&gt;
      of nslookup.&lt;br /&gt;
&lt;br /&gt;
      Below I am forcing the lookup from DNS 68.80.0.6 of the name chirico.org, and&lt;br /&gt;
      note that the query time is return too.&lt;br /&gt;
&lt;br /&gt;
         $ dig @68.80.0.6  +qr chirico.org&lt;br /&gt;
&lt;br /&gt;
         ; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.2.1 &amp;lt;&amp;lt;&amp;gt;&amp;gt; @68.80.0.6 +qr chirico.org&lt;br /&gt;
         ;; global options:  printcmd&lt;br /&gt;
         ;; Sending:&lt;br /&gt;
         ;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 55908&lt;br /&gt;
         ;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0&lt;br /&gt;
        &lt;br /&gt;
         ;; QUESTION SECTION:&lt;br /&gt;
         ;chirico.org.                   IN      A&lt;br /&gt;
        &lt;br /&gt;
         ;; Got answer:&lt;br /&gt;
         ;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 55908&lt;br /&gt;
         ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
        &lt;br /&gt;
         ;; QUESTION SECTION:&lt;br /&gt;
         ;chirico.org.                   IN      A&lt;br /&gt;
        &lt;br /&gt;
         ;; ANSWER SECTION:&lt;br /&gt;
         chirico.org.            5538    IN      A       66.35.250.210&lt;br /&gt;
        &lt;br /&gt;
         ;; AUTHORITY SECTION:&lt;br /&gt;
         chirico.org.            30599   IN      NS      ns78.worldnic.com.&lt;br /&gt;
         chirico.org.            30599   IN      NS      ns77.worldnic.com.&lt;br /&gt;
        &lt;br /&gt;
         ;; ADDITIONAL SECTION:&lt;br /&gt;
         ns78.worldnic.com.      16022   IN      A       216.168.225.218&lt;br /&gt;
         ns77.worldnic.com.      7       IN      A       216.168.228.41&lt;br /&gt;
        &lt;br /&gt;
         ;; Query time: 155 msec&lt;br /&gt;
         ;; SERVER: 68.80.0.6#53(68.80.0.6)&lt;br /&gt;
         ;; WHEN: Thu Dec 23 07:48:23 2004&lt;br /&gt;
         ;; MSG SIZE  rcvd: 127&lt;br /&gt;
&lt;br /&gt;
      So what if you wanted to know what name the IP address 66.35.250.210&lt;br /&gt;
      resolves to, when using dns 68.80.0.12.&lt;br /&gt;
&lt;br /&gt;
          $ dig @68.80.0.12 -x 66.35.250.210&lt;br /&gt;
          ...&lt;br /&gt;
          ;; ANSWER SECTION:&lt;br /&gt;
          210.250.35.66.in-addr.arpa. 3600 IN   CNAME   210.0/24.250.35.66.in-addr.arpa.&lt;br /&gt;
          210.0/24.250.35.66.in-addr.arpa. 3600 IN PTR  vhost.sourceforge.net.&lt;br /&gt;
&lt;br /&gt;
      Above you can see it resolved to &amp;quot;vhost.sourceforge.net&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      Reference ( http://www.tldp.org/HOWTO/DNS-HOWTO-5.html )&lt;br /&gt;
        Also see TIP 223.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 112:&lt;br /&gt;
&lt;br /&gt;
       Using GNU Autotools - so you can produce the familiar &amp;quot;./configure&amp;quot;  &amp;quot;make&amp;quot;  and &amp;quot;make install&amp;quot;&lt;br /&gt;
                             commands. There is also a &amp;quot;make dist&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                The program sqlite3api.cc and the rest of this code can be found at&lt;br /&gt;
                 http://prdownloads.sourceforge.net/cpearls/autotools.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         A &amp;quot;Makefile.am&amp;quot; is required:&lt;br /&gt;
&lt;br /&gt;
            bin_PROGRAMS = sprog&lt;br /&gt;
            sprog_SOURCES = sqlite3api.cc&lt;br /&gt;
            sprog_LDADD = @INCLUDES@ @SQLIBOBJS@&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         In addition, a &amp;quot;configure.in&amp;quot; file is required. Note, AC_CHECK_LIB will&lt;br /&gt;
         check the &amp;quot;libsqlite3.so&amp;quot; file for the &amp;quot;sqlite3_open&amp;quot; file. Note that&lt;br /&gt;
         &amp;quot;sqlite3&amp;quot;, is a shortcut for &amp;quot;libsqlite3&amp;quot; by convention. If this file&lt;br /&gt;
         is not found, AC_CHECK_FILE looks for &amp;quot;/usr/local/lib/libsqlite3.a&amp;quot;. If&lt;br /&gt;
         this is found, then, &amp;quot;-lsqlite3&amp;quot; is added to the LIBS environment variable.&lt;br /&gt;
         Also, &amp;quot;-I/usr/local/include&amp;quot; and &amp;quot;-L/usr/local/lib&amp;quot; will be added on the&lt;br /&gt;
         command line. This is common when some one does not have the library in&lt;br /&gt;
         the path.  (See TIP 49)&lt;br /&gt;
&lt;br /&gt;
            dnl Process this file with autoconf to produce a configure script.&lt;br /&gt;
            AC_INIT(sqlite3api.cc)&lt;br /&gt;
            AM_INIT_AUTOMAKE(sqliteprog, 1.0)&lt;br /&gt;
            AC_PROG_CXX&lt;br /&gt;
            CXXFLAGS='-Wall -W -O2 -s -pipe'&lt;br /&gt;
            AC_CHECK_LIB(sqlite3,sqlite3_open,[],found=no)&lt;br /&gt;
             if test &amp;quot;$found&amp;quot; = &amp;quot;no&amp;quot;; then&lt;br /&gt;
               AC_CHECK_FILE(/usr/local/lib/libsqlite3.a, found=yes)&lt;br /&gt;
               if test &amp;quot;$found&amp;quot; = &amp;quot;yes&amp;quot;; then&lt;br /&gt;
                 LIBS=&amp;quot;$LIBS -lsqlite3&amp;quot;&lt;br /&gt;
                 INCLUDES=&amp;quot;$INCLUDES -I/usr/local/include&amp;quot;&lt;br /&gt;
                 EXTRALIB='-L/usr/local/lib'&lt;br /&gt;
                else&lt;br /&gt;
                 echo &amp;quot;Are you SURE sqlite3 is installed?&amp;quot;&lt;br /&gt;
               fi&lt;br /&gt;
             fi&lt;br /&gt;
            SQLIBOBJS='-Wl,-R/usr/local/lib'&lt;br /&gt;
            AC_SUBST(INCLUDES)&lt;br /&gt;
            AC_SUBST(SQLIBOBJS)&lt;br /&gt;
            AC_SUBST(EXTRALIB)&lt;br /&gt;
            AC_OUTPUT(Makefile)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         To build the configure file, just run the following:&lt;br /&gt;
&lt;br /&gt;
             $ aclocal&lt;br /&gt;
             $ autoconf&lt;br /&gt;
             $ touch NEWS README AUTHORS ChangeLog&lt;br /&gt;
             $ automake --add-missing&lt;br /&gt;
&lt;br /&gt;
         Now if you want to make a tar.gz file &amp;quot;sqliteprog-1.0.tar.gz&amp;quot;, then&lt;br /&gt;
         all you have to run is the following:&lt;br /&gt;
&lt;br /&gt;
             $ make dist&lt;br /&gt;
&lt;br /&gt;
         Note: did you ever want to save all the output from a ./configure? Well, it&lt;br /&gt;
               is automatically saved in the &amp;quot;config.log&amp;quot; file. In fact, this file may&lt;br /&gt;
               contain a lot more than what you saw on the screen.&lt;br /&gt;
&lt;br /&gt;
               Also, you may need to rerun ./configure. But before you do, delete&lt;br /&gt;
               the &amp;quot;config.cache&amp;quot; file to get a clean build.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 113:&lt;br /&gt;
&lt;br /&gt;
       EMACS - common emacs commands.&lt;br /&gt;
&lt;br /&gt;
         M is the ESC&lt;br /&gt;
         C or c is the Ctl&lt;br /&gt;
&lt;br /&gt;
        Shell - when working in a shell. &amp;quot;M-x rename-uniquely&amp;quot; is good for split screen editing.&lt;br /&gt;
&lt;br /&gt;
          M-x rename-uniquely   Use this for multiple shells (renames buffer so it's not the same shell)&lt;br /&gt;
          C-c C-z               Send job in background (when working in a shell)&lt;br /&gt;
          C-c C-o               commit-kill-output (gets rid of a lot of shell output)&lt;br /&gt;
          C-c C-r               reposition at beginning of output&lt;br /&gt;
          C-c C-e               reposition at end of output&lt;br /&gt;
          M-x send-invisible    Hide passwords - use this before typing a password&lt;br /&gt;
&lt;br /&gt;
         Note: if the shell prompt does not show up correctly, then, you may want to creat a &amp;quot;.emacs_bash&amp;quot;&lt;br /&gt;
               file with the following contents:&lt;br /&gt;
&lt;br /&gt;
                          PS1=&amp;quot;emacs:\W \$ &amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Directories  (C-x d) give you a directory listing. You know all those annoying &amp;quot;~&amp;quot; and &amp;quot;#&amp;quot;&lt;br /&gt;
                     file that you get? You can easily delete these when in &amp;quot;dired&amp;quot; mode by hitting&lt;br /&gt;
                     &amp;quot;~&amp;quot;, then  &amp;quot;d&amp;quot; to flag it for delete. Then, hit &amp;quot;x&amp;quot; to and confirm deletion.&lt;br /&gt;
&lt;br /&gt;
                     These are other command that work on highlighted files in &amp;quot;dired&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
                          R   rename&lt;br /&gt;
                          v   view&lt;br /&gt;
                          Z   compress the file&lt;br /&gt;
                          +   create directory&lt;br /&gt;
&lt;br /&gt;
        Other common commands:&lt;br /&gt;
&lt;br /&gt;
          c-x l          list the line you are on, and how many lines in the document.&lt;br /&gt;
                         You will get something like: Page has 4881 lines (4440 + 442),&lt;br /&gt;
                         which means you are on the 4440 line.&lt;br /&gt;
&lt;br /&gt;
          c-x rm bookmark make&lt;br /&gt;
          c-x rb bookmark bounce&lt;br /&gt;
        &lt;br /&gt;
          c-x rb notes&lt;br /&gt;
          c-x rb emacs&lt;br /&gt;
        &lt;br /&gt;
          c-x / &amp;lt;r&amp;gt; (save position in register &amp;lt;r&amp;gt;)&lt;br /&gt;
          c-x j &amp;lt;r&amp;gt; (jump to position in register &amp;lt;r&amp;gt;)&lt;br /&gt;
          c-x r SPC 1 (mark current point in register 1)&lt;br /&gt;
          c-x r j 1 (jump to marked point in register 1)&lt;br /&gt;
          c-x r t &amp;lt;string&amp;gt;  (insert string into register)&lt;br /&gt;
        &lt;br /&gt;
          c-x r s 1 (save marked region in register 1)&lt;br /&gt;
          c-x r i 1 (insert marked region)&lt;br /&gt;
        &lt;br /&gt;
          c-x c-o (delete all blank lines, except one)&lt;br /&gt;
        &lt;br /&gt;
          c-x z (repeat the last command ... stop with an a)&lt;br /&gt;
          c-x zz (repeat the last command twice)&lt;br /&gt;
&lt;br /&gt;
          rectangle&lt;br /&gt;
          ---------&lt;br /&gt;
          C-SPC&lt;br /&gt;
          goto the next region&lt;br /&gt;
          C-x&lt;br /&gt;
          C-x&lt;br /&gt;
          then, C-x r r &amp;quot;name of register&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
          to insert the register&lt;br /&gt;
          C-x r i &amp;quot;name of register&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
          macros:&lt;br /&gt;
          -------&lt;br /&gt;
          c-x (    start macro&lt;br /&gt;
          c-x )    end macro&lt;br /&gt;
          c-x e    execute macro&lt;br /&gt;
        &lt;br /&gt;
          mail:&lt;br /&gt;
          -----&lt;br /&gt;
          c-x m   mail&lt;br /&gt;
          c-c c-s send&lt;br /&gt;
        &lt;br /&gt;
          C-x C-e&lt;br /&gt;
          (insert &amp;quot;\n\nExtra Line of text&amp;quot;)&lt;br /&gt;
        &lt;br /&gt;
          ;; chirico functions in .emacs&lt;br /&gt;
          ;; This creates an html template&lt;br /&gt;
          (defun my-html ()&lt;br /&gt;
          (interactive)&lt;br /&gt;
          (insert &amp;quot;&amp;lt;html&amp;gt;&lt;br /&gt;
          &amp;lt;head&amp;gt;&lt;br /&gt;
          &amp;lt;META HTTP-EQUIV=\&amp;quot;Pragma\&amp;quot; CONTENT=\&amp;quot;no-cache\&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;META HTTP-EQUIV=\&amp;quot;Expires\&amp;quot; CONTENT=\&amp;quot;-1\&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;/head&amp;gt;&lt;br /&gt;
          &amp;lt;body bgcolor=\&amp;quot;#ffffff\&amp;quot;&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
          &amp;lt;/body&amp;gt;&lt;br /&gt;
          &amp;lt;/html&amp;gt;&amp;quot;)&lt;br /&gt;
          )&lt;br /&gt;
&lt;br /&gt;
     Backspace issues when using &amp;quot;emacs -nw&amp;quot;? They putting the following in your &amp;quot;~/.emacs&amp;quot; file&lt;br /&gt;
&lt;br /&gt;
             (global-set-key &amp;quot;\C-d&amp;quot; 'backward-delete-char)&lt;br /&gt;
             (global-set-key &amp;quot;\C-h&amp;quot; 'backward-delete-char)&lt;br /&gt;
             (global-set-key (kbd &amp;quot;DEL&amp;quot;) 'delete-char)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 114:&lt;br /&gt;
&lt;br /&gt;
        ncftpget - an intelligent ftp client (http://www.ncftp.com/). Also&lt;br /&gt;
                   check your fedora or debian install. This package allows&lt;br /&gt;
                   you to easily download packages from ftp sites.&lt;br /&gt;
&lt;br /&gt;
          This is an example of connect to an ftp site, with a subdirectory, and&lt;br /&gt;
          downloading all in one command.&lt;br /&gt;
&lt;br /&gt;
           $ ncftpget ftp://ftp.gnu.org/pub/gnu/gcc/gcc-3.2.3/gcc-3.2.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
          Of if you want to get the fedora core 3 installs&lt;br /&gt;
&lt;br /&gt;
           $ ncftpget ftp://ftp.linux.ncsu.edu/pub/fedora/linux/core/3/i386/iso/FC3*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 115:&lt;br /&gt;
&lt;br /&gt;
        expr - evaluate expressions. You can use this on the command line&lt;br /&gt;
&lt;br /&gt;
           $ expr 6 + 4&lt;br /&gt;
           10&lt;br /&gt;
&lt;br /&gt;
         Note the spaces. Without spaces, you get the following:&lt;br /&gt;
&lt;br /&gt;
           $ expr 6+4&lt;br /&gt;
           6+4&lt;br /&gt;
&lt;br /&gt;
         If you're using &amp;quot;*&amp;quot;, you'll need a &amp;quot;\&amp;quot; before it&lt;br /&gt;
&lt;br /&gt;
           $ expr 10 \* 10&lt;br /&gt;
           100&lt;br /&gt;
&lt;br /&gt;
         This also works for variables&lt;br /&gt;
&lt;br /&gt;
           $ var1=34&lt;br /&gt;
           $ expr $var1 + 3&lt;br /&gt;
           37&lt;br /&gt;
&lt;br /&gt;
         or&lt;br /&gt;
&lt;br /&gt;
           $ var1=2&lt;br /&gt;
           $ var1=`expr $var1 \* 2`&lt;br /&gt;
           $ echo $var1&lt;br /&gt;
           4&lt;br /&gt;
&lt;br /&gt;
         see (TIP 25) you can get the cosine(.23)&lt;br /&gt;
&lt;br /&gt;
           $ var1=`echo &amp;quot;c(.23)&amp;quot;|bc -l`&lt;br /&gt;
           $ echo $var1&lt;br /&gt;
           .97366639500537483696&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         You can also do substrings:&lt;br /&gt;
&lt;br /&gt;
           $ expr substr &amp;quot;BigBear&amp;quot; 4 4&lt;br /&gt;
           Bear&lt;br /&gt;
&lt;br /&gt;
         And length of strings&lt;br /&gt;
&lt;br /&gt;
           $ mstr=&amp;quot;12345&amp;quot;&lt;br /&gt;
           $ expr length $mstr&lt;br /&gt;
           5&lt;br /&gt;
&lt;br /&gt;
         Regular expressions&lt;br /&gt;
&lt;br /&gt;
           $ expr &amp;quot;a3&amp;quot; : [a-z][1-9]&lt;br /&gt;
           2&lt;br /&gt;
&lt;br /&gt;
         Or you can get a bit fancy&lt;br /&gt;
&lt;br /&gt;
           $ myexpr=&amp;quot;[a-z][1-9]&amp;quot;&lt;br /&gt;
           $ echo $myexpr&lt;br /&gt;
           [a-z][1-9]&lt;br /&gt;
&lt;br /&gt;
           $ expr &amp;quot;a3&amp;quot; : $myexpr&lt;br /&gt;
           2&lt;br /&gt;
&lt;br /&gt;
         This may not be the best way to find out if it is Friday, but&lt;br /&gt;
         it seems to work. It's more of an exercise in xargs.&lt;br /&gt;
&lt;br /&gt;
           $ date&lt;br /&gt;
           Fri Dec 31 16:44:47 EST 2004&lt;br /&gt;
           $ date|xargs -i expr {} : &amp;quot;[Fri]&amp;quot;&lt;br /&gt;
           1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 116:&lt;br /&gt;
&lt;br /&gt;
        eval&lt;br /&gt;
&lt;br /&gt;
           $ mypipe=&amp;quot;|&amp;quot;&lt;br /&gt;
           $ eval ls $mypipe wc&lt;br /&gt;
           6       6     129&lt;br /&gt;
&lt;br /&gt;
        Did you catch that? The above statement is the same as&lt;br /&gt;
&lt;br /&gt;
           $ ls | wc&lt;br /&gt;
&lt;br /&gt;
        Where &amp;quot;|&amp;quot; is put into the variable $mypipe&lt;br /&gt;
&lt;br /&gt;
        (also see TIP 118)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 117:&lt;br /&gt;
&lt;br /&gt;
        lxr, glimpse, patchset - tools for reading the kernel source&lt;br /&gt;
&lt;br /&gt;
          This example puts some of the files in /home/src since my home&lt;br /&gt;
          partition is the largest. Plus, you do not want to over write&lt;br /&gt;
          the source in /usr/src/ If you want to put your files elsewhere&lt;br /&gt;
          just substitute /home/src for your desired directory.&lt;br /&gt;
&lt;br /&gt;
         patchset -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ export SRCDIR=/home/src&lt;br /&gt;
            $ cd $SRCDIR&lt;br /&gt;
            $ wget http://www.csn.ul.ie/~mel/projects/patchset/patchset-0.5.tar.gz&lt;br /&gt;
            $ export PATH=$PATH:$SRCDIR/patchset-0.5/bin&lt;br /&gt;
&lt;br /&gt;
          Now edit &amp;quot;/home/src/patchset-0.5/etc/patchset.conf&amp;quot; and set WWW_USER to&lt;br /&gt;
          whatever your website runs as&lt;br /&gt;
&lt;br /&gt;
                  export WWW_USER=nobody&lt;br /&gt;
&lt;br /&gt;
          Getting kernel source. The last step builds and asks a lot of questions. Enter&lt;br /&gt;
          yes to things that interest you, since this is what you will see in the source&lt;br /&gt;
          code. It is not going to build for booting. The &amp;quot;downlaod -p&amp;quot; is for downloading&lt;br /&gt;
          a patch.&lt;br /&gt;
&lt;br /&gt;
            $ download 2.6.10&lt;br /&gt;
            $ createset 2.6.10&lt;br /&gt;
            $ make-kernel -b 2.6.10&lt;br /&gt;
&lt;br /&gt;
        glimpse -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ mkdir -p /home/src/glimpse&lt;br /&gt;
            $ cd /home/src/glimpse&lt;br /&gt;
            $ wget http://webglimpse.net/trial/glimpse-latest.tar.gz&lt;br /&gt;
            $ tar -xzf glimpse-latest.tar.gz&lt;br /&gt;
            $ cd glimpse-4.18.0&lt;br /&gt;
            $ ./configure; make&lt;br /&gt;
            $ make install&lt;br /&gt;
&lt;br /&gt;
        lxr -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ make -p /home/src/lxr&lt;br /&gt;
            $ cd /home/src/lxr&lt;br /&gt;
            $ wget http://heanet.dl.sourceforge.net/sourceforge/lxr/lxr-0.3.1.tar.gz&lt;br /&gt;
            $ cd lxr-0.3&lt;br /&gt;
&lt;br /&gt;
          Edit &amp;quot;Makefile&amp;quot; and set PERLBIN to &amp;quot;/usr/bin/perl&amp;quot; or the where perl is&lt;br /&gt;
          on your system. Also set INSTALLPREFIX to &amp;quot;/var/www/lxr&amp;quot;.  Then, as root&lt;br /&gt;
          do the following:&lt;br /&gt;
&lt;br /&gt;
            $ make install&lt;br /&gt;
&lt;br /&gt;
         Apache changes&lt;br /&gt;
&lt;br /&gt;
          Next edit the apache httpd.conf. On my system it is&lt;br /&gt;
          &amp;quot;/usr/local/apache2/conf/httpd.conf&amp;quot;, but if you did a fedora install&lt;br /&gt;
          I think this file is located at &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             Alias  /lxr/ &amp;quot;/var/www/lxr/&amp;quot;&lt;br /&gt;
             &amp;lt;Directory &amp;quot;/var/www/lxr/&amp;quot;&amp;gt;&lt;br /&gt;
               Options ExecCGI Indexes Includes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride all&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
&lt;br /&gt;
              &amp;lt;Files ~ (search|source|ident|diff|find)&amp;gt;&lt;br /&gt;
                    SetHandler cgi-script&lt;br /&gt;
              &amp;lt;/Files&amp;gt;&lt;br /&gt;
             &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          lxr - continued &amp;quot;/var/www/lxr/http/lxr.conf&amp;quot; changes.  The following contains&lt;br /&gt;
                my lxr.conf with changes made to almost every variable. Make sure you use&lt;br /&gt;
                your website in place of 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
                 # Configuration file.&lt;br /&gt;
                &lt;br /&gt;
                 # Define typed variable &amp;quot;v&amp;quot;, read valueset from file.&lt;br /&gt;
                 variable: v, Version, [/var/www/lxr/source/versions], [/var/www/lxr/source/defversion]&lt;br /&gt;
                &lt;br /&gt;
                 # Define typed variable &amp;quot;a&amp;quot;.  First value is default.&lt;br /&gt;
                 variable: a, Architecture, (i386, alpha, m68k, mips, ppc, sparc, sparc64)&lt;br /&gt;
                &lt;br /&gt;
                 # Define the base url for the LXR files.&lt;br /&gt;
                 baseurl: http://192.168.1.71/lxr/http/&lt;br /&gt;
                &lt;br /&gt;
                 # These are the templates for the HTML heading, directory listing and&lt;br /&gt;
                 # footer, respectively.&lt;br /&gt;
                 htmlhead: /var/www/lxr/http/template-head&lt;br /&gt;
                 htmltail: /var/www/lxr/http/template-tail&lt;br /&gt;
                 htmldir:  /var/www/lxr/http/template-dir&lt;br /&gt;
                &lt;br /&gt;
                 # The source is here.&lt;br /&gt;
                 sourceroot: /var/www/lxr/source/$v/&lt;br /&gt;
                 srcrootname: Linux&lt;br /&gt;
                &lt;br /&gt;
                 # &amp;quot;#include &amp;lt;foo.h&amp;gt;&amp;quot; is mapped to this directory (in the LXR source&lt;br /&gt;
                 # tree)&lt;br /&gt;
                 incprefix: /include&lt;br /&gt;
                &lt;br /&gt;
                 # The database files go here.&lt;br /&gt;
                 dbdir: /var/www/lxr/source/$v/&lt;br /&gt;
                &lt;br /&gt;
                 # Glimpse can be found here.&lt;br /&gt;
                 glimpsebin: /usr/local/bin/glimpse&lt;br /&gt;
                &lt;br /&gt;
                 # The power of regexps.  This is pretty Linux-specific, but quite&lt;br /&gt;
                 # useful.  Tinker with it and see what it does.  (How's that for&lt;br /&gt;
                 # documentation?)&lt;br /&gt;
                 map: /include/asm[^\/]*/ /include/asm-$a/&lt;br /&gt;
                 map: /arch/[^\/]+/ /arch/$a/&lt;br /&gt;
&lt;br /&gt;
         Now you should be ready to run &amp;quot;make-lxr&amp;quot;. Make sure the path is setup to patchset,&lt;br /&gt;
         which is repeated here. The last step take awhile.&lt;br /&gt;
&lt;br /&gt;
            $ export SRCDIR=/home/src&lt;br /&gt;
            $ cd $SRCDIR&lt;br /&gt;
            $ export PATH=$PATH:$SRCDIR/patchset-0.5/bin&lt;br /&gt;
&lt;br /&gt;
            $  make-lxr 2.6.10&lt;br /&gt;
&lt;br /&gt;
         Now you need to index the source. Below the ./glimpse_* file will be put in&lt;br /&gt;
         root. Checkout the -H option if you do not want them here on a temporary&lt;br /&gt;
         bases of if you run out of room.&lt;br /&gt;
&lt;br /&gt;
            $ glimpseindex -o -t -w 5000 /var/www/lxr/source/2.6.10 &amp;gt;&amp;amp; .glimpse_out&lt;br /&gt;
&lt;br /&gt;
         Since the above put the files under /root/.glimpse_* they should be moved&lt;br /&gt;
&lt;br /&gt;
            $ mv /root/.glimps_* /var/www/lxr/source/2.6.10/.&lt;br /&gt;
            $ chown -R nobody.nobody ./.glimpse_*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 118:&lt;br /&gt;
&lt;br /&gt;
        exec - you can change standard output and input without starting a new&lt;br /&gt;
               process.&lt;br /&gt;
&lt;br /&gt;
          The exec redirect the output from ls and date to a file. Nothing&lt;br /&gt;
          is show on the terminal until &amp;quot;exec &amp;gt; /dev/tty&amp;quot; is performed&lt;br /&gt;
&lt;br /&gt;
            $ exec &amp;gt; mfile&lt;br /&gt;
            $ ls&lt;br /&gt;
            $ date&lt;br /&gt;
            $ exec &amp;gt; /dev/tty&lt;br /&gt;
&lt;br /&gt;
          This is an example of assigning file descriptor 3 to file &amp;quot;output3&amp;quot; for&lt;br /&gt;
          output, then, redirecting &amp;quot;ls&amp;quot; to this descriptor. Finally, file descriptor&lt;br /&gt;
          3 is used for input, and the contents are read into the cat command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
            $ exec 3&amp;gt;output3&lt;br /&gt;
            $ ls  &amp;gt;&amp;amp; 3&lt;br /&gt;
            $ exec 3&amp;lt;output3&lt;br /&gt;
            $ cat &amp;lt;&amp;amp;3&lt;br /&gt;
            ChangeLog&lt;br /&gt;
            CVS&lt;br /&gt;
            How_to_Linux_and_Open_Source.txt&lt;br /&gt;
            How_to_Linux_and_Open_Source.txt.~1.193.~&lt;br /&gt;
            mfile&lt;br /&gt;
            mfile2&lt;br /&gt;
            mfile3&lt;br /&gt;
            mftp&lt;br /&gt;
            output3&lt;br /&gt;
&lt;br /&gt;
        Could you redirect the output to 3 files and stderr?&lt;br /&gt;
&lt;br /&gt;
            $ exec 3&amp;gt;output3&lt;br /&gt;
            $ exec 4&amp;gt;output4&lt;br /&gt;
            $ exec 5&amp;gt;output5&lt;br /&gt;
&lt;br /&gt;
            $ ls &amp;gt;&amp;amp; 3 &amp;gt;&amp;amp; 4 &amp;gt;&amp;amp; 5 &amp;gt;&amp;amp; 2   // Nope, can't do this.&lt;br /&gt;
            output3  output4  output5&lt;br /&gt;
&lt;br /&gt;
         Instead, you should do the following:&lt;br /&gt;
&lt;br /&gt;
            $ ls | tee output3 | tee output4 |tee output5&lt;br /&gt;
&lt;br /&gt;
         Closing the &amp;quot;output&amp;quot; file descriptor&lt;br /&gt;
&lt;br /&gt;
            $ &amp;gt;&amp;amp;3-&lt;br /&gt;
&lt;br /&gt;
         Closing the &amp;quot;input&amp;quot; file descriptor&lt;br /&gt;
&lt;br /&gt;
            $ 3&amp;lt;&amp;amp;-&lt;br /&gt;
&lt;br /&gt;
         See what is still open on 0-10&lt;br /&gt;
&lt;br /&gt;
            $ lsof -a -p $$ -d 0-10&lt;br /&gt;
&lt;br /&gt;
         Recursion - the following counts to 5, then, quits.&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
            sleep 1&lt;br /&gt;
            declare -x n&lt;br /&gt;
            let n=${n:=0}+1&lt;br /&gt;
            [ $n -le 5 ] &amp;amp;&amp;amp; echo &amp;quot;$n&amp;quot; &amp;amp;&amp;amp;  exec $0&lt;br /&gt;
&lt;br /&gt;
         There are some real-life applications for this technique, as follows:&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
            declare -x N&lt;br /&gt;
            declare -x n&lt;br /&gt;
            N=${N:=$(od -vAn -N1 -tu4 &amp;lt; /dev/urandom)}&lt;br /&gt;
            let n=${n:=0}+1&lt;br /&gt;
            [ $(($n%2)) -eq 0 ] &amp;amp;&amp;amp; echo &amp;quot;She Loves Me!&amp;quot; || echo &amp;quot;She Loves Me NOT!&amp;quot;&lt;br /&gt;
            [ $n -lt $N ] &amp;amp;&amp;amp;  exec $0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 119:&lt;br /&gt;
&lt;br /&gt;
        runlevel - need to know the current runlevel?&lt;br /&gt;
&lt;br /&gt;
           $ who -r&lt;br /&gt;
           run-level 3  Dec 31 19:02                   last=S&lt;br /&gt;
&lt;br /&gt;
        Need to know the architecture?&lt;br /&gt;
&lt;br /&gt;
          $ arch&lt;br /&gt;
          i686&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 120:&lt;br /&gt;
&lt;br /&gt;
        at - executes commands at a specified time.&lt;br /&gt;
&lt;br /&gt;
         A few examples here. The 1970 program will run&lt;br /&gt;
         next Auguest 2 even though the year 1970 has long past.&lt;br /&gt;
&lt;br /&gt;
          $ at 6:30am Jan 12 &amp;lt; program&lt;br /&gt;
          $ at noon tomorrow &amp;lt; program&lt;br /&gt;
          $ at 1970 pm August 2 &amp;lt; program&lt;br /&gt;
&lt;br /&gt;
        This is an interactive way to use the command:&lt;br /&gt;
&lt;br /&gt;
          $ at now + 6 minutes&lt;br /&gt;
          warning: commands will be executed using (in order) a) $SHELL b) login shell c) /bin/sh&lt;br /&gt;
          at&amp;gt; ls&lt;br /&gt;
          at&amp;gt; date &amp;gt; /tmp/5min&lt;br /&gt;
          at&amp;gt; ^D&lt;br /&gt;
          job 3 at 2005-01-01 08:50&lt;br /&gt;
&lt;br /&gt;
        What jobs are in the queue?&lt;br /&gt;
&lt;br /&gt;
          $ atq&lt;br /&gt;
&lt;br /&gt;
        or&lt;br /&gt;
&lt;br /&gt;
          $ at -l&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 121:&lt;br /&gt;
&lt;br /&gt;
        Creating a Manpage&lt;br /&gt;
&lt;br /&gt;
         As root you can copy the following to /usr/local/man/man1/soup.1 which will&lt;br /&gt;
         give you a manpage for soup.&lt;br /&gt;
&lt;br /&gt;
              .\&amp;quot; Manpage for souptonuts.&lt;br /&gt;
              .\&amp;quot; Contact mchirico@users.sourceforge.com to correct errors or omissions.&lt;br /&gt;
              .TH man 1 &amp;quot;04 January 2005&amp;quot; &amp;quot;1.0&amp;quot; &amp;quot;souptonuts man page&amp;quot;&lt;br /&gt;
              .SH NAME&lt;br /&gt;
              soup \- man page for souptonuts&lt;br /&gt;
              .SH SYNOPSIS&lt;br /&gt;
              soup&lt;br /&gt;
              .SH DESCRIPTION&lt;br /&gt;
              souptonuts is a collection of linux and open&lt;br /&gt;
              source tips.&lt;br /&gt;
              off for golf.&lt;br /&gt;
              .SH OPTIONS&lt;br /&gt;
              The souptonuts does not take any options.&lt;br /&gt;
              .SH SEE ALSO&lt;br /&gt;
              doughnut(1), golf(8)&lt;br /&gt;
              .SH BUGS&lt;br /&gt;
              No known bugs at this time.&lt;br /&gt;
              .SH AUTHOR&lt;br /&gt;
              Mike Chirico (mchirico@comcast.net mchirico@users.sourceforge.net)&lt;br /&gt;
&lt;br /&gt;
         So, to view this man page&lt;br /&gt;
&lt;br /&gt;
            $ man soup&lt;br /&gt;
&lt;br /&gt;
         It's also possible to compress&lt;br /&gt;
&lt;br /&gt;
            $ gzip /usr/local/man/man1/soup.1&lt;br /&gt;
&lt;br /&gt;
         For plenty of examples look at the other man pages. Also the following&lt;br /&gt;
         is helpful. The last one is a tutorial &amp;quot;man 7 mdoc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            $ man manpath&lt;br /&gt;
            $ man groff&lt;br /&gt;
            $ man 7 mdoc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 122:&lt;br /&gt;
&lt;br /&gt;
        dmesg - print out boot messages, or what is in the kernel ring buffer.&lt;br /&gt;
&lt;br /&gt;
          If you missed the messages on boot-up, you can use dmesg to print them.&lt;br /&gt;
&lt;br /&gt;
            $ dmesg &amp;gt; boot.msg&lt;br /&gt;
&lt;br /&gt;
          Or to print, then, clear the ring&lt;br /&gt;
&lt;br /&gt;
            # dmesg -c &amp;gt; boot.msg&lt;br /&gt;
&lt;br /&gt;
          (also see TIP 20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 123:&lt;br /&gt;
&lt;br /&gt;
        gnus - emacs email nntp news reader (comcast as example with NO TLS or SSL)&lt;br /&gt;
&lt;br /&gt;
          First check that you can connect to the news group:&lt;br /&gt;
&lt;br /&gt;
                 $ telnet newsgroups.comcast.net 119&lt;br /&gt;
                 Trying 216.196.97.136...&lt;br /&gt;
                 Connected to newsgroups.comcast.net.&lt;br /&gt;
                 Escape character is '^]'.&lt;br /&gt;
                 200 News.GigaNews.Com&lt;br /&gt;
&lt;br /&gt;
          If you want to check for TLS or SSL see (TIP 54).&lt;br /&gt;
&lt;br /&gt;
          Here is a very simple configuration example without encryption. It&lt;br /&gt;
          appears that comcast does not support ssl or TLS.&lt;br /&gt;
&lt;br /&gt;
          In the &amp;quot;~/.emacs&amp;quot; file you would add the following to get comcast&lt;br /&gt;
          news groups&lt;br /&gt;
&lt;br /&gt;
             (setq gnus-select-method '(nntp &amp;quot;newsgroups.comcast.net&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
          Then, create an &amp;quot;~/.authinfo&amp;quot; file with the following settings using&lt;br /&gt;
          you own username and password.&lt;br /&gt;
&lt;br /&gt;
             machine newsgroups.comcast.net login borkey@comcast.net  password borkeypass0rd&lt;br /&gt;
&lt;br /&gt;
          Next create a &amp;quot;~/.newsrc&amp;quot; with your groups&lt;br /&gt;
&lt;br /&gt;
             news.announce.newusers:&lt;br /&gt;
             comp.lang.c++.moderated! 1-500&lt;br /&gt;
             comp.unix.programmer! 1-500&lt;br /&gt;
             comp.unix.shell! 1-500&lt;br /&gt;
             gnu.emacs.gnus! 1-500&lt;br /&gt;
&lt;br /&gt;
          Finally, create a &amp;quot;~/.gnus&amp;quot; with the following email settings for you&lt;br /&gt;
&lt;br /&gt;
             (setq user-mail-address &amp;quot;mchirico@comcast.net&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
             (defun my-message-mode-setup ()&lt;br /&gt;
               (setq fill-column 72)&lt;br /&gt;
               (turn-on-auto-fill))&lt;br /&gt;
               (add-hook 'message-mode-hook 'my-message-mode-setup)&lt;br /&gt;
&lt;br /&gt;
          To get into gnus&lt;br /&gt;
&lt;br /&gt;
              E-x gnus&lt;br /&gt;
&lt;br /&gt;
          The following are common gnus commands&lt;br /&gt;
&lt;br /&gt;
                RET  view the article under the cursor&lt;br /&gt;
&lt;br /&gt;
                A A (shift-a, shift a): List all newsgroups known&lt;br /&gt;
                                        to the server.&lt;br /&gt;
&lt;br /&gt;
                l (lower-case L)      : List only  subscribed groups&lt;br /&gt;
                                        with unread articles.&lt;br /&gt;
&lt;br /&gt;
                L                     : List all newsgroups in .newsrc file.&lt;br /&gt;
&lt;br /&gt;
                g                     : See if new articles have arrived.&lt;br /&gt;
&lt;br /&gt;
            Some commands for reading&lt;br /&gt;
&lt;br /&gt;
                n  next unread article&lt;br /&gt;
&lt;br /&gt;
                p  previous article&lt;br /&gt;
&lt;br /&gt;
                SPC  scroll down  moves to next unread&lt;br /&gt;
                     when at the bottom of the article&lt;br /&gt;
&lt;br /&gt;
                del  scroll up&lt;br /&gt;
&lt;br /&gt;
                F  follow-up to group on the article you are&lt;br /&gt;
                   reading now.&lt;br /&gt;
&lt;br /&gt;
                f  follow-up to group without citing the article&lt;br /&gt;
&lt;br /&gt;
                R  reply by mail and cite the article&lt;br /&gt;
&lt;br /&gt;
                r  reply by mail without citing the article&lt;br /&gt;
&lt;br /&gt;
                m  new mail&lt;br /&gt;
&lt;br /&gt;
                a  new posting&lt;br /&gt;
&lt;br /&gt;
                c  Catchup&lt;br /&gt;
&lt;br /&gt;
                C-u / t  Show only young headers&lt;br /&gt;
                         / t without C-u limits the summary&lt;br /&gt;
                         to old headers&lt;br /&gt;
&lt;br /&gt;
                T T  toggle threading&lt;br /&gt;
&lt;br /&gt;
                C-u g  Display raw article&lt;br /&gt;
                       hit g to return to normal view&lt;br /&gt;
&lt;br /&gt;
                t  Show all headers  it's a toggle&lt;br /&gt;
&lt;br /&gt;
                W w  Wordwrap the current article&lt;br /&gt;
&lt;br /&gt;
                W r  Decode ROT13  a toggle&lt;br /&gt;
&lt;br /&gt;
                ^  fetch parent of article&lt;br /&gt;
&lt;br /&gt;
                L  create a scorefile-entry based&lt;br /&gt;
                   on the current article (low score)&lt;br /&gt;
                   ? gives you information what each char means&lt;br /&gt;
&lt;br /&gt;
                I  like L but high score&lt;br /&gt;
&lt;br /&gt;
          Commands to send email&lt;br /&gt;
&lt;br /&gt;
            C-c C-c  send message&lt;br /&gt;
&lt;br /&gt;
            C-c C-d  save message as draft&lt;br /&gt;
&lt;br /&gt;
            C-c C-k  kill message&lt;br /&gt;
&lt;br /&gt;
            C-c C-m f  attach file&lt;br /&gt;
&lt;br /&gt;
            M-q  reformat paragraph&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 124:&lt;br /&gt;
&lt;br /&gt;
        Sending Email from telnet&lt;br /&gt;
&lt;br /&gt;
           Note, if you are on the computer you can sometime use the local loopback.&lt;br /&gt;
           In fact, sometimes you can only use the local loop back 127.0.0.1 in&lt;br /&gt;
           place of &amp;quot;bozo.company.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            1     [mchirico@soup Notes]$ telnet bozo.company.com 25&lt;br /&gt;
            2     Trying 192.168.0.204...&lt;br /&gt;
            3     Connected to bozo.company.com.&lt;br /&gt;
            4     Escape character is '^]'.&lt;br /&gt;
            5     220 bozo.company.com ESMTP Postfix (Postfix-20010228-pl03) (Mandrake Linux)&lt;br /&gt;
            6     HELO fakedomain.com&lt;br /&gt;
            7     HELO fakedomain.com         // server echo&lt;br /&gt;
            8     250 bozo.company.com&lt;br /&gt;
            9     MAIL FROM: test@fakedomain.com&lt;br /&gt;
           10     MAIL FROM: test@fakedomain.com   // server echo&lt;br /&gt;
           11     250 Ok&lt;br /&gt;
           12     RCPT TO: mchirico@someother.com&lt;br /&gt;
           13     RCPT TO: mchirico@someother.com   // server echo&lt;br /&gt;
           14     250 Ok&lt;br /&gt;
           15     DATA&lt;br /&gt;
           16     DATA    // echo&lt;br /&gt;
           17     354 Enter mail, end with &amp;quot;.&amp;quot; on a line by itself&lt;br /&gt;
           18     This is a test message&lt;br /&gt;
           19     This is a test message&lt;br /&gt;
           20     to send&lt;br /&gt;
           21     to send&lt;br /&gt;
           22     .&lt;br /&gt;
           23     250 2.0.0 j0B0uH3L018469 Message accepted for delivery&lt;br /&gt;
&lt;br /&gt;
          Above on line 6 you can type in any domain name. Line 7 is an echo. All&lt;br /&gt;
          echos are listed in the comment field.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 125:&lt;br /&gt;
&lt;br /&gt;
          IP forwarding, IP Masquerade&lt;br /&gt;
&lt;br /&gt;
             # echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
             # ipchains -F forward&lt;br /&gt;
             # ipchains -P forward DENY&lt;br /&gt;
             # ipchains -A forward -s 192.168.0.0/24 -j MASQ&lt;br /&gt;
             # ipchains -A forward -i eth1 -j MASQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          This assumes that your internal network is 192.168.0.0 on eth1, and the&lt;br /&gt;
          internet is connected to eth0.&lt;br /&gt;
&lt;br /&gt;
          (Also See TIP 182)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 126:&lt;br /&gt;
&lt;br /&gt;
         Setting KDE as the default desktop manager&lt;br /&gt;
&lt;br /&gt;
               Edit &amp;quot;/etc/sysconfig/desktop&amp;quot; to include the two lines:&lt;br /&gt;
&lt;br /&gt;
                 DESKTOP=&amp;quot;KDE&amp;quot;&lt;br /&gt;
                 DISPLAYMANAGER=&amp;quot;KDE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 127:&lt;br /&gt;
&lt;br /&gt;
        Have a file and you do not know whay type it is (tar, gz, ASCII, binary) ?&lt;br /&gt;
        Use the file command.  Below it is used on the file &amp;quot;mftp&amp;quot;&lt;br /&gt;
&lt;br /&gt;
               $ file mftp&lt;br /&gt;
               mftp: Bourne-Again shell script text executable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 128:&lt;br /&gt;
&lt;br /&gt;
        Software RAID: Two good references&lt;br /&gt;
&lt;br /&gt;
          http://www.tldp.org/HOWTO/Software-RAID-HOWTO-1.html&lt;br /&gt;
          http://lists.us.dell.com/pipermail/linux-poweredge/2003-July/014331.html&lt;br /&gt;
&lt;br /&gt;
        Note, you must setup grub for each RAID 1 device. Suppose you have&lt;br /&gt;
        2 SCSI drives (sda and sdb). By default grub is setup on sda; but, you&lt;br /&gt;
        need to enable it for sdb (/dev/hdb for ide) as follows:&lt;br /&gt;
&lt;br /&gt;
           grub&amp;gt;device (hd0) /dev/sdb&lt;br /&gt;
           grub&amp;gt;root (hd0,0)&lt;br /&gt;
           grub&amp;gt;setup (hd0)&lt;br /&gt;
&lt;br /&gt;
           Checking if &amp;quot;/boot/grub/stage1&amp;quot; exists... no&lt;br /&gt;
           Checking if &amp;quot;/grub/stage1&amp;quot; exists... yes&lt;br /&gt;
           Checking if &amp;quot;/grub/stage2&amp;quot; exists... yes&lt;br /&gt;
           Checking if &amp;quot;/grub/e2fs_stage1_5&amp;quot; exists.. yes&lt;br /&gt;
           Running &amp;quot;embed /grub/e2fs_stage1_5 (hd0)&amp;quot;... 16 sectors are embedded.&lt;br /&gt;
          succeeded&lt;br /&gt;
           Running &amp;quot;install /grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/grub/stage2 /grub/grub&lt;br /&gt;
         .conf&amp;quot;... succeeded.&lt;br /&gt;
         Done.&lt;br /&gt;
&lt;br /&gt;
          grub&amp;gt;&lt;br /&gt;
          grub&amp;gt;quit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Checking to see if everything is working:&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
        Checking the drives&lt;br /&gt;
&lt;br /&gt;
          $ sfdisk -d /dev/sdb&lt;br /&gt;
          $ sfdisk -d /dev/sda&lt;br /&gt;
&lt;br /&gt;
          $ fdisk -l /dev/sda  &amp;quot;This will give general information&amp;quot;&lt;br /&gt;
          $ fdisk -l           &amp;quot;General information for all drives&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Adding raid (assume you want to add the first drive &amp;quot;sda1&amp;quot;, or if it is the second&lt;br /&gt;
                    drive then substitute &amp;quot;sda2&amp;quot; below )&lt;br /&gt;
&lt;br /&gt;
          $ raidhotadd /dev/md0 /dev/sda1&lt;br /&gt;
          $ raidhotadd /dev/md1 /dev/sda2&lt;br /&gt;
          $ raidhotadd /dev/md2 /dev/sda3&lt;br /&gt;
&lt;br /&gt;
        This is an example of an cat /proc/mdstat that is working. Note that&lt;br /&gt;
        there is a listing for both sda1[0] and sdb1[1]&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
                Personalities : [raid1]&lt;br /&gt;
                read_ahead 1024 sectors&lt;br /&gt;
                Event: 12&lt;br /&gt;
                md0 : active raid1 sda1[0] sdb1[1]&lt;br /&gt;
                      104320 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md1 : active raid1 sda2[0] sdb2[1]&lt;br /&gt;
                      1044160 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md2 : active raid1 sda3[0] sdb3[1]&lt;br /&gt;
                      34411136 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        Compare that to this where md2 is missing sdb3&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
                Personalities : [raid1]&lt;br /&gt;
                read_ahead 1024 sectors&lt;br /&gt;
                Event: 9&lt;br /&gt;
                md0 : active raid1 sda1[0] sdb1[1]&lt;br /&gt;
                      104320 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md1 : active raid1 sda2[0] sdb2[1]&lt;br /&gt;
                      1044160 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md2 : active raid1 sdb3[1]        &amp;lt;---- HERE&lt;br /&gt;
                      34411136 blocks [2/1] [_U]&lt;br /&gt;
&lt;br /&gt;
                unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        If you are rebuilding an array, you can watch it by doing the following:&lt;br /&gt;
&lt;br /&gt;
           $ watch -n1 cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
        Need to know the raid setup?&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/raidtab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 129:&lt;br /&gt;
&lt;br /&gt;
        Resetting Redhat Linux Passwords using GRUB&lt;br /&gt;
&lt;br /&gt;
           1. Press 'e'&lt;br /&gt;
           2. Press 'e' again&lt;br /&gt;
           3. Append 'single' to the kernel version listing&lt;br /&gt;
&lt;br /&gt;
          See&lt;br /&gt;
             http://linuxgazette.net/107/tomar.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 130:&lt;br /&gt;
&lt;br /&gt;
        mtr - matt's traceroute. This is an advanced traceroute that keeps&lt;br /&gt;
              [http://www.bitwizard.nl/mtr/]&lt;br /&gt;
                  $ mtr www.yahoo.com&lt;br /&gt;
&lt;br /&gt;
                                              Matt's traceroute  [v0.52]&lt;br /&gt;
                     third-fl-71.localdomain                            Thu Jan 20 11:05:57 2005&lt;br /&gt;
                     Keys:  D - Display mode    R - Restart statistics    Q - Quit&lt;br /&gt;
                                                            Packets               Pings&lt;br /&gt;
                     Hostname                            %Loss  Rcv  Snt  Last Best  Avg  Worst&lt;br /&gt;
                      1. 192.168.1.1                        0%    3    3     0    0    0      1&lt;br /&gt;
                      2. ???&lt;br /&gt;
                      3. fe-2-6-rr01.willogrove5.pa.pa01    0%    3    3     8    7    7      8&lt;br /&gt;
                      4. srp-8-1-ar01.willowgrove1.pa.pa    0%    2    2     8    8    8      8&lt;br /&gt;
                      5. pos7-3-cr01.torresdale.pa.core.    0%    2    2     8    8    8      8&lt;br /&gt;
                      6. 12.119.53.53                       0%    2    2    12   12   12     13&lt;br /&gt;
                      7. tbr1-p012401.phlpa.ip.att.net      0%    2    2    12   12   13     13&lt;br /&gt;
                      8. tbr1-cl8.n54ny.ip.att.net          0%    2    2    13   13   13     13&lt;br /&gt;
                      9. ggr2-p310.n54ny.ip.att.net         0%    2    2    12   12   13     14&lt;br /&gt;
                     10. so-1-0-0.gar4.NewYork1.Level3.n    0%    2    2    14   14   37     61&lt;br /&gt;
                     11. ae-1-54.bbr2.NewYork1.Level3.ne    0%    2    2    13   12   13     13&lt;br /&gt;
                     12. ge-0-3-0.bbr2.Washington1.Level    0%    2    2    19   19   19     19&lt;br /&gt;
                     13. ge-1-1-51.car1.Washington1.Leve    0%    2    2    18   18   19     20&lt;br /&gt;
                     14. 4.79.228.6                         0%    2    2    21   19   20     21&lt;br /&gt;
                     15. UNKNOWN-216-109-120-201.yahoo.c    0%    2    2    21   20   20     21&lt;br /&gt;
                     16. w2.rc.vip.dcn.yahoo.com            0%    2    2    23   21   22     23&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 131:&lt;br /&gt;
&lt;br /&gt;
        chfn - change finger information&lt;br /&gt;
&lt;br /&gt;
            $ chfn&lt;br /&gt;
&lt;br /&gt;
          Next you are asked for a password and user information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 132:&lt;br /&gt;
&lt;br /&gt;
        chsh - change login shell&lt;br /&gt;
&lt;br /&gt;
          First, you may want to get a listing of all the possible&lt;br /&gt;
          shells.&lt;br /&gt;
&lt;br /&gt;
             $ chsh -l&lt;br /&gt;
&lt;br /&gt;
               /bin/sh&lt;br /&gt;
               /bin/bash&lt;br /&gt;
               /sbin/nologin&lt;br /&gt;
               /bin/ash&lt;br /&gt;
               /bin/bsh&lt;br /&gt;
               /bin/ksh&lt;br /&gt;
               /usr/bin/ksh&lt;br /&gt;
               /usr/bin/pdksh&lt;br /&gt;
               /bin/tcsh&lt;br /&gt;
               /bin/csh&lt;br /&gt;
               /bin/zsh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 133:&lt;br /&gt;
&lt;br /&gt;
        bash - working with binary, hex and base 3.&lt;br /&gt;
&lt;br /&gt;
         For the variable must be declare as an integer. Then&lt;br /&gt;
         specify the  &amp;lt;base&amp;gt;#&amp;lt;value&amp;gt;. The example below is 22 in&lt;br /&gt;
         base 3.&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n&lt;br /&gt;
              $ n=3#22&lt;br /&gt;
              $ echo $n&lt;br /&gt;
                8&lt;br /&gt;
&lt;br /&gt;
           Base 16 (hex)&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n2&lt;br /&gt;
              $ n2=16#a&lt;br /&gt;
              $ echo $n2&lt;br /&gt;
                10&lt;br /&gt;
&lt;br /&gt;
           Base 8 (octal)&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n3&lt;br /&gt;
              $ n3=8#11&lt;br /&gt;
              $ echo $n3&lt;br /&gt;
                9   Note 8+1=9&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 134:&lt;br /&gt;
&lt;br /&gt;
        monitoring IP traffic. Try iptraf http://iptraf.seul.org/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 135:&lt;br /&gt;
&lt;br /&gt;
        enscript - convert text files to PostScript&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 136:&lt;br /&gt;
&lt;br /&gt;
        dd and tar - blocking factor. How to determine the blocking factor, block size&lt;br /&gt;
                   so that tar and dd can work together.&lt;br /&gt;
&lt;br /&gt;
        Step 1: Create a large file on local disk, in a directory &amp;quot;1&amp;quot; that will eventually&lt;br /&gt;
                be written to tape. This will be created with dd as follows:&lt;br /&gt;
&lt;br /&gt;
                $ mkdir 1&lt;br /&gt;
                $ dd if=/dev/zero of=disk-image count=40960&lt;br /&gt;
                  40960+0 records in&lt;br /&gt;
                  40960+0 records out&lt;br /&gt;
&lt;br /&gt;
                $ cd ..&lt;br /&gt;
&lt;br /&gt;
        Step 2: tar the directory and contents to tape. First rewind the tape. These examples&lt;br /&gt;
                use /dev/nst0 as the location of the tape. Make sure to substitute your values&lt;br /&gt;
                if needed.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ tar --label=&amp;quot;Test 1&amp;quot; --create --blocking-factor=128 --file=/dev/nst0 1&lt;br /&gt;
&lt;br /&gt;
        Step 3: Read data from the tape using a block size of 128k. If you get an I/O error, which&lt;br /&gt;
                could happend if you used a different blocking factor above, then, you may need&lt;br /&gt;
                to increase the bs to 256, or 512 etc. as needed.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=/dev/nst0 bs=128k of=testblocksz count=1&lt;br /&gt;
                 0+1 records in&lt;br /&gt;
                 0+1 records out&lt;br /&gt;
&lt;br /&gt;
                $ ls -l testblocksz&lt;br /&gt;
                 -rw-r--r--    1 root     root        65536 Feb  9 10:41 testblocksz&lt;br /&gt;
&lt;br /&gt;
                $ ls -lh testblocksz&lt;br /&gt;
                 -rw-r--r--    1 root     root          64k Feb  9 10:41 testblocksz&lt;br /&gt;
&lt;br /&gt;
               Note above that the size 65536 is equal to 64k. That &amp;quot;h&amp;quot; switch in &amp;quot;ls&amp;quot; is for&lt;br /&gt;
               human readable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 4: tar uses a multiplier of 512*blocking-factor to get block size. Again&lt;br /&gt;
&lt;br /&gt;
                 512 * blocking-factor = block size used in dd command.&lt;br /&gt;
&lt;br /&gt;
              Putting in the values, we see that&lt;br /&gt;
&lt;br /&gt;
                 512 * 128 = 65536&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 5: So what does this tell you? You can now use these numbers to &amp;quot;dd&amp;quot; files&lt;br /&gt;
              to tape. But, first tar will be used to create the file locally.&lt;br /&gt;
&lt;br /&gt;
                $ tar --label=&amp;quot;Test 1&amp;quot; --create --blocking-factor=128 --file=test.tar 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 6: Send this to tape with the dd command. Remember 64k is equal to 65536.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=test.tar bs=64k of=/dev/nst0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 7: Now test that it can be read with tar command using blocking-factor=128.&lt;br /&gt;
             Note the &amp;quot;t&amp;quot; command in tar is for tell. It will not write data.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ tar -tvf /dev/nst0 --blocking-factor=128&lt;br /&gt;
                 V--------- 0/0               0 2005-02-09 10:38:20 Test 1--Volume Header--&lt;br /&gt;
                 drwxr-xr-x root/root         0 2005-02-09 10:34:10 1/&lt;br /&gt;
                 -rw-r--r-- root/root  20971520 2005-02-09 10:34:11 1/disk-image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 8: Reading tape data with dd. Most of the time a high &amp;quot;ibs&amp;quot; input block size&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=/dev/nst0 of=outfromdd.tar ibs=64k&lt;br /&gt;
                 321+0 records in&lt;br /&gt;
                 41088+0 records out&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 9: Verify that outfromdd.tar can be read by tar with blocking-factor=128&lt;br /&gt;
&lt;br /&gt;
                $ tar -tvf outfromdd.tar --blocking-factor=128&lt;br /&gt;
                 V--------- 0/0               0 2005-02-09 10:38:20 Test 1--Volume Header--&lt;br /&gt;
                 drwxr-xr-x root/root         0 2005-02-09 10:34:10 1/&lt;br /&gt;
                 -rw-r--r-- root/root  20971520 2005-02-09 10:34:11 1/disk-image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       PULLING FILES:  The dd command can be used to pull files.&lt;br /&gt;
&lt;br /&gt;
              ssh target_address dd if=remotefile | dd of=localfile&lt;br /&gt;
&lt;br /&gt;
           Or, a specific example of getting a file from a computer called hamlet.&lt;br /&gt;
&lt;br /&gt;
              $ ssh root@hamlet  dd if=/home/cvs/test | dd of=/home/storage/test&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        GOING BACKWARD AND FORWARD ON TAPE:&lt;br /&gt;
&lt;br /&gt;
             Go to end of data&lt;br /&gt;
              $ mt -f /dev/nst0  eod&lt;br /&gt;
&lt;br /&gt;
             Previous record&lt;br /&gt;
              $ mt -f /dev/nst0  bsfm 1&lt;br /&gt;
&lt;br /&gt;
             Forward record&lt;br /&gt;
              $ mt -f /dev/nst0  fsf 1&lt;br /&gt;
&lt;br /&gt;
             Rewind&lt;br /&gt;
              $ mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
             Tell&lt;br /&gt;
              $ mt -f /dev/nst0 tell&lt;br /&gt;
&lt;br /&gt;
         (Reference TIP 151 - for how to get around firewalls)&lt;br /&gt;
&lt;br /&gt;
         Below is a script that I use to backup computers via ssh. The&lt;br /&gt;
         tape drive is on &amp;quot;nis&amp;quot; and the extra space is on &amp;quot;hamlet&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                #!/bin/bash&lt;br /&gt;
                # Program to backup server remotely&lt;br /&gt;
                # Assume remote server is nis, you are on squeezel&lt;br /&gt;
                #&lt;br /&gt;
                # Recover from tape&lt;br /&gt;
                #&lt;br /&gt;
                #   dd if=/dev/nst0 of=test.tar.gz bs=64k&lt;br /&gt;
                #&lt;br /&gt;
                filename=&amp;quot;support1.$(date &amp;quot;+%m%d%y%H%M&amp;quot;).tar.gz&amp;quot;&lt;br /&gt;
                DIRTOBACKUP=/var/www&lt;br /&gt;
                #tar cvzf - $DIRTOBACKUP | ssh  root@nis  '(mt -f /dev/nst0 rewind; dd of=/dev/nst0 bs=64k )'&lt;br /&gt;
                tar cvzf - $DIRTOBACKUP | ssh  support1@hamlet &amp;quot;dd of=/home/support1/backups/${filename} &amp;quot;&lt;br /&gt;
&lt;br /&gt;
         Another example program, below, pushes the last &amp;quot;.tar.gz&amp;quot; file to tape:&lt;br /&gt;
&lt;br /&gt;
                #!/bin/bash&lt;br /&gt;
                # Program to push files to tape&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                # Notes on recovering from tape&lt;br /&gt;
                #&lt;br /&gt;
                #   dd if=/dev/nst0 of=test.tar.gz ibs=64k&lt;br /&gt;
                #    or&lt;br /&gt;
                #  $ ssh root@tapeserver &amp;quot;mt -f /dev/nst0 rewind&amp;quot;&lt;br /&gt;
                #  $ ssh root@tapeserver &amp;quot;dd if=/dev/nst0 ibs=64k&amp;quot;|dd of=cvs1.tar.gz&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                # First rewind tape&lt;br /&gt;
                ssh root@tapeserver 'mt -f /dev/nst0 rewind'&lt;br /&gt;
                #&lt;br /&gt;
                # Grab only the last file&lt;br /&gt;
                file=$(find /home/cvs  -iname 'cvs*.tar.gz'|sort|tail -n 1)&lt;br /&gt;
                dd if=${file}|ssh root@tapeserver 'dd of=/dev/nst0 bs=64k'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 137:&lt;br /&gt;
&lt;br /&gt;
        Apache - redirecting pages. All changes are in httpd.conf&lt;br /&gt;
&lt;br /&gt;
               RedirectMatch (.*)\.gif$ http://www.anotherserver.com$1.jpg&lt;br /&gt;
&lt;br /&gt;
               Redirect /service http://foo2.bar.com/service&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 138:&lt;br /&gt;
&lt;br /&gt;
        samba mounts via ssh - mounting a samba share through an ssh tunnel, going&lt;br /&gt;
               through an intermediate computer, that accepts ssh. We'll call this&lt;br /&gt;
               intermediate computer middle [65.219.4.23], and we want to get to&lt;br /&gt;
               destination [192.168.0.81]. The user will be mchirico.&lt;br /&gt;
&lt;br /&gt;
          STEP 1:&lt;br /&gt;
&lt;br /&gt;
               $ mkdir -p /samba/share&lt;br /&gt;
&lt;br /&gt;
          STEP 2:&lt;br /&gt;
&lt;br /&gt;
            This has to be done as root, since we are using a lower port.&lt;br /&gt;
&lt;br /&gt;
               $ ssh -N -L 139:192.168.0.81:139 mchirico@65.219.4.23&lt;br /&gt;
&lt;br /&gt;
          STEP 3:&lt;br /&gt;
&lt;br /&gt;
              umount /samba/sales&lt;br /&gt;
              /bin/mount -t smbfs -o  username=donkey,workgroup=donkeydomain,&lt;br /&gt;
                      password=passw0rk1,port=139,dmask=770,fmask=660,&lt;br /&gt;
                      netbiosname=homecpu //localhost/share /samba/share&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 139:&lt;br /&gt;
&lt;br /&gt;
        Music on Fedora Core -- How to play music on http://magnatune.com with &amp;quot;xmms&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           The following command will show the sound driver:&lt;br /&gt;
&lt;br /&gt;
              $ lspci|grep -i audio&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          STEP 1:&lt;br /&gt;
&lt;br /&gt;
                Unmute amixer with the following command:&lt;br /&gt;
&lt;br /&gt;
              $ amixer set Master 100% unmute&lt;br /&gt;
              $ amixer set PCM 100%  unmute&lt;br /&gt;
&lt;br /&gt;
                Note you can also get a graphical interface with &amp;quot;alsamixer&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              $ alsamixer&lt;br /&gt;
&lt;br /&gt;
                 h,F1   -- for help&lt;br /&gt;
                 Esc    -- exit&lt;br /&gt;
                 Tab    -- move to selections&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          STEP 2:&lt;br /&gt;
&lt;br /&gt;
                Test a sound file &amp;quot;*.au&amp;quot; with aplay. To quickly find files on your system use&lt;br /&gt;
                the &amp;quot;locate *.au&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
                  $ aplay /usr/lib/python2.3/test/audiotest.au&lt;br /&gt;
&lt;br /&gt;
          STEP 3:&lt;br /&gt;
&lt;br /&gt;
                Install &amp;quot;xmms-mp3-1.2.10-9.2.1.fc3.rf.i386.rpm&amp;quot; which does not come with Fedora because&lt;br /&gt;
                of GPL license restrictions.  The latest version of this package can be found&lt;br /&gt;
                at the following url:&lt;br /&gt;
&lt;br /&gt;
                  http://rpmseek.com/rpm-pl/xmms-mp3.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                  $ rpm -ivh xmms-mp3-1.2.10-9.2.1.fc3.rf.i386.rpm&lt;br /&gt;
&lt;br /&gt;
          STEP 4:&lt;br /&gt;
&lt;br /&gt;
                Go to magnatun &amp;quot;http://magnatune.com/&amp;quot;, select genre and make sure xmms&lt;br /&gt;
                is the default player.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 140:&lt;br /&gt;
&lt;br /&gt;
        Routing -- getting access to a network 1 hop away. You are currently on the 192 network&lt;br /&gt;
                   and you want access to the 172.21.0.0 network that has a computer straddling&lt;br /&gt;
                   the two, with /proc/sys/net/ipv4/ip_forward set to 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               $ route add -net 172.21.0.0 netmask 255.255.255.0 gw 192.168.0.204&lt;br /&gt;
&lt;br /&gt;
         To undo:&lt;br /&gt;
&lt;br /&gt;
               $ route del -net 172.21.0.0 netmask 255.255.255.0 gw 192.168.0.204&lt;br /&gt;
&lt;br /&gt;
         Now you can ping 172.21.0.21.&lt;br /&gt;
&lt;br /&gt;
         Does not work?&lt;br /&gt;
&lt;br /&gt;
         Go on to 192.168.0.204 and execute the following commands:&lt;br /&gt;
&lt;br /&gt;
               $ echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
               $ cat /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
               1&lt;br /&gt;
&lt;br /&gt;
         To Look at the the gateway, execute the following command.&lt;br /&gt;
&lt;br /&gt;
               $ netstat -r&lt;br /&gt;
&lt;br /&gt;
         References: &lt;br /&gt;
&lt;br /&gt;
               http://lartc.org/lartc.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 141:&lt;br /&gt;
&lt;br /&gt;
        RAM disk -- creating a filesystem in RAM.&lt;br /&gt;
&lt;br /&gt;
               $ mkfs -t ext3 -q /dev/ram1 4096&lt;br /&gt;
               $ mkdir -p /fsram&lt;br /&gt;
               $ mount /dev/ram1 /fsram -o defaults,rw&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 142:&lt;br /&gt;
&lt;br /&gt;
        Create a Live Linux CDROM  using  BusyBox and OpenSSH.&lt;br /&gt;
&lt;br /&gt;
            These steps are rather long. A complete tutorial is given at&lt;br /&gt;
            the following link:&lt;br /&gt;
             http://prdownloads.sourceforge.net/souptonuts/instructions_boot_system.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 143:&lt;br /&gt;
&lt;br /&gt;
      SystemImager (http://www.systemimager.org/) SystemImager is software that automates Linux installs,&lt;br /&gt;
                       software distribution, and production deployment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 144:&lt;br /&gt;
&lt;br /&gt;
      Mounted a filesystem in rescue mode, yet, you cannot read and write?  Remount.&lt;br /&gt;
&lt;br /&gt;
             $ mount -o remount /&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 145:&lt;br /&gt;
&lt;br /&gt;
      Nmap commands to check for Microsoft VPN connection.&lt;br /&gt;
&lt;br /&gt;
         $ nmap -sO -p 47 vpn1.someserver.com&lt;br /&gt;
         $ nmap -sS -p T:1723 vpn1.someserver.com&lt;br /&gt;
&lt;br /&gt;
      By the way, with nmap you can specify multiple ports. Below&lt;br /&gt;
      is an example of multiple ports; but, use the commands above&lt;br /&gt;
      for Microsoft VPN services.&lt;br /&gt;
&lt;br /&gt;
         $ nmap -sS -p T:1723-3000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 146:&lt;br /&gt;
&lt;br /&gt;
      Perl and ssh - monitoring systems. The output from ssh can be parsed. Below is&lt;br /&gt;
      a simple procedure to just to read the ssh ouput into perl.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #&lt;br /&gt;
          $pid = open $readme, &amp;quot;ssh root\@hamlet df -lh|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
          while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
           print $_&lt;br /&gt;
          }&lt;br /&gt;
          close $readme&lt;br /&gt;
&lt;br /&gt;
      But note, you probably want to do something more complex. Below is a more robust&lt;br /&gt;
      example that bypassed all the fortune, heading junk that you may encounter when&lt;br /&gt;
      logging in.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #&lt;br /&gt;
          $pid = open $readme, &amp;quot;ssh root\@hamlet df -lh 2&amp;gt;/dev/null|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
          while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
           print $_&lt;br /&gt;
          }&lt;br /&gt;
          close $readme&lt;br /&gt;
&lt;br /&gt;
      NO! you CANNOT do bidirectional communication with the open statement. Note the &amp;quot;|&amp;quot; before&lt;br /&gt;
      and after below, which cannot be done.&lt;br /&gt;
&lt;br /&gt;
          # Cannot do this!&lt;br /&gt;
          $pid = open $readme, &amp;quot;|ssh root\@hamlet df -lh 2&amp;gt;/dev/null|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
      Below is a simple Perl example working with arrays:&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          @ArrayOfArray = (&lt;br /&gt;
                   [ &amp;quot;ant&amp;quot;, &amp;quot;bee&amp;quot; ],&lt;br /&gt;
                   [ &amp;quot;mouse&amp;quot;, &amp;quot;mole&amp;quot;, &amp;quot;rat&amp;quot; ],&lt;br /&gt;
                   [ &amp;quot;duck&amp;quot;, &amp;quot;goose&amp;quot;, &amp;quot;flamingo&amp;quot; ],&lt;br /&gt;
                   [  &amp;quot;rose&amp;quot;,&amp;quot;carnation&amp;quot;,&amp;quot;sunflower&amp;quot;],&lt;br /&gt;
                  );&lt;br /&gt;
&lt;br /&gt;
          for $i ( 0 .. $#ArrayOfArray ) {&lt;br /&gt;
              for $j ( 0 .. $#{$ArrayOfArray[$i]} ) {&lt;br /&gt;
                  print &amp;quot;Element $i $j is $ArrayOfArray[$i][$j]\n&amp;quot;;&lt;br /&gt;
              }&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          # Or this is another way to list elements&lt;br /&gt;
          foreach( @ArrayOfArray ) {&lt;br /&gt;
             foreach $i (0..$#$_) {&lt;br /&gt;
                print &amp;quot;$_-&amp;gt;[$i] &amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
             print &amp;quot;\n&amp;quot;;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Below is an example of working with Hash of Arrays:&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #  ./program &amp;lt; /etc/passwd&lt;br /&gt;
          while(&amp;lt;&amp;gt;){&lt;br /&gt;
              next unless s/^(.*?):\s*//;&lt;br /&gt;
              $HoA{$1} = [ split(/:/) ];&lt;br /&gt;
          }&lt;br /&gt;
          for $i (keys %HoA ) {&lt;br /&gt;
              print &amp;quot;$i: @{ $HoA{$i} } \n&amp;quot;;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
      Example of regular expression. This is my most used regular expression - I like&lt;br /&gt;
      this sample. See the &amp;quot;www.unix.org.ua&amp;quot; link at the end of this tip.&lt;br /&gt;
&lt;br /&gt;
          &amp;quot;hot cross buns&amp;quot; =~ /cross/;&lt;br /&gt;
          print &amp;quot;Matched: &amp;lt;$`&amp;gt; $&amp;amp; &amp;lt;$'&amp;gt;\n&amp;quot;;    # Matched: &amp;lt;hot &amp;gt; cross &amp;lt; buns&amp;gt;&lt;br /&gt;
          print &amp;quot;Left:    &amp;lt;$`&amp;gt;\n&amp;quot;;            # Left:    &amp;lt;hot &amp;gt;&lt;br /&gt;
          print &amp;quot;Match:   &amp;lt;$&amp;amp;&amp;gt;\n&amp;quot;;            # Match:   &amp;lt;cross&amp;gt;&lt;br /&gt;
          print &amp;quot;Right:   &amp;lt;$'&amp;gt;\n&amp;quot;;            # Right:   &amp;lt; buns&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      If you're looking for Perl information, type &amp;quot;man perl&amp;quot;, which will show you how&lt;br /&gt;
      to get even more information. Or better yet, take a look at the following&lt;br /&gt;
      link:&lt;br /&gt;
&lt;br /&gt;
          http://www.unix.org.ua/orelly/perl/prog3/ch09_01.htm&lt;br /&gt;
               also&lt;br /&gt;
          http://www.stonehenge.com/merlyn/UnixReview/&lt;br /&gt;
&lt;br /&gt;
      For a quick example on using Perl with SQLite, see the following links:&lt;br /&gt;
&lt;br /&gt;
          http://prdownloads.sourceforge.net/souptonuts/README_sqlite_tutorial.html?download&lt;br /&gt;
            or&lt;br /&gt;
          http://freshmeat.net/articles/view/1428/&lt;br /&gt;
            or&lt;br /&gt;
          http://www.perl.com/pub/a/1999/09/refererents.html&lt;br /&gt;
&lt;br /&gt;
      Standard input for files. This example will read from stdin, or open a file if given as&lt;br /&gt;
      an argument, and convert all &amp;quot;&amp;lt;&amp;quot; to &amp;quot;&amp;amp;lt;&amp;quot; and &amp;quot;&amp;gt;&amp;quot; to &amp;quot;&amp;amp;gt;&amp;quot;, which can be handy when&lt;br /&gt;
      converting text files to html files. Note the &amp;quot;while(&amp;lt;&amp;gt;)&amp;quot; will take multiple file names&lt;br /&gt;
      on the command line.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          while(&amp;lt;&amp;gt;) {&lt;br /&gt;
             s/&amp;amp;amp;/&amp;amp;amp;amp;/g;&lt;br /&gt;
             s/&amp;amp;lt;/&amp;amp;amp;lt;/g;&lt;br /&gt;
             s/&amp;amp;gt;/&amp;amp;amp;gt;/g;&lt;br /&gt;
             s/&amp;lt;/&amp;amp;lt;/g;&lt;br /&gt;
             s/&amp;gt;/&amp;amp;gt;/g;&lt;br /&gt;
             print;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
      Perl Debugger is very useful for testing commands and works like an interpreter, just&lt;br /&gt;
      like python. So to get into the Perl Debugger execute the command below, &amp;quot;q&amp;quot; to quit.&lt;br /&gt;
&lt;br /&gt;
          $ perl -de 0&lt;br /&gt;
&lt;br /&gt;
      Reference TIP 170&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 147:&lt;br /&gt;
&lt;br /&gt;
      Shutdown&lt;br /&gt;
&lt;br /&gt;
          # shutdown 8:00 -- Shutdown at 8:00&lt;br /&gt;
&lt;br /&gt;
          # shutdown +13  -- Shutdown after 13min&lt;br /&gt;
&lt;br /&gt;
          # shutdown -r now  -- Shutdown now and restart&lt;br /&gt;
&lt;br /&gt;
          # shutdown -k +2  -- &amp;quot;The system is going DOWN to maintenance mode in 2 minutes!&amp;quot;&lt;br /&gt;
                              The above is only a warning.&lt;br /&gt;
&lt;br /&gt;
          # shutdown -h now   -- Shutdown now and halt&lt;br /&gt;
&lt;br /&gt;
          # shutdown -c    -- Cancel shutdown&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 148:&lt;br /&gt;
&lt;br /&gt;
      ac -  print statistics about users connect time&lt;br /&gt;
&lt;br /&gt;
          $ ac -p    -- print hour usage by user (individual)&lt;br /&gt;
          $ ac -dy   -- print daily usage&lt;br /&gt;
&lt;br /&gt;
       Options can also be combined&lt;br /&gt;
&lt;br /&gt;
          $ ac -dyp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 149:&lt;br /&gt;
&lt;br /&gt;
      Smart Monitoring Tools:&lt;br /&gt;
      Disk failing? Or want to know the temperature of your hard-drive?&lt;br /&gt;
&lt;br /&gt;
         http://smartmontools.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
      For a good, quick tutorial, see the Linux Journal article&lt;br /&gt;
        http://www.linuxjournal.com/article/6983&lt;br /&gt;
&lt;br /&gt;
      Below are some common commands:&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -i /dev/hda&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -Hc /dev/hda&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -A /dev/hda&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 150:&lt;br /&gt;
&lt;br /&gt;
      Monitor dhcp trafic - dhcpdump and tcpdump.&lt;br /&gt;
&lt;br /&gt;
      Download dhcpdump&lt;br /&gt;
&lt;br /&gt;
         $ wget  http://voxel.dl.sourceforge.net/sourceforge/mavetju/dhcpdump-1.5.tar.gz&lt;br /&gt;
         $ ./configure&lt;br /&gt;
         $ make &amp;amp;&amp;amp; make install&lt;br /&gt;
&lt;br /&gt;
     Once it's installed, you can monitor all dhcp traffic as follows, if done with root.&lt;br /&gt;
&lt;br /&gt;
         $ tcpdump -lenx -i eth0 -s 1500 port bootps or port bootpc| dhcpdump&lt;br /&gt;
&lt;br /&gt;
     The above assumes you are using eth0 (ethernet port 0).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 151:&lt;br /&gt;
&lt;br /&gt;
      Breaking Firewalls with ssh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      A sample .ssh/config file (note this must have chmod 600 rights)&lt;br /&gt;
&lt;br /&gt;
           ## Server1 ##&lt;br /&gt;
           Host 130.21.19.227&lt;br /&gt;
               LocalForward 20000 192.168.0.66:80&lt;br /&gt;
               LocalForward 22000 192.168.0.66:22&lt;br /&gt;
&lt;br /&gt;
      With the above &amp;quot;~/.ssh/config&amp;quot; file, after sshing into 130.21.19.227 it&lt;br /&gt;
      is then possible to ssh into nearby computers directly.&lt;br /&gt;
&lt;br /&gt;
         $ ssh -l mchirico 130.21.19.227&lt;br /&gt;
         $ scp -P 22000 authorized_keys* mchirico@localhost:.&lt;br /&gt;
         $ ssh -l mchirico localhost -p 22000&lt;br /&gt;
&lt;br /&gt;
      For the complete article reference the following link:&lt;br /&gt;
        http://souptonuts.sourceforge.net/sshtips.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 152:&lt;br /&gt;
&lt;br /&gt;
      Renaming files - suppose you want to rename all the &amp;quot;.htm&amp;quot; files to &amp;quot;.html&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          $ rename .htm .html *.htm&lt;br /&gt;
&lt;br /&gt;
      Or, suppose you files file1, file2, file3 ...&lt;br /&gt;
&lt;br /&gt;
          $ touch file1 file2 file3 file4 file5 file6&lt;br /&gt;
          $ rename file file. file*&lt;br /&gt;
&lt;br /&gt;
      The above command will give you &amp;quot;file.1&amp;quot;, &amp;quot;file.2&amp;quot; ... &amp;quot;file.6&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 153:&lt;br /&gt;
&lt;br /&gt;
      Renaming files with Perl - this is taken from &amp;quot;Programming Perl 3rd Edition&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          # rename - change filenames&lt;br /&gt;
          $op = shift;&lt;br /&gt;
          for (@ARGV) {&lt;br /&gt;
              $was = $_;&lt;br /&gt;
              eval $op;&lt;br /&gt;
              die if $@;&lt;br /&gt;
              # next line calls built-in function, not the script&lt;br /&gt;
              rename($was,$_) unless $was eq $_;&lt;br /&gt;
           }&lt;br /&gt;
&lt;br /&gt;
      The above Perl program can be used as follows:&lt;br /&gt;
&lt;br /&gt;
           $ rename 's/\.orig$//'    *.orig&lt;br /&gt;
           $ rename 'y/A-Z/a-z/ unless /^Make/' *&lt;br /&gt;
&lt;br /&gt;
      Also reference:&lt;br /&gt;
           http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 154:&lt;br /&gt;
&lt;br /&gt;
      R project (http://www.r-project.org)&lt;br /&gt;
&lt;br /&gt;
      To start R, just type &amp;quot;R&amp;quot; at the command prompt and &amp;quot;q()&amp;quot; to quit. Below&lt;br /&gt;
      2 is raised to powers 0 through 6 and thrown into an array.&lt;br /&gt;
&lt;br /&gt;
           $ R&lt;br /&gt;
           &amp;gt; N &amp;lt;- 2^(0:6)&lt;br /&gt;
           &amp;gt; N&lt;br /&gt;
           [1]  1  2  4  8 16 32 64&lt;br /&gt;
           &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      There is a summary summary() command.&lt;br /&gt;
&lt;br /&gt;
           &amp;gt; summary(N)&lt;br /&gt;
           Min. 1st Qu.  Median    Mean 3rd Qu.    Max.&lt;br /&gt;
           1.00    3.00    8.00   18.14   24.00   64.00&lt;br /&gt;
&lt;br /&gt;
      Note that the array begins as 1 and not 0&lt;br /&gt;
&lt;br /&gt;
           &amp;gt; N[1:3]&lt;br /&gt;
           [1] 1 2 4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 155:&lt;br /&gt;
&lt;br /&gt;
      ls - listing files by size, with the biggest file listed last&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           $ ls --sort=size -lhr&lt;br /&gt;
&lt;br /&gt;
      The above command sorts files by size, listing the contents in&lt;br /&gt;
      &amp;quot;h&amp;quot; human readable format in reverse order.&lt;br /&gt;
&lt;br /&gt;
      Note the options:  --sort={none,time,size,extension}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 156:&lt;br /&gt;
&lt;br /&gt;
     Perl - program to clean up old versions of files&lt;br /&gt;
&lt;br /&gt;
       #!/usr/bin/perl&lt;br /&gt;
       #   Copyright (c) GPL 2005 Mike Chirico&lt;br /&gt;
       # This program deletes old files from several directories&lt;br /&gt;
       # and within each directory there must be x number of copies&lt;br /&gt;
       # each y number of bytes&lt;br /&gt;
       #&lt;br /&gt;
&lt;br /&gt;
       sub delete_old_ones {&lt;br /&gt;
           $directory_and_file=$_[0];&lt;br /&gt;
           $save_count=$_[1];&lt;br /&gt;
           $bytes_in_file=$_[2];&lt;br /&gt;
         # Don't change setting here of '-lt'&lt;br /&gt;
           $pid = open $readme, &amp;quot;ls -lt $directory_and_file|&amp;quot; or die &amp;quot;Could not execute\n&amp;quot;;&lt;br /&gt;
           while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
               my @fields = split;&lt;br /&gt;
              # Make sure we have $save_count good ones with data&lt;br /&gt;
               if ($fields[4] &amp;gt; $bytes_in_file &amp;amp;&amp;amp; $save_count &amp;gt; 0) {&lt;br /&gt;
                   $save_count--;&lt;br /&gt;
                   print &amp;quot;Kept files: $fields[4] $fields[8]\n&amp;quot;;&lt;br /&gt;
               }&lt;br /&gt;
              # delete the old ones&lt;br /&gt;
              if ($save_count &amp;lt;= 0 )&lt;br /&gt;
              {&lt;br /&gt;
                  print &amp;quot;Deleted files: $fields[4] $fields[8]\n&amp;quot;;&lt;br /&gt;
                  unlink $fields[8];&lt;br /&gt;
              }&lt;br /&gt;
           }&lt;br /&gt;
           close $readme;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       @AofA = (&lt;br /&gt;
          [ &amp;quot;/home/cvs/backups/*.gz&amp;quot;, &amp;quot;6&amp;quot;,196621 ],&lt;br /&gt;
          [ &amp;quot;/home/mail/backups/*.gz&amp;quot;,&amp;quot;5&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/snort/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/server1/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/actserver/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/server2/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
                );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       foreach( @AofA ) {&lt;br /&gt;
           &amp;amp;delete_old_ones($_-&amp;gt;[0],$_-&amp;gt;[1],$_-&amp;gt;[2]);&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
     Reference TIP 170 and the following link:&lt;br /&gt;
       http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 157:&lt;br /&gt;
&lt;br /&gt;
     Graphics and Visualization Software that runs on Linux&lt;br /&gt;
        http://www.tldp.org/HOWTO/Scientific-Computing-with-GNU-Linux/graphvis.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 158:&lt;br /&gt;
&lt;br /&gt;
     Keeping files in sync going both ways. Unlike rsync, this is not a one way mirror&lt;br /&gt;
     option.&lt;br /&gt;
&lt;br /&gt;
     You will need ocaml installed first.&lt;br /&gt;
&lt;br /&gt;
       $ wget http://caml.inria.fr/pub/distrib/ocaml-3.08/ocaml-3.08.3.tar.gz&lt;br /&gt;
       $ tar -xzf ocaml-3.08.3.tar.gz&lt;br /&gt;
       $ cd ocaml-3.08.3&lt;br /&gt;
&lt;br /&gt;
       $ ./configure&lt;br /&gt;
       $ make world&lt;br /&gt;
       $ make opt&lt;br /&gt;
       $ make install&lt;br /&gt;
&lt;br /&gt;
     Next, get unison and put it in a different directory.&lt;br /&gt;
     [http://www.cis.upenn.edu/~bcpierce/unison/]&lt;br /&gt;
&lt;br /&gt;
       $ wget http://www.cis.upenn.edu/~bcpierce/unison/download/stable/latest/unison-2.10.2.tar.gz&lt;br /&gt;
       $ tar -xzf unison-2.10.2.tar.gz&lt;br /&gt;
       $ cd unison-2.10.2&lt;br /&gt;
       $ make UISTYLE=text&lt;br /&gt;
       $ su&lt;br /&gt;
       # cp unison /usr/local/bin/.&lt;br /&gt;
&lt;br /&gt;
     Note, you have to copy the file manually.&lt;br /&gt;
&lt;br /&gt;
     See the following article [http://www.linuxjournal.com/article/7712]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 159:&lt;br /&gt;
&lt;br /&gt;
     Dump ext2/ext3 filesystem information with &amp;quot;dumpe2fs&amp;quot;. Perform the mount command&lt;br /&gt;
     and query away.&lt;br /&gt;
&lt;br /&gt;
       $ dumpe2fs /dev/sda1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 160:&lt;br /&gt;
&lt;br /&gt;
     sysreport - a script that generates an HTML report on the system configuration. It&lt;br /&gt;
     gathers information about the hardware and is somewhat redhat specific. The utility&lt;br /&gt;
     should be run as root.&lt;br /&gt;
&lt;br /&gt;
       $ /usr/sbin/sysreport&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 161:&lt;br /&gt;
&lt;br /&gt;
     Key Bindings Using bind.  You can bind, say, ctl-t to a command.&lt;br /&gt;
&lt;br /&gt;
     Add the following to you &amp;quot;~/.inputrc&amp;quot; file, just as it is typed below with quotes.&lt;br /&gt;
&lt;br /&gt;
           &amp;quot;\C-t&amp;quot;: ls -l&lt;br /&gt;
&lt;br /&gt;
     Next, run the command&lt;br /&gt;
&lt;br /&gt;
           $ bind -f .inputrc&lt;br /&gt;
&lt;br /&gt;
     Or, you can do everything on the command line; however, it won't be there the next time&lt;br /&gt;
     you log in. Below is the way to do everything on the command line.&lt;br /&gt;
&lt;br /&gt;
           $ bind -x '&amp;quot;\C-t&amp;quot;:ls -l'&lt;br /&gt;
&lt;br /&gt;
     To unbind use the &amp;quot;-r&amp;quot; option. Single quotes are not needed.&lt;br /&gt;
&lt;br /&gt;
           $ bind -r &amp;quot;\C-t&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Getting a list of all bindings can be done as follows, and not this can be redirected&lt;br /&gt;
     to the &amp;quot;.inputrc&amp;quot; file for further editing.&lt;br /&gt;
&lt;br /&gt;
           $ bind -p &amp;gt; .inputrc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 162:&lt;br /&gt;
&lt;br /&gt;
     awk - common awk commands.&lt;br /&gt;
&lt;br /&gt;
     Find device names &amp;quot;sd&amp;quot; or with major number 4 and device name &amp;quot;tty&amp;quot;. Print the&lt;br /&gt;
     record number NR, plus the major number and minor number.&lt;br /&gt;
&lt;br /&gt;
          $ awk '$2 == &amp;quot;sd&amp;quot;||$1 == 4 &amp;amp;&amp;amp; $2 == &amp;quot;tty&amp;quot; { print NR,$1,$2}' /proc/devices&lt;br /&gt;
&lt;br /&gt;
     Find device name equal to &amp;quot;sound&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ awk '/sound/{print NR,$1,$2}' /proc/devices&lt;br /&gt;
&lt;br /&gt;
     Print the 5th record, first field, in file test&lt;br /&gt;
&lt;br /&gt;
          $ awk 'NR==5{print $1}' test&lt;br /&gt;
&lt;br /&gt;
     Print a record, skip 4 records, print a record etc from file1&lt;br /&gt;
&lt;br /&gt;
          $ awk '(NR-1) % 4 == 0 {print $1}' file1&lt;br /&gt;
&lt;br /&gt;
     Print all records except the last one from file1&lt;br /&gt;
&lt;br /&gt;
          $ tac file1|awk 'NR &amp;gt; 1 {print $0}'|tac&lt;br /&gt;
&lt;br /&gt;
     Print A,B,C ..Z on each line, cycling back to A if greater than 26 lines&lt;br /&gt;
&lt;br /&gt;
          $ awk '{ print substr(&amp;quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&amp;quot;,(NR-1)%26+1,1),$0}' file1&lt;br /&gt;
&lt;br /&gt;
     Number of bytes in a directory.&lt;br /&gt;
&lt;br /&gt;
          $ ls -l|awk 'BEGIN{ c=0}{ c+=$5} END{ print c}'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 163:&lt;br /&gt;
&lt;br /&gt;
     Configuring Remote Logging.  If you have several servers on 192.168.1.0, you can setup remote logging&lt;br /&gt;
     as follows.&lt;br /&gt;
&lt;br /&gt;
     MAIN LOG SERVER (192.168.1.81):&lt;br /&gt;
&lt;br /&gt;
        Firewall - allow UDP port 514 on the main server that will receive the logs.&lt;br /&gt;
&lt;br /&gt;
          $ iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 514 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        Edit &amp;quot;/etc/sysconfig/syslog&amp;quot; and add the &amp;quot;-r&amp;quot; option to SYSLOGD_OPTIONS as shown below.&lt;br /&gt;
&lt;br /&gt;
          SYSLOGD_OPTIONS=&amp;quot;-r -m -0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Note, the &amp;quot;-r&amp;quot; is to allow remote logging and  &amp;quot;-m 0&amp;quot; specifies that that the syslog process should&lt;br /&gt;
        not write regular timestamps.  I prefer to only write timestamps for the clients.&lt;br /&gt;
&lt;br /&gt;
        Next, restart the logging process&lt;br /&gt;
&lt;br /&gt;
          $ service syslog restart&lt;br /&gt;
&lt;br /&gt;
     CLIENT LOG SERVER:&lt;br /&gt;
&lt;br /&gt;
        Edit &amp;quot;/etc/syslog.conf&amp;quot; and add the ip address of the log server, or put in the hostname.&lt;br /&gt;
&lt;br /&gt;
            *.* @192.168.1.81&lt;br /&gt;
&lt;br /&gt;
        Next, restart the logging process&lt;br /&gt;
&lt;br /&gt;
          $ service syslog restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 164:&lt;br /&gt;
&lt;br /&gt;
     kudzu - hardware on your system. To probe the hardware on your system without doing&lt;br /&gt;
             anything, issue the following command.&lt;br /&gt;
&lt;br /&gt;
          $ kudzu -p&lt;br /&gt;
&lt;br /&gt;
      But wait, a lot of this information is already recorded in the following file&lt;br /&gt;
&lt;br /&gt;
            /etc/sysconfig/hwconf&lt;br /&gt;
&lt;br /&gt;
      You can also use lspci to list all PCI devices.&lt;br /&gt;
&lt;br /&gt;
          $ lspci&lt;br /&gt;
&lt;br /&gt;
      Also, take a look at the script /etc/sbin/sysreport, since this script has a lot of&lt;br /&gt;
      info gathering commands. You can pick and choose what you want, or run the complete&lt;br /&gt;
      report.&lt;br /&gt;
&lt;br /&gt;
      If you just want information on the NIC&lt;br /&gt;
&lt;br /&gt;
          $ ip link show eth0&lt;br /&gt;
          2: eth0: &amp;lt;BROADCAST,MULTICAST,UP&amp;gt; mtu 1500 qdisc pfifo_fast qlen 1000&lt;br /&gt;
          link/ether 00:11:11:8a:be:3f brd ff:ff:ff:ff:ff:ff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 165:&lt;br /&gt;
&lt;br /&gt;
     cfengine - a very power agent for monitoring and administrating both a single computer&lt;br /&gt;
              and or multiple computers. [ http://www.cfengine.org/ ]&lt;br /&gt;
&lt;br /&gt;
     The following is a quick example on downloading and installing cfengine.&lt;br /&gt;
&lt;br /&gt;
          $ ncftpget ftp://ftp.iu.hio.no/pub/cfengine/cfengine-2.1.15.tar.gz&lt;br /&gt;
          $ md5sum cfengine-2.1.15.tar.gz&lt;br /&gt;
          f03de82709f84c3d6d916b6e557321f9  cfengine-2.1.15.tar.gz&lt;br /&gt;
&lt;br /&gt;
          $ tar -xzf cfengine-2.1.15.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You need to have a current version of BerkeleyDB (http://downloads.sleepycat.com/db-4.3.28.tar.gz).&lt;br /&gt;
     Note that BerkeleyDB has a funny install. You cd to the &amp;quot;build_unix&amp;quot; directory, then,&lt;br /&gt;
&lt;br /&gt;
          Installing BerkeleyDB if needed:&lt;br /&gt;
                 $ wget http://downloads.sleepycat.com/db-4.3.28.tar.gz&lt;br /&gt;
                 $ tar -xzf db-4.3.28.tar.gz&lt;br /&gt;
                 $ cd db-4.3.28/build_unix/&lt;br /&gt;
                 $ ../dist/configure&lt;br /&gt;
                 make&lt;br /&gt;
                 make install&lt;br /&gt;
&lt;br /&gt;
     You also need a current version of OpenSSL. For instructions on how to install OpenSSL see&lt;br /&gt;
     (http://souptonuts.sourceforge.net/postfix_tutorial.html).&lt;br /&gt;
&lt;br /&gt;
     See (TIP 49) on putting &amp;quot;/usr/local/BerkeleyDB.4.3/lib&amp;quot; in the &amp;quot;/etc/ld.so.conf&amp;quot; file. Or&lt;br /&gt;
     once BerkeleyDB is installed, you can put the location on the command line as follows:&lt;br /&gt;
&lt;br /&gt;
     Configuring cfengine with direct reference to BerkeleyDB.4.3.  First cd to the cfengine source.&lt;br /&gt;
&lt;br /&gt;
          $ ./configure --with-berkeleydb=/usr/local/BerkeleyDB.4.3/lib&lt;br /&gt;
          $ make&lt;br /&gt;
          $ make install&lt;br /&gt;
&lt;br /&gt;
     Next create the following directories:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /var/cfengine/bin&lt;br /&gt;
          $ mkdir -p /var/cfengine/inputs&lt;br /&gt;
&lt;br /&gt;
     Copy needed files (cfagent, cfdoc, cfenvd, cfenvgraph, cfexecd, cfkey, cfrun, cfservd, cfshow):&lt;br /&gt;
&lt;br /&gt;
          $ cp /usr/local/sbin/cf* /var/cfengine/bin&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You'll also need to generate keys. As root, execute the following:&lt;br /&gt;
&lt;br /&gt;
          $ cfkey&lt;br /&gt;
&lt;br /&gt;
     The command above will write the public and private keys in&lt;br /&gt;
     &amp;quot;/var/cfengine/ppkeys&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You probably want (cfexecd, cfservd, and cfenvd) running on all servers. If you&lt;br /&gt;
     add the following to &amp;quot;/etc/rc.local&amp;quot; these daemons will start on reboot.&lt;br /&gt;
&lt;br /&gt;
           # Lines in /etc/rc.local&lt;br /&gt;
           /usr/local/sbin/cfexecd&lt;br /&gt;
           /usr/local/sbin/cfservd&lt;br /&gt;
           /usr/local/sbin/cfenvd&lt;br /&gt;
&lt;br /&gt;
     Also, make sure you run each command now as follows:&lt;br /&gt;
&lt;br /&gt;
          $ /usr/local/sbin/cfexecd&lt;br /&gt;
          $ /usr/local/sbin/cfservd&lt;br /&gt;
          $ /usr/local/sbin/cfenvd&lt;br /&gt;
&lt;br /&gt;
     Firewall settings must be adjusted to allows 5308 for tcp/udp. My local network&lt;br /&gt;
     is 192.168.1.0, so I'm opening it up for all my computers.&lt;br /&gt;
&lt;br /&gt;
          $ iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 5308 -j ACCEPT&lt;br /&gt;
          $ iptables -A INPUT -p tcp -s 192.168.1.0/24  --dport 5308 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
     A set of keys needs to be on the server and hosts. For example, my key on &amp;quot;tape.squeezel.com&amp;quot;&lt;br /&gt;
     should be copied over to the server &amp;quot;squeezel.squeezel.com&amp;quot; as follows:&lt;br /&gt;
&lt;br /&gt;
     This is done from tape.squeezel.com&lt;br /&gt;
&lt;br /&gt;
          $ scp /var/cfengine/ppkeys/localhost.pub  root@squeezel.squeezel.com:/var/cfengine/ppkeys/root-tape.squeezel.com.pub&lt;br /&gt;
          $ scp root@squeezel.squeezel.com:/var/cfengine/ppkeys/localhost.pub /var/cfengine/ppkeys/root-squeezel.squeezel.com.pub&lt;br /&gt;
&lt;br /&gt;
     Also, &amp;quot;/var/cfengine/inputs/cfrun.hosts&amp;quot; on the server &amp;quot;squeezel.squeezel.com&amp;quot; must contain&lt;br /&gt;
     all the computers that will get updated. This is &amp;quot;cfrun.hosts&amp;quot; on &amp;quot;squeezel.squeezel.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          closet.squeezel.com&lt;br /&gt;
          tape.squeezel.com&lt;br /&gt;
&lt;br /&gt;
     Once I'm done, from &amp;quot;tape.squeezel.com&amp;quot; I can run the following test:&lt;br /&gt;
&lt;br /&gt;
          $ cfrun squeezel.squeezel.com -v&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 166:&lt;br /&gt;
&lt;br /&gt;
     cfengine - a quick example. This example will be run as root. You create the file &amp;quot;cfagent.conf&amp;quot; in&lt;br /&gt;
     &amp;quot;/var/cfengine/inputs/&amp;quot;. The example below will checksum all the files in /home/chirico/deleteme/tripwire,&lt;br /&gt;
     it will also comment out the line &amp;quot;finger&amp;quot; in any file located in /tmp/testdir/stuff, also appending&lt;br /&gt;
     the command in this file &amp;quot; Edit change with cfengine&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          # /var/cfengine/inputs/cfagent.conf&lt;br /&gt;
          #&lt;br /&gt;
          # You run this with the following:&lt;br /&gt;
          #   cfagent -vK&lt;br /&gt;
        &lt;br /&gt;
          control:&lt;br /&gt;
                 actionsequence = ( files tidy editfiles )&lt;br /&gt;
                 ChecksumDatabase = ( /var/cfengine/cache.db )&lt;br /&gt;
                 # Below, true to update md5&lt;br /&gt;
                 ChecksumUpdates = ( true )&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
          files:&lt;br /&gt;
                 /home/chirico/deleteme/tripwire checksum=md5 recurse=inf&lt;br /&gt;
                 /home/chirico/deleteme/tripwire/moredata checksum=md5 recurse=inf&lt;br /&gt;
                 #/home/chirico/deleteme/tripwire/compress  recurse=inf include=*.txt acti on=compress&lt;br /&gt;
                   # If the database isn't secure, nothing is secure...&lt;br /&gt;
                 /var/cfengine/cache.db  mode=600 owner=root action=fixall&lt;br /&gt;
        &lt;br /&gt;
          tidy:&lt;br /&gt;
                 /home/chirico/deleteme/tripwire pattern=*~ recurse=inf age=0&lt;br /&gt;
                 # You must put an age. 0 runs now.&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
          editfiles:&lt;br /&gt;
        &lt;br /&gt;
                {  /tmp/testdir/stuff&lt;br /&gt;
&lt;br /&gt;
                   HashCommentLinesContaining &amp;quot;finger&amp;quot;&lt;br /&gt;
                   AppendIfNoSuchLine &amp;quot;# Edit Change with cfengine &amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     A few further notes on the above. The command &amp;quot;actionsequence = ( files tidy editfiles) tells the order&lt;br /&gt;
     of what to execute. The heading &amp;quot;tidy:&amp;quot; deletes files, and of course, &amp;quot;editfiles&amp;quot; does the editing of files.&lt;br /&gt;
&lt;br /&gt;
     To run the example, execute the following command. The  &amp;quot;-K&amp;quot; causes the lock file to be ignored.&lt;br /&gt;
&lt;br /&gt;
            $ cfagent -vK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 167:&lt;br /&gt;
&lt;br /&gt;
     Implementing Disk Quotas - a quick example that can easily be done on a live system for testing. There&lt;br /&gt;
     is no need to reboot, since you'll be creating a virtual filesystem.&lt;br /&gt;
&lt;br /&gt;
     Do the following as root. First create a mount point.&lt;br /&gt;
&lt;br /&gt;
            # mkdir -p /quota&lt;br /&gt;
&lt;br /&gt;
     Next, create 20M file. Since I have many of these files, I created a special directory &amp;quot;/usr/disk-img&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            # mkdir -p /usr/disk-img&lt;br /&gt;
            # dd if=/dev/zero of=/usr/disk-img/disk-quota.ext3 count=40960&lt;br /&gt;
&lt;br /&gt;
     The dd command above create a 20 MB file because, by default, dd uses a block size of 512 bytes. That makes&lt;br /&gt;
     the size: 40960*512=20971520.&lt;br /&gt;
&lt;br /&gt;
     Next, format this as an ext3 filesystem&lt;br /&gt;
&lt;br /&gt;
            # /sbin/mkfs -t ext3 -q /usr/disk-img/disk-quota.ext3 -F&lt;br /&gt;
&lt;br /&gt;
     Add the following line to &amp;quot;/etc/fstab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            /usr/disk-img/disk-quota.ext3    /quota ext3    rw,loop,usrquota,grpquota  0 0&lt;br /&gt;
&lt;br /&gt;
     Now, mount this filesystem&lt;br /&gt;
&lt;br /&gt;
            # mount /quota&lt;br /&gt;
&lt;br /&gt;
     Take a look at it:&lt;br /&gt;
&lt;br /&gt;
            # ls -l /quota&lt;br /&gt;
            lost+found&lt;br /&gt;
&lt;br /&gt;
     Now, run &amp;quot;quotacheck&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            # quotacheck -vug /quota&lt;br /&gt;
&lt;br /&gt;
     You'll get errors the first time this is run, because you have no quota files.&lt;br /&gt;
     But, run it a second time and you'll see something similiar to the following:&lt;br /&gt;
&lt;br /&gt;
            # quotacheck -vug /quota&lt;br /&gt;
            quotacheck: Scanning /dev/loop2 [/quota] done&lt;br /&gt;
            quotacheck: Checked 3 directories and 4 files&lt;br /&gt;
&lt;br /&gt;
     Now take a look at the files:&lt;br /&gt;
&lt;br /&gt;
            # ls -l /quota&lt;br /&gt;
            total 26&lt;br /&gt;
            -rw-------  1 root root  6144 Jun 14 12:23 aquota.group&lt;br /&gt;
            -rw-------  1 root root  6144 Jun 14 12:23 aquota.user&lt;br /&gt;
            drwx------  2 root root 12288 Jun 14 12:18 lost+found&lt;br /&gt;
&lt;br /&gt;
     Next use &amp;quot;edquota&amp;quot; to grant the user &amp;quot;chirico&amp;quot; a certain quota&lt;br /&gt;
&lt;br /&gt;
            # edquota -f /quota chirico&lt;br /&gt;
&lt;br /&gt;
     This will bring up a menu, and here I have edited so that user &amp;quot;chirico&amp;quot;&lt;br /&gt;
     has a soft limit of 120*512=61K, and a soft limit of 2 inodes and a hard limit of 5.&lt;br /&gt;
&lt;br /&gt;
             Disk quotas for user chirico (uid 500):&lt;br /&gt;
             Filesystem                   blocks       soft       hard     inodes     soft     hard&lt;br /&gt;
             /dev/loop2                        2        120        150         1        2         3&lt;br /&gt;
&lt;br /&gt;
     Next, turn quotas on with the following command:&lt;br /&gt;
&lt;br /&gt;
             $ quotaon /quota&lt;br /&gt;
&lt;br /&gt;
     If you need to turn off quotas, the command is &amp;quot;quotaoff -a&amp;quot; for all filesystems. You'll run into&lt;br /&gt;
     errors if you try to run quotacheck, say &amp;quot;quotacheck -avug&amp;quot; because this tries to unmount and mount&lt;br /&gt;
     the filesystem. You need to turn off quotas first &amp;quot;quotaoff /quota&amp;quot;. Note you only need to run&lt;br /&gt;
     quotacheck once, or when doing maintenance after a system crash.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      To get a report on the quote, runn &amp;quot;repquota&amp;quot; as follows:&lt;br /&gt;
&lt;br /&gt;
           $ repquota /quota&lt;br /&gt;
            *** Report for user quotas on device /dev/loop0&lt;br /&gt;
            Block grace time: 7days; Inode grace time: 7days&lt;br /&gt;
                                    Block limits                File limits&lt;br /&gt;
            User            used    soft    hard  grace    used  soft  hard  grace&lt;br /&gt;
            ----------------------------------------------------------------------&lt;br /&gt;
            root      --    1189       0       0              2     0     0&lt;br /&gt;
            chirico   -+      93       0       0              4     2     5  6days&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Note above that user &amp;quot;chirico&amp;quot; has used 4 on the file limits. This user has a hard&lt;br /&gt;
      limit of 5. So when this user tries to create 2 more files (bring this over the limit of 5)&lt;br /&gt;
      then he will get the following error as demonstrated below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           [chirico@squeezel chirico]$ touch one&lt;br /&gt;
           [chirico@squeezel chirico]$ touch two&lt;br /&gt;
           loop0: write failed, user file limit reached.&lt;br /&gt;
           touch: cannot touch `two': Disk quota exceeded&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Now, if repquota (run by root) is executed it shows the following:&lt;br /&gt;
&lt;br /&gt;
           $ repquota /quota&lt;br /&gt;
           *** Report for user quotas on device /dev/loop0&lt;br /&gt;
           Block grace time: 7days; Inode grace time: 7days&lt;br /&gt;
                                   Block limits                File limits&lt;br /&gt;
           User            used    soft    hard  grace    used  soft  hard  grace&lt;br /&gt;
           ----------------------------------------------------------------------&lt;br /&gt;
           root      --    1189       0       0              2     0     0&lt;br /&gt;
           chirico   -+      94       0       0              5     2     5  6days&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Note the &amp;quot;+&amp;quot; sign above. User &amp;quot;chirico&amp;quot; is above the File soft limits, and in this case&lt;br /&gt;
      above the hard limits.&lt;br /&gt;
&lt;br /&gt;
      To warn user by sending email to them, run &amp;quot;warnquota&amp;quot;, but you need check that&lt;br /&gt;
      &amp;quot;/etc/warnquota.conf&amp;quot; is setup correctly. For the example above, this file should&lt;br /&gt;
      look as follows:&lt;br /&gt;
&lt;br /&gt;
            $ cat /etc/quotatab&lt;br /&gt;
            #&lt;br /&gt;
            #  This is sample quotatab (/etc/quotatab)&lt;br /&gt;
            #  Here you can specify description of each device for user&lt;br /&gt;
            #&lt;br /&gt;
            #  Comments begin with hash in the beginning of the line&lt;br /&gt;
&lt;br /&gt;
            # Example of description&lt;br /&gt;
            /dev/loop0: This is loopback device&lt;br /&gt;
&lt;br /&gt;
      Just run the following as root:&lt;br /&gt;
&lt;br /&gt;
            $ warnquota&lt;br /&gt;
&lt;br /&gt;
      By the way, if you want to change the grace period, it can only be done on a filesystem&lt;br /&gt;
      basis. Not per user.&lt;br /&gt;
&lt;br /&gt;
            $  edquota -t&lt;br /&gt;
&lt;br /&gt;
      Users can run &amp;quot;quota&amp;quot; to see their usage as follows:&lt;br /&gt;
&lt;br /&gt;
            [chirico@squeezel ~]$ quota&lt;br /&gt;
            Disk quotas for user chirico (uid 500):&lt;br /&gt;
                 Filesystem  blocks   quota   limit   grace   files   quota   limit   grace&lt;br /&gt;
                 /dev/loop0      94       0       0               5      10      50&lt;br /&gt;
&lt;br /&gt;
      As you can see from above, I changed my inode limit to 50.&lt;br /&gt;
&lt;br /&gt;
      What about running this on the whole filesystem? Yes, below is an example where I'm running&lt;br /&gt;
      this on FC3, on the root of the filesystem &amp;quot;/&amp;quot;. This assumes that you have installed the&lt;br /&gt;
      quota package. Try doing &amp;quot;rpm -q quota&amp;quot; to see if this package is installed.&lt;br /&gt;
&lt;br /&gt;
        Step 1:&lt;br /&gt;
&lt;br /&gt;
           Check to make sure the quota software is installed. You can either do a &amp;quot;whereis quota&amp;quot;,&lt;br /&gt;
           or check for the rpm package.&lt;br /&gt;
&lt;br /&gt;
             $ whereis quota&lt;br /&gt;
             whereis quota&lt;br /&gt;
             quota: /usr/bin/quota /usr/share/man/man1/quota.1.gz&lt;br /&gt;
&lt;br /&gt;
           Checking for the rpm package.&lt;br /&gt;
&lt;br /&gt;
            $ rpm -q quota&lt;br /&gt;
            quota-3.12-5&lt;br /&gt;
&lt;br /&gt;
        Step 2:&lt;br /&gt;
&lt;br /&gt;
           Edit /etc/fstab and add usrquota and grpquota options for &amp;quot;/dev/VolGroup00/LogVol00&amp;quot;,&lt;br /&gt;
           which is shown on the first line below:&lt;br /&gt;
&lt;br /&gt;
             /dev/VolGroup00/LogVol00 /                      ext3    defaults,usrquota,grpquota        1 1&lt;br /&gt;
             LABEL=/boot             /boot                   ext3    defaults        1 2&lt;br /&gt;
             none                    /dev/pts                devpts  gid=5,mode=620  0 0&lt;br /&gt;
             none                    /dev/shm                tmpfs   defaults        0 0&lt;br /&gt;
             none                    /proc                   proc    defaults        0 0&lt;br /&gt;
             none                    /sys                    sysfs   defaults        0 0&lt;br /&gt;
             /dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0&lt;br /&gt;
&lt;br /&gt;
        Step 3:&lt;br /&gt;
&lt;br /&gt;
           Remount the filesystem as follows:&lt;br /&gt;
&lt;br /&gt;
             $ mount -o remount /&lt;br /&gt;
&lt;br /&gt;
        Step 4:&lt;br /&gt;
&lt;br /&gt;
           Run quotacheck with the &amp;quot;-m&amp;quot; option. Like the above statement, this will have to be run with&lt;br /&gt;
           root priviliges. This creates the quota database files, and it can take a long time if it is&lt;br /&gt;
           a large full filesystem.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             $ quotacheck -cugm /&lt;br /&gt;
&lt;br /&gt;
        Step 5:&lt;br /&gt;
&lt;br /&gt;
           This step is optional, but it's good to know if you need to recalculate quotas because of a&lt;br /&gt;
           system crash. It's demonstrated here, because at this point quota's have not been turned on.&lt;br /&gt;
           Again, note the &amp;quot;m&amp;quot; option below.&lt;br /&gt;
&lt;br /&gt;
             $ quotacheck -avumg&lt;br /&gt;
&lt;br /&gt;
        Step 6:&lt;br /&gt;
&lt;br /&gt;
           Set limits for specific users or groups using the &amp;quot;edquota&amp;quot; command. Shown below is the command&lt;br /&gt;
           to setup quotas for user &amp;quot;chirico&amp;quot;. Shown below this user has used 161560 blocks, he has a soft&lt;br /&gt;
           limit of 1161560 and a hard limit of 900000. He has used 3085 inodes and has a soft limit of 10000&lt;br /&gt;
           and a hard limit of 12000.&lt;br /&gt;
&lt;br /&gt;
             $ edquota -f / chirico&lt;br /&gt;
&lt;br /&gt;
             Disk quotas for user chirico (uid 500):&lt;br /&gt;
               Filesystem                   blocks       soft       hard     inodes     soft     hard&lt;br /&gt;
               /dev/mapper/VolGroup00-LogVol00     161560    1161560     900000       3085    10000    12000&lt;br /&gt;
&lt;br /&gt;
           You can put quotas on groups as well. The following is done as root. See (TIP 186 and TIP 6) for creating&lt;br /&gt;
           groups and adding users to groups.&lt;br /&gt;
&lt;br /&gt;
             $ edquota -g share&lt;br /&gt;
&lt;br /&gt;
           If you create a sharable directory for anyone in the group &amp;quot;share&amp;quot; (TIP 6), quota restrictions against&lt;br /&gt;
           group &amp;quot;share&amp;quot; will only apply to files added in the &amp;quot;/home/share&amp;quot; directory. When user &amp;quot;chirico&amp;quot; creates&lt;br /&gt;
           files in &amp;quot;/home/share&amp;quot; they also go against this user quota as well. However, when files are created in&lt;br /&gt;
           his home directory they do not go against the &amp;quot;share&amp;quot; group.&lt;br /&gt;
&lt;br /&gt;
           Note - if you get errors when trying to run &amp;quot;edquota -g share&amp;quot;, turn quotas off &amp;quot;quotaoff /&amp;quot; and&lt;br /&gt;
                  run &amp;quot;quotacheck -avugm&amp;quot;. Then, turn the quotas back on &amp;quot;quotaon /&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           You can see the status of the group quota with the following command:&lt;br /&gt;
&lt;br /&gt;
             $ quota -g share&lt;br /&gt;
&lt;br /&gt;
        Step 7:&lt;br /&gt;
&lt;br /&gt;
           Turn on quotas with the &amp;quot;qutoaon&amp;quot; command. This command needs to be done with root privileges.&lt;br /&gt;
&lt;br /&gt;
             $ quotaon /&lt;br /&gt;
&lt;br /&gt;
        Step 8:&lt;br /&gt;
&lt;br /&gt;
           Check &amp;quot;/etc/quotatab&amp;quot; file for the correct entries. Note that when you do the &amp;quot;mount&amp;quot; command&lt;br /&gt;
           the filesystem returned needs to match what is in the &amp;quot;quotatab&amp;quot; file. I have noticed that this&lt;br /&gt;
           is not the case by default.&lt;br /&gt;
&lt;br /&gt;
             $ mount&lt;br /&gt;
             /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw,usrquota,grpquota)&lt;br /&gt;
&lt;br /&gt;
           So the &amp;quot;/etc/quotatab&amp;quot; must contain the following line.&lt;br /&gt;
&lt;br /&gt;
             /dev/mapper/VolGroup00-LogVol00: This is the Volume group&lt;br /&gt;
&lt;br /&gt;
        Step 9:&lt;br /&gt;
&lt;br /&gt;
           Run &amp;quot;warnquota&amp;quot; as a check that the &amp;quot;/etc/quotatab&amp;quot; files is setup correctly.&lt;br /&gt;
&lt;br /&gt;
              $ warnquota&lt;br /&gt;
&lt;br /&gt;
        Step 10:&lt;br /&gt;
&lt;br /&gt;
           Setup a daily cron job for running &amp;quot;warnquota&amp;quot;. The following should be placed&lt;br /&gt;
           in &amp;quot;/etc/cron.daily&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              #!/bin/sh&lt;br /&gt;
              # Place this file in /etc/cron.daily&lt;br /&gt;
              # with rights 0755&lt;br /&gt;
              /usr/sbin/warnquota&lt;br /&gt;
              EXITVALUE=$?&lt;br /&gt;
              if [ $EXITVALUE != 0 ]; then&lt;br /&gt;
                 /usr/bin/logger -t warnquota &amp;quot;ALERT exited abnormally with [$EXITVALUE]&amp;quot;&lt;br /&gt;
              fi&lt;br /&gt;
              exit 0&lt;br /&gt;
&lt;br /&gt;
      References:&lt;br /&gt;
        http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/sysadmin-guide/ch-disk-quotas.html&lt;br /&gt;
        (TIP 6, TIP 186, and TIP 205)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 168:&lt;br /&gt;
&lt;br /&gt;
     rdist - remote file distribution client program. You can use this program in combination with&lt;br /&gt;
     ssh. This program does more than just copy files. Once a file has been copied, you can dictate&lt;br /&gt;
     other actions to be performed. Or you can hold off copying all together if the destination is&lt;br /&gt;
     running low on inodes, or disk space.&lt;br /&gt;
&lt;br /&gt;
     For the purpose of this example, all commands will been run on &amp;quot;squeezel.squeezel.com&amp;quot;, and the&lt;br /&gt;
     computers that will be updated are &amp;quot;tape.squeezel.com&amp;quot; and &amp;quot;closet.squeezel.com&amp;quot;. Obviously, you&lt;br /&gt;
     would substitute your computer names.&lt;br /&gt;
&lt;br /&gt;
     It helps to setup ssh keys on each computer first. Reference [http://souptonuts.sourceforge.net/sshtips.htm]&lt;br /&gt;
     and (TIP 12).&lt;br /&gt;
&lt;br /&gt;
     Step 1: Create the Configuration file myDistfile&lt;br /&gt;
&lt;br /&gt;
       Below is my sample &amp;quot;myDistfile&amp;quot;. This file will access hosts &amp;quot;tape.squeezel.com&amp;quot; using username chirico&lt;br /&gt;
       and &amp;quot;closet.squeezel.com&amp;quot; with the username running this command, and copy the&lt;br /&gt;
       files &amp;quot;/home/chirico/file1&amp;quot; and &amp;quot;/home/chirico/file2&amp;quot; to the these two servers creating the&lt;br /&gt;
       directory ~/tmpdir if it doesn't exist. Once these files are updated, a mail check (&amp;quot;sendmail -bv&amp;quot;)&lt;br /&gt;
       will be performed, and mail will be sent to &amp;quot;chirico@squeezel&amp;quot;. This happens twice, once for each file.&lt;br /&gt;
&lt;br /&gt;
       Note, the line &amp;quot;/home/chirico/file2 -&amp;gt; tape.squeezel.com&amp;quot; which moves the file &amp;quot;file2&amp;quot; to&lt;br /&gt;
       tape.squeezel.com renaming the file to &amp;quot;tapedest&amp;quot; in the directory &amp;quot;/home/chirico&amp;quot;. Once this file&lt;br /&gt;
       is copied, the rights are modified to &amp;quot;chmod +r&amp;quot;.  Likewise, &amp;quot;/home/chirico/file2 -&amp;gt; closet.squeezel.com&amp;quot;&lt;br /&gt;
       copies the file file2, which is renamed as closetdest.&lt;br /&gt;
&lt;br /&gt;
                 # Contents of myDistfile&lt;br /&gt;
                 HOSTS = ( chirico@tape.squeezel.com closet.squeezel.com )&lt;br /&gt;
&lt;br /&gt;
                 FILES = ( /home/chirico/file1 /home/chirico/file2 )&lt;br /&gt;
&lt;br /&gt;
                 ${FILES} -&amp;gt; ${HOSTS}&lt;br /&gt;
                    # Directory tmpdir will be created if it doesn't exist&lt;br /&gt;
                    install tmpdir ;&lt;br /&gt;
                    special /home/chirico/file1  &amp;quot;/usr/sbin/sendmail -bv mchirico@gmail.com&amp;quot;;&lt;br /&gt;
                    notify chirico@squeezel;&lt;br /&gt;
&lt;br /&gt;
                 /home/chirico/file2 -&amp;gt; tape.squeezel.com&lt;br /&gt;
                    install  /home/chirico/tapedest;&lt;br /&gt;
                    special  /home/chirico/tapedest &amp;quot;chmod +r /home/chirico/tapedest&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
                 /home/chirico/file2 -&amp;gt; closet.squeezel.com&lt;br /&gt;
                    install /home/chirico/closetdest;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 2: Command from squeezel.squeezel.com to run myDistfile above&lt;br /&gt;
&lt;br /&gt;
       Below is the command that will execute the contents in &amp;quot;myDistfile&amp;quot;. This command is run from the&lt;br /&gt;
       computer &amp;quot;squeezel.squeezel.com&amp;quot;. All output will go in the file &amp;quot;cmd1rdist.log&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ rdist -P /usr/local/bin/ssh -f ./myDistfile -l file=./cmd1rdist.log=all&lt;br /&gt;
&lt;br /&gt;
       Obviously you want a secure copy (using scp), so the -P option uses ssh as your secure&lt;br /&gt;
       transport mechanism.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 169:&lt;br /&gt;
&lt;br /&gt;
     Restricting root logins (/etc/securetty). ctl-alt-F4 will give you a prompt for tty3. Note&lt;br /&gt;
     that it is one number less. Take a look at the contents of &amp;quot;/etc/securetty&amp;quot;. To prevent&lt;br /&gt;
     root from logging in on this device, take out tty3 from this listing. Note, you can always&lt;br /&gt;
     login as another user, then, su to root.  Below is an example of the default&lt;br /&gt;
     &amp;quot;/etc/securetty&amp;quot; that allows root to login to everything.&lt;br /&gt;
&lt;br /&gt;
         [root@squeezel ~]# cat /etc/securetty&lt;br /&gt;
         console&lt;br /&gt;
         vc/1&lt;br /&gt;
         vc/2&lt;br /&gt;
         vc/3&lt;br /&gt;
         vc/4&lt;br /&gt;
         vc/5&lt;br /&gt;
         vc/6&lt;br /&gt;
         vc/7&lt;br /&gt;
         vc/8&lt;br /&gt;
         vc/9&lt;br /&gt;
         vc/10&lt;br /&gt;
         vc/11&lt;br /&gt;
         tty1&lt;br /&gt;
         tty2&lt;br /&gt;
         tty3&lt;br /&gt;
         tty4&lt;br /&gt;
         tty5&lt;br /&gt;
         tty6&lt;br /&gt;
         tty7&lt;br /&gt;
         tty8&lt;br /&gt;
         tty9&lt;br /&gt;
         tty10&lt;br /&gt;
         tty11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 170:&lt;br /&gt;
&lt;br /&gt;
     Perl map function. Try the following to get a quick take on this function,&lt;br /&gt;
     which increments each value in the array a;&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map {$_++} @a;&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot; } @a;&lt;br /&gt;
&lt;br /&gt;
     or&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     And you can easily make modifications, like reversing the order&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     Plus there is a grep() function that works on each element as well&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse grep{ $_ &amp;gt; 3} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     To get only odd numbers in reverse order:&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse grep{ !($_ % 2)} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference: http://www-128.ibm.com/developerworks/linux/library/l-road4.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 171:&lt;br /&gt;
&lt;br /&gt;
     Perl - subroutine call and shifting through variables. A simple and useful&lt;br /&gt;
     technique.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          sub test {&lt;br /&gt;
            local $mval;&lt;br /&gt;
            while( $mval = shift ) {&lt;br /&gt;
              print &amp;quot; $mval\n&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          test(&amp;quot;one&amp;quot;,&amp;quot;two&amp;quot;,&amp;quot;three&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 172:&lt;br /&gt;
&lt;br /&gt;
     Tcp wrappers - First &amp;quot;/etc/hosts.allow&amp;quot; is check, and if there is an entry in this file, no more&lt;br /&gt;
     checking it done.  If are no matches in &amp;quot;/etc/hosts.allow&amp;quot;, the &amp;quot;/etc/hosts.deny&amp;quot; file is checked&lt;br /&gt;
     and if a match is found, that service is blocked for that host.&lt;br /&gt;
&lt;br /&gt;
     Example &amp;quot;/etc/hosts.deny&amp;quot; file:&lt;br /&gt;
&lt;br /&gt;
         sshd: 192.168.1.171&lt;br /&gt;
&lt;br /&gt;
     The above file blocks access to computer 192.168.1.171. It's also possible to run commands when&lt;br /&gt;
     someone from this computer tries to ssh in. This example sends mail.&lt;br /&gt;
&lt;br /&gt;
         sshd: 192.168.1.171: spawn (echo -e &amp;quot;%d %h %H %u&amp;quot;| /bin/mail -s 'hosts.deny entry' root)&lt;br /&gt;
&lt;br /&gt;
     Of course, you can also run commands in the &amp;quot;/etc/hosts.allow&amp;quot; if you wanted mail sent for a successful&lt;br /&gt;
     login.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 173:&lt;br /&gt;
&lt;br /&gt;
     pgrep, pkill - look up or signal process based on name and other attributes.&lt;br /&gt;
&lt;br /&gt;
     To quick find all instances of ssh running, for user root, execute the following&lt;br /&gt;
     command:&lt;br /&gt;
&lt;br /&gt;
           $ pgrep -u root -l ssh&lt;br /&gt;
&lt;br /&gt;
     To kill a process, or send a signal use the &amp;quot;pkill&amp;quot; option. For example, to&lt;br /&gt;
     make syslog reread its configuration file:&lt;br /&gt;
&lt;br /&gt;
           $ pkill -HUP syslogd&lt;br /&gt;
&lt;br /&gt;
     Another command command is &amp;quot;pidof&amp;quot; that can tell you how many processes are running.&lt;br /&gt;
     This can be useful for detecting DOS attacks.&lt;br /&gt;
&lt;br /&gt;
           $ pidof sshd&lt;br /&gt;
           4783 4781 30008 30006 29888 29886 2246&lt;br /&gt;
&lt;br /&gt;
     Above there are 7 sshd's running. Reference &amp;quot;Tcpdump, Raw Socket and Libpap Tutorial&amp;quot;&lt;br /&gt;
     at [http://souptonuts.sourceforge.net/tcpdump_tutorial.html].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 174:&lt;br /&gt;
&lt;br /&gt;
     Password Cracking - tools to check your users passwords:&lt;br /&gt;
&lt;br /&gt;
      John The Ripper&lt;br /&gt;
        http://www.openwall.com/john/&lt;br /&gt;
&lt;br /&gt;
      Crack&lt;br /&gt;
        http://www.crypticide.com/users/alecm/&lt;br /&gt;
&lt;br /&gt;
      Slurpie&lt;br /&gt;
        http://www.ussrback.com/distributed.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 175:&lt;br /&gt;
&lt;br /&gt;
     Password Aging - setting the number of days a password is valid.&lt;br /&gt;
&lt;br /&gt;
         $ chage -M 90 &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 176:&lt;br /&gt;
&lt;br /&gt;
     Kernel Performance Tuning - /Documentation/sysctl/vm.txt documents kernel settings to&lt;br /&gt;
     improve performance. Below are some examples.&lt;br /&gt;
&lt;br /&gt;
       overcommit_memory:  0 -- default estimates the amount of memory for malloc&lt;br /&gt;
                           1 -- kernel pretends there is always enough memory until it runs out&lt;br /&gt;
                           3 -- never overcommit&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/overcommit_memory&lt;br /&gt;
          0&lt;br /&gt;
&lt;br /&gt;
       page-cluster:&lt;br /&gt;
            The Linux VM subsystem avoids excessive disk seeks by reading&lt;br /&gt;
            multiple pages on a page fault. The number of pages it reads&lt;br /&gt;
            is dependent on the amount of memory in your machine.&lt;br /&gt;
        &lt;br /&gt;
            The number of pages the kernel reads in at once is equal to&lt;br /&gt;
            2 ^ page-cluster. Values above 2 ^ 5 don't make much sense&lt;br /&gt;
            for swap because we only cluster swap data in 32-page groups.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/page-cluster&lt;br /&gt;
          3&lt;br /&gt;
&lt;br /&gt;
       min_free_kbytes:&lt;br /&gt;
            This is used to force the Linux VM to keep a minimum number&lt;br /&gt;
            of kilobytes free.  The VM uses this number to compute a pages_min&lt;br /&gt;
            value for each lowmem zone in the system.  Each lowmem zone gets&lt;br /&gt;
            a number of reserved free pages based proportionally on its size.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/min_free_kbytes&lt;br /&gt;
          3831&lt;br /&gt;
&lt;br /&gt;
       max_map_count:&lt;br /&gt;
            This file contains the maximum number of memory map areas a process&lt;br /&gt;
            may have. Memory map areas are used as a side-effect of calling&lt;br /&gt;
            malloc, directly by mmap and mprotect, and also when loading shared&lt;br /&gt;
            libraries.&lt;br /&gt;
&lt;br /&gt;
            While most applications need less than a thousand maps, certain&lt;br /&gt;
            programs, particularly malloc debuggers, may consume lots of them,&lt;br /&gt;
            e.g., up to one or two maps per allocation.&lt;br /&gt;
&lt;br /&gt;
            The default value is 65536.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/max_map_count&lt;br /&gt;
          65536&lt;br /&gt;
&lt;br /&gt;
        Also see http://people.redhat.com/alikins/system_tuning.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 177:&lt;br /&gt;
&lt;br /&gt;
     IO Scheduler - /Documentation/block/as-iosched.txt documents kernel settings for disk&lt;br /&gt;
     performance.&lt;br /&gt;
&lt;br /&gt;
     If you're not sure what partitions you have &amp;quot;$ cat /proc/partitions&amp;quot;. This example&lt;br /&gt;
     assumes hda, and you can see some of the kernel settings:&lt;br /&gt;
&lt;br /&gt;
          $ ls /sys/block/hda/queue/iosched&lt;br /&gt;
          back_seek_max  back_seek_penalty  clear_elapsed  fifo_batch_expire  fifo_expire_async&lt;br /&gt;
           fifo_expire_sync  find_best_crq  key_type  quantum  queued&lt;br /&gt;
&lt;br /&gt;
     References: http://lwn.net/Articles/102505/&lt;br /&gt;
                 http://bhhdoa.org.au/pipermail/ck/2004-September/000961.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 178:&lt;br /&gt;
&lt;br /&gt;
     iozone -- getting data on disk performance (http://www.iozone.org/). This is a very&lt;br /&gt;
     comprehensive package.&lt;br /&gt;
&lt;br /&gt;
           $ wget http://www.iozone.org/src/current/iozone3_242.tar&lt;br /&gt;
           $ tar -xf iozone3_242.tar&lt;br /&gt;
           $ cd iozone3_242/src/current&lt;br /&gt;
           $ make linux&lt;br /&gt;
&lt;br /&gt;
     At this point you should read the documentation. There is no &amp;quot;make install&amp;quot;. You&lt;br /&gt;
     copy it to each filesystem you want to run this program on. Below are some quick&lt;br /&gt;
     start commands.&lt;br /&gt;
&lt;br /&gt;
       Good comprehensive test.&lt;br /&gt;
&lt;br /&gt;
           $ iozone -a&lt;br /&gt;
&lt;br /&gt;
       I prefer this for small filesystems. It limits the record size to 10000 and does&lt;br /&gt;
       the output in operations per second (higher numbers mean faster drive).&lt;br /&gt;
&lt;br /&gt;
           $ ./iozone -a -s 10000 -O&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 179:&lt;br /&gt;
&lt;br /&gt;
     history - bash command to get a history of all commands typed. But, here is a way&lt;br /&gt;
     that you can get date and time listed as well.&lt;br /&gt;
&lt;br /&gt;
           $ HISTTIMEFORMAT=&amp;quot;%y/%m/%d %T &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Defining the environment variable above give you the date/time info when you&lt;br /&gt;
     execute history:&lt;br /&gt;
&lt;br /&gt;
           $ history&lt;br /&gt;
              ...&lt;br /&gt;
               175  05/06/30 12:51:46 grep '141.162.' mout &amp;gt; mout2&lt;br /&gt;
               176  05/06/30 12:51:48 e mout2&lt;br /&gt;
               177  05/06/30 12:56:59 ls&lt;br /&gt;
               178  05/06/30 12:57:02 ls&lt;br /&gt;
               179  05/06/30 12:57:39 ls&lt;br /&gt;
               180  05/06/30 12:57:49 ls -l&lt;br /&gt;
               181  05/06/30 13:01:10 history&lt;br /&gt;
               182  05/06/30 13:01:20 HISTTIMEFORMAT=&amp;quot;%y/%m/%d %T &amp;quot;&lt;br /&gt;
               183  05/06/30 13:01:23 history&lt;br /&gt;
              ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 180:&lt;br /&gt;
&lt;br /&gt;
     .config - Fedora Core getting the .config to rebuild the kernel. You can find&lt;br /&gt;
     this file, the &amp;quot;.config&amp;quot; file at the following location:&lt;br /&gt;
&lt;br /&gt;
          $ ls &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Or, to see the contents&lt;br /&gt;
&lt;br /&gt;
          $ cat &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     This can be important, if you're planning to build your own kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 181:&lt;br /&gt;
&lt;br /&gt;
     Listing control key settings.&lt;br /&gt;
&lt;br /&gt;
          $ stty -a&lt;br /&gt;
          speed 38400 baud; rows 0; columns 0; line = 0;&lt;br /&gt;
          intr = ^C; quit = ^\; erase = &amp;lt;undef&amp;gt;; kill = &amp;lt;undef&amp;gt;; eof = ^D; eol = &amp;lt;undef&amp;gt;; eol2 = &amp;lt;undef&amp;gt;; start = ^Q;&lt;br /&gt;
          stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;&lt;br /&gt;
          -parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts&lt;br /&gt;
          -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel&lt;br /&gt;
          opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0&lt;br /&gt;
          isig icanon iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 182:&lt;br /&gt;
&lt;br /&gt;
     iptables DNAT and SNAT. You have a webserver on 192.168.1.71. When people query this webserver, you want them&lt;br /&gt;
     to goto 192.168.1.81, with no indication that they are going to another web server. In fact, they always make&lt;br /&gt;
     their web hits to 192.168.1.71.&lt;br /&gt;
&lt;br /&gt;
     The following is the iptables commands:&lt;br /&gt;
&lt;br /&gt;
        $ echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
        $ iptables -t nat -A PREROUTING -d 192.168.1.71 -p tcp --dport 80 -j DNAT --to 192.168.1.81&lt;br /&gt;
        $ iptables -t nat -A POSTROUTING -d 192.168.1.81 -s 192.168.1.0/24 -p tcp --dport 80 -j SNAT --to 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
     Change 192.168.1.0/24 to whatever source you expect the web browser to come in on. Below is the tcpdump showing&lt;br /&gt;
     all traffic is relayed via 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
         [root@closet iptables]# tcpdump -nN port 80&lt;br /&gt;
&lt;br /&gt;
         17:34:58.790398 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: S 3620106373:3620106373(0) win 16384 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790465 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: S 3620106373:3620106373(0) win 16384 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790703 IP 192.168.1.81.80 &amp;gt; 192.168.1.71.1158: S 1973665156:1973665156(0) ack 3620106374 win 5840 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790720 IP 192.168.1.71.80 &amp;gt; 192.168.1.102.1158: S 1973665156:1973665156(0) ack 3620106374 win 5840 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790951 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: . ack 1 win 17520&lt;br /&gt;
         17:34:58.790965 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: . ack 1 win 17520&lt;br /&gt;
         17:34:58.791451 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: P 1:327(326) ack 1 win 17520&lt;br /&gt;
         17:34:58.791472 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: P 1:327(326) ack 1 win 17520&lt;br /&gt;
         17:34:58.791973 IP 192.168.1.81.80 &amp;gt; 192.168.1.71.1158: . ack 327 win 6432&lt;br /&gt;
&lt;br /&gt;
     Above the web client is on &amp;quot;192.168.1.102&amp;quot;. You can see that the 1st server &amp;quot;192.168.1.71&amp;quot; then goes out to&lt;br /&gt;
     the 2nd server &amp;quot;192.168.1.81&amp;quot; on the second line. The third line shows the 2nd server &amp;quot;192.168.1.81&amp;quot; responding to&lt;br /&gt;
     the 1st server, and the forth line passes this data back to the web client &amp;quot;192.168.1.102&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Note: You can save your current iptables setting with the following command:&lt;br /&gt;
&lt;br /&gt;
         $ iptables-save &amp;gt; iptables_store&lt;br /&gt;
&lt;br /&gt;
       The big advantage is that you can store the counters as well.&lt;br /&gt;
&lt;br /&gt;
         $ iptables-save -c &amp;gt; iptables_store_w_cnts&lt;br /&gt;
&lt;br /&gt;
       To restore the file, use the following:&lt;br /&gt;
&lt;br /&gt;
         $ iptables-restore -c &amp;lt; iptables_store_w_cnts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 183:&lt;br /&gt;
&lt;br /&gt;
     mailstats - display mail statistics. This file reads data from &amp;quot;/var/log/mail/statistics&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         [root@closet ~]# mailstats&lt;br /&gt;
         Statistics from Sat Jun 25 15:59:52 2005&lt;br /&gt;
          M   msgsfr  bytes_from   msgsto    bytes_to  msgsrej msgsdis msgsqur  Mailer&lt;br /&gt;
          4        1          2K        0          0K        0       0       0  esmtp&lt;br /&gt;
          9        0          0K        1          2K        0       0       0  local&lt;br /&gt;
         =====================================================================&lt;br /&gt;
          T        1          2K        1          2K        0       0       0&lt;br /&gt;
          C        1                    0                    0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 184:&lt;br /&gt;
&lt;br /&gt;
     Profiling C Applications - Assume you have the following program p1.c:&lt;br /&gt;
&lt;br /&gt;
         /* Program  p1.c */&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
         t1(int i)&lt;br /&gt;
         {&lt;br /&gt;
                 printf(&amp;quot;t1:%d\n&amp;quot;, i);&lt;br /&gt;
         }&lt;br /&gt;
        &lt;br /&gt;
         t2(int j)&lt;br /&gt;
         {&lt;br /&gt;
                 printf(&amp;quot;t2:%d\n&amp;quot;, j);&lt;br /&gt;
         }&lt;br /&gt;
        &lt;br /&gt;
         int main(void)&lt;br /&gt;
         {&lt;br /&gt;
                 int i, j;&lt;br /&gt;
        &lt;br /&gt;
                 for (i = 0; i &amp;lt; 5; ++i) {&lt;br /&gt;
                         t1(i);&lt;br /&gt;
                         for (j = 0; j &amp;lt; 2; ++j) {&lt;br /&gt;
                                 t2(j);&lt;br /&gt;
                         }&lt;br /&gt;
                 }&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
     Compile the program as follows:&lt;br /&gt;
&lt;br /&gt;
        $ gcc -pg -g -o p1 p1.c&lt;br /&gt;
        $ ./p1&lt;br /&gt;
        t1:0&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:1&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:2&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:3&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:4&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
&lt;br /&gt;
     Next, to get the profile graph.&lt;br /&gt;
&lt;br /&gt;
        $ gprof -p -b p1&lt;br /&gt;
        Flat profile:&lt;br /&gt;
        &lt;br /&gt;
        Each sample counts as 0.01 seconds.&lt;br /&gt;
         no time accumulated&lt;br /&gt;
        &lt;br /&gt;
          %   cumulative   self              self     total&lt;br /&gt;
         time   seconds   seconds    calls  Ts/call  Ts/call  name&lt;br /&gt;
          0.00      0.00     0.00       10     0.00     0.00  t2&lt;br /&gt;
          0.00      0.00     0.00        5     0.00     0.00  t1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Above note the 10 calls to t2 and 5 calls to t1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 185:&lt;br /&gt;
&lt;br /&gt;
     CDPATH - this is a bash variable like PATH that defines a search path&lt;br /&gt;
              for the cd command.&lt;br /&gt;
&lt;br /&gt;
     Suppose you have the following directory structure:&lt;br /&gt;
&lt;br /&gt;
             /home/chirico/stuff&lt;br /&gt;
                               |-- dirA&lt;br /&gt;
                               `-- dirB&lt;br /&gt;
&lt;br /&gt;
     Assume you define CDPATH as follows:&lt;br /&gt;
&lt;br /&gt;
             CDPATH=/home/chirico/stuff&lt;br /&gt;
&lt;br /&gt;
     Now, no matter what directory you are in if you use the cd command below&lt;br /&gt;
     you will automatically move to &amp;quot;/home/chirico/stuff/dirA&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             $ cd dirA&lt;br /&gt;
&lt;br /&gt;
     Note you could be in &amp;quot;/etc&amp;quot; and will move directly to &amp;quot;/home/chirico/stuff/dirA&amp;quot;.&lt;br /&gt;
     This command has the same format as PATH - multiple entries are separated by a colon.&lt;br /&gt;
     If the current directory contain a sub-directory dirA, then, it gets priority.&lt;br /&gt;
&lt;br /&gt;
     The following is part of my .bash_profile&lt;br /&gt;
&lt;br /&gt;
             CDPATH=/work/cpearls/src/posted_on_sf/:/work/souptonuts/documentation/:/home/chirico/deleteme/&lt;br /&gt;
             export PATH CVS_RSH EDITOR JAVA_HOME CDPATH&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 186:&lt;br /&gt;
&lt;br /&gt;
     Groups - add groups and users to groups. The following shows how to create the group &amp;quot;share&amp;quot;&lt;br /&gt;
              and add the user &amp;quot;chirico&amp;quot; to this group. The following should be done as root, and&lt;br /&gt;
              assumes the account &amp;quot;chirico&amp;quot; already exits.&lt;br /&gt;
&lt;br /&gt;
             $ groupadd share&lt;br /&gt;
             $ usermod -G share chirico&lt;br /&gt;
&lt;br /&gt;
     Note the change made to &amp;quot;/etc/group&amp;quot; below:&lt;br /&gt;
&lt;br /&gt;
             $ cat /etc/group|grep 'share'&lt;br /&gt;
             share:x:616:chirico&lt;br /&gt;
&lt;br /&gt;
     If the user chirico is currently logged in, he should run the following&lt;br /&gt;
     command to immediately have group &amp;quot;share&amp;quot; rights. Or, the next time he logs&lt;br /&gt;
     in he will have access to this group.&lt;br /&gt;
&lt;br /&gt;
             $ newgrp share&lt;br /&gt;
&lt;br /&gt;
     Reference the following (TIP 6, TIP 167).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 187:&lt;br /&gt;
&lt;br /&gt;
     oprofile - steps for running oprofile on Fedora.&lt;br /&gt;
&lt;br /&gt;
     Step 1:&lt;br /&gt;
&lt;br /&gt;
       Find out what version of the kernel you are running.&lt;br /&gt;
&lt;br /&gt;
           $ uname -a&lt;br /&gt;
           Linux closet.squeezel.com 2.6.12-1.1398_FC4 #1 Fri Jul 15 00:52:32 EDT 2005 i686 i686 i386 GNU/Linux&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 2:&lt;br /&gt;
&lt;br /&gt;
       Download the source in a chosen directory. Above, I'm running 2.6.12-1, but I'm going to go for 2.6.12.3, since&lt;br /&gt;
       it's a little later. You want the signed file as well.&lt;br /&gt;
&lt;br /&gt;
           $ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.12.3.tar.gz&lt;br /&gt;
           $ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.12.3.tar.gz.sign&lt;br /&gt;
&lt;br /&gt;
       Now, check the signature.&lt;br /&gt;
&lt;br /&gt;
           $ gpg --verify linux-2.6.12.3.tar.gz.sign linux-2.6.12.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 3:&lt;br /&gt;
&lt;br /&gt;
       Unpack the file.&lt;br /&gt;
&lt;br /&gt;
           $ tar -xzf linux-2.6.12.3.tar.gz&lt;br /&gt;
           $ cd cd linux-2.6.12.3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 4:&lt;br /&gt;
&lt;br /&gt;
       Copy the &amp;quot;.config&amp;quot; used to compile your previous kernel. You should find it&lt;br /&gt;
       in the following direcotry &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       Copy it to the linux-2.6.12.3 directory.&lt;br /&gt;
&lt;br /&gt;
           $ cp &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot; .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 5:&lt;br /&gt;
&lt;br /&gt;
       Run make as follows. It will ask for a few questions on &amp;quot;make oldconfig&amp;quot;. The&lt;br /&gt;
       make installs below will have to be done with root privileges.&lt;br /&gt;
&lt;br /&gt;
          $ make oldconfig&lt;br /&gt;
          $ make bzImage&lt;br /&gt;
          $ make modules&lt;br /&gt;
          $ make modules_install&lt;br /&gt;
          $ make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 6:&lt;br /&gt;
&lt;br /&gt;
       Edit the &amp;quot;/boot/grub/grub.conf&amp;quot; and set default = 0  as shown below in this&lt;br /&gt;
       file.&lt;br /&gt;
&lt;br /&gt;
            default=0&lt;br /&gt;
            timeout=5&lt;br /&gt;
            splashimage=(hd0,2)/grub/splash.xpm.gz&lt;br /&gt;
            hiddenmenu&lt;br /&gt;
            title Fedora Core (2.6.12.3)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.12.3 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.12.3.img&lt;br /&gt;
            title Fedora Core (2.6.12-1.1398_FC4)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.12-1.1398_FC4 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.12-1.1398_FC4.img&lt;br /&gt;
            title Fedora Core (2.6.11-1.1369_FC4)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.11-1.1369_FC4 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.11-1.1369_FC4.img&lt;br /&gt;
            title Other&lt;br /&gt;
                    rootnoverify (hd0,1)&lt;br /&gt;
                    chainloader +1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 7:&lt;br /&gt;
&lt;br /&gt;
       Shutdown with the restart option.&lt;br /&gt;
&lt;br /&gt;
           $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 8:&lt;br /&gt;
&lt;br /&gt;
       Run opcontrol. The commands below are done as root.  My kernel was compiled in the following&lt;br /&gt;
       directory &amp;quot;/home/kernel/linux-2.6.12.3/&amp;quot;, so I'll run opcontrol as follows:&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --vmlinux=/home/kernel/linux-2.6.12.3/vmlinux&lt;br /&gt;
&lt;br /&gt;
       Now start.&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --start&lt;br /&gt;
           Using 2.6+ OProfile kernel interface.&lt;br /&gt;
           Reading module info.&lt;br /&gt;
           Using log file /var/lib/oprofile/oprofiled.log&lt;br /&gt;
           Daemon started.&lt;br /&gt;
           Profiler running.&lt;br /&gt;
&lt;br /&gt;
       Shutdown opcontrol.&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --shutdown&lt;br /&gt;
&lt;br /&gt;
       Run report.&lt;br /&gt;
&lt;br /&gt;
           $ opreport&lt;br /&gt;
&lt;br /&gt;
           CPU: CPU with timer interrupt, speed 0 MHz (estimated)&lt;br /&gt;
           Profiling through timer interrupt&lt;br /&gt;
                     TIMER:0|&lt;br /&gt;
             samples|      %|&lt;br /&gt;
           ------------------&lt;br /&gt;
              156088 99.8746 vmlinux&lt;br /&gt;
                  60  0.0384 libc-2.3.5.so&lt;br /&gt;
                  30  0.0192 oprofiled&lt;br /&gt;
                  23  0.0147 libcrypto.so.0.9.7f&lt;br /&gt;
                  13  0.0083 bash&lt;br /&gt;
                  12  0.0077 screen&lt;br /&gt;
                  10  0.0064 sshd&lt;br /&gt;
                   9  0.0058 ssh&lt;br /&gt;
                   6  0.0038 ip_tables&lt;br /&gt;
                   6  0.0038 libncurses.so.5.4&lt;br /&gt;
                   5  0.0032 b44&lt;br /&gt;
                   5  0.0032 ext3&lt;br /&gt;
                   5  0.0032 ld-2.3.5.so&lt;br /&gt;
                   4  0.0026 ip_conntrack&lt;br /&gt;
                   4  0.0026 jbd&lt;br /&gt;
                   2  0.0013 grep&lt;br /&gt;
                   1 6.4e-04 libdns.so.20.0.2&lt;br /&gt;
                   1 6.4e-04 libisc.so.9.1.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Reference the following for more documentation:&lt;br /&gt;
             http://oprofile.sourceforge.net/doc/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 188:&lt;br /&gt;
&lt;br /&gt;
     cyrus-imapd with Postfix using sasldb for authentication. For this example&lt;br /&gt;
     the server is tape.squeezel.com and the user is chirico.&lt;br /&gt;
&lt;br /&gt;
        Step 1:&lt;br /&gt;
        &lt;br /&gt;
                   $ yum install cyrus-imapd&lt;br /&gt;
                   $ yum install cyrus-imapd-utils&lt;br /&gt;
        &lt;br /&gt;
            You need &amp;quot;cyrus-imapd-utils&amp;quot; for cyradm.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 2:&lt;br /&gt;
        &lt;br /&gt;
          Edit /etc/imapd.conf&lt;br /&gt;
        &lt;br /&gt;
               configdirectory: /var/lib/imap&lt;br /&gt;
               partition-default: /var/spool/imap&lt;br /&gt;
               admins: cyrus&lt;br /&gt;
               sievedir: /var/lib/imap/sieve&lt;br /&gt;
               sendmail: /usr/sbin/sendmail&lt;br /&gt;
               hashimapspool: true&lt;br /&gt;
               # Chirico Commented the below line&lt;br /&gt;
               # sasl_pwcheck_method: saslauthd&lt;br /&gt;
               # Because using sasldb&lt;br /&gt;
               sasl_pwcheck_method: auxprop&lt;br /&gt;
               sasl_auxprop_plugin: sasldb&lt;br /&gt;
               #  Chirico end change&lt;br /&gt;
               sasl_mech_list: PLAIN&lt;br /&gt;
               tls_cert_file: /usr/share/ssl/certs/cyrus-imapd.pem&lt;br /&gt;
               tls_key_file: /usr/share/ssl/certs/cyrus-imapd.pem&lt;br /&gt;
               tls_ca_file: /usr/share/ssl/certs/ca-bundle.crt&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 3:&lt;br /&gt;
        &lt;br /&gt;
           Create a user and password:&lt;br /&gt;
        &lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` cyrus&lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` chirico&lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` allmail&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
           This will automatically create the file /etc/sasldb2. But look&lt;br /&gt;
           at the default rights, assuming you ran saslpasswd2 as root:&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /etc/sasldb2&lt;br /&gt;
                 -rw-r-----  1 root root 12288 Jul 31 09:50 /etc/sasldb2&lt;br /&gt;
        &lt;br /&gt;
           We need to correct this in step 4.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 4:&lt;br /&gt;
        &lt;br /&gt;
                 $ chown root.mail /etc/sasldb2&lt;br /&gt;
                 $ ls -l /etc/sasldb2&lt;br /&gt;
                 -rw-r-----  1 root mail 12288 Jul 31 09:50 /etc/sasldb2&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 5:&lt;br /&gt;
        &lt;br /&gt;
            Update &amp;quot;/etc/postfix/main.cf&amp;quot;. Note in /etc/imapd.conf the configdirectory&lt;br /&gt;
            points to /var/lib/imap, and if I look at this directory I see the&lt;br /&gt;
            socket directory. However, after staring /etc/init.d/cyrus-imapd  there&lt;br /&gt;
            will be a socket file &amp;quot;/var/lib/imap/socket/lmtp&amp;quot;. (See step 6).&lt;br /&gt;
        &lt;br /&gt;
                  mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp&lt;br /&gt;
                  mailbox_transport = cyrus&lt;br /&gt;
        &lt;br /&gt;
            Restart postfix.&lt;br /&gt;
        &lt;br /&gt;
                  /etc/init.d/postfix restart&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 6:&lt;br /&gt;
&lt;br /&gt;
            Start cyrus-imapd and look for the socket file.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
                   $ /etc/init.d/cyrus-imapd restart&lt;br /&gt;
                   Shutting down cyrus-imapd:                                 [  OK  ]&lt;br /&gt;
                   Starting cyrus-imapd: preparing databases... done.         [  OK  ]&lt;br /&gt;
        &lt;br /&gt;
            Now you should see the lmtp file:&lt;br /&gt;
        &lt;br /&gt;
                   $ ls -l /var/lib/imap/socket/lmtp&lt;br /&gt;
                   srwxrwxrwx  1 root root 0 Jul 31 10:04 /var/lib/imap/socket/lmtp&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 7:&lt;br /&gt;
        &lt;br /&gt;
            Add users. Note, you may have to go back to step 3 to add them to /etc/sasldb2&lt;br /&gt;
            as well.&lt;br /&gt;
        &lt;br /&gt;
                   $ su - cyrus&lt;br /&gt;
                   $ cyradm tape.squeezel.com&lt;br /&gt;
                   tape.squeezel.com&amp;gt; cm user.chirico&lt;br /&gt;
                   tape.squeezel.com&amp;gt; quit&lt;br /&gt;
        &lt;br /&gt;
            Now got back as root, and check that everything was created correctly.&lt;br /&gt;
        &lt;br /&gt;
                   $ ls /var/spool/imap/c/user/&lt;br /&gt;
                   total 8&lt;br /&gt;
                   drwx------  2 cyrus mail 4096 Jul 31 10:21 chirico&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 8:&lt;br /&gt;
        &lt;br /&gt;
             Run a mail test. We'll do this as root to the chirico account.&lt;br /&gt;
        &lt;br /&gt;
                   $ mail -s 'First test'  chirico&lt;br /&gt;
                   first test&lt;br /&gt;
                   .&lt;br /&gt;
        &lt;br /&gt;
             Now, still as root check the maillog. Normally everything should work.&lt;br /&gt;
        &lt;br /&gt;
                  $ tail /var/log/maillog&lt;br /&gt;
        &lt;br /&gt;
             However, I got the following error below.&lt;br /&gt;
&lt;br /&gt;
                     Jul 31 10:29:03 tape postfix/cleanup[30124]: AE7CB1B34A4: message-id=&amp;lt;20050731142903.AE7CB1B34A4@tape.squeezel.com&amp;gt;&lt;br /&gt;
                     Jul 31 10:29:03 tape postfix/qmgr[30120]: AE7CB1B34A4: from=&amp;lt;root@tape.squeezel.com&amp;gt;, size=315, nrcpt=1 (queue active)&lt;br /&gt;
                     Jul 31 10:29:03 tape pipe[30128]: fatal: pipe_comand: execvp /cyrus/bin/deliver: No such file or directory&lt;br /&gt;
&lt;br /&gt;
             If you get a similiar error, you may need to adjust the settting in /etc/postfix/master.cf&lt;br /&gt;
        &lt;br /&gt;
                 # This is the problem in /etc/postfix/master.cf&lt;br /&gt;
                 cyrus     unix  -       n       n       -       -       pipe&lt;br /&gt;
                   user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}&lt;br /&gt;
        &lt;br /&gt;
             My deliver file is the following&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
                 -rwxr-xr-x  1 root root 846228 Apr  4 18:59 /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
        &lt;br /&gt;
             So I need to change my /etc/postfix/master.cf as follows:&lt;br /&gt;
        &lt;br /&gt;
                 # Fix because by deliver file is under  /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
                 cyrus     unix  -       n       n       -       -       pipe&lt;br /&gt;
                   user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -r ${sender} -m ${extension} ${user}&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
             If changes were needed, like I had to do, restart postfix&lt;br /&gt;
        &lt;br /&gt;
                 $ /etc/init.d/postfix restart&lt;br /&gt;
        &lt;br /&gt;
             Now, if everything works, you should start to see numbers in the spool directory like &amp;quot;1.&amp;quot; and&lt;br /&gt;
             &amp;quot;2.&amp;quot;.&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /var/spool/imap/c/user/chirico/&lt;br /&gt;
                 total 40&lt;br /&gt;
                 -rw-------  1 cyrus mail  545 Jul 31 10:44 1.&lt;br /&gt;
                 -rw-------  1 cyrus mail  547 Jul 31 10:45 2.&lt;br /&gt;
                 -rw-------  1 cyrus mail 1276 Jul 31 10:45 cyrus.cache&lt;br /&gt;
                 -rw-------  1 cyrus mail  153 Jul 31 10:21 cyrus.header&lt;br /&gt;
                 -rw-------  1 cyrus mail  196 Jul 31 10:45 cyrus.index&lt;br /&gt;
&lt;br /&gt;
        Step 9:&lt;br /&gt;
        &lt;br /&gt;
             Local firewall.&lt;br /&gt;
        &lt;br /&gt;
                 # imap&lt;br /&gt;
                iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 143 -j ACCEPT&lt;br /&gt;
                iptables -A INPUT -p tcp -s 192.168.1.0/24  --dport 143 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        Step 10:&lt;br /&gt;
        &lt;br /&gt;
             Configure cyrus-imapd to start for run-level 3 and 5.&lt;br /&gt;
&lt;br /&gt;
                 # chkconfig --level 35 cyrus-imapd on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       HINTS - &lt;br /&gt;
&lt;br /&gt;
        Something to watch out for:&lt;br /&gt;
&lt;br /&gt;
              Something to watch out for: If a user creates a .forward file in their shell account with the&lt;br /&gt;
              following entry, then, mail will not get mail relayed to cyrus.&lt;br /&gt;
&lt;br /&gt;
                  &amp;quot;|exec /usr/bin/procmail&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             The /etc/maillog will show something like this:&lt;br /&gt;
&lt;br /&gt;
                    to=&amp;lt;chirico@squeezel.squeezel.com&amp;gt;, orig_to=&amp;lt;chirico&amp;gt;, relay=local, delay=0,&lt;br /&gt;
                          status=sent (delivered to command: exec /usr/bin/procmail)&lt;br /&gt;
&lt;br /&gt;
             Remove the &amp;quot;.forward&amp;quot; file from their home directory and you'll get the following:&lt;br /&gt;
&lt;br /&gt;
                    to=&amp;lt;chirico@squeezel.squeezel.com&amp;gt;, relay=cyrus, delay=0,&lt;br /&gt;
                          status=sent (squeezel.squeezel.com)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              mutt with IMAP?  (See TIP 190)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 189:&lt;br /&gt;
&lt;br /&gt;
     expand - convert tabs to spaces in a file.&lt;br /&gt;
&lt;br /&gt;
             $ expand How_to_Linux_and_Open_Source.txt &amp;gt; notabs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 190:&lt;br /&gt;
&lt;br /&gt;
     mutt with imap - assume you have setup imap (see tip 188). Now how do you configure&lt;br /&gt;
                      your &amp;quot;.muttrc&amp;quot; file to automatically connect, securely to the IMAP server?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       &lt;br /&gt;
     Below is an example of my &amp;quot;.muttrc&amp;quot; file. For this example, assume my password is &amp;quot;S0m3paSSw0r9&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             $ cat .muttrc&lt;br /&gt;
             set spoolfile = &amp;quot;imaps://chirico:S0m3paSSw0r9@squeezel.squeezel.com/&lt;br /&gt;
             set imap_force_ssl=yes&lt;br /&gt;
             set certificate_file=~/.mutt/certificates/72d31154.0&lt;br /&gt;
&lt;br /&gt;
     Now, you want to copy the certificate as a &amp;quot;file.pem&amp;quot; and run &amp;quot;c_rehash&amp;quot; to convert this&lt;br /&gt;
     file to a number. See the article. See the following article on how to do this under the &lt;br /&gt;
     fetchmail section.&lt;br /&gt;
&lt;br /&gt;
          http://souptonuts.sourceforge.net/postfix_tutorial.html&lt;br /&gt;
&lt;br /&gt;
     This is a quick summary of creating this key.&lt;br /&gt;
&lt;br /&gt;
             $ openssl s_client -connect squeezel.squeezel.com:995 -showcerts &amp;gt; file.pem&lt;br /&gt;
             $ c_rehash ~/.mutt/certificates&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 191:&lt;br /&gt;
&lt;br /&gt;
     Apache - CGI scripts.  There are two ways to enable CGI scripts. The second method is the&lt;br /&gt;
              prefered method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           First way, the easy way. Look for the &amp;quot;http.conf&amp;quot; file. On Fedora Core, this file can be&lt;br /&gt;
           found under &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;. Edit this file as follows to make &lt;br /&gt;
           &amp;quot;http://squeezel.squeezel.com/chirico-cgi/&amp;quot; execute scripts.&lt;br /&gt;
&lt;br /&gt;
                     ScriptAlias /chirico-cgi/ &amp;quot;/home/chirico/cgi-bin/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           Second way, the better way. Instead of doing the above, make the following change in &lt;br /&gt;
           &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                     &amp;lt;Directory /home/chirico/cgi-bin&amp;gt;&lt;br /&gt;
                      Options +ExecCGI&lt;br /&gt;
                      SetHandler chirico-cgi&lt;br /&gt;
                     &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Running a test script. Now copy the following test script into the directory &amp;quot;/home/chirico/cgi-bin&amp;quot;&lt;br /&gt;
        and change the rights to execute for the user running this.&lt;br /&gt;
&lt;br /&gt;
                  #!/bin/sh&lt;br /&gt;
                  # Save as test.cgi&lt;br /&gt;
                  #  chown apache.apache test.cgi&lt;br /&gt;
                  #  chmod 700 test.cgi&lt;br /&gt;
                  echo &amp;quot;Content-Type: text/html&amp;quot;&lt;br /&gt;
                  echo&lt;br /&gt;
                  echo &amp;quot;Hello world from user &amp;lt;b&amp;gt;`whoami`&amp;lt;/b&amp;gt;! &amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 192:&lt;br /&gt;
&lt;br /&gt;
     Bash - using getopts for your bash scripts.&lt;br /&gt;
&lt;br /&gt;
                   #!/bin/bash&lt;br /&gt;
                   while getopts &amp;quot;ab:cd:&amp;quot; Option&lt;br /&gt;
                   # b and d take arguments&lt;br /&gt;
                   #&lt;br /&gt;
                   do&lt;br /&gt;
                     case $Option in&lt;br /&gt;
                       a) echo -e &amp;quot;a = $OPTIND&amp;quot;;;&lt;br /&gt;
                       b) echo -e &amp;quot;b = $OPTIND $OPTARG&amp;quot;;;&lt;br /&gt;
                       c) echo -e &amp;quot;c = $OPTIND&amp;quot;;;&lt;br /&gt;
                       d) echo -e &amp;quot;d = $OPTIND $OPTARG&amp;quot;;;&lt;br /&gt;
                    esac&lt;br /&gt;
                  done&lt;br /&gt;
                  shift $(($OPTIND - 1))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 193:&lt;br /&gt;
&lt;br /&gt;
     Sieve - creating sieve recipes with &amp;quot;sieveshell&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     The following sieve script put all jefferson.edu mail into the &lt;br /&gt;
     folder jefferson. This assumes that I have already created the IMP &lt;br /&gt;
     directory, or mail box (INBOX.jefferson), which can be done in mutt &lt;br /&gt;
     with the &amp;quot;C&amp;quot; command. Below is an example of finding &amp;quot;jefferson.edu&amp;quot;&lt;br /&gt;
     anywhere in the header. &lt;br /&gt;
&lt;br /&gt;
         # This is a file named jefferson.siv&lt;br /&gt;
         require [&amp;quot;fileinto&amp;quot;];&lt;br /&gt;
         if header :contains &amp;quot;Received&amp;quot; &amp;quot;from jefferson.edu&amp;quot; {&lt;br /&gt;
           fileinto &amp;quot;INBOX.jefferson&amp;quot;;&lt;br /&gt;
           stop;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
     Now, from the command propt execute &amp;quot;sieveshell&amp;quot; with the hostname of the&lt;br /&gt;
     imap server. My server is squeezel.squeezel.com, so I would execute the &lt;br /&gt;
     following:&lt;br /&gt;
&lt;br /&gt;
          $ sieveshell squeezel.squeezel.com&lt;br /&gt;
          connecting to squeezel.squeezel.com&lt;br /&gt;
          Please enter your password:****&lt;br /&gt;
          &amp;gt; put jefferson.siv&lt;br /&gt;
          &amp;gt; activate jefferson.siv&lt;br /&gt;
          &amp;gt; list&lt;br /&gt;
          jefferson.siv  &amp;lt;- active script&lt;br /&gt;
          &amp;gt; quit&lt;br /&gt;
&lt;br /&gt;
     Note the put brings in the script. And you need to activiate it.&lt;br /&gt;
&lt;br /&gt;
     You can activate a sieve script for any user on your system if you are&lt;br /&gt;
     root. This is an example of activating a script for user chirico. Assume&lt;br /&gt;
     below the root prompt is &amp;quot;#&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          # sieveshell -a chirico -u chirico squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
     You can also automate everything from a bash script. But note after&lt;br /&gt;
     the -e the commands, and not a file with the commands, follows within&lt;br /&gt;
     quotes. This is the script I use for my home system.&lt;br /&gt;
&lt;br /&gt;
         #!/bin/bash&lt;br /&gt;
         sieveshell -a chirico -u chirico -e 'deactivate&lt;br /&gt;
         delete chirico.siv&lt;br /&gt;
         put chirico.siv&lt;br /&gt;
         activate chirico.siv&lt;br /&gt;
         list&lt;br /&gt;
         '  squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     References:&lt;br /&gt;
         http://wiki.fastmail.fm/index.php/SieveRecipes&lt;br /&gt;
         http://www.cyrusoft.com/sieve/#documents&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 194:&lt;br /&gt;
&lt;br /&gt;
     emacs - editing files remotely with tramp. Tramp comes with the latest version of emacs.&lt;br /&gt;
             That means if you're using Fedora core 4, with emacs, you have tramp. This is &lt;br /&gt;
             ideal for editing files on remote computers that do not use emacs.&lt;br /&gt;
&lt;br /&gt;
             Edit the &amp;quot;.emacs&amp;quot; file and add the following line:&lt;br /&gt;
&lt;br /&gt;
                 (require 'tramp)&lt;br /&gt;
                 (setq tramp-default-method &amp;quot;scp&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
             Now, to edit a file on computer tape.squeezel.com (C-x, C-f) and&lt;br /&gt;
             enter the following in Find file:&lt;br /&gt;
&lt;br /&gt;
                 Find file:/chirico@tape.squeezel.com:test.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             References:&lt;br /&gt;
&lt;br /&gt;
                    http://savannah.gnu.org/projects/tramp/&lt;br /&gt;
&lt;br /&gt;
             &lt;br /&gt;
&lt;br /&gt;
TIP 195:&lt;br /&gt;
&lt;br /&gt;
     trusted X11 forwarding - running gnome and KDE both on one screen, at the same&lt;br /&gt;
             time securely. The following assumes gnome is running on the current&lt;br /&gt;
             computer and &amp;quot;closet.squeezel.com&amp;quot; has KDE&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y  closet.squeezel.com&lt;br /&gt;
              $ startkde&lt;br /&gt;
&lt;br /&gt;
          Or assume you want to run gnome on &amp;quot;closet.squeezel.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y  closet.squeezel.com&lt;br /&gt;
              $ gnome-session&lt;br /&gt;
&lt;br /&gt;
          By default Fedora Core allows ForwardX11 over ssh. Note you want to use&lt;br /&gt;
          the -Y option above and NOT -X. &lt;br /&gt;
&lt;br /&gt;
          Suppose you want a remote &amp;quot;gnome-session&amp;quot; on ctl-alt-F12. Below is an &lt;br /&gt;
          example of getting the remote computer closet.squeezel.com, and you&lt;br /&gt;
          can still have the above configuration.&lt;br /&gt;
&lt;br /&gt;
          First you must allow magic cookies for each server connection.&lt;br /&gt;
             &lt;br /&gt;
              $ MCOOKIE=$(mcookie)&lt;br /&gt;
              $ xauth add $(hostname)/unix:1 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
              $ xauth add localhost/unix:1 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
  &lt;br /&gt;
          Again, note that you have to add this for EACH connection. So if you wanted 2 as well&lt;br /&gt;
&lt;br /&gt;
              $ MCOOKIE=$(mcookie)&lt;br /&gt;
              $ xauth add $(hostname)/unix:2 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
              $ xauth add localhost/unix:2 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
&lt;br /&gt;
          On squeezel.squeezel.com create a new xterm. If :1 is take below&lt;br /&gt;
          try :2. The vt12 is for switching to ctl-alt-F12.&lt;br /&gt;
&lt;br /&gt;
              $ xinit -- :1 vt12&lt;br /&gt;
&lt;br /&gt;
          Note, if you do not add the above cookies, you will get the follow error:&lt;br /&gt;
         &lt;br /&gt;
               Xlib: connection to &amp;quot;:1.0&amp;quot; refused by server&lt;br /&gt;
               Xlib: No protocol specified&lt;br /&gt;
&lt;br /&gt;
          The screen may be hard to read. At this point ssh -Y to the remote computer.&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y closet.squeezel.com&lt;br /&gt;
              $ gnome-session&lt;br /&gt;
&lt;br /&gt;
          Yes, you will get errors about sound and some custom drivers is the remove &lt;br /&gt;
          computer has different hardware. After is loads, you can switch back and&lt;br /&gt;
          forth between session with (ctl-alt-F12)  and (ctl-alt-F7)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 196:&lt;br /&gt;
&lt;br /&gt;
     Suspend ssh session - you have just sshed into a computer &amp;quot;ssh -l user example.com&amp;quot;, and you&lt;br /&gt;
          want to get back to the terminal prompt of the computer you started with. Escapte, by &lt;br /&gt;
          default with ssh is &amp;quot;~&amp;quot;, so enter &amp;quot;~&amp;quot; followed by &amp;quot;ctl-z&amp;quot; to suspend.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 197:&lt;br /&gt;
&lt;br /&gt;
     Quick way to send a text file &lt;br /&gt;
&lt;br /&gt;
              $ sendmail -f mike.chirico@gmail.com mchirico@comcast.net &amp;lt; /etc/fstab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 198:&lt;br /&gt;
&lt;br /&gt;
     size - determining the size of the text segment, data segment, and &amp;quot;bss&amp;quot; or uninitialized data segment.&lt;br /&gt;
&lt;br /&gt;
              $ size /bin/sh /bin/bash&lt;br /&gt;
               text        data     bss     dec     hex filename&lt;br /&gt;
              586946      22444   18784  628174   995ce /bin/sh&lt;br /&gt;
              586946      22444   18784  628174   995ce /bin/bash&lt;br /&gt;
&lt;br /&gt;
          Note above that &amp;quot;/bin/sh&amp;quot; and &amp;quot;/bin/bash&amp;quot; have equal text,data and bss numbers. It's&lt;br /&gt;
          highly likely that these are the same programs.&lt;br /&gt;
&lt;br /&gt;
              $ ls -l /bin/sh&lt;br /&gt;
               lrwxrwxrwx  1 root root 4 Jan 14  2005 /bin/sh -&amp;gt; bash&lt;br /&gt;
&lt;br /&gt;
          Yep, it's the same program. Here's a further definition of each segment.&lt;br /&gt;
&lt;br /&gt;
              Text segment: The machine instructions that the CPU executes. This is usually&lt;br /&gt;
                            read only and sharable.&lt;br /&gt;
&lt;br /&gt;
              Data segment: Contains initialized variables in a program. You also know these&lt;br /&gt;
                            as declarations and definitions.&lt;br /&gt;
&lt;br /&gt;
                               int max = 200;&lt;br /&gt;
&lt;br /&gt;
              Uninitialized data segment: Think of this as a declaration only, or data that&lt;br /&gt;
                            is only initialized by the kernel to arithmetic 0 or null pointers&lt;br /&gt;
                            before program execution.&lt;br /&gt;
&lt;br /&gt;
                               char s[10];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 199:&lt;br /&gt;
&lt;br /&gt;
     Using the at command.&lt;br /&gt;
&lt;br /&gt;
       Below is a simple example if running the ls command at 11:42am that&lt;br /&gt;
       will send mail -m to the user that executed it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       We'll execute job1 defined as follows and set to be executable. &lt;br /&gt;
&lt;br /&gt;
           $ cat ./job1&lt;br /&gt;
           #!/bin/bash&lt;br /&gt;
           date &amp;gt;&amp;gt; /tmp/job1&lt;br /&gt;
&lt;br /&gt;
       The at command is listed below. For queue &amp;quot;-q&amp;quot; names you can only&lt;br /&gt;
       specify one letter. Here we're using x. The letter determines the&lt;br /&gt;
       priority with &amp;quot;a&amp;quot; the highest.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x  -f ./job1 -m  11:54am&lt;br /&gt;
           job 3 at 2005-10-04 11:54&lt;br /&gt;
&lt;br /&gt;
       Now, if you execute the atq command, you'll get the following.&lt;br /&gt;
&lt;br /&gt;
           $ atq&lt;br /&gt;
           3       2005-10-04 11:54 x chirico&lt;br /&gt;
&lt;br /&gt;
       It's also possible to execute jobs at the command line entering&lt;br /&gt;
       a ctl-d at the end of the input.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x  -m 12:08pm&lt;br /&gt;
           at&amp;gt; ls -l&lt;br /&gt;
           at&amp;gt; who&lt;br /&gt;
           at&amp;gt; date&lt;br /&gt;
           at&amp;gt; ^D&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Or for a job to execute 1 minute from now.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x -m `date -d '1 minute' +&amp;quot;%H:%M&amp;quot;`&lt;br /&gt;
           at&amp;gt; ls -l&lt;br /&gt;
           at&amp;gt; date&lt;br /&gt;
     &lt;br /&gt;
&lt;br /&gt;
     Important points: The atd daemon must be running. To check if&lt;br /&gt;
      it's running do the following:&lt;br /&gt;
&lt;br /&gt;
            $ /etc/init.d/atd status&lt;br /&gt;
&lt;br /&gt;
      Also, if there is an /etc/at.allow file, then only users in that&lt;br /&gt;
      file will be allowed to execute at.&lt;br /&gt;
&lt;br /&gt;
      If /etc/at.deny exists but is empty and there is no /etc/at.allow,&lt;br /&gt;
      then, everyone can execute the at command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 200:&lt;br /&gt;
&lt;br /&gt;
     lsusb - command will display all USB buses and all devices connected.&lt;br /&gt;
&lt;br /&gt;
        $ lsusb&lt;br /&gt;
        Bus 005 Device 003: ID 413c:2010 Dell Computer Corp.&lt;br /&gt;
        Bus 005 Device 002: ID 413c:1003 Dell Computer Corp.&lt;br /&gt;
        Bus 005 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 004 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 003 Device 003: ID 0fc5:1227 Delcom Engineering&lt;br /&gt;
        Bus 003 Device 002: ID 046d:c016 Logitech, Inc. Optical Mouse&lt;br /&gt;
        Bus 003 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 002 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 001 Device 001: ID 0000:0000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 201:&lt;br /&gt;
&lt;br /&gt;
     Memory fragmentation - if you suspect workload memory fragmentation issues&lt;br /&gt;
     and you want to monitor the current state of you system, then, consider&lt;br /&gt;
     looking at the output from /proc/buddyinfo on recent kernels.&lt;br /&gt;
&lt;br /&gt;
        $ cat /proc/buddyinfo&lt;br /&gt;
      Node 0, zone      DMA    541    218     42      2      0      0      0      1      1      1      0 &lt;br /&gt;
      Node 0, zone   Normal   2508   2614     52      1      5      5      0      1      1      1      0 &lt;br /&gt;
      Node 0, zone  HighMem      0      1      3      0      1      0      0      0      0      0      0 &lt;br /&gt;
&lt;br /&gt;
     The following definition is taken from  ./Documentation/filesystems/proc.txt in the &lt;br /&gt;
     Linux kernel source.&lt;br /&gt;
&lt;br /&gt;
       Each column represents the number of pages of a certain order which are&lt;br /&gt;
       available.  In this case, there are 0 chunks of 2^0*PAGE_SIZE available in&lt;br /&gt;
       ZONE_DMA, 4 chunks of 2^1*PAGE_SIZE in ZONE_DMA, 101 chunks of 2^4*PAGE_SIZE&lt;br /&gt;
       available in ZONE_NORMAL, etc...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 202:&lt;br /&gt;
&lt;br /&gt;
     arp - Linux ARP kernel moduel.  This command implements the Address Resolution Protocol.&lt;br /&gt;
&lt;br /&gt;
     This is an example of the command.&lt;br /&gt;
&lt;br /&gt;
        $ arp&lt;br /&gt;
        Address                  HWtype  HWaddress           Flags Mask            Iface&lt;br /&gt;
        tape.squeezel.com        ether   00:50:DA:60:5B:AD   C                     eth0&lt;br /&gt;
        squeezel.squeezel.com    ether   00:11:11:8A:BE:3F   C                     eth0&lt;br /&gt;
        gw.squeezel.com          ether   00:0F:66:47:15:73   C                     eth0&lt;br /&gt;
&lt;br /&gt;
       &lt;br /&gt;
TIP 203:&lt;br /&gt;
&lt;br /&gt;
     dbench - performance monitoring. &lt;br /&gt;
&lt;br /&gt;
     So, how does your system react when the load average is above 600. Have you even seen a &lt;br /&gt;
     computer with a load average of 600? Well, this could be your chance. &lt;br /&gt;
&lt;br /&gt;
         Reference: http://freshmeat.net/projects/dbench/&lt;br /&gt;
&lt;br /&gt;
     The following gives a load average of 10 on my system.&lt;br /&gt;
&lt;br /&gt;
        $ dbench 34&lt;br /&gt;
&lt;br /&gt;
     If you want a higher load, just increase the number.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 204:&lt;br /&gt;
&lt;br /&gt;
     /etc guide - a listing of common files in the /etc directory.&lt;br /&gt;
&lt;br /&gt;
        /etc/exports: this file is used to configure NFS.&lt;br /&gt;
&lt;br /&gt;
        /etc/ftpusers: the users on your system who are restricted from FTP login.&lt;br /&gt;
&lt;br /&gt;
        /etc/motd: message of the day, which users see after login.&lt;br /&gt;
&lt;br /&gt;
        /etc/named.conf: DNS config file.&lt;br /&gt;
&lt;br /&gt;
        /etc/profile: common user information.&lt;br /&gt;
&lt;br /&gt;
        /etc/inittab: this file contains runlevel start information.&lt;br /&gt;
&lt;br /&gt;
        /etc/services: the services and their respective ports.&lt;br /&gt;
&lt;br /&gt;
        /etc/shells: this contains the names of all shells installed on the system.&lt;br /&gt;
&lt;br /&gt;
        /etc/passwd: this file contains user information.&lt;br /&gt;
&lt;br /&gt;
        /etc/group: security group rights.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
TIP 205: &lt;br /&gt;
&lt;br /&gt;
     logger - is a bash command utility for writing to /var/log/messages or the&lt;br /&gt;
            other files defined in /etc/syslog.conf.&lt;br /&gt;
&lt;br /&gt;
            $ logger -t TEST more of a test here&lt;br /&gt;
&lt;br /&gt;
         This is what shows up in /var/log/messages&lt;br /&gt;
  &lt;br /&gt;
            Oct 28 07:15:50 squeezel TEST: more of a test here&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
TIP 206: &lt;br /&gt;
&lt;br /&gt;
     accton, lastcomm - accouting on and last command. This is &lt;br /&gt;
         a way to monitor users on your system. As root, you &lt;br /&gt;
         would implement this as follows:&lt;br /&gt;
&lt;br /&gt;
           $ accton -h&lt;br /&gt;
            Usage: accton [-hV] [file]&lt;br /&gt;
            [--help] [--version]&lt;br /&gt;
&lt;br /&gt;
            The system's default process accounting file is /var/account/pacct.&lt;br /&gt;
&lt;br /&gt;
         Note the default file location is /var/account/pacct so we'll turn&lt;br /&gt;
         it on system wide with the following command.&lt;br /&gt;
&lt;br /&gt;
           $ accton /var/account/pacct&lt;br /&gt;
&lt;br /&gt;
         Now take a look at this file. It will grow. To see command that&lt;br /&gt;
         are executed, use the lastcomm command.&lt;br /&gt;
&lt;br /&gt;
           $ lastcomm&lt;br /&gt;
&lt;br /&gt;
         The above command gives output for all users. To get the data&lt;br /&gt;
         for user &amp;quot;chirico&amp;quot; execute the following command:&lt;br /&gt;
&lt;br /&gt;
           $ lastcomm --user chirico&lt;br /&gt;
&lt;br /&gt;
         You can also get a summary of commands with sa.&lt;br /&gt;
&lt;br /&gt;
           [chirico@big ~]$ sa&lt;br /&gt;
           30       5.23re       0.00cp    10185k&lt;br /&gt;
           11       4.83re       0.00cp     8961k   ***other&lt;br /&gt;
            8       0.13re       0.00cp    19744k   nagios*&lt;br /&gt;
            4       0.00re       0.00cp     2542k   automount*&lt;br /&gt;
            3       0.00re       0.00cp      680k   sa&lt;br /&gt;
            2       0.13re       0.00cp    17424k   check_ping&lt;br /&gt;
            2       0.13re       0.00cp      978k   ping&lt;br /&gt;
&lt;br /&gt;
         To turn off accounting, execute accton without a filename.&lt;br /&gt;
&lt;br /&gt;
           $ accton&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 207:&lt;br /&gt;
&lt;br /&gt;
     CPU Temperature on a laptop. The following is the temperature&lt;br /&gt;
       of my Dell laptop. &lt;br /&gt;
&lt;br /&gt;
           $ cat /proc/acpi/thermal_zone/THM/temperature&lt;br /&gt;
           temperature:             58 C&lt;br /&gt;
&lt;br /&gt;
      &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 208:&lt;br /&gt;
&lt;br /&gt;
     script -f with mkfifo to allow another user to view what you type&lt;br /&gt;
          in real-time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Step 1.  Create a fifo (first in first out) file that the other&lt;br /&gt;
              user can view. For this example create the file /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
               [chirico@laptop ~]$ mkfifo /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
        Step 2.  Have the second user, voyeur user, cat this file. Output will block&lt;br /&gt;
              for them until you complete step 3. The other user, voyer,&lt;br /&gt;
              is executing the command below.&lt;br /&gt;
 &lt;br /&gt;
               [voyeur@laptop ~]$ cat /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
        Step 3.  The original user runs the following command.&lt;br /&gt;
&lt;br /&gt;
               [chirico@laptop ~]$ script -f  /tmp/scriptout&lt;br /&gt;
               Script started, file is /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
             Now anything typed, including a vi session, will be displayed to the&lt;br /&gt;
             voyeur user in step 2. &lt;br /&gt;
&lt;br /&gt;
        See TIP 46.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 209:&lt;br /&gt;
&lt;br /&gt;
     fsck forced on next reboot.  To do this, as root issue the following commands.&lt;br /&gt;
&lt;br /&gt;
            $ cd /&lt;br /&gt;
            $ touch forcefsck&lt;br /&gt;
&lt;br /&gt;
          Now reboot the system, and when it comes up fsck will be forced on the system.&lt;br /&gt;
&lt;br /&gt;
            $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 210:&lt;br /&gt;
&lt;br /&gt;
     /dev/random and /dev/urandom differ in their random generating properties. /dev/random&lt;br /&gt;
        only returns bytes when enough noise has been generated from the entropy pool. In&lt;br /&gt;
        contrast /dev/urandom will always return bytes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference: http://sourceforge.net/direct-dl/mchirico/cpearls/simple_but_common.tar.gz (rand.c)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 211:&lt;br /&gt;
&lt;br /&gt;
     Want to find out the speed of your NIC?  (Full Duplex or Half), then use ethtool.&lt;br /&gt;
&lt;br /&gt;
               [root@squeezel ~]# ethtool eth0&lt;br /&gt;
               Settings for eth0:&lt;br /&gt;
                       Supported ports: [ MII ]&lt;br /&gt;
                       Supported link modes:   10baseT/Half 10baseT/Full&lt;br /&gt;
                                               100baseT/Half 100baseT/Full&lt;br /&gt;
                                               1000baseT/Half 1000baseT/Full&lt;br /&gt;
                       Supports auto-negotiation: Yes&lt;br /&gt;
                       Advertised link modes:  10baseT/Half 10baseT/Full&lt;br /&gt;
                                               100baseT/Half 100baseT/Full&lt;br /&gt;
                                               1000baseT/Half 1000baseT/Full&lt;br /&gt;
                       Advertised auto-negotiation: Yes&lt;br /&gt;
                       Speed: 100Mb/s&lt;br /&gt;
                       Duplex: Full&lt;br /&gt;
                       Port: Twisted Pair&lt;br /&gt;
                       PHYAD: 1&lt;br /&gt;
                       Transceiver: internal&lt;br /&gt;
                       Auto-negotiation: on&lt;br /&gt;
                       Supports Wake-on: g&lt;br /&gt;
                       Wake-on: d&lt;br /&gt;
                       Current message level: 0x000000ff (255)&lt;br /&gt;
                       Link detected: yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 212:&lt;br /&gt;
&lt;br /&gt;
     rpm install hang? You might need to delete the lock state information. &lt;br /&gt;
&lt;br /&gt;
        $ nl /etc/rc.d/rc.sysinit | grep rpm&lt;br /&gt;
        720   rm -f /var/lib/rpm/__db* &amp;amp;&amp;gt; /dev/null&lt;br /&gt;
&lt;br /&gt;
     Note the command &lt;br /&gt;
&lt;br /&gt;
        $ rm -f /var/lib/rpm/__db*&lt;br /&gt;
&lt;br /&gt;
     Because sometimes you will run &amp;quot;rpm -ivh somerpm&amp;quot; and it will just sit&lt;br /&gt;
     there.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 213:&lt;br /&gt;
&lt;br /&gt;
     Apache - limit access to certain directories based on IP address in the&lt;br /&gt;
         httpd.conf file.&lt;br /&gt;
&lt;br /&gt;
          You can do this completely from /etc/httpd/conf/httpd.conf which&lt;br /&gt;
          are shown below for multiple IP addresses. Note that all 3 setting&lt;br /&gt;
          are the same.&lt;br /&gt;
&lt;br /&gt;
                10.0.0.0/255.0.0.0&lt;br /&gt;
                10.0.0.0/8&lt;br /&gt;
                10&lt;br /&gt;
&lt;br /&gt;
          However, the following is different&lt;br /&gt;
&lt;br /&gt;
                10.0.0.0/24   only allows 10.0.0.1 to 10.0.0.254&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Some complete settings in /etc/httpd/conf/httpd.conf &lt;br /&gt;
&lt;br /&gt;
             &amp;lt;Directory /var/www/html/chirico/&amp;gt;&lt;br /&gt;
                 Order allow,deny&lt;br /&gt;
                 Allow from 10.0.0.0/8      # All 10.&lt;br /&gt;
                 Allow from 192.168.0.0/16  # All 192.168&lt;br /&gt;
                 Allow from 127             # All 127.&lt;br /&gt;
             &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          Don't forget to reload httpd with the following command.&lt;br /&gt;
        &lt;br /&gt;
             $ /etc/init.d/httpd reload&lt;br /&gt;
&lt;br /&gt;
          &lt;br /&gt;
&lt;br /&gt;
TIP 214:&lt;br /&gt;
&lt;br /&gt;
     Open Files - determining how many files are currently open.&lt;br /&gt;
&lt;br /&gt;
             $ cat /proc/sys/fs/file-nr&lt;br /&gt;
             2030    263     104851&lt;br /&gt;
              |       |        \- maximum open file descriptors &lt;br /&gt;
              |       |         &lt;br /&gt;
              |       \- total free allocated file descriptors&lt;br /&gt;
              |&lt;br /&gt;
              (Total allocated file descriptors since boot)&lt;br /&gt;
&lt;br /&gt;
        Note the maximum number can be set or changed.&lt;br /&gt;
&lt;br /&gt;
              $ cat /proc/sys/fs/file-max&lt;br /&gt;
              104851&lt;br /&gt;
&lt;br /&gt;
        To change this&lt;br /&gt;
&lt;br /&gt;
              $ echo &amp;quot;804854&amp;quot; &amp;gt; /proc/sys/fs/file-max&lt;br /&gt;
 &lt;br /&gt;
        Note lsof | wc -l will report higher numbers because this includes&lt;br /&gt;
        open files that are not using file descriptors such as directories,&lt;br /&gt;
        memory mapped files, and executable text files.&lt;br /&gt;
&lt;br /&gt;
        (Reference http://www.netadmintools.com/art295.html&lt;br /&gt;
         and also see the man page for this: man 5 proc )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 215:&lt;br /&gt;
&lt;br /&gt;
     Ctrl-Alt-Del will cause an immediate reboot, without syncing dirty buffers by&lt;br /&gt;
     setting the value &amp;gt; 0 in /proc/sys/kernel/ctrl-alt-del.&lt;br /&gt;
&lt;br /&gt;
               $ echo 1 &amp;gt; /proc/sys/kernel/ctrl-alt-del&lt;br /&gt;
       &lt;br /&gt;
&lt;br /&gt;
        (Reference: man 5 proc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 216:&lt;br /&gt;
&lt;br /&gt;
     Redefining keys in X using xev and xmodmap.  The program xev, used in an X window &lt;br /&gt;
     terminal screen will display information on mouse movements, keys pressed and &lt;br /&gt;
     released.&lt;br /&gt;
&lt;br /&gt;
        $ xev&lt;br /&gt;
&lt;br /&gt;
     Now type shift-4 and you'll notice the event details below:&lt;br /&gt;
&lt;br /&gt;
        KeyPress event, serial 29, synthetic NO, window 0x3800001,&lt;br /&gt;
            root 0x60, subw 0x0, time 55307049, (418,242), root:(428,339),&lt;br /&gt;
            state 0x1, keycode 13 (keysym 0x24, dollar), same_screen YES,&lt;br /&gt;
            XLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
            XmbLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
            XFilterEvent returns: False&lt;br /&gt;
        &lt;br /&gt;
        KeyRelease event, serial 29, synthetic NO, window 0x3800001,&lt;br /&gt;
            root 0x60, subw 0x0, time 55307184, (418,242), root:(428,339),&lt;br /&gt;
            state 0x1, keycode 13 (keysym 0x24, dollar), same_screen YES,&lt;br /&gt;
            XLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
       &lt;br /&gt;
     So, if you want to redefine this key to say copyright, see (/usr/X11R6/include/X11/keysymdef.h)&lt;br /&gt;
     you would type the following.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 copyright'&lt;br /&gt;
&lt;br /&gt;
     To get the key back to the dollar, issue the following command.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 dollar'&lt;br /&gt;
&lt;br /&gt;
     By the way it's possible to define multiple key codes for a sigle key. You'll need&lt;br /&gt;
     to have a key defined as the Mode_switch. Perhaps you'd like to use the Windows key,&lt;br /&gt;
     or the key with the Microsoft logo on it, since you're using Linux. This key is&lt;br /&gt;
     keycode 115&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 115 = Mode_switch'&lt;br /&gt;
&lt;br /&gt;
     Now you could define 3 values to the shift-4. For this example use ld, Yen and dollar.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 dollar sterling yen'&lt;br /&gt;
&lt;br /&gt;
     So pressing the keys gives you the following:&lt;br /&gt;
&lt;br /&gt;
          shift-$          (dollar sign)&lt;br /&gt;
          Windows-$        (lb sign)&lt;br /&gt;
          Windows-shift-$  (Yen sign)&lt;br /&gt;
&lt;br /&gt;
     You could go crazy and redefine all you keys.&lt;br /&gt;
&lt;br /&gt;
     (Thanks to hisham for this tip).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 217:&lt;br /&gt;
&lt;br /&gt;
     Threads - which version of threads are you using?&lt;br /&gt;
&lt;br /&gt;
          $ getconf GNU_LIBPTHREAD_VERSION&lt;br /&gt;
          NPTL 2.3.90&lt;br /&gt;
&lt;br /&gt;
     For a history on threads used with gcc reference the following:&lt;br /&gt;
          &lt;br /&gt;
          http://en.wikipedia.org/wiki/NPTL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 218:&lt;br /&gt;
&lt;br /&gt;
     Screenshots using ImageMagick. &lt;br /&gt;
&lt;br /&gt;
        If you want the entire screen, execute the following:&lt;br /&gt;
&lt;br /&gt;
            $ import -window root screen.png&lt;br /&gt;
&lt;br /&gt;
        Or to crosshair select the region with your mouse, execute &lt;br /&gt;
        the following instead.&lt;br /&gt;
&lt;br /&gt;
            $ import screen.png&lt;br /&gt;
&lt;br /&gt;
        KDE has the ability to take screenshots with the command below.&lt;br /&gt;
&lt;br /&gt;
            $ ksnapshot&lt;br /&gt;
&lt;br /&gt;
        GNOME likewise has a command too.&lt;br /&gt;
&lt;br /&gt;
            $ gnome-panel-screenshot --delay 6&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Visting ImageMagick again, the xwininfo command give window information and the id can be&lt;br /&gt;
        used to capture images with the import command.&lt;br /&gt;
&lt;br /&gt;
            $ xwininfo&lt;br /&gt;
&lt;br /&gt;
          xwininfo: Please select the window about which you&lt;br /&gt;
          would like information by clicking the&lt;br /&gt;
          mouse in that window.&lt;br /&gt;
&lt;br /&gt;
          xwininfo: Window id: 0x1e00007 &amp;quot;chirico@squeezel:/work/svn/souptonuts - Shell - Konsole&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          Absolute upper-left X:  4&lt;br /&gt;
          Absolute upper-left Y:  21&lt;br /&gt;
          Relative upper-left X:  0&lt;br /&gt;
          Relative upper-left Y:  0&lt;br /&gt;
          Width: 880&lt;br /&gt;
          Height: 510&lt;br /&gt;
          Depth: 24&lt;br /&gt;
          Visual Class: TrueColor&lt;br /&gt;
          Border width: 0&lt;br /&gt;
          Class: InputOutput&lt;br /&gt;
          Colormap: 0x20 (installed)&lt;br /&gt;
          Bit Gravity State: NorthWestGravity&lt;br /&gt;
          Window Gravity State: NorthWestGravity&lt;br /&gt;
          Backing Store State: NotUseful&lt;br /&gt;
          Save Under State: no&lt;br /&gt;
          Map State: IsViewable&lt;br /&gt;
          Override Redirect State: no&lt;br /&gt;
          Corners:  +4+21  -396+21  -396-493  +4-493&lt;br /&gt;
          -geometry 880x510+0+0&lt;br /&gt;
&lt;br /&gt;
        Now use the import command with the Window id. My example is shown below.&lt;br /&gt;
&lt;br /&gt;
             $ import -window 0x1e00007  id.miff&lt;br /&gt;
&lt;br /&gt;
        And to quickly display this image that you just saved, use the display command.&lt;br /&gt;
&lt;br /&gt;
             $ display id.miff &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 219:&lt;br /&gt;
&lt;br /&gt;
     File Access over SSH using FUSE (Filesystem in USErspace). This is a very good way to &lt;br /&gt;
     mount a remote filesystem locally. It's  like a secure NFS mount, but you don't require &lt;br /&gt;
     admin privileges on the remote computer. You do need to have fuse-sshfs installed on &lt;br /&gt;
     the local computer that will perform the filesystem mount.&lt;br /&gt;
&lt;br /&gt;
     The following works with Fedora Core 5. Only the users added to the fuse group can mout &lt;br /&gt;
     external drives. Below the user chirico is being added to the group fuse.&lt;br /&gt;
&lt;br /&gt;
             $ yum install fuse-sshfs&lt;br /&gt;
             $ usermod -a -G fuse chirico&lt;br /&gt;
     &lt;br /&gt;
     You'll need to reboot.&lt;br /&gt;
&lt;br /&gt;
             $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
             &lt;br /&gt;
     Next I'm going to mount the remote filesystem v0.squeezel.com. This is done as user chirico&lt;br /&gt;
     on the local computer. I'm using root on the remote computer v0.squeezel.com because I&lt;br /&gt;
     want to mount the complete drive.&lt;br /&gt;
&lt;br /&gt;
             $ mkdir v0&lt;br /&gt;
             $ sshfs root@v0.squeezel.com:/  v0&lt;br /&gt;
             $ cd v0&lt;br /&gt;
             $ ls -l&lt;br /&gt;
               bin   dev  home  lost+found     media  mnt  opt   q     sbin     srv  tmp  var&lt;br /&gt;
               boot  etc  lib   master_backup  misc   net  proc  root  selinux  sys  usr&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
     Now to unmount the filesystem&lt;br /&gt;
&lt;br /&gt;
             $ fusermount -u /home/chirico/v0&lt;br /&gt;
&lt;br /&gt;
     Yes, you can mount the filesystem on boot. Below shows an example entry for /etc/fstab, but&lt;br /&gt;
     this only allows user on the current system to view what is is /mnt/v0. &lt;br /&gt;
&lt;br /&gt;
             sshfs#root@v0.squeezel.com:/var/log             /mnt/v0 fuse defaults    0 0&lt;br /&gt;
&lt;br /&gt;
     References:&lt;br /&gt;
        (http://fuse.sourceforge.net/sshfs.html)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 220:&lt;br /&gt;
&lt;br /&gt;
     OpenVPN - A full-featured SSL VPN solution. The following demonstrates&lt;br /&gt;
               a very simple OpenVPN setup between two Fedora Core 5 computers&lt;br /&gt;
               big.squeezel.com 192.168.1.12 and tape.squeezel.com 192.168.1.155&lt;br /&gt;
&lt;br /&gt;
               As root install the package on both computers.&lt;br /&gt;
&lt;br /&gt;
                  $ yum -y install openvpn&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Setup on big.squeezel.com 192.168.1.12&lt;br /&gt;
&lt;br /&gt;
                  $ iptables -A INPUT -p udp -s 192.168.1.155  --dport 1194 -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tun+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A FORWARD -i tap+ -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
             Note - make sure you have commented out the following line &lt;br /&gt;
                    in /etc/sysconfig/iptables&lt;br /&gt;
&lt;br /&gt;
                  # -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
&lt;br /&gt;
             Now from continuting with the commands that need to be executed on &lt;br /&gt;
             big.squeezel.com 192.168.1.12 do one of the following&lt;br /&gt;
           &lt;br /&gt;
                  $ openvpn --remote tape.squeezel.com  --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 --verb 9&lt;br /&gt;
&lt;br /&gt;
             The above statement gives lots of errors. Once it's working you may want&lt;br /&gt;
             the following statement without the --verb 9 option.&lt;br /&gt;
&lt;br /&gt;
                  $ openvpn --remote tape.squeezel.com  --dev tun1 --ifconfig 10.4.0.1 10.4.0.2&lt;br /&gt;
&lt;br /&gt;
             After you finish the setup commands for tape.squeezel.com immediately below, you'll be&lt;br /&gt;
             able to access tape.squeezel.com as 10.4.0.2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Setup on tape.squeezel.com 192.168.1.155&lt;br /&gt;
&lt;br /&gt;
                  $ iptables -A INPUT -p udp -s 192.168.1.12  --dport 1194 -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tun+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A FORWARD -i tap+ -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
             Note - again, make sure you have commented out the following line &lt;br /&gt;
                    in /etc/sysconfig/iptables&lt;br /&gt;
&lt;br /&gt;
                  # -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
&lt;br /&gt;
             The openvpn commands are tape.squeezel.com are reversed from what is shown&lt;br /&gt;
             above.&lt;br /&gt;
&lt;br /&gt;
                  $ openvpn --remote big.squeezel.com --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 --verb 9&lt;br /&gt;
&lt;br /&gt;
             Or&lt;br /&gt;
                  $ openvpn --remote big.squeezel.com --dev tun1 --ifconfig 10.4.0.2 10.4.0.1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             Now you can access all services and ports from big.squeezel.com on 10.4.0.1 for &lt;br /&gt;
             such services as MySQL, secure Web, imap, etc. A quick test is nmap as follows:&lt;br /&gt;
&lt;br /&gt;
                  $ nmap -A -T4 10.4.0.1&lt;br /&gt;
&lt;br /&gt;
                  Starting Nmap 4.03 ( http://www.insecure.org/nmap/ ) at 2006-05-20 13:54 EDT&lt;br /&gt;
                  Interesting ports on 10.4.0.1:&lt;br /&gt;
                  (The 1671 ports scanned but not shown below are in state: closed)&lt;br /&gt;
                  PORT     STATE SERVICE VERSION&lt;br /&gt;
                  22/tcp   open  ssh     OpenSSH 4.3 (protocol 2.0)&lt;br /&gt;
                  111/tcp  open  rpcbind  2 (rpc #100000)&lt;br /&gt;
                  3306/tcp open  mysql   MySQL (unauthorized)&lt;br /&gt;
&lt;br /&gt;
                  Nmap finished: 1 IP address (1 host up) scanned in 7.116 seconds&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 221:&lt;br /&gt;
&lt;br /&gt;
     openssl - Some common commands.&lt;br /&gt;
&lt;br /&gt;
             Finding the openssldir (Directory for OpenSSL files).&lt;br /&gt;
&lt;br /&gt;
                  $ openssl version -a|grep OPENSSLDIR&lt;br /&gt;
                  OPENSSLDIR: &amp;quot;/etc/pki/tls&amp;quot;&lt;br /&gt;
&lt;br /&gt;
             Connect to a secure SMTP server with STARTTLS, assuming the server name is&lt;br /&gt;
             squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
                  $ openssl s_client -connect squeezel.squeezel.com:25 -starttls&lt;br /&gt;
&lt;br /&gt;
         &lt;br /&gt;
&lt;br /&gt;
      Reference (http://www.madboa.com/geek/openssl/)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 222:&lt;br /&gt;
&lt;br /&gt;
     Bash functions. This is easy, and I find it very useful to create bash functions&lt;br /&gt;
     for repeated commands. For example, suppose you want to create a quick bash function&lt;br /&gt;
     to cd to /var/log, tail messages and tail secure. You can create this function as&lt;br /&gt;
     follows:&lt;br /&gt;
&lt;br /&gt;
                  [root@v5 log]# m()&lt;br /&gt;
                  m()&lt;br /&gt;
                  &amp;gt; { cd /var/log&lt;br /&gt;
                  { cd /var/log&lt;br /&gt;
                  &amp;gt; tail messages&lt;br /&gt;
                  tail messages&lt;br /&gt;
                  &amp;gt; tail secure&lt;br /&gt;
                  tail secure&lt;br /&gt;
                  &amp;gt; }&lt;br /&gt;
                  }&lt;br /&gt;
                  &lt;br /&gt;
     Above I'm typing m() then hitting return. Note the echo on the next line followed&lt;br /&gt;
     by the prompt &amp;gt;. I then enter {. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 223:&lt;br /&gt;
&lt;br /&gt;
     Stats on DNS Server. You can get stats on your DNS server. &lt;br /&gt;
&lt;br /&gt;
       The following works for BIND 9:&lt;br /&gt;
&lt;br /&gt;
                  $ rndc stats&lt;br /&gt;
&lt;br /&gt;
         On my system I see the output in &amp;quot;/var/named/chroot/var/named/data/named_stats.txt&amp;quot;, which&lt;br /&gt;
         if an FC4 system. By the way, if you're using BIND 8, the command is &amp;quot;ndc stats&amp;quot;, but that&lt;br /&gt;
         has a completely different format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Format of the output&lt;br /&gt;
&lt;br /&gt;
            +++ Statistics Dump +++ (1153791199)&lt;br /&gt;
            success 297621&lt;br /&gt;
            referral 32&lt;br /&gt;
            nxrrset 21953&lt;br /&gt;
            nxdomain 33742&lt;br /&gt;
            recursion 28243&lt;br /&gt;
            failure 54&lt;br /&gt;
            --- Statistics Dump --- (1153791199)&lt;br /&gt;
&lt;br /&gt;
      The number (1153791199) can be converted with the date command.&lt;br /&gt;
&lt;br /&gt;
                  $ date -d '1970-01-01 1153791199 sec'&lt;br /&gt;
                  Tue Jul 25 02:33:19 EDT 2006&lt;br /&gt;
&lt;br /&gt;
      That's 1153791199 seconds since 1970-01-01 UCT. Which is 4 hours fast,&lt;br /&gt;
      from EDT.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 224:&lt;br /&gt;
&lt;br /&gt;
     snmp - simple network monitoring protocol. The following steps setup snmp on Fedora Core 5.&lt;br /&gt;
&lt;br /&gt;
                  $ yum install net-snmp*&lt;br /&gt;
&lt;br /&gt;
         Next add the following line in &amp;quot;/etc/snmp/snmpd.conf&amp;quot; at the bottom.&lt;br /&gt;
&lt;br /&gt;
                  rocommunity pA33worD&lt;br /&gt;
&lt;br /&gt;
         Start the snmp service.&lt;br /&gt;
&lt;br /&gt;
                  $ /etc/init.d/snmpd restart&lt;br /&gt;
&lt;br /&gt;
         Once started, from the command prompt, it's possible to get stats on the computer.&lt;br /&gt;
&lt;br /&gt;
                  $ snmpwalk -v 1 -c pA33worD localhost system&lt;br /&gt;
         Or&lt;br /&gt;
                  $ snmpwalk -v 1 -c pA33worD localhost interface&lt;br /&gt;
&lt;br /&gt;
         Or&lt;br /&gt;
                  $ snmpgetnext -v 1 -c pA33worD localhost sysUpTime&lt;br /&gt;
                  DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (26452) 0:04:24.52&lt;br /&gt;
&lt;br /&gt;
         Note the Timeticks is in 100th of a second. So the computer above has been running&lt;br /&gt;
         for 264.52 seconds.&lt;br /&gt;
&lt;br /&gt;
         Reference( TIP 225 shows how to use MRTG for gathering snmp stats).&lt;br /&gt;
                  http://www.net-snmp.org/tutorial/tutorial-5/commands/snmpv3.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 225:&lt;br /&gt;
&lt;br /&gt;
     MRTG - Multi Router Traffic Grapher.  &lt;br /&gt;
&lt;br /&gt;
                  $ cfgmaker --output=/etc/mrtg/v5.squeezel.com \&lt;br /&gt;
                    ifref=ip --global &amp;quot;workdir:/var/www/html/mrtg/stats&amp;quot;\&lt;br /&gt;
                    pA33worD@v5.squeezel.com&lt;br /&gt;
&lt;br /&gt;
        Reference: http://www.chinalinuxpub.com/doc/www.siliconvalleyccie.com/linux-hn/mrtg.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 226:&lt;br /&gt;
&lt;br /&gt;
     Back Trace - This is a method of getting a back trace for all processes on the system.&lt;br /&gt;
                  it assumes the following: a. Kernel was build with CONFIG_MAGIC_SYS-REQ &lt;br /&gt;
                  enabled (which Fedora 5 kernels are) b. You can get direct access to the &lt;br /&gt;
                  monitor.&lt;br /&gt;
&lt;br /&gt;
             Step 1.&lt;br /&gt;
&lt;br /&gt;
                  Ctl-Alt-F1 (This brings you to the text console)&lt;br /&gt;
&lt;br /&gt;
             Step 2.&lt;br /&gt;
&lt;br /&gt;
                  Alt-ScrollLock &lt;br /&gt;
                  Ctl-ScrollLock&lt;br /&gt;
          &lt;br /&gt;
                  Note above that's Alt-ScrollLock followed by Ctl-ScrollLock. You should see&lt;br /&gt;
                  a lot of text on the screen. To fast to read, but don't worry the text will&lt;br /&gt;
                  be in /var/log/messages at the end.&lt;br /&gt;
&lt;br /&gt;
                  On my system the ScrollLock key is next to the NumLock key. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 227:&lt;br /&gt;
&lt;br /&gt;
     Ext3 Tuning - One advantage of Ext3 over Ext2 is directory indexing, which  imporves file&lt;br /&gt;
                  access in directories containing large files or when the directory contains&lt;br /&gt;
                  many files. Directory indexing improves performance by using hashed binary &lt;br /&gt;
                  trees. &lt;br /&gt;
&lt;br /&gt;
                  There are two ways to enable dir_index. First, find the device using the mount&lt;br /&gt;
                  command.&lt;br /&gt;
&lt;br /&gt;
                      $ mount&lt;br /&gt;
&lt;br /&gt;
                      /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)&lt;br /&gt;
                      proc on /proc type proc (rw)&lt;br /&gt;
                      sysfs on /sys type sysfs (rw)&lt;br /&gt;
                      devpts on /dev/pts type devpts (rw,gid=5,mode=620)&lt;br /&gt;
                      /dev/sda1 on /boot type ext3 (rw) &amp;lt;--- This is the one you want&lt;br /&gt;
                      tmpfs on /dev/shm type tmpfs (rw)&lt;br /&gt;
                      none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)&lt;br /&gt;
                      sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)&lt;br /&gt;
                      automount(pid2001) on /net type autofs (rw,fd=4,pgrp=2001,minproto=2,maxproto=4)                   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                  From the above command, the device used is /dev/sda1.  Using the tune2fs command,&lt;br /&gt;
                  directory indexing will only apply to directories created after running the &lt;br /&gt;
                  command below.               &lt;br /&gt;
&lt;br /&gt;
                       $ tune2fs -O dir_index /dev/sda1&lt;br /&gt;
&lt;br /&gt;
                  However, if you want it to apply to all directories, use the e2fsck command as  &lt;br /&gt;
                  shown below:&lt;br /&gt;
&lt;br /&gt;
                       $ e2fsck -D -f /dev/sda1&lt;br /&gt;
&lt;br /&gt;
                  You'll need to bypass the warning message.&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
     Reference: &amp;quot;Tuning Journaling File Systems: A small amount of effort an dtime can yield big&lt;br /&gt;
                results&amp;quot;,by Steve Best. Linux Magazine, September 10, 2006. This author as has&lt;br /&gt;
                a very good book titled: &amp;quot;Linux Debugging and Performance Tuning.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 228:&lt;br /&gt;
&lt;br /&gt;
     NIC bonding - binding two or more NICs to one IP address to improve performance. The following&lt;br /&gt;
                instructions were done on Fedora Core 5.&lt;br /&gt;
&lt;br /&gt;
         Step 1.&lt;br /&gt;
             &lt;br /&gt;
            Create the file ifcfg-bond0 with the IP address, netmask and gateway. Shown&lt;br /&gt;
            below is my file.&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-bond0&lt;br /&gt;
&lt;br /&gt;
                   DEVICE=bond0&lt;br /&gt;
                   IPADDR=192.168.1.12&lt;br /&gt;
                   NETMASK=255.255.255.0&lt;br /&gt;
                   GATEWAY=192.168.1.1&lt;br /&gt;
                   USERCTL=no&lt;br /&gt;
                   BOOTPROTO=none&lt;br /&gt;
                   ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
         Step 2.&lt;br /&gt;
&lt;br /&gt;
            Modify eth0, eth1 and eth2. Shown below are each one of my files. Note that&lt;br /&gt;
            you must comment out, or remove the ip address, netmask, gateway and hardware&lt;br /&gt;
            address from each one of these files, since settings should only come from&lt;br /&gt;
            the ifcfg-bond0 file above. I've chosen to comment out the lines, instead of &lt;br /&gt;
            removing, should I decide to unbond my NICS sometime in the future.&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth0&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:9D&lt;br /&gt;
                  #IPADDR=192.168.1.12&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  #GATEWAY=192.168.1.1&lt;br /&gt;
                  #USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  # Settings for Bond&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth1&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth1&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:C9&lt;br /&gt;
                  #IPADDR=192.168.1.13&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  #&lt;br /&gt;
                  # Settings for bonding&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth2&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth2&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:9D&lt;br /&gt;
                  #IPADDR=192.168.1.12&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  #GATEWAY=192.168.1.1&lt;br /&gt;
                  #USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
         Step 3.&lt;br /&gt;
&lt;br /&gt;
            Set the load parameters for bond0 bonding kernel module. Append the&lt;br /&gt;
            following lines to /etc/modprobe.conf &lt;br /&gt;
&lt;br /&gt;
                 # bonding commands &lt;br /&gt;
                 alias bond0 bonding&lt;br /&gt;
                 options bond0 mode=balance-alb miimon=100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Step 4.&lt;br /&gt;
&lt;br /&gt;
            Load the bond driver module from the command prompt.&lt;br /&gt;
&lt;br /&gt;
                 $ modprobe bonding&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Step 5.&lt;br /&gt;
&lt;br /&gt;
            Restart the network, or restart the computer. Note I restarted to computer,&lt;br /&gt;
            since my NICs above had MAC assignments.&lt;br /&gt;
&lt;br /&gt;
                 $ service network restart   # Or restart computer&lt;br /&gt;
&lt;br /&gt;
             Take a look at the proc settings. &lt;br /&gt;
&lt;br /&gt;
                 $ cat /proc/net/bonding/bond0 &lt;br /&gt;
                 Ethernet Channel Bonding Driver: v3.0.3 (March 23, 2006)&lt;br /&gt;
&lt;br /&gt;
                 Bonding Mode: adaptive load balancing&lt;br /&gt;
                 Primary Slave: None&lt;br /&gt;
                 Currently Active Slave: eth2&lt;br /&gt;
                 MII Status: up&lt;br /&gt;
                 MII Polling Interval (ms): 100&lt;br /&gt;
                 Up Delay (ms): 0&lt;br /&gt;
                 Down Delay (ms): 0&lt;br /&gt;
&lt;br /&gt;
                 Slave Interface: eth2&lt;br /&gt;
                 MII Status: up&lt;br /&gt;
                 Link Failure Count: 0&lt;br /&gt;
                 Permanent HW addr: 00:13:72:80:62:f0&lt;br /&gt;
            &lt;br /&gt;
     References:&lt;br /&gt;
&lt;br /&gt;
         http://www.cyberciti.biz/nixcraft/vivek/blogger/2006/04/linux-bond-or-team-multiple-network.php&lt;br /&gt;
          Good, well written article describing the steps above.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=24692&amp;amp;package_id=146474&lt;br /&gt;
          Documentation for bonding that can also be found in the kernel&lt;br /&gt;
          ./Documentation/networking/bonding.txt&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 229:&lt;br /&gt;
&lt;br /&gt;
     /etc/nsswitch.conf - System Databases and Name Service Switch configuration file. &lt;br /&gt;
&lt;br /&gt;
         This file determines lookup order of services. For example, to match a name&lt;br /&gt;
         to an IP address, an entry can be put into the /etc/hosts file. Or a DNS query&lt;br /&gt;
         can be made. What's the order?  Normally, it's the entry in the /etc/hosts file.&lt;br /&gt;
         because /etc/nsswitch.conf contains the following setting&lt;br /&gt;
        &lt;br /&gt;
            hosts:      files dns&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	 See man nsswitch.conf for more settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
THE FOLLOWING SECTIONS STARTS THE PROGRAMMING TIPS&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 1:&lt;br /&gt;
&lt;br /&gt;
     Simple open command that restarts the close if a signal&lt;br /&gt;
     occurs.  Also note, the POSIX standards committee decided&lt;br /&gt;
     all new functions would not use errno and would instead&lt;br /&gt;
     directly return the error number in the function.&lt;br /&gt;
&lt;br /&gt;
     A lot of functions return -1 on an error condition, then,&lt;br /&gt;
     set errno to the value of the error.  This will still work&lt;br /&gt;
     for all the well known functions; but, it's changing.&lt;br /&gt;
&lt;br /&gt;
     /* start of code open.c&lt;br /&gt;
        Compile gcc -o open open.c&lt;br /&gt;
&lt;br /&gt;
        Reference (Look for simple_but_common_x.x.x.tar.gz):&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79066&lt;br /&gt;
&lt;br /&gt;
                             */&lt;br /&gt;
     #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     #include &amp;lt;string.h&amp;gt;             /* for strerror(int errno) */&lt;br /&gt;
     #include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     #define BUFLEN 100&lt;br /&gt;
     extern int errno;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     int&lt;br /&gt;
     main (void)&lt;br /&gt;
     {&lt;br /&gt;
       int fp,error;&lt;br /&gt;
       char buf[BUFLEN+1];&lt;br /&gt;
&lt;br /&gt;
       if ((fp = open (&amp;quot;data&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1)&lt;br /&gt;
         {&lt;br /&gt;
           fprintf (stderr, &amp;quot;Can't open data: %s\n&amp;quot;, strerror (errno));&lt;br /&gt;
           return 1;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
       snprintf (buf, BUFLEN, &amp;quot;123&amp;quot;);&lt;br /&gt;
       write (fp, buf, strlen (buf));&lt;br /&gt;
&lt;br /&gt;
       // Restart close should a signal occur */&lt;br /&gt;
       while((( error = close (fp) ) == -1) &amp;amp;&amp;amp; (errno == EINTR));&lt;br /&gt;
       if(error == -1)&lt;br /&gt;
         perror(&amp;quot;Failed to close the file\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
       return 0;&lt;br /&gt;
      }&lt;br /&gt;
     /* end of open.c */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 2:&lt;br /&gt;
&lt;br /&gt;
     Example of setting the effective UID on a file&lt;br /&gt;
&lt;br /&gt;
     /*  start of code&lt;br /&gt;
       gcc uid_open.c -o uid_open&lt;br /&gt;
       su&lt;br /&gt;
       chown root.chirico uid_open&lt;br /&gt;
       chmod u+s uid_open&lt;br /&gt;
       exit&lt;br /&gt;
&lt;br /&gt;
       Now you can run this as chirico and write to the&lt;br /&gt;
       root directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     */&lt;br /&gt;
     #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;string.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     int main()&lt;br /&gt;
     {&lt;br /&gt;
             int fd;&lt;br /&gt;
&lt;br /&gt;
             if ((fd = open(&amp;quot;/root/datajunk&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1) {&lt;br /&gt;
                     fprintf(stderr, &amp;quot;Can't open file \n&amp;quot;);&lt;br /&gt;
                     return 1;&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
             write(fd, &amp;quot;0123456&amp;quot;, strlen(&amp;quot;0123456&amp;quot;));&lt;br /&gt;
             close(fd);&lt;br /&gt;
             return 0;&lt;br /&gt;
     }&lt;br /&gt;
&lt;br /&gt;
     /* end of code */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 3:&lt;br /&gt;
&lt;br /&gt;
     Writing a C http post.&lt;br /&gt;
&lt;br /&gt;
     For downloads reference:&lt;br /&gt;
      http://prdownloads.sourceforge.net/cpearls/spider.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 4:&lt;br /&gt;
&lt;br /&gt;
     Writing a 2.6.x Kernel Module:&lt;br /&gt;
&lt;br /&gt;
       Look for the latest version of &amp;quot;procreadwrite&amp;quot;.  This is a 2.6 kernel&lt;br /&gt;
       modules that demonstrates how to create /proc entires and write directly&lt;br /&gt;
       to user-land via tty.  It's updated to reflect replacement of &amp;quot;current-&amp;gt;tty&amp;quot;&lt;br /&gt;
       with &amp;quot;current-&amp;gt;signal-&amp;gt;tty&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79066&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 5:&lt;br /&gt;
&lt;br /&gt;
     Creating a filename with '\n'.  This goes with (TIP 71)&lt;br /&gt;
&lt;br /&gt;
         /**** topen.c ***********************************************************&lt;br /&gt;
           Filenames can be created with any character except the null character&lt;br /&gt;
           and a slash.&lt;br /&gt;
&lt;br /&gt;
           This example creates a file with returns '\n\n'&lt;br /&gt;
&lt;br /&gt;
           There's a way to remove a file by inode:&lt;br /&gt;
&lt;br /&gt;
               $ ls -libt *&lt;br /&gt;
&lt;br /&gt;
           And, once you know the inode&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec mv '{}' goodstuff \;&lt;br /&gt;
&lt;br /&gt;
           or&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec rm '{}' goodstuff \;&lt;br /&gt;
&lt;br /&gt;
           or&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec cat '{}' \;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Compile:&lt;br /&gt;
&lt;br /&gt;
             gcc -o topen -Wall -W -O2 -s -pipe  topen.c&lt;br /&gt;
&lt;br /&gt;
         Reference:&lt;br /&gt;
           http://prdownloads.sourceforge.net/cpearls/simple_but_common_0.0.14.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
         */&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         #include &amp;lt;string.h&amp;gt;             /* for strerror(int errno) */&lt;br /&gt;
         #include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         #define BUFLEN 100&lt;br /&gt;
         extern int errno;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         int&lt;br /&gt;
         main (void)&lt;br /&gt;
         {&lt;br /&gt;
           int fp,error;&lt;br /&gt;
           char buf[BUFLEN+1];&lt;br /&gt;
&lt;br /&gt;
           if ((fp = open (&amp;quot;\n\n\n\n\n\n\n\n\n&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1)&lt;br /&gt;
             {&lt;br /&gt;
               fprintf (stderr, &amp;quot;Can't open data: %s\n&amp;quot;, strerror (errno));&lt;br /&gt;
               return 1;&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
           snprintf (buf, BUFLEN, &amp;quot;123&amp;quot;);&lt;br /&gt;
           write (fp, buf, strlen (buf));&lt;br /&gt;
&lt;br /&gt;
           // Restart close should a signal occur */&lt;br /&gt;
           while((( error = close (fp) ) == -1) &amp;amp;&amp;amp; (errno == EINTR));&lt;br /&gt;
           if(error == -1)&lt;br /&gt;
             perror(&amp;quot;Failed to close the file\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
           return 0;&lt;br /&gt;
&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  **Note, if you want email notification after every 50 new tips have been&lt;br /&gt;
    added, then, click on the following link:&lt;br /&gt;
&lt;br /&gt;
     https://sourceforge.net/project/filemodule_monitor.php?filemodule_id=120838&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 6:&lt;br /&gt;
&lt;br /&gt;
     Working With The Lemon Parser Generator.&lt;br /&gt;
     http://prdownloads.sourceforge.net/souptonuts/lemon_examples.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 7:&lt;br /&gt;
&lt;br /&gt;
     copy command for std container output.&lt;br /&gt;
&lt;br /&gt;
        #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
        #include &amp;lt;list&amp;gt;&lt;br /&gt;
        #include &amp;lt;vector&amp;gt;&lt;br /&gt;
        #include &amp;lt;iterator&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        using namespace std;&lt;br /&gt;
        int main(void)&lt;br /&gt;
        {&lt;br /&gt;
          vector&amp;lt;int&amp;gt; v;&lt;br /&gt;
          list&amp;lt;int&amp;gt; l;&lt;br /&gt;
&lt;br /&gt;
          v.push_back(1);&lt;br /&gt;
          v.push_back(2);&lt;br /&gt;
          copy(v.begin(),v.end(),ostream_iterator&amp;lt;int&amp;gt;(cout,&amp;quot;\n&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          l.push_back(23);&lt;br /&gt;
          l.push_back(12);&lt;br /&gt;
          copy(l.begin(),l.end(),ostream_iterator&amp;lt;int&amp;gt;(cout,&amp;quot;\n&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 8:&lt;br /&gt;
&lt;br /&gt;
  /* Copyright (c) 2005 Mike Chirico mchirico@comcast.net mchirico@users.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Example of using virtual functions. Note the use of &amp;quot;initialization lists&amp;quot;&lt;br /&gt;
              for assinging the variable first and last.&lt;br /&gt;
&lt;br /&gt;
      Compile:&lt;br /&gt;
        g++ -o virtualfunc -Wall -W -O2 -s -pipe  virtual_function.cc&lt;br /&gt;
&lt;br /&gt;
      Download:&lt;br /&gt;
        http://prdownloads.sourceforge.net/cpearls/simple_but_common_cpp.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  */&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
  #include &amp;lt;string&amp;gt;&lt;br /&gt;
  #include &amp;lt;list&amp;gt;&lt;br /&gt;
  #include &amp;lt;algorithm&amp;gt;&lt;br /&gt;
  #include &amp;lt;iterator&amp;gt;&lt;br /&gt;
  #include &amp;lt;functional&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  using namespace std;&lt;br /&gt;
&lt;br /&gt;
  class Employee {&lt;br /&gt;
  string first,last;&lt;br /&gt;
  public:&lt;br /&gt;
    Employee(const string&amp;amp; fn=&amp;quot;John&amp;quot;,const  string&amp;amp; ln=&amp;quot;Smith&amp;quot;): first(fn),last(ln) {}&lt;br /&gt;
    virtual void print() const {&lt;br /&gt;
    cout &amp;lt;&amp;lt; &amp;quot;First name: &amp;quot; &amp;lt;&amp;lt; first &amp;lt;&amp;lt; &amp;quot;, Last name: &amp;quot; &amp;lt;&amp;lt; last &amp;lt;&amp;lt; endl;&lt;br /&gt;
    }&lt;br /&gt;
    virtual ~Employee() {}&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  class Manager : public Employee {&lt;br /&gt;
    int level;&lt;br /&gt;
    list&amp;lt;Employee*&amp;gt; subordinates;&lt;br /&gt;
  public:&lt;br /&gt;
    Manager(const string&amp;amp; fn=&amp;quot;Ivan&amp;quot;,const string&amp;amp; ln=&amp;quot;Stedwick&amp;quot;, int lvl=1): Employee(fn,ln), level(lvl) {}&lt;br /&gt;
    void print() {&lt;br /&gt;
      cout &amp;lt;&amp;lt; &amp;quot;Manager level: &amp;quot; &amp;lt;&amp;lt; level &amp;lt;&amp;lt; &amp;quot;  &amp;quot;;&lt;br /&gt;
      Employee::print();&lt;br /&gt;
      cout &amp;lt;&amp;lt; &amp;quot;Supervises:&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
      for_each(subordinates.begin(),subordinates.end(),mem_fun(&amp;amp;Employee::print));&lt;br /&gt;
      cout &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; endl;&lt;br /&gt;
    }&lt;br /&gt;
    void addstaff(Employee&amp;amp; staff){&lt;br /&gt;
      subordinates.push_front(&amp;amp;staff);&lt;br /&gt;
    }&lt;br /&gt;
    void addstaff(Employee* staff){&lt;br /&gt;
      subordinates.push_front(staff);&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   int main()&lt;br /&gt;
   {&lt;br /&gt;
     Employee p0(&amp;quot;Lisa&amp;quot;,&amp;quot;Payne&amp;quot;);&lt;br /&gt;
     Manager m0;&lt;br /&gt;
&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Zoe&amp;quot;,&amp;quot;Bear&amp;quot;)); /* uses void addstaff(Employee* staff) */&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Leah&amp;quot;,&amp;quot;Bopper&amp;quot;));&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Abby&amp;quot;,&amp;quot;Chicken&amp;quot;));&lt;br /&gt;
     m0.addstaff(p0);  /* void addstaff(Employee&amp;amp; staff)  needed for this one */&lt;br /&gt;
     m0.addstaff(new Employee());&lt;br /&gt;
     m0.print();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     return 0;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 9:&lt;br /&gt;
&lt;br /&gt;
   /*  Named Constructor Idiom.&lt;br /&gt;
       Reference: http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.6&lt;br /&gt;
&lt;br /&gt;
   */&lt;br /&gt;
   #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
   #include &amp;lt;cmath&amp;gt;&lt;br /&gt;
   using namespace std;&lt;br /&gt;
&lt;br /&gt;
   class Point {&lt;br /&gt;
&lt;br /&gt;
   public:&lt;br /&gt;
     static Point rectangular(float x, float y);&lt;br /&gt;
     static Point polar(float radius, float angle);&lt;br /&gt;
     float get_x() { return x_; }&lt;br /&gt;
     float get_y() { return y_; }&lt;br /&gt;
&lt;br /&gt;
   private:&lt;br /&gt;
     Point(float x, float y);&lt;br /&gt;
     float x_, y_;&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
   inline Point::Point(float x, float y)&lt;br /&gt;
     : x_(x), y_(y) {}&lt;br /&gt;
&lt;br /&gt;
   inline Point Point::rectangular(float x, float y)&lt;br /&gt;
   { return Point(x,y); }&lt;br /&gt;
&lt;br /&gt;
   inline Point Point::polar(float radius, float angle)&lt;br /&gt;
   { return Point(radius*cos(angle),radius*sin(angle)); }&lt;br /&gt;
&lt;br /&gt;
   int main(void)&lt;br /&gt;
   {&lt;br /&gt;
     Point p1 = Point::rectangular(5.7,1.2);&lt;br /&gt;
     Point p2 = Point::polar(5.7,1.2);&lt;br /&gt;
&lt;br /&gt;
     cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; p1.get_x() &amp;lt;&amp;lt; &amp;quot;, &amp;quot; &amp;lt;&amp;lt; p1.get_y() &amp;lt;&amp;lt; &amp;quot;)&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
     cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; p2.get_x() &amp;lt;&amp;lt; &amp;quot;, &amp;quot; &amp;lt;&amp;lt; p2.get_y() &amp;lt;&amp;lt; &amp;quot;)&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 10:&lt;br /&gt;
&lt;br /&gt;
   /* Copy_constructor_assignment.cc&lt;br /&gt;
      Copyright (c) 2004 GPL Mike Chirico, mchirico@comcast.net or mchirico@users.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
      Reference: &amp;quot;The C++ Programming Language&amp;quot;, 3rd ed, by Stroustrup&lt;br /&gt;
      pg. 246.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Download:&lt;br /&gt;
      http://prdownloads.sourceforge.net/cpearls/simple_but_common.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
   */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   class Name {&lt;br /&gt;
   public:&lt;br /&gt;
     char* s;&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   class Table {&lt;br /&gt;
     Name *p;&lt;br /&gt;
     size_t sz;&lt;br /&gt;
   public:&lt;br /&gt;
     Table(size_t s=15) {&lt;br /&gt;
               p = new Name[sz=s];&lt;br /&gt;
               for(size_t i=0; i&amp;lt; sz; ++i) p[i].s=&amp;quot;****&amp;quot;;&lt;br /&gt;
                          }&lt;br /&gt;
     Table(const Table &amp;amp;t);&lt;br /&gt;
     Table&amp;amp; operator=(const Table&amp;amp;);&lt;br /&gt;
     int prt();&lt;br /&gt;
     void asgn(char* ts,size_t index);&lt;br /&gt;
     ~Table(){ delete[] p; }&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Table&amp;amp; Table::operator=(const Table &amp;amp;t)&lt;br /&gt;
   {&lt;br /&gt;
     if( this != &amp;amp;t) {&lt;br /&gt;
       delete[] p;&lt;br /&gt;
       p = new Name[sz=t.sz];&lt;br /&gt;
       for(size_t i=0; i&amp;lt; t.sz; ++i) p[i]=t.p[i];&lt;br /&gt;
     }&lt;br /&gt;
     return *this;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   int Table::prt()&lt;br /&gt;
   {&lt;br /&gt;
     for(size_t i=0; i&amp;lt; sz; ++i) std::cout &amp;lt;&amp;lt; p[i].s &amp;lt;&amp;lt; &amp;quot; &amp;quot;;&lt;br /&gt;
     std::cout &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
     return 0;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   /*&lt;br /&gt;
     asgn will increase the array of strings, if needed&lt;br /&gt;
     to size index+1, and add the string ts to position&lt;br /&gt;
     index.&lt;br /&gt;
   */&lt;br /&gt;
   void Table::asgn(char* ts,size_t index)&lt;br /&gt;
   {&lt;br /&gt;
     if(index &amp;lt; sz ) {&lt;br /&gt;
        p[index].s=ts;&lt;br /&gt;
     }else if ( index &amp;gt;= sz ){&lt;br /&gt;
        Name *tp;&lt;br /&gt;
        tp=p;&lt;br /&gt;
&lt;br /&gt;
        p = new Name[index+1];&lt;br /&gt;
&lt;br /&gt;
        for(size_t i=0; i&amp;lt; sz; ++i) p[i].s=tp[i].s;&lt;br /&gt;
        delete [] tp;&lt;br /&gt;
        for(size_t i=sz; i &amp;lt; index; ++i)p[i].s=&amp;quot;****&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
        p[index].s=ts;&lt;br /&gt;
        sz=index+1;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   int main(void)&lt;br /&gt;
   {&lt;br /&gt;
&lt;br /&gt;
     Table t1;&lt;br /&gt;
     Table t2(5);&lt;br /&gt;
&lt;br /&gt;
     // this is bigger than initial sz&lt;br /&gt;
     t1.asgn(&amp;quot;myname&amp;quot;,20);&lt;br /&gt;
     t1.prt();&lt;br /&gt;
     t2.prt();&lt;br /&gt;
&lt;br /&gt;
     t1=t2;&lt;br /&gt;
&lt;br /&gt;
     t1.prt();&lt;br /&gt;
     t2.prt();&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REFERENCES:&lt;br /&gt;
&lt;br /&gt;
  (1)  http://www.tldp.org/LDP/abs/html/index.html&lt;br /&gt;
  (2)  http://www.shelldorado.com/&lt;br /&gt;
  (3)  http://www.faqs.org/ftp/usenet/news.answers/unix-faq/faq/part1&lt;br /&gt;
  (4)  http://www-106.ibm.com/developerworks/library/l-rpm1/&lt;br /&gt;
  (5)  http://www-136.ibm.com/developerworks/linux/&lt;br /&gt;
  (6)  http://www.gnu.org/manual/manual.html&lt;br /&gt;
  (7)  http://fedora.redhat.com/&lt;br /&gt;
  (8)  http://souptonuts.sourceforge.net/chirico/index.php&lt;br /&gt;
  (9)  http://www.faqs.org/faqs/&lt;br /&gt;
 (10)  http://www.faqs.org/docs/linux_network/&lt;br /&gt;
 (11)  http://www.tml.hut.fi/~viu/linux/sag/sag-0.6.2.html/index.html&lt;br /&gt;
 (12)  http://www.yolinux.com/TUTORIALS/LinuxTutorialSysAdmin.html&lt;br /&gt;
 (13)  http://sed.sourceforge.net/grabbag/scripts/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  SUMMARY:&lt;br /&gt;
   (1)(2)(3) Excellent resource for bash scripts.&lt;br /&gt;
   (4)       rpm resource&lt;br /&gt;
   (6)       GNU Manuals Online&lt;br /&gt;
   (7)       Fedora&lt;br /&gt;
   (8)       Authors Website&lt;br /&gt;
   (11)(12)  System Admin&lt;br /&gt;
   (13)      Excellent source of sed scripts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
HIGHLY RECOMMENDED BOOKS:&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX Network Programming, The Sockets Networking API&amp;quot;, Volume 1, Third Edition.&lt;br /&gt;
        W. Richard Stevens, Bill Fenner, Andrew M. Rudoff.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX Network Programming, Interprocess Communications&amp;quot;, Volume 2, Second Edition.&lt;br /&gt;
        W. Richard Stevens.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX SYSTEMS Programming, Communication, Concurrency, and Threads&amp;quot;, Kay A. Robbins,&lt;br /&gt;
        Steven Robbins&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming with POSIX Threads&amp;quot;, David R. Butenhof. Addison-Wesley&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;The C++ Programming Language&amp;quot; Third Edition. Bjarne Stroustrup. Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C Programming Language&amp;quot; (2nd Edition), Second Edition, Kernighan and Ritchie&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Advanced Linux Programming&amp;quot; by Mark Mitchell, Jeffrey Oldham, and Alex Samuel, of&lt;br /&gt;
        CodeSourcery LL. This book if free at the following resource:&lt;br /&gt;
        http://www.advancedlinuxprogramming.com/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Accelerated C++, Practical Programming by Example&amp;quot; Andrew Koenig, Barbara E. Moo.&lt;br /&gt;
        Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C: A Reference Manual&amp;quot;, Fifth Edition, Samuel P. Harbison, Guy L. Steele.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Standard Library: A Tutorial and Reference, The&amp;quot;, Nicolai M. Josuttis. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Templates: The Complete Guide&amp;quot;, David Vandevoorde, Nicolai M. Josuttis. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Exceptional C++: 47 Engineering Puzzles, Programming Problems, and Solutions&amp;quot;, Herb Sutter.&lt;br /&gt;
     Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;More Exceptional C++&amp;quot;, Herb Sutter.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Exceptional C++ Style: 40 New Engineering Puzzles, Programming Problems, and Solutions&amp;quot;,&lt;br /&gt;
       Herb Sutter. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;The Art of Computer Programming (TAOCP)&amp;quot;, Vol 1,Vol 2, Vol 3. Donald E. Knuth. Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming Perl, 3rd Edition&amp;quot;, Tom Christiansen, Jon Orwant, Larry Wall. O'Reilly.&lt;br /&gt;
       http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming from the Ground Up&amp;quot;, Jonathan Bartlett, Edited by Dominick Bruno, Jr.&lt;br /&gt;
       http://savannah.nongnu.org/download/pgubook/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Expert C Programming&amp;quot;, Peter van der Linden, Prentice Hall PTR.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Coding Standards 101 Rules, Guidelines, and Best Practices&amp;quot;, by Herb Sutter and&lt;br /&gt;
       Andrei Alexandrescu.  http://www.gotw.ca/publications/c++cs/bibliography.htm&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Linux Kernel Development: A practical guide to the design and implementation of&lt;br /&gt;
       the Linux kernel&amp;quot;, by Robert Love, Sams Publishing.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond&amp;quot;, by&lt;br /&gt;
       David Abrahams and Aleksey Gurtovoy. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
HIGHLY RECOMMENDED: PHILOSOPHICAL&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;Zen and the Art of Motorcycle Maintenance: An Inquiry into Values&amp;quot;, Robert Pirsig.&lt;br /&gt;
        http://www.virtualschool.edu/mon/Quality/PirsigZen/index.html&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;Lila: An Inquiry Into Morals&amp;quot;, Robert Pirsig.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RECOMMENDED BOOKS:&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Structure and Interpretation of Computer Programs&amp;quot;, Harold Abelson, Gerald Jay Sussman,&lt;br /&gt;
      Julie Sussman. This book is free:&lt;br /&gt;
        http://mitpress.mit.edu/sicp/full-text/book/book.html&lt;br /&gt;
              and&lt;br /&gt;
        http://www.gnu.org/software/mit-scheme/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RECOMMENDED HOTOS:&lt;br /&gt;
&lt;br /&gt;
    Linux Networking-HOWTO (Previously the Net-3 Howto)&lt;br /&gt;
     http://en.tldp.org/HOWTO/NET3-4-HOWTO.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CORRECTIONS:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following people made suggestions and corrections:&lt;br /&gt;
  - Jorge Fabregas &amp;lt;fabregasj@prtc.net&amp;gt; TIP 21&lt;br /&gt;
  - Malcolm Parsons &amp;lt;malcolm.parsons@gmail.com&amp;gt; TIP 44&lt;br /&gt;
  - Andreas Haunschmidt &amp;lt;Andreas.Haunschmidt@utanet.at&amp;gt; TIP 102, TIP 90&lt;br /&gt;
  - P@draigBrady.com (Following links )&lt;br /&gt;
  - Jacques.GARNIER-EXTERIEUR@EU.RHODIA.COM TIP 46&lt;br /&gt;
&lt;br /&gt;
                http://www.pixelbeat.org/cmdline.html&lt;br /&gt;
                http://www.pixelbeat.org/rotagator/linux.tips/rotagator.fortune&lt;br /&gt;
                http://www.pixelbeat.org/scripts/&lt;br /&gt;
&lt;br /&gt;
  - Tobias Nix &amp;lt;tobias.nix@gmail.com&amp;gt; TIP 12&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>C4tboCcdro</name></author>	</entry>

	<entry>
		<id>https://wiki.gacq.com/index.php?title=Linux_tips&amp;diff=2769</id>
		<title>Linux tips</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacq.com/index.php?title=Linux_tips&amp;diff=2769"/>
				<updated>2009-01-10T19:15:05Z</updated>
		
		<summary type="html">&lt;p&gt;C4tboCcdro: http://fademon.0lx.net/article-600.htm&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://fademon.0lx.net/article-600.htm jordan capri sample movies] [http://caraines.qsh.eu/cencob.htm latest nigerian movies] [http://varpasz.is-the-boss.com/article189.htm estate license per real state] [http://qasletop.is-the-boss.com/letoracn.html angel season 1 torrent] [http://naceceli.qsh.eu/page1465.html ninja video game] &lt;br /&gt;
[http://bukgetert.0lx.net/article-1659.htm skinny dipping videos] [http://ettaelt.strefa.pl/news-1716.html actor male movie] [http://mahohmie.qsh.eu/resource776.htm quotes from the movie stick it] [http://zelfibu.strefa.pl/korolald-1009.html movie online show tv watch] [http://acsitzar.0lx.net/news-jennifer-aniston-2008-11-10.html jennifer aniston video clip] &lt;br /&gt;
[http://bukgetert.0lx.net/article-287.htm sad movies always make me cry] [http://tarobasal.strefa.pl/sitemap.htm webmap] [http://betheres.qsh.eu/comment-141.htm revolutionary war movies] [http://dronoubr.0lx.net/angelina-antonio.html angelina antonio banderas jolie video] [http://mahohmie.qsh.eu/resource1532.htm new realeased movies] &lt;br /&gt;
[http://huruple.qsh.eu/20081227-sara-jay-xxx.htm sara jay xxx movie] [http://naceceli.qsh.eu/sitemap.html link] [http://huruple.qsh.eu/20090105-adc-video-patch.htm adc video patch panel] [http://tulilre.strefa.pl/2008-12-27-imovie-5-download.html imovie 5 download] [http://faquafav.is-the-boss.com/text-545.htm pinnacle studio 9.0 serial] &lt;br /&gt;
[http://mahohmie.qsh.eu/resource1805.htm spongebob tv movie character toy] [http://fademon.0lx.net/article-1434.htm put music videos on your psp for free] [http://acsitzar.0lx.net/news-joes-movies-2008-11-12.html joes movies] [http://caraines.qsh.eu/defanele.htm iran movie] [http://betheres.qsh.eu/comment-180.htm movie prime cut] &lt;br /&gt;
[http://caraines.qsh.eu/zelgolg.htm amc movie .com] [http://caraines.qsh.eu/zmexplnrb.htm ejaculate galleries.squirting video] [http://spfortne.qsh.eu/20081226-adult-alyssa.html adult alyssa milano movie] [http://lofaako.strefa.pl/sitemap.html map] [http://caraines.qsh.eu/caelttro.htm anne curtis video scandal download] &lt;br /&gt;
[http://zelgetgo.0lx.net/sitemap.htm url] [http://relquaca.is-the-boss.com/20090104-lanhound-serial.html lanhound serial number] [http://bukgetert.0lx.net/article-28.htm sitemap] [http://fispruil.qsh.eu/news1763.html she will be loved video cast maroon 5] [http://bukgetert.0lx.net/article-52.htm make a movie screen] &lt;br /&gt;
[http://lifokdron.0lx.net/1739.html michael thriller video] [http://huruple.qsh.eu/20090101-interracial-video.htm interracial video tgp] [http://relquaca.is-the-boss.com/20090103-password-stealer.html password stealer crack] [http://acsitzar.0lx.net/news-most-wanted-2008-11-17.html most wanted movie] [http://vihencbr.0lx.net/secure-video.html secure video chat] &lt;br /&gt;
[http://acsitzar.0lx.net/news-jethro-tull-videos-2008-11-19.html jethro tull videos] [http://bukgetert.0lx.net/sitemap.htm links] [http://lifokdron.0lx.net/504.html movie theater in virginia] [http://flheddin.qsh.eu/brfadron-453.html motivational military videos] [http://sematild.qsh.eu/resource322.htm real player video codecs] &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Mike Chirico (mchirico@users.sourceforge.net) or (mchirico@comcast.net)&lt;br /&gt;
Copyright (C) 2004 (GNU Free Documentation License)&lt;br /&gt;
Last Updated: Thu Dec 28 16:42:50 EST 2006&lt;br /&gt;
&lt;br /&gt;
The latest version of this document can be found at:&lt;br /&gt;
http://souptonuts.sourceforge.net/how_to_linux_and_open_source.htm&lt;br /&gt;
  or text version ( if you have trouble downloading the full document: over 140 pages )&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/How_to_Linux_and_Open_Source.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on Gmail with Postix and Fetchmail&lt;br /&gt;
http://souptonuts.sourceforge.net/postfix_tutorial.html&lt;br /&gt;
&lt;br /&gt;
For tips on using SQLite (over 25 pages)&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_sqlite_tutorial.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on MySQL reference:&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_mysql.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For a recommended reading list&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/Recommended_Reading.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on upgrading RedHat 9 or 8.0 to 2.6.x src kernel&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_26.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on Comcast Email with Home Linux Box&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_COMCAST_EMAIL.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  **Note, if you want email notification after every 50 new tips have been&lt;br /&gt;
    added, then, click on the following link:&lt;br /&gt;
     https://sourceforge.net/project/filemodule_monitor.php?filemodule_id=120838&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 1:&lt;br /&gt;
&lt;br /&gt;
     Is NTP Working?&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Test the current server):&lt;br /&gt;
&lt;br /&gt;
          Try issuing the following command:&lt;br /&gt;
&lt;br /&gt;
          $ ntpq -pn&lt;br /&gt;
&lt;br /&gt;
           remote refid st t when poll reach delay offset jitter&lt;br /&gt;
           ===================================================&lt;br /&gt;
           tock.usno.navy 0.0.0.0 16 u - 64 0 0.000 0.000 4000.00&lt;br /&gt;
&lt;br /&gt;
          The above is an example of a problem.&lt;br /&gt;
          Compare it to a working configuration.&lt;br /&gt;
&lt;br /&gt;
          $ ntpq -pn&lt;br /&gt;
&lt;br /&gt;
           remote refid st t when poll reach delay offset jitter&lt;br /&gt;
           ========================================================&lt;br /&gt;
           +128.4.40.12 128.4.40.10 2 u 107 128 377 25.642 3.350 1.012&lt;br /&gt;
           127.127.1.0 127.127.1.0 10 l 40 64 377 0.000 0.000 0.008&lt;br /&gt;
           +128.91.2.13 128.4.40.12 3 u 34 128 377 21.138 6.118 0.398&lt;br /&gt;
           *192.5.41.41 .USNO. 1 u 110 128 377 33.69 9.533 3.534&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Configure the /etc/ntp.conf):&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/ntp.conf&lt;br /&gt;
&lt;br /&gt;
            # My simple client-only ntp configuration.&lt;br /&gt;
            server timeserver1.upenn.edu&lt;br /&gt;
            # ping -a timeserver1.upenn.edu shows the IP address 128.91.2.13&lt;br /&gt;
            # which is used in the restrict below&lt;br /&gt;
            restrict 128.91.2.13&lt;br /&gt;
            server tock.usno.navy.mil&lt;br /&gt;
            restrict 192.5.41.41&lt;br /&gt;
            server 128.4.40.12&lt;br /&gt;
            restrict 128.4.40.12&lt;br /&gt;
            server 127.127.1.0 # local clock&lt;br /&gt;
            fudge 127.127.1.0 stratum 10&lt;br /&gt;
            driftfile /etc/ntp/drift&lt;br /&gt;
            restrict default ignore&lt;br /&gt;
            restrict 127.0.0.0 mask 255.0.0.0&lt;br /&gt;
            authenticate no&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Configure /etc/ntp/step-tickers):&lt;br /&gt;
&lt;br /&gt;
          The values for server above are placed in the &amp;quot;/etc/ntp/step-tickers&amp;quot; file&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/ntp/step-tickers&lt;br /&gt;
&lt;br /&gt;
              timeserver1.upenn.edu&lt;br /&gt;
              tock.usno.navy.mil&lt;br /&gt;
              128.4.40.12&lt;br /&gt;
&lt;br /&gt;
          The startup script /etc/rc.d/init.d/ntpd will grab the servers in this&lt;br /&gt;
          file and execute the ntpdate command as follows:&lt;br /&gt;
&lt;br /&gt;
             /usr/sbin/ntpdate -s -b -p 8 timeserver1.upenn.edu&lt;br /&gt;
&lt;br /&gt;
          Why? Because if the time is off ntpd will not start. The command above set the&lt;br /&gt;
          clock. If System Time deviates from true time by more than 1000 seconds, then,&lt;br /&gt;
          the ntpd daemon  will enter panic mode and exit.&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Restart the service and check):&lt;br /&gt;
&lt;br /&gt;
          Issue the restart command&lt;br /&gt;
&lt;br /&gt;
            /etc/init.d/ntpd restart&lt;br /&gt;
&lt;br /&gt;
          check the values for &amp;quot;ntpq -pn&amp;quot;,&lt;br /&gt;
          which should match step 1.&lt;br /&gt;
&lt;br /&gt;
             ntpq -pn&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE:&lt;br /&gt;
&lt;br /&gt;
          Time is always stored in the kernel as the number of seconds since&lt;br /&gt;
          midnight of the 1st of January 1970 UTC, regardless of whether the&lt;br /&gt;
          hardware clock is stored as UTC or not.  Conversions to local time&lt;br /&gt;
          are done at run-time. So, it's easy to get the time in different&lt;br /&gt;
          timezones for only the current session as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ export TZ=EST&lt;br /&gt;
              $ date&lt;br /&gt;
              Mon Aug  2 10:34:04 EST 2004&lt;br /&gt;
&lt;br /&gt;
              $ export TZ=NET&lt;br /&gt;
              $ date&lt;br /&gt;
              Mon Aug  2 15:34:18 NET 2004&lt;br /&gt;
&lt;br /&gt;
          The following are possible values for TZ:&lt;br /&gt;
&lt;br /&gt;
              Hours From Greenwich Mean Time (GMT) Value Description&lt;br /&gt;
              0 GMT Greenwich Mean Time&lt;br /&gt;
              +1 ECT European Central Time&lt;br /&gt;
              +2 EET European Eastern Time&lt;br /&gt;
              +2 ART&lt;br /&gt;
              +3 EAT Saudi Arabia&lt;br /&gt;
              +3.5 MET Iran&lt;br /&gt;
              +4 NET&lt;br /&gt;
              +5 PLT West Asia&lt;br /&gt;
              +5.5 IST India&lt;br /&gt;
              +6 BST Central Asia&lt;br /&gt;
              +7 VST Bangkok&lt;br /&gt;
              +8 CTT China&lt;br /&gt;
              +9 JST Japan&lt;br /&gt;
              +9.5 ACT Central Australia&lt;br /&gt;
              +10 AET Eastern Australia&lt;br /&gt;
              +11 SST Central Pacific&lt;br /&gt;
              +12 NST New Zealand&lt;br /&gt;
              -11 MIT Samoa&lt;br /&gt;
              -10 HST Hawaii&lt;br /&gt;
              -9 AST Alaska&lt;br /&gt;
              -8 PST Pacific Standard Time&lt;br /&gt;
              -7 PNT Arizona&lt;br /&gt;
              -7 MST Mountain Standard Time&lt;br /&gt;
              -6 CST Central Standard Time&lt;br /&gt;
              -5 EST Eastern Standard Time&lt;br /&gt;
              -5 IET Indiana East&lt;br /&gt;
              -4 PRT Atlantic Standard Time&lt;br /&gt;
              -3.5 CNT Newfoundland&lt;br /&gt;
              -3 AGT Eastern South America&lt;br /&gt;
              -3 BET Eastern South America&lt;br /&gt;
              -1 CAT Azores&lt;br /&gt;
&lt;br /&gt;
              DST timezone&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              0      BST for British Summer.&lt;br /&gt;
              +400   ADT for Atlantic Daylight.&lt;br /&gt;
              +500   EDT for Eastern Daylight.&lt;br /&gt;
              +600   CDT for Central Daylight.&lt;br /&gt;
              +700   MDT for Mountain Daylight.&lt;br /&gt;
              +800   PDT for Pacific Daylight.&lt;br /&gt;
              +900   YDT for Yukon Daylight.&lt;br /&gt;
              +1000  HDT for Hawaii Daylight.&lt;br /&gt;
              -100   MEST for Middle European Summer,&lt;br /&gt;
                         MESZ for Middle European Summer,&lt;br /&gt;
                         SST for Swedish Summer and FST for French Summer.&lt;br /&gt;
              -700   WADT for West Australian Daylight.&lt;br /&gt;
              -1000  EADT for Eastern Australian Daylight.&lt;br /&gt;
              -1200  NZDT for New Zealand Daylight.&lt;br /&gt;
&lt;br /&gt;
     The following is an example of setting the TZ environment variable&lt;br /&gt;
     for the timezone, only when timezone changes go into effect.&lt;br /&gt;
&lt;br /&gt;
               $ export TZ=EST+5EDT,M4.1.0/2,M10.5.0/2&lt;br /&gt;
&lt;br /&gt;
     Take a look at the last line &amp;quot;M10.5.0/2&amp;quot;. What does it mean? Here is the&lt;br /&gt;
     documentation&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Mm.w.d This  specifies  day  d (0 &amp;lt;= d &amp;lt;= 6) of week w (1 &amp;lt;= w &amp;lt;= 5) of&lt;br /&gt;
              month m (1 &amp;lt;= m &amp;lt;= 12).  Week 1 is the first week in which day d&lt;br /&gt;
              occurs and week 5 is the last week in which day d occurs.  Day 0&lt;br /&gt;
              is a Sunday.&lt;br /&gt;
&lt;br /&gt;
              The time fields specify when, in the local time  currently  in&lt;br /&gt;
              effect, the  change  to  the  other  time  occurs.   If omitted,&lt;br /&gt;
              the default is  02:00:00.&lt;br /&gt;
&lt;br /&gt;
      So this is what it means. M10 stands for October, the 5 is the fifth week&lt;br /&gt;
      that includes a Sunday (note 0 in M10.5.0/2 is Sunday). To see that it is&lt;br /&gt;
      the fifth week see the calendar below. The time change occurs a 2am in&lt;br /&gt;
      the morning.&lt;br /&gt;
&lt;br /&gt;
                                October&lt;br /&gt;
                         Su Mo Tu We Th Fr Sa&lt;br /&gt;
                                         1  2&lt;br /&gt;
                          3  4  5  6  7  8  9&lt;br /&gt;
                         10 11 12 13 14 15 16&lt;br /&gt;
                         17 18 19 20 21 22 23&lt;br /&gt;
                         24 25 26 27 28 29 30&lt;br /&gt;
                         31&lt;br /&gt;
&lt;br /&gt;
       Prove it. Take the following program sunrise, which can calcuates sunrise&lt;br /&gt;
       and sunset for an latitude and longitude. This program can be downloaded&lt;br /&gt;
       from the following location:&lt;br /&gt;
           http://sourceforge.net/direct-dl/mchirico/souptonuts/working_with_time.tar.gz&lt;br /&gt;
&lt;br /&gt;
       Below is a bash script that will run the program for the next 100 days.&lt;br /&gt;
&lt;br /&gt;
          #!/bin/bash&lt;br /&gt;
          #  program: next100days  Mike Chirico&lt;br /&gt;
          #  download:&lt;br /&gt;
          #  http://sourceforge.net/direct-dl/mchirico/souptonuts/working_with_time.tar.gz&lt;br /&gt;
          #&lt;br /&gt;
          #  This will calculate the sunrise and sunset for&lt;br /&gt;
          #  latitude     39.95  Note must convert to degrees&lt;br /&gt;
          #  longitude  75.15  Note must convert to degrees&lt;br /&gt;
          lat=39.95&lt;br /&gt;
          long=75.15&lt;br /&gt;
          for (( i=0; i &amp;lt;= 100; i++))&lt;br /&gt;
          do&lt;br /&gt;
            sunrise    `date -d &amp;quot;+$i day&amp;quot; &amp;quot;+%Y %m %d&amp;quot;` $lat $long&lt;br /&gt;
          done&lt;br /&gt;
&lt;br /&gt;
       Take a look at the following sample output.&lt;br /&gt;
&lt;br /&gt;
           $ export TZ=EST+5EDT,M4.1.0/2,M10.5.0/2&lt;br /&gt;
           $ ./next100days&lt;br /&gt;
&lt;br /&gt;
          Sunrise  08-24-2004  06:21:12   Sunset 08-24-2004  19:43:42&lt;br /&gt;
          Sunrise  08-25-2004  06:22:09   Sunset 08-25-2004  19:42:12&lt;br /&gt;
          Sunrise  08-26-2004  06:23:06   Sunset 08-26-2004  19:40:41&lt;br /&gt;
          Sunrise  08-27-2004  06:24:03   Sunset 08-27-2004  19:39:09&lt;br /&gt;
          Sunrise  08-28-2004  06:25:00   Sunset 08-28-2004  19:37:37&lt;br /&gt;
          Sunrise  08-29-2004  06:25:56   Sunset 08-29-2004  19:36:04&lt;br /&gt;
          Sunrise  08-30-2004  06:26:53   Sunset 08-30-2004  19:34:31&lt;br /&gt;
          Sunrise  08-31-2004  06:27:50   Sunset 08-31-2004  19:32:57&lt;br /&gt;
          Sunrise  09-01-2004  06:28:46   Sunset 09-01-2004  19:31:22&lt;br /&gt;
          Sunrise  09-02-2004  06:29:43   Sunset 09-02-2004  19:29:47&lt;br /&gt;
          ..[values omitted ]&lt;br /&gt;
          Sunrise  10-28-2004  07:25:31   Sunset 10-28-2004  18:02:34&lt;br /&gt;
          Sunrise  10-29-2004  07:26:38   Sunset 10-29-2004  18:01:19&lt;br /&gt;
          Sunrise  10-30-2004  07:27:46   Sunset 10-30-2004  18:00:06&lt;br /&gt;
          Sunrise  10-31-2004  06:28:53   Sunset 10-31-2004  16:58:54&lt;br /&gt;
          Sunrise  11-01-2004  06:30:01   Sunset 11-01-2004  16:57:44&lt;br /&gt;
          Sunrise  11-02-2004  06:31:10   Sunset 11-02-2004  16:56:35&lt;br /&gt;
&lt;br /&gt;
       Compare 10-30-2004 with 10-31-2004. Sunrise is an hour earlier because&lt;br /&gt;
       daylight saving time has ended, just as predicted.&lt;br /&gt;
&lt;br /&gt;
       There is an easier way to switch between timezones. Take a look at the&lt;br /&gt;
       directory zoneinfo as follows:&lt;br /&gt;
&lt;br /&gt;
            $ ls /usr/share/zoneinfo&lt;br /&gt;
&lt;br /&gt;
            Africa      Chile    Factory    Iceland      Mexico    posix       UCT&lt;br /&gt;
            America     CST6CDT  GB         Indian       Mideast   posixrules  Universal&lt;br /&gt;
            Antarctica  Cuba     GB-Eire    Iran         MST       PRC         US&lt;br /&gt;
            Arctic      EET      GMT        iso3166.tab  MST7MDT   PST8PDT     UTC&lt;br /&gt;
            Asia        Egypt    GMT0       Israel       Navajo    right       WET&lt;br /&gt;
            Atlantic    Eire     GMT-0      Jamaica      NZ        ROC         W-SU&lt;br /&gt;
            Australia   EST      GMT+0      Japan        NZ-CHAT   ROK         zone.tab&lt;br /&gt;
            Brazil      EST5EDT  Greenwich  Kwajalein    Pacific   Singapore   Zulu&lt;br /&gt;
            Canada      Etc      Hongkong   Libya        Poland    SystemV&lt;br /&gt;
            CET         Europe   HST        MET          Portugal  Turkey&lt;br /&gt;
&lt;br /&gt;
       TZ can be set to any one of these files. Some of these are directories and contain&lt;br /&gt;
       subdirectories, such as ./posix/America. This way you don not have to enter the&lt;br /&gt;
       timezone, offset, and range for dst, since it has already been calculated.&lt;br /&gt;
&lt;br /&gt;
           $ export TZ=:/usr/share/zoneinfo/posix/America/Aruba&lt;br /&gt;
           $ export TZ=:/usr/share/zoneinfo/Egypt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Reference:&lt;br /&gt;
          http://prdownloads.sourceforge.net/cpearls/date_calc.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
          Also see  (TIP 27).&lt;br /&gt;
          Also see  (TIP 103) using chrony which is very similiar to ntpd.&lt;br /&gt;
          Note time settings can usually be found in /etc/sysconfig/clock&lt;br /&gt;
         &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 2:&lt;br /&gt;
&lt;br /&gt;
     cpio works like tar, only better.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Create two directories with data ../dir1 an ../dir2)&lt;br /&gt;
&lt;br /&gt;
          mkdir -p ../dir1&lt;br /&gt;
          mkdir -p ../dir2&lt;br /&gt;
          cp /etc/*.conf ../dir1/.&lt;br /&gt;
          cp /etc/*.cnf ../dir2/.&lt;br /&gt;
&lt;br /&gt;
          Which will backup all your cnf and conf files.&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Piping the files to tar)&lt;br /&gt;
&lt;br /&gt;
          cpio works like tar but can take input&lt;br /&gt;
          from the &amp;quot;find&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar &amp;gt; test.tar&lt;br /&gt;
               or&lt;br /&gt;
           $ find ../dir1/ | cpio -o -H tar &amp;gt; test2.tar&lt;br /&gt;
&lt;br /&gt;
          Same command without the &amp;quot;&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar -F test.tar&lt;br /&gt;
              or&lt;br /&gt;
           $ find ../dir1/ | cpio -o -H tar -F test2.tar&lt;br /&gt;
&lt;br /&gt;
          Using append&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar -F test.tar&lt;br /&gt;
             or&lt;br /&gt;
           $ find ../dir2/ | cpio -o --format=tar --append -F test.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (List contents of the tar file)&lt;br /&gt;
&lt;br /&gt;
          $ cpio -it &amp;lt; test.tar&lt;br /&gt;
                or&lt;br /&gt;
          $ cpio -it -F test.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Extract the contents)&lt;br /&gt;
&lt;br /&gt;
          $ cpio -i -F test.tar&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 3:&lt;br /&gt;
&lt;br /&gt;
     Working with tar. The basics with encryption.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Using the tar command on the directory /stuff)&lt;br /&gt;
&lt;br /&gt;
          Suppose you have a directory /stuff&lt;br /&gt;
          To tar everything in stuff to create a &amp;quot;.tar&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
          $ tar -cvf stuff.tar stuff&lt;br /&gt;
&lt;br /&gt;
          Which will create &amp;quot;stuff.tar&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Using the tar command to create a &amp;quot;.tar.gz&amp;quot; of /stuff)&lt;br /&gt;
&lt;br /&gt;
          $ tar -czf stuff.tar.gz stuff&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (List the files in the archive)&lt;br /&gt;
&lt;br /&gt;
          $ tar -tzf stuff.tar.gz&lt;br /&gt;
               or&lt;br /&gt;
          $ tar -tf stuff.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (A way to list specific files)&lt;br /&gt;
&lt;br /&gt;
          Note, pipe the results to a file and edit&lt;br /&gt;
&lt;br /&gt;
           $ tar -tzf stuff.tar.gz &amp;gt; mout&lt;br /&gt;
&lt;br /&gt;
          Then, edit mout to only include the files you want&lt;br /&gt;
&lt;br /&gt;
           $ tar -T mout -xzf stuff.tar.gz&lt;br /&gt;
&lt;br /&gt;
          The above command will only get the files in mout.&lt;br /&gt;
          Of couse, if you want them all&lt;br /&gt;
&lt;br /&gt;
           $ tar -xzf stuff.tar.gz&lt;br /&gt;
&lt;br /&gt;
     STEP 5 (ENCRYPTION)&lt;br /&gt;
&lt;br /&gt;
           $ tar -zcvf - stuff|openssl des3 -salt -k secretpassword | dd of=stuff.des3&lt;br /&gt;
&lt;br /&gt;
          This will create stuff.des3...don't forget the password you&lt;br /&gt;
          put in place of  secretpassword. This can be done interactively as&lt;br /&gt;
          well.&lt;br /&gt;
&lt;br /&gt;
            $ dd if=stuff.des3 |openssl des3 -d -k secretpassword|tar zxf -&lt;br /&gt;
&lt;br /&gt;
     NOTE:  above there is a &amp;quot;-&amp;quot; at the end... this will&lt;br /&gt;
            extract everything.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 4:&lt;br /&gt;
&lt;br /&gt;
     Creating a Virtual File System and Mounting it with a Loopback Device.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Construct a 10MB file)&lt;br /&gt;
&lt;br /&gt;
           $ dd if=/dev/zero of=/tmp/disk-image count=20480&lt;br /&gt;
&lt;br /&gt;
          By default dd uses block of 512 so the size will be 20480*512&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Make an ext2 or ext3 file system) -- ext2 shown here.&lt;br /&gt;
&lt;br /&gt;
           $ mke2fs -q&lt;br /&gt;
&lt;br /&gt;
          or if you want ext3&lt;br /&gt;
&lt;br /&gt;
           $ mkfs -t ext3 -q /tmp/disk-image&lt;br /&gt;
&lt;br /&gt;
          yes, you can even use reiser, but you'll need to create a bigger&lt;br /&gt;
          disk image. Something like &amp;quot;dd if=/dev/zero of=/tmp/disk-image count=50480&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ mkfs -t reiserfs -q /tmp/disk-image&lt;br /&gt;
&lt;br /&gt;
          Hit yes for confirmation.  It only asks this because it's a file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Create a directory &amp;quot;virtual-fs&amp;quot; and mount. This has to be done as root)&lt;br /&gt;
&lt;br /&gt;
           $ mkdir /virtual-fs&lt;br /&gt;
           $ mount -o loop=/dev/loop0 /tmp/disk-image /virtual-fs&lt;br /&gt;
&lt;br /&gt;
         SPECIAL NOTE: if you mount a second device you will have to increase the&lt;br /&gt;
                       loop count: loop=/dev/loop1, loop=/dev/loop2, ... loop=/dev/loopn&lt;br /&gt;
&lt;br /&gt;
          Now it operates just like a disk. This virtual filesystem can be mounted&lt;br /&gt;
          when the system boots by adding the following to the &amp;quot;/etc/fstab&amp;quot; file. Then,&lt;br /&gt;
          to mount, just type &amp;quot;mount /virtual-fs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                 /tmp/disk-image /virtual-fs ext2               rw,loop=/dev/loop0 0 0&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (When done, umount it)&lt;br /&gt;
&lt;br /&gt;
           $ umount /virtual-fs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE: If you are using Fedora core 2, in the /etc/fstab you can take&lt;br /&gt;
              advantage of acl properties for this mount. Note the acl next to the&lt;br /&gt;
              rw entry. This is shown here with ext3.&lt;br /&gt;
&lt;br /&gt;
                 /tmp/disk-image     /virtual-fs ext3    rw,acl,loop=/dev/loop1 0 0&lt;br /&gt;
&lt;br /&gt;
              Also, if you are using Fedora core 2 and above, you can mount the file&lt;br /&gt;
              on a cryptoloop.&lt;br /&gt;
&lt;br /&gt;
                $ dd if=/dev/urandom of=disk-aes count=20480&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ modprobe loop&lt;br /&gt;
                $ modprobe cryptoloop&lt;br /&gt;
                $ modprobe aes&lt;br /&gt;
&lt;br /&gt;
                $ losetup -e aes /dev/loop0 disk-aes&lt;br /&gt;
                $ mkfs -t ext2 /dev/loop0&lt;br /&gt;
                $ mount -o loop,encryption=aes disk-aes &amp;lt;mount point&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              If you do not have Fedora core 2, then, you can build the kernel from source&lt;br /&gt;
              with some of the following options (not complete, yet)&lt;br /&gt;
               reference:&lt;br /&gt;
     http://cvs.sourceforge.net/viewcvs.py/cpearls/cpearls/src/posted_on_sf/acl/ehd.pdf?rev=1.1&amp;amp;view=log&lt;br /&gt;
&lt;br /&gt;
                      Cryptographic API Support (CONFIG_CRYPTO)&lt;br /&gt;
                      generic loop cryptographic (CONFIG_CRYPTOLOOP)&lt;br /&gt;
                      Cryptographic ciphers (CONFIG_CIPHERS)&lt;br /&gt;
                      Enable one or more  ciphers  (CONFIG CIPHER .*) such as AES.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     HELPFUL INFORMATION: It is possible to bind mount partitions, or associate the&lt;br /&gt;
                     mounted partition to a directory name.&lt;br /&gt;
&lt;br /&gt;
                  # mount --bind  /virtual-fs      /home/mchirico/vfs&lt;br /&gt;
&lt;br /&gt;
             Also, if you want to see what filesystems are currently mounted, &amp;quot;cat&amp;quot; the&lt;br /&gt;
             file &amp;quot;/etc/mtab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
                  $ cat /etc/mtab&lt;br /&gt;
&lt;br /&gt;
     Also see TIP 91.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 5:&lt;br /&gt;
&lt;br /&gt;
     Setting up 2 IP address on &amp;quot;One&amp;quot; NIC. This example is on ethernet.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (The settings for the initial IP address)&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
&lt;br /&gt;
            DEVICE=eth0&lt;br /&gt;
            BOOTPROTO=static&lt;br /&gt;
            BROADCAST=192.168.99.255&lt;br /&gt;
            IPADDR=192.168.1.155&lt;br /&gt;
            NETMASK=255.255.252.0&lt;br /&gt;
            NETWORK=192.168.1.0&lt;br /&gt;
            ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (2nd IP address: )&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/sysconfig/network-scripts/ifcfg-eth0:1&lt;br /&gt;
&lt;br /&gt;
            DEVICE=eth0:1&lt;br /&gt;
            BOOTPROTO=static&lt;br /&gt;
            BROADCAST=192.168.99.255&lt;br /&gt;
            IPADDR=192.168.1.182&lt;br /&gt;
            NETMASK=255.255.252.0&lt;br /&gt;
            NETWORK=192.168.1.0&lt;br /&gt;
            ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
     SUMMARY  Note, in STEP 1 the filename is &amp;quot;ifcfg-eth0&amp;quot;, whereas in&lt;br /&gt;
              STEP 2 it's &amp;quot;ifcfg-eth0:1&amp;quot; and also not the matching&lt;br /&gt;
              entries for &amp;quot;DEVICE=...&amp;quot;.  Also, obviously, the&lt;br /&gt;
              &amp;quot;IPADDR&amp;quot; is different as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 6:&lt;br /&gt;
&lt;br /&gt;
     Sharing Directories Among Several Users.&lt;br /&gt;
&lt;br /&gt;
     Several people are working on a project in &amp;quot;/home/share&amp;quot;&lt;br /&gt;
     and they need to create documents and programs so that&lt;br /&gt;
     others in the group can edit and execute these documents&lt;br /&gt;
     as needed. Also see (TIP 186) for adding existing users&lt;br /&gt;
     to groups.&lt;br /&gt;
&lt;br /&gt;
       $  /usr/sbin/groupadd share&lt;br /&gt;
       $  chown -R root.share /home/share&lt;br /&gt;
       $  /usr/bin/gpasswd -a &amp;lt;username&amp;gt; share&lt;br /&gt;
       $  chmod 2775 /home/share&lt;br /&gt;
&lt;br /&gt;
       $  ls -ld /home/share&lt;br /&gt;
             drwxrwsr-x    2 root     share        4096 Nov  8 16:19 /home/share&lt;br /&gt;
                   ^---------- Note the s bit, which was set with the chmod 2775&lt;br /&gt;
&lt;br /&gt;
       $  cat /etc/group&lt;br /&gt;
          ...&lt;br /&gt;
           share:x:502:chirico,donkey,zoe&lt;br /&gt;
          ...          ^------- users are added to this group.&lt;br /&gt;
&lt;br /&gt;
     The user may need to login again to get access. Or, if the user is currently&lt;br /&gt;
     logged in, they can run the following command:&lt;br /&gt;
&lt;br /&gt;
       $ su - &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Note, the above step is recommended over  &amp;quot;newgrp - share&amp;quot; since currently&lt;br /&gt;
     newgrp in FC2,FC3, and FC4 gets access to the group but the umask is not&lt;br /&gt;
     correctly formed.&lt;br /&gt;
&lt;br /&gt;
     As root you  can test their account.&lt;br /&gt;
&lt;br /&gt;
       $ su - &amp;lt;username&amp;gt;   &amp;quot;You need to '-' to pickup thier environment  '$ su - chirico' &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Note: SUID, SGID, Sticky bit. Only the left most octet is examined, and &amp;quot;chmod 755&amp;quot; is used&lt;br /&gt;
          as an example of the full command. But, anything else could be used as well. Normally&lt;br /&gt;
          you'd want executable permissions.&lt;br /&gt;
&lt;br /&gt;
        Octal digit  Binary value      Meaning                           Example usage&lt;br /&gt;
            0           000       all cleared                             $ chmod 0755 or chmod 755&lt;br /&gt;
            1           001       sticky                                  $ chmod 1755&lt;br /&gt;
            2           010       setgid                                  $ chmod 2755&lt;br /&gt;
            3           011       setgid, sticky                          $ chmod 3755&lt;br /&gt;
            4           100       setuid                                  $ chmod 4755&lt;br /&gt;
            5           101       setuid, sticky                          $ chmod 5755&lt;br /&gt;
            6           110       setuid, setgid                          $ chmod 6755&lt;br /&gt;
            7           111       setuid, setgid, sticky                  $ chmod 7755&lt;br /&gt;
&lt;br /&gt;
     A few examples applied to a directory below. In the first example all users in the group can&lt;br /&gt;
     add files to directory &amp;quot;dirA&amp;quot; and they can delete their own files. Users cannot delete other&lt;br /&gt;
     user's files.&lt;br /&gt;
&lt;br /&gt;
        Sticky bit:&lt;br /&gt;
           $ chmod 1770  dirA&lt;br /&gt;
&lt;br /&gt;
     Below files created within the directory have the group ID of the directory, rather than that&lt;br /&gt;
     of the default group setting for the user who created the file.&lt;br /&gt;
&lt;br /&gt;
        Set group ID bit:&lt;br /&gt;
           $ chmod 2755  dirB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 7:&lt;br /&gt;
&lt;br /&gt;
     Getting Infomation on Commands&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;info&amp;quot; is a great utility for getting information about the system.&lt;br /&gt;
     Here's a quick key on using &amp;quot;info&amp;quot; from the terminal prompt.&lt;br /&gt;
&lt;br /&gt;
       'q' exits.&lt;br /&gt;
       'u' moves up to the table of contents of the current section.&lt;br /&gt;
       'n' moves to the next chapter.&lt;br /&gt;
       'p' moves to the previous chapter.&lt;br /&gt;
       'space' goes into the selected section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The following is a good starting point:&lt;br /&gt;
&lt;br /&gt;
        $ info coreutils&lt;br /&gt;
&lt;br /&gt;
      Need to find out what a certain program does?&lt;br /&gt;
&lt;br /&gt;
        $ whatis  open&lt;br /&gt;
       open   (2)  - open and possibly create a file or device&lt;br /&gt;
       open   (3)  - perl pragma to set default PerlIO layers for input and output&lt;br /&gt;
       open   (3pm)  - perl pragma to set default PerlIO layers for input and output&lt;br /&gt;
       open   (n)  - Open a file-based or command pipeline channel&lt;br /&gt;
&lt;br /&gt;
      To get specific information about the open commmand&lt;br /&gt;
&lt;br /&gt;
        $ man 2 open&lt;br /&gt;
&lt;br /&gt;
       also try 'keyword' search, which is the same as the apropos command.&lt;br /&gt;
       For example, to find all the man pages on selinux, type the following:&lt;br /&gt;
&lt;br /&gt;
        $ man -k selinux&lt;br /&gt;
&lt;br /&gt;
       or the man full word search. Same as whatis command.&lt;br /&gt;
&lt;br /&gt;
        $ man -f &amp;lt;some string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       This is a hint once you are inside man.&lt;br /&gt;
&lt;br /&gt;
        space      moves forward one page&lt;br /&gt;
        b          moves backward&lt;br /&gt;
        y          scrolls up one line &amp;quot;yikes, I missed it!&amp;quot;&lt;br /&gt;
        g          goes to the beginning&lt;br /&gt;
        q          quits&lt;br /&gt;
        /&amp;lt;string&amp;gt;  search, repeat seach n&lt;br /&gt;
        m          mark, enter a letter like &amp;quot;a&amp;quot;, then, ' to go back&lt;br /&gt;
        '          enter a letter that is marked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       To get section numbers&lt;br /&gt;
&lt;br /&gt;
        $ man 8 ping&lt;br /&gt;
&lt;br /&gt;
       Note the numbers are used as follows&lt;br /&gt;
         (This is OpenBSD)&lt;br /&gt;
&lt;br /&gt;
         1  General Commands&lt;br /&gt;
         2  System Calls and Error Numbers&lt;br /&gt;
         3  C Libraries&lt;br /&gt;
         3p perl&lt;br /&gt;
         4  Devices and device drivers&lt;br /&gt;
         5  File Formats and config files&lt;br /&gt;
         6  Game instructions&lt;br /&gt;
         7  Miscellaneous information&lt;br /&gt;
         8  System maintenance&lt;br /&gt;
         9  Kernel internals&lt;br /&gt;
&lt;br /&gt;
       To find the man page directly, &amp;quot;ls&amp;quot; command:&lt;br /&gt;
&lt;br /&gt;
         $ whereis -m ls&lt;br /&gt;
         ls: /usr/share/man/man1/ls.1.gz /usr/share/man/man1/ls.1 /usr/share/man/man1p/ls.1p&lt;br /&gt;
&lt;br /&gt;
       To read this file directly, do the following:&lt;br /&gt;
&lt;br /&gt;
         $ man /usr/share/man/man1/ls.1.gz&lt;br /&gt;
&lt;br /&gt;
       If you want to know the manpath, execute manpath.&lt;br /&gt;
&lt;br /&gt;
         $ manpath&lt;br /&gt;
         /usr/share/man:/usr/X11R6/man:/usr/local/share/man:/usr/local/pgsql/man:/usr/man:/usr/local/man&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 8:&lt;br /&gt;
&lt;br /&gt;
     How to Put a &amp;quot;Running Job&amp;quot; in the Background.&lt;br /&gt;
&lt;br /&gt;
     You're running a job at the terminal prompt, and it's taking&lt;br /&gt;
     a very long time. You want to put the job in the backgroud.&lt;br /&gt;
&lt;br /&gt;
       &amp;quot;CTL - z&amp;quot; Temporarily suspends the job&lt;br /&gt;
       $ jobs     This will list all the jobs&lt;br /&gt;
       $ bg %jobnumber (bg %1)  To run in the background&lt;br /&gt;
       $ fg %jobnumber          To bring back in the foreground&lt;br /&gt;
&lt;br /&gt;
     Need to kill all jobs -- say you're using several suspended&lt;br /&gt;
     emacs sessions and you just want everything to exit.&lt;br /&gt;
&lt;br /&gt;
       $ kill -9  `jobs -p`&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;jobs -p&amp;quot; gives the process number of each job, and the&lt;br /&gt;
     kill -9 kills everything. Yes, sometimes &amp;quot;kill -9&amp;quot; is excessive&lt;br /&gt;
     and you should issue a &amp;quot;kill -15&amp;quot; that allows jobs to clean-up.&lt;br /&gt;
     However, for exacs session, I prefer &amp;quot;kill -9&amp;quot; and haven't had&lt;br /&gt;
     a problem.&lt;br /&gt;
&lt;br /&gt;
     Sometimes you need to list the process id along with job&lt;br /&gt;
     information. For instance, here's process id with the listing.&lt;br /&gt;
&lt;br /&gt;
       $ jobs -l&lt;br /&gt;
&lt;br /&gt;
     Note you can also renice a job, or give it lower priority.&lt;br /&gt;
&lt;br /&gt;
       $ nice -n +15 find . -ctime 2 -type f  -exec ls {} \; &amp;gt; last48hours&lt;br /&gt;
        ^z&lt;br /&gt;
       $  bg&lt;br /&gt;
&lt;br /&gt;
     So above that was a ctl-z to suppend. Then, bg to run it in&lt;br /&gt;
     the background. Now, if you want to change the priority lower&lt;br /&gt;
     you just renice it, once you know the process id.&lt;br /&gt;
&lt;br /&gt;
       $ jobs -pl&lt;br /&gt;
   [1]+ 29388 Running                 nice -n +15 find . -ctime 2 -exec ls -l {} \; &amp;gt;mout &amp;amp;&lt;br /&gt;
&lt;br /&gt;
       $ renice +30 -p 29388&lt;br /&gt;
        29388: old priority 15, new priority 19&lt;br /&gt;
&lt;br /&gt;
      19 was the lowest priority for this job. You cannot increase&lt;br /&gt;
      the priority unless you are root.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 9:&lt;br /&gt;
&lt;br /&gt;
     Need to Delete a File for Good -- not even GOD can recover.&lt;br /&gt;
&lt;br /&gt;
     You have a file &amp;quot;secret&amp;quot;.  The following makes it so no one&lt;br /&gt;
     can read it.  If the file was 12 bytes, it's now 4096 after it&lt;br /&gt;
     has been over written 100 times.  There's no way to recover this.&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z secret&lt;br /&gt;
&lt;br /&gt;
     Want to remove the file? Use the &amp;quot;u&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z -u test2&lt;br /&gt;
&lt;br /&gt;
     It can be applied to a device&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z -u /dev/fd0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       CAUTION: Note that shred relies on a very important assumption: that the file system  overwrites  data&lt;br /&gt;
       in  place.   This is the traditional way to do things, but many modern file system designs do not sat-&lt;br /&gt;
       isfy this assumption.  The following are examples of file systems on which shred is not effective,  or&lt;br /&gt;
       is not guaranteed to be effective in all file system modes:&lt;br /&gt;
&lt;br /&gt;
       * log-structured or journaled file systems, such as those supplied with&lt;br /&gt;
&lt;br /&gt;
              AIX and Solaris (and JFS, ReiserFS, XFS, Ext3, etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 52).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 10:&lt;br /&gt;
&lt;br /&gt;
     Who and What is doing What on Your System - finding open sockets,&lt;br /&gt;
     files etc.&lt;br /&gt;
&lt;br /&gt;
       $ lsof&lt;br /&gt;
          or as root&lt;br /&gt;
       $ watch lsof -i&lt;br /&gt;
&lt;br /&gt;
     To list all open Internet files, use:&lt;br /&gt;
&lt;br /&gt;
       $ lsof -i -U&lt;br /&gt;
&lt;br /&gt;
       (See TIP 118)&lt;br /&gt;
&lt;br /&gt;
     Also try fuser. Suppose you have a mounted file-system, and you need&lt;br /&gt;
     to umount it. To list the users on the file-system /work&lt;br /&gt;
&lt;br /&gt;
       $ fuser -u /work&lt;br /&gt;
&lt;br /&gt;
     To kill all processes accessing the file system /work  in  any way.&lt;br /&gt;
&lt;br /&gt;
       $ fuser -km /work&lt;br /&gt;
&lt;br /&gt;
     Or better yet, maybe you want to eject a cdrom on /mnt/cdrom&lt;br /&gt;
&lt;br /&gt;
       $ fuser -km /mnt/cdrom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     If you need IO load information about your system, you can execute&lt;br /&gt;
     iostat. But note, the very first iostat gives a snapshot since&lt;br /&gt;
     the last boot. You typically want the following command, which gives&lt;br /&gt;
     you 3 outputs every 5 seconds.&lt;br /&gt;
&lt;br /&gt;
       $ iostat -xtc 5 3&lt;br /&gt;
       Linux 2.6.12-1.1376_FC3smp (squeezel.squeezel.com) 	10/05/2005&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:04 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  0.97    0.06    1.94    0.62   96.41&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:09 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  0.60    0.00    1.70    0.00   97.70&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:14 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  1.00    0.00    1.60    0.00   97.39&lt;br /&gt;
&lt;br /&gt;
     vmstat reports memory statistics.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ vmstat&lt;br /&gt;
       $ ifconfig&lt;br /&gt;
       $ cat /proc/sys/vm/.. (entries under here)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      *NOTE: (TIP 77) shows sample usage of &amp;quot;ifconfig&amp;quot;. Also&lt;br /&gt;
       (TIP 84) shows sample output of &amp;quot;$ cat /proc/cpuinfo&amp;quot;. You can download iostat&lt;br /&gt;
       and other packages from (http://perso.wanadoo.fr/sebastien.godard/download_en.html).&lt;br /&gt;
       You also may want to look at iozone (TIP 178).&lt;br /&gt;
&lt;br /&gt;
     Also&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/meminfo&lt;br /&gt;
       $ cat /proc/stat&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/uptime&lt;br /&gt;
       1078623.55 1048008.34       First number is the number of seconds since boot.&lt;br /&gt;
                                   The second number is the number of idle seconds.&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/loadavg&lt;br /&gt;
       0.25 0.14 0.10 1/166 7778   This shows load at 1,5, and 15 minutes,&lt;br /&gt;
                                   a total of 1 current running process out&lt;br /&gt;
                                   from a total of 166. The 7778 is the last&lt;br /&gt;
                                   process id used.&lt;br /&gt;
                                   Ref: http://www.teamquest.com/resources/gunther/ldavg1.shtml&lt;br /&gt;
&lt;br /&gt;
     Or current process open file descriptors&lt;br /&gt;
&lt;br /&gt;
        $ ls -l /proc/self/fd/0&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lr-x------    1 chirico  chirico        64 Jun 29 13:17 3 -&amp;gt; /proc/26667/fd&lt;br /&gt;
&lt;br /&gt;
      So you could, $ echo &amp;quot;stuff&amp;quot; &amp;gt; /dev/pts/51, to get output. Note, tree is also&lt;br /&gt;
      helpful here:&lt;br /&gt;
&lt;br /&gt;
         $ tree /proc/self&lt;br /&gt;
&lt;br /&gt;
            /proc/self&lt;br /&gt;
            |-- auxv&lt;br /&gt;
            |-- cmdline&lt;br /&gt;
            |-- cwd -&amp;gt; /work/souptonuts/documentation/theBook&lt;br /&gt;
            |-- environ&lt;br /&gt;
            |-- exe -&amp;gt; /usr/bin/tree&lt;br /&gt;
            |-- fd&lt;br /&gt;
            |   |-- 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   |-- 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   |-- 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   `-- 3 -&amp;gt; /proc/26668/fd&lt;br /&gt;
            |-- maps&lt;br /&gt;
            |-- mem&lt;br /&gt;
            |-- mounts&lt;br /&gt;
            |-- root -&amp;gt; /&lt;br /&gt;
            |-- stat&lt;br /&gt;
            |-- statm&lt;br /&gt;
            |-- status&lt;br /&gt;
            |-- task&lt;br /&gt;
            |   `-- 26668&lt;br /&gt;
            |       |-- auxv&lt;br /&gt;
            |       |-- cmdline&lt;br /&gt;
            |       |-- cwd -&amp;gt; /work/souptonuts/documentation/theBook&lt;br /&gt;
            |       |-- environ&lt;br /&gt;
            |       |-- exe -&amp;gt; /usr/bin/tree&lt;br /&gt;
            |       |-- fd&lt;br /&gt;
            |       |   |-- 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   |-- 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   |-- 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   `-- 3 -&amp;gt; /proc/26668/task/26668/fd&lt;br /&gt;
            |       |-- maps&lt;br /&gt;
            |       |-- mem&lt;br /&gt;
            |       |-- mounts&lt;br /&gt;
            |       |-- root -&amp;gt; /&lt;br /&gt;
            |       |-- stat&lt;br /&gt;
            |       |-- statm&lt;br /&gt;
            |       |-- status&lt;br /&gt;
            |       `-- wchan&lt;br /&gt;
            `-- wchan&lt;br /&gt;
&lt;br /&gt;
            10 directories, 28 files&lt;br /&gt;
&lt;br /&gt;
     Need a listing of the system settings?&lt;br /&gt;
&lt;br /&gt;
       $ sysctl -a&lt;br /&gt;
&lt;br /&gt;
     Need IPC (Shared Memory Segments, Semaphore Arrays, Message Queue) status&lt;br /&gt;
     etc?&lt;br /&gt;
&lt;br /&gt;
       $ ipcs&lt;br /&gt;
       $ ipcs -l  &amp;quot;This gives limits&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Need to &amp;quot;watch&amp;quot; everything a user does?  The following watches donkey.&lt;br /&gt;
&lt;br /&gt;
       $ watch lsof -u donkey&lt;br /&gt;
&lt;br /&gt;
     Or, to see what in  going on in directory &amp;quot;/work/junk&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       $ watch lsof +D /work/junk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 11:&lt;br /&gt;
&lt;br /&gt;
     How to make a File &amp;quot;immutable&amp;quot; or &amp;quot;unalterable&amp;quot; -- it cannot be changed&lt;br /&gt;
     or deleted even by root. Note this works on (ext2/ext3) filesystems.&lt;br /&gt;
     And, yes, root can delete after it's changed back.&lt;br /&gt;
&lt;br /&gt;
     As root:&lt;br /&gt;
&lt;br /&gt;
       $ chattr +i filename&lt;br /&gt;
&lt;br /&gt;
     And to change it back:&lt;br /&gt;
&lt;br /&gt;
       $ chattr -i filename&lt;br /&gt;
&lt;br /&gt;
     List attributes&lt;br /&gt;
&lt;br /&gt;
       $ lsattr filename&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 12:&lt;br /&gt;
&lt;br /&gt;
     SSH - How to Generate the Key Pair.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     On the local server&lt;br /&gt;
&lt;br /&gt;
       $  ssh-keygen -t dsa -b 2048&lt;br /&gt;
&lt;br /&gt;
     This will create the two files:&lt;br /&gt;
&lt;br /&gt;
            .ssh/id_dsa (Private key)&lt;br /&gt;
            .ssh/id_dsa.pub  (Public key you can share)&lt;br /&gt;
&lt;br /&gt;
     Next insert &amp;quot;.ssh/id_dsa.pub&amp;quot; on the remote server&lt;br /&gt;
     in the file  &amp;quot;.ssh/authorized_keys&amp;quot; and &amp;quot;.ssh/authorized_keys2&amp;quot;&lt;br /&gt;
     and change the  permission of each file to (chmod 600). Plus, make&lt;br /&gt;
     sure the directory &amp;quot;.ssh&amp;quot; exists on the remote computer with 700 rights.&lt;br /&gt;
     Ok, assuming  192.168.1.155 is the remote server and &amp;quot;donkey&amp;quot; is the&lt;br /&gt;
     account on that remote server.&lt;br /&gt;
&lt;br /&gt;
       $ ssh donkey@192.168.1.155 &amp;quot;mkdir -p .ssh&amp;quot;&lt;br /&gt;
       $ ssh donkey@192.168.1.155 &amp;quot;chmod 700 .ssh&amp;quot;&lt;br /&gt;
       $ scp ./.ssh/id_dsa.pub  donkey@192.168.1.155:.ssh/newkey.pub&lt;br /&gt;
&lt;br /&gt;
     Now connect to that remote server &amp;quot;192.168.1.155&amp;quot; and add .ssh/newkey.pub&lt;br /&gt;
     to both &amp;quot;authorized_keys&amp;quot; and &amp;quot;authorized_keys2&amp;quot;.  When done, the permission&lt;br /&gt;
     on&lt;br /&gt;
       (This is on the remote server)&lt;br /&gt;
&lt;br /&gt;
        $chmod 600 .ssh/authorized_key*&lt;br /&gt;
&lt;br /&gt;
     Next, go back to the local server and issue the following:&lt;br /&gt;
&lt;br /&gt;
        $ ssh-agent $SHELL&lt;br /&gt;
        $ ssh-add&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;ssh-add&amp;quot; will allow you to enter the passphrase and it will&lt;br /&gt;
     save it for the current login session.&lt;br /&gt;
&lt;br /&gt;
     You don't have to enter a password when running &amp;quot;ssh-keygen&amp;quot; above. But,&lt;br /&gt;
     remember anyone with root access can &amp;quot;su - &amp;lt;username&amp;gt;&amp;quot; and then connect&lt;br /&gt;
     to your computers.  It's harder, however, not impossible, for root to do&lt;br /&gt;
     this if  you have a password.&lt;br /&gt;
&lt;br /&gt;
     (Reference TIP 151)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 13:&lt;br /&gt;
&lt;br /&gt;
     Securing the System: Don't allow root to login remotely.  Instead,&lt;br /&gt;
     the admin could login as another account, then, &amp;quot;su -&amp;quot;.  However,&lt;br /&gt;
     root can still login &amp;quot;from the local terminal&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     In the &amp;quot;/etc/ssh/sshd_config&amp;quot; file change the following lines:&lt;br /&gt;
&lt;br /&gt;
        Protocol 2&lt;br /&gt;
        PermitRootLogin no&lt;br /&gt;
        PermitEmptyPasswords no&lt;br /&gt;
&lt;br /&gt;
     Then, restart ssh&lt;br /&gt;
&lt;br /&gt;
        /etc/init.d/sshd restart&lt;br /&gt;
&lt;br /&gt;
     Why would you want to do this?  It's not possible for anyone to guess&lt;br /&gt;
     or keep trying the root account.  This is especially good for computers&lt;br /&gt;
     on the Internet. So, even if the &amp;quot;root&amp;quot; passwords is known, they can't&lt;br /&gt;
     get access to the system remotely.  Only from the terminal, which is locked&lt;br /&gt;
     in your computer room. However, if anyone has a account on the server,&lt;br /&gt;
     then, they can login under their  account then &amp;quot;su -&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Suppose you only want a limited number of users:  &amp;quot;mchirico&amp;quot; and &amp;quot;donkey&amp;quot;.&lt;br /&gt;
     Add the following line to &amp;quot;/etc/ssh/sshd_config&amp;quot;. Note, this allows access&lt;br /&gt;
     for chirico and donkey, but everyone else is denied.&lt;br /&gt;
&lt;br /&gt;
         #  Once you add AllowUsers - everyone else is denied.&lt;br /&gt;
         AllowUsers mchirico donkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 14:&lt;br /&gt;
&lt;br /&gt;
     Keep Logs Longer with Less Space.&lt;br /&gt;
&lt;br /&gt;
     Normally logs rotate monthly, over writing all the old data.  Here's a&lt;br /&gt;
     sample &amp;quot;/etc/logrotate.conf&amp;quot; that will keep 12 months of backup&lt;br /&gt;
     compressing the logfiles&lt;br /&gt;
&lt;br /&gt;
       $ cat /etc/logrotate.conf&lt;br /&gt;
&lt;br /&gt;
             # see &amp;quot;man logrotate&amp;quot; for details&lt;br /&gt;
             # rotate log files weekly&lt;br /&gt;
             #chirico changes to monthly&lt;br /&gt;
             monthly&lt;br /&gt;
&lt;br /&gt;
             # keep 4 weeks worth of backlogs&lt;br /&gt;
             # keep 12 months of backup&lt;br /&gt;
             rotate 12&lt;br /&gt;
&lt;br /&gt;
             # create new (empty) log files after rotating old ones&lt;br /&gt;
             create&lt;br /&gt;
&lt;br /&gt;
             # uncomment this if you want your log files compressed&lt;br /&gt;
             compress&lt;br /&gt;
&lt;br /&gt;
             # RPM packages drop log rotation information into this directory&lt;br /&gt;
             include /etc/logrotate.d&lt;br /&gt;
&lt;br /&gt;
             # no packages own wtmp -- we'll rotate them here&lt;br /&gt;
             /var/log/wtmp {&lt;br /&gt;
                 monthly&lt;br /&gt;
                 create 0664 root utmp&lt;br /&gt;
                 rotate 1&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
             # system-specific logs may be also be configured here.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Note: see tip 1. The clock should always be correctly set.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 15:&lt;br /&gt;
&lt;br /&gt;
     What Network Services are Running?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -atup&lt;br /&gt;
&lt;br /&gt;
     or&lt;br /&gt;
&lt;br /&gt;
          $ netstat -ap|grep LISTEN|less&lt;br /&gt;
&lt;br /&gt;
     This can be helpful to determine the services running.&lt;br /&gt;
&lt;br /&gt;
     Need stats on dropped UDP packets?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s -u&lt;br /&gt;
&lt;br /&gt;
     or TCP&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s -t&lt;br /&gt;
&lt;br /&gt;
     or summary of everything&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s&lt;br /&gt;
&lt;br /&gt;
     or looking for error rates on the interface?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -i&lt;br /&gt;
&lt;br /&gt;
     Listening interfaces?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -l&lt;br /&gt;
&lt;br /&gt;
     (Tip above provided by Amos Shapira)&lt;br /&gt;
&lt;br /&gt;
     Also see TIP 77.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 16:&lt;br /&gt;
&lt;br /&gt;
     Apache: Creating and Using an &amp;quot;.htaccess&amp;quot; File&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Below is a sample &amp;quot;.htaccess&amp;quot; file which goes in&lt;br /&gt;
     &amp;quot;/usr/local/apache/htdocs/chirico/alpha/.htaccess&amp;quot; for this&lt;br /&gt;
     example&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         AuthUserFile /usr/local/apache/htdocs/chirico/alpha/.htpasswd&lt;br /&gt;
         AuthGroupFile /dev/null&lt;br /&gt;
         AuthName &amp;quot;Your Name and regular password required&amp;quot;&lt;br /&gt;
         AuthType Basic&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;Limit GET POST&amp;gt;&lt;br /&gt;
         require valid-user&lt;br /&gt;
         &amp;lt;/Limit&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    In order for this to work /usr/local/apache/conf/httpd.conf must&lt;br /&gt;
    have the following line in it:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       #&lt;br /&gt;
       &amp;lt;Directory /usr/local/apache/htdocs/chirico/alpha&amp;gt;&lt;br /&gt;
           AllowOverride FileInfo AuthConfig Limit&lt;br /&gt;
           Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec&lt;br /&gt;
           &amp;lt;Limit GET POST OPTIONS PROPFIND&amp;gt;&lt;br /&gt;
               Order allow,deny&lt;br /&gt;
               Allow from all&lt;br /&gt;
           &amp;lt;/Limit&amp;gt;&lt;br /&gt;
           &amp;lt;LimitExcept GET POST OPTIONS PROPFIND&amp;gt;&lt;br /&gt;
               Order deny,allow&lt;br /&gt;
               Deny from all&lt;br /&gt;
           &amp;lt;/LimitExcept&amp;gt;&lt;br /&gt;
       &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Also, a password file must be created&lt;br /&gt;
&lt;br /&gt;
      $ /usr/local/apache/bin/htpasswd -c .htpasswd chirico&lt;br /&gt;
&lt;br /&gt;
    And enter the user names and passwords.&lt;br /&gt;
&lt;br /&gt;
    Next Reload Apache:&lt;br /&gt;
&lt;br /&gt;
      $ /etc/init.d/httpd reload&lt;br /&gt;
&lt;br /&gt;
    (Reference TIP 213 limit access to certain directories based on IP address).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 17:&lt;br /&gt;
&lt;br /&gt;
     Working with &amp;quot;mt&amp;quot; Commands: reading and writing to tape.&lt;br /&gt;
&lt;br /&gt;
     The following assumes the tape device is &amp;quot;/dev/st0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     STEP 1 ( rewind the tape)&lt;br /&gt;
&lt;br /&gt;
          # mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (check to see if you are at block 0)&lt;br /&gt;
&lt;br /&gt;
          # mt -f /dev/nst0 tell&lt;br /&gt;
            At block 0.&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Backup &amp;quot;tar compress&amp;quot;  directories &amp;quot;one&amp;quot;  and &amp;quot;two&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
          # tar -czf /dev/nst0 one two&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Check to see what block you are at)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
&lt;br /&gt;
       You should get something like block 2 at this point.&lt;br /&gt;
&lt;br /&gt;
     STEP 5 (Rewind the tape)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
     STEP 6 (List the files)&lt;br /&gt;
&lt;br /&gt;
           # tar -tzf /dev/nst0&lt;br /&gt;
              one/&lt;br /&gt;
              one/test&lt;br /&gt;
              two/&lt;br /&gt;
&lt;br /&gt;
     STEP 7 (Restore directory &amp;quot;one&amp;quot;  into directory &amp;quot;junk&amp;quot;).  Note, you&lt;br /&gt;
          have to first rewind the tape, since the last operation moved&lt;br /&gt;
          ahead 2 blocks. Check this with &amp;quot;mt -f /dev/nst0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           # cd junk&lt;br /&gt;
           # mt -f /dev/nst0 rewind&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
              At block 0.&lt;br /&gt;
           # tar -xzf /dev/nst0 one&lt;br /&gt;
&lt;br /&gt;
     STEP 8 (Next, take a look to see what block the tape is at)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
              At block 2.&lt;br /&gt;
&lt;br /&gt;
     STEP 9 (Now backup directories three  and four)&lt;br /&gt;
&lt;br /&gt;
           # tar -czf /dev/nst0 three four&lt;br /&gt;
&lt;br /&gt;
       After backing up the files, the tape should be past block 2.&lt;br /&gt;
       Check this.&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
             At block 4.&lt;br /&gt;
&lt;br /&gt;
          Currently the following exist:&lt;br /&gt;
&lt;br /&gt;
                At block 1:&lt;br /&gt;
                     one/&lt;br /&gt;
                    one/test&lt;br /&gt;
                    two/&lt;br /&gt;
&lt;br /&gt;
                At block 2:&lt;br /&gt;
                    three/&lt;br /&gt;
                    three/samplehere&lt;br /&gt;
                    four/&lt;br /&gt;
&lt;br /&gt;
                At block 4:&lt;br /&gt;
                    (* This is empty *)&lt;br /&gt;
&lt;br /&gt;
     A few notes. You can set the blocking factor and a label&lt;br /&gt;
     with tar. For example:&lt;br /&gt;
&lt;br /&gt;
      $ tar --label=&amp;quot;temp label&amp;quot; --create  --blocking-factor=128 --file=/dev/nst0 Notes&lt;br /&gt;
&lt;br /&gt;
     But note if you try to read it with the default, incorrect blocking&lt;br /&gt;
     factor, then, you will get the following error:&lt;br /&gt;
&lt;br /&gt;
        $ tar -t   --file=/dev/nst0&lt;br /&gt;
        tar: /dev/nst0: Cannot read: Cannot allocate memory&lt;br /&gt;
        tar: At beginning of tape, quitting now&lt;br /&gt;
        tar: Error is not recoverable: exiting now&lt;br /&gt;
&lt;br /&gt;
     However this is easily fixed with the correct blocking factor&lt;br /&gt;
&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ tar -t --blocking-factor=128 --file=/dev/nst0&lt;br /&gt;
         temp label&lt;br /&gt;
         Notes&lt;br /&gt;
&lt;br /&gt;
     Take advantage of the label command.&lt;br /&gt;
&lt;br /&gt;
         $ MYCOMMENTS=&amp;quot;Big_important_tape&amp;quot;&lt;br /&gt;
         $ tar --label=&amp;quot;$(date +%F)&amp;quot;+&amp;quot;${MYCOMMENTS}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Writing to tape on a remote 192.168.1.155 computer&lt;br /&gt;
&lt;br /&gt;
         $ tar cvzf - ./tmp | ssh -l chirico 192.168.1.155 '(mt -f /dev/nst0 rewind; dd of=/dev/st0 )'&lt;br /&gt;
&lt;br /&gt;
     Restoring the contents from tape on a remote computer&lt;br /&gt;
&lt;br /&gt;
         $ ssh -l chirico 192.168.1.155 '(mt -f /dev/nst0 rewind; dd if=/dev/st0  )'|tar xzf -&lt;br /&gt;
&lt;br /&gt;
     Getting data off of tape with dd command with odd blocking factor. Just set ibs very high&lt;br /&gt;
&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ tar --label=&amp;quot;Contenets of Notes&amp;quot; --create  --blocking-factor=128 --file=/dev/nst0 Notes&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ dd ibs=1048576 if=/dev/st0 of=notes.tar&lt;br /&gt;
&lt;br /&gt;
     The above will probably work with ibs=64k as well&lt;br /&gt;
&lt;br /&gt;
        (Also see TIP 136)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 18:&lt;br /&gt;
&lt;br /&gt;
     Encrypting Data to Tape using &amp;quot;tar&amp;quot; and &amp;quot;openssl&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     The following shows an example of writing the contents of &amp;quot;tapetest&amp;quot; to tape:&lt;br /&gt;
&lt;br /&gt;
        $ tar zcvf - tapetest|openssl des3 -salt  -k secretpassword | dd of=/dev/st0&lt;br /&gt;
&lt;br /&gt;
     Reading the data back:&lt;br /&gt;
&lt;br /&gt;
        $ dd if=/dev/st0|openssl des3 -d -k secretpassword|tar xzf -&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 19:&lt;br /&gt;
&lt;br /&gt;
     Mounting an ISO Image as a Filesystem -- this is great if you don't have the DVD&lt;br /&gt;
         hardware, but, need to get at the data.  The following show an example of&lt;br /&gt;
         mounting the Fedora core 2 as a file.&lt;br /&gt;
&lt;br /&gt;
         $ mkdir /iso0&lt;br /&gt;
         $ mount -o loop -t iso9660 /FC2-i386-DVD.iso  /iso0&lt;br /&gt;
&lt;br /&gt;
     Or to mount automatically at boot, add the following to &amp;quot;/etc/fstab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         /FC2-i386-DVD.iso /iso0     iso9660 rw,loop  0 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Reference: http://umn.dl.sourceforge.net/sourceforge/souptonuts/README_fedora.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 20:&lt;br /&gt;
&lt;br /&gt;
     Getting Information about the Hard drive and list all PCI devices.&lt;br /&gt;
&lt;br /&gt;
                $ hdparm /dev/hda&lt;br /&gt;
&lt;br /&gt;
                  /dev/hda:&lt;br /&gt;
                   multcount    = 16 (on)&lt;br /&gt;
                   IO_support   =  0 (default 16-bit)&lt;br /&gt;
                   unmaskirq    =  0 (off)&lt;br /&gt;
                   using_dma    =  1 (on)&lt;br /&gt;
                   keepsettings =  0 (off)&lt;br /&gt;
                   readonly     =  0 (off)&lt;br /&gt;
                   readahead    = 256 (on)&lt;br /&gt;
                   geometry     = 16383/255/63, sectors = 234375000, start = 0&lt;br /&gt;
&lt;br /&gt;
            or for SCSI&lt;br /&gt;
&lt;br /&gt;
                $ hdparm /dev/sda&lt;br /&gt;
&lt;br /&gt;
            Try it with the -i option for information&lt;br /&gt;
&lt;br /&gt;
                $ hdparm -i /dev/hda&lt;br /&gt;
&lt;br /&gt;
                /dev/hda:&lt;br /&gt;
&lt;br /&gt;
                Model=IC35L120AVV207-1, FwRev=V24OA66A, SerialNo=VNVD09G4CZ6E0T&lt;br /&gt;
                Config={ HardSect NotMFM HdSw&amp;gt;15uSec Fixed DTR&amp;gt;10Mbs }&lt;br /&gt;
                RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=52&lt;br /&gt;
                BuffType=DualPortCache, BuffSize=7965kB, MaxMultSect=16, MultSect=16&lt;br /&gt;
                CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=234375000&lt;br /&gt;
                IORDY=on/off, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}&lt;br /&gt;
                PIO modes:  pio0 pio1 pio2 pio3 pio4&lt;br /&gt;
                DMA modes:  mdma0 mdma1 mdma2&lt;br /&gt;
                UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5&lt;br /&gt;
                AdvancedPM=yes: disabled (255) WriteCache=enabled&lt;br /&gt;
                Drive conforms to: ATA/ATAPI-6 T13 1410D revision 3a:  2 3 4 5 6&lt;br /&gt;
&lt;br /&gt;
            How fast is your drive?&lt;br /&gt;
&lt;br /&gt;
                $ hdparm -tT /dev/hda&lt;br /&gt;
&lt;br /&gt;
                /dev/hda:&lt;br /&gt;
                Timing buffer-cache reads:   128 MB in  0.41 seconds =315.32 MB/sec&lt;br /&gt;
                Timing buffered disk reads:  64 MB in  1.19 seconds = 53.65 MB/sec&lt;br /&gt;
&lt;br /&gt;
            Need to find your device?&lt;br /&gt;
&lt;br /&gt;
                $ mount&lt;br /&gt;
                   or&lt;br /&gt;
                $ cat /proc/partitions&lt;br /&gt;
                   or&lt;br /&gt;
                $ dmesg | egrep '^(s|h)d'&lt;br /&gt;
&lt;br /&gt;
                   which for my system lists:&lt;br /&gt;
&lt;br /&gt;
                      hda: IC35L120AVV207-1, ATA DISK drive&lt;br /&gt;
                      hdc: Lite-On LTN486S 48x Max, ATAPI CD/DVD-ROM drive&lt;br /&gt;
                      hda: max request size: 1024KiB&lt;br /&gt;
                      hda: 234375000 sectors (120000 MB) w/7965KiB Cache, CHS=16383/255/63, UDMA(100)&lt;br /&gt;
&lt;br /&gt;
             By the way, if you want to turn on dma&lt;br /&gt;
&lt;br /&gt;
                 $ hdparm -d1 /dev/hda&lt;br /&gt;
                   setting using_dma to 1 (on)&lt;br /&gt;
                   using_dma    =  1 (on)&lt;br /&gt;
&lt;br /&gt;
         (Also see TIP 122 )&lt;br /&gt;
&lt;br /&gt;
     List all PCI devices&lt;br /&gt;
&lt;br /&gt;
                $ lspci -v&lt;br /&gt;
&lt;br /&gt;
          00:00.0 Host bridge: Intel Corp. 82845G/GL [Brookdale-G] Chipset Host Bridge (rev&lt;br /&gt;
                  Subsystem: Dell Computer Corporation: Unknown device 0160&lt;br /&gt;
                  Flags: bus master, fast devsel, latency 0&lt;br /&gt;
                  Memory at f0000000 (32-bit, prefetchable) [size=128M]&lt;br /&gt;
                  Capabilities: &amp;lt;available only to root&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              ... lots more ...&lt;br /&gt;
&lt;br /&gt;
           Note, there is also lspci -vv for even more information.&lt;br /&gt;
&lt;br /&gt;
          (Also see TIP 200)&lt;br /&gt;
&lt;br /&gt;
TIP 21:&lt;br /&gt;
&lt;br /&gt;
     Setting up &amp;quot;cron&amp;quot; Jobs.&lt;br /&gt;
&lt;br /&gt;
     If you want to use the emacs editor for editing cron jobs, then,&lt;br /&gt;
     set the following in your &amp;quot;/home/user/.bash_profile&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        EDITOR=emacs&lt;br /&gt;
&lt;br /&gt;
     Then, to edit cron jobs&lt;br /&gt;
&lt;br /&gt;
        $ crontab -e&lt;br /&gt;
&lt;br /&gt;
     You may want to put in the following header&lt;br /&gt;
&lt;br /&gt;
        #MINUTE(0-59) HOUR(0-23) DAYOFMONTH(1-31) MONTHOFYEAR(1-12) DAYOFWEEK(0-6) Note 0=Sun and 7=Sun&lt;br /&gt;
        #&lt;br /&gt;
        #14,15 10 * * 0   /usr/bin/somecommmand  &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     The sample &amp;quot;commented out command&amp;quot; will run at 10:14 and 10:15 every Sunday.  There will&lt;br /&gt;
     be no &amp;quot;mail&amp;quot; sent to the user because of the &amp;quot;&amp;gt;/dev/null 2&amp;gt;&amp;amp;1&amp;quot; entry.&lt;br /&gt;
&lt;br /&gt;
        $ crontab -l&lt;br /&gt;
&lt;br /&gt;
     The above will list all cron jobs. Or if you're root&lt;br /&gt;
&lt;br /&gt;
        $ crontab -l -u &amp;lt;username&amp;gt;&lt;br /&gt;
        $ crontab -e -u &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Reference &amp;quot;man 5 crontab&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
        The time and date fields are:&lt;br /&gt;
&lt;br /&gt;
                     field          allowed values&lt;br /&gt;
                     -----          --------------&lt;br /&gt;
                     minute         0-59&lt;br /&gt;
                     hour           0-23&lt;br /&gt;
                     day of month   1-31&lt;br /&gt;
                     month          1-12 (or names, see below)&lt;br /&gt;
                     day of week    0-7 (0 or 7 is Sun, or use names)&lt;br /&gt;
&lt;br /&gt;
              A field may be an asterisk (*), which always stands for ``first-last''.&lt;br /&gt;
&lt;br /&gt;
              Ranges of numbers are allowed.  Ranges are two numbers separated with a&lt;br /&gt;
              hyphen.   The  specified  range is inclusive.  For example, 8-11 for an&lt;br /&gt;
              ``hours'' entry specifies execution at hours 8, 9, 10 and 11.&lt;br /&gt;
&lt;br /&gt;
              Lists are allowed.  A list is a set of numbers (or ranges) separated by&lt;br /&gt;
              commas.  Examples: ``1,2,5,9'', ``0-4,8-12''.&lt;br /&gt;
&lt;br /&gt;
              Ranges can include &amp;quot;steps&amp;quot;, so &amp;quot;1-9/2&amp;quot; is the same as &amp;quot;1,3,5,7,9&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Note, you can run just every 5 minutes as follows:&lt;br /&gt;
&lt;br /&gt;
              */5 * * * * /etc/mrtg/domrtg  &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     To run jobs hourly,daily,weekly or monthly you can add shell scripts into the&lt;br /&gt;
     appropriate directory:&lt;br /&gt;
&lt;br /&gt;
             /etc/cron.hourly/&lt;br /&gt;
             /etc/cron.daily/&lt;br /&gt;
             /etc/cron.weekly/&lt;br /&gt;
             /etc/cron.monthly/&lt;br /&gt;
&lt;br /&gt;
     Note that the above are pre-configured schedules set in &amp;quot;/etc/crontab&amp;quot;, so&lt;br /&gt;
     if you want, you can change the schedule. Below is my /etc/crontab:&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/crontab&lt;br /&gt;
           SHELL=/bin/bash&lt;br /&gt;
           PATH=/sbin:/bin:/usr/sbin:/usr/bin&lt;br /&gt;
           MAILTO=root&lt;br /&gt;
           HOME=/&lt;br /&gt;
&lt;br /&gt;
           # run-parts&lt;br /&gt;
           01 * * * * root run-parts /etc/cron.hourly&lt;br /&gt;
           02 4 * * * root run-parts /etc/cron.daily&lt;br /&gt;
           22 4 * * 0 root run-parts /etc/cron.weekly&lt;br /&gt;
           42 4 1 * * root run-parts /etc/cron.monthly&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 22:&lt;br /&gt;
&lt;br /&gt;
     Keeping Files in Sync Between Servers.&lt;br /&gt;
&lt;br /&gt;
     The remote computer is &amp;quot;192.168.1.171&amp;quot; and has the account &amp;quot;donkey&amp;quot;.  You want&lt;br /&gt;
     to &amp;quot;keep in sync&amp;quot; the files under &amp;quot;/home/cu2000/Logs&amp;quot; on the remote computer&lt;br /&gt;
     with files on &amp;quot;/home/chirico/dev/MEDIA_Server&amp;quot; on the local computer.&lt;br /&gt;
&lt;br /&gt;
       $ rsync  -Lae ssh  donkey@192.168.1.171:/home/cu2000/Logs /home/chirico/dev/MEDIA_Server&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;rsync&amp;quot; is a convient command for keeping files in sync, and as shown here will work&lt;br /&gt;
     through ssh.  The -L option tells rsync to treat symbolic links like ordinary files.&lt;br /&gt;
&lt;br /&gt;
        Also see [http://www.rsnapshot.org/]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 23:&lt;br /&gt;
&lt;br /&gt;
     Looking up the Spelling of a Word.&lt;br /&gt;
&lt;br /&gt;
        $ look &amp;lt;partial spelling&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     so the following will list all words that&lt;br /&gt;
     start with stuff&lt;br /&gt;
&lt;br /&gt;
        $ look stuff&lt;br /&gt;
           stuff&lt;br /&gt;
           stuffage&lt;br /&gt;
           stuffata&lt;br /&gt;
           stuffed&lt;br /&gt;
           stuffender&lt;br /&gt;
           stuffer&lt;br /&gt;
           stuffers&lt;br /&gt;
           stuffgownsman&lt;br /&gt;
           stuffier&lt;br /&gt;
           stuffiest&lt;br /&gt;
           stuffily&lt;br /&gt;
           stuffiness&lt;br /&gt;
           stuffinesses&lt;br /&gt;
           stuffiness's&lt;br /&gt;
           stuffing&lt;br /&gt;
           stuffings&lt;br /&gt;
           stuffing's&lt;br /&gt;
           stuffless&lt;br /&gt;
           stuffs&lt;br /&gt;
           stuffy&lt;br /&gt;
&lt;br /&gt;
     It helps to have a large &amp;quot;linuxwords&amp;quot; dictionary.  You can download&lt;br /&gt;
     a much bigger dictionary from the following:&lt;br /&gt;
&lt;br /&gt;
              http://prdownloads.sourceforge.net/souptonuts/linuxwords.1.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
     Note: vim users can setup the .vimrc file with the following. Now when you type &lt;br /&gt;
       CTL-X CTL-T in insert mode, you'll get a thesaurus lookup.&lt;br /&gt;
&lt;br /&gt;
           set dictionary+=/usr/share/dict/words&lt;br /&gt;
           set thesaurus+=/usr/share/dict/words&lt;br /&gt;
&lt;br /&gt;
     Or, you can call aspell with the F6 command after putting the folling entry in your&lt;br /&gt;
     .vimrc file&lt;br /&gt;
&lt;br /&gt;
           :nmap &amp;lt;F6&amp;gt; :w&amp;lt;CR&amp;gt;:!aspell -e -c %&amp;lt;CR&amp;gt;:e&amp;lt;CR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Now, hit F6 when you're in vim, and you'll get a spell checker.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     There is also an X Windows dictionary that runs with the following command.&lt;br /&gt;
&lt;br /&gt;
           $ gnome-dictionary&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 24:&lt;br /&gt;
&lt;br /&gt;
     Find out if a Command is Aliased.&lt;br /&gt;
&lt;br /&gt;
         $ type -all &amp;lt;command&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Example:&lt;br /&gt;
&lt;br /&gt;
         $ type -all ls&lt;br /&gt;
            ls is aliased to `ls --color=tty'&lt;br /&gt;
            ls is /bin/ls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 25:&lt;br /&gt;
&lt;br /&gt;
     Create a Terminal Calculator&lt;br /&gt;
&lt;br /&gt;
      Put the following in your .bashrc file&lt;br /&gt;
&lt;br /&gt;
            function calc&lt;br /&gt;
            {&lt;br /&gt;
             echo &amp;quot;${1}&amp;quot;|bc -l;&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
      Or, run it at the shell prompt. Now&lt;br /&gt;
      &amp;quot;calc&amp;quot; from the shell will work as follows:&lt;br /&gt;
&lt;br /&gt;
            $ calc 3+45&lt;br /&gt;
               48&lt;br /&gt;
&lt;br /&gt;
      All functions  with a &amp;quot;(&amp;quot; or &amp;quot;)&amp;quot; must be enclosed&lt;br /&gt;
      in quotes.  For instance, to get the sin of .4&lt;br /&gt;
&lt;br /&gt;
            $ calc &amp;quot;s(.4)&amp;quot;&lt;br /&gt;
              .38941834230865049166&lt;br /&gt;
&lt;br /&gt;
          (See TIP 115 using the expr command)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 26:&lt;br /&gt;
&lt;br /&gt;
     Kill a User and All Their Current Processes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        #  This program will kill all processes from a&lt;br /&gt;
        #  user.  The user name is read from the command line.&lt;br /&gt;
        #&lt;br /&gt;
        #  This program also demonstrates reading a bash variable&lt;br /&gt;
        #  into an awk script.&lt;br /&gt;
        #&lt;br /&gt;
        #  Usage: kill9user &amp;lt;user&amp;gt;&lt;br /&gt;
        #&lt;br /&gt;
        kill -9 `ps aux|awk -v var=$1 '$1==var { print $2 }'`&lt;br /&gt;
&lt;br /&gt;
    or if you want want to create the above script the command&lt;br /&gt;
    below will kill the user &amp;quot;donkey&amp;quot; and all of his processes.&lt;br /&gt;
&lt;br /&gt;
        $ kill -9 `ps aux|awk -v var=&amp;quot;donkey&amp;quot; '$1==var { print $2 }'`&lt;br /&gt;
&lt;br /&gt;
    Check their cron jobs and &amp;quot;at&amp;quot; jobs, if you have a security issue.&lt;br /&gt;
&lt;br /&gt;
          $ crontab -u &amp;lt;user&amp;gt; -e&lt;br /&gt;
&lt;br /&gt;
    Lock the account:&lt;br /&gt;
&lt;br /&gt;
          $ passwd -l &amp;lt;user&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Remove all authorized_keys&lt;br /&gt;
&lt;br /&gt;
          $ rm /home/user/.shosts&lt;br /&gt;
          $ rm /home/user/.rhosts&lt;br /&gt;
          $ rm -rf /home/user/.ssh&lt;br /&gt;
          $ rm /home/user/.forward&lt;br /&gt;
&lt;br /&gt;
      or consider&lt;br /&gt;
&lt;br /&gt;
          $ mv /home/user  /home/safeuser&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Change the shell&lt;br /&gt;
&lt;br /&gt;
          $ chsh -s /bin/true &amp;lt;user&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Do an inventory&lt;br /&gt;
&lt;br /&gt;
          $ find / -user &amp;lt;user&amp;gt;  &amp;gt; list_of_user_files&lt;br /&gt;
&lt;br /&gt;
    NOTE: Also see (TIP 10).&lt;br /&gt;
&lt;br /&gt;
    To see all users, except the current user. Do not use the&lt;br /&gt;
    dash &amp;quot;ps -aux&amp;quot; is wrong but the following is correct:&lt;br /&gt;
&lt;br /&gt;
          $ ps aux| awk '!/'${USER}'/{printf(&amp;quot;%s \n&amp;quot;,$0)}'&lt;br /&gt;
&lt;br /&gt;
     or (ww = wide, wide output)&lt;br /&gt;
&lt;br /&gt;
          $ ps auwwx| awk '!/'${USER}'/{printf(&amp;quot;%s \n&amp;quot;,$0)}'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    The following codes may be useful:&lt;br /&gt;
&lt;br /&gt;
       D    Uninterruptible sleep (usually IO)&lt;br /&gt;
       R    Running or runnable (on run queue)&lt;br /&gt;
       S    Interruptible sleep (waiting for an event to complete)&lt;br /&gt;
       T    Stopped, either by a job control signal or because it is being traced.&lt;br /&gt;
       W    paging (not valid since the 2.6.xx kernel)&lt;br /&gt;
       X    dead (should never be seen)&lt;br /&gt;
       Z    Defunct (&amp;quot;zombie&amp;quot;) process, terminated but not reaped by its parent.&lt;br /&gt;
&lt;br /&gt;
    For BSD formats and when the stat keyword is used, additional&lt;br /&gt;
       characters may be displayed:&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;    high-priority (not nice to other users)&lt;br /&gt;
       N    low-priority (nice to other users)&lt;br /&gt;
       L    has pages locked into memory (for real-time and custom IO)&lt;br /&gt;
       s    is a session leader&lt;br /&gt;
       l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)&lt;br /&gt;
       +    is in the foreground process group&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Also see TIP 28. and TIP 89.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 27:&lt;br /&gt;
&lt;br /&gt;
     Format Dates for Logs and Files&lt;br /&gt;
&lt;br /&gt;
         $ date &amp;quot;+%m%d%y %A,%B %d %Y %X&amp;quot;&lt;br /&gt;
             061704 Thursday,June 17 2004 07:13:40 PM&lt;br /&gt;
&lt;br /&gt;
         $ date &amp;quot;+%m%d%Y&amp;quot;&lt;br /&gt;
             06172004&lt;br /&gt;
&lt;br /&gt;
         $ date -d '1 day ago' &amp;quot;+%m%d%Y&amp;quot;&lt;br /&gt;
             06162004&lt;br /&gt;
&lt;br /&gt;
         $ date -d '3 months 1 day  2 hour  15 minutes 2 seconds ago'&lt;br /&gt;
&lt;br /&gt;
      or to go into the future remove the &amp;quot;ago&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         $ date -d '3 months 1 day  2 hour  15 minutes 2 seconds '&lt;br /&gt;
&lt;br /&gt;
            Also the following works:&lt;br /&gt;
&lt;br /&gt;
                $ date -d '+2 year +1 month -1 week  +3 day -8 hour +2 min -5 seconds'&lt;br /&gt;
&lt;br /&gt;
      Quick question: If there are 100,000,000 stars in the visible sky, and you can&lt;br /&gt;
      count them, round the clock, at a rate of a star per second starting now, when&lt;br /&gt;
      would you finish counting?  Would you still be alive?&lt;br /&gt;
&lt;br /&gt;
                $ date -d '+100000000 seconds'&lt;br /&gt;
&lt;br /&gt;
      Sooner than you think!&lt;br /&gt;
&lt;br /&gt;
      This can be assigned to variables&lt;br /&gt;
&lt;br /&gt;
         $ mdate=`date -d '3 months 1 day  2 hour  15 minutes 2 seconds ' &amp;quot;+%m%d%Y_%A_%B_%D_%Y_%X&amp;quot;  `&lt;br /&gt;
         $ echo $mdate&lt;br /&gt;
             09182004_Saturday_September_09/18/04_2004_09:40:41 PM&lt;br /&gt;
             ^---- Easy to sort   ^-------^----- Easy to read&lt;br /&gt;
&lt;br /&gt;
      See TIP 28 below.&lt;br /&gt;
&lt;br /&gt;
      See TIP 87 when working with large delta time changes -40 years, or -200 years ago, or even&lt;br /&gt;
      1,000,000 days into the future.&lt;br /&gt;
&lt;br /&gt;
      Also see (TIP 1) for working with time zones.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 28:&lt;br /&gt;
&lt;br /&gt;
     Need Ascii Codes? For instance, for printing quotes:&lt;br /&gt;
&lt;br /&gt;
                         awk 'BEGIN { msg = &amp;quot;Don\047t Panic!&amp;quot;; printf &amp;quot;%s \n&amp;quot;,msg }'&lt;br /&gt;
              or&lt;br /&gt;
                         awk 'BEGIN { msg = &amp;quot;Don\x027t Panic!&amp;quot;; printf &amp;quot;%s \n&amp;quot;,msg }'&lt;br /&gt;
&lt;br /&gt;
     It's better to use \047, because certain characters that follow \x027 may cause problems.&lt;br /&gt;
&lt;br /&gt;
     For example, take a look at the following two lines. The first line prints a &amp;quot;}&amp;quot; caused&lt;br /&gt;
     by the extra D in \x027D. The the line immediately below does not work as expected.&lt;br /&gt;
&lt;br /&gt;
                      awk 'BEGIN {printf(&amp;quot;The D causes problems \x027D\n&amp;quot;)}'&lt;br /&gt;
&lt;br /&gt;
            However, the line below works fine:&lt;br /&gt;
&lt;br /&gt;
                      awk 'BEGIN {printf(&amp;quot;The D does not cause problems \047D\n&amp;quot;)}'&lt;br /&gt;
&lt;br /&gt;
     Or if you wanted to use the date command in &amp;quot;awk&amp;quot; to print date.time.nanosecond.timezone for&lt;br /&gt;
     each line of a file &amp;quot;test&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     The following date can be used in awk because the single quotes are enclosed within the&lt;br /&gt;
     double quotes.&lt;br /&gt;
&lt;br /&gt;
             date '+%m%d%Y.%H%M%S.%N%z'&lt;br /&gt;
&lt;br /&gt;
       $ awk 'BEGIN { &amp;quot;date '+%m%d%Y.%H%M%S.%N%z'&amp;quot; | getline MyDate  } { print MyDate,$0 }' &amp;lt; data&lt;br /&gt;
&lt;br /&gt;
     But it's also possible to replace  &amp;quot;+&amp;quot;  with  \x2B,  &amp;quot;%&amp;quot; with \x25, and &amp;quot;d&amp;quot; with \x64 as follows:&lt;br /&gt;
&lt;br /&gt;
       $ awk 'BEGIN { &amp;quot;date \x27\x2B\x25m\x25\x64\x25Y.\x25H\x25M\x25S.\x25N\x25z\x27&amp;quot; | getline MyDate  } { print MyDate,$0 }' &amp;lt; test&lt;br /&gt;
&lt;br /&gt;
             07062004.113820.346033000-0400 bob 71&lt;br /&gt;
             07062004.113820.346033000-0400 tom 43&lt;br /&gt;
             07062004.113820.346033000-0400 sal 34&lt;br /&gt;
             07062004.113820.346033000-0400 bob 89&lt;br /&gt;
             07062004.113820.346033000-0400 tom 66&lt;br /&gt;
             07062004.113820.346033000-0400 sal 99&lt;br /&gt;
&lt;br /&gt;
     For this example it's not needed because single quotes are used inside of double quotes; however, there may be times when&lt;br /&gt;
     hex replacement is easier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ man ascii&lt;br /&gt;
&lt;br /&gt;
        Oct   Dec   Hex   Char           Oct   Dec   Hex   Char&lt;br /&gt;
            -----------------------------------------------------------&lt;br /&gt;
            000   0     00    NUL '\0'       100   64    40    @&lt;br /&gt;
            001   1     01    SOH            101   65    41    A&lt;br /&gt;
            002   2     02    STX            102   66    42    B&lt;br /&gt;
            003   3     03    ETX            103   67    43    C&lt;br /&gt;
            004   4     04    EOT            104   68    44    D&lt;br /&gt;
            005   5     05    ENQ            105   69    45    E&lt;br /&gt;
            006   6     06    ACK            106   70    46    F&lt;br /&gt;
            007   7     07    BEL '\a'       107   71    47    G&lt;br /&gt;
            010   8     08    BS  '\b'       110   72    48    H&lt;br /&gt;
            011   9     09    HT  '\t'       111   73    49    I&lt;br /&gt;
            012   10    0A    LF  '\n'       112   74    4A    J&lt;br /&gt;
            013   11    0B    VT  '\v'       113   75    4B    K&lt;br /&gt;
            014   12    0C    FF  '\f'       114   76    4C    L&lt;br /&gt;
            015   13    0D    CR  '\r'       115   77    4D    M&lt;br /&gt;
            016   14    0E    SO             116   78    4E    N&lt;br /&gt;
            017   15    0F    SI             117   79    4F    O&lt;br /&gt;
            020   16    10    DLE            120   80    50    P&lt;br /&gt;
            021   17    11    DC1            121   81    51    Q&lt;br /&gt;
            022   18    12    DC2            122   82    52    R&lt;br /&gt;
            023   19    13    DC3            123   83    53    S&lt;br /&gt;
            024   20    14    DC4            124   84    54    T&lt;br /&gt;
            025   21    15    NAK            125   85    55    U&lt;br /&gt;
            026   22    16    SYN            126   86    56    V&lt;br /&gt;
            027   23    17    ETB            127   87    57    W&lt;br /&gt;
            030   24    18    CAN            130   88    58    X&lt;br /&gt;
            031   25    19    EM             131   89    59    Y&lt;br /&gt;
            032   26    1A    SUB            132   90    5A    Z&lt;br /&gt;
            033   27    1B    ESC            133   91    5B    [&lt;br /&gt;
            034   28    1C    FS             134   92    5C    \   '\\'&lt;br /&gt;
            035   29    1D    GS             135   93    5D    ]&lt;br /&gt;
            036   30    1E    RS             136   94    5E    ^&lt;br /&gt;
            037   31    1F    US             137   95    5F    _&lt;br /&gt;
            040   32    20    SPACE          140   96    60    `&lt;br /&gt;
            041   33    21    !              141   97    61    a&lt;br /&gt;
            042   34    22    &amp;quot;              142   98    62    b&lt;br /&gt;
            043   35    23    #              143   99    63    c&lt;br /&gt;
            044   36    24    $              144   100   64    d&lt;br /&gt;
            045   37    25    %              145   101   65    e&lt;br /&gt;
            046   38    26    &amp;amp;              146   102   66    f&lt;br /&gt;
            047   39    27    '              147   103   67    g&lt;br /&gt;
            050   40    28    (              150   104   68    h&lt;br /&gt;
            051   41    29    )              151   105   69    i&lt;br /&gt;
            052   42    2A    *              152   106   6A    j&lt;br /&gt;
            053   43    2B    +              153   107   6B    k&lt;br /&gt;
            054   44    2C    ,              154   108   6C    l&lt;br /&gt;
            055   45    2D    -              155   109   6D    m&lt;br /&gt;
            056   46    2E    .              156   110   6E    n&lt;br /&gt;
            057   47    2F    /              157   111   6F    o&lt;br /&gt;
            060   48    30    0              160   112   70    p&lt;br /&gt;
            061   49    31    1              161   113   71    q&lt;br /&gt;
            062   50    32    2              162   114   72    r&lt;br /&gt;
            063   51    33    3              163   115   73    s&lt;br /&gt;
            064   52    34    4              164   116   74    t&lt;br /&gt;
            065   53    35    5              165   117   75    u&lt;br /&gt;
            066   54    36    6              166   118   76    v&lt;br /&gt;
            067   55    37    7              167   119   77    w&lt;br /&gt;
            070   56    38    8              170   120   78    x&lt;br /&gt;
            071   57    39    9              171   121   79    y&lt;br /&gt;
            072   58    3A    :              172   122   7A    z&lt;br /&gt;
            073   59    3B    ;              173   123   7B    {&lt;br /&gt;
            074   60    3C    &amp;lt;              174   124   7C    |&lt;br /&gt;
            075   61    3D    =              175   125   7D    }&lt;br /&gt;
            076   62    3E    &amp;gt;              176   126   7E    ~&lt;br /&gt;
            077   63    3F    ?              177   127   7F    DEL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 29:&lt;br /&gt;
&lt;br /&gt;
     Need a WWW Browser for the Terminal Session? Try lynx or elinks.&lt;br /&gt;
&lt;br /&gt;
         $ lynx&lt;br /&gt;
&lt;br /&gt;
     Or to read all these tips, with the latest updates&lt;br /&gt;
&lt;br /&gt;
      $ lynx http://umn.dl.sourceforge.net/sourceforge/souptonuts/How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Or, better yet elinks.&lt;br /&gt;
&lt;br /&gt;
         $ elinks http://somepage.&lt;br /&gt;
&lt;br /&gt;
     You can get elinks at the following site:&lt;br /&gt;
&lt;br /&gt;
             http://elinks.or.cz/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 30:&lt;br /&gt;
&lt;br /&gt;
    screen - screen manager with VT100/ANSI terminal emulation&lt;br /&gt;
&lt;br /&gt;
         This is an excellent utility. But if you work a lot in Emacs,&lt;br /&gt;
         then, you should place the following in your ~./.bashrc&lt;br /&gt;
&lt;br /&gt;
             alias s='screen -e^Pa -D -R'&lt;br /&gt;
&lt;br /&gt;
         After loging in again (or source .bashrc) ,&lt;br /&gt;
         type the following to load &amp;quot;screen&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
             $ s&lt;br /&gt;
&lt;br /&gt;
         If you're using the not using the alias command above, substitute&lt;br /&gt;
         CTL-a for CTL-p below. :&lt;br /&gt;
&lt;br /&gt;
             CTL-p CTL-C       To get a new session&lt;br /&gt;
             CTL-p  &amp;quot;           To list sessions, and arrow keys to move&lt;br /&gt;
             CTL-p SHFT-A      To name sessions&lt;br /&gt;
             CTL-p S            To split screens&lt;br /&gt;
             CLT-p Q            To unsplit screens&lt;br /&gt;
             CLT-p TAB          To switch between screens&lt;br /&gt;
             CLT-p :resize n    To resize screen to n rows, on split screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Screen is very powerful.  Should you become disconneced, you can&lt;br /&gt;
         still resume work after loggin in.&lt;br /&gt;
&lt;br /&gt;
             $ man screen&lt;br /&gt;
&lt;br /&gt;
         The above command will give you more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 31:&lt;br /&gt;
&lt;br /&gt;
     Need to Find the Factors of a Number?&lt;br /&gt;
&lt;br /&gt;
           $ factor 2345678992&lt;br /&gt;
                2345678992: 2 2 2 2 6581 22277&lt;br /&gt;
&lt;br /&gt;
     It's a quick way to find out if a number is prime&lt;br /&gt;
&lt;br /&gt;
           $ factor 7867&lt;br /&gt;
                7867: 7867&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 32:&lt;br /&gt;
&lt;br /&gt;
     Less is More -- piping to less to scroll backword and forward&lt;br /&gt;
&lt;br /&gt;
      For large &amp;quot;ls&amp;quot; listings try the followin, then, use the arrow key&lt;br /&gt;
      to move up and down the list.&lt;br /&gt;
&lt;br /&gt;
           $ ls /some_large_dir/ | less&lt;br /&gt;
&lt;br /&gt;
                 or&lt;br /&gt;
&lt;br /&gt;
           $ cat some_large_file | less&lt;br /&gt;
&lt;br /&gt;
                 or&lt;br /&gt;
&lt;br /&gt;
           $ less some_large_file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 33:&lt;br /&gt;
&lt;br /&gt;
     C &amp;quot;indent&amp;quot; Settings for Kernel Development&lt;br /&gt;
&lt;br /&gt;
           $ indent -kr -i8  program.c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 34:&lt;br /&gt;
&lt;br /&gt;
     FTP auto-login.  &amp;quot;ftp&amp;quot; to a site and have the password stored.&lt;br /&gt;
&lt;br /&gt;
     For instance, here's a sample &amp;quot;.net&amp;quot; file in a user's home&lt;br /&gt;
     directory for uploading to sourceforge. Note, sourceforge will&lt;br /&gt;
     take any password, so m@temp.com is used here for login &amp;quot;anonymous&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ cat ~/.netrc&lt;br /&gt;
               machine upload.sourceforge.net login anonymous password m@temp.com&lt;br /&gt;
               default login anonymous password user@site&lt;br /&gt;
&lt;br /&gt;
     It might be a good idea to change the rights on this file&lt;br /&gt;
&lt;br /&gt;
           $ chmod 0400 ~/.netrc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         #!/bin/bash&lt;br /&gt;
         #&lt;br /&gt;
         #  Sample ftp automated script to download&lt;br /&gt;
         #  file to ${dwnld}&lt;br /&gt;
         #&lt;br /&gt;
         dwnld=&amp;quot;/work/faq/unix-faq&amp;quot;&lt;br /&gt;
         cd ${dwnld}&lt;br /&gt;
         ftp &amp;lt;&amp;lt; FTPSTRING&lt;br /&gt;
         prompt off&lt;br /&gt;
         open rtfm.mit.edu&lt;br /&gt;
         cd /pub/usenet-by-group/news.answers/unix-faq/faq&lt;br /&gt;
         mget contents&lt;br /&gt;
         mget diff&lt;br /&gt;
         mget part*&lt;br /&gt;
         bye&lt;br /&gt;
         FTPSTRING&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      (Also see TIP 114 for ncftpget, which is a very powerful restarting&lt;br /&gt;
                            ftp program)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 35:&lt;br /&gt;
&lt;br /&gt;
     Bash Brace Expansion&lt;br /&gt;
&lt;br /&gt;
           $ echo f{ee,ie,oe,um}&lt;br /&gt;
                fee fie foe fum&lt;br /&gt;
&lt;br /&gt;
     This works with almost any command&lt;br /&gt;
&lt;br /&gt;
           $ mkdir -p /work/junk/{one,two,three,four}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 36:&lt;br /&gt;
&lt;br /&gt;
     Getting a List of Users on the System&lt;br /&gt;
&lt;br /&gt;
           $ cut -d: -f1 /etc/passwd | sort&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 37:&lt;br /&gt;
&lt;br /&gt;
     Editing a Bash Command&lt;br /&gt;
&lt;br /&gt;
      Try typing a long command say, then, type &amp;quot;fc&amp;quot; for an easy way&lt;br /&gt;
      to edit the command.&lt;br /&gt;
&lt;br /&gt;
           $ find /etc -iname '*.cnf' -exec grep -H 'log' {} \;&lt;br /&gt;
           $ fc&lt;br /&gt;
&lt;br /&gt;
      &amp;quot;fc&amp;quot; will bring the last command typed into an editor, &amp;quot;emacs&amp;quot; if&lt;br /&gt;
      that's the default editor. Type &amp;quot;fc -l&amp;quot; to list last few commands.&lt;br /&gt;
&lt;br /&gt;
      To seach for a command, try typing &amp;quot;CTL-r&amp;quot; at the shell prompt for&lt;br /&gt;
      searching. &amp;quot;CTL-t&amp;quot; to transpose, say &amp;quot;sl&amp;quot; was typed by you want &amp;quot;ls&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Hints when using &amp;quot;fc: in emacs:&lt;br /&gt;
&lt;br /&gt;
           ESC-b     move one word backward&lt;br /&gt;
           ESC-f     move one word forward&lt;br /&gt;
           ESC-DEL   kill one word backward&lt;br /&gt;
           CTL-k     kill point to end&lt;br /&gt;
           CTL-y     un-yank killed region at point&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 38:&lt;br /&gt;
&lt;br /&gt;
     Moving around Directories.&lt;br /&gt;
&lt;br /&gt;
     Change to the home directory:&lt;br /&gt;
          $ cd ~&lt;br /&gt;
            or&lt;br /&gt;
          $ cd&lt;br /&gt;
&lt;br /&gt;
     To go back to the last directory&lt;br /&gt;
          $ cd -&lt;br /&gt;
&lt;br /&gt;
     Instead of &amp;quot;cd&amp;quot; to a directory try &amp;quot;pushd&amp;quot; and look&lt;br /&gt;
     at the heading...you can see a list of directories.&lt;br /&gt;
&lt;br /&gt;
          $ pushd /etc&lt;br /&gt;
          $ pushd /usr/local&lt;br /&gt;
&lt;br /&gt;
      Then, to get back &amp;quot;popd&amp;quot; or &amp;quot;popd 1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      To list all the directories pushed on the stack&lt;br /&gt;
      use the &amp;quot;dirs -v&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
          $ dirs -v&lt;br /&gt;
           0  /usr/local&lt;br /&gt;
           1  /etc&lt;br /&gt;
           2  /work/souptonuts/documentation/theBook&lt;br /&gt;
&lt;br /&gt;
      Now, if you &amp;quot;pushd +1&amp;quot; you will be moved to &amp;quot;/etc&amp;quot;, since&lt;br /&gt;
      is number &amp;quot;1&amp;quot; on the stack, and this directory will become&lt;br /&gt;
      &amp;quot;0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ pwd&lt;br /&gt;
           /usr/local&lt;br /&gt;
          $ pushd +1&lt;br /&gt;
          $ pwd&lt;br /&gt;
           /etc&lt;br /&gt;
&lt;br /&gt;
          $ dirs -v&lt;br /&gt;
           0  /etc&lt;br /&gt;
           1  /work/souptonuts/documentation/theBook&lt;br /&gt;
           2  /usr/local&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 39:&lt;br /&gt;
&lt;br /&gt;
     Need an Underscore after a Variable?&lt;br /&gt;
&lt;br /&gt;
       Enclose the variable in &amp;quot;{}&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $echo ${UID}_&lt;br /&gt;
&lt;br /&gt;
       Compare to&lt;br /&gt;
&lt;br /&gt;
          $echo $UID_&lt;br /&gt;
&lt;br /&gt;
       Also try the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ m=&amp;quot;my stuff here&amp;quot;&lt;br /&gt;
                $ echo -e ${m// /'\n'}&lt;br /&gt;
                        my&lt;br /&gt;
                        stuff&lt;br /&gt;
                        here&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 40:&lt;br /&gt;
&lt;br /&gt;
     Bash Variable Offset and String Operators&lt;br /&gt;
&lt;br /&gt;
        $ r=&amp;quot;this is stuff&amp;quot;&lt;br /&gt;
        $ echo ${r:3}&lt;br /&gt;
        $ echo ${r:5:2}&lt;br /&gt;
&lt;br /&gt;
      Note, ${varname:offset:length}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         ${varname:?message}  If varname exist and isn't null return value, else,&lt;br /&gt;
                              print var and message.&lt;br /&gt;
&lt;br /&gt;
           $ r=&amp;quot;new stuff&amp;quot;&lt;br /&gt;
           $ echo ${r:? &amp;quot;that's r for you&amp;quot;}&lt;br /&gt;
               new stuff&lt;br /&gt;
           $ unset r&lt;br /&gt;
           $ echo ${r:? &amp;quot;that's r for you&amp;quot;}&lt;br /&gt;
               bash: r:  that's r for you&lt;br /&gt;
&lt;br /&gt;
         ${varname:+word}    If varname exist and not null return word. Else, return null.&lt;br /&gt;
&lt;br /&gt;
         ${varname:-word}    If varname exist and not null return value. Else, return word.&lt;br /&gt;
&lt;br /&gt;
      Working with arrays in bash - bash arrays.&lt;br /&gt;
&lt;br /&gt;
           $ unset p&lt;br /&gt;
           $ p=(one two three)&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[@]}&amp;quot;&lt;br /&gt;
           one two three&lt;br /&gt;
&lt;br /&gt;
      or&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[*]}&amp;quot;&lt;br /&gt;
           one two three&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${#p[@]}&amp;quot;&lt;br /&gt;
           3&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[0]}&amp;quot;&lt;br /&gt;
           one&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[1]}&amp;quot;&lt;br /&gt;
           two&lt;br /&gt;
&lt;br /&gt;
            Also see (TIP 95)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 41:&lt;br /&gt;
&lt;br /&gt;
     Loops in Bash&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The command below loops through directories listed in $PATH.&lt;br /&gt;
&lt;br /&gt;
          $ path=$PATH:&lt;br /&gt;
          $ while [ $path ]; do echo &amp;quot; ${path%%:*} &amp;quot;; path=${path#*:}; done&lt;br /&gt;
&lt;br /&gt;
       The command below will also loop through directories in your path.&lt;br /&gt;
&lt;br /&gt;
          $IFS=:&lt;br /&gt;
          $ for dir in $PATH&lt;br /&gt;
          &amp;gt; do&lt;br /&gt;
          &amp;gt; ls -ld $dir&lt;br /&gt;
          &amp;gt; done&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Jun 10 20:16 /usr/local/bin&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Jun 13 23:12 /bin&lt;br /&gt;
              drwxr-xr-x    3 root     root        40960 Jun 12 08:00 /usr/bin&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Feb 14 03:12 /usr/X11R6/bin&lt;br /&gt;
              drwxrwxr-x    2 chirico  chirico      4096 Jun  6 13:06 /home/chirico/bin&lt;br /&gt;
&lt;br /&gt;
     Other ways of doing loops:&lt;br /&gt;
&lt;br /&gt;
        for (( i=1; i &amp;lt;= 20; i++))&lt;br /&gt;
                do&lt;br /&gt;
                        echo -n &amp;quot;$i &amp;quot;&lt;br /&gt;
                done&lt;br /&gt;
&lt;br /&gt;
     Note, to do it all on one line, do the following:&lt;br /&gt;
&lt;br /&gt;
        $ for (( i=1; i &amp;lt;= 20; i++)); do echo -n &amp;quot;$i&amp;quot;; done&lt;br /&gt;
&lt;br /&gt;
     Below, is an example of declaring i an integer so that you do not&lt;br /&gt;
     have to preface with let.&lt;br /&gt;
&lt;br /&gt;
          $ declare -i i&lt;br /&gt;
          $ i=5;&lt;br /&gt;
          $ while (( $i &amp;gt; 1 )); do&lt;br /&gt;
          &amp;gt; i=i-1&lt;br /&gt;
          &amp;gt; echo $i&lt;br /&gt;
          &amp;gt; done&lt;br /&gt;
          4&lt;br /&gt;
          3&lt;br /&gt;
          2&lt;br /&gt;
&lt;br /&gt;
     You can also use &amp;quot;while [ $i -gt 1 ]; do&amp;quot;  in place of &amp;quot;while (( $i &amp;gt; 1 )); do&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     To get a listing of all declared values&lt;br /&gt;
&lt;br /&gt;
          $ declare -i&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Try putting a few words in the file &amp;quot;test&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         $ while read filename; do echo  &amp;quot;- $filename &amp;quot;; done &amp;lt; test |nl -w1&lt;br /&gt;
&lt;br /&gt;
     Or, using an array&lt;br /&gt;
&lt;br /&gt;
                declare -a Array&lt;br /&gt;
                Array[0]=&amp;quot;zero&amp;quot;&lt;br /&gt;
                Array[1]=&amp;quot;one&amp;quot;&lt;br /&gt;
                Array[2]=&amp;quot;two&amp;quot;&lt;br /&gt;
                for i in `seq ${#Array[@]}`&lt;br /&gt;
                do&lt;br /&gt;
                  echo $Array[$i-1]&lt;br /&gt;
                done&lt;br /&gt;
&lt;br /&gt;
         Also see (TIP 95 and TIP 133).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 42:&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;diff&amp;quot; and &amp;quot;patch&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
        You have created a program &amp;quot;prog.c&amp;quot;, saved as this name and also copied&lt;br /&gt;
        to  &amp;quot;prog.c.old&amp;quot;. You post &amp;quot;prog.c&amp;quot; to users.  Next, you make changes&lt;br /&gt;
        to prog.c&lt;br /&gt;
&lt;br /&gt;
          $ diff -c prog.c.old prog.c &amp;gt; prog.patch&lt;br /&gt;
&lt;br /&gt;
        Now, users can get the latest updates by running.&lt;br /&gt;
&lt;br /&gt;
          $ patch &amp;lt; prog.patch&lt;br /&gt;
&lt;br /&gt;
        By the way, you can make backups of your data easily.&lt;br /&gt;
&lt;br /&gt;
          $ cp /etc/fstab{,.bak}&lt;br /&gt;
&lt;br /&gt;
        Now, you do your edits to &amp;quot;/etc/fstab&amp;quot; and if you need&lt;br /&gt;
        to go back to the original, you can find it at&lt;br /&gt;
        &amp;quot;/etc/fstab.bak&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 43:&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;cat&amp;quot; the Contents of Files Listed in a File, in That Order.&lt;br /&gt;
&lt;br /&gt;
       SETUP (Assume you have the following)&lt;br /&gt;
&lt;br /&gt;
              $ cat file_of_files&lt;br /&gt;
                  file1&lt;br /&gt;
                  file2&lt;br /&gt;
&lt;br /&gt;
              $ cat file1&lt;br /&gt;
                  This is the data in file1&lt;br /&gt;
&lt;br /&gt;
              $ cat file 2&lt;br /&gt;
                  This is the data in file2&lt;br /&gt;
&lt;br /&gt;
       So there are 3 files here &amp;quot;file_of_files&amp;quot; which contains the name of&lt;br /&gt;
       other files.  In this case &amp;quot;file1&amp;quot; and &amp;quot;file2&amp;quot;. And the contents of&lt;br /&gt;
       &amp;quot;file1&amp;quot; and &amp;quot;file2&amp;quot; is shown above.&lt;br /&gt;
&lt;br /&gt;
               $ cat file_of_files|xargs cat&lt;br /&gt;
                    This is the data in  file1&lt;br /&gt;
                    This is the data in  file2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 44:&lt;br /&gt;
&lt;br /&gt;
     Columns and Rows -- getting anything you want.&lt;br /&gt;
&lt;br /&gt;
     Assume you have the following file.&lt;br /&gt;
&lt;br /&gt;
        $ cat data&lt;br /&gt;
           1 2 3&lt;br /&gt;
           4 5&lt;br /&gt;
           6 7 8 9 10&lt;br /&gt;
           11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
     How to you get everything in  2 columns?&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l2&lt;br /&gt;
           1 2&lt;br /&gt;
           3 4&lt;br /&gt;
           5 6&lt;br /&gt;
           7 8&lt;br /&gt;
           9 10&lt;br /&gt;
           11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
    Three columns?&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l3&lt;br /&gt;
           1 2 3&lt;br /&gt;
           4 5 6&lt;br /&gt;
           7 8 9&lt;br /&gt;
           10 11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
    What's the row sum of the &amp;quot;three columns?&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
           6&lt;br /&gt;
           15&lt;br /&gt;
           24&lt;br /&gt;
           33&lt;br /&gt;
           27&lt;br /&gt;
&lt;br /&gt;
    or&lt;br /&gt;
&lt;br /&gt;
        $ tr ' ' '\n' &amp;lt; data |xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
&lt;br /&gt;
    NOTE &amp;quot;Steven Heiner's rule&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
             cat one_file | program&lt;br /&gt;
&lt;br /&gt;
           can always be rewritten as&lt;br /&gt;
&lt;br /&gt;
             program &amp;lt; one_file&lt;br /&gt;
&lt;br /&gt;
   Note: thanks to Steven Heiner (http://www.shelldorado.com/) the above can be&lt;br /&gt;
       shortened as follows:&lt;br /&gt;
&lt;br /&gt;
               $ tr ' ' '\n' &amp;lt; data|xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
&lt;br /&gt;
          Need to &amp;quot;tr&amp;quot; from the stdin?&lt;br /&gt;
&lt;br /&gt;
               $ tr &amp;quot;xy&amp;quot; &amp;quot;yx&amp;quot;| ... | ...&lt;br /&gt;
&lt;br /&gt;
       But there is a the &amp;quot;Stephane CHAZELAS&amp;quot; condition here&lt;br /&gt;
&lt;br /&gt;
         &amp;quot;Note that tr, sed, and awk mail fail on files containing '\0'&lt;br /&gt;
          sed and awk have unspecified behaviors if the input&lt;br /&gt;
          doesn't end in a '\n' (or to sum up, cat works for&lt;br /&gt;
          binary and text files, text utilities such as sed or awk&lt;br /&gt;
          work only for text files).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 45:&lt;br /&gt;
&lt;br /&gt;
     Auto Directory Spelling Corrections.&lt;br /&gt;
&lt;br /&gt;
      To turn this on:&lt;br /&gt;
&lt;br /&gt;
           $ shopt -s cdspell&lt;br /&gt;
&lt;br /&gt;
      Now mispell a directory in the cd command.&lt;br /&gt;
&lt;br /&gt;
           $ cd /usk/local&lt;br /&gt;
                   ^-------- still gets you to --&lt;br /&gt;
                                                |&lt;br /&gt;
                                            /usr/local&lt;br /&gt;
&lt;br /&gt;
      What other options can you set? The following will list&lt;br /&gt;
      all the options:&lt;br /&gt;
&lt;br /&gt;
           $ shopt -p&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 46:&lt;br /&gt;
&lt;br /&gt;
     Record Eveything Printed on Your Terminal Screen.&lt;br /&gt;
&lt;br /&gt;
            $ script -a &amp;lt;filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Now start doing stuff and &amp;quot;everything&amp;quot; is appended to &amp;lt;filename&amp;gt;.&lt;br /&gt;
     For example&lt;br /&gt;
&lt;br /&gt;
            $ script installation&lt;br /&gt;
&lt;br /&gt;
            $ (command)&lt;br /&gt;
&lt;br /&gt;
            $ (result)&lt;br /&gt;
&lt;br /&gt;
            $ ...&lt;br /&gt;
&lt;br /&gt;
            $ ...&lt;br /&gt;
&lt;br /&gt;
            $ (command)&lt;br /&gt;
&lt;br /&gt;
            $ (result)&lt;br /&gt;
&lt;br /&gt;
            $ exit&lt;br /&gt;
&lt;br /&gt;
     The whole session log is in the installation file that you can later&lt;br /&gt;
     read and/or cleanup and add to a documentation.&lt;br /&gt;
&lt;br /&gt;
     This command can also be used to redirect the contents to another user,&lt;br /&gt;
     but you must be root to do this.&lt;br /&gt;
&lt;br /&gt;
     Step 1 - find out what pts they are using.&lt;br /&gt;
&lt;br /&gt;
            $ w&lt;br /&gt;
&lt;br /&gt;
     Step 2 - Run script on that pts. After running this command below&lt;br /&gt;
              everything you type will appear on their screen.&lt;br /&gt;
&lt;br /&gt;
            $ script /dev/pts/4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Thanks to Jacques.GARNIER-EXTERIEUR@EU.RHODIA.COM for his contribution&lt;br /&gt;
     to this tip.&lt;br /&gt;
&lt;br /&gt;
     Also reference TIP 208.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 47:&lt;br /&gt;
&lt;br /&gt;
     Monitor all Network Traffic Except Your Current ssh Connection.&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX -s 1500 port not 22&lt;br /&gt;
&lt;br /&gt;
       Or to filter out port 123 as well getting the full length of the packet&lt;br /&gt;
       (-s 0), use the following:&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX -s 0 port not 22  and port not 123&lt;br /&gt;
&lt;br /&gt;
       Or to filter only a certain host say 81.169.158.205&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX  port not 22 and host 81.169.158.205&lt;br /&gt;
&lt;br /&gt;
     Just want ip addresses and a little bit of data, then,&lt;br /&gt;
     use this. The &amp;quot;-c 20&amp;quot; is to stop after 20 packets.&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN  -s 1500 port not 22 -c 20&lt;br /&gt;
&lt;br /&gt;
     If you're looking for sign of DOS attacks, the following show just the SYN&lt;br /&gt;
     packets on all interfaces:&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump 'tcp[13] &amp;amp; 2 == 2'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 48:&lt;br /&gt;
&lt;br /&gt;
     Where are the GNU Reference Manuals?&lt;br /&gt;
&lt;br /&gt;
           http://www.gnu.org/manual/manual.html&lt;br /&gt;
&lt;br /&gt;
     Also worth a look the &amp;quot;Linux Documentation Project&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           http://en.tldp.org/&lt;br /&gt;
&lt;br /&gt;
     and Red Hat manuals&lt;br /&gt;
&lt;br /&gt;
           http://www.redhat.com/docs/manuals/enterprise/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 49:&lt;br /&gt;
&lt;br /&gt;
     Setting or Changing the Library Path.&lt;br /&gt;
&lt;br /&gt;
     The following contains the settings to be added or deleted&lt;br /&gt;
&lt;br /&gt;
           /etc/ld.so.conf&lt;br /&gt;
&lt;br /&gt;
     After this file is edited, you must run the following:&lt;br /&gt;
&lt;br /&gt;
           $ ldconfig&lt;br /&gt;
&lt;br /&gt;
     See &amp;quot;man ldconfig&amp;quot; for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 50:&lt;br /&gt;
&lt;br /&gt;
     Working with Libraries in C&lt;br /&gt;
&lt;br /&gt;
     Assume the following 3 programs:&lt;br /&gt;
&lt;br /&gt;
      $ cat ./src/test.c&lt;br /&gt;
&lt;br /&gt;
         int test(int t)&lt;br /&gt;
         {&lt;br /&gt;
           printf(&amp;quot;%d\n&amp;quot;,t);&lt;br /&gt;
           return t;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      $ cat ./src/prog1.c&lt;br /&gt;
&lt;br /&gt;
         /*&lt;br /&gt;
          program: prog1.c&lt;br /&gt;
          dependences: test.c&lt;br /&gt;
&lt;br /&gt;
          compiling this program:&lt;br /&gt;
          gcc -o prog test.c prog1.c&lt;br /&gt;
&lt;br /&gt;
          Note the libpersonal include&lt;br /&gt;
          should be remove if NOT using the&lt;br /&gt;
          library&lt;br /&gt;
         */&lt;br /&gt;
&lt;br /&gt;
         #include &amp;lt;libpersonal.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         int&lt;br /&gt;
         main(int argc, char **argv)&lt;br /&gt;
         {&lt;br /&gt;
           test(45);&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
      $ cat ./include/libpersonal.h&lt;br /&gt;
&lt;br /&gt;
         extern int test(int);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Prog1.c needs the test function in  test.c&lt;br /&gt;
     To compile, so that both programs work together, do the following:&lt;br /&gt;
&lt;br /&gt;
          $ cd src&lt;br /&gt;
          $ gcc -o prog test.c prog1.c -I../include&lt;br /&gt;
&lt;br /&gt;
     However, if you want to create your own static library, then, run the following:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p ../lib&lt;br /&gt;
          $ gcc -c test.c  -o ../lib/test.o&lt;br /&gt;
          $ cd ../lib&lt;br /&gt;
          $ ar r libpersonal.a test.o&lt;br /&gt;
          $ ranlib libpersonal.a&lt;br /&gt;
&lt;br /&gt;
     or, the ar and ranlib command can be combined as follows:&lt;br /&gt;
&lt;br /&gt;
          $ ar rs libpersonal.a test.o&lt;br /&gt;
&lt;br /&gt;
     To compile the program with the static library:&lt;br /&gt;
&lt;br /&gt;
          $ cd ../src&lt;br /&gt;
          $ gcc -I../include -L../lib -o prog1 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     The -I../include  tells  gcc to look in the ../include directory for&lt;br /&gt;
     libpersonal.h. and -L../lib, tells gcc to look for the&lt;br /&gt;
     &amp;quot;libpersonal.a&amp;quot; library.&lt;br /&gt;
&lt;br /&gt;
           $ cd ..&lt;br /&gt;
           $ tree src lib include&lt;br /&gt;
           src&lt;br /&gt;
           |-- prog&lt;br /&gt;
           |-- prog1&lt;br /&gt;
           |-- prog1.c&lt;br /&gt;
           `-- test.c&lt;br /&gt;
           lib&lt;br /&gt;
           |-- libpersonal.a&lt;br /&gt;
           `-- test.o&lt;br /&gt;
           include&lt;br /&gt;
           `-- libpersonal.h&lt;br /&gt;
&lt;br /&gt;
     This was a STATIC library. Often times you will want to use a SHARED&lt;br /&gt;
     or dynamic library.&lt;br /&gt;
&lt;br /&gt;
     SHARED LIBRARY:&lt;br /&gt;
&lt;br /&gt;
     You must recompile test.c with -fpic option.&lt;br /&gt;
&lt;br /&gt;
          $ cd ../lib&lt;br /&gt;
          $ gcc -c -fpic ../src/test.c -o test.o&lt;br /&gt;
&lt;br /&gt;
     Next create the libpersonal.so file.&lt;br /&gt;
&lt;br /&gt;
          $ gcc -shared -o libpersonal.so test.o&lt;br /&gt;
&lt;br /&gt;
     Now, compile the source prog1.c as follows:&lt;br /&gt;
&lt;br /&gt;
          $ cd ../src&lt;br /&gt;
          $ gcc -Wl,-R../lib -L../lib -I../include -o prog2 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
     This should work fine. But, take a look at prog2 using the ldd command.&lt;br /&gt;
&lt;br /&gt;
          $ ldd prog2&lt;br /&gt;
&lt;br /&gt;
        libpersonal.so =&amp;gt; ../lib/libpersonal.so (0x40017000)&lt;br /&gt;
        libc.so.6 =&amp;gt; /lib/tls/libc.so.6 (0x42000000)&lt;br /&gt;
        /lib/ld-linux.so.2 =&amp;gt; /lib/ld-linux.so.2 (0x40000000)&lt;br /&gt;
&lt;br /&gt;
     If you move the program prog2 to a different location, it will not run.&lt;br /&gt;
     Instead you will get the following error:&lt;br /&gt;
&lt;br /&gt;
           prog2: error while loading shared libraries: libpersonal.so:&lt;br /&gt;
                     cannot open shared object file: No such file or directory&lt;br /&gt;
&lt;br /&gt;
     To fix this, you should specify the direct path to the library. And in my&lt;br /&gt;
     case it is rather long&lt;br /&gt;
&lt;br /&gt;
      $  gcc -Wl,-R/work/souptonuts/documentation/theBook/lib -L../lib -I../include -o prog2 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE: The -R must always follow the -Wl.  (-Wl,-R&amp;lt;directory&amp;gt;) They always go together&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 51:&lt;br /&gt;
&lt;br /&gt;
     Actively Monitor a File and Send Email when Expression Occurs.&lt;br /&gt;
&lt;br /&gt;
     This is a way to monitor &amp;quot;/var/log/messages&amp;quot; or any file for certain changes.&lt;br /&gt;
     The example below actively monitors &amp;quot;stuff&amp;quot; for the work &amp;quot;now&amp;quot; and as soon as&lt;br /&gt;
     &amp;quot;now&amp;quot; is added to the file, the contents of msg are sent to the user&lt;br /&gt;
     mikechirico@hotmail.com&lt;br /&gt;
&lt;br /&gt;
          $ tail -f stuff | \&lt;br /&gt;
              awk ' /now/ { system(&amp;quot;mail -s \&amp;quot;This is working\&amp;quot;  mikechirico@hotmail.com &amp;lt; msg&amp;quot;) }'&lt;br /&gt;
&lt;br /&gt;
     Or, you can run a program, say get headings on slashdot from the program &amp;quot;getslash.php&amp;quot; which&lt;br /&gt;
     runs on  &amp;quot;192.168.1.155&amp;quot; with account &amp;quot;chirico&amp;quot;. Assuming you have ssh keys setup, then, the following&lt;br /&gt;
     will send mail from the output:&lt;br /&gt;
&lt;br /&gt;
          $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;|mail -s &amp;quot;Slash cron Headlines&amp;quot;  mchirico@comcast.net&lt;br /&gt;
&lt;br /&gt;
     See (TIP 80) for scraping the headings on slash dot and how to get a copy of &amp;quot;getslash.php&amp;quot;.  If you still&lt;br /&gt;
     want to use awk:&lt;br /&gt;
&lt;br /&gt;
           $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;| \&lt;br /&gt;
                      awk '{ print $0 | &amp;quot;mail -s \x27 Slash Topics \x27 mchirico@comcast.net &amp;quot;}'&lt;br /&gt;
&lt;br /&gt;
     Note the &amp;quot;\x27&amp;quot; is a quote.  Maybe you only want articles dealing with &amp;quot;Linux&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
           $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;| \&lt;br /&gt;
                      awk '/Linux/{ print $0 | &amp;quot;mail -s \x27 Slash Topics \x27 mchirico@comcast.net &amp;quot;}'&lt;br /&gt;
&lt;br /&gt;
     For $60, you can get a numeric display from &amp;quot;delcom engineering&amp;quot; that you can send messages and&lt;br /&gt;
     data to.  I get weather information off the internet and send it to this device.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/projects/delcom/&lt;br /&gt;
&lt;br /&gt;
     (Reference TIP 151 for ssh tips)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 52:&lt;br /&gt;
&lt;br /&gt;
     Need to Keep Secrets? Encrypt it.&lt;br /&gt;
&lt;br /&gt;
      To Encrypt:&lt;br /&gt;
&lt;br /&gt;
            $ openssl des3 -salt -in file.txt -out file.des3&lt;br /&gt;
&lt;br /&gt;
      The above will prompt for a password, or you can put it in&lt;br /&gt;
      with a -k option, assuming you're on a trusted server.&lt;br /&gt;
&lt;br /&gt;
      To Decrypt&lt;br /&gt;
&lt;br /&gt;
            $  openssl des3 -d -salt -in file.des3 -out file.txt -k mypassword&lt;br /&gt;
&lt;br /&gt;
      Need to encrypt what you type? Enter the following, then start typing&lt;br /&gt;
      and  ^D to end.&lt;br /&gt;
&lt;br /&gt;
            $ openssl des3 -salt -out stuff.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 53:&lt;br /&gt;
&lt;br /&gt;
     Check that a File has Not Been Tampered With: Use Cryptographic Hashing Function.&lt;br /&gt;
&lt;br /&gt;
     The md5sum is popular but dated&lt;br /&gt;
&lt;br /&gt;
              $ md5sum file&lt;br /&gt;
&lt;br /&gt;
     Instead, use one of the following;&lt;br /&gt;
&lt;br /&gt;
              $ openssl dgst -sha1 -c file&lt;br /&gt;
&lt;br /&gt;
              $ openssl dgst -ripemd160 -c  file&lt;br /&gt;
&lt;br /&gt;
     All calls give a fixed length string or &amp;quot;message digest&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 54:&lt;br /&gt;
&lt;br /&gt;
     Need to View Information About a Secure Web Server? A SSL/TLS test.&lt;br /&gt;
&lt;br /&gt;
           $ openssl s_client -connect www.sourceforge.net:443&lt;br /&gt;
&lt;br /&gt;
     Above will give a long listing of certificates.&lt;br /&gt;
&lt;br /&gt;
     Note, it is also possible to get certificate information about a mail server&lt;br /&gt;
&lt;br /&gt;
           $ openssl s_client -connect mail.comcast.net:995 -showcerts&lt;br /&gt;
&lt;br /&gt;
     When you do the above command you get two certificates. If you copy&lt;br /&gt;
     past both certificates by taking the following contents include the&lt;br /&gt;
     begin and end show below:&lt;br /&gt;
&lt;br /&gt;
                 -----BEGIN CERTIFICATE-----&lt;br /&gt;
                 ....&lt;br /&gt;
                 -----END CERTIFICATE-----&lt;br /&gt;
&lt;br /&gt;
     Then create files &amp;quot;comcast0.pem&amp;quot; and &amp;quot;comcast1.pem&amp;quot; out of these certificaties and&lt;br /&gt;
     put them in a directory &amp;quot;/home/donkey/.certs&amp;quot;, then, with the openssl src package, in&lt;br /&gt;
     the &amp;quot;./tools/c_rehash&amp;quot; run&lt;br /&gt;
&lt;br /&gt;
            $ c_rehash .certs&lt;br /&gt;
            Doing .certs&lt;br /&gt;
            comcast0.pem =&amp;gt; 72f90dc0.0&lt;br /&gt;
            comcast1.pem =&amp;gt; f73e89fd.0&lt;br /&gt;
&lt;br /&gt;
     Now it's possible to have fetchmail work with these certs.&lt;br /&gt;
&lt;br /&gt;
       #&lt;br /&gt;
       #&lt;br /&gt;
       # Sample .fetchmailrc file for Comcast&lt;br /&gt;
       #&lt;br /&gt;
       # Check mail every 90 seconds&lt;br /&gt;
       set daemon 90&lt;br /&gt;
       set syslog&lt;br /&gt;
       set postmaster donkey&lt;br /&gt;
       #set bouncemail&lt;br /&gt;
       #&lt;br /&gt;
       # Comcast email is zdonkey but computer account is  just donkey&lt;br /&gt;
       #&lt;br /&gt;
       poll mail.comcast.net with proto POP3 and options no dns&lt;br /&gt;
              user 'zdonkey' with pass &amp;quot;somethin35&amp;quot;  is 'donkey' here options ssl sslcertck sslcertpath '/home/donkey/.certs'&lt;br /&gt;
              smtphost comcast.net&lt;br /&gt;
       # currently not used&lt;br /&gt;
       mda '/usr/bin/procmail -d %T'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     REFERENCE: http://www.openssl.org/&lt;br /&gt;
                http://www.catb.org/~esr/fetchmail/fetchmail-6.2.5.tar.gz&lt;br /&gt;
                http://www.madboa.com/geek/openssl/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 55:&lt;br /&gt;
&lt;br /&gt;
     cp --parents. What does this option do?&lt;br /&gt;
&lt;br /&gt;
     Assume you have the following directory structure&lt;br /&gt;
&lt;br /&gt;
            .&lt;br /&gt;
            |-- a&lt;br /&gt;
            |   `-- b&lt;br /&gt;
            |       `-- c&lt;br /&gt;
            |           `-- d&lt;br /&gt;
            |               |-- file1&lt;br /&gt;
            |               `-- file2&lt;br /&gt;
            `-- newdir&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Issue the following command:&lt;br /&gt;
&lt;br /&gt;
         $ cp --parents ./a/b/c/d/* ./newdir/&lt;br /&gt;
&lt;br /&gt;
     Now you have the following:&lt;br /&gt;
&lt;br /&gt;
            .&lt;br /&gt;
            |-- a&lt;br /&gt;
            |   `-- b&lt;br /&gt;
            |       `-- c&lt;br /&gt;
            |           `-- d&lt;br /&gt;
            |               |-- file1&lt;br /&gt;
            |               `-- file2&lt;br /&gt;
            `-- newdir&lt;br /&gt;
                `-- a&lt;br /&gt;
                    `-- b&lt;br /&gt;
                        `-- c&lt;br /&gt;
                            `-- d&lt;br /&gt;
                                |-- file1&lt;br /&gt;
                                `-- file2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 56:&lt;br /&gt;
&lt;br /&gt;
     Quickly Locating files.&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;locate&amp;quot; command quickly searches the indexed database for files.  It just&lt;br /&gt;
     gives the name of the files; but, if you need more information use it as follows&lt;br /&gt;
&lt;br /&gt;
         $ locate document|xargs ls -l&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;locate&amp;quot; database may only get updated every 24 hours.  For more recent finds,&lt;br /&gt;
     use the &amp;quot;find&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 57:&lt;br /&gt;
&lt;br /&gt;
     Using the &amp;quot;find&amp;quot; Command.&lt;br /&gt;
&lt;br /&gt;
     List only directories, max 2 nodes down that have &amp;quot;net&amp;quot; in the name&lt;br /&gt;
&lt;br /&gt;
       $ find /proc -type d -maxdepth 2 -iname '*net*'&lt;br /&gt;
&lt;br /&gt;
     Find all *.c and *.h files starting from the current &amp;quot;.&amp;quot; position.&lt;br /&gt;
&lt;br /&gt;
       $ find . \( -iname '*.c'  -o -iname '*.h' \) -print&lt;br /&gt;
&lt;br /&gt;
     Find all, but skip what's in &amp;quot;/CVS&amp;quot; and &amp;quot;/junk&amp;quot;. Start from &amp;quot;/work&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ find /work \( -iregex '.*/CVS'  -o -iregex '.*/junk' \)  -prune -o -print&lt;br /&gt;
&lt;br /&gt;
     Note -regex and -iregex work on the directory as well, which means&lt;br /&gt;
     you must consider the &amp;quot;./&amp;quot; that comes before all listings.&lt;br /&gt;
&lt;br /&gt;
     Here is another example. Find all files except what is under the CVS, including&lt;br /&gt;
     CVS listings. Also exclude &amp;quot;#&amp;quot; and &amp;quot;~&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       $ find . -regex '.*' ! \( -regex '.*CVS.*'  -o -regex '.*[#|~].*' \)&lt;br /&gt;
&lt;br /&gt;
     Find a *.c file, then run grep on it looking for &amp;quot;stdio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       $ find . -iname '*.c' -exec grep -H 'stdio.h' {} \;&lt;br /&gt;
         sample output --&amp;gt;  ./prog1.c:#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
                            ./test.c:#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Looking for the disk-hog on the whole system?&lt;br /&gt;
&lt;br /&gt;
       $ find /  -size +10000k 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
     Looking for files changed in the last 24 hours? Make sure you add the&lt;br /&gt;
     minus sign &amp;quot;-1&amp;quot;, otherwise, you will only find files changed exactly&lt;br /&gt;
     24 hours from now. With the &amp;quot;-1&amp;quot; you get files changed from now to 24&lt;br /&gt;
     hours.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ find  . -ctime -1  -printf &amp;quot;%a %f\n&amp;quot;&lt;br /&gt;
       Wed Oct  6 12:51:56 2004 .&lt;br /&gt;
       Wed Oct  6 12:35:16 2004 How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
     Or if you just want files.&lt;br /&gt;
&lt;br /&gt;
       $ find . -type f -ctime -1  -printf &amp;quot;%a %f\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Details on file status change in the last 48 hours, current directory. Also note &amp;quot;-atime -2&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
       $ find . -ctime -2 -type f -exec ls -l {} \;&lt;br /&gt;
&lt;br /&gt;
             NOTE: if you don't use -type f, you make get &amp;quot;.&amp;quot; returned, which&lt;br /&gt;
             when run through ls &amp;quot;ls .&amp;quot; may list more than what you want.&lt;br /&gt;
&lt;br /&gt;
             Also you may only want the current directory&lt;br /&gt;
&lt;br /&gt;
       $ find . -ctime -2 -type f -maxdepth 1 -exec ls -l {} \;&lt;br /&gt;
&lt;br /&gt;
     To find files modified within the last 5 to 10 minutes&lt;br /&gt;
&lt;br /&gt;
       $ find . -mmin +5 -mmin -10 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     For more example &amp;quot;find&amp;quot; commands, reference the following looking&lt;br /&gt;
     for the latest version of &amp;quot;bashscripts.x.x.x.tar.gz&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79320&amp;amp;package_id=80711&lt;br /&gt;
&lt;br /&gt;
     See &amp;quot;TIP 71&amp;quot; for examples of find using the inode feature. &amp;quot; $ find . -inum &amp;lt;inode&amp;gt; -exec rm -- '{}' \; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     If you don't want error messages, or need to redirect error messages &amp;quot;&amp;gt; /dev/null 2&amp;gt;&amp;amp;1&amp;quot;, or see&lt;br /&gt;
     &amp;quot;TIP 81&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 58:&lt;br /&gt;
&lt;br /&gt;
     Using the &amp;quot;rm&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
     How do you remove a file that has the name &amp;quot;-&amp;quot;.  For instance, if you run the command&lt;br /&gt;
     &amp;quot;$ cat &amp;gt; - &amp;quot; and type some text followed by ^d, how does the &amp;quot;-&amp;quot; file get deleted?&lt;br /&gt;
&lt;br /&gt;
        $ rm -- -&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;--&amp;quot; nullifies any rm options.&lt;br /&gt;
&lt;br /&gt;
     How do you delete the directory &amp;quot;one&amp;quot;, all it's sub-directories, and any data?&lt;br /&gt;
&lt;br /&gt;
        $ rm -rf ./one&lt;br /&gt;
&lt;br /&gt;
     Note, to selectively delete stuff on a directory, use the find command &amp;quot;TIP 57&amp;quot;.&lt;br /&gt;
     To delete by inode, see &amp;quot;TIP 71&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 59:&lt;br /&gt;
&lt;br /&gt;
     Giving ownership.&lt;br /&gt;
&lt;br /&gt;
     How do you give the user &amp;quot;donkey&amp;quot; ownership to all directories and files under&lt;br /&gt;
     &amp;quot;./fordonkey&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          $ chown -R donkey ./fordonkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 60:&lt;br /&gt;
&lt;br /&gt;
     Only Permit root login -- give others a message when they try to login.&lt;br /&gt;
&lt;br /&gt;
     Create the file &amp;quot;/etc/nologin&amp;quot; with &amp;quot;nologin&amp;quot; containing the contents&lt;br /&gt;
     of the message.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 61:&lt;br /&gt;
&lt;br /&gt;
     Limits: file size, open files, pipe size, stack size, max memory size&lt;br /&gt;
             cpu time, plus others.&lt;br /&gt;
&lt;br /&gt;
     To get a listing of current limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -a&lt;br /&gt;
             core file size        (blocks, -c) 0&lt;br /&gt;
             data seg size         (kbytes, -d) unlimited&lt;br /&gt;
             file size             (blocks, -f) unlimited&lt;br /&gt;
             max locked memory     (kbytes, -l) unlimited&lt;br /&gt;
             max memory size       (kbytes, -m) unlimited&lt;br /&gt;
             open files                    (-n) 1024&lt;br /&gt;
             pipe size          (512 bytes, -p) 8&lt;br /&gt;
             stack size            (kbytes, -s) 8192&lt;br /&gt;
             cpu time             (seconds, -t) unlimited&lt;br /&gt;
             max user processes            (-u) 8179&lt;br /&gt;
             virtual memory        (kbytes, -v) unlimited&lt;br /&gt;
&lt;br /&gt;
     Note as a user you can decrease your limits in the current&lt;br /&gt;
     shell session; but, you cannot increase.  This can be ideal&lt;br /&gt;
     for testing programs.  But, first you may want to create&lt;br /&gt;
     another shell &amp;quot;sh&amp;quot; so that you can &amp;quot;go back to where started&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -f 10&lt;br /&gt;
&lt;br /&gt;
     Now try&lt;br /&gt;
&lt;br /&gt;
          $ yes &amp;gt;&amp;gt; out&lt;br /&gt;
             File size limit exceeded&lt;br /&gt;
&lt;br /&gt;
     To set limits on users, make changes to &amp;quot;/etc/security/limits.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           bozo   - maxlogins 1&lt;br /&gt;
&lt;br /&gt;
     Will keep bozo from loging in more than once.&lt;br /&gt;
&lt;br /&gt;
     To list hard limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -Ha&lt;br /&gt;
&lt;br /&gt;
     To list soft limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -Sa&lt;br /&gt;
&lt;br /&gt;
     To restrict user access by time, day make changes to&lt;br /&gt;
             &amp;quot;/etc/security/time.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Also take a look at &amp;quot;/etc/profile&amp;quot; to see what other changes&lt;br /&gt;
     can be made, plus take a look under &amp;quot;/etc/security/*.conf&amp;quot; for&lt;br /&gt;
     other configuration files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 62:&lt;br /&gt;
&lt;br /&gt;
     Stupid &amp;quot;cat&amp;quot; Tricks.&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 43).&lt;br /&gt;
&lt;br /&gt;
     If you have multiple blank lines, squeeze these lines down to one,&lt;br /&gt;
     then, try the following:&lt;br /&gt;
&lt;br /&gt;
          $ cat -s &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to number the lines?&lt;br /&gt;
&lt;br /&gt;
          $ cat -n &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to show tabs?&lt;br /&gt;
&lt;br /&gt;
          $ cat -t &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Need to mark end of lines by &amp;quot;$&amp;quot;? The following was suggested by  (Amos Shapira)&lt;br /&gt;
&lt;br /&gt;
          $ cat -e &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to see all the ctl characters?&lt;br /&gt;
&lt;br /&gt;
          /* ctlgen.c&lt;br /&gt;
            Program to generate ctl characters.&lt;br /&gt;
&lt;br /&gt;
            Compile:&lt;br /&gt;
&lt;br /&gt;
               gcc -o ctlgen ctlgen.c&lt;br /&gt;
&lt;br /&gt;
            Run:&lt;br /&gt;
&lt;br /&gt;
               ./ctlgen &amp;gt; mout&lt;br /&gt;
&lt;br /&gt;
            Now see the characters:&lt;br /&gt;
&lt;br /&gt;
               cat -v mout&lt;br /&gt;
&lt;br /&gt;
            Here's a sample output:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               $ cat -v mout|tail&lt;br /&gt;
                   test M-v&lt;br /&gt;
                   test M-w&lt;br /&gt;
                   test M-x&lt;br /&gt;
                   test M-y&lt;br /&gt;
                   test M-z&lt;br /&gt;
                   test M-{&lt;br /&gt;
                   test M-|&lt;br /&gt;
                   test M-}&lt;br /&gt;
                   test M-~&lt;br /&gt;
                   test M-^?&lt;br /&gt;
&lt;br /&gt;
          */&lt;br /&gt;
          #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
          #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
          int main()&lt;br /&gt;
          {&lt;br /&gt;
            int i;&lt;br /&gt;
&lt;br /&gt;
            for(i=0; i &amp;lt; 256; ++i)&lt;br /&gt;
              printf(&amp;quot;test %c \n&amp;quot;,i);&lt;br /&gt;
&lt;br /&gt;
            return 0;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 63:&lt;br /&gt;
&lt;br /&gt;
     Guard against SYN attacks and &amp;quot;ping&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     As root do the following:&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/tcp_syncookies&lt;br /&gt;
&lt;br /&gt;
     Want to disable &amp;quot;ping&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_all&lt;br /&gt;
&lt;br /&gt;
     Disable broadcast/multicast &amp;quot;ping&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts&lt;br /&gt;
&lt;br /&gt;
     And to enable again:&lt;br /&gt;
&lt;br /&gt;
          echo 0 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_all&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 64:&lt;br /&gt;
&lt;br /&gt;
     Make changes to .bash_profile and need to update the current session?&lt;br /&gt;
&lt;br /&gt;
       $ source .bash_profile&lt;br /&gt;
&lt;br /&gt;
     With the above command, the user does not have to logout.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 65:&lt;br /&gt;
&lt;br /&gt;
     What are the Special Shell Variables?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        $#   The number of arguments.&lt;br /&gt;
        $@   All arguments, as separate words.&lt;br /&gt;
        $*   All arguments, as one word.&lt;br /&gt;
        $$   ID of the current process.&lt;br /&gt;
        $?   Exit status of the last command.&lt;br /&gt;
        $0,$1,..$9,${10},${11}...${N}    Positional parameters. After &amp;quot;9&amp;quot; you must use the ${k} syntax.&lt;br /&gt;
&lt;br /&gt;
     Note that 0 is true. For example if you execute the following, which is true you get zero.&lt;br /&gt;
&lt;br /&gt;
         $  [[ -f /etc/passwd ]]&lt;br /&gt;
         $  echo $?&lt;br /&gt;
         0&lt;br /&gt;
     And the following is false, which returns a 1.&lt;br /&gt;
&lt;br /&gt;
         $  [[ -f /etc/passwdjabberwisnohere ]]&lt;br /&gt;
         $  echo $?&lt;br /&gt;
         1&lt;br /&gt;
&lt;br /&gt;
     So true=0 and false=1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Sample program &amp;quot;mdo&amp;quot;  to show the difference between &amp;quot;$@&amp;quot; and &amp;quot;$*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        function myarg&lt;br /&gt;
        {&lt;br /&gt;
            echo &amp;quot;$# in myarg function&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
        echo -e &amp;quot;$# parameters on the cmd line\n&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;calling: myarg \&amp;quot;\$@\&amp;quot; and myarg \&amp;quot;\$*\&amp;quot;\n&amp;quot;&lt;br /&gt;
        myarg &amp;quot;$@&amp;quot;&lt;br /&gt;
        myarg &amp;quot;$*&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;\ncalling: myarg \$@ and myarg \$* without quotes\n&amp;quot;&lt;br /&gt;
        myarg $@&lt;br /&gt;
        myarg $*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The result of running &amp;quot;./mdo one two&amp;quot;. Note that when quoted, myarg &amp;quot;$*&amp;quot;,&lt;br /&gt;
      returns 1 ... all parameters are smushed together as one word.&lt;br /&gt;
&lt;br /&gt;
            [chirico@third-fl-71 theBook]$ ./mdo one two&lt;br /&gt;
            2 parameters on the cmd line&lt;br /&gt;
&lt;br /&gt;
            calling: myarg &amp;quot;$@&amp;quot; and myarg &amp;quot;$*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
            1 in myarg function&lt;br /&gt;
&lt;br /&gt;
            calling: myarg $@ and myarg $* without quotes&lt;br /&gt;
&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
&lt;br /&gt;
      Example program &amp;quot;mdo2&amp;quot; shows how the input separator can be changed.&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        IFS=|&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=,&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=\;&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=$1&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            [chirico@third-fl-71 theBook]$ ./mdo2 one two three four five&lt;br /&gt;
            one two three four five&lt;br /&gt;
&lt;br /&gt;
            one,two,three,four,five&lt;br /&gt;
&lt;br /&gt;
            one;two;three;four;five&lt;br /&gt;
&lt;br /&gt;
            oneotwoothreeofourofive&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 66:&lt;br /&gt;
&lt;br /&gt;
     Replace all &amp;quot;x&amp;quot; with &amp;quot;y&amp;quot; and all &amp;quot;y&amp;quot; with &amp;quot;x&amp;quot; in file data.&lt;br /&gt;
&lt;br /&gt;
        $ cata data&lt;br /&gt;
          x y&lt;br /&gt;
          y x&lt;br /&gt;
&lt;br /&gt;
        $ tr &amp;quot;xy&amp;quot;  &amp;quot;yx&amp;quot; &amp;lt; data&lt;br /&gt;
          y x&lt;br /&gt;
          x y&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 67:&lt;br /&gt;
&lt;br /&gt;
     On a Linux 2.6.x Kernel, how do you directly measure disk activity,&lt;br /&gt;
     and where is this information documented?&lt;br /&gt;
&lt;br /&gt;
          o The information is documented in the kernel source&lt;br /&gt;
               ./Documentation/iostats.txt&lt;br /&gt;
&lt;br /&gt;
          o The new way of getting this info in 2.6.x is&lt;br /&gt;
              $ cat /sys/block/hda/stat&lt;br /&gt;
            151121 5694 1932358 796675 37867 76770 916994 8353762 0 800672 9150437&lt;br /&gt;
&lt;br /&gt;
             Field  1 -- # of reads issued&lt;br /&gt;
                 This is the total number of reads completed successfully.&lt;br /&gt;
             Field  2 -- # of reads merged, field 6 -- # of writes merged&lt;br /&gt;
                 Reads and writes which are adjacent to each other may be merged for&lt;br /&gt;
                 efficiency.  Thus two 4K reads may become one 8K read before it is&lt;br /&gt;
                 ultimately handed to the disk, and so it will be counted (and queued)&lt;br /&gt;
                 as only one I/O.  This field lets you know how often this was done.&lt;br /&gt;
             Field  3 -- # of sectors read&lt;br /&gt;
                 This is the total number of sectors read successfully.&lt;br /&gt;
             Field  4 -- # of milliseconds spent reading&lt;br /&gt;
                 This is the total number of milliseconds spent by all reads (as&lt;br /&gt;
                 measured from __make_request() to end_that_request_last()).&lt;br /&gt;
             Field  5 -- # of writes completed&lt;br /&gt;
                 This is the total number of writes completed successfully.&lt;br /&gt;
             Field  7 -- # of sectors written&lt;br /&gt;
                 This is the total number of sectors written successfully.&lt;br /&gt;
             Field  8 -- # of milliseconds spent writing&lt;br /&gt;
                 This is the total number of milliseconds spent by all writes (as&lt;br /&gt;
                 measured from __make_request() to end_that_request_last()).&lt;br /&gt;
             Field  9 -- # of I/Os currently in progress&lt;br /&gt;
                 The only field that should go to zero. Incremented as requests are&lt;br /&gt;
                 given to appropriate request_queue_t and decremented as they finish.&lt;br /&gt;
             Field 10 -- # of milliseconds spent doing I/Os&lt;br /&gt;
                 This field is increases so long as field 9 is nonzero.&lt;br /&gt;
             Field 11 -- weighted # of milliseconds spent doing I/Os&lt;br /&gt;
                 This field is incremented at each I/O start, I/O completion, I/O&lt;br /&gt;
                 merge, or read of these stats by the number of I/Os in progress&lt;br /&gt;
                 (field 9) times the number of milliseconds spent doing I/O since the&lt;br /&gt;
                 last update of this field.  This can provide an easy measure of both&lt;br /&gt;
                 I/O completion time and the backlog that may be accumulating.&lt;br /&gt;
&lt;br /&gt;
       Note, this is device specific.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 68:&lt;br /&gt;
&lt;br /&gt;
     Passing Outbound Mail, plus Masquerading User and Hostname.&lt;br /&gt;
&lt;br /&gt;
     Here's a specific example:&lt;br /&gt;
&lt;br /&gt;
         How does one send and receive Comcast email from a home Linux box,&lt;br /&gt;
         which uses Comcast as the ISP, if the local account on the Linux&lt;br /&gt;
         box is different from the Comcast email.  For instance, the&lt;br /&gt;
         account on the Linux box is &amp;quot;chirico@third-fl-71&amp;quot; and the Comcast&lt;br /&gt;
         email account is &amp;quot;mchirico@comcast.net&amp;quot;.  Note both the hostname and&lt;br /&gt;
         username are different.&lt;br /&gt;
&lt;br /&gt;
         So, the user &amp;quot;chirico&amp;quot; using &amp;quot;mutt&amp;quot;, &amp;quot;elm&amp;quot; or any email program would&lt;br /&gt;
         like to send out email to say &amp;quot;donkey@comcast.net&amp;quot;; yet, donkey would&lt;br /&gt;
         see the email from &amp;quot;mchirico@comcast.net&amp;quot; and not &amp;quot;chirico@third-fl-71&amp;quot;&lt;br /&gt;
         but chirico@third-fl-71 would get the replies.&lt;br /&gt;
&lt;br /&gt;
         For a full description of how to solve this problem, including related&lt;br /&gt;
         &amp;quot;sendmail.mc&amp;quot;, &amp;quot;site.config.m4&amp;quot;, &amp;quot;genericstable&amp;quot;, &amp;quot;genericsdomain&amp;quot;,&lt;br /&gt;
         &amp;quot;.procmailrc&amp;quot;, and &amp;quot;.forward&amp;quot; files,  reference the following:&lt;br /&gt;
&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/README_COMCAST_EMAIL.txt?download&lt;br /&gt;
&lt;br /&gt;
         Included in the above link are instructions for building sendmail with&lt;br /&gt;
         &amp;quot;SASL&amp;quot; and &amp;quot;STARTTLS&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 69:&lt;br /&gt;
&lt;br /&gt;
     How do you remove just the last 2 lines from a file and save the result?&lt;br /&gt;
&lt;br /&gt;
         $ sed  '$d' file | sed '$d' &amp;gt; savefile&lt;br /&gt;
&lt;br /&gt;
     Or, as Amos Shapira pointed out, it's much easier with the head command.&lt;br /&gt;
&lt;br /&gt;
         $ head -2 file&lt;br /&gt;
&lt;br /&gt;
      And, of course, removing just the last line&lt;br /&gt;
&lt;br /&gt;
         $ sed '$d' file &amp;gt; savefile&lt;br /&gt;
&lt;br /&gt;
         (See REFERENCES (13))&lt;br /&gt;
&lt;br /&gt;
     How do you remove extra spaces at the end of a line?&lt;br /&gt;
&lt;br /&gt;
         $ sed 's/[ ]*$//g'&lt;br /&gt;
&lt;br /&gt;
     How do you remove blank lines, or lines with just spaces and tabs,&lt;br /&gt;
     saving the origional file as file.backup?&lt;br /&gt;
&lt;br /&gt;
         $ perl -pi.backup -e &amp;quot;s/^(\s)*\n//&amp;quot;  file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 70:&lt;br /&gt;
&lt;br /&gt;
     Generating Random Numbers.&lt;br /&gt;
&lt;br /&gt;
         $ od -vAn -N4 -tu4 &amp;lt; /dev/urandom&lt;br /&gt;
             3905158199&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 71:&lt;br /&gt;
&lt;br /&gt;
     Deleting a File by it's Inode Value.&lt;br /&gt;
&lt;br /&gt;
       See (PROGRAMMING TIP 5) for creating the file, or&lt;br /&gt;
&lt;br /&gt;
       $ cat &amp;gt; '\n\n\n\n\n\n\n'&lt;br /&gt;
         type some text&lt;br /&gt;
         ^D&lt;br /&gt;
&lt;br /&gt;
     To list the inode and display the characters.&lt;br /&gt;
&lt;br /&gt;
       $ ls -libt *&lt;br /&gt;
&lt;br /&gt;
     To remove by inode. Note the &amp;quot;--&amp;quot; option.  This&lt;br /&gt;
     will keep any special characters in the file from being&lt;br /&gt;
     interpreted at &amp;quot;rm&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
       $ find . -inum &amp;lt;inode&amp;gt; -exec rm -- '{}' \;&lt;br /&gt;
&lt;br /&gt;
     Or to check contents&lt;br /&gt;
&lt;br /&gt;
       $ find . -inum &amp;lt;inode&amp;gt; -exec cat '{}' \;&lt;br /&gt;
&lt;br /&gt;
     Reference:&lt;br /&gt;
         http://www.faqs.org/ftp/usenet/news.answers/unix-faq/faq/part2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 72:&lt;br /&gt;
&lt;br /&gt;
     Sending Attachments Using Mutt -- On the Command Line.&lt;br /&gt;
&lt;br /&gt;
        $ mutt -s &amp;quot;See Attachment&amp;quot; -a file.doc user@domain.net &amp;lt; message.txt&lt;br /&gt;
&lt;br /&gt;
          or just the message:&lt;br /&gt;
&lt;br /&gt;
        $ echo | mutt -a sample.tar.gz user@domain.net&lt;br /&gt;
&lt;br /&gt;
      Reference:&lt;br /&gt;
          http://www.shelldorado.com/articles/mailattachments.html&lt;br /&gt;
&lt;br /&gt;
        Also see (TIP 51).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 73:&lt;br /&gt;
&lt;br /&gt;
     Want to find out what functions a program calls?&lt;br /&gt;
&lt;br /&gt;
         $ strace &amp;lt;program&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Try this with &amp;quot;topen.c&amp;quot; (see PROGRAMMING TIP 5)&lt;br /&gt;
&lt;br /&gt;
         $ strace  ./topen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 74:&lt;br /&gt;
&lt;br /&gt;
     RPM Usage Summary.&lt;br /&gt;
&lt;br /&gt;
     Install. Full filename is needed.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -ivh Fedora/RPMS/postgresql-libs-7.4.2-1.i386.rpm&lt;br /&gt;
&lt;br /&gt;
     To view list of files installed with a particular package.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -ql postgresql-libs&lt;br /&gt;
                /usr/lib/libecpg.so.4&lt;br /&gt;
                /usr/lib/libecpg.so.4.1&lt;br /&gt;
                /usr/lib/libecpg_compat.so.1&lt;br /&gt;
                /usr/lib/libecpg_compat.so.1.1&lt;br /&gt;
                /usr/lib/libpgtypes.so.1&lt;br /&gt;
                ...&lt;br /&gt;
&lt;br /&gt;
     Or, to get the file listing from a package that is not installed use the&lt;br /&gt;
     &amp;quot;-p&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -pql /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/CHANGES&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/LICENSE&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/README&lt;br /&gt;
               /usr/share/man/man3/pcap.3.gz&lt;br /&gt;
&lt;br /&gt;
     For dependencies listing, use the &amp;quot;R&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qpR /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /sbin/ldconfig&lt;br /&gt;
               /sbin/ldconfig&lt;br /&gt;
               kernel &amp;gt;= 2.2.0&lt;br /&gt;
               libc.so.6&lt;br /&gt;
               libc.so.6(GLIBC_2.0)&lt;br /&gt;
               libc.so.6(GLIBC_2.1)&lt;br /&gt;
               libc.so.6(GLIBC_2.1.3)&lt;br /&gt;
               libc.so.6(GLIBC_2.3)&lt;br /&gt;
               openssl&lt;br /&gt;
               rpmlib(CompressedFileNames) &amp;lt;= 3.0.4-1&lt;br /&gt;
               rpmlib(PayloadFilesHavePrefix) &amp;lt;= 4.0-1&lt;br /&gt;
&lt;br /&gt;
     To check the integrity, use the &amp;quot;-K&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -K /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm: (sha1) dsa sha1 md5 gpg OK&lt;br /&gt;
&lt;br /&gt;
     To list all packages installed.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qa&lt;br /&gt;
&lt;br /&gt;
     To find out which file a package belongs to.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qf /usr/lib/libecpg.so.4.1&lt;br /&gt;
&lt;br /&gt;
     To uninstall a package&lt;br /&gt;
&lt;br /&gt;
         $ rpm -e&lt;br /&gt;
&lt;br /&gt;
     For building rpm packages reference the following:&lt;br /&gt;
       http://www-106.ibm.com/developerworks/library/l-rpm1/&lt;br /&gt;
&lt;br /&gt;
     To verify md5 sum so that you know it downloaded ok&lt;br /&gt;
&lt;br /&gt;
         $ rpm -K  *.rpm&lt;br /&gt;
&lt;br /&gt;
     The following is a good reference:&lt;br /&gt;
        http://www.rpm.org/max-rpm/s1-rpm-install-additional-options.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 75:&lt;br /&gt;
&lt;br /&gt;
     Listing Output from a Bash Script.&lt;br /&gt;
&lt;br /&gt;
     Add &amp;quot;set -x&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          #!/bin/bash&lt;br /&gt;
          set -x&lt;br /&gt;
          ls&lt;br /&gt;
          date&lt;br /&gt;
&lt;br /&gt;
     Will list the files and output as follows:&lt;br /&gt;
&lt;br /&gt;
           + ls&lt;br /&gt;
           ChangeLog  CVS  data  test&lt;br /&gt;
           + date&lt;br /&gt;
           Thu Jul  1 20:41:04 EDT 2004&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 76:&lt;br /&gt;
&lt;br /&gt;
     Using wget.&lt;br /&gt;
&lt;br /&gt;
     Grap a webpage and pipe it to less. For example suppose you wanted to pipe the&lt;br /&gt;
     contents of all these tips, directly from the web.&lt;br /&gt;
&lt;br /&gt;
      $ wget -O - http://sourceforge.net/direct-dl/mchirico/souptonuts/How_to_Linux_and_Open_Source.txt|less&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 77:&lt;br /&gt;
&lt;br /&gt;
     Finding IP address and MAC address.&lt;br /&gt;
&lt;br /&gt;
       $ /sbin/ifconfig&lt;br /&gt;
&lt;br /&gt;
     Note the following output &amp;quot;eth0&amp;quot; and &amp;quot;eth0:1&amp;quot; which means&lt;br /&gt;
     two IP addresses are tied to 1 NIC (Network Interface Card).&lt;br /&gt;
&lt;br /&gt;
             eth0      Link encap:Ethernet  HWaddr 00:50:DA:60:5B:AD&lt;br /&gt;
                       inet addr:192.168.1.155  Bcast:192.168.99.255  Mask:255.255.252.0&lt;br /&gt;
                       UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
                       RX packets:982757 errors:116 dropped:0 overruns:0 frame:116&lt;br /&gt;
                       TX packets:439297 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:1000&lt;br /&gt;
                       RX bytes:693529078 (661.4 Mb)  TX bytes:78400296 (74.7 Mb)&lt;br /&gt;
                       Interrupt:10 Base address:0xa800&lt;br /&gt;
&lt;br /&gt;
             eth0:1    Link encap:Ethernet  HWaddr 00:50:DA:60:5B:AD&lt;br /&gt;
                       inet addr:192.168.1.182  Bcast:192.168.3.255  Mask:255.255.252.0&lt;br /&gt;
                       UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
                       RX packets:982757 errors:116 dropped:0 overruns:0 frame:116&lt;br /&gt;
                       TX packets:439299 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:1000&lt;br /&gt;
                       RX bytes:693529078 (661.4 Mb)  TX bytes:78400636 (74.7 Mb)&lt;br /&gt;
                       Interrupt:10 Base address:0xa800&lt;br /&gt;
&lt;br /&gt;
             lo        Link encap:Local Loopback&lt;br /&gt;
                       inet addr:127.0.0.1  Mask:255.0.0.0&lt;br /&gt;
                       UP LOOPBACK RUNNING  MTU:16436  Metric:1&lt;br /&gt;
                       RX packets:785 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
                       TX packets:785 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:0&lt;br /&gt;
                       RX bytes:2372833 (2.2 Mb)  TX bytes:2372833 (2.2 Mb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 78:&lt;br /&gt;
&lt;br /&gt;
     DOS to UNIX and UNIX to DOS.&lt;br /&gt;
&lt;br /&gt;
        $ dos2unix file.txt&lt;br /&gt;
&lt;br /&gt;
     And to go the other way from UNIX to DOS&lt;br /&gt;
&lt;br /&gt;
        $ unix2dos unixfile&lt;br /&gt;
&lt;br /&gt;
     See the man page, since there are MAC options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     NOTE: If you're working file DOS files, you'll probably want to use&lt;br /&gt;
           &amp;quot;zip&amp;quot; instead of &amp;quot;gzip&amp;quot; so users on Windows can unzip them.&lt;br /&gt;
&lt;br /&gt;
              $ zip test.zip test.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 79:&lt;br /&gt;
&lt;br /&gt;
     Need to Run Interactive Commands? Try &amp;quot;expect&amp;quot;.&lt;br /&gt;
       http://expect.nist.gov/expect.tar.gz&lt;br /&gt;
&lt;br /&gt;
     This simple example waits for the input &amp;quot;hi&amp;quot;, in some form before&lt;br /&gt;
     returning, immediately, &amp;quot;hello there!&amp;quot;. Otherwise, it will wait for&lt;br /&gt;
     60 seconds, then, return &amp;quot;hello there!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/expect&lt;br /&gt;
          set timeout 60&lt;br /&gt;
          expect &amp;quot;hi\n&amp;quot;&lt;br /&gt;
          send &amp;quot;hello there!\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference:&lt;br /&gt;
        http://www.oreilly.com/catalog/expect/chapter/ch03.html&lt;br /&gt;
&lt;br /&gt;
        http://www.cotse.com/dlf/man/expect/bulletproof1.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 80:&lt;br /&gt;
&lt;br /&gt;
     Using PHP as a Command Line Scripting Language.&lt;br /&gt;
&lt;br /&gt;
     The following will grab the complete file from slashdot.&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/php -q&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;?php&lt;br /&gt;
         $fileName = &amp;quot;http://slashdot.org/slashdot.xml&amp;quot;;&lt;br /&gt;
         $rss = file($fileName) or die (&amp;quot;Cannot open file $fileName\n&amp;quot;);&lt;br /&gt;
         for ($index=0; $index &amp;lt; count($rss); $index++)&lt;br /&gt;
              {&lt;br /&gt;
              echo $rss[$index];&lt;br /&gt;
              }&lt;br /&gt;
         ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       Note, if you want an example that parses the XML of&lt;br /&gt;
       slashdot, then, download the following:&lt;br /&gt;
&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/php_scripts.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 81:&lt;br /&gt;
&lt;br /&gt;
     Discarding all output -- including stderr messages.&lt;br /&gt;
&lt;br /&gt;
         $ ls  &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     Or sending all output to a file&lt;br /&gt;
&lt;br /&gt;
         $ someprog &amp;gt; /tmp/file 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     Sometimes, find displays a lot of errors when searching through&lt;br /&gt;
     directories that the user doesn't have access to. To discard&lt;br /&gt;
     error messages &amp;quot;stderr&amp;quot;, which is normally file descripter &amp;quot;2&amp;quot;&lt;br /&gt;
     work the following:&lt;br /&gt;
&lt;br /&gt;
         $ find / -iname 'stuff' 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
          or to pipe results elsewhere&lt;br /&gt;
&lt;br /&gt;
         $ find / -iname 'stuff' &amp;gt; /tmp/results_of_find  2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 118).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 82:&lt;br /&gt;
&lt;br /&gt;
     Using MIX.  D. Knuth's  assembly language/machine-code instruction set used in&lt;br /&gt;
     his books to illustrate his algorithms.&lt;br /&gt;
&lt;br /&gt;
     Download the source:&lt;br /&gt;
&lt;br /&gt;
       http://sourceforge.net/project/showfiles.php?group_id=13897&lt;br /&gt;
&lt;br /&gt;
       $ ./configure&lt;br /&gt;
       $ make&lt;br /&gt;
       $ make install&lt;br /&gt;
&lt;br /&gt;
     Documentation can be found at the following link. The link on&lt;br /&gt;
     sourceforge is not correct, but, the one below works.&lt;br /&gt;
&lt;br /&gt;
       http://www.gnu.org/software/mdk/manual/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 83:&lt;br /&gt;
&lt;br /&gt;
     Gnuplot [ http://sourceforge.net/projects/gnuplot/ ].&lt;br /&gt;
&lt;br /&gt;
     This software is ideal for printing graphs.&lt;br /&gt;
&lt;br /&gt;
         gnuplot&amp;gt; set term png&lt;br /&gt;
         gnuplot&amp;gt; set output 'testcos.png'&lt;br /&gt;
         gnuplot&amp;gt; plot cos(x)*sin(x)&lt;br /&gt;
         gnuplot&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
     Or the following command can be put into &amp;quot;file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            $ cat &amp;gt; file&lt;br /&gt;
            set term png&lt;br /&gt;
            set output 'testcos.png'&lt;br /&gt;
            plot cos(x)*sin(x)&lt;br /&gt;
            exit&lt;br /&gt;
            ^D&lt;br /&gt;
&lt;br /&gt;
     Then, run as follows:&lt;br /&gt;
&lt;br /&gt;
            $ gnuplot file&lt;br /&gt;
&lt;br /&gt;
     Or, suppose you have the following file &amp;quot;/home/chirico/data&amp;quot;. Comments&lt;br /&gt;
     with &amp;quot;#&amp;quot; are not read by gnuplot.&lt;br /&gt;
&lt;br /&gt;
            # File /home/chirico/data&lt;br /&gt;
            #&lt;br /&gt;
            2005-07-26  1    2.3    3&lt;br /&gt;
            2005-07-27  2    3.4    5&lt;br /&gt;
            2005-07-28  3    4    6.6&lt;br /&gt;
            2005-07-29  4    6    2.5&lt;br /&gt;
&lt;br /&gt;
     And you have the following new &amp;quot;file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            set term png&lt;br /&gt;
            set xdata time&lt;br /&gt;
            set timefmt &amp;quot;%Y-%m-%d &amp;quot;&lt;br /&gt;
            set format x &amp;quot;%Y/%m/%d&amp;quot;&lt;br /&gt;
            set output '/var/www/html/chirico/gnuplot/data.png'&lt;br /&gt;
            plot '/home/chirico/data' using 1:2 w linespoints  title '1st col', \&lt;br /&gt;
             '/home/chirico/data' using 1:3 w linespoints  title '2nd col', \&lt;br /&gt;
             '/home/chirico/data' using 1:4 w linespoints  title '3rd col'&lt;br /&gt;
            exit&lt;br /&gt;
&lt;br /&gt;
     You can now get a graph of this data running the following:&lt;br /&gt;
&lt;br /&gt;
            $ gnuplot file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 84:&lt;br /&gt;
&lt;br /&gt;
     CPU Information - speed, processor, cache.&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/cpuinfo&lt;br /&gt;
&lt;br /&gt;
               processor       : 0&lt;br /&gt;
               vendor_id       : GenuineIntel&lt;br /&gt;
               cpu family      : 15&lt;br /&gt;
               model           : 2&lt;br /&gt;
               model name      : Intel(R) Pentium(R) 4 CPU 2.20GHz&lt;br /&gt;
               stepping        : 9&lt;br /&gt;
               cpu MHz         : 2193.221&lt;br /&gt;
               cache size      : 512 KB&lt;br /&gt;
               fdiv_bug        : no&lt;br /&gt;
               hlt_bug         : no&lt;br /&gt;
               f00f_bug        : no&lt;br /&gt;
               coma_bug        : no&lt;br /&gt;
               fpu             : yes&lt;br /&gt;
               fpu_exception   : yes&lt;br /&gt;
               cpuid level     : 2&lt;br /&gt;
               wp              : yes&lt;br /&gt;
               flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr&lt;br /&gt;
               bogomips        : 4325.37&lt;br /&gt;
&lt;br /&gt;
      &amp;quot;bogomips&amp;quot; is a rough but good way to quickly compare two computer speeds. True it's a&lt;br /&gt;
      bogus reading; but, a &amp;quot;good enough&amp;quot; for government work calculation.  See (TIP 10) for&lt;br /&gt;
      &amp;quot;vmstat&amp;quot; and &amp;quot;iostat&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 85:&lt;br /&gt;
&lt;br /&gt;
     POVRAY - Making Animated GIFs&lt;br /&gt;
&lt;br /&gt;
     To see this in action, reference:&lt;br /&gt;
      http://souptonuts.sourceforge.net/povray/orbit.pov.html&lt;br /&gt;
&lt;br /&gt;
     These are the basic command to create:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        $ povray orbit.ini -Iorbit.pov&lt;br /&gt;
        $ convert -delay 20 *.ppm orbit.gif&lt;br /&gt;
&lt;br /&gt;
     By the way, convert is a program from imagemagick, and it can&lt;br /&gt;
     be downloaded from ( http://www.imagemagick.org ).&lt;br /&gt;
&lt;br /&gt;
    The following is &amp;quot;orbit.pov&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          #include &amp;quot;colors.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;finish.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;metals.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;textures.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;stones.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;skies.inc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          camera {&lt;br /&gt;
            location &amp;lt; 2, 3, -8 &amp;gt;&lt;br /&gt;
            look_at  &amp;lt; 0, 0, 0 &amp;gt;&lt;br /&gt;
            focal_point &amp;lt;0, 0, 0&amp;gt;&lt;br /&gt;
            blur_samples 20&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          light_source {&lt;br /&gt;
                  &amp;lt; 0, 10, 0&amp;gt;&lt;br /&gt;
                  color White&lt;br /&gt;
                  area_light &amp;lt;2,0,0&amp;gt;,&amp;lt;0,0,2&amp;gt;, 2, 2&lt;br /&gt;
                  adaptive 1&lt;br /&gt;
                  fade_distance 8&lt;br /&gt;
                  fade_power 1&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          sky_sphere {&lt;br /&gt;
            S_Cloud3&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          plane { &amp;lt;0, 1, 0&amp;gt;, -1&lt;br /&gt;
                  texture {&lt;br /&gt;
                          pigment {&lt;br /&gt;
                                  checker color Blue, color White&lt;br /&gt;
                          }&lt;br /&gt;
                          finish {Phong_Glossy}&lt;br /&gt;
                  }&lt;br /&gt;
          }&lt;br /&gt;
          #declare ball0=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;0.5, 0.5, 0&amp;gt;, 1&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Yellow}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          #declare ball1=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;3, 2, 0&amp;gt;, 0.5&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Blue}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          #declare ball2=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;3, 1, 0&amp;gt;, 1&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Green}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          object {ball0 rotate 360*clock*y}&lt;br /&gt;
          object {ball1 rotate 720*clock*y}&lt;br /&gt;
          object {ball2 rotate 360*(1 - clock)*y}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    And, &amp;quot;orbit.ini&amp;quot; follows:&lt;br /&gt;
&lt;br /&gt;
          Output_File_Type=P&lt;br /&gt;
&lt;br /&gt;
          Width=320&lt;br /&gt;
          Height=240&lt;br /&gt;
&lt;br /&gt;
          Initial_Frame=1&lt;br /&gt;
          Final_Frame=10&lt;br /&gt;
          Antialias=true&lt;br /&gt;
&lt;br /&gt;
          Subset_Start_Frame=1&lt;br /&gt;
          Subset_End_Frame=10&lt;br /&gt;
&lt;br /&gt;
          Cyclic_Animation=on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 86:&lt;br /&gt;
&lt;br /&gt;
     GPG --  GnuPG&lt;br /&gt;
&lt;br /&gt;
        Reference: http://www.gnupg.org/documentation/faqs.html&lt;br /&gt;
                   http://codesorcery.net/mutt/mutt-gnupg-howto&lt;br /&gt;
                   http://www.gnupg.org/(en)/download/index.html&lt;br /&gt;
                   (SCRIPT 4) on following link:&lt;br /&gt;
                   http://prdownloads.sourceforge.net/souptonuts/README_common_script_commands.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Generage key:&lt;br /&gt;
&lt;br /&gt;
        $ gpg --gen-key&lt;br /&gt;
&lt;br /&gt;
     Generate public key ID and fingerprint&lt;br /&gt;
&lt;br /&gt;
        $ gpg --fingerprint&lt;br /&gt;
&lt;br /&gt;
     Get a list of keys:&lt;br /&gt;
&lt;br /&gt;
        $ gpg --list-keys&lt;br /&gt;
&lt;br /&gt;
          pub  1024D/A11C1499 2004-07-15 Mike Chirico &amp;lt;mchirico@comcast.net&amp;gt;&lt;br /&gt;
          sub  1024g/E1A3C2B3 2004-07-15&lt;br /&gt;
&lt;br /&gt;
     Encrypt&lt;br /&gt;
&lt;br /&gt;
        $ gpg -r Mike  --encrypt sample.txt&lt;br /&gt;
&lt;br /&gt;
       This will produce &amp;quot;sample.txt.asc&amp;quot;, which is a binary file.  Note, I can use &amp;quot;Mike&amp;quot; because that's the&lt;br /&gt;
       name on the list of keys. Again, it will be a binary file.&lt;br /&gt;
&lt;br /&gt;
     Encrypt using &amp;quot;ASCII-armored text&amp;quot;  (--armor), which is probably what you want when sending &amp;quot;in&amp;quot; the body of an&lt;br /&gt;
     email, or some document.&lt;br /&gt;
&lt;br /&gt;
        $ gpg  -r Mike  --encrypt --armor sample.txt&lt;br /&gt;
            or&lt;br /&gt;
        $ gpg -r Mike -e -a sample.txt&lt;br /&gt;
            or&lt;br /&gt;
        $ gpg --output somefile.asc --armor -r Mike  --encrypt --armor sample.txt&lt;br /&gt;
&lt;br /&gt;
     The above 3 statements will still produce &amp;quot;sample.txt.asc&amp;quot;, but look at it, or &amp;quot;$ cat sample.txt.asc&amp;quot; without &lt;br /&gt;
     fear, since there are no binary characters. Yes, you could even compile a program &amp;quot;$ g++ -o test test.c&amp;quot; , then,&lt;br /&gt;
     &amp;quot;$ gpg --output test.asc  -r Mike --encrypt --armor test&amp;quot;. However, when decrypting make sure to pipe&lt;br /&gt;
     the results.&lt;br /&gt;
&lt;br /&gt;
            $ gpg --decrypt test.asc &amp;gt; test&lt;br /&gt;
&lt;br /&gt;
     Export &amp;quot;public&amp;quot; key:&lt;br /&gt;
&lt;br /&gt;
           $ gpg --armor --export Mike &amp;gt; m1.asc&lt;br /&gt;
&lt;br /&gt;
     Signing the file &amp;quot;message.txt&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
           $ gpg --clearsign message.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Sending the key to the &amp;quot;key-server&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        First, list the keys.&lt;br /&gt;
&lt;br /&gt;
                $ gpg --list-keys&lt;br /&gt;
                    /home/chirico/.gnupg/pubring.gpg&lt;br /&gt;
                                 v------------------ Use this with &amp;quot;0x&amp;quot; in front -------&lt;br /&gt;
                  pub  1024D/A11C1499 2004-07-15 Mike Chirico  &amp;lt;mchirico@comcast.net&amp;gt;   |&lt;br /&gt;
                  sub  1024g/E1A3C2B3 2004-07-15                                        |&lt;br /&gt;
                                                                                        |&lt;br /&gt;
                                   v----------------------------------------------------&lt;br /&gt;
                $ gpg --send-keys 0xA11C1499&lt;br /&gt;
&lt;br /&gt;
             The above sends it to the keyserver defined in &amp;quot;/home/chirico/.gnupg/gpg.conf&amp;quot;.  Other key servers:&lt;br /&gt;
&lt;br /&gt;
                            wwwkeys.pgp.net&lt;br /&gt;
                            search.keyserver.net&lt;br /&gt;
                            pgp.ai.mit.edu&lt;br /&gt;
&lt;br /&gt;
             When you go to your user-group meetings, you need to bring 2 forms of ID, and&lt;br /&gt;
             list your Key fingerprint. Shown below is the command for getting this fingerprint.&lt;br /&gt;
&lt;br /&gt;
                $ gpg --fingerprint mchirico@comcast.net&lt;br /&gt;
                 pub   1024D/A11C1499 2004-07-15&lt;br /&gt;
                 Key fingerprint = 9D7F C80D BB7B 4BAB CCA4  1BE9 9056 5BEC A11C 1499&lt;br /&gt;
                 uid   Mike Chirico (http://souptonuts.sourceforge.net/chirico/index.php) &amp;lt;mchirico@comcast.net&amp;gt;&lt;br /&gt;
                 sub   1024g/E1A3C2B3 2004-07-15&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Receving keys:&lt;br /&gt;
&lt;br /&gt;
        The following will retrieve my mchirico@comcast.net key&lt;br /&gt;
&lt;br /&gt;
               $ gpg --recv-keys 0xA11C1499&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Special Note: If you get the following error &amp;quot;GPG: Warning: Using Insecure Memory&amp;quot; , then,&lt;br /&gt;
                   &amp;quot; chmod 4755 /path/to/gpg&amp;quot;  to setuid(root) permissioins on the gpg binary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     NOTE: If using mutt, just before sending with the &amp;quot;y&amp;quot; option, hit &amp;quot;p&amp;quot; to sign or encrypt.&lt;br /&gt;
&lt;br /&gt;
     It's possible to create a gpg/pgp email from the command line. For a tutorial on this,&lt;br /&gt;
     reference (SCRIPT 4) at the following link:&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/README_common_script_commands.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 87:&lt;br /&gt;
&lt;br /&gt;
     Working with Dates: Steffen Beyer has developed a Perl and C module for working with dates&lt;br /&gt;
&lt;br /&gt;
     This softare can be downloaded from the following location:&lt;br /&gt;
        http://www.engelschall.com/u/sb/download/pkg/Date-Calc-5.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
         $ wget http://www.engelschall.com/u/sb/download/pkg/Date-Calc-5.3.tar.gz&lt;br /&gt;
         $ tar -xzvf Date-Calc-5.3.tar.gz&lt;br /&gt;
         $ cd Date-Calc-5.3&lt;br /&gt;
         $ cp ./examples/cal.c .&lt;br /&gt;
         $ gcc cal.c DateCalc.c -o mcal&lt;br /&gt;
&lt;br /&gt;
     The file cal.c contains sample function calls from DateCalc.c.  Note, &amp;quot;DateCalc.c&amp;quot;&lt;br /&gt;
     is just a list of functions and includes for &amp;quot;DateCalc.h&amp;quot; and &amp;quot;ToolBox.h&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Or, and this may be easier, just download the following:&lt;br /&gt;
         http://prdownloads.sourceforge.net/cpearls/date_calc.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
     The above link contains a few examples.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 88:&lt;br /&gt;
&lt;br /&gt;
     Color patterns for mutt.&lt;br /&gt;
&lt;br /&gt;
     The colors can be changed in the /home/user/.muttrc file. The first field begins with&lt;br /&gt;
     color, the second field is the foreground color, and the third field is the background&lt;br /&gt;
     color, or default.&lt;br /&gt;
&lt;br /&gt;
     An example .muttrc for colors:&lt;br /&gt;
&lt;br /&gt;
       # color patterns for mutt&lt;br /&gt;
       color normal     white          black # normal text&lt;br /&gt;
       color indicator  black          yellow  # actual message&lt;br /&gt;
       color tree       brightmagenta  default # thread arrows&lt;br /&gt;
       color status     brightyellow         default # status line&lt;br /&gt;
       color error      brightred      default # errors&lt;br /&gt;
       color message    magenta        default # info messages&lt;br /&gt;
       color signature  magenta        default # signature&lt;br /&gt;
       color attachment brightyellow   red     # MIME attachments&lt;br /&gt;
       color search     brightyellow   red     # search matches&lt;br /&gt;
       color tilde      brightmagenta  default # ~ at bottom of msg&lt;br /&gt;
       color markers    red            default # + at beginning of wrapped lines&lt;br /&gt;
       color hdrdefault cyan           default # default header lines&lt;br /&gt;
       color bold       red            default # hiliting bold patterns in body&lt;br /&gt;
       color underline  green          default # hiliting underlined patterns in body&lt;br /&gt;
       color quoted     cyan           default # quoted text&lt;br /&gt;
       color quoted1    magenta        default&lt;br /&gt;
       color quoted2    red            default&lt;br /&gt;
       color quoted3    green          default&lt;br /&gt;
       color quoted4    magenta           default&lt;br /&gt;
       color quoted5    cyan           default&lt;br /&gt;
       color quoted6    magenta        default&lt;br /&gt;
       color quoted7    red            default&lt;br /&gt;
       color quoted8    green          default&lt;br /&gt;
       color quoted9    cyan           default&lt;br /&gt;
       color body   cyan  default  &amp;quot;((ftp|http|https)://|news:)[^ &amp;gt;)\&amp;quot;\t]+&amp;quot;&lt;br /&gt;
       color body   cyan  default  &amp;quot;[-a-z_0-9.+]+@[-a-z_0-9.]+&amp;quot;&lt;br /&gt;
       color body   red   default  &amp;quot;(^| )\\*[-a-z0-9*]+\\*[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color body   green default  &amp;quot;(^| )_[-a-z0-9_]+_[,.?]?[\n]&amp;quot;&lt;br /&gt;
       color body   red   default  &amp;quot;(^| )\\*[-a-z0-9*]+\\*[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color body   green default  &amp;quot;(^| )_[-a-z0-9_]+_[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color index  cyan  default  ~F         # Flagged&lt;br /&gt;
       color index  red   default  ~N         # New&lt;br /&gt;
       color index  magenta    default  ~T         # Tagged&lt;br /&gt;
       color index  cyan       default  ~D         # Deleted&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 190)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 89:&lt;br /&gt;
&lt;br /&gt;
     ps command in detail&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Here are the possible codes when using state &amp;quot;$ ps -e -o state,cmd&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             PROCESS STATE CODES&lt;br /&gt;
                  D   uninterruptible sleep (usually IO)&lt;br /&gt;
                  R   runnable (on run queue)&lt;br /&gt;
                  S   sleeping&lt;br /&gt;
                  T   traced or stopped&lt;br /&gt;
                  Z   a defunct (&amp;quot;zombie&amp;quot;) process&lt;br /&gt;
&lt;br /&gt;
                  &amp;lt;    high-priority (not nice to other users)&lt;br /&gt;
                  N    low-priority (nice to other users)&lt;br /&gt;
                  L    has pages locked into memory (for real-time and custom IO)&lt;br /&gt;
                  s    is a session leader&lt;br /&gt;
                  l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)&lt;br /&gt;
                  +    is in the foreground process group&lt;br /&gt;
&lt;br /&gt;
    For instance:&lt;br /&gt;
&lt;br /&gt;
     Note that the -o is for user defined, and -e is for select&lt;br /&gt;
     all process.&lt;br /&gt;
&lt;br /&gt;
       $ ps -e -o pid,state,start,time,etime,cmd&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
             9946 S 15:40:45 00:00:00    02:23:29 /bin/bash -i&lt;br /&gt;
             9985 T 15:41:24 00:00:01    02:22:50 emacs mout2&lt;br /&gt;
            10003 T 15:43:59 00:00:00    02:20:15 emacs NOTES&lt;br /&gt;
            10320 T 17:38:42 00:00:00       25:32 emacs stuff.c&lt;br /&gt;
         ...&lt;br /&gt;
&lt;br /&gt;
     You may want to command below, without the -e, which will give the&lt;br /&gt;
     process only under the current terminal.&lt;br /&gt;
&lt;br /&gt;
       $ ps -o pid,state,start,time,etime,cmd&lt;br /&gt;
&lt;br /&gt;
     Want to find what 's impacting your load?&lt;br /&gt;
&lt;br /&gt;
       $ ps -e -o %cpu,pid,state,start,time,etime,%cpu,%mem,cmd|sort -rn|less&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ ps aux&lt;br /&gt;
&lt;br /&gt;
            USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND&lt;br /&gt;
            root         1  0.0  0.0  1380  480 ?        S    Aug04   0:00 init [3]&lt;br /&gt;
            root         2  0.0  0.0     0    0 ?        SWN  Aug04   0:00 [ksoftirqd/0]&lt;br /&gt;
            root         3  0.0  0.0     0    0 ?        SW&amp;lt;  Aug04   0:00 [events/0]&lt;br /&gt;
            root         4  0.0  0.0     0    0 ?        SW&amp;lt;  Aug04   0:00 [khelper]&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     Or, if you want to see the environment add the -e option&lt;br /&gt;
&lt;br /&gt;
       $ ps aeux&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
            chirico   2735  0.0  0.1  4400 1492 pts/0    S    Aug04   0:00 -bash USER=chirico LOGNAME=chirico HOME=/home/chirico PATH=/usr/&lt;br /&gt;
            chirico   2771  0.0  0.0  4328  924 pts/0    S    Aug04   0:00 screen -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm S&lt;br /&gt;
            chirico   2772  0.0  0.6  9476 6352 ?        S    Aug04   0:54 SCREEN -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm S&lt;br /&gt;
            chirico   2773  0.0  0.1  4432 1548 pts/1    S    Aug04   0:10 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            chirico   2797  0.0  0.1  4416 1496 pts/2    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            root      2821  0.0  0.0  4100  952 pts/2    S    Aug04   0:00 su -&lt;br /&gt;
            root      2822  0.0  0.1  4384 1480 pts/2    S    Aug04   0:00 -bash&lt;br /&gt;
            chirico   2862  0.0  0.1  4428 1524 pts/3    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            sporkey   2946  0.0  0.2  6836 2960 ?        S    Aug04   0:15 fetchmail&lt;br /&gt;
            chirico   2952  0.0  0.1  4436 1552 pts/5    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            chirico   3880  0.0  0.1  4416 1496 pts/6    S    Aug05   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            root      3904  0.0  0.0  4100  956 pts/6    S    Aug05   0:00 su - donkey&lt;br /&gt;
            donkey    3905  0.0  0.1  4336 1452 pts/6    S    Aug05   0:00 -bash&lt;br /&gt;
            donkey    3938  0.0  0.2  6732 2856 ?        S    Aug05   0:14 fetchmail&lt;br /&gt;
            chirico   3944  0.0  0.1  4416 1496 pts/7    S    Aug05   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     There is also a -f &amp;quot;forrest&amp;quot; option. Also note below &amp;quot; -bash&amp;quot; is the start of a login shell.&lt;br /&gt;
&lt;br /&gt;
      $ ps aeuxwwf &lt;br /&gt;
     &lt;br /&gt;
     The ww option above gives a wide format with all variables. Use the above command if you plan&lt;br /&gt;
     to parse through a Perl script. Otherwise, it may be easier to do a quick read using the command&lt;br /&gt;
     below, without &amp;quot;ww&amp;quot;.    &lt;br /&gt;
&lt;br /&gt;
      $ ps aeuxf&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
            root      2339  0.0  0.1  3512 1444 ?        S    Dec01   0:00 /usr/sbin/sshd&lt;br /&gt;
            root     25651  0.0  0.1  6764 1980 ?        S    Dec23   0:00  \_ /usr/sbin/sshd&lt;br /&gt;
            chirico  25653  0.0  0.2  6840 2236 ?        S    Dec23   0:14      \_ /usr/sbin/sshd&lt;br /&gt;
            chirico  25654  0.0  0.1  4364 1440 pts/4    S    Dec23   0:00          \_ -bash USER=chirico LOGNAME=chirico HOME=/home/chirico&lt;br /&gt;
            chirico  25690  0.0  0.0  4328  920 pts/4    S    Dec23   0:00              \_ screen -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm&lt;br /&gt;
            root      2355  0.0  0.0  2068  904 ?        S    Dec01   0:00 xinetd -stayalive -pidfile /var/run/xinetd.pid&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     It is also possible to list the process by command line. For example, the following command will only list the emacs&lt;br /&gt;
     processes.&lt;br /&gt;
&lt;br /&gt;
      $ ps -fC emacs&lt;br /&gt;
       UID        PID  PPID  C STIME TTY          TIME CMD&lt;br /&gt;
       chirico   5049  5020  0 May11 pts/13   00:00:00 emacs -nw Notes&lt;br /&gt;
       chirico  12368  5104  0 May12 pts/18   00:00:00 emacs -nw dnotify.c&lt;br /&gt;
       chirico  19792 18028  0 May13 pts/20   00:00:00 emacs -nw hello.c&lt;br /&gt;
       chirico  14034 27367  0 18:52 pts/8    00:00:00 emacs -nw How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
     You may also want to consider using top in batch mode. Here the &amp;quot;-n 1&amp;quot; means refresh once,&lt;br /&gt;
     and the &amp;quot;b&amp;quot; is for batch. The &amp;quot;fmt -s&amp;quot; is to put it in a more readable format.&lt;br /&gt;
&lt;br /&gt;
       $ top -n 1 b |fmt  -s &amp;gt;&amp;gt;statfile&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 90:&lt;br /&gt;
&lt;br /&gt;
     Learning Assembly.&lt;br /&gt;
&lt;br /&gt;
     Once you have written the source, assuming the file is &amp;quot;exit.s&amp;quot;, it can be compiled as follows:&lt;br /&gt;
&lt;br /&gt;
            $ as exit.s -o exit.o&lt;br /&gt;
            $ ld exit.o -o exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Here is the program:&lt;br /&gt;
&lt;br /&gt;
         #&lt;br /&gt;
         #INPUT:  none&lt;br /&gt;
         #&lt;br /&gt;
         #OUTPUT:         returns a status code. This can be viewed&lt;br /&gt;
         # by typing&lt;br /&gt;
         #&lt;br /&gt;
         # echo $?&lt;br /&gt;
         #&lt;br /&gt;
         # after running the program&lt;br /&gt;
         #&lt;br /&gt;
         #VARIABLES:&lt;br /&gt;
         # %eax holds the system call number&lt;br /&gt;
         # (this is always the case)&lt;br /&gt;
         #&lt;br /&gt;
         # %ebx holds the return status&lt;br /&gt;
         #&lt;br /&gt;
                 .section .data&lt;br /&gt;
                 .section .text&lt;br /&gt;
&lt;br /&gt;
                 .globl _start&lt;br /&gt;
         _start:&lt;br /&gt;
                 movl $1, %eax # this is the linux kernel command&lt;br /&gt;
                 # number (system call) for exiting&lt;br /&gt;
                 # a program&lt;br /&gt;
                 movl $0, %ebx # this is the status number we will&lt;br /&gt;
                 # return to the operating system.&lt;br /&gt;
                 # Change this around and it will&lt;br /&gt;
                 # return different things to&lt;br /&gt;
                 # echo $?&lt;br /&gt;
                 int $0x80 # this wakes up the kernel to run&lt;br /&gt;
                 # the exit command&lt;br /&gt;
&lt;br /&gt;
     After running this program, you can get the exit code.&lt;br /&gt;
&lt;br /&gt;
            $ exit $?&lt;br /&gt;
            0&lt;br /&gt;
&lt;br /&gt;
     That is about all it does; but, get the book for more details. The&lt;br /&gt;
     book is free.&lt;br /&gt;
&lt;br /&gt;
          http://savannah.nongnu.org/download/pgubook/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 91:&lt;br /&gt;
&lt;br /&gt;
     Creating a sandbox for reiserfstune,debugreiserfs and ACL.  Also see TIP 4.&lt;br /&gt;
&lt;br /&gt;
     Assume you have a reisers files system created from a disk file, which&lt;br /&gt;
     means you have done something like the following:&lt;br /&gt;
&lt;br /&gt;
          # dd if=/dev/zero of=disk-rfs count=102400&lt;br /&gt;
          # losetup  /dev/loop4 ./disk-rfs&lt;br /&gt;
          # mkfs -t reiserfs /dev/loop4&lt;br /&gt;
          # mkdir /fs2&lt;br /&gt;
          # mount -o loop,acl ./disk-rfs /fs2&lt;br /&gt;
&lt;br /&gt;
     Now, you can run reiserfstune. But, first you will need to umount fs2&lt;br /&gt;
&lt;br /&gt;
          # umount /fs2&lt;br /&gt;
          # reiserfstune ./disk-rfs&lt;br /&gt;
&lt;br /&gt;
     Or you can run the debug command&lt;br /&gt;
&lt;br /&gt;
          # debugreiserfs -J ./disk-rfs&lt;br /&gt;
&lt;br /&gt;
     Now, suppose you run through a lot of the debug options on&lt;br /&gt;
     http://www.namesys.com/ and you destroy this file.&lt;br /&gt;
&lt;br /&gt;
     You can recreate the file and delete the loop device.&lt;br /&gt;
&lt;br /&gt;
          # dd if=/dev/zero of=disk-rfs count=102400&lt;br /&gt;
          # losetup -d /dev/loop4&lt;br /&gt;
          # mount -o loop,acl ./disk-rfs /fs2&lt;br /&gt;
&lt;br /&gt;
     Now, try working with some of the ACL options - you can only do this&lt;br /&gt;
     with the latest kernel and tools -- Fedora Core 2 will work.&lt;br /&gt;
&lt;br /&gt;
     Assume you have 3 users, donkey, chirico and bozo2. You can give&lt;br /&gt;
     everyone rights to this file system as follows:&lt;br /&gt;
&lt;br /&gt;
          # setfacl -R -m d:u:donkey:rwx,d:u:chirico:rwx,d:u:bozo2:rwx /fs2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 92:&lt;br /&gt;
&lt;br /&gt;
     SpamAssassin - Setup.&lt;br /&gt;
&lt;br /&gt;
     Step 1.&lt;br /&gt;
&lt;br /&gt;
           Installing the SpamAssassin CPAN utility. You will need to do this&lt;br /&gt;
           as root.&lt;br /&gt;
        &lt;br /&gt;
              $ su -&lt;br /&gt;
&lt;br /&gt;
           Once you have root privileges invoke cpan.&lt;br /&gt;
        &lt;br /&gt;
              # perl -MCPAN -e shell&lt;br /&gt;
&lt;br /&gt;
              cpan&amp;gt;&lt;br /&gt;
&lt;br /&gt;
           Now install with prerequisites policy set to ask.&lt;br /&gt;
        &lt;br /&gt;
              cpan&amp;gt; o conf prerequisites_policy ask&lt;br /&gt;
        &lt;br /&gt;
              cpan&amp;gt; install Mail::SpamAssassin&lt;br /&gt;
        &lt;br /&gt;
           You will get lots of output as the necessary modules are downloaded and&lt;br /&gt;
           compiled and installed.&lt;br /&gt;
&lt;br /&gt;
     Step 2.&lt;br /&gt;
&lt;br /&gt;
            Configuration.&lt;br /&gt;
&lt;br /&gt;
            Edit the following &amp;quot;/etc/mail/spamassassin/local.cf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            Here is a look at my file&lt;br /&gt;
&lt;br /&gt;
                $ cat /etc/mail/spamassassin/local.cf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                # This is the right place to customize your installation of SpamAssassin.&lt;br /&gt;
                #&lt;br /&gt;
                # See 'perldoc Mail::SpamAssassin::Conf' for details of what can be&lt;br /&gt;
                # tweaked.&lt;br /&gt;
                #&lt;br /&gt;
                ###########################################################################&lt;br /&gt;
                #&lt;br /&gt;
                # rewrite_subject 0&lt;br /&gt;
                # report_safe 1&lt;br /&gt;
                # trusted_networks 212.17.35.&lt;br /&gt;
                #&lt;br /&gt;
                &lt;br /&gt;
                # Below added from book&lt;br /&gt;
                # You may want to set this to 5, then, work your way down.&lt;br /&gt;
                # Currently I have this 3&lt;br /&gt;
                required_hits 3&lt;br /&gt;
                &lt;br /&gt;
                # This determines how spam is reported. Currently safe email is reported&lt;br /&gt;
                # in the message.&lt;br /&gt;
                report_safe 1&lt;br /&gt;
                &lt;br /&gt;
                # The will rewrite the tag of the spam message.&lt;br /&gt;
                rewrite_subject 1&lt;br /&gt;
                &lt;br /&gt;
                # By default, SpamAssassin will run RBL checks.  If your ISP already&lt;br /&gt;
                # does this, set this to 1.&lt;br /&gt;
                skip_rbl_checks 0&lt;br /&gt;
&lt;br /&gt;
     Step 3.&lt;br /&gt;
&lt;br /&gt;
            Update .procmail.&lt;br /&gt;
&lt;br /&gt;
            You should update the .procmail file as follows. Here is my /home/chirico/.procmail file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ cat /home/chirico/.procmailrc&lt;br /&gt;
&lt;br /&gt;
                PATH=/bin:/usr/bin:/usr/local/bin&lt;br /&gt;
                MAILDIR=/var/spool/mail&lt;br /&gt;
                DEFAULT=/var/spool/mail/chirico&lt;br /&gt;
                LOGFILE=/home/chirico/MailBAG&lt;br /&gt;
                MYHOME=/home/chirico&lt;br /&gt;
                #  Must have folder MailTRASH&lt;br /&gt;
                TRASH=/home/chirico/MailTRASH&lt;br /&gt;
                &lt;br /&gt;
                # Will get everything from this mail&lt;br /&gt;
                :0&lt;br /&gt;
                * ^From:.*sporkey@comcast.net&lt;br /&gt;
                        $DEFAULT&lt;br /&gt;
                &lt;br /&gt;
                # Spamassassin&lt;br /&gt;
                :0fw&lt;br /&gt;
                * &amp;lt;300000&lt;br /&gt;
                |/usr/local/bin/spamassassin&lt;br /&gt;
&lt;br /&gt;
      Reference:&lt;br /&gt;
        http://pm-doc.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 93:&lt;br /&gt;
&lt;br /&gt;
     Make Graphs: using dot and neato.&lt;br /&gt;
&lt;br /&gt;
       $ dot -Tpng dotfile -o myout.png&lt;br /&gt;
&lt;br /&gt;
     To see the output reference the following:&lt;br /&gt;
       http://souptonuts.sourceforge.net/code/myout.png&lt;br /&gt;
&lt;br /&gt;
     Where &amp;quot;dotfile&amp;quot; is the following:&lt;br /&gt;
&lt;br /&gt;
       $ cat dotfile&lt;br /&gt;
&lt;br /&gt;
       digraph g&lt;br /&gt;
       {&lt;br /&gt;
               node [shape = record];&lt;br /&gt;
&lt;br /&gt;
               node0 [ label =&amp;quot;&amp;lt;f0&amp;gt; stuff | &amp;lt;f1&amp;gt; J | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node1 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; E | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node4 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; C | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node6 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; I | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node2 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; U | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node5 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; N | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node9 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; Y | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node8 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; W | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node10 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; Z | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node7 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; A | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node3 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; G | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node0&amp;quot;:f0 -&amp;gt; &amp;quot;node1&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node0&amp;quot;:f2 -&amp;gt; &amp;quot;node2&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node1&amp;quot;:f0 -&amp;gt; &amp;quot;node4&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node1&amp;quot;:f2 -&amp;gt; &amp;quot;node6&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node4&amp;quot;:f0 -&amp;gt; &amp;quot;node7&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node4&amp;quot;:f2 -&amp;gt; &amp;quot;node3&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node2&amp;quot;:f0 -&amp;gt; &amp;quot;node5&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node2&amp;quot;:f2 -&amp;gt; &amp;quot;node9&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node9&amp;quot;:f0 -&amp;gt; &amp;quot;node8&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node9&amp;quot;:f2 -&amp;gt; &amp;quot;node10&amp;quot;:f1;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
     Checkout the following article:&lt;br /&gt;
        http://www.linuxjournal.com/article.php?sid=7275&lt;br /&gt;
&lt;br /&gt;
     To download this software&lt;br /&gt;
        http://www.graphviz.org/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 94:&lt;br /&gt;
&lt;br /&gt;
     Makefile: working with conditions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     First note that all the indentations of the file must be&lt;br /&gt;
     a single tab. There cannot be any spaces, or make will&lt;br /&gt;
     not run.&lt;br /&gt;
&lt;br /&gt;
       $ cat Makefile&lt;br /&gt;
&lt;br /&gt;
        # Compiler flags&lt;br /&gt;
        sqliteLIB := $(shell ls /usr/local/lib/libsqlite.so)&lt;br /&gt;
        sqlite3LIB := $(shell ls /usr/local/lib/libsqlite3.so)&lt;br /&gt;
        # all assumes sqlite and sqlite3 are installed&lt;br /&gt;
        #&lt;br /&gt;
&lt;br /&gt;
        test:&lt;br /&gt;
        ifeq (&amp;quot;$(sqlite3LIB)&amp;quot;,&amp;quot;/usr/local/lib/libsqlite3.so&amp;quot;)&lt;br /&gt;
             @echo -e &amp;quot;True -- we found the file&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
             @echo &amp;quot;False -- we did not find the file&amp;quot;&lt;br /&gt;
        endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     So, if I run make I will get the following output.&lt;br /&gt;
&lt;br /&gt;
       $ make&lt;br /&gt;
       True -- we found the file&lt;br /&gt;
&lt;br /&gt;
     This is because I have a file /usr/local/lib/libsqlite3.so on my system.&lt;br /&gt;
     Note how the assignment is made, with the shell command&lt;br /&gt;
&lt;br /&gt;
           sqlite3LIB := $(shell ls /usr/local/lib/libsqlite3.so)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 95:&lt;br /&gt;
&lt;br /&gt;
     Bash: Conditional Expressions&lt;br /&gt;
&lt;br /&gt;
          if [ -e /etc/ntp.conf ]&lt;br /&gt;
            then&lt;br /&gt;
              echo &amp;quot;You have the ntp config file&amp;quot;&lt;br /&gt;
            else&lt;br /&gt;
              echo &amp;quot;You do not have the ntp config file&amp;quot;&lt;br /&gt;
          fi&lt;br /&gt;
&lt;br /&gt;
       Now using an AND condition inside the [ ]. By the way, above, you&lt;br /&gt;
       can put the &amp;quot;then&amp;quot; on the same line as the if &amp;quot;if [ -e /etc/ntp.conf ]; then&amp;quot;&lt;br /&gt;
       as long as you use the &amp;quot;;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           if [ \( -e /etc/ntp.conf \) -a \( -e /etc/ntp/ntpservers \) ]&lt;br /&gt;
             then&lt;br /&gt;
               echo &amp;quot;You have ntp config and ntpservers&amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp.conf ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntp.conf &amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp/ntpservers ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntpservers &amp;quot;&lt;br /&gt;
             else&lt;br /&gt;
               echo &amp;quot; you have neither ntp.conf or ntpservers&amp;quot;&lt;br /&gt;
           fi&lt;br /&gt;
&lt;br /&gt;
        A few things to note above. Else if statement is written as &amp;quot;elif&amp;quot;, and when&lt;br /&gt;
        dealing with &amp;quot;(&amp;quot; you will need to insert &amp;quot;\(&amp;quot;. By the way &amp;quot;-o&amp;quot; can replace &amp;quot;-a&amp;quot;&lt;br /&gt;
        and the &amp;quot;-o&amp;quot; is for OR condition. AND can be done as follows too.&lt;br /&gt;
&lt;br /&gt;
           if [ -e /etc/ntp.conf ] &amp;amp;&amp;amp; [ -e /etc/ntp/ntpservers ]&lt;br /&gt;
             then&lt;br /&gt;
               echo &amp;quot;You have ntp config and ntpservers&amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp.conf ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntp.conf &amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp/ntpservers ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntpservers &amp;quot;&lt;br /&gt;
             else&lt;br /&gt;
               echo &amp;quot; you have neither ntp.conf or ntpservers&amp;quot;&lt;br /&gt;
           fi&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (files).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             -b file      True if file exists and is a block file&lt;br /&gt;
             -c file      True if file exists and is a character device file&lt;br /&gt;
             -d file      True if file exists and is a directory&lt;br /&gt;
             -e file      True if file exists&lt;br /&gt;
             -f file      True if file exists and is a regular file&lt;br /&gt;
             -g file      True if file exists and is set goup id&lt;br /&gt;
             -G file      True if owned by the effective group ID&lt;br /&gt;
&lt;br /&gt;
             -k file      True if &amp;quot;sticky&amp;quot; bit is set and file exists&lt;br /&gt;
             -L file      True if file exists and is a symbolic link&lt;br /&gt;
             -n string    True if string is non-null&lt;br /&gt;
&lt;br /&gt;
             -O file      Ture if file exists and is owned by the effective user ID&lt;br /&gt;
&lt;br /&gt;
             -p file      True if file is a named pipe (FIFO)&lt;br /&gt;
             -r file      True if file is readable&lt;br /&gt;
             -s file      True if file has size &amp;gt; 0&lt;br /&gt;
             -S file      True if file exists and is a socket&lt;br /&gt;
&lt;br /&gt;
             -t file      True if file is open and refers to a terminal.&lt;br /&gt;
             -u file      True if setuid bit is set&lt;br /&gt;
             -w file      True if file exists and is writeable&lt;br /&gt;
             -x file      True if file executable&lt;br /&gt;
             -x dir       True if directory can be searched&lt;br /&gt;
&lt;br /&gt;
             file1 -nt file2     True if file1 modification date newer than file2&lt;br /&gt;
             file1 -ot file2     True if file1 modification date older than file2&lt;br /&gt;
             file1 -ef file2     True if file1 and file2 have same inode&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (Integers).&lt;br /&gt;
&lt;br /&gt;
             -lt  Less than&lt;br /&gt;
             -le  Less than or equal&lt;br /&gt;
             -eq  Equal&lt;br /&gt;
             -ge  Greater than or equal&lt;br /&gt;
             -gt  Greater than&lt;br /&gt;
             -ne  Not equal&lt;br /&gt;
&lt;br /&gt;
          Example usage.&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
             {&lt;br /&gt;
               while read num value; do&lt;br /&gt;
                if [ $num -gt  2 ]; then&lt;br /&gt;
                  echo $value&lt;br /&gt;
                fi&lt;br /&gt;
               done&lt;br /&gt;
             } &amp;lt; somefile&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (Strings).&lt;br /&gt;
&lt;br /&gt;
             str1 = str2      str1 matches str2&lt;br /&gt;
             str1 != str2     str1 does not matches str2&lt;br /&gt;
             str1 &amp;lt; str2      str1 is less than str2&lt;br /&gt;
             str1 &amp;gt;  str2     str1 is greater than str2&lt;br /&gt;
             -n str1          str1 is not null (length greater than 0)&lt;br /&gt;
             -z str1          str1 is null (las length 0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 96:&lt;br /&gt;
&lt;br /&gt;
     CVS: Working with cvs&lt;br /&gt;
&lt;br /&gt;
      INITIAL REPOSITORY:&lt;br /&gt;
&lt;br /&gt;
       To create a repository, and this is normally done by the system admin. This&lt;br /&gt;
       is NOT creating a project to checkout, but the location where everything&lt;br /&gt;
       will be stored! The initial repository!&lt;br /&gt;
&lt;br /&gt;
             cvs -d repository_root_directory init&lt;br /&gt;
&lt;br /&gt;
       Or here is a specific example:&lt;br /&gt;
&lt;br /&gt;
             cvs -d /work/cvsREPOSITORY/   init&lt;br /&gt;
&lt;br /&gt;
       Creating a directory tree from scratch. For a new project, the easiest thing to&lt;br /&gt;
       do is probably to create an empty directory structure, like this:&lt;br /&gt;
&lt;br /&gt;
             $ mkdir sqlite_examples&lt;br /&gt;
             $ mkdir sqlite_examples/man&lt;br /&gt;
             $ mkdir sqlite_examples/testing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       After that, you use the import command to create the&lt;br /&gt;
       corresponding (empty) directory structure inside the repository:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             $ cd &amp;lt;directory&amp;gt;&lt;br /&gt;
             $ cvs -d repository_root_directory import  -m &amp;quot;Created directory structure&amp;quot; yoyodyne/dir yoyo start&lt;br /&gt;
&lt;br /&gt;
       Or, here is a specific example.&lt;br /&gt;
&lt;br /&gt;
             $  cd sqlite_examples&lt;br /&gt;
             $  cvs  -d /work/cvsREPOSITORY/ import -m 'test SQlite'  sqlite_examples sqlite_examples start&lt;br /&gt;
&lt;br /&gt;
       Now, you can delete the directory sqlite_examples, or go to another directory and type&lt;br /&gt;
       the following:&lt;br /&gt;
&lt;br /&gt;
             $ cvs -d /work/cvsREPOSITORY/ co sqlite_examples&lt;br /&gt;
&lt;br /&gt;
     COOL TOOLS:&lt;br /&gt;
&lt;br /&gt;
           1. cvsps&lt;br /&gt;
           2. cvsreport&lt;br /&gt;
&lt;br /&gt;
         cvsps which you can find at http://www.cobite.com/cvsps/cvsps-2.0rc1.tar.gz&lt;br /&gt;
&lt;br /&gt;
             $ cvsps -f README_sqlite_tutorial.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 97:&lt;br /&gt;
&lt;br /&gt;
     Common vi and vim commands&lt;br /&gt;
&lt;br /&gt;
           Command mode ESC&lt;br /&gt;
&lt;br /&gt;
                dd       delete&lt;br /&gt;
                u        undelete&lt;br /&gt;
                y        yank (copy to buffer)&lt;br /&gt;
                p/P      p before cursor/P after cursor&lt;br /&gt;
&lt;br /&gt;
                Ctl-g    show current line number&lt;br /&gt;
                shft-G   end of file&lt;br /&gt;
              n shft-G   move to line n&lt;br /&gt;
&lt;br /&gt;
               /stuff/   search&lt;br /&gt;
                  n   repeat in same direction&lt;br /&gt;
                  N   repeat in opposite direction&lt;br /&gt;
                  /return  repeat seach forward&lt;br /&gt;
                  ?return  repeat seach backward&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;dyy  Yank current line to buffer d&lt;br /&gt;
               &amp;quot;a7yy Yank next 7 lines to buffer a&lt;br /&gt;
                    or&lt;br /&gt;
               :1,7ya a  Yank [ya] lines 1,7 to buffer a&lt;br /&gt;
               :1,7ya b  Yank [ya] lines 1,7 to buffer b&lt;br /&gt;
&lt;br /&gt;
               :5 pu b   Put [pu] buffer b after line 5&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;dP   Put the content of buffer d before cursor&lt;br /&gt;
               &amp;quot;ap   Put the contents of buffer a after cursor&lt;br /&gt;
&lt;br /&gt;
               :1,4 w! file2  Write lines 1,4 to file2&lt;br /&gt;
               :1,3&lt;br /&gt;
&lt;br /&gt;
               :set nu     Display line numbers&lt;br /&gt;
               :set nonum  Turns off display&lt;br /&gt;
&lt;br /&gt;
               :e &amp;lt;filename&amp;gt; Edit a file in a new buffer&lt;br /&gt;
&lt;br /&gt;
            vim&lt;br /&gt;
               :split&lt;br /&gt;
               :split &amp;lt;filename&amp;gt;&lt;br /&gt;
               :sp &amp;lt;filename&amp;gt;&lt;br /&gt;
               :split new&lt;br /&gt;
&lt;br /&gt;
                   ctl-w   To move between windows&lt;br /&gt;
                   ctl-w+&lt;br /&gt;
                   ctl-w-  To change size&lt;br /&gt;
                   ctl+wv  Split windows vertically&lt;br /&gt;
                   ctl-wq  Close window&lt;br /&gt;
&lt;br /&gt;
               :only       To view only 1 window&lt;br /&gt;
&lt;br /&gt;
            vim dictionary - put the following command in ~/.vimrc&lt;br /&gt;
&lt;br /&gt;
                   set dictionary+=/usr/share/dict/words&lt;br /&gt;
                   set thesaurus+=/usr/share/dict/words&lt;br /&gt;
              &lt;br /&gt;
               Now, after you type a word &amp;lt;ctl-x&amp;gt;&amp;lt;ctl-k&amp;gt;&amp;lt;ctl-n&amp;gt; and to &lt;br /&gt;
               go back in the listing &amp;lt;ctl-p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                   butter&amp;lt;ctl-x&amp;gt;&amp;lt;ctl-k&amp;gt;&amp;lt;ctl-n&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 98:&lt;br /&gt;
&lt;br /&gt;
     Using apt-get&lt;br /&gt;
&lt;br /&gt;
          $ apt-get update&lt;br /&gt;
          $ apt-get -s install &amp;lt;pkage&amp;gt;    &amp;lt;---- if everything is ok, then, remove the s&lt;br /&gt;
&lt;br /&gt;
     Note you may want to use dpkg to purge if you have to do a reinstall.&lt;br /&gt;
&lt;br /&gt;
          $ dpkg --purge exim4-base&lt;br /&gt;
          $ dpkg --purge exim4-config&lt;br /&gt;
          $ apt-get install exim4&lt;br /&gt;
&lt;br /&gt;
          $ dpkg-reconfigure exim4-config&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 99:&lt;br /&gt;
&lt;br /&gt;
     Mounting a cdrom on openbsd and installing packages&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /cdrom&lt;br /&gt;
          $ mount /dev/cd0a /cdrom&lt;br /&gt;
          $ cd /cdrom&lt;br /&gt;
&lt;br /&gt;
     To add packages&lt;br /&gt;
&lt;br /&gt;
          $ pkg_add -v  &amp;lt;directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Mounting a cdrom on linux to a user's home sub-directory:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /home/chirico/cdrom&lt;br /&gt;
          $ mount /dev/cdrom /home/chirico/cdrom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 100:&lt;br /&gt;
&lt;br /&gt;
    Creating a boot floppy for knoppix cd:&lt;br /&gt;
&lt;br /&gt;
          $ dd if=/mnt/cdrom/KNOPPIX/boot.img of=/dev/fd0 bs=1440k&lt;br /&gt;
&lt;br /&gt;
    References:&lt;br /&gt;
        http://www.knoppix.net/docs/index.php/BootFloppyHowTo&lt;br /&gt;
&lt;br /&gt;
    For a lot of the knoppix how-to's&lt;br /&gt;
        http://www.knoppix.net/docs/index.php/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 101:&lt;br /&gt;
&lt;br /&gt;
    Diction and Style Tools for Linux  http://ftp.gnu.org/gnu/diction/&lt;br /&gt;
&lt;br /&gt;
        $ diction mytext|less&lt;br /&gt;
&lt;br /&gt;
    Or, this can be done interactively&lt;br /&gt;
&lt;br /&gt;
        $ diction&lt;br /&gt;
        This is more text to read and you can do with it&lt;br /&gt;
        what you want.&lt;br /&gt;
        (stdin):1: This is more text to read and you [can -&amp;gt; (do not confuse with &amp;quot;may&amp;quot;)] do with it what you want.&lt;br /&gt;
&lt;br /&gt;
    DESCRIPTION&lt;br /&gt;
       Diction finds all sentences in a document, that contain phrases from  a&lt;br /&gt;
       database  of  frequently  misused,  bad  or  wordy diction.  It further&lt;br /&gt;
       checks for double words.  If no files are given, the document  is  read&lt;br /&gt;
       from  standard input.  Each found phrase is enclosed in [ ] (brackets).&lt;br /&gt;
       Suggestions and advice, if any, are printed headed by a right arrow -&amp;gt;.&lt;br /&gt;
       A  sentence is a sequence of words, that starts with a capitalised word&lt;br /&gt;
       and ends with a full stop, double colon, question mark or  exclaimation&lt;br /&gt;
       mark.  A single letter followed by a dot is considered an abbreviation,&lt;br /&gt;
       so it does not terminate a sentence.   Various  multi-letter  abbrevia-&lt;br /&gt;
       tions are recognized, they do not terminate a sentence as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 102:&lt;br /&gt;
&lt;br /&gt;
    Using a mail alias.&lt;br /&gt;
&lt;br /&gt;
       Suppose all root mail on your system to go to one root account root@main.com&lt;br /&gt;
&lt;br /&gt;
       In the following file:&lt;br /&gt;
&lt;br /&gt;
             /etc/aliases&lt;br /&gt;
&lt;br /&gt;
       Add this line&lt;br /&gt;
&lt;br /&gt;
             root:    root@main.com&lt;br /&gt;
&lt;br /&gt;
       Next, run newaliases [/usr/bin/newaliases] as follows:&lt;br /&gt;
&lt;br /&gt;
             $ newaliases&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Special note: It's possible to send mail to more than one address. Suppose you want&lt;br /&gt;
                     mail going to root@main.com above, plus you want it going to user donkey&lt;br /&gt;
                     on the local system.&lt;br /&gt;
&lt;br /&gt;
             root:  root@main.com donkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 103:&lt;br /&gt;
&lt;br /&gt;
    Chrony - this service is similiar to ntp. It keeps accurate time&lt;br /&gt;
            on your computer against a very accurate clock in across&lt;br /&gt;
            a network with various time delays.&lt;br /&gt;
&lt;br /&gt;
    Reference: http://go.to/chrony&lt;br /&gt;
&lt;br /&gt;
        In the file &amp;quot;/etc/chrony/chrony.conf&amp;quot; add/replace the following&lt;br /&gt;
&lt;br /&gt;
             server 146.186.218.60&lt;br /&gt;
             server 128.118.25.3&lt;br /&gt;
             server 128.2.129.21&lt;br /&gt;
&lt;br /&gt;
        Next start the chrony service&lt;br /&gt;
&lt;br /&gt;
           $ /etc/init.d/chrony restart&lt;br /&gt;
&lt;br /&gt;
     Next verify that this is working. It may take 20 or 30 minutes to update&lt;br /&gt;
     the clock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Shell command:&lt;br /&gt;
       # chronyc&lt;br /&gt;
       chronyc&amp;gt; sourcestats&lt;br /&gt;
       210 Number of sources = 3&lt;br /&gt;
       Name/IP Address            NP  NR  Span  Frequency   Freq Skew   Std Dev&lt;br /&gt;
       ========================================================================&lt;br /&gt;
       b50.cede.psu.edu            2   0    64       0.000    2000.000  4000ms&lt;br /&gt;
       otc2.psu.edu                2   0    66       0.000    2000.000  4000ms&lt;br /&gt;
       FS3.ECE.CMU.EDU             2   0    64       0.000    2000.000  4000ms&lt;br /&gt;
       chronyc&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    It is probably best to let chrony do its work. However, if you want to&lt;br /&gt;
    set both the hardware and software clock, the following will work:&lt;br /&gt;
&lt;br /&gt;
      Sets the hardware clock&lt;br /&gt;
        # hwclock --set --date=&amp;quot;12/10/04 10:18:05&amp;quot;&lt;br /&gt;
      Sync the hardware clock to software&lt;br /&gt;
        # hwclock --hctosys&lt;br /&gt;
&lt;br /&gt;
    Normally the system keep accurate time with the software clock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 104:&lt;br /&gt;
&lt;br /&gt;
    NFS mount&lt;br /&gt;
&lt;br /&gt;
     SERVER (192.168.1.182)&lt;br /&gt;
&lt;br /&gt;
       Make sure nfs is running on the server&lt;br /&gt;
 &lt;br /&gt;
           $ /etc/init.d/nfs restart&lt;br /&gt;
&lt;br /&gt;
       At the server the contents of /etc/exports for&lt;br /&gt;
       allowing 2 computers (192.168.1.171 and 192.168.1.71)&lt;br /&gt;
       to access the home directory of this server. Note that&lt;br /&gt;
       read write (rw) access is allowed.&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/exports&lt;br /&gt;
         /home   192.168.1.171(rw)&lt;br /&gt;
         /home   192.168.1.71(rw)&lt;br /&gt;
&lt;br /&gt;
       Or, if you have a lot of clients on 192.168.1.* then consider&lt;br /&gt;
       the following:&lt;br /&gt;
&lt;br /&gt;
          /home 192.168.1.0/255.255.252.0(rw)&lt;br /&gt;
&lt;br /&gt;
       Next, still at the server, run the exportfs command&lt;br /&gt;
&lt;br /&gt;
          $ exportfs -rv&lt;br /&gt;
&lt;br /&gt;
       IPTABLES (lokkit). If you're using fedora with default lokkit firewall&lt;br /&gt;
                then you can put the following under &amp;quot;Other ports&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                  Other ports nfs:tcp nfs:udp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       If the above does not work or you are not using lokkit&lt;br /&gt;
        IPTABLES (values in /etc/sysconfig/iptables on SERVER )&lt;br /&gt;
&lt;br /&gt;
        # NFS Need to accept fragmented packets and may not have header&lt;br /&gt;
        #             so you will not know where they are coming from&lt;br /&gt;
        -A INPUT -f -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -m tcp -s 192.168.1.171 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -s 192.168.1.171 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -m udp -s 192.168.1.171 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -s 192.168.1.171 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        &lt;br /&gt;
        -A INPUT -f -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -m tcp -s 192.168.1.71 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -s 192.168.1.71 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -m udp -s 192.168.1.71 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -s 192.168.1.71 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        (Reference: http://nfs.sourceforge.net/nfs-howto/server.html)&lt;br /&gt;
                  and&lt;br /&gt;
        (Reference: http://nfs.sourceforge.net/nfs-howto/security.html)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     CLIENT1 (192.168.1.171)&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /home2&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/fstab&lt;br /&gt;
         192.168.1.182:/home          /home2     nfs     rw 0 0&lt;br /&gt;
&lt;br /&gt;
          $ mount -a -t nfs&lt;br /&gt;
&lt;br /&gt;
        Or to do a one time mounting by hand&lt;br /&gt;
&lt;br /&gt;
          $ mount -t nfs 192.168.1.182:/home  /home2&lt;br /&gt;
&lt;br /&gt;
        Now /home2 on the client will be /home on the server&lt;br /&gt;
&lt;br /&gt;
        Reference:&lt;br /&gt;
          http://nfs.sourceforge.net/nfs-howto/index.html&lt;br /&gt;
&lt;br /&gt;
     MONITOR NFS:&lt;br /&gt;
&lt;br /&gt;
        To monitor the client:&lt;br /&gt;
&lt;br /&gt;
          $ nfsstat -c&lt;br /&gt;
&lt;br /&gt;
           Also note you can &amp;quot;cat /proc/net/rpc/nfs&amp;quot; as well.&lt;br /&gt;
&lt;br /&gt;
       To monitor the server (note the -s instead of the -c).&lt;br /&gt;
&lt;br /&gt;
         $ nfsstat -s&lt;br /&gt;
&lt;br /&gt;
           Also note you can &amp;quot;cat /proc/net/rpc/nfsd&amp;quot; as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       The following &amp;quot;cat&amp;quot; command is done on the NFS server, and shows which&lt;br /&gt;
       clients are mounting. This does not go with examples above. By the way,&lt;br /&gt;
       &amp;quot;root_squash&amp;quot; is the default, and means that root access on the clients is&lt;br /&gt;
       denied. So, how does the client root get access to these filesystems? You have&lt;br /&gt;
       to &amp;quot;su - &amp;lt;someuser&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
              $ cat /proc/fs/nfs/exports&lt;br /&gt;
              # Version 1.1&lt;br /&gt;
              # Path Client(Flags) # IPs&lt;br /&gt;
              /home   192.168.1.102(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   squeezel.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   192.168.1.106(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   livingroom.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   10.8.0.1(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   closet.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
&lt;br /&gt;
     (Reference: http://www.vanemery.com/Linux/NFSv4/NFSv4-no-rpcsec.html#automount )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 105:&lt;br /&gt;
&lt;br /&gt;
      Ports used for Microsoft products&lt;br /&gt;
               http://www.microsoft.com/canada/smallbiz/sgc/articles/ref_net_ports_ms_prod.mspx?pf=true&lt;br /&gt;
          Firewalling?&lt;br /&gt;
               http://www.microsoft.com/technet/prodtechnol/windowsserver2003/library/ServerHelp/428c1bbf-2ceb-4f76-a1ef-0219982eca10.mspx&lt;br /&gt;
&lt;br /&gt;
      To find out common port mappings, take a look at &amp;quot;/etc/services&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 106:&lt;br /&gt;
&lt;br /&gt;
      Man pages: If man pages are formatting incorrectly with PuTTY, try editing&lt;br /&gt;
      the &amp;quot;/etc/man.config&amp;quot; file with the following changes:&lt;br /&gt;
&lt;br /&gt;
           NROFF /usr/bin/groff -Tlatin1 -mandoc&lt;br /&gt;
           NEQN /usr/bin/geqn -Tlatin1&lt;br /&gt;
&lt;br /&gt;
         (Reference TIP 7 for using man)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 107:&lt;br /&gt;
&lt;br /&gt;
      Valgrind: check for memory leaks in your programs. (http://valgrind.org/)&lt;br /&gt;
&lt;br /&gt;
       This is how you can run it on the program &amp;quot;a.out&amp;quot; for valgrind version 2.2.0&lt;br /&gt;
&lt;br /&gt;
         $ valgrind --logfile=valgrind.output   --tool=memcheck ./a.out&lt;br /&gt;
&lt;br /&gt;
       This is how you write the logfile &amp;quot;--log-file&amp;quot; for valgrind-3.0.1&lt;br /&gt;
&lt;br /&gt;
         $ valgrind  --log-file=valgrind --leak-check=yes --tool=memcheck ./a.out&lt;br /&gt;
&lt;br /&gt;
       With C++ programs with gcc 3.4 and later that use STL, export GLIBCXX_FORCE_NEW &lt;br /&gt;
       only when testing to disable memory caching. Remember to enable for production&lt;br /&gt;
       as this will have a performance penalty. Reference  http://valgrind.org/docs/FAQ/ &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 108:&lt;br /&gt;
&lt;br /&gt;
      Runlevel Configuring.&lt;br /&gt;
&lt;br /&gt;
       These two programs, run as root give you a ncurses GUI to what will&lt;br /&gt;
       run on your system on boot.&lt;br /&gt;
&lt;br /&gt;
            # ntsysv&lt;br /&gt;
&lt;br /&gt;
            # chkconfig&lt;br /&gt;
&lt;br /&gt;
       Note, you can also set these manually. For example, normally you will&lt;br /&gt;
       have files in &amp;quot;/etc/init.d/&amp;quot; that will take parameters like &amp;quot;start&amp;quot;,&amp;quot;stop&amp;quot;&lt;br /&gt;
       &amp;quot;restart&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       Take a look at &amp;quot;/etc/init.d/mysql&amp;quot; this file will start and stop the&lt;br /&gt;
       mysql daemon. So, how does know which run levels, and the order it gets&lt;br /&gt;
       loaded in the run level to other programs? By the K&amp;lt;number&amp;gt; and S&amp;lt;number&amp;gt;&lt;br /&gt;
       values.&lt;br /&gt;
&lt;br /&gt;
            $ ls /etc/rc3.d/*mysql&lt;br /&gt;
&lt;br /&gt;
                /etc/rc3.d/K85mysql&lt;br /&gt;
                /etc/rc3.d/S85mysql&lt;br /&gt;
&lt;br /&gt;
       So here on my system the start value is 85. Looking in /etc/rc3.d, which is&lt;br /&gt;
       run level 3, any program with a lower number S84something will get loaded&lt;br /&gt;
       before mysql.&lt;br /&gt;
&lt;br /&gt;
       I manually set the run level as follows for mysql.&lt;br /&gt;
&lt;br /&gt;
            # cd /etc/rc3.d&lt;br /&gt;
            # ln -s ../init.d/mysql S85mysql&lt;br /&gt;
            # ln -s ../init.d/mysql K85mysql&lt;br /&gt;
&lt;br /&gt;
            # cd /etc/rc5.d&lt;br /&gt;
            # ln -s ../init.d/mysql S85mysql&lt;br /&gt;
            # ln -s ../init.d/mysql K85mysql&lt;br /&gt;
&lt;br /&gt;
       Note that I could have chose other numbers as well. &amp;quot;ntsysv&amp;quot; gives&lt;br /&gt;
       you a graphical interface.&lt;br /&gt;
&lt;br /&gt;
       This is a way of doing this with &amp;quot;chkconfig&amp;quot; at the command prompt.&lt;br /&gt;
&lt;br /&gt;
            # chkconfig --list mysqld&lt;br /&gt;
            mysqld          0:off   1:off   2:off   3:on    4:off   5:on    6:off&lt;br /&gt;
&lt;br /&gt;
       Above you can see it's on. Here's how we would have turned this on with chkconfig.&lt;br /&gt;
&lt;br /&gt;
            # chkconfig --level 35 mysqld on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 109:&lt;br /&gt;
&lt;br /&gt;
       File Alteration Monitor - Gamin a FAM replacement&lt;br /&gt;
        http://www.gnome.org/~veillard/gamin/&lt;br /&gt;
        http://www.gnome.org/~veillard/gamin/sources/&lt;br /&gt;
       ******  EXAMPLE NOT COMPLETE *****&lt;br /&gt;
&lt;br /&gt;
       Working with fam  - file alteration monitor.  Mail uses this to signify&lt;br /&gt;
           a change in a file's status.&lt;br /&gt;
&lt;br /&gt;
        Below is the sample C program ftest.c which can be compiled as&lt;br /&gt;
        follows:&lt;br /&gt;
&lt;br /&gt;
              $ gcc -o ftest ftest.c  -lfam&lt;br /&gt;
&lt;br /&gt;
        You will need to work with this as root&lt;br /&gt;
&lt;br /&gt;
              #  ./ftest &amp;lt;somefile absolute path&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Reference:&lt;br /&gt;
            http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?db=man&amp;amp;fname=/usr/share/catman/p_man/cat3x/fam.z&lt;br /&gt;
            http://www.devchannel.org/devtoolschannel/04/05/13/2146252.shtml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 110:&lt;br /&gt;
&lt;br /&gt;
       glibc - this is the main library used by C, and the following&lt;br /&gt;
        link below gives you examples on everything from sockets,math,&lt;br /&gt;
        date and time functions, user environment, and much more.&lt;br /&gt;
&lt;br /&gt;
         http://www.gnu.org/software/libc/manual/html_mono/libc.html&lt;br /&gt;
&lt;br /&gt;
       How do you know which version of glibc you are running?&lt;br /&gt;
&lt;br /&gt;
          #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
          #include &amp;lt;gnu/libc-version.h&amp;gt;&lt;br /&gt;
          int main (void)&lt;br /&gt;
           {&lt;br /&gt;
             puts (gnu_get_libc_version ());&lt;br /&gt;
             return 0;&lt;br /&gt;
           }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 111:&lt;br /&gt;
&lt;br /&gt;
       nslookup and dig - query Internet name servers interactively.&lt;br /&gt;
&lt;br /&gt;
         $ nslookup&lt;br /&gt;
         &amp;gt;chirico.org&lt;br /&gt;
         Server:        68.80.0.6&lt;br /&gt;
         Address:       68.80.0.6#53&lt;br /&gt;
&lt;br /&gt;
         Name: chirico.org&lt;br /&gt;
         Address: 66.35.250.210&lt;br /&gt;
         &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      The nslookup command will query the dns server is &amp;quot;/etc/resolve.conf&amp;quot;&lt;br /&gt;
      However, you can force a certain dns with &amp;quot;- server&amp;quot;.  For example the&lt;br /&gt;
      command below goes to the server named dilbert&lt;br /&gt;
&lt;br /&gt;
         $ nslookup - dilbert&lt;br /&gt;
         &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      dig:&lt;br /&gt;
&lt;br /&gt;
      dig gives you more information. You should probably use dig instead&lt;br /&gt;
      of nslookup.&lt;br /&gt;
&lt;br /&gt;
      Below I am forcing the lookup from DNS 68.80.0.6 of the name chirico.org, and&lt;br /&gt;
      note that the query time is return too.&lt;br /&gt;
&lt;br /&gt;
         $ dig @68.80.0.6  +qr chirico.org&lt;br /&gt;
&lt;br /&gt;
         ; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.2.1 &amp;lt;&amp;lt;&amp;gt;&amp;gt; @68.80.0.6 +qr chirico.org&lt;br /&gt;
         ;; global options:  printcmd&lt;br /&gt;
         ;; Sending:&lt;br /&gt;
         ;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 55908&lt;br /&gt;
         ;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0&lt;br /&gt;
        &lt;br /&gt;
         ;; QUESTION SECTION:&lt;br /&gt;
         ;chirico.org.                   IN      A&lt;br /&gt;
        &lt;br /&gt;
         ;; Got answer:&lt;br /&gt;
         ;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 55908&lt;br /&gt;
         ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
        &lt;br /&gt;
         ;; QUESTION SECTION:&lt;br /&gt;
         ;chirico.org.                   IN      A&lt;br /&gt;
        &lt;br /&gt;
         ;; ANSWER SECTION:&lt;br /&gt;
         chirico.org.            5538    IN      A       66.35.250.210&lt;br /&gt;
        &lt;br /&gt;
         ;; AUTHORITY SECTION:&lt;br /&gt;
         chirico.org.            30599   IN      NS      ns78.worldnic.com.&lt;br /&gt;
         chirico.org.            30599   IN      NS      ns77.worldnic.com.&lt;br /&gt;
        &lt;br /&gt;
         ;; ADDITIONAL SECTION:&lt;br /&gt;
         ns78.worldnic.com.      16022   IN      A       216.168.225.218&lt;br /&gt;
         ns77.worldnic.com.      7       IN      A       216.168.228.41&lt;br /&gt;
        &lt;br /&gt;
         ;; Query time: 155 msec&lt;br /&gt;
         ;; SERVER: 68.80.0.6#53(68.80.0.6)&lt;br /&gt;
         ;; WHEN: Thu Dec 23 07:48:23 2004&lt;br /&gt;
         ;; MSG SIZE  rcvd: 127&lt;br /&gt;
&lt;br /&gt;
      So what if you wanted to know what name the IP address 66.35.250.210&lt;br /&gt;
      resolves to, when using dns 68.80.0.12.&lt;br /&gt;
&lt;br /&gt;
          $ dig @68.80.0.12 -x 66.35.250.210&lt;br /&gt;
          ...&lt;br /&gt;
          ;; ANSWER SECTION:&lt;br /&gt;
          210.250.35.66.in-addr.arpa. 3600 IN   CNAME   210.0/24.250.35.66.in-addr.arpa.&lt;br /&gt;
          210.0/24.250.35.66.in-addr.arpa. 3600 IN PTR  vhost.sourceforge.net.&lt;br /&gt;
&lt;br /&gt;
      Above you can see it resolved to &amp;quot;vhost.sourceforge.net&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      Reference ( http://www.tldp.org/HOWTO/DNS-HOWTO-5.html )&lt;br /&gt;
        Also see TIP 223.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 112:&lt;br /&gt;
&lt;br /&gt;
       Using GNU Autotools - so you can produce the familiar &amp;quot;./configure&amp;quot;  &amp;quot;make&amp;quot;  and &amp;quot;make install&amp;quot;&lt;br /&gt;
                             commands. There is also a &amp;quot;make dist&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                The program sqlite3api.cc and the rest of this code can be found at&lt;br /&gt;
                 http://prdownloads.sourceforge.net/cpearls/autotools.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         A &amp;quot;Makefile.am&amp;quot; is required:&lt;br /&gt;
&lt;br /&gt;
            bin_PROGRAMS = sprog&lt;br /&gt;
            sprog_SOURCES = sqlite3api.cc&lt;br /&gt;
            sprog_LDADD = @INCLUDES@ @SQLIBOBJS@&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         In addition, a &amp;quot;configure.in&amp;quot; file is required. Note, AC_CHECK_LIB will&lt;br /&gt;
         check the &amp;quot;libsqlite3.so&amp;quot; file for the &amp;quot;sqlite3_open&amp;quot; file. Note that&lt;br /&gt;
         &amp;quot;sqlite3&amp;quot;, is a shortcut for &amp;quot;libsqlite3&amp;quot; by convention. If this file&lt;br /&gt;
         is not found, AC_CHECK_FILE looks for &amp;quot;/usr/local/lib/libsqlite3.a&amp;quot;. If&lt;br /&gt;
         this is found, then, &amp;quot;-lsqlite3&amp;quot; is added to the LIBS environment variable.&lt;br /&gt;
         Also, &amp;quot;-I/usr/local/include&amp;quot; and &amp;quot;-L/usr/local/lib&amp;quot; will be added on the&lt;br /&gt;
         command line. This is common when some one does not have the library in&lt;br /&gt;
         the path.  (See TIP 49)&lt;br /&gt;
&lt;br /&gt;
            dnl Process this file with autoconf to produce a configure script.&lt;br /&gt;
            AC_INIT(sqlite3api.cc)&lt;br /&gt;
            AM_INIT_AUTOMAKE(sqliteprog, 1.0)&lt;br /&gt;
            AC_PROG_CXX&lt;br /&gt;
            CXXFLAGS='-Wall -W -O2 -s -pipe'&lt;br /&gt;
            AC_CHECK_LIB(sqlite3,sqlite3_open,[],found=no)&lt;br /&gt;
             if test &amp;quot;$found&amp;quot; = &amp;quot;no&amp;quot;; then&lt;br /&gt;
               AC_CHECK_FILE(/usr/local/lib/libsqlite3.a, found=yes)&lt;br /&gt;
               if test &amp;quot;$found&amp;quot; = &amp;quot;yes&amp;quot;; then&lt;br /&gt;
                 LIBS=&amp;quot;$LIBS -lsqlite3&amp;quot;&lt;br /&gt;
                 INCLUDES=&amp;quot;$INCLUDES -I/usr/local/include&amp;quot;&lt;br /&gt;
                 EXTRALIB='-L/usr/local/lib'&lt;br /&gt;
                else&lt;br /&gt;
                 echo &amp;quot;Are you SURE sqlite3 is installed?&amp;quot;&lt;br /&gt;
               fi&lt;br /&gt;
             fi&lt;br /&gt;
            SQLIBOBJS='-Wl,-R/usr/local/lib'&lt;br /&gt;
            AC_SUBST(INCLUDES)&lt;br /&gt;
            AC_SUBST(SQLIBOBJS)&lt;br /&gt;
            AC_SUBST(EXTRALIB)&lt;br /&gt;
            AC_OUTPUT(Makefile)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         To build the configure file, just run the following:&lt;br /&gt;
&lt;br /&gt;
             $ aclocal&lt;br /&gt;
             $ autoconf&lt;br /&gt;
             $ touch NEWS README AUTHORS ChangeLog&lt;br /&gt;
             $ automake --add-missing&lt;br /&gt;
&lt;br /&gt;
         Now if you want to make a tar.gz file &amp;quot;sqliteprog-1.0.tar.gz&amp;quot;, then&lt;br /&gt;
         all you have to run is the following:&lt;br /&gt;
&lt;br /&gt;
             $ make dist&lt;br /&gt;
&lt;br /&gt;
         Note: did you ever want to save all the output from a ./configure? Well, it&lt;br /&gt;
               is automatically saved in the &amp;quot;config.log&amp;quot; file. In fact, this file may&lt;br /&gt;
               contain a lot more than what you saw on the screen.&lt;br /&gt;
&lt;br /&gt;
               Also, you may need to rerun ./configure. But before you do, delete&lt;br /&gt;
               the &amp;quot;config.cache&amp;quot; file to get a clean build.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 113:&lt;br /&gt;
&lt;br /&gt;
       EMACS - common emacs commands.&lt;br /&gt;
&lt;br /&gt;
         M is the ESC&lt;br /&gt;
         C or c is the Ctl&lt;br /&gt;
&lt;br /&gt;
        Shell - when working in a shell. &amp;quot;M-x rename-uniquely&amp;quot; is good for split screen editing.&lt;br /&gt;
&lt;br /&gt;
          M-x rename-uniquely   Use this for multiple shells (renames buffer so it's not the same shell)&lt;br /&gt;
          C-c C-z               Send job in background (when working in a shell)&lt;br /&gt;
          C-c C-o               commit-kill-output (gets rid of a lot of shell output)&lt;br /&gt;
          C-c C-r               reposition at beginning of output&lt;br /&gt;
          C-c C-e               reposition at end of output&lt;br /&gt;
          M-x send-invisible    Hide passwords - use this before typing a password&lt;br /&gt;
&lt;br /&gt;
         Note: if the shell prompt does not show up correctly, then, you may want to creat a &amp;quot;.emacs_bash&amp;quot;&lt;br /&gt;
               file with the following contents:&lt;br /&gt;
&lt;br /&gt;
                          PS1=&amp;quot;emacs:\W \$ &amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Directories  (C-x d) give you a directory listing. You know all those annoying &amp;quot;~&amp;quot; and &amp;quot;#&amp;quot;&lt;br /&gt;
                     file that you get? You can easily delete these when in &amp;quot;dired&amp;quot; mode by hitting&lt;br /&gt;
                     &amp;quot;~&amp;quot;, then  &amp;quot;d&amp;quot; to flag it for delete. Then, hit &amp;quot;x&amp;quot; to and confirm deletion.&lt;br /&gt;
&lt;br /&gt;
                     These are other command that work on highlighted files in &amp;quot;dired&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
                          R   rename&lt;br /&gt;
                          v   view&lt;br /&gt;
                          Z   compress the file&lt;br /&gt;
                          +   create directory&lt;br /&gt;
&lt;br /&gt;
        Other common commands:&lt;br /&gt;
&lt;br /&gt;
          c-x l          list the line you are on, and how many lines in the document.&lt;br /&gt;
                         You will get something like: Page has 4881 lines (4440 + 442),&lt;br /&gt;
                         which means you are on the 4440 line.&lt;br /&gt;
&lt;br /&gt;
          c-x rm bookmark make&lt;br /&gt;
          c-x rb bookmark bounce&lt;br /&gt;
        &lt;br /&gt;
          c-x rb notes&lt;br /&gt;
          c-x rb emacs&lt;br /&gt;
        &lt;br /&gt;
          c-x / &amp;lt;r&amp;gt; (save position in register &amp;lt;r&amp;gt;)&lt;br /&gt;
          c-x j &amp;lt;r&amp;gt; (jump to position in register &amp;lt;r&amp;gt;)&lt;br /&gt;
          c-x r SPC 1 (mark current point in register 1)&lt;br /&gt;
          c-x r j 1 (jump to marked point in register 1)&lt;br /&gt;
          c-x r t &amp;lt;string&amp;gt;  (insert string into register)&lt;br /&gt;
        &lt;br /&gt;
          c-x r s 1 (save marked region in register 1)&lt;br /&gt;
          c-x r i 1 (insert marked region)&lt;br /&gt;
        &lt;br /&gt;
          c-x c-o (delete all blank lines, except one)&lt;br /&gt;
        &lt;br /&gt;
          c-x z (repeat the last command ... stop with an a)&lt;br /&gt;
          c-x zz (repeat the last command twice)&lt;br /&gt;
&lt;br /&gt;
          rectangle&lt;br /&gt;
          ---------&lt;br /&gt;
          C-SPC&lt;br /&gt;
          goto the next region&lt;br /&gt;
          C-x&lt;br /&gt;
          C-x&lt;br /&gt;
          then, C-x r r &amp;quot;name of register&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
          to insert the register&lt;br /&gt;
          C-x r i &amp;quot;name of register&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
          macros:&lt;br /&gt;
          -------&lt;br /&gt;
          c-x (    start macro&lt;br /&gt;
          c-x )    end macro&lt;br /&gt;
          c-x e    execute macro&lt;br /&gt;
        &lt;br /&gt;
          mail:&lt;br /&gt;
          -----&lt;br /&gt;
          c-x m   mail&lt;br /&gt;
          c-c c-s send&lt;br /&gt;
        &lt;br /&gt;
          C-x C-e&lt;br /&gt;
          (insert &amp;quot;\n\nExtra Line of text&amp;quot;)&lt;br /&gt;
        &lt;br /&gt;
          ;; chirico functions in .emacs&lt;br /&gt;
          ;; This creates an html template&lt;br /&gt;
          (defun my-html ()&lt;br /&gt;
          (interactive)&lt;br /&gt;
          (insert &amp;quot;&amp;lt;html&amp;gt;&lt;br /&gt;
          &amp;lt;head&amp;gt;&lt;br /&gt;
          &amp;lt;META HTTP-EQUIV=\&amp;quot;Pragma\&amp;quot; CONTENT=\&amp;quot;no-cache\&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;META HTTP-EQUIV=\&amp;quot;Expires\&amp;quot; CONTENT=\&amp;quot;-1\&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;/head&amp;gt;&lt;br /&gt;
          &amp;lt;body bgcolor=\&amp;quot;#ffffff\&amp;quot;&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
          &amp;lt;/body&amp;gt;&lt;br /&gt;
          &amp;lt;/html&amp;gt;&amp;quot;)&lt;br /&gt;
          )&lt;br /&gt;
&lt;br /&gt;
     Backspace issues when using &amp;quot;emacs -nw&amp;quot;? They putting the following in your &amp;quot;~/.emacs&amp;quot; file&lt;br /&gt;
&lt;br /&gt;
             (global-set-key &amp;quot;\C-d&amp;quot; 'backward-delete-char)&lt;br /&gt;
             (global-set-key &amp;quot;\C-h&amp;quot; 'backward-delete-char)&lt;br /&gt;
             (global-set-key (kbd &amp;quot;DEL&amp;quot;) 'delete-char)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 114:&lt;br /&gt;
&lt;br /&gt;
        ncftpget - an intelligent ftp client (http://www.ncftp.com/). Also&lt;br /&gt;
                   check your fedora or debian install. This package allows&lt;br /&gt;
                   you to easily download packages from ftp sites.&lt;br /&gt;
&lt;br /&gt;
          This is an example of connect to an ftp site, with a subdirectory, and&lt;br /&gt;
          downloading all in one command.&lt;br /&gt;
&lt;br /&gt;
           $ ncftpget ftp://ftp.gnu.org/pub/gnu/gcc/gcc-3.2.3/gcc-3.2.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
          Of if you want to get the fedora core 3 installs&lt;br /&gt;
&lt;br /&gt;
           $ ncftpget ftp://ftp.linux.ncsu.edu/pub/fedora/linux/core/3/i386/iso/FC3*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 115:&lt;br /&gt;
&lt;br /&gt;
        expr - evaluate expressions. You can use this on the command line&lt;br /&gt;
&lt;br /&gt;
           $ expr 6 + 4&lt;br /&gt;
           10&lt;br /&gt;
&lt;br /&gt;
         Note the spaces. Without spaces, you get the following:&lt;br /&gt;
&lt;br /&gt;
           $ expr 6+4&lt;br /&gt;
           6+4&lt;br /&gt;
&lt;br /&gt;
         If you're using &amp;quot;*&amp;quot;, you'll need a &amp;quot;\&amp;quot; before it&lt;br /&gt;
&lt;br /&gt;
           $ expr 10 \* 10&lt;br /&gt;
           100&lt;br /&gt;
&lt;br /&gt;
         This also works for variables&lt;br /&gt;
&lt;br /&gt;
           $ var1=34&lt;br /&gt;
           $ expr $var1 + 3&lt;br /&gt;
           37&lt;br /&gt;
&lt;br /&gt;
         or&lt;br /&gt;
&lt;br /&gt;
           $ var1=2&lt;br /&gt;
           $ var1=`expr $var1 \* 2`&lt;br /&gt;
           $ echo $var1&lt;br /&gt;
           4&lt;br /&gt;
&lt;br /&gt;
         see (TIP 25) you can get the cosine(.23)&lt;br /&gt;
&lt;br /&gt;
           $ var1=`echo &amp;quot;c(.23)&amp;quot;|bc -l`&lt;br /&gt;
           $ echo $var1&lt;br /&gt;
           .97366639500537483696&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         You can also do substrings:&lt;br /&gt;
&lt;br /&gt;
           $ expr substr &amp;quot;BigBear&amp;quot; 4 4&lt;br /&gt;
           Bear&lt;br /&gt;
&lt;br /&gt;
         And length of strings&lt;br /&gt;
&lt;br /&gt;
           $ mstr=&amp;quot;12345&amp;quot;&lt;br /&gt;
           $ expr length $mstr&lt;br /&gt;
           5&lt;br /&gt;
&lt;br /&gt;
         Regular expressions&lt;br /&gt;
&lt;br /&gt;
           $ expr &amp;quot;a3&amp;quot; : [a-z][1-9]&lt;br /&gt;
           2&lt;br /&gt;
&lt;br /&gt;
         Or you can get a bit fancy&lt;br /&gt;
&lt;br /&gt;
           $ myexpr=&amp;quot;[a-z][1-9]&amp;quot;&lt;br /&gt;
           $ echo $myexpr&lt;br /&gt;
           [a-z][1-9]&lt;br /&gt;
&lt;br /&gt;
           $ expr &amp;quot;a3&amp;quot; : $myexpr&lt;br /&gt;
           2&lt;br /&gt;
&lt;br /&gt;
         This may not be the best way to find out if it is Friday, but&lt;br /&gt;
         it seems to work. It's more of an exercise in xargs.&lt;br /&gt;
&lt;br /&gt;
           $ date&lt;br /&gt;
           Fri Dec 31 16:44:47 EST 2004&lt;br /&gt;
           $ date|xargs -i expr {} : &amp;quot;[Fri]&amp;quot;&lt;br /&gt;
           1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 116:&lt;br /&gt;
&lt;br /&gt;
        eval&lt;br /&gt;
&lt;br /&gt;
           $ mypipe=&amp;quot;|&amp;quot;&lt;br /&gt;
           $ eval ls $mypipe wc&lt;br /&gt;
           6       6     129&lt;br /&gt;
&lt;br /&gt;
        Did you catch that? The above statement is the same as&lt;br /&gt;
&lt;br /&gt;
           $ ls | wc&lt;br /&gt;
&lt;br /&gt;
        Where &amp;quot;|&amp;quot; is put into the variable $mypipe&lt;br /&gt;
&lt;br /&gt;
        (also see TIP 118)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 117:&lt;br /&gt;
&lt;br /&gt;
        lxr, glimpse, patchset - tools for reading the kernel source&lt;br /&gt;
&lt;br /&gt;
          This example puts some of the files in /home/src since my home&lt;br /&gt;
          partition is the largest. Plus, you do not want to over write&lt;br /&gt;
          the source in /usr/src/ If you want to put your files elsewhere&lt;br /&gt;
          just substitute /home/src for your desired directory.&lt;br /&gt;
&lt;br /&gt;
         patchset -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ export SRCDIR=/home/src&lt;br /&gt;
            $ cd $SRCDIR&lt;br /&gt;
            $ wget http://www.csn.ul.ie/~mel/projects/patchset/patchset-0.5.tar.gz&lt;br /&gt;
            $ export PATH=$PATH:$SRCDIR/patchset-0.5/bin&lt;br /&gt;
&lt;br /&gt;
          Now edit &amp;quot;/home/src/patchset-0.5/etc/patchset.conf&amp;quot; and set WWW_USER to&lt;br /&gt;
          whatever your website runs as&lt;br /&gt;
&lt;br /&gt;
                  export WWW_USER=nobody&lt;br /&gt;
&lt;br /&gt;
          Getting kernel source. The last step builds and asks a lot of questions. Enter&lt;br /&gt;
          yes to things that interest you, since this is what you will see in the source&lt;br /&gt;
          code. It is not going to build for booting. The &amp;quot;downlaod -p&amp;quot; is for downloading&lt;br /&gt;
          a patch.&lt;br /&gt;
&lt;br /&gt;
            $ download 2.6.10&lt;br /&gt;
            $ createset 2.6.10&lt;br /&gt;
            $ make-kernel -b 2.6.10&lt;br /&gt;
&lt;br /&gt;
        glimpse -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ mkdir -p /home/src/glimpse&lt;br /&gt;
            $ cd /home/src/glimpse&lt;br /&gt;
            $ wget http://webglimpse.net/trial/glimpse-latest.tar.gz&lt;br /&gt;
            $ tar -xzf glimpse-latest.tar.gz&lt;br /&gt;
            $ cd glimpse-4.18.0&lt;br /&gt;
            $ ./configure; make&lt;br /&gt;
            $ make install&lt;br /&gt;
&lt;br /&gt;
        lxr -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ make -p /home/src/lxr&lt;br /&gt;
            $ cd /home/src/lxr&lt;br /&gt;
            $ wget http://heanet.dl.sourceforge.net/sourceforge/lxr/lxr-0.3.1.tar.gz&lt;br /&gt;
            $ cd lxr-0.3&lt;br /&gt;
&lt;br /&gt;
          Edit &amp;quot;Makefile&amp;quot; and set PERLBIN to &amp;quot;/usr/bin/perl&amp;quot; or the where perl is&lt;br /&gt;
          on your system. Also set INSTALLPREFIX to &amp;quot;/var/www/lxr&amp;quot;.  Then, as root&lt;br /&gt;
          do the following:&lt;br /&gt;
&lt;br /&gt;
            $ make install&lt;br /&gt;
&lt;br /&gt;
         Apache changes&lt;br /&gt;
&lt;br /&gt;
          Next edit the apache httpd.conf. On my system it is&lt;br /&gt;
          &amp;quot;/usr/local/apache2/conf/httpd.conf&amp;quot;, but if you did a fedora install&lt;br /&gt;
          I think this file is located at &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             Alias  /lxr/ &amp;quot;/var/www/lxr/&amp;quot;&lt;br /&gt;
             &amp;lt;Directory &amp;quot;/var/www/lxr/&amp;quot;&amp;gt;&lt;br /&gt;
               Options ExecCGI Indexes Includes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride all&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
&lt;br /&gt;
              &amp;lt;Files ~ (search|source|ident|diff|find)&amp;gt;&lt;br /&gt;
                    SetHandler cgi-script&lt;br /&gt;
              &amp;lt;/Files&amp;gt;&lt;br /&gt;
             &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          lxr - continued &amp;quot;/var/www/lxr/http/lxr.conf&amp;quot; changes.  The following contains&lt;br /&gt;
                my lxr.conf with changes made to almost every variable. Make sure you use&lt;br /&gt;
                your website in place of 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
                 # Configuration file.&lt;br /&gt;
                &lt;br /&gt;
                 # Define typed variable &amp;quot;v&amp;quot;, read valueset from file.&lt;br /&gt;
                 variable: v, Version, [/var/www/lxr/source/versions], [/var/www/lxr/source/defversion]&lt;br /&gt;
                &lt;br /&gt;
                 # Define typed variable &amp;quot;a&amp;quot;.  First value is default.&lt;br /&gt;
                 variable: a, Architecture, (i386, alpha, m68k, mips, ppc, sparc, sparc64)&lt;br /&gt;
                &lt;br /&gt;
                 # Define the base url for the LXR files.&lt;br /&gt;
                 baseurl: http://192.168.1.71/lxr/http/&lt;br /&gt;
                &lt;br /&gt;
                 # These are the templates for the HTML heading, directory listing and&lt;br /&gt;
                 # footer, respectively.&lt;br /&gt;
                 htmlhead: /var/www/lxr/http/template-head&lt;br /&gt;
                 htmltail: /var/www/lxr/http/template-tail&lt;br /&gt;
                 htmldir:  /var/www/lxr/http/template-dir&lt;br /&gt;
                &lt;br /&gt;
                 # The source is here.&lt;br /&gt;
                 sourceroot: /var/www/lxr/source/$v/&lt;br /&gt;
                 srcrootname: Linux&lt;br /&gt;
                &lt;br /&gt;
                 # &amp;quot;#include &amp;lt;foo.h&amp;gt;&amp;quot; is mapped to this directory (in the LXR source&lt;br /&gt;
                 # tree)&lt;br /&gt;
                 incprefix: /include&lt;br /&gt;
                &lt;br /&gt;
                 # The database files go here.&lt;br /&gt;
                 dbdir: /var/www/lxr/source/$v/&lt;br /&gt;
                &lt;br /&gt;
                 # Glimpse can be found here.&lt;br /&gt;
                 glimpsebin: /usr/local/bin/glimpse&lt;br /&gt;
                &lt;br /&gt;
                 # The power of regexps.  This is pretty Linux-specific, but quite&lt;br /&gt;
                 # useful.  Tinker with it and see what it does.  (How's that for&lt;br /&gt;
                 # documentation?)&lt;br /&gt;
                 map: /include/asm[^\/]*/ /include/asm-$a/&lt;br /&gt;
                 map: /arch/[^\/]+/ /arch/$a/&lt;br /&gt;
&lt;br /&gt;
         Now you should be ready to run &amp;quot;make-lxr&amp;quot;. Make sure the path is setup to patchset,&lt;br /&gt;
         which is repeated here. The last step take awhile.&lt;br /&gt;
&lt;br /&gt;
            $ export SRCDIR=/home/src&lt;br /&gt;
            $ cd $SRCDIR&lt;br /&gt;
            $ export PATH=$PATH:$SRCDIR/patchset-0.5/bin&lt;br /&gt;
&lt;br /&gt;
            $  make-lxr 2.6.10&lt;br /&gt;
&lt;br /&gt;
         Now you need to index the source. Below the ./glimpse_* file will be put in&lt;br /&gt;
         root. Checkout the -H option if you do not want them here on a temporary&lt;br /&gt;
         bases of if you run out of room.&lt;br /&gt;
&lt;br /&gt;
            $ glimpseindex -o -t -w 5000 /var/www/lxr/source/2.6.10 &amp;gt;&amp;amp; .glimpse_out&lt;br /&gt;
&lt;br /&gt;
         Since the above put the files under /root/.glimpse_* they should be moved&lt;br /&gt;
&lt;br /&gt;
            $ mv /root/.glimps_* /var/www/lxr/source/2.6.10/.&lt;br /&gt;
            $ chown -R nobody.nobody ./.glimpse_*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 118:&lt;br /&gt;
&lt;br /&gt;
        exec - you can change standard output and input without starting a new&lt;br /&gt;
               process.&lt;br /&gt;
&lt;br /&gt;
          The exec redirect the output from ls and date to a file. Nothing&lt;br /&gt;
          is show on the terminal until &amp;quot;exec &amp;gt; /dev/tty&amp;quot; is performed&lt;br /&gt;
&lt;br /&gt;
            $ exec &amp;gt; mfile&lt;br /&gt;
            $ ls&lt;br /&gt;
            $ date&lt;br /&gt;
            $ exec &amp;gt; /dev/tty&lt;br /&gt;
&lt;br /&gt;
          This is an example of assigning file descriptor 3 to file &amp;quot;output3&amp;quot; for&lt;br /&gt;
          output, then, redirecting &amp;quot;ls&amp;quot; to this descriptor. Finally, file descriptor&lt;br /&gt;
          3 is used for input, and the contents are read into the cat command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
            $ exec 3&amp;gt;output3&lt;br /&gt;
            $ ls  &amp;gt;&amp;amp; 3&lt;br /&gt;
            $ exec 3&amp;lt;output3&lt;br /&gt;
            $ cat &amp;lt;&amp;amp;3&lt;br /&gt;
            ChangeLog&lt;br /&gt;
            CVS&lt;br /&gt;
            How_to_Linux_and_Open_Source.txt&lt;br /&gt;
            How_to_Linux_and_Open_Source.txt.~1.193.~&lt;br /&gt;
            mfile&lt;br /&gt;
            mfile2&lt;br /&gt;
            mfile3&lt;br /&gt;
            mftp&lt;br /&gt;
            output3&lt;br /&gt;
&lt;br /&gt;
        Could you redirect the output to 3 files and stderr?&lt;br /&gt;
&lt;br /&gt;
            $ exec 3&amp;gt;output3&lt;br /&gt;
            $ exec 4&amp;gt;output4&lt;br /&gt;
            $ exec 5&amp;gt;output5&lt;br /&gt;
&lt;br /&gt;
            $ ls &amp;gt;&amp;amp; 3 &amp;gt;&amp;amp; 4 &amp;gt;&amp;amp; 5 &amp;gt;&amp;amp; 2   // Nope, can't do this.&lt;br /&gt;
            output3  output4  output5&lt;br /&gt;
&lt;br /&gt;
         Instead, you should do the following:&lt;br /&gt;
&lt;br /&gt;
            $ ls | tee output3 | tee output4 |tee output5&lt;br /&gt;
&lt;br /&gt;
         Closing the &amp;quot;output&amp;quot; file descriptor&lt;br /&gt;
&lt;br /&gt;
            $ &amp;gt;&amp;amp;3-&lt;br /&gt;
&lt;br /&gt;
         Closing the &amp;quot;input&amp;quot; file descriptor&lt;br /&gt;
&lt;br /&gt;
            $ 3&amp;lt;&amp;amp;-&lt;br /&gt;
&lt;br /&gt;
         See what is still open on 0-10&lt;br /&gt;
&lt;br /&gt;
            $ lsof -a -p $$ -d 0-10&lt;br /&gt;
&lt;br /&gt;
         Recursion - the following counts to 5, then, quits.&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
            sleep 1&lt;br /&gt;
            declare -x n&lt;br /&gt;
            let n=${n:=0}+1&lt;br /&gt;
            [ $n -le 5 ] &amp;amp;&amp;amp; echo &amp;quot;$n&amp;quot; &amp;amp;&amp;amp;  exec $0&lt;br /&gt;
&lt;br /&gt;
         There are some real-life applications for this technique, as follows:&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
            declare -x N&lt;br /&gt;
            declare -x n&lt;br /&gt;
            N=${N:=$(od -vAn -N1 -tu4 &amp;lt; /dev/urandom)}&lt;br /&gt;
            let n=${n:=0}+1&lt;br /&gt;
            [ $(($n%2)) -eq 0 ] &amp;amp;&amp;amp; echo &amp;quot;She Loves Me!&amp;quot; || echo &amp;quot;She Loves Me NOT!&amp;quot;&lt;br /&gt;
            [ $n -lt $N ] &amp;amp;&amp;amp;  exec $0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 119:&lt;br /&gt;
&lt;br /&gt;
        runlevel - need to know the current runlevel?&lt;br /&gt;
&lt;br /&gt;
           $ who -r&lt;br /&gt;
           run-level 3  Dec 31 19:02                   last=S&lt;br /&gt;
&lt;br /&gt;
        Need to know the architecture?&lt;br /&gt;
&lt;br /&gt;
          $ arch&lt;br /&gt;
          i686&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 120:&lt;br /&gt;
&lt;br /&gt;
        at - executes commands at a specified time.&lt;br /&gt;
&lt;br /&gt;
         A few examples here. The 1970 program will run&lt;br /&gt;
         next Auguest 2 even though the year 1970 has long past.&lt;br /&gt;
&lt;br /&gt;
          $ at 6:30am Jan 12 &amp;lt; program&lt;br /&gt;
          $ at noon tomorrow &amp;lt; program&lt;br /&gt;
          $ at 1970 pm August 2 &amp;lt; program&lt;br /&gt;
&lt;br /&gt;
        This is an interactive way to use the command:&lt;br /&gt;
&lt;br /&gt;
          $ at now + 6 minutes&lt;br /&gt;
          warning: commands will be executed using (in order) a) $SHELL b) login shell c) /bin/sh&lt;br /&gt;
          at&amp;gt; ls&lt;br /&gt;
          at&amp;gt; date &amp;gt; /tmp/5min&lt;br /&gt;
          at&amp;gt; ^D&lt;br /&gt;
          job 3 at 2005-01-01 08:50&lt;br /&gt;
&lt;br /&gt;
        What jobs are in the queue?&lt;br /&gt;
&lt;br /&gt;
          $ atq&lt;br /&gt;
&lt;br /&gt;
        or&lt;br /&gt;
&lt;br /&gt;
          $ at -l&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 121:&lt;br /&gt;
&lt;br /&gt;
        Creating a Manpage&lt;br /&gt;
&lt;br /&gt;
         As root you can copy the following to /usr/local/man/man1/soup.1 which will&lt;br /&gt;
         give you a manpage for soup.&lt;br /&gt;
&lt;br /&gt;
              .\&amp;quot; Manpage for souptonuts.&lt;br /&gt;
              .\&amp;quot; Contact mchirico@users.sourceforge.com to correct errors or omissions.&lt;br /&gt;
              .TH man 1 &amp;quot;04 January 2005&amp;quot; &amp;quot;1.0&amp;quot; &amp;quot;souptonuts man page&amp;quot;&lt;br /&gt;
              .SH NAME&lt;br /&gt;
              soup \- man page for souptonuts&lt;br /&gt;
              .SH SYNOPSIS&lt;br /&gt;
              soup&lt;br /&gt;
              .SH DESCRIPTION&lt;br /&gt;
              souptonuts is a collection of linux and open&lt;br /&gt;
              source tips.&lt;br /&gt;
              off for golf.&lt;br /&gt;
              .SH OPTIONS&lt;br /&gt;
              The souptonuts does not take any options.&lt;br /&gt;
              .SH SEE ALSO&lt;br /&gt;
              doughnut(1), golf(8)&lt;br /&gt;
              .SH BUGS&lt;br /&gt;
              No known bugs at this time.&lt;br /&gt;
              .SH AUTHOR&lt;br /&gt;
              Mike Chirico (mchirico@comcast.net mchirico@users.sourceforge.net)&lt;br /&gt;
&lt;br /&gt;
         So, to view this man page&lt;br /&gt;
&lt;br /&gt;
            $ man soup&lt;br /&gt;
&lt;br /&gt;
         It's also possible to compress&lt;br /&gt;
&lt;br /&gt;
            $ gzip /usr/local/man/man1/soup.1&lt;br /&gt;
&lt;br /&gt;
         For plenty of examples look at the other man pages. Also the following&lt;br /&gt;
         is helpful. The last one is a tutorial &amp;quot;man 7 mdoc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            $ man manpath&lt;br /&gt;
            $ man groff&lt;br /&gt;
            $ man 7 mdoc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 122:&lt;br /&gt;
&lt;br /&gt;
        dmesg - print out boot messages, or what is in the kernel ring buffer.&lt;br /&gt;
&lt;br /&gt;
          If you missed the messages on boot-up, you can use dmesg to print them.&lt;br /&gt;
&lt;br /&gt;
            $ dmesg &amp;gt; boot.msg&lt;br /&gt;
&lt;br /&gt;
          Or to print, then, clear the ring&lt;br /&gt;
&lt;br /&gt;
            # dmesg -c &amp;gt; boot.msg&lt;br /&gt;
&lt;br /&gt;
          (also see TIP 20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 123:&lt;br /&gt;
&lt;br /&gt;
        gnus - emacs email nntp news reader (comcast as example with NO TLS or SSL)&lt;br /&gt;
&lt;br /&gt;
          First check that you can connect to the news group:&lt;br /&gt;
&lt;br /&gt;
                 $ telnet newsgroups.comcast.net 119&lt;br /&gt;
                 Trying 216.196.97.136...&lt;br /&gt;
                 Connected to newsgroups.comcast.net.&lt;br /&gt;
                 Escape character is '^]'.&lt;br /&gt;
                 200 News.GigaNews.Com&lt;br /&gt;
&lt;br /&gt;
          If you want to check for TLS or SSL see (TIP 54).&lt;br /&gt;
&lt;br /&gt;
          Here is a very simple configuration example without encryption. It&lt;br /&gt;
          appears that comcast does not support ssl or TLS.&lt;br /&gt;
&lt;br /&gt;
          In the &amp;quot;~/.emacs&amp;quot; file you would add the following to get comcast&lt;br /&gt;
          news groups&lt;br /&gt;
&lt;br /&gt;
             (setq gnus-select-method '(nntp &amp;quot;newsgroups.comcast.net&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
          Then, create an &amp;quot;~/.authinfo&amp;quot; file with the following settings using&lt;br /&gt;
          you own username and password.&lt;br /&gt;
&lt;br /&gt;
             machine newsgroups.comcast.net login borkey@comcast.net  password borkeypass0rd&lt;br /&gt;
&lt;br /&gt;
          Next create a &amp;quot;~/.newsrc&amp;quot; with your groups&lt;br /&gt;
&lt;br /&gt;
             news.announce.newusers:&lt;br /&gt;
             comp.lang.c++.moderated! 1-500&lt;br /&gt;
             comp.unix.programmer! 1-500&lt;br /&gt;
             comp.unix.shell! 1-500&lt;br /&gt;
             gnu.emacs.gnus! 1-500&lt;br /&gt;
&lt;br /&gt;
          Finally, create a &amp;quot;~/.gnus&amp;quot; with the following email settings for you&lt;br /&gt;
&lt;br /&gt;
             (setq user-mail-address &amp;quot;mchirico@comcast.net&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
             (defun my-message-mode-setup ()&lt;br /&gt;
               (setq fill-column 72)&lt;br /&gt;
               (turn-on-auto-fill))&lt;br /&gt;
               (add-hook 'message-mode-hook 'my-message-mode-setup)&lt;br /&gt;
&lt;br /&gt;
          To get into gnus&lt;br /&gt;
&lt;br /&gt;
              E-x gnus&lt;br /&gt;
&lt;br /&gt;
          The following are common gnus commands&lt;br /&gt;
&lt;br /&gt;
                RET  view the article under the cursor&lt;br /&gt;
&lt;br /&gt;
                A A (shift-a, shift a): List all newsgroups known&lt;br /&gt;
                                        to the server.&lt;br /&gt;
&lt;br /&gt;
                l (lower-case L)      : List only  subscribed groups&lt;br /&gt;
                                        with unread articles.&lt;br /&gt;
&lt;br /&gt;
                L                     : List all newsgroups in .newsrc file.&lt;br /&gt;
&lt;br /&gt;
                g                     : See if new articles have arrived.&lt;br /&gt;
&lt;br /&gt;
            Some commands for reading&lt;br /&gt;
&lt;br /&gt;
                n  next unread article&lt;br /&gt;
&lt;br /&gt;
                p  previous article&lt;br /&gt;
&lt;br /&gt;
                SPC  scroll down  moves to next unread&lt;br /&gt;
                     when at the bottom of the article&lt;br /&gt;
&lt;br /&gt;
                del  scroll up&lt;br /&gt;
&lt;br /&gt;
                F  follow-up to group on the article you are&lt;br /&gt;
                   reading now.&lt;br /&gt;
&lt;br /&gt;
                f  follow-up to group without citing the article&lt;br /&gt;
&lt;br /&gt;
                R  reply by mail and cite the article&lt;br /&gt;
&lt;br /&gt;
                r  reply by mail without citing the article&lt;br /&gt;
&lt;br /&gt;
                m  new mail&lt;br /&gt;
&lt;br /&gt;
                a  new posting&lt;br /&gt;
&lt;br /&gt;
                c  Catchup&lt;br /&gt;
&lt;br /&gt;
                C-u / t  Show only young headers&lt;br /&gt;
                         / t without C-u limits the summary&lt;br /&gt;
                         to old headers&lt;br /&gt;
&lt;br /&gt;
                T T  toggle threading&lt;br /&gt;
&lt;br /&gt;
                C-u g  Display raw article&lt;br /&gt;
                       hit g to return to normal view&lt;br /&gt;
&lt;br /&gt;
                t  Show all headers  it's a toggle&lt;br /&gt;
&lt;br /&gt;
                W w  Wordwrap the current article&lt;br /&gt;
&lt;br /&gt;
                W r  Decode ROT13  a toggle&lt;br /&gt;
&lt;br /&gt;
                ^  fetch parent of article&lt;br /&gt;
&lt;br /&gt;
                L  create a scorefile-entry based&lt;br /&gt;
                   on the current article (low score)&lt;br /&gt;
                   ? gives you information what each char means&lt;br /&gt;
&lt;br /&gt;
                I  like L but high score&lt;br /&gt;
&lt;br /&gt;
          Commands to send email&lt;br /&gt;
&lt;br /&gt;
            C-c C-c  send message&lt;br /&gt;
&lt;br /&gt;
            C-c C-d  save message as draft&lt;br /&gt;
&lt;br /&gt;
            C-c C-k  kill message&lt;br /&gt;
&lt;br /&gt;
            C-c C-m f  attach file&lt;br /&gt;
&lt;br /&gt;
            M-q  reformat paragraph&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 124:&lt;br /&gt;
&lt;br /&gt;
        Sending Email from telnet&lt;br /&gt;
&lt;br /&gt;
           Note, if you are on the computer you can sometime use the local loopback.&lt;br /&gt;
           In fact, sometimes you can only use the local loop back 127.0.0.1 in&lt;br /&gt;
           place of &amp;quot;bozo.company.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            1     [mchirico@soup Notes]$ telnet bozo.company.com 25&lt;br /&gt;
            2     Trying 192.168.0.204...&lt;br /&gt;
            3     Connected to bozo.company.com.&lt;br /&gt;
            4     Escape character is '^]'.&lt;br /&gt;
            5     220 bozo.company.com ESMTP Postfix (Postfix-20010228-pl03) (Mandrake Linux)&lt;br /&gt;
            6     HELO fakedomain.com&lt;br /&gt;
            7     HELO fakedomain.com         // server echo&lt;br /&gt;
            8     250 bozo.company.com&lt;br /&gt;
            9     MAIL FROM: test@fakedomain.com&lt;br /&gt;
           10     MAIL FROM: test@fakedomain.com   // server echo&lt;br /&gt;
           11     250 Ok&lt;br /&gt;
           12     RCPT TO: mchirico@someother.com&lt;br /&gt;
           13     RCPT TO: mchirico@someother.com   // server echo&lt;br /&gt;
           14     250 Ok&lt;br /&gt;
           15     DATA&lt;br /&gt;
           16     DATA    // echo&lt;br /&gt;
           17     354 Enter mail, end with &amp;quot;.&amp;quot; on a line by itself&lt;br /&gt;
           18     This is a test message&lt;br /&gt;
           19     This is a test message&lt;br /&gt;
           20     to send&lt;br /&gt;
           21     to send&lt;br /&gt;
           22     .&lt;br /&gt;
           23     250 2.0.0 j0B0uH3L018469 Message accepted for delivery&lt;br /&gt;
&lt;br /&gt;
          Above on line 6 you can type in any domain name. Line 7 is an echo. All&lt;br /&gt;
          echos are listed in the comment field.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 125:&lt;br /&gt;
&lt;br /&gt;
          IP forwarding, IP Masquerade&lt;br /&gt;
&lt;br /&gt;
             # echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
             # ipchains -F forward&lt;br /&gt;
             # ipchains -P forward DENY&lt;br /&gt;
             # ipchains -A forward -s 192.168.0.0/24 -j MASQ&lt;br /&gt;
             # ipchains -A forward -i eth1 -j MASQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          This assumes that your internal network is 192.168.0.0 on eth1, and the&lt;br /&gt;
          internet is connected to eth0.&lt;br /&gt;
&lt;br /&gt;
          (Also See TIP 182)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 126:&lt;br /&gt;
&lt;br /&gt;
         Setting KDE as the default desktop manager&lt;br /&gt;
&lt;br /&gt;
               Edit &amp;quot;/etc/sysconfig/desktop&amp;quot; to include the two lines:&lt;br /&gt;
&lt;br /&gt;
                 DESKTOP=&amp;quot;KDE&amp;quot;&lt;br /&gt;
                 DISPLAYMANAGER=&amp;quot;KDE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 127:&lt;br /&gt;
&lt;br /&gt;
        Have a file and you do not know whay type it is (tar, gz, ASCII, binary) ?&lt;br /&gt;
        Use the file command.  Below it is used on the file &amp;quot;mftp&amp;quot;&lt;br /&gt;
&lt;br /&gt;
               $ file mftp&lt;br /&gt;
               mftp: Bourne-Again shell script text executable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 128:&lt;br /&gt;
&lt;br /&gt;
        Software RAID: Two good references&lt;br /&gt;
&lt;br /&gt;
          http://www.tldp.org/HOWTO/Software-RAID-HOWTO-1.html&lt;br /&gt;
          http://lists.us.dell.com/pipermail/linux-poweredge/2003-July/014331.html&lt;br /&gt;
&lt;br /&gt;
        Note, you must setup grub for each RAID 1 device. Suppose you have&lt;br /&gt;
        2 SCSI drives (sda and sdb). By default grub is setup on sda; but, you&lt;br /&gt;
        need to enable it for sdb (/dev/hdb for ide) as follows:&lt;br /&gt;
&lt;br /&gt;
           grub&amp;gt;device (hd0) /dev/sdb&lt;br /&gt;
           grub&amp;gt;root (hd0,0)&lt;br /&gt;
           grub&amp;gt;setup (hd0)&lt;br /&gt;
&lt;br /&gt;
           Checking if &amp;quot;/boot/grub/stage1&amp;quot; exists... no&lt;br /&gt;
           Checking if &amp;quot;/grub/stage1&amp;quot; exists... yes&lt;br /&gt;
           Checking if &amp;quot;/grub/stage2&amp;quot; exists... yes&lt;br /&gt;
           Checking if &amp;quot;/grub/e2fs_stage1_5&amp;quot; exists.. yes&lt;br /&gt;
           Running &amp;quot;embed /grub/e2fs_stage1_5 (hd0)&amp;quot;... 16 sectors are embedded.&lt;br /&gt;
          succeeded&lt;br /&gt;
           Running &amp;quot;install /grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/grub/stage2 /grub/grub&lt;br /&gt;
         .conf&amp;quot;... succeeded.&lt;br /&gt;
         Done.&lt;br /&gt;
&lt;br /&gt;
          grub&amp;gt;&lt;br /&gt;
          grub&amp;gt;quit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Checking to see if everything is working:&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
        Checking the drives&lt;br /&gt;
&lt;br /&gt;
          $ sfdisk -d /dev/sdb&lt;br /&gt;
          $ sfdisk -d /dev/sda&lt;br /&gt;
&lt;br /&gt;
          $ fdisk -l /dev/sda  &amp;quot;This will give general information&amp;quot;&lt;br /&gt;
          $ fdisk -l           &amp;quot;General information for all drives&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Adding raid (assume you want to add the first drive &amp;quot;sda1&amp;quot;, or if it is the second&lt;br /&gt;
                    drive then substitute &amp;quot;sda2&amp;quot; below )&lt;br /&gt;
&lt;br /&gt;
          $ raidhotadd /dev/md0 /dev/sda1&lt;br /&gt;
          $ raidhotadd /dev/md1 /dev/sda2&lt;br /&gt;
          $ raidhotadd /dev/md2 /dev/sda3&lt;br /&gt;
&lt;br /&gt;
        This is an example of an cat /proc/mdstat that is working. Note that&lt;br /&gt;
        there is a listing for both sda1[0] and sdb1[1]&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
                Personalities : [raid1]&lt;br /&gt;
                read_ahead 1024 sectors&lt;br /&gt;
                Event: 12&lt;br /&gt;
                md0 : active raid1 sda1[0] sdb1[1]&lt;br /&gt;
                      104320 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md1 : active raid1 sda2[0] sdb2[1]&lt;br /&gt;
                      1044160 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md2 : active raid1 sda3[0] sdb3[1]&lt;br /&gt;
                      34411136 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        Compare that to this where md2 is missing sdb3&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
                Personalities : [raid1]&lt;br /&gt;
                read_ahead 1024 sectors&lt;br /&gt;
                Event: 9&lt;br /&gt;
                md0 : active raid1 sda1[0] sdb1[1]&lt;br /&gt;
                      104320 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md1 : active raid1 sda2[0] sdb2[1]&lt;br /&gt;
                      1044160 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md2 : active raid1 sdb3[1]        &amp;lt;---- HERE&lt;br /&gt;
                      34411136 blocks [2/1] [_U]&lt;br /&gt;
&lt;br /&gt;
                unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        If you are rebuilding an array, you can watch it by doing the following:&lt;br /&gt;
&lt;br /&gt;
           $ watch -n1 cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
        Need to know the raid setup?&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/raidtab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 129:&lt;br /&gt;
&lt;br /&gt;
        Resetting Redhat Linux Passwords using GRUB&lt;br /&gt;
&lt;br /&gt;
           1. Press 'e'&lt;br /&gt;
           2. Press 'e' again&lt;br /&gt;
           3. Append 'single' to the kernel version listing&lt;br /&gt;
&lt;br /&gt;
          See&lt;br /&gt;
             http://linuxgazette.net/107/tomar.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 130:&lt;br /&gt;
&lt;br /&gt;
        mtr - matt's traceroute. This is an advanced traceroute that keeps&lt;br /&gt;
              [http://www.bitwizard.nl/mtr/]&lt;br /&gt;
                  $ mtr www.yahoo.com&lt;br /&gt;
&lt;br /&gt;
                                              Matt's traceroute  [v0.52]&lt;br /&gt;
                     third-fl-71.localdomain                            Thu Jan 20 11:05:57 2005&lt;br /&gt;
                     Keys:  D - Display mode    R - Restart statistics    Q - Quit&lt;br /&gt;
                                                            Packets               Pings&lt;br /&gt;
                     Hostname                            %Loss  Rcv  Snt  Last Best  Avg  Worst&lt;br /&gt;
                      1. 192.168.1.1                        0%    3    3     0    0    0      1&lt;br /&gt;
                      2. ???&lt;br /&gt;
                      3. fe-2-6-rr01.willogrove5.pa.pa01    0%    3    3     8    7    7      8&lt;br /&gt;
                      4. srp-8-1-ar01.willowgrove1.pa.pa    0%    2    2     8    8    8      8&lt;br /&gt;
                      5. pos7-3-cr01.torresdale.pa.core.    0%    2    2     8    8    8      8&lt;br /&gt;
                      6. 12.119.53.53                       0%    2    2    12   12   12     13&lt;br /&gt;
                      7. tbr1-p012401.phlpa.ip.att.net      0%    2    2    12   12   13     13&lt;br /&gt;
                      8. tbr1-cl8.n54ny.ip.att.net          0%    2    2    13   13   13     13&lt;br /&gt;
                      9. ggr2-p310.n54ny.ip.att.net         0%    2    2    12   12   13     14&lt;br /&gt;
                     10. so-1-0-0.gar4.NewYork1.Level3.n    0%    2    2    14   14   37     61&lt;br /&gt;
                     11. ae-1-54.bbr2.NewYork1.Level3.ne    0%    2    2    13   12   13     13&lt;br /&gt;
                     12. ge-0-3-0.bbr2.Washington1.Level    0%    2    2    19   19   19     19&lt;br /&gt;
                     13. ge-1-1-51.car1.Washington1.Leve    0%    2    2    18   18   19     20&lt;br /&gt;
                     14. 4.79.228.6                         0%    2    2    21   19   20     21&lt;br /&gt;
                     15. UNKNOWN-216-109-120-201.yahoo.c    0%    2    2    21   20   20     21&lt;br /&gt;
                     16. w2.rc.vip.dcn.yahoo.com            0%    2    2    23   21   22     23&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 131:&lt;br /&gt;
&lt;br /&gt;
        chfn - change finger information&lt;br /&gt;
&lt;br /&gt;
            $ chfn&lt;br /&gt;
&lt;br /&gt;
          Next you are asked for a password and user information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 132:&lt;br /&gt;
&lt;br /&gt;
        chsh - change login shell&lt;br /&gt;
&lt;br /&gt;
          First, you may want to get a listing of all the possible&lt;br /&gt;
          shells.&lt;br /&gt;
&lt;br /&gt;
             $ chsh -l&lt;br /&gt;
&lt;br /&gt;
               /bin/sh&lt;br /&gt;
               /bin/bash&lt;br /&gt;
               /sbin/nologin&lt;br /&gt;
               /bin/ash&lt;br /&gt;
               /bin/bsh&lt;br /&gt;
               /bin/ksh&lt;br /&gt;
               /usr/bin/ksh&lt;br /&gt;
               /usr/bin/pdksh&lt;br /&gt;
               /bin/tcsh&lt;br /&gt;
               /bin/csh&lt;br /&gt;
               /bin/zsh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 133:&lt;br /&gt;
&lt;br /&gt;
        bash - working with binary, hex and base 3.&lt;br /&gt;
&lt;br /&gt;
         For the variable must be declare as an integer. Then&lt;br /&gt;
         specify the  &amp;lt;base&amp;gt;#&amp;lt;value&amp;gt;. The example below is 22 in&lt;br /&gt;
         base 3.&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n&lt;br /&gt;
              $ n=3#22&lt;br /&gt;
              $ echo $n&lt;br /&gt;
                8&lt;br /&gt;
&lt;br /&gt;
           Base 16 (hex)&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n2&lt;br /&gt;
              $ n2=16#a&lt;br /&gt;
              $ echo $n2&lt;br /&gt;
                10&lt;br /&gt;
&lt;br /&gt;
           Base 8 (octal)&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n3&lt;br /&gt;
              $ n3=8#11&lt;br /&gt;
              $ echo $n3&lt;br /&gt;
                9   Note 8+1=9&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 134:&lt;br /&gt;
&lt;br /&gt;
        monitoring IP traffic. Try iptraf http://iptraf.seul.org/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 135:&lt;br /&gt;
&lt;br /&gt;
        enscript - convert text files to PostScript&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 136:&lt;br /&gt;
&lt;br /&gt;
        dd and tar - blocking factor. How to determine the blocking factor, block size&lt;br /&gt;
                   so that tar and dd can work together.&lt;br /&gt;
&lt;br /&gt;
        Step 1: Create a large file on local disk, in a directory &amp;quot;1&amp;quot; that will eventually&lt;br /&gt;
                be written to tape. This will be created with dd as follows:&lt;br /&gt;
&lt;br /&gt;
                $ mkdir 1&lt;br /&gt;
                $ dd if=/dev/zero of=disk-image count=40960&lt;br /&gt;
                  40960+0 records in&lt;br /&gt;
                  40960+0 records out&lt;br /&gt;
&lt;br /&gt;
                $ cd ..&lt;br /&gt;
&lt;br /&gt;
        Step 2: tar the directory and contents to tape. First rewind the tape. These examples&lt;br /&gt;
                use /dev/nst0 as the location of the tape. Make sure to substitute your values&lt;br /&gt;
                if needed.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ tar --label=&amp;quot;Test 1&amp;quot; --create --blocking-factor=128 --file=/dev/nst0 1&lt;br /&gt;
&lt;br /&gt;
        Step 3: Read data from the tape using a block size of 128k. If you get an I/O error, which&lt;br /&gt;
                could happend if you used a different blocking factor above, then, you may need&lt;br /&gt;
                to increase the bs to 256, or 512 etc. as needed.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=/dev/nst0 bs=128k of=testblocksz count=1&lt;br /&gt;
                 0+1 records in&lt;br /&gt;
                 0+1 records out&lt;br /&gt;
&lt;br /&gt;
                $ ls -l testblocksz&lt;br /&gt;
                 -rw-r--r--    1 root     root        65536 Feb  9 10:41 testblocksz&lt;br /&gt;
&lt;br /&gt;
                $ ls -lh testblocksz&lt;br /&gt;
                 -rw-r--r--    1 root     root          64k Feb  9 10:41 testblocksz&lt;br /&gt;
&lt;br /&gt;
               Note above that the size 65536 is equal to 64k. That &amp;quot;h&amp;quot; switch in &amp;quot;ls&amp;quot; is for&lt;br /&gt;
               human readable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 4: tar uses a multiplier of 512*blocking-factor to get block size. Again&lt;br /&gt;
&lt;br /&gt;
                 512 * blocking-factor = block size used in dd command.&lt;br /&gt;
&lt;br /&gt;
              Putting in the values, we see that&lt;br /&gt;
&lt;br /&gt;
                 512 * 128 = 65536&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 5: So what does this tell you? You can now use these numbers to &amp;quot;dd&amp;quot; files&lt;br /&gt;
              to tape. But, first tar will be used to create the file locally.&lt;br /&gt;
&lt;br /&gt;
                $ tar --label=&amp;quot;Test 1&amp;quot; --create --blocking-factor=128 --file=test.tar 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 6: Send this to tape with the dd command. Remember 64k is equal to 65536.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=test.tar bs=64k of=/dev/nst0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 7: Now test that it can be read with tar command using blocking-factor=128.&lt;br /&gt;
             Note the &amp;quot;t&amp;quot; command in tar is for tell. It will not write data.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ tar -tvf /dev/nst0 --blocking-factor=128&lt;br /&gt;
                 V--------- 0/0               0 2005-02-09 10:38:20 Test 1--Volume Header--&lt;br /&gt;
                 drwxr-xr-x root/root         0 2005-02-09 10:34:10 1/&lt;br /&gt;
                 -rw-r--r-- root/root  20971520 2005-02-09 10:34:11 1/disk-image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 8: Reading tape data with dd. Most of the time a high &amp;quot;ibs&amp;quot; input block size&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=/dev/nst0 of=outfromdd.tar ibs=64k&lt;br /&gt;
                 321+0 records in&lt;br /&gt;
                 41088+0 records out&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 9: Verify that outfromdd.tar can be read by tar with blocking-factor=128&lt;br /&gt;
&lt;br /&gt;
                $ tar -tvf outfromdd.tar --blocking-factor=128&lt;br /&gt;
                 V--------- 0/0               0 2005-02-09 10:38:20 Test 1--Volume Header--&lt;br /&gt;
                 drwxr-xr-x root/root         0 2005-02-09 10:34:10 1/&lt;br /&gt;
                 -rw-r--r-- root/root  20971520 2005-02-09 10:34:11 1/disk-image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       PULLING FILES:  The dd command can be used to pull files.&lt;br /&gt;
&lt;br /&gt;
              ssh target_address dd if=remotefile | dd of=localfile&lt;br /&gt;
&lt;br /&gt;
           Or, a specific example of getting a file from a computer called hamlet.&lt;br /&gt;
&lt;br /&gt;
              $ ssh root@hamlet  dd if=/home/cvs/test | dd of=/home/storage/test&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        GOING BACKWARD AND FORWARD ON TAPE:&lt;br /&gt;
&lt;br /&gt;
             Go to end of data&lt;br /&gt;
              $ mt -f /dev/nst0  eod&lt;br /&gt;
&lt;br /&gt;
             Previous record&lt;br /&gt;
              $ mt -f /dev/nst0  bsfm 1&lt;br /&gt;
&lt;br /&gt;
             Forward record&lt;br /&gt;
              $ mt -f /dev/nst0  fsf 1&lt;br /&gt;
&lt;br /&gt;
             Rewind&lt;br /&gt;
              $ mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
             Tell&lt;br /&gt;
              $ mt -f /dev/nst0 tell&lt;br /&gt;
&lt;br /&gt;
         (Reference TIP 151 - for how to get around firewalls)&lt;br /&gt;
&lt;br /&gt;
         Below is a script that I use to backup computers via ssh. The&lt;br /&gt;
         tape drive is on &amp;quot;nis&amp;quot; and the extra space is on &amp;quot;hamlet&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                #!/bin/bash&lt;br /&gt;
                # Program to backup server remotely&lt;br /&gt;
                # Assume remote server is nis, you are on squeezel&lt;br /&gt;
                #&lt;br /&gt;
                # Recover from tape&lt;br /&gt;
                #&lt;br /&gt;
                #   dd if=/dev/nst0 of=test.tar.gz bs=64k&lt;br /&gt;
                #&lt;br /&gt;
                filename=&amp;quot;support1.$(date &amp;quot;+%m%d%y%H%M&amp;quot;).tar.gz&amp;quot;&lt;br /&gt;
                DIRTOBACKUP=/var/www&lt;br /&gt;
                #tar cvzf - $DIRTOBACKUP | ssh  root@nis  '(mt -f /dev/nst0 rewind; dd of=/dev/nst0 bs=64k )'&lt;br /&gt;
                tar cvzf - $DIRTOBACKUP | ssh  support1@hamlet &amp;quot;dd of=/home/support1/backups/${filename} &amp;quot;&lt;br /&gt;
&lt;br /&gt;
         Another example program, below, pushes the last &amp;quot;.tar.gz&amp;quot; file to tape:&lt;br /&gt;
&lt;br /&gt;
                #!/bin/bash&lt;br /&gt;
                # Program to push files to tape&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                # Notes on recovering from tape&lt;br /&gt;
                #&lt;br /&gt;
                #   dd if=/dev/nst0 of=test.tar.gz ibs=64k&lt;br /&gt;
                #    or&lt;br /&gt;
                #  $ ssh root@tapeserver &amp;quot;mt -f /dev/nst0 rewind&amp;quot;&lt;br /&gt;
                #  $ ssh root@tapeserver &amp;quot;dd if=/dev/nst0 ibs=64k&amp;quot;|dd of=cvs1.tar.gz&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                # First rewind tape&lt;br /&gt;
                ssh root@tapeserver 'mt -f /dev/nst0 rewind'&lt;br /&gt;
                #&lt;br /&gt;
                # Grab only the last file&lt;br /&gt;
                file=$(find /home/cvs  -iname 'cvs*.tar.gz'|sort|tail -n 1)&lt;br /&gt;
                dd if=${file}|ssh root@tapeserver 'dd of=/dev/nst0 bs=64k'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 137:&lt;br /&gt;
&lt;br /&gt;
        Apache - redirecting pages. All changes are in httpd.conf&lt;br /&gt;
&lt;br /&gt;
               RedirectMatch (.*)\.gif$ http://www.anotherserver.com$1.jpg&lt;br /&gt;
&lt;br /&gt;
               Redirect /service http://foo2.bar.com/service&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 138:&lt;br /&gt;
&lt;br /&gt;
        samba mounts via ssh - mounting a samba share through an ssh tunnel, going&lt;br /&gt;
               through an intermediate computer, that accepts ssh. We'll call this&lt;br /&gt;
               intermediate computer middle [65.219.4.23], and we want to get to&lt;br /&gt;
               destination [192.168.0.81]. The user will be mchirico.&lt;br /&gt;
&lt;br /&gt;
          STEP 1:&lt;br /&gt;
&lt;br /&gt;
               $ mkdir -p /samba/share&lt;br /&gt;
&lt;br /&gt;
          STEP 2:&lt;br /&gt;
&lt;br /&gt;
            This has to be done as root, since we are using a lower port.&lt;br /&gt;
&lt;br /&gt;
               $ ssh -N -L 139:192.168.0.81:139 mchirico@65.219.4.23&lt;br /&gt;
&lt;br /&gt;
          STEP 3:&lt;br /&gt;
&lt;br /&gt;
              umount /samba/sales&lt;br /&gt;
              /bin/mount -t smbfs -o  username=donkey,workgroup=donkeydomain,&lt;br /&gt;
                      password=passw0rk1,port=139,dmask=770,fmask=660,&lt;br /&gt;
                      netbiosname=homecpu //localhost/share /samba/share&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 139:&lt;br /&gt;
&lt;br /&gt;
        Music on Fedora Core -- How to play music on http://magnatune.com with &amp;quot;xmms&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           The following command will show the sound driver:&lt;br /&gt;
&lt;br /&gt;
              $ lspci|grep -i audio&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          STEP 1:&lt;br /&gt;
&lt;br /&gt;
                Unmute amixer with the following command:&lt;br /&gt;
&lt;br /&gt;
              $ amixer set Master 100% unmute&lt;br /&gt;
              $ amixer set PCM 100%  unmute&lt;br /&gt;
&lt;br /&gt;
                Note you can also get a graphical interface with &amp;quot;alsamixer&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              $ alsamixer&lt;br /&gt;
&lt;br /&gt;
                 h,F1   -- for help&lt;br /&gt;
                 Esc    -- exit&lt;br /&gt;
                 Tab    -- move to selections&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          STEP 2:&lt;br /&gt;
&lt;br /&gt;
                Test a sound file &amp;quot;*.au&amp;quot; with aplay. To quickly find files on your system use&lt;br /&gt;
                the &amp;quot;locate *.au&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
                  $ aplay /usr/lib/python2.3/test/audiotest.au&lt;br /&gt;
&lt;br /&gt;
          STEP 3:&lt;br /&gt;
&lt;br /&gt;
                Install &amp;quot;xmms-mp3-1.2.10-9.2.1.fc3.rf.i386.rpm&amp;quot; which does not come with Fedora because&lt;br /&gt;
                of GPL license restrictions.  The latest version of this package can be found&lt;br /&gt;
                at the following url:&lt;br /&gt;
&lt;br /&gt;
                  http://rpmseek.com/rpm-pl/xmms-mp3.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                  $ rpm -ivh xmms-mp3-1.2.10-9.2.1.fc3.rf.i386.rpm&lt;br /&gt;
&lt;br /&gt;
          STEP 4:&lt;br /&gt;
&lt;br /&gt;
                Go to magnatun &amp;quot;http://magnatune.com/&amp;quot;, select genre and make sure xmms&lt;br /&gt;
                is the default player.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 140:&lt;br /&gt;
&lt;br /&gt;
        Routing -- getting access to a network 1 hop away. You are currently on the 192 network&lt;br /&gt;
                   and you want access to the 172.21.0.0 network that has a computer straddling&lt;br /&gt;
                   the two, with /proc/sys/net/ipv4/ip_forward set to 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               $ route add -net 172.21.0.0 netmask 255.255.255.0 gw 192.168.0.204&lt;br /&gt;
&lt;br /&gt;
         To undo:&lt;br /&gt;
&lt;br /&gt;
               $ route del -net 172.21.0.0 netmask 255.255.255.0 gw 192.168.0.204&lt;br /&gt;
&lt;br /&gt;
         Now you can ping 172.21.0.21.&lt;br /&gt;
&lt;br /&gt;
         Does not work?&lt;br /&gt;
&lt;br /&gt;
         Go on to 192.168.0.204 and execute the following commands:&lt;br /&gt;
&lt;br /&gt;
               $ echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
               $ cat /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
               1&lt;br /&gt;
&lt;br /&gt;
         To Look at the the gateway, execute the following command.&lt;br /&gt;
&lt;br /&gt;
               $ netstat -r&lt;br /&gt;
&lt;br /&gt;
         References: &lt;br /&gt;
&lt;br /&gt;
               http://lartc.org/lartc.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 141:&lt;br /&gt;
&lt;br /&gt;
        RAM disk -- creating a filesystem in RAM.&lt;br /&gt;
&lt;br /&gt;
               $ mkfs -t ext3 -q /dev/ram1 4096&lt;br /&gt;
               $ mkdir -p /fsram&lt;br /&gt;
               $ mount /dev/ram1 /fsram -o defaults,rw&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 142:&lt;br /&gt;
&lt;br /&gt;
        Create a Live Linux CDROM  using  BusyBox and OpenSSH.&lt;br /&gt;
&lt;br /&gt;
            These steps are rather long. A complete tutorial is given at&lt;br /&gt;
            the following link:&lt;br /&gt;
             http://prdownloads.sourceforge.net/souptonuts/instructions_boot_system.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 143:&lt;br /&gt;
&lt;br /&gt;
      SystemImager (http://www.systemimager.org/) SystemImager is software that automates Linux installs,&lt;br /&gt;
                       software distribution, and production deployment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 144:&lt;br /&gt;
&lt;br /&gt;
      Mounted a filesystem in rescue mode, yet, you cannot read and write?  Remount.&lt;br /&gt;
&lt;br /&gt;
             $ mount -o remount /&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 145:&lt;br /&gt;
&lt;br /&gt;
      Nmap commands to check for Microsoft VPN connection.&lt;br /&gt;
&lt;br /&gt;
         $ nmap -sO -p 47 vpn1.someserver.com&lt;br /&gt;
         $ nmap -sS -p T:1723 vpn1.someserver.com&lt;br /&gt;
&lt;br /&gt;
      By the way, with nmap you can specify multiple ports. Below&lt;br /&gt;
      is an example of multiple ports; but, use the commands above&lt;br /&gt;
      for Microsoft VPN services.&lt;br /&gt;
&lt;br /&gt;
         $ nmap -sS -p T:1723-3000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 146:&lt;br /&gt;
&lt;br /&gt;
      Perl and ssh - monitoring systems. The output from ssh can be parsed. Below is&lt;br /&gt;
      a simple procedure to just to read the ssh ouput into perl.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #&lt;br /&gt;
          $pid = open $readme, &amp;quot;ssh root\@hamlet df -lh|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
          while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
           print $_&lt;br /&gt;
          }&lt;br /&gt;
          close $readme&lt;br /&gt;
&lt;br /&gt;
      But note, you probably want to do something more complex. Below is a more robust&lt;br /&gt;
      example that bypassed all the fortune, heading junk that you may encounter when&lt;br /&gt;
      logging in.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #&lt;br /&gt;
          $pid = open $readme, &amp;quot;ssh root\@hamlet df -lh 2&amp;gt;/dev/null|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
          while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
           print $_&lt;br /&gt;
          }&lt;br /&gt;
          close $readme&lt;br /&gt;
&lt;br /&gt;
      NO! you CANNOT do bidirectional communication with the open statement. Note the &amp;quot;|&amp;quot; before&lt;br /&gt;
      and after below, which cannot be done.&lt;br /&gt;
&lt;br /&gt;
          # Cannot do this!&lt;br /&gt;
          $pid = open $readme, &amp;quot;|ssh root\@hamlet df -lh 2&amp;gt;/dev/null|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
      Below is a simple Perl example working with arrays:&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          @ArrayOfArray = (&lt;br /&gt;
                   [ &amp;quot;ant&amp;quot;, &amp;quot;bee&amp;quot; ],&lt;br /&gt;
                   [ &amp;quot;mouse&amp;quot;, &amp;quot;mole&amp;quot;, &amp;quot;rat&amp;quot; ],&lt;br /&gt;
                   [ &amp;quot;duck&amp;quot;, &amp;quot;goose&amp;quot;, &amp;quot;flamingo&amp;quot; ],&lt;br /&gt;
                   [  &amp;quot;rose&amp;quot;,&amp;quot;carnation&amp;quot;,&amp;quot;sunflower&amp;quot;],&lt;br /&gt;
                  );&lt;br /&gt;
&lt;br /&gt;
          for $i ( 0 .. $#ArrayOfArray ) {&lt;br /&gt;
              for $j ( 0 .. $#{$ArrayOfArray[$i]} ) {&lt;br /&gt;
                  print &amp;quot;Element $i $j is $ArrayOfArray[$i][$j]\n&amp;quot;;&lt;br /&gt;
              }&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          # Or this is another way to list elements&lt;br /&gt;
          foreach( @ArrayOfArray ) {&lt;br /&gt;
             foreach $i (0..$#$_) {&lt;br /&gt;
                print &amp;quot;$_-&amp;gt;[$i] &amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
             print &amp;quot;\n&amp;quot;;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Below is an example of working with Hash of Arrays:&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #  ./program &amp;lt; /etc/passwd&lt;br /&gt;
          while(&amp;lt;&amp;gt;){&lt;br /&gt;
              next unless s/^(.*?):\s*//;&lt;br /&gt;
              $HoA{$1} = [ split(/:/) ];&lt;br /&gt;
          }&lt;br /&gt;
          for $i (keys %HoA ) {&lt;br /&gt;
              print &amp;quot;$i: @{ $HoA{$i} } \n&amp;quot;;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
      Example of regular expression. This is my most used regular expression - I like&lt;br /&gt;
      this sample. See the &amp;quot;www.unix.org.ua&amp;quot; link at the end of this tip.&lt;br /&gt;
&lt;br /&gt;
          &amp;quot;hot cross buns&amp;quot; =~ /cross/;&lt;br /&gt;
          print &amp;quot;Matched: &amp;lt;$`&amp;gt; $&amp;amp; &amp;lt;$'&amp;gt;\n&amp;quot;;    # Matched: &amp;lt;hot &amp;gt; cross &amp;lt; buns&amp;gt;&lt;br /&gt;
          print &amp;quot;Left:    &amp;lt;$`&amp;gt;\n&amp;quot;;            # Left:    &amp;lt;hot &amp;gt;&lt;br /&gt;
          print &amp;quot;Match:   &amp;lt;$&amp;amp;&amp;gt;\n&amp;quot;;            # Match:   &amp;lt;cross&amp;gt;&lt;br /&gt;
          print &amp;quot;Right:   &amp;lt;$'&amp;gt;\n&amp;quot;;            # Right:   &amp;lt; buns&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      If you're looking for Perl information, type &amp;quot;man perl&amp;quot;, which will show you how&lt;br /&gt;
      to get even more information. Or better yet, take a look at the following&lt;br /&gt;
      link:&lt;br /&gt;
&lt;br /&gt;
          http://www.unix.org.ua/orelly/perl/prog3/ch09_01.htm&lt;br /&gt;
               also&lt;br /&gt;
          http://www.stonehenge.com/merlyn/UnixReview/&lt;br /&gt;
&lt;br /&gt;
      For a quick example on using Perl with SQLite, see the following links:&lt;br /&gt;
&lt;br /&gt;
          http://prdownloads.sourceforge.net/souptonuts/README_sqlite_tutorial.html?download&lt;br /&gt;
            or&lt;br /&gt;
          http://freshmeat.net/articles/view/1428/&lt;br /&gt;
            or&lt;br /&gt;
          http://www.perl.com/pub/a/1999/09/refererents.html&lt;br /&gt;
&lt;br /&gt;
      Standard input for files. This example will read from stdin, or open a file if given as&lt;br /&gt;
      an argument, and convert all &amp;quot;&amp;lt;&amp;quot; to &amp;quot;&amp;amp;lt;&amp;quot; and &amp;quot;&amp;gt;&amp;quot; to &amp;quot;&amp;amp;gt;&amp;quot;, which can be handy when&lt;br /&gt;
      converting text files to html files. Note the &amp;quot;while(&amp;lt;&amp;gt;)&amp;quot; will take multiple file names&lt;br /&gt;
      on the command line.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          while(&amp;lt;&amp;gt;) {&lt;br /&gt;
             s/&amp;amp;amp;/&amp;amp;amp;amp;/g;&lt;br /&gt;
             s/&amp;amp;lt;/&amp;amp;amp;lt;/g;&lt;br /&gt;
             s/&amp;amp;gt;/&amp;amp;amp;gt;/g;&lt;br /&gt;
             s/&amp;lt;/&amp;amp;lt;/g;&lt;br /&gt;
             s/&amp;gt;/&amp;amp;gt;/g;&lt;br /&gt;
             print;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
      Perl Debugger is very useful for testing commands and works like an interpreter, just&lt;br /&gt;
      like python. So to get into the Perl Debugger execute the command below, &amp;quot;q&amp;quot; to quit.&lt;br /&gt;
&lt;br /&gt;
          $ perl -de 0&lt;br /&gt;
&lt;br /&gt;
      Reference TIP 170&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 147:&lt;br /&gt;
&lt;br /&gt;
      Shutdown&lt;br /&gt;
&lt;br /&gt;
          # shutdown 8:00 -- Shutdown at 8:00&lt;br /&gt;
&lt;br /&gt;
          # shutdown +13  -- Shutdown after 13min&lt;br /&gt;
&lt;br /&gt;
          # shutdown -r now  -- Shutdown now and restart&lt;br /&gt;
&lt;br /&gt;
          # shutdown -k +2  -- &amp;quot;The system is going DOWN to maintenance mode in 2 minutes!&amp;quot;&lt;br /&gt;
                              The above is only a warning.&lt;br /&gt;
&lt;br /&gt;
          # shutdown -h now   -- Shutdown now and halt&lt;br /&gt;
&lt;br /&gt;
          # shutdown -c    -- Cancel shutdown&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 148:&lt;br /&gt;
&lt;br /&gt;
      ac -  print statistics about users connect time&lt;br /&gt;
&lt;br /&gt;
          $ ac -p    -- print hour usage by user (individual)&lt;br /&gt;
          $ ac -dy   -- print daily usage&lt;br /&gt;
&lt;br /&gt;
       Options can also be combined&lt;br /&gt;
&lt;br /&gt;
          $ ac -dyp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 149:&lt;br /&gt;
&lt;br /&gt;
      Smart Monitoring Tools:&lt;br /&gt;
      Disk failing? Or want to know the temperature of your hard-drive?&lt;br /&gt;
&lt;br /&gt;
         http://smartmontools.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
      For a good, quick tutorial, see the Linux Journal article&lt;br /&gt;
        http://www.linuxjournal.com/article/6983&lt;br /&gt;
&lt;br /&gt;
      Below are some common commands:&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -i /dev/hda&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -Hc /dev/hda&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -A /dev/hda&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 150:&lt;br /&gt;
&lt;br /&gt;
      Monitor dhcp trafic - dhcpdump and tcpdump.&lt;br /&gt;
&lt;br /&gt;
      Download dhcpdump&lt;br /&gt;
&lt;br /&gt;
         $ wget  http://voxel.dl.sourceforge.net/sourceforge/mavetju/dhcpdump-1.5.tar.gz&lt;br /&gt;
         $ ./configure&lt;br /&gt;
         $ make &amp;amp;&amp;amp; make install&lt;br /&gt;
&lt;br /&gt;
     Once it's installed, you can monitor all dhcp traffic as follows, if done with root.&lt;br /&gt;
&lt;br /&gt;
         $ tcpdump -lenx -i eth0 -s 1500 port bootps or port bootpc| dhcpdump&lt;br /&gt;
&lt;br /&gt;
     The above assumes you are using eth0 (ethernet port 0).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 151:&lt;br /&gt;
&lt;br /&gt;
      Breaking Firewalls with ssh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      A sample .ssh/config file (note this must have chmod 600 rights)&lt;br /&gt;
&lt;br /&gt;
           ## Server1 ##&lt;br /&gt;
           Host 130.21.19.227&lt;br /&gt;
               LocalForward 20000 192.168.0.66:80&lt;br /&gt;
               LocalForward 22000 192.168.0.66:22&lt;br /&gt;
&lt;br /&gt;
      With the above &amp;quot;~/.ssh/config&amp;quot; file, after sshing into 130.21.19.227 it&lt;br /&gt;
      is then possible to ssh into nearby computers directly.&lt;br /&gt;
&lt;br /&gt;
         $ ssh -l mchirico 130.21.19.227&lt;br /&gt;
         $ scp -P 22000 authorized_keys* mchirico@localhost:.&lt;br /&gt;
         $ ssh -l mchirico localhost -p 22000&lt;br /&gt;
&lt;br /&gt;
      For the complete article reference the following link:&lt;br /&gt;
        http://souptonuts.sourceforge.net/sshtips.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 152:&lt;br /&gt;
&lt;br /&gt;
      Renaming files - suppose you want to rename all the &amp;quot;.htm&amp;quot; files to &amp;quot;.html&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          $ rename .htm .html *.htm&lt;br /&gt;
&lt;br /&gt;
      Or, suppose you files file1, file2, file3 ...&lt;br /&gt;
&lt;br /&gt;
          $ touch file1 file2 file3 file4 file5 file6&lt;br /&gt;
          $ rename file file. file*&lt;br /&gt;
&lt;br /&gt;
      The above command will give you &amp;quot;file.1&amp;quot;, &amp;quot;file.2&amp;quot; ... &amp;quot;file.6&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 153:&lt;br /&gt;
&lt;br /&gt;
      Renaming files with Perl - this is taken from &amp;quot;Programming Perl 3rd Edition&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          # rename - change filenames&lt;br /&gt;
          $op = shift;&lt;br /&gt;
          for (@ARGV) {&lt;br /&gt;
              $was = $_;&lt;br /&gt;
              eval $op;&lt;br /&gt;
              die if $@;&lt;br /&gt;
              # next line calls built-in function, not the script&lt;br /&gt;
              rename($was,$_) unless $was eq $_;&lt;br /&gt;
           }&lt;br /&gt;
&lt;br /&gt;
      The above Perl program can be used as follows:&lt;br /&gt;
&lt;br /&gt;
           $ rename 's/\.orig$//'    *.orig&lt;br /&gt;
           $ rename 'y/A-Z/a-z/ unless /^Make/' *&lt;br /&gt;
&lt;br /&gt;
      Also reference:&lt;br /&gt;
           http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 154:&lt;br /&gt;
&lt;br /&gt;
      R project (http://www.r-project.org)&lt;br /&gt;
&lt;br /&gt;
      To start R, just type &amp;quot;R&amp;quot; at the command prompt and &amp;quot;q()&amp;quot; to quit. Below&lt;br /&gt;
      2 is raised to powers 0 through 6 and thrown into an array.&lt;br /&gt;
&lt;br /&gt;
           $ R&lt;br /&gt;
           &amp;gt; N &amp;lt;- 2^(0:6)&lt;br /&gt;
           &amp;gt; N&lt;br /&gt;
           [1]  1  2  4  8 16 32 64&lt;br /&gt;
           &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      There is a summary summary() command.&lt;br /&gt;
&lt;br /&gt;
           &amp;gt; summary(N)&lt;br /&gt;
           Min. 1st Qu.  Median    Mean 3rd Qu.    Max.&lt;br /&gt;
           1.00    3.00    8.00   18.14   24.00   64.00&lt;br /&gt;
&lt;br /&gt;
      Note that the array begins as 1 and not 0&lt;br /&gt;
&lt;br /&gt;
           &amp;gt; N[1:3]&lt;br /&gt;
           [1] 1 2 4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 155:&lt;br /&gt;
&lt;br /&gt;
      ls - listing files by size, with the biggest file listed last&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           $ ls --sort=size -lhr&lt;br /&gt;
&lt;br /&gt;
      The above command sorts files by size, listing the contents in&lt;br /&gt;
      &amp;quot;h&amp;quot; human readable format in reverse order.&lt;br /&gt;
&lt;br /&gt;
      Note the options:  --sort={none,time,size,extension}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 156:&lt;br /&gt;
&lt;br /&gt;
     Perl - program to clean up old versions of files&lt;br /&gt;
&lt;br /&gt;
       #!/usr/bin/perl&lt;br /&gt;
       #   Copyright (c) GPL 2005 Mike Chirico&lt;br /&gt;
       # This program deletes old files from several directories&lt;br /&gt;
       # and within each directory there must be x number of copies&lt;br /&gt;
       # each y number of bytes&lt;br /&gt;
       #&lt;br /&gt;
&lt;br /&gt;
       sub delete_old_ones {&lt;br /&gt;
           $directory_and_file=$_[0];&lt;br /&gt;
           $save_count=$_[1];&lt;br /&gt;
           $bytes_in_file=$_[2];&lt;br /&gt;
         # Don't change setting here of '-lt'&lt;br /&gt;
           $pid = open $readme, &amp;quot;ls -lt $directory_and_file|&amp;quot; or die &amp;quot;Could not execute\n&amp;quot;;&lt;br /&gt;
           while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
               my @fields = split;&lt;br /&gt;
              # Make sure we have $save_count good ones with data&lt;br /&gt;
               if ($fields[4] &amp;gt; $bytes_in_file &amp;amp;&amp;amp; $save_count &amp;gt; 0) {&lt;br /&gt;
                   $save_count--;&lt;br /&gt;
                   print &amp;quot;Kept files: $fields[4] $fields[8]\n&amp;quot;;&lt;br /&gt;
               }&lt;br /&gt;
              # delete the old ones&lt;br /&gt;
              if ($save_count &amp;lt;= 0 )&lt;br /&gt;
              {&lt;br /&gt;
                  print &amp;quot;Deleted files: $fields[4] $fields[8]\n&amp;quot;;&lt;br /&gt;
                  unlink $fields[8];&lt;br /&gt;
              }&lt;br /&gt;
           }&lt;br /&gt;
           close $readme;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       @AofA = (&lt;br /&gt;
          [ &amp;quot;/home/cvs/backups/*.gz&amp;quot;, &amp;quot;6&amp;quot;,196621 ],&lt;br /&gt;
          [ &amp;quot;/home/mail/backups/*.gz&amp;quot;,&amp;quot;5&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/snort/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/server1/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/actserver/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/server2/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
                );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       foreach( @AofA ) {&lt;br /&gt;
           &amp;amp;delete_old_ones($_-&amp;gt;[0],$_-&amp;gt;[1],$_-&amp;gt;[2]);&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
     Reference TIP 170 and the following link:&lt;br /&gt;
       http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 157:&lt;br /&gt;
&lt;br /&gt;
     Graphics and Visualization Software that runs on Linux&lt;br /&gt;
        http://www.tldp.org/HOWTO/Scientific-Computing-with-GNU-Linux/graphvis.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 158:&lt;br /&gt;
&lt;br /&gt;
     Keeping files in sync going both ways. Unlike rsync, this is not a one way mirror&lt;br /&gt;
     option.&lt;br /&gt;
&lt;br /&gt;
     You will need ocaml installed first.&lt;br /&gt;
&lt;br /&gt;
       $ wget http://caml.inria.fr/pub/distrib/ocaml-3.08/ocaml-3.08.3.tar.gz&lt;br /&gt;
       $ tar -xzf ocaml-3.08.3.tar.gz&lt;br /&gt;
       $ cd ocaml-3.08.3&lt;br /&gt;
&lt;br /&gt;
       $ ./configure&lt;br /&gt;
       $ make world&lt;br /&gt;
       $ make opt&lt;br /&gt;
       $ make install&lt;br /&gt;
&lt;br /&gt;
     Next, get unison and put it in a different directory.&lt;br /&gt;
     [http://www.cis.upenn.edu/~bcpierce/unison/]&lt;br /&gt;
&lt;br /&gt;
       $ wget http://www.cis.upenn.edu/~bcpierce/unison/download/stable/latest/unison-2.10.2.tar.gz&lt;br /&gt;
       $ tar -xzf unison-2.10.2.tar.gz&lt;br /&gt;
       $ cd unison-2.10.2&lt;br /&gt;
       $ make UISTYLE=text&lt;br /&gt;
       $ su&lt;br /&gt;
       # cp unison /usr/local/bin/.&lt;br /&gt;
&lt;br /&gt;
     Note, you have to copy the file manually.&lt;br /&gt;
&lt;br /&gt;
     See the following article [http://www.linuxjournal.com/article/7712]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 159:&lt;br /&gt;
&lt;br /&gt;
     Dump ext2/ext3 filesystem information with &amp;quot;dumpe2fs&amp;quot;. Perform the mount command&lt;br /&gt;
     and query away.&lt;br /&gt;
&lt;br /&gt;
       $ dumpe2fs /dev/sda1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 160:&lt;br /&gt;
&lt;br /&gt;
     sysreport - a script that generates an HTML report on the system configuration. It&lt;br /&gt;
     gathers information about the hardware and is somewhat redhat specific. The utility&lt;br /&gt;
     should be run as root.&lt;br /&gt;
&lt;br /&gt;
       $ /usr/sbin/sysreport&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 161:&lt;br /&gt;
&lt;br /&gt;
     Key Bindings Using bind.  You can bind, say, ctl-t to a command.&lt;br /&gt;
&lt;br /&gt;
     Add the following to you &amp;quot;~/.inputrc&amp;quot; file, just as it is typed below with quotes.&lt;br /&gt;
&lt;br /&gt;
           &amp;quot;\C-t&amp;quot;: ls -l&lt;br /&gt;
&lt;br /&gt;
     Next, run the command&lt;br /&gt;
&lt;br /&gt;
           $ bind -f .inputrc&lt;br /&gt;
&lt;br /&gt;
     Or, you can do everything on the command line; however, it won't be there the next time&lt;br /&gt;
     you log in. Below is the way to do everything on the command line.&lt;br /&gt;
&lt;br /&gt;
           $ bind -x '&amp;quot;\C-t&amp;quot;:ls -l'&lt;br /&gt;
&lt;br /&gt;
     To unbind use the &amp;quot;-r&amp;quot; option. Single quotes are not needed.&lt;br /&gt;
&lt;br /&gt;
           $ bind -r &amp;quot;\C-t&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Getting a list of all bindings can be done as follows, and not this can be redirected&lt;br /&gt;
     to the &amp;quot;.inputrc&amp;quot; file for further editing.&lt;br /&gt;
&lt;br /&gt;
           $ bind -p &amp;gt; .inputrc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 162:&lt;br /&gt;
&lt;br /&gt;
     awk - common awk commands.&lt;br /&gt;
&lt;br /&gt;
     Find device names &amp;quot;sd&amp;quot; or with major number 4 and device name &amp;quot;tty&amp;quot;. Print the&lt;br /&gt;
     record number NR, plus the major number and minor number.&lt;br /&gt;
&lt;br /&gt;
          $ awk '$2 == &amp;quot;sd&amp;quot;||$1 == 4 &amp;amp;&amp;amp; $2 == &amp;quot;tty&amp;quot; { print NR,$1,$2}' /proc/devices&lt;br /&gt;
&lt;br /&gt;
     Find device name equal to &amp;quot;sound&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ awk '/sound/{print NR,$1,$2}' /proc/devices&lt;br /&gt;
&lt;br /&gt;
     Print the 5th record, first field, in file test&lt;br /&gt;
&lt;br /&gt;
          $ awk 'NR==5{print $1}' test&lt;br /&gt;
&lt;br /&gt;
     Print a record, skip 4 records, print a record etc from file1&lt;br /&gt;
&lt;br /&gt;
          $ awk '(NR-1) % 4 == 0 {print $1}' file1&lt;br /&gt;
&lt;br /&gt;
     Print all records except the last one from file1&lt;br /&gt;
&lt;br /&gt;
          $ tac file1|awk 'NR &amp;gt; 1 {print $0}'|tac&lt;br /&gt;
&lt;br /&gt;
     Print A,B,C ..Z on each line, cycling back to A if greater than 26 lines&lt;br /&gt;
&lt;br /&gt;
          $ awk '{ print substr(&amp;quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&amp;quot;,(NR-1)%26+1,1),$0}' file1&lt;br /&gt;
&lt;br /&gt;
     Number of bytes in a directory.&lt;br /&gt;
&lt;br /&gt;
          $ ls -l|awk 'BEGIN{ c=0}{ c+=$5} END{ print c}'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 163:&lt;br /&gt;
&lt;br /&gt;
     Configuring Remote Logging.  If you have several servers on 192.168.1.0, you can setup remote logging&lt;br /&gt;
     as follows.&lt;br /&gt;
&lt;br /&gt;
     MAIN LOG SERVER (192.168.1.81):&lt;br /&gt;
&lt;br /&gt;
        Firewall - allow UDP port 514 on the main server that will receive the logs.&lt;br /&gt;
&lt;br /&gt;
          $ iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 514 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        Edit &amp;quot;/etc/sysconfig/syslog&amp;quot; and add the &amp;quot;-r&amp;quot; option to SYSLOGD_OPTIONS as shown below.&lt;br /&gt;
&lt;br /&gt;
          SYSLOGD_OPTIONS=&amp;quot;-r -m -0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Note, the &amp;quot;-r&amp;quot; is to allow remote logging and  &amp;quot;-m 0&amp;quot; specifies that that the syslog process should&lt;br /&gt;
        not write regular timestamps.  I prefer to only write timestamps for the clients.&lt;br /&gt;
&lt;br /&gt;
        Next, restart the logging process&lt;br /&gt;
&lt;br /&gt;
          $ service syslog restart&lt;br /&gt;
&lt;br /&gt;
     CLIENT LOG SERVER:&lt;br /&gt;
&lt;br /&gt;
        Edit &amp;quot;/etc/syslog.conf&amp;quot; and add the ip address of the log server, or put in the hostname.&lt;br /&gt;
&lt;br /&gt;
            *.* @192.168.1.81&lt;br /&gt;
&lt;br /&gt;
        Next, restart the logging process&lt;br /&gt;
&lt;br /&gt;
          $ service syslog restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 164:&lt;br /&gt;
&lt;br /&gt;
     kudzu - hardware on your system. To probe the hardware on your system without doing&lt;br /&gt;
             anything, issue the following command.&lt;br /&gt;
&lt;br /&gt;
          $ kudzu -p&lt;br /&gt;
&lt;br /&gt;
      But wait, a lot of this information is already recorded in the following file&lt;br /&gt;
&lt;br /&gt;
            /etc/sysconfig/hwconf&lt;br /&gt;
&lt;br /&gt;
      You can also use lspci to list all PCI devices.&lt;br /&gt;
&lt;br /&gt;
          $ lspci&lt;br /&gt;
&lt;br /&gt;
      Also, take a look at the script /etc/sbin/sysreport, since this script has a lot of&lt;br /&gt;
      info gathering commands. You can pick and choose what you want, or run the complete&lt;br /&gt;
      report.&lt;br /&gt;
&lt;br /&gt;
      If you just want information on the NIC&lt;br /&gt;
&lt;br /&gt;
          $ ip link show eth0&lt;br /&gt;
          2: eth0: &amp;lt;BROADCAST,MULTICAST,UP&amp;gt; mtu 1500 qdisc pfifo_fast qlen 1000&lt;br /&gt;
          link/ether 00:11:11:8a:be:3f brd ff:ff:ff:ff:ff:ff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 165:&lt;br /&gt;
&lt;br /&gt;
     cfengine - a very power agent for monitoring and administrating both a single computer&lt;br /&gt;
              and or multiple computers. [ http://www.cfengine.org/ ]&lt;br /&gt;
&lt;br /&gt;
     The following is a quick example on downloading and installing cfengine.&lt;br /&gt;
&lt;br /&gt;
          $ ncftpget ftp://ftp.iu.hio.no/pub/cfengine/cfengine-2.1.15.tar.gz&lt;br /&gt;
          $ md5sum cfengine-2.1.15.tar.gz&lt;br /&gt;
          f03de82709f84c3d6d916b6e557321f9  cfengine-2.1.15.tar.gz&lt;br /&gt;
&lt;br /&gt;
          $ tar -xzf cfengine-2.1.15.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You need to have a current version of BerkeleyDB (http://downloads.sleepycat.com/db-4.3.28.tar.gz).&lt;br /&gt;
     Note that BerkeleyDB has a funny install. You cd to the &amp;quot;build_unix&amp;quot; directory, then,&lt;br /&gt;
&lt;br /&gt;
          Installing BerkeleyDB if needed:&lt;br /&gt;
                 $ wget http://downloads.sleepycat.com/db-4.3.28.tar.gz&lt;br /&gt;
                 $ tar -xzf db-4.3.28.tar.gz&lt;br /&gt;
                 $ cd db-4.3.28/build_unix/&lt;br /&gt;
                 $ ../dist/configure&lt;br /&gt;
                 make&lt;br /&gt;
                 make install&lt;br /&gt;
&lt;br /&gt;
     You also need a current version of OpenSSL. For instructions on how to install OpenSSL see&lt;br /&gt;
     (http://souptonuts.sourceforge.net/postfix_tutorial.html).&lt;br /&gt;
&lt;br /&gt;
     See (TIP 49) on putting &amp;quot;/usr/local/BerkeleyDB.4.3/lib&amp;quot; in the &amp;quot;/etc/ld.so.conf&amp;quot; file. Or&lt;br /&gt;
     once BerkeleyDB is installed, you can put the location on the command line as follows:&lt;br /&gt;
&lt;br /&gt;
     Configuring cfengine with direct reference to BerkeleyDB.4.3.  First cd to the cfengine source.&lt;br /&gt;
&lt;br /&gt;
          $ ./configure --with-berkeleydb=/usr/local/BerkeleyDB.4.3/lib&lt;br /&gt;
          $ make&lt;br /&gt;
          $ make install&lt;br /&gt;
&lt;br /&gt;
     Next create the following directories:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /var/cfengine/bin&lt;br /&gt;
          $ mkdir -p /var/cfengine/inputs&lt;br /&gt;
&lt;br /&gt;
     Copy needed files (cfagent, cfdoc, cfenvd, cfenvgraph, cfexecd, cfkey, cfrun, cfservd, cfshow):&lt;br /&gt;
&lt;br /&gt;
          $ cp /usr/local/sbin/cf* /var/cfengine/bin&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You'll also need to generate keys. As root, execute the following:&lt;br /&gt;
&lt;br /&gt;
          $ cfkey&lt;br /&gt;
&lt;br /&gt;
     The command above will write the public and private keys in&lt;br /&gt;
     &amp;quot;/var/cfengine/ppkeys&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You probably want (cfexecd, cfservd, and cfenvd) running on all servers. If you&lt;br /&gt;
     add the following to &amp;quot;/etc/rc.local&amp;quot; these daemons will start on reboot.&lt;br /&gt;
&lt;br /&gt;
           # Lines in /etc/rc.local&lt;br /&gt;
           /usr/local/sbin/cfexecd&lt;br /&gt;
           /usr/local/sbin/cfservd&lt;br /&gt;
           /usr/local/sbin/cfenvd&lt;br /&gt;
&lt;br /&gt;
     Also, make sure you run each command now as follows:&lt;br /&gt;
&lt;br /&gt;
          $ /usr/local/sbin/cfexecd&lt;br /&gt;
          $ /usr/local/sbin/cfservd&lt;br /&gt;
          $ /usr/local/sbin/cfenvd&lt;br /&gt;
&lt;br /&gt;
     Firewall settings must be adjusted to allows 5308 for tcp/udp. My local network&lt;br /&gt;
     is 192.168.1.0, so I'm opening it up for all my computers.&lt;br /&gt;
&lt;br /&gt;
          $ iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 5308 -j ACCEPT&lt;br /&gt;
          $ iptables -A INPUT -p tcp -s 192.168.1.0/24  --dport 5308 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
     A set of keys needs to be on the server and hosts. For example, my key on &amp;quot;tape.squeezel.com&amp;quot;&lt;br /&gt;
     should be copied over to the server &amp;quot;squeezel.squeezel.com&amp;quot; as follows:&lt;br /&gt;
&lt;br /&gt;
     This is done from tape.squeezel.com&lt;br /&gt;
&lt;br /&gt;
          $ scp /var/cfengine/ppkeys/localhost.pub  root@squeezel.squeezel.com:/var/cfengine/ppkeys/root-tape.squeezel.com.pub&lt;br /&gt;
          $ scp root@squeezel.squeezel.com:/var/cfengine/ppkeys/localhost.pub /var/cfengine/ppkeys/root-squeezel.squeezel.com.pub&lt;br /&gt;
&lt;br /&gt;
     Also, &amp;quot;/var/cfengine/inputs/cfrun.hosts&amp;quot; on the server &amp;quot;squeezel.squeezel.com&amp;quot; must contain&lt;br /&gt;
     all the computers that will get updated. This is &amp;quot;cfrun.hosts&amp;quot; on &amp;quot;squeezel.squeezel.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          closet.squeezel.com&lt;br /&gt;
          tape.squeezel.com&lt;br /&gt;
&lt;br /&gt;
     Once I'm done, from &amp;quot;tape.squeezel.com&amp;quot; I can run the following test:&lt;br /&gt;
&lt;br /&gt;
          $ cfrun squeezel.squeezel.com -v&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 166:&lt;br /&gt;
&lt;br /&gt;
     cfengine - a quick example. This example will be run as root. You create the file &amp;quot;cfagent.conf&amp;quot; in&lt;br /&gt;
     &amp;quot;/var/cfengine/inputs/&amp;quot;. The example below will checksum all the files in /home/chirico/deleteme/tripwire,&lt;br /&gt;
     it will also comment out the line &amp;quot;finger&amp;quot; in any file located in /tmp/testdir/stuff, also appending&lt;br /&gt;
     the command in this file &amp;quot; Edit change with cfengine&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          # /var/cfengine/inputs/cfagent.conf&lt;br /&gt;
          #&lt;br /&gt;
          # You run this with the following:&lt;br /&gt;
          #   cfagent -vK&lt;br /&gt;
        &lt;br /&gt;
          control:&lt;br /&gt;
                 actionsequence = ( files tidy editfiles )&lt;br /&gt;
                 ChecksumDatabase = ( /var/cfengine/cache.db )&lt;br /&gt;
                 # Below, true to update md5&lt;br /&gt;
                 ChecksumUpdates = ( true )&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
          files:&lt;br /&gt;
                 /home/chirico/deleteme/tripwire checksum=md5 recurse=inf&lt;br /&gt;
                 /home/chirico/deleteme/tripwire/moredata checksum=md5 recurse=inf&lt;br /&gt;
                 #/home/chirico/deleteme/tripwire/compress  recurse=inf include=*.txt acti on=compress&lt;br /&gt;
                   # If the database isn't secure, nothing is secure...&lt;br /&gt;
                 /var/cfengine/cache.db  mode=600 owner=root action=fixall&lt;br /&gt;
        &lt;br /&gt;
          tidy:&lt;br /&gt;
                 /home/chirico/deleteme/tripwire pattern=*~ recurse=inf age=0&lt;br /&gt;
                 # You must put an age. 0 runs now.&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
          editfiles:&lt;br /&gt;
        &lt;br /&gt;
                {  /tmp/testdir/stuff&lt;br /&gt;
&lt;br /&gt;
                   HashCommentLinesContaining &amp;quot;finger&amp;quot;&lt;br /&gt;
                   AppendIfNoSuchLine &amp;quot;# Edit Change with cfengine &amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     A few further notes on the above. The command &amp;quot;actionsequence = ( files tidy editfiles) tells the order&lt;br /&gt;
     of what to execute. The heading &amp;quot;tidy:&amp;quot; deletes files, and of course, &amp;quot;editfiles&amp;quot; does the editing of files.&lt;br /&gt;
&lt;br /&gt;
     To run the example, execute the following command. The  &amp;quot;-K&amp;quot; causes the lock file to be ignored.&lt;br /&gt;
&lt;br /&gt;
            $ cfagent -vK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 167:&lt;br /&gt;
&lt;br /&gt;
     Implementing Disk Quotas - a quick example that can easily be done on a live system for testing. There&lt;br /&gt;
     is no need to reboot, since you'll be creating a virtual filesystem.&lt;br /&gt;
&lt;br /&gt;
     Do the following as root. First create a mount point.&lt;br /&gt;
&lt;br /&gt;
            # mkdir -p /quota&lt;br /&gt;
&lt;br /&gt;
     Next, create 20M file. Since I have many of these files, I created a special directory &amp;quot;/usr/disk-img&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            # mkdir -p /usr/disk-img&lt;br /&gt;
            # dd if=/dev/zero of=/usr/disk-img/disk-quota.ext3 count=40960&lt;br /&gt;
&lt;br /&gt;
     The dd command above create a 20 MB file because, by default, dd uses a block size of 512 bytes. That makes&lt;br /&gt;
     the size: 40960*512=20971520.&lt;br /&gt;
&lt;br /&gt;
     Next, format this as an ext3 filesystem&lt;br /&gt;
&lt;br /&gt;
            # /sbin/mkfs -t ext3 -q /usr/disk-img/disk-quota.ext3 -F&lt;br /&gt;
&lt;br /&gt;
     Add the following line to &amp;quot;/etc/fstab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            /usr/disk-img/disk-quota.ext3    /quota ext3    rw,loop,usrquota,grpquota  0 0&lt;br /&gt;
&lt;br /&gt;
     Now, mount this filesystem&lt;br /&gt;
&lt;br /&gt;
            # mount /quota&lt;br /&gt;
&lt;br /&gt;
     Take a look at it:&lt;br /&gt;
&lt;br /&gt;
            # ls -l /quota&lt;br /&gt;
            lost+found&lt;br /&gt;
&lt;br /&gt;
     Now, run &amp;quot;quotacheck&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            # quotacheck -vug /quota&lt;br /&gt;
&lt;br /&gt;
     You'll get errors the first time this is run, because you have no quota files.&lt;br /&gt;
     But, run it a second time and you'll see something similiar to the following:&lt;br /&gt;
&lt;br /&gt;
            # quotacheck -vug /quota&lt;br /&gt;
            quotacheck: Scanning /dev/loop2 [/quota] done&lt;br /&gt;
            quotacheck: Checked 3 directories and 4 files&lt;br /&gt;
&lt;br /&gt;
     Now take a look at the files:&lt;br /&gt;
&lt;br /&gt;
            # ls -l /quota&lt;br /&gt;
            total 26&lt;br /&gt;
            -rw-------  1 root root  6144 Jun 14 12:23 aquota.group&lt;br /&gt;
            -rw-------  1 root root  6144 Jun 14 12:23 aquota.user&lt;br /&gt;
            drwx------  2 root root 12288 Jun 14 12:18 lost+found&lt;br /&gt;
&lt;br /&gt;
     Next use &amp;quot;edquota&amp;quot; to grant the user &amp;quot;chirico&amp;quot; a certain quota&lt;br /&gt;
&lt;br /&gt;
            # edquota -f /quota chirico&lt;br /&gt;
&lt;br /&gt;
     This will bring up a menu, and here I have edited so that user &amp;quot;chirico&amp;quot;&lt;br /&gt;
     has a soft limit of 120*512=61K, and a soft limit of 2 inodes and a hard limit of 5.&lt;br /&gt;
&lt;br /&gt;
             Disk quotas for user chirico (uid 500):&lt;br /&gt;
             Filesystem                   blocks       soft       hard     inodes     soft     hard&lt;br /&gt;
             /dev/loop2                        2        120        150         1        2         3&lt;br /&gt;
&lt;br /&gt;
     Next, turn quotas on with the following command:&lt;br /&gt;
&lt;br /&gt;
             $ quotaon /quota&lt;br /&gt;
&lt;br /&gt;
     If you need to turn off quotas, the command is &amp;quot;quotaoff -a&amp;quot; for all filesystems. You'll run into&lt;br /&gt;
     errors if you try to run quotacheck, say &amp;quot;quotacheck -avug&amp;quot; because this tries to unmount and mount&lt;br /&gt;
     the filesystem. You need to turn off quotas first &amp;quot;quotaoff /quota&amp;quot;. Note you only need to run&lt;br /&gt;
     quotacheck once, or when doing maintenance after a system crash.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      To get a report on the quote, runn &amp;quot;repquota&amp;quot; as follows:&lt;br /&gt;
&lt;br /&gt;
           $ repquota /quota&lt;br /&gt;
            *** Report for user quotas on device /dev/loop0&lt;br /&gt;
            Block grace time: 7days; Inode grace time: 7days&lt;br /&gt;
                                    Block limits                File limits&lt;br /&gt;
            User            used    soft    hard  grace    used  soft  hard  grace&lt;br /&gt;
            ----------------------------------------------------------------------&lt;br /&gt;
            root      --    1189       0       0              2     0     0&lt;br /&gt;
            chirico   -+      93       0       0              4     2     5  6days&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Note above that user &amp;quot;chirico&amp;quot; has used 4 on the file limits. This user has a hard&lt;br /&gt;
      limit of 5. So when this user tries to create 2 more files (bring this over the limit of 5)&lt;br /&gt;
      then he will get the following error as demonstrated below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           [chirico@squeezel chirico]$ touch one&lt;br /&gt;
           [chirico@squeezel chirico]$ touch two&lt;br /&gt;
           loop0: write failed, user file limit reached.&lt;br /&gt;
           touch: cannot touch `two': Disk quota exceeded&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Now, if repquota (run by root) is executed it shows the following:&lt;br /&gt;
&lt;br /&gt;
           $ repquota /quota&lt;br /&gt;
           *** Report for user quotas on device /dev/loop0&lt;br /&gt;
           Block grace time: 7days; Inode grace time: 7days&lt;br /&gt;
                                   Block limits                File limits&lt;br /&gt;
           User            used    soft    hard  grace    used  soft  hard  grace&lt;br /&gt;
           ----------------------------------------------------------------------&lt;br /&gt;
           root      --    1189       0       0              2     0     0&lt;br /&gt;
           chirico   -+      94       0       0              5     2     5  6days&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Note the &amp;quot;+&amp;quot; sign above. User &amp;quot;chirico&amp;quot; is above the File soft limits, and in this case&lt;br /&gt;
      above the hard limits.&lt;br /&gt;
&lt;br /&gt;
      To warn user by sending email to them, run &amp;quot;warnquota&amp;quot;, but you need check that&lt;br /&gt;
      &amp;quot;/etc/warnquota.conf&amp;quot; is setup correctly. For the example above, this file should&lt;br /&gt;
      look as follows:&lt;br /&gt;
&lt;br /&gt;
            $ cat /etc/quotatab&lt;br /&gt;
            #&lt;br /&gt;
            #  This is sample quotatab (/etc/quotatab)&lt;br /&gt;
            #  Here you can specify description of each device for user&lt;br /&gt;
            #&lt;br /&gt;
            #  Comments begin with hash in the beginning of the line&lt;br /&gt;
&lt;br /&gt;
            # Example of description&lt;br /&gt;
            /dev/loop0: This is loopback device&lt;br /&gt;
&lt;br /&gt;
      Just run the following as root:&lt;br /&gt;
&lt;br /&gt;
            $ warnquota&lt;br /&gt;
&lt;br /&gt;
      By the way, if you want to change the grace period, it can only be done on a filesystem&lt;br /&gt;
      basis. Not per user.&lt;br /&gt;
&lt;br /&gt;
            $  edquota -t&lt;br /&gt;
&lt;br /&gt;
      Users can run &amp;quot;quota&amp;quot; to see their usage as follows:&lt;br /&gt;
&lt;br /&gt;
            [chirico@squeezel ~]$ quota&lt;br /&gt;
            Disk quotas for user chirico (uid 500):&lt;br /&gt;
                 Filesystem  blocks   quota   limit   grace   files   quota   limit   grace&lt;br /&gt;
                 /dev/loop0      94       0       0               5      10      50&lt;br /&gt;
&lt;br /&gt;
      As you can see from above, I changed my inode limit to 50.&lt;br /&gt;
&lt;br /&gt;
      What about running this on the whole filesystem? Yes, below is an example where I'm running&lt;br /&gt;
      this on FC3, on the root of the filesystem &amp;quot;/&amp;quot;. This assumes that you have installed the&lt;br /&gt;
      quota package. Try doing &amp;quot;rpm -q quota&amp;quot; to see if this package is installed.&lt;br /&gt;
&lt;br /&gt;
        Step 1:&lt;br /&gt;
&lt;br /&gt;
           Check to make sure the quota software is installed. You can either do a &amp;quot;whereis quota&amp;quot;,&lt;br /&gt;
           or check for the rpm package.&lt;br /&gt;
&lt;br /&gt;
             $ whereis quota&lt;br /&gt;
             whereis quota&lt;br /&gt;
             quota: /usr/bin/quota /usr/share/man/man1/quota.1.gz&lt;br /&gt;
&lt;br /&gt;
           Checking for the rpm package.&lt;br /&gt;
&lt;br /&gt;
            $ rpm -q quota&lt;br /&gt;
            quota-3.12-5&lt;br /&gt;
&lt;br /&gt;
        Step 2:&lt;br /&gt;
&lt;br /&gt;
           Edit /etc/fstab and add usrquota and grpquota options for &amp;quot;/dev/VolGroup00/LogVol00&amp;quot;,&lt;br /&gt;
           which is shown on the first line below:&lt;br /&gt;
&lt;br /&gt;
             /dev/VolGroup00/LogVol00 /                      ext3    defaults,usrquota,grpquota        1 1&lt;br /&gt;
             LABEL=/boot             /boot                   ext3    defaults        1 2&lt;br /&gt;
             none                    /dev/pts                devpts  gid=5,mode=620  0 0&lt;br /&gt;
             none                    /dev/shm                tmpfs   defaults        0 0&lt;br /&gt;
             none                    /proc                   proc    defaults        0 0&lt;br /&gt;
             none                    /sys                    sysfs   defaults        0 0&lt;br /&gt;
             /dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0&lt;br /&gt;
&lt;br /&gt;
        Step 3:&lt;br /&gt;
&lt;br /&gt;
           Remount the filesystem as follows:&lt;br /&gt;
&lt;br /&gt;
             $ mount -o remount /&lt;br /&gt;
&lt;br /&gt;
        Step 4:&lt;br /&gt;
&lt;br /&gt;
           Run quotacheck with the &amp;quot;-m&amp;quot; option. Like the above statement, this will have to be run with&lt;br /&gt;
           root priviliges. This creates the quota database files, and it can take a long time if it is&lt;br /&gt;
           a large full filesystem.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             $ quotacheck -cugm /&lt;br /&gt;
&lt;br /&gt;
        Step 5:&lt;br /&gt;
&lt;br /&gt;
           This step is optional, but it's good to know if you need to recalculate quotas because of a&lt;br /&gt;
           system crash. It's demonstrated here, because at this point quota's have not been turned on.&lt;br /&gt;
           Again, note the &amp;quot;m&amp;quot; option below.&lt;br /&gt;
&lt;br /&gt;
             $ quotacheck -avumg&lt;br /&gt;
&lt;br /&gt;
        Step 6:&lt;br /&gt;
&lt;br /&gt;
           Set limits for specific users or groups using the &amp;quot;edquota&amp;quot; command. Shown below is the command&lt;br /&gt;
           to setup quotas for user &amp;quot;chirico&amp;quot;. Shown below this user has used 161560 blocks, he has a soft&lt;br /&gt;
           limit of 1161560 and a hard limit of 900000. He has used 3085 inodes and has a soft limit of 10000&lt;br /&gt;
           and a hard limit of 12000.&lt;br /&gt;
&lt;br /&gt;
             $ edquota -f / chirico&lt;br /&gt;
&lt;br /&gt;
             Disk quotas for user chirico (uid 500):&lt;br /&gt;
               Filesystem                   blocks       soft       hard     inodes     soft     hard&lt;br /&gt;
               /dev/mapper/VolGroup00-LogVol00     161560    1161560     900000       3085    10000    12000&lt;br /&gt;
&lt;br /&gt;
           You can put quotas on groups as well. The following is done as root. See (TIP 186 and TIP 6) for creating&lt;br /&gt;
           groups and adding users to groups.&lt;br /&gt;
&lt;br /&gt;
             $ edquota -g share&lt;br /&gt;
&lt;br /&gt;
           If you create a sharable directory for anyone in the group &amp;quot;share&amp;quot; (TIP 6), quota restrictions against&lt;br /&gt;
           group &amp;quot;share&amp;quot; will only apply to files added in the &amp;quot;/home/share&amp;quot; directory. When user &amp;quot;chirico&amp;quot; creates&lt;br /&gt;
           files in &amp;quot;/home/share&amp;quot; they also go against this user quota as well. However, when files are created in&lt;br /&gt;
           his home directory they do not go against the &amp;quot;share&amp;quot; group.&lt;br /&gt;
&lt;br /&gt;
           Note - if you get errors when trying to run &amp;quot;edquota -g share&amp;quot;, turn quotas off &amp;quot;quotaoff /&amp;quot; and&lt;br /&gt;
                  run &amp;quot;quotacheck -avugm&amp;quot;. Then, turn the quotas back on &amp;quot;quotaon /&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           You can see the status of the group quota with the following command:&lt;br /&gt;
&lt;br /&gt;
             $ quota -g share&lt;br /&gt;
&lt;br /&gt;
        Step 7:&lt;br /&gt;
&lt;br /&gt;
           Turn on quotas with the &amp;quot;qutoaon&amp;quot; command. This command needs to be done with root privileges.&lt;br /&gt;
&lt;br /&gt;
             $ quotaon /&lt;br /&gt;
&lt;br /&gt;
        Step 8:&lt;br /&gt;
&lt;br /&gt;
           Check &amp;quot;/etc/quotatab&amp;quot; file for the correct entries. Note that when you do the &amp;quot;mount&amp;quot; command&lt;br /&gt;
           the filesystem returned needs to match what is in the &amp;quot;quotatab&amp;quot; file. I have noticed that this&lt;br /&gt;
           is not the case by default.&lt;br /&gt;
&lt;br /&gt;
             $ mount&lt;br /&gt;
             /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw,usrquota,grpquota)&lt;br /&gt;
&lt;br /&gt;
           So the &amp;quot;/etc/quotatab&amp;quot; must contain the following line.&lt;br /&gt;
&lt;br /&gt;
             /dev/mapper/VolGroup00-LogVol00: This is the Volume group&lt;br /&gt;
&lt;br /&gt;
        Step 9:&lt;br /&gt;
&lt;br /&gt;
           Run &amp;quot;warnquota&amp;quot; as a check that the &amp;quot;/etc/quotatab&amp;quot; files is setup correctly.&lt;br /&gt;
&lt;br /&gt;
              $ warnquota&lt;br /&gt;
&lt;br /&gt;
        Step 10:&lt;br /&gt;
&lt;br /&gt;
           Setup a daily cron job for running &amp;quot;warnquota&amp;quot;. The following should be placed&lt;br /&gt;
           in &amp;quot;/etc/cron.daily&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              #!/bin/sh&lt;br /&gt;
              # Place this file in /etc/cron.daily&lt;br /&gt;
              # with rights 0755&lt;br /&gt;
              /usr/sbin/warnquota&lt;br /&gt;
              EXITVALUE=$?&lt;br /&gt;
              if [ $EXITVALUE != 0 ]; then&lt;br /&gt;
                 /usr/bin/logger -t warnquota &amp;quot;ALERT exited abnormally with [$EXITVALUE]&amp;quot;&lt;br /&gt;
              fi&lt;br /&gt;
              exit 0&lt;br /&gt;
&lt;br /&gt;
      References:&lt;br /&gt;
        http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/sysadmin-guide/ch-disk-quotas.html&lt;br /&gt;
        (TIP 6, TIP 186, and TIP 205)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 168:&lt;br /&gt;
&lt;br /&gt;
     rdist - remote file distribution client program. You can use this program in combination with&lt;br /&gt;
     ssh. This program does more than just copy files. Once a file has been copied, you can dictate&lt;br /&gt;
     other actions to be performed. Or you can hold off copying all together if the destination is&lt;br /&gt;
     running low on inodes, or disk space.&lt;br /&gt;
&lt;br /&gt;
     For the purpose of this example, all commands will been run on &amp;quot;squeezel.squeezel.com&amp;quot;, and the&lt;br /&gt;
     computers that will be updated are &amp;quot;tape.squeezel.com&amp;quot; and &amp;quot;closet.squeezel.com&amp;quot;. Obviously, you&lt;br /&gt;
     would substitute your computer names.&lt;br /&gt;
&lt;br /&gt;
     It helps to setup ssh keys on each computer first. Reference [http://souptonuts.sourceforge.net/sshtips.htm]&lt;br /&gt;
     and (TIP 12).&lt;br /&gt;
&lt;br /&gt;
     Step 1: Create the Configuration file myDistfile&lt;br /&gt;
&lt;br /&gt;
       Below is my sample &amp;quot;myDistfile&amp;quot;. This file will access hosts &amp;quot;tape.squeezel.com&amp;quot; using username chirico&lt;br /&gt;
       and &amp;quot;closet.squeezel.com&amp;quot; with the username running this command, and copy the&lt;br /&gt;
       files &amp;quot;/home/chirico/file1&amp;quot; and &amp;quot;/home/chirico/file2&amp;quot; to the these two servers creating the&lt;br /&gt;
       directory ~/tmpdir if it doesn't exist. Once these files are updated, a mail check (&amp;quot;sendmail -bv&amp;quot;)&lt;br /&gt;
       will be performed, and mail will be sent to &amp;quot;chirico@squeezel&amp;quot;. This happens twice, once for each file.&lt;br /&gt;
&lt;br /&gt;
       Note, the line &amp;quot;/home/chirico/file2 -&amp;gt; tape.squeezel.com&amp;quot; which moves the file &amp;quot;file2&amp;quot; to&lt;br /&gt;
       tape.squeezel.com renaming the file to &amp;quot;tapedest&amp;quot; in the directory &amp;quot;/home/chirico&amp;quot;. Once this file&lt;br /&gt;
       is copied, the rights are modified to &amp;quot;chmod +r&amp;quot;.  Likewise, &amp;quot;/home/chirico/file2 -&amp;gt; closet.squeezel.com&amp;quot;&lt;br /&gt;
       copies the file file2, which is renamed as closetdest.&lt;br /&gt;
&lt;br /&gt;
                 # Contents of myDistfile&lt;br /&gt;
                 HOSTS = ( chirico@tape.squeezel.com closet.squeezel.com )&lt;br /&gt;
&lt;br /&gt;
                 FILES = ( /home/chirico/file1 /home/chirico/file2 )&lt;br /&gt;
&lt;br /&gt;
                 ${FILES} -&amp;gt; ${HOSTS}&lt;br /&gt;
                    # Directory tmpdir will be created if it doesn't exist&lt;br /&gt;
                    install tmpdir ;&lt;br /&gt;
                    special /home/chirico/file1  &amp;quot;/usr/sbin/sendmail -bv mchirico@gmail.com&amp;quot;;&lt;br /&gt;
                    notify chirico@squeezel;&lt;br /&gt;
&lt;br /&gt;
                 /home/chirico/file2 -&amp;gt; tape.squeezel.com&lt;br /&gt;
                    install  /home/chirico/tapedest;&lt;br /&gt;
                    special  /home/chirico/tapedest &amp;quot;chmod +r /home/chirico/tapedest&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
                 /home/chirico/file2 -&amp;gt; closet.squeezel.com&lt;br /&gt;
                    install /home/chirico/closetdest;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 2: Command from squeezel.squeezel.com to run myDistfile above&lt;br /&gt;
&lt;br /&gt;
       Below is the command that will execute the contents in &amp;quot;myDistfile&amp;quot;. This command is run from the&lt;br /&gt;
       computer &amp;quot;squeezel.squeezel.com&amp;quot;. All output will go in the file &amp;quot;cmd1rdist.log&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ rdist -P /usr/local/bin/ssh -f ./myDistfile -l file=./cmd1rdist.log=all&lt;br /&gt;
&lt;br /&gt;
       Obviously you want a secure copy (using scp), so the -P option uses ssh as your secure&lt;br /&gt;
       transport mechanism.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 169:&lt;br /&gt;
&lt;br /&gt;
     Restricting root logins (/etc/securetty). ctl-alt-F4 will give you a prompt for tty3. Note&lt;br /&gt;
     that it is one number less. Take a look at the contents of &amp;quot;/etc/securetty&amp;quot;. To prevent&lt;br /&gt;
     root from logging in on this device, take out tty3 from this listing. Note, you can always&lt;br /&gt;
     login as another user, then, su to root.  Below is an example of the default&lt;br /&gt;
     &amp;quot;/etc/securetty&amp;quot; that allows root to login to everything.&lt;br /&gt;
&lt;br /&gt;
         [root@squeezel ~]# cat /etc/securetty&lt;br /&gt;
         console&lt;br /&gt;
         vc/1&lt;br /&gt;
         vc/2&lt;br /&gt;
         vc/3&lt;br /&gt;
         vc/4&lt;br /&gt;
         vc/5&lt;br /&gt;
         vc/6&lt;br /&gt;
         vc/7&lt;br /&gt;
         vc/8&lt;br /&gt;
         vc/9&lt;br /&gt;
         vc/10&lt;br /&gt;
         vc/11&lt;br /&gt;
         tty1&lt;br /&gt;
         tty2&lt;br /&gt;
         tty3&lt;br /&gt;
         tty4&lt;br /&gt;
         tty5&lt;br /&gt;
         tty6&lt;br /&gt;
         tty7&lt;br /&gt;
         tty8&lt;br /&gt;
         tty9&lt;br /&gt;
         tty10&lt;br /&gt;
         tty11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 170:&lt;br /&gt;
&lt;br /&gt;
     Perl map function. Try the following to get a quick take on this function,&lt;br /&gt;
     which increments each value in the array a;&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map {$_++} @a;&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot; } @a;&lt;br /&gt;
&lt;br /&gt;
     or&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     And you can easily make modifications, like reversing the order&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     Plus there is a grep() function that works on each element as well&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse grep{ $_ &amp;gt; 3} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     To get only odd numbers in reverse order:&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse grep{ !($_ % 2)} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference: http://www-128.ibm.com/developerworks/linux/library/l-road4.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 171:&lt;br /&gt;
&lt;br /&gt;
     Perl - subroutine call and shifting through variables. A simple and useful&lt;br /&gt;
     technique.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          sub test {&lt;br /&gt;
            local $mval;&lt;br /&gt;
            while( $mval = shift ) {&lt;br /&gt;
              print &amp;quot; $mval\n&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          test(&amp;quot;one&amp;quot;,&amp;quot;two&amp;quot;,&amp;quot;three&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 172:&lt;br /&gt;
&lt;br /&gt;
     Tcp wrappers - First &amp;quot;/etc/hosts.allow&amp;quot; is check, and if there is an entry in this file, no more&lt;br /&gt;
     checking it done.  If are no matches in &amp;quot;/etc/hosts.allow&amp;quot;, the &amp;quot;/etc/hosts.deny&amp;quot; file is checked&lt;br /&gt;
     and if a match is found, that service is blocked for that host.&lt;br /&gt;
&lt;br /&gt;
     Example &amp;quot;/etc/hosts.deny&amp;quot; file:&lt;br /&gt;
&lt;br /&gt;
         sshd: 192.168.1.171&lt;br /&gt;
&lt;br /&gt;
     The above file blocks access to computer 192.168.1.171. It's also possible to run commands when&lt;br /&gt;
     someone from this computer tries to ssh in. This example sends mail.&lt;br /&gt;
&lt;br /&gt;
         sshd: 192.168.1.171: spawn (echo -e &amp;quot;%d %h %H %u&amp;quot;| /bin/mail -s 'hosts.deny entry' root)&lt;br /&gt;
&lt;br /&gt;
     Of course, you can also run commands in the &amp;quot;/etc/hosts.allow&amp;quot; if you wanted mail sent for a successful&lt;br /&gt;
     login.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 173:&lt;br /&gt;
&lt;br /&gt;
     pgrep, pkill - look up or signal process based on name and other attributes.&lt;br /&gt;
&lt;br /&gt;
     To quick find all instances of ssh running, for user root, execute the following&lt;br /&gt;
     command:&lt;br /&gt;
&lt;br /&gt;
           $ pgrep -u root -l ssh&lt;br /&gt;
&lt;br /&gt;
     To kill a process, or send a signal use the &amp;quot;pkill&amp;quot; option. For example, to&lt;br /&gt;
     make syslog reread its configuration file:&lt;br /&gt;
&lt;br /&gt;
           $ pkill -HUP syslogd&lt;br /&gt;
&lt;br /&gt;
     Another command command is &amp;quot;pidof&amp;quot; that can tell you how many processes are running.&lt;br /&gt;
     This can be useful for detecting DOS attacks.&lt;br /&gt;
&lt;br /&gt;
           $ pidof sshd&lt;br /&gt;
           4783 4781 30008 30006 29888 29886 2246&lt;br /&gt;
&lt;br /&gt;
     Above there are 7 sshd's running. Reference &amp;quot;Tcpdump, Raw Socket and Libpap Tutorial&amp;quot;&lt;br /&gt;
     at [http://souptonuts.sourceforge.net/tcpdump_tutorial.html].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 174:&lt;br /&gt;
&lt;br /&gt;
     Password Cracking - tools to check your users passwords:&lt;br /&gt;
&lt;br /&gt;
      John The Ripper&lt;br /&gt;
        http://www.openwall.com/john/&lt;br /&gt;
&lt;br /&gt;
      Crack&lt;br /&gt;
        http://www.crypticide.com/users/alecm/&lt;br /&gt;
&lt;br /&gt;
      Slurpie&lt;br /&gt;
        http://www.ussrback.com/distributed.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 175:&lt;br /&gt;
&lt;br /&gt;
     Password Aging - setting the number of days a password is valid.&lt;br /&gt;
&lt;br /&gt;
         $ chage -M 90 &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 176:&lt;br /&gt;
&lt;br /&gt;
     Kernel Performance Tuning - /Documentation/sysctl/vm.txt documents kernel settings to&lt;br /&gt;
     improve performance. Below are some examples.&lt;br /&gt;
&lt;br /&gt;
       overcommit_memory:  0 -- default estimates the amount of memory for malloc&lt;br /&gt;
                           1 -- kernel pretends there is always enough memory until it runs out&lt;br /&gt;
                           3 -- never overcommit&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/overcommit_memory&lt;br /&gt;
          0&lt;br /&gt;
&lt;br /&gt;
       page-cluster:&lt;br /&gt;
            The Linux VM subsystem avoids excessive disk seeks by reading&lt;br /&gt;
            multiple pages on a page fault. The number of pages it reads&lt;br /&gt;
            is dependent on the amount of memory in your machine.&lt;br /&gt;
        &lt;br /&gt;
            The number of pages the kernel reads in at once is equal to&lt;br /&gt;
            2 ^ page-cluster. Values above 2 ^ 5 don't make much sense&lt;br /&gt;
            for swap because we only cluster swap data in 32-page groups.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/page-cluster&lt;br /&gt;
          3&lt;br /&gt;
&lt;br /&gt;
       min_free_kbytes:&lt;br /&gt;
            This is used to force the Linux VM to keep a minimum number&lt;br /&gt;
            of kilobytes free.  The VM uses this number to compute a pages_min&lt;br /&gt;
            value for each lowmem zone in the system.  Each lowmem zone gets&lt;br /&gt;
            a number of reserved free pages based proportionally on its size.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/min_free_kbytes&lt;br /&gt;
          3831&lt;br /&gt;
&lt;br /&gt;
       max_map_count:&lt;br /&gt;
            This file contains the maximum number of memory map areas a process&lt;br /&gt;
            may have. Memory map areas are used as a side-effect of calling&lt;br /&gt;
            malloc, directly by mmap and mprotect, and also when loading shared&lt;br /&gt;
            libraries.&lt;br /&gt;
&lt;br /&gt;
            While most applications need less than a thousand maps, certain&lt;br /&gt;
            programs, particularly malloc debuggers, may consume lots of them,&lt;br /&gt;
            e.g., up to one or two maps per allocation.&lt;br /&gt;
&lt;br /&gt;
            The default value is 65536.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/max_map_count&lt;br /&gt;
          65536&lt;br /&gt;
&lt;br /&gt;
        Also see http://people.redhat.com/alikins/system_tuning.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 177:&lt;br /&gt;
&lt;br /&gt;
     IO Scheduler - /Documentation/block/as-iosched.txt documents kernel settings for disk&lt;br /&gt;
     performance.&lt;br /&gt;
&lt;br /&gt;
     If you're not sure what partitions you have &amp;quot;$ cat /proc/partitions&amp;quot;. This example&lt;br /&gt;
     assumes hda, and you can see some of the kernel settings:&lt;br /&gt;
&lt;br /&gt;
          $ ls /sys/block/hda/queue/iosched&lt;br /&gt;
          back_seek_max  back_seek_penalty  clear_elapsed  fifo_batch_expire  fifo_expire_async&lt;br /&gt;
           fifo_expire_sync  find_best_crq  key_type  quantum  queued&lt;br /&gt;
&lt;br /&gt;
     References: http://lwn.net/Articles/102505/&lt;br /&gt;
                 http://bhhdoa.org.au/pipermail/ck/2004-September/000961.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 178:&lt;br /&gt;
&lt;br /&gt;
     iozone -- getting data on disk performance (http://www.iozone.org/). This is a very&lt;br /&gt;
     comprehensive package.&lt;br /&gt;
&lt;br /&gt;
           $ wget http://www.iozone.org/src/current/iozone3_242.tar&lt;br /&gt;
           $ tar -xf iozone3_242.tar&lt;br /&gt;
           $ cd iozone3_242/src/current&lt;br /&gt;
           $ make linux&lt;br /&gt;
&lt;br /&gt;
     At this point you should read the documentation. There is no &amp;quot;make install&amp;quot;. You&lt;br /&gt;
     copy it to each filesystem you want to run this program on. Below are some quick&lt;br /&gt;
     start commands.&lt;br /&gt;
&lt;br /&gt;
       Good comprehensive test.&lt;br /&gt;
&lt;br /&gt;
           $ iozone -a&lt;br /&gt;
&lt;br /&gt;
       I prefer this for small filesystems. It limits the record size to 10000 and does&lt;br /&gt;
       the output in operations per second (higher numbers mean faster drive).&lt;br /&gt;
&lt;br /&gt;
           $ ./iozone -a -s 10000 -O&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 179:&lt;br /&gt;
&lt;br /&gt;
     history - bash command to get a history of all commands typed. But, here is a way&lt;br /&gt;
     that you can get date and time listed as well.&lt;br /&gt;
&lt;br /&gt;
           $ HISTTIMEFORMAT=&amp;quot;%y/%m/%d %T &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Defining the environment variable above give you the date/time info when you&lt;br /&gt;
     execute history:&lt;br /&gt;
&lt;br /&gt;
           $ history&lt;br /&gt;
              ...&lt;br /&gt;
               175  05/06/30 12:51:46 grep '141.162.' mout &amp;gt; mout2&lt;br /&gt;
               176  05/06/30 12:51:48 e mout2&lt;br /&gt;
               177  05/06/30 12:56:59 ls&lt;br /&gt;
               178  05/06/30 12:57:02 ls&lt;br /&gt;
               179  05/06/30 12:57:39 ls&lt;br /&gt;
               180  05/06/30 12:57:49 ls -l&lt;br /&gt;
               181  05/06/30 13:01:10 history&lt;br /&gt;
               182  05/06/30 13:01:20 HISTTIMEFORMAT=&amp;quot;%y/%m/%d %T &amp;quot;&lt;br /&gt;
               183  05/06/30 13:01:23 history&lt;br /&gt;
              ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 180:&lt;br /&gt;
&lt;br /&gt;
     .config - Fedora Core getting the .config to rebuild the kernel. You can find&lt;br /&gt;
     this file, the &amp;quot;.config&amp;quot; file at the following location:&lt;br /&gt;
&lt;br /&gt;
          $ ls &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Or, to see the contents&lt;br /&gt;
&lt;br /&gt;
          $ cat &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     This can be important, if you're planning to build your own kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 181:&lt;br /&gt;
&lt;br /&gt;
     Listing control key settings.&lt;br /&gt;
&lt;br /&gt;
          $ stty -a&lt;br /&gt;
          speed 38400 baud; rows 0; columns 0; line = 0;&lt;br /&gt;
          intr = ^C; quit = ^\; erase = &amp;lt;undef&amp;gt;; kill = &amp;lt;undef&amp;gt;; eof = ^D; eol = &amp;lt;undef&amp;gt;; eol2 = &amp;lt;undef&amp;gt;; start = ^Q;&lt;br /&gt;
          stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;&lt;br /&gt;
          -parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts&lt;br /&gt;
          -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel&lt;br /&gt;
          opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0&lt;br /&gt;
          isig icanon iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 182:&lt;br /&gt;
&lt;br /&gt;
     iptables DNAT and SNAT. You have a webserver on 192.168.1.71. When people query this webserver, you want them&lt;br /&gt;
     to goto 192.168.1.81, with no indication that they are going to another web server. In fact, they always make&lt;br /&gt;
     their web hits to 192.168.1.71.&lt;br /&gt;
&lt;br /&gt;
     The following is the iptables commands:&lt;br /&gt;
&lt;br /&gt;
        $ echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
        $ iptables -t nat -A PREROUTING -d 192.168.1.71 -p tcp --dport 80 -j DNAT --to 192.168.1.81&lt;br /&gt;
        $ iptables -t nat -A POSTROUTING -d 192.168.1.81 -s 192.168.1.0/24 -p tcp --dport 80 -j SNAT --to 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
     Change 192.168.1.0/24 to whatever source you expect the web browser to come in on. Below is the tcpdump showing&lt;br /&gt;
     all traffic is relayed via 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
         [root@closet iptables]# tcpdump -nN port 80&lt;br /&gt;
&lt;br /&gt;
         17:34:58.790398 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: S 3620106373:3620106373(0) win 16384 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790465 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: S 3620106373:3620106373(0) win 16384 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790703 IP 192.168.1.81.80 &amp;gt; 192.168.1.71.1158: S 1973665156:1973665156(0) ack 3620106374 win 5840 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790720 IP 192.168.1.71.80 &amp;gt; 192.168.1.102.1158: S 1973665156:1973665156(0) ack 3620106374 win 5840 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790951 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: . ack 1 win 17520&lt;br /&gt;
         17:34:58.790965 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: . ack 1 win 17520&lt;br /&gt;
         17:34:58.791451 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: P 1:327(326) ack 1 win 17520&lt;br /&gt;
         17:34:58.791472 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: P 1:327(326) ack 1 win 17520&lt;br /&gt;
         17:34:58.791973 IP 192.168.1.81.80 &amp;gt; 192.168.1.71.1158: . ack 327 win 6432&lt;br /&gt;
&lt;br /&gt;
     Above the web client is on &amp;quot;192.168.1.102&amp;quot;. You can see that the 1st server &amp;quot;192.168.1.71&amp;quot; then goes out to&lt;br /&gt;
     the 2nd server &amp;quot;192.168.1.81&amp;quot; on the second line. The third line shows the 2nd server &amp;quot;192.168.1.81&amp;quot; responding to&lt;br /&gt;
     the 1st server, and the forth line passes this data back to the web client &amp;quot;192.168.1.102&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Note: You can save your current iptables setting with the following command:&lt;br /&gt;
&lt;br /&gt;
         $ iptables-save &amp;gt; iptables_store&lt;br /&gt;
&lt;br /&gt;
       The big advantage is that you can store the counters as well.&lt;br /&gt;
&lt;br /&gt;
         $ iptables-save -c &amp;gt; iptables_store_w_cnts&lt;br /&gt;
&lt;br /&gt;
       To restore the file, use the following:&lt;br /&gt;
&lt;br /&gt;
         $ iptables-restore -c &amp;lt; iptables_store_w_cnts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 183:&lt;br /&gt;
&lt;br /&gt;
     mailstats - display mail statistics. This file reads data from &amp;quot;/var/log/mail/statistics&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         [root@closet ~]# mailstats&lt;br /&gt;
         Statistics from Sat Jun 25 15:59:52 2005&lt;br /&gt;
          M   msgsfr  bytes_from   msgsto    bytes_to  msgsrej msgsdis msgsqur  Mailer&lt;br /&gt;
          4        1          2K        0          0K        0       0       0  esmtp&lt;br /&gt;
          9        0          0K        1          2K        0       0       0  local&lt;br /&gt;
         =====================================================================&lt;br /&gt;
          T        1          2K        1          2K        0       0       0&lt;br /&gt;
          C        1                    0                    0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 184:&lt;br /&gt;
&lt;br /&gt;
     Profiling C Applications - Assume you have the following program p1.c:&lt;br /&gt;
&lt;br /&gt;
         /* Program  p1.c */&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
         t1(int i)&lt;br /&gt;
         {&lt;br /&gt;
                 printf(&amp;quot;t1:%d\n&amp;quot;, i);&lt;br /&gt;
         }&lt;br /&gt;
        &lt;br /&gt;
         t2(int j)&lt;br /&gt;
         {&lt;br /&gt;
                 printf(&amp;quot;t2:%d\n&amp;quot;, j);&lt;br /&gt;
         }&lt;br /&gt;
        &lt;br /&gt;
         int main(void)&lt;br /&gt;
         {&lt;br /&gt;
                 int i, j;&lt;br /&gt;
        &lt;br /&gt;
                 for (i = 0; i &amp;lt; 5; ++i) {&lt;br /&gt;
                         t1(i);&lt;br /&gt;
                         for (j = 0; j &amp;lt; 2; ++j) {&lt;br /&gt;
                                 t2(j);&lt;br /&gt;
                         }&lt;br /&gt;
                 }&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
     Compile the program as follows:&lt;br /&gt;
&lt;br /&gt;
        $ gcc -pg -g -o p1 p1.c&lt;br /&gt;
        $ ./p1&lt;br /&gt;
        t1:0&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:1&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:2&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:3&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:4&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
&lt;br /&gt;
     Next, to get the profile graph.&lt;br /&gt;
&lt;br /&gt;
        $ gprof -p -b p1&lt;br /&gt;
        Flat profile:&lt;br /&gt;
        &lt;br /&gt;
        Each sample counts as 0.01 seconds.&lt;br /&gt;
         no time accumulated&lt;br /&gt;
        &lt;br /&gt;
          %   cumulative   self              self     total&lt;br /&gt;
         time   seconds   seconds    calls  Ts/call  Ts/call  name&lt;br /&gt;
          0.00      0.00     0.00       10     0.00     0.00  t2&lt;br /&gt;
          0.00      0.00     0.00        5     0.00     0.00  t1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Above note the 10 calls to t2 and 5 calls to t1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 185:&lt;br /&gt;
&lt;br /&gt;
     CDPATH - this is a bash variable like PATH that defines a search path&lt;br /&gt;
              for the cd command.&lt;br /&gt;
&lt;br /&gt;
     Suppose you have the following directory structure:&lt;br /&gt;
&lt;br /&gt;
             /home/chirico/stuff&lt;br /&gt;
                               |-- dirA&lt;br /&gt;
                               `-- dirB&lt;br /&gt;
&lt;br /&gt;
     Assume you define CDPATH as follows:&lt;br /&gt;
&lt;br /&gt;
             CDPATH=/home/chirico/stuff&lt;br /&gt;
&lt;br /&gt;
     Now, no matter what directory you are in if you use the cd command below&lt;br /&gt;
     you will automatically move to &amp;quot;/home/chirico/stuff/dirA&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             $ cd dirA&lt;br /&gt;
&lt;br /&gt;
     Note you could be in &amp;quot;/etc&amp;quot; and will move directly to &amp;quot;/home/chirico/stuff/dirA&amp;quot;.&lt;br /&gt;
     This command has the same format as PATH - multiple entries are separated by a colon.&lt;br /&gt;
     If the current directory contain a sub-directory dirA, then, it gets priority.&lt;br /&gt;
&lt;br /&gt;
     The following is part of my .bash_profile&lt;br /&gt;
&lt;br /&gt;
             CDPATH=/work/cpearls/src/posted_on_sf/:/work/souptonuts/documentation/:/home/chirico/deleteme/&lt;br /&gt;
             export PATH CVS_RSH EDITOR JAVA_HOME CDPATH&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 186:&lt;br /&gt;
&lt;br /&gt;
     Groups - add groups and users to groups. The following shows how to create the group &amp;quot;share&amp;quot;&lt;br /&gt;
              and add the user &amp;quot;chirico&amp;quot; to this group. The following should be done as root, and&lt;br /&gt;
              assumes the account &amp;quot;chirico&amp;quot; already exits.&lt;br /&gt;
&lt;br /&gt;
             $ groupadd share&lt;br /&gt;
             $ usermod -G share chirico&lt;br /&gt;
&lt;br /&gt;
     Note the change made to &amp;quot;/etc/group&amp;quot; below:&lt;br /&gt;
&lt;br /&gt;
             $ cat /etc/group|grep 'share'&lt;br /&gt;
             share:x:616:chirico&lt;br /&gt;
&lt;br /&gt;
     If the user chirico is currently logged in, he should run the following&lt;br /&gt;
     command to immediately have group &amp;quot;share&amp;quot; rights. Or, the next time he logs&lt;br /&gt;
     in he will have access to this group.&lt;br /&gt;
&lt;br /&gt;
             $ newgrp share&lt;br /&gt;
&lt;br /&gt;
     Reference the following (TIP 6, TIP 167).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 187:&lt;br /&gt;
&lt;br /&gt;
     oprofile - steps for running oprofile on Fedora.&lt;br /&gt;
&lt;br /&gt;
     Step 1:&lt;br /&gt;
&lt;br /&gt;
       Find out what version of the kernel you are running.&lt;br /&gt;
&lt;br /&gt;
           $ uname -a&lt;br /&gt;
           Linux closet.squeezel.com 2.6.12-1.1398_FC4 #1 Fri Jul 15 00:52:32 EDT 2005 i686 i686 i386 GNU/Linux&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 2:&lt;br /&gt;
&lt;br /&gt;
       Download the source in a chosen directory. Above, I'm running 2.6.12-1, but I'm going to go for 2.6.12.3, since&lt;br /&gt;
       it's a little later. You want the signed file as well.&lt;br /&gt;
&lt;br /&gt;
           $ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.12.3.tar.gz&lt;br /&gt;
           $ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.12.3.tar.gz.sign&lt;br /&gt;
&lt;br /&gt;
       Now, check the signature.&lt;br /&gt;
&lt;br /&gt;
           $ gpg --verify linux-2.6.12.3.tar.gz.sign linux-2.6.12.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 3:&lt;br /&gt;
&lt;br /&gt;
       Unpack the file.&lt;br /&gt;
&lt;br /&gt;
           $ tar -xzf linux-2.6.12.3.tar.gz&lt;br /&gt;
           $ cd cd linux-2.6.12.3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 4:&lt;br /&gt;
&lt;br /&gt;
       Copy the &amp;quot;.config&amp;quot; used to compile your previous kernel. You should find it&lt;br /&gt;
       in the following direcotry &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       Copy it to the linux-2.6.12.3 directory.&lt;br /&gt;
&lt;br /&gt;
           $ cp &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot; .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 5:&lt;br /&gt;
&lt;br /&gt;
       Run make as follows. It will ask for a few questions on &amp;quot;make oldconfig&amp;quot;. The&lt;br /&gt;
       make installs below will have to be done with root privileges.&lt;br /&gt;
&lt;br /&gt;
          $ make oldconfig&lt;br /&gt;
          $ make bzImage&lt;br /&gt;
          $ make modules&lt;br /&gt;
          $ make modules_install&lt;br /&gt;
          $ make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 6:&lt;br /&gt;
&lt;br /&gt;
       Edit the &amp;quot;/boot/grub/grub.conf&amp;quot; and set default = 0  as shown below in this&lt;br /&gt;
       file.&lt;br /&gt;
&lt;br /&gt;
            default=0&lt;br /&gt;
            timeout=5&lt;br /&gt;
            splashimage=(hd0,2)/grub/splash.xpm.gz&lt;br /&gt;
            hiddenmenu&lt;br /&gt;
            title Fedora Core (2.6.12.3)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.12.3 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.12.3.img&lt;br /&gt;
            title Fedora Core (2.6.12-1.1398_FC4)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.12-1.1398_FC4 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.12-1.1398_FC4.img&lt;br /&gt;
            title Fedora Core (2.6.11-1.1369_FC4)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.11-1.1369_FC4 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.11-1.1369_FC4.img&lt;br /&gt;
            title Other&lt;br /&gt;
                    rootnoverify (hd0,1)&lt;br /&gt;
                    chainloader +1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 7:&lt;br /&gt;
&lt;br /&gt;
       Shutdown with the restart option.&lt;br /&gt;
&lt;br /&gt;
           $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 8:&lt;br /&gt;
&lt;br /&gt;
       Run opcontrol. The commands below are done as root.  My kernel was compiled in the following&lt;br /&gt;
       directory &amp;quot;/home/kernel/linux-2.6.12.3/&amp;quot;, so I'll run opcontrol as follows:&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --vmlinux=/home/kernel/linux-2.6.12.3/vmlinux&lt;br /&gt;
&lt;br /&gt;
       Now start.&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --start&lt;br /&gt;
           Using 2.6+ OProfile kernel interface.&lt;br /&gt;
           Reading module info.&lt;br /&gt;
           Using log file /var/lib/oprofile/oprofiled.log&lt;br /&gt;
           Daemon started.&lt;br /&gt;
           Profiler running.&lt;br /&gt;
&lt;br /&gt;
       Shutdown opcontrol.&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --shutdown&lt;br /&gt;
&lt;br /&gt;
       Run report.&lt;br /&gt;
&lt;br /&gt;
           $ opreport&lt;br /&gt;
&lt;br /&gt;
           CPU: CPU with timer interrupt, speed 0 MHz (estimated)&lt;br /&gt;
           Profiling through timer interrupt&lt;br /&gt;
                     TIMER:0|&lt;br /&gt;
             samples|      %|&lt;br /&gt;
           ------------------&lt;br /&gt;
              156088 99.8746 vmlinux&lt;br /&gt;
                  60  0.0384 libc-2.3.5.so&lt;br /&gt;
                  30  0.0192 oprofiled&lt;br /&gt;
                  23  0.0147 libcrypto.so.0.9.7f&lt;br /&gt;
                  13  0.0083 bash&lt;br /&gt;
                  12  0.0077 screen&lt;br /&gt;
                  10  0.0064 sshd&lt;br /&gt;
                   9  0.0058 ssh&lt;br /&gt;
                   6  0.0038 ip_tables&lt;br /&gt;
                   6  0.0038 libncurses.so.5.4&lt;br /&gt;
                   5  0.0032 b44&lt;br /&gt;
                   5  0.0032 ext3&lt;br /&gt;
                   5  0.0032 ld-2.3.5.so&lt;br /&gt;
                   4  0.0026 ip_conntrack&lt;br /&gt;
                   4  0.0026 jbd&lt;br /&gt;
                   2  0.0013 grep&lt;br /&gt;
                   1 6.4e-04 libdns.so.20.0.2&lt;br /&gt;
                   1 6.4e-04 libisc.so.9.1.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Reference the following for more documentation:&lt;br /&gt;
             http://oprofile.sourceforge.net/doc/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 188:&lt;br /&gt;
&lt;br /&gt;
     cyrus-imapd with Postfix using sasldb for authentication. For this example&lt;br /&gt;
     the server is tape.squeezel.com and the user is chirico.&lt;br /&gt;
&lt;br /&gt;
        Step 1:&lt;br /&gt;
        &lt;br /&gt;
                   $ yum install cyrus-imapd&lt;br /&gt;
                   $ yum install cyrus-imapd-utils&lt;br /&gt;
        &lt;br /&gt;
            You need &amp;quot;cyrus-imapd-utils&amp;quot; for cyradm.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 2:&lt;br /&gt;
        &lt;br /&gt;
          Edit /etc/imapd.conf&lt;br /&gt;
        &lt;br /&gt;
               configdirectory: /var/lib/imap&lt;br /&gt;
               partition-default: /var/spool/imap&lt;br /&gt;
               admins: cyrus&lt;br /&gt;
               sievedir: /var/lib/imap/sieve&lt;br /&gt;
               sendmail: /usr/sbin/sendmail&lt;br /&gt;
               hashimapspool: true&lt;br /&gt;
               # Chirico Commented the below line&lt;br /&gt;
               # sasl_pwcheck_method: saslauthd&lt;br /&gt;
               # Because using sasldb&lt;br /&gt;
               sasl_pwcheck_method: auxprop&lt;br /&gt;
               sasl_auxprop_plugin: sasldb&lt;br /&gt;
               #  Chirico end change&lt;br /&gt;
               sasl_mech_list: PLAIN&lt;br /&gt;
               tls_cert_file: /usr/share/ssl/certs/cyrus-imapd.pem&lt;br /&gt;
               tls_key_file: /usr/share/ssl/certs/cyrus-imapd.pem&lt;br /&gt;
               tls_ca_file: /usr/share/ssl/certs/ca-bundle.crt&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 3:&lt;br /&gt;
        &lt;br /&gt;
           Create a user and password:&lt;br /&gt;
        &lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` cyrus&lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` chirico&lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` allmail&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
           This will automatically create the file /etc/sasldb2. But look&lt;br /&gt;
           at the default rights, assuming you ran saslpasswd2 as root:&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /etc/sasldb2&lt;br /&gt;
                 -rw-r-----  1 root root 12288 Jul 31 09:50 /etc/sasldb2&lt;br /&gt;
        &lt;br /&gt;
           We need to correct this in step 4.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 4:&lt;br /&gt;
        &lt;br /&gt;
                 $ chown root.mail /etc/sasldb2&lt;br /&gt;
                 $ ls -l /etc/sasldb2&lt;br /&gt;
                 -rw-r-----  1 root mail 12288 Jul 31 09:50 /etc/sasldb2&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 5:&lt;br /&gt;
        &lt;br /&gt;
            Update &amp;quot;/etc/postfix/main.cf&amp;quot;. Note in /etc/imapd.conf the configdirectory&lt;br /&gt;
            points to /var/lib/imap, and if I look at this directory I see the&lt;br /&gt;
            socket directory. However, after staring /etc/init.d/cyrus-imapd  there&lt;br /&gt;
            will be a socket file &amp;quot;/var/lib/imap/socket/lmtp&amp;quot;. (See step 6).&lt;br /&gt;
        &lt;br /&gt;
                  mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp&lt;br /&gt;
                  mailbox_transport = cyrus&lt;br /&gt;
        &lt;br /&gt;
            Restart postfix.&lt;br /&gt;
        &lt;br /&gt;
                  /etc/init.d/postfix restart&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 6:&lt;br /&gt;
&lt;br /&gt;
            Start cyrus-imapd and look for the socket file.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
                   $ /etc/init.d/cyrus-imapd restart&lt;br /&gt;
                   Shutting down cyrus-imapd:                                 [  OK  ]&lt;br /&gt;
                   Starting cyrus-imapd: preparing databases... done.         [  OK  ]&lt;br /&gt;
        &lt;br /&gt;
            Now you should see the lmtp file:&lt;br /&gt;
        &lt;br /&gt;
                   $ ls -l /var/lib/imap/socket/lmtp&lt;br /&gt;
                   srwxrwxrwx  1 root root 0 Jul 31 10:04 /var/lib/imap/socket/lmtp&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 7:&lt;br /&gt;
        &lt;br /&gt;
            Add users. Note, you may have to go back to step 3 to add them to /etc/sasldb2&lt;br /&gt;
            as well.&lt;br /&gt;
        &lt;br /&gt;
                   $ su - cyrus&lt;br /&gt;
                   $ cyradm tape.squeezel.com&lt;br /&gt;
                   tape.squeezel.com&amp;gt; cm user.chirico&lt;br /&gt;
                   tape.squeezel.com&amp;gt; quit&lt;br /&gt;
        &lt;br /&gt;
            Now got back as root, and check that everything was created correctly.&lt;br /&gt;
        &lt;br /&gt;
                   $ ls /var/spool/imap/c/user/&lt;br /&gt;
                   total 8&lt;br /&gt;
                   drwx------  2 cyrus mail 4096 Jul 31 10:21 chirico&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 8:&lt;br /&gt;
        &lt;br /&gt;
             Run a mail test. We'll do this as root to the chirico account.&lt;br /&gt;
        &lt;br /&gt;
                   $ mail -s 'First test'  chirico&lt;br /&gt;
                   first test&lt;br /&gt;
                   .&lt;br /&gt;
        &lt;br /&gt;
             Now, still as root check the maillog. Normally everything should work.&lt;br /&gt;
        &lt;br /&gt;
                  $ tail /var/log/maillog&lt;br /&gt;
        &lt;br /&gt;
             However, I got the following error below.&lt;br /&gt;
&lt;br /&gt;
                     Jul 31 10:29:03 tape postfix/cleanup[30124]: AE7CB1B34A4: message-id=&amp;lt;20050731142903.AE7CB1B34A4@tape.squeezel.com&amp;gt;&lt;br /&gt;
                     Jul 31 10:29:03 tape postfix/qmgr[30120]: AE7CB1B34A4: from=&amp;lt;root@tape.squeezel.com&amp;gt;, size=315, nrcpt=1 (queue active)&lt;br /&gt;
                     Jul 31 10:29:03 tape pipe[30128]: fatal: pipe_comand: execvp /cyrus/bin/deliver: No such file or directory&lt;br /&gt;
&lt;br /&gt;
             If you get a similiar error, you may need to adjust the settting in /etc/postfix/master.cf&lt;br /&gt;
        &lt;br /&gt;
                 # This is the problem in /etc/postfix/master.cf&lt;br /&gt;
                 cyrus     unix  -       n       n       -       -       pipe&lt;br /&gt;
                   user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}&lt;br /&gt;
        &lt;br /&gt;
             My deliver file is the following&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
                 -rwxr-xr-x  1 root root 846228 Apr  4 18:59 /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
        &lt;br /&gt;
             So I need to change my /etc/postfix/master.cf as follows:&lt;br /&gt;
        &lt;br /&gt;
                 # Fix because by deliver file is under  /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
                 cyrus     unix  -       n       n       -       -       pipe&lt;br /&gt;
                   user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -r ${sender} -m ${extension} ${user}&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
             If changes were needed, like I had to do, restart postfix&lt;br /&gt;
        &lt;br /&gt;
                 $ /etc/init.d/postfix restart&lt;br /&gt;
        &lt;br /&gt;
             Now, if everything works, you should start to see numbers in the spool directory like &amp;quot;1.&amp;quot; and&lt;br /&gt;
             &amp;quot;2.&amp;quot;.&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /var/spool/imap/c/user/chirico/&lt;br /&gt;
                 total 40&lt;br /&gt;
                 -rw-------  1 cyrus mail  545 Jul 31 10:44 1.&lt;br /&gt;
                 -rw-------  1 cyrus mail  547 Jul 31 10:45 2.&lt;br /&gt;
                 -rw-------  1 cyrus mail 1276 Jul 31 10:45 cyrus.cache&lt;br /&gt;
                 -rw-------  1 cyrus mail  153 Jul 31 10:21 cyrus.header&lt;br /&gt;
                 -rw-------  1 cyrus mail  196 Jul 31 10:45 cyrus.index&lt;br /&gt;
&lt;br /&gt;
        Step 9:&lt;br /&gt;
        &lt;br /&gt;
             Local firewall.&lt;br /&gt;
        &lt;br /&gt;
                 # imap&lt;br /&gt;
                iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 143 -j ACCEPT&lt;br /&gt;
                iptables -A INPUT -p tcp -s 192.168.1.0/24  --dport 143 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        Step 10:&lt;br /&gt;
        &lt;br /&gt;
             Configure cyrus-imapd to start for run-level 3 and 5.&lt;br /&gt;
&lt;br /&gt;
                 # chkconfig --level 35 cyrus-imapd on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       HINTS - &lt;br /&gt;
&lt;br /&gt;
        Something to watch out for:&lt;br /&gt;
&lt;br /&gt;
              Something to watch out for: If a user creates a .forward file in their shell account with the&lt;br /&gt;
              following entry, then, mail will not get mail relayed to cyrus.&lt;br /&gt;
&lt;br /&gt;
                  &amp;quot;|exec /usr/bin/procmail&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             The /etc/maillog will show something like this:&lt;br /&gt;
&lt;br /&gt;
                    to=&amp;lt;chirico@squeezel.squeezel.com&amp;gt;, orig_to=&amp;lt;chirico&amp;gt;, relay=local, delay=0,&lt;br /&gt;
                          status=sent (delivered to command: exec /usr/bin/procmail)&lt;br /&gt;
&lt;br /&gt;
             Remove the &amp;quot;.forward&amp;quot; file from their home directory and you'll get the following:&lt;br /&gt;
&lt;br /&gt;
                    to=&amp;lt;chirico@squeezel.squeezel.com&amp;gt;, relay=cyrus, delay=0,&lt;br /&gt;
                          status=sent (squeezel.squeezel.com)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              mutt with IMAP?  (See TIP 190)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 189:&lt;br /&gt;
&lt;br /&gt;
     expand - convert tabs to spaces in a file.&lt;br /&gt;
&lt;br /&gt;
             $ expand How_to_Linux_and_Open_Source.txt &amp;gt; notabs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 190:&lt;br /&gt;
&lt;br /&gt;
     mutt with imap - assume you have setup imap (see tip 188). Now how do you configure&lt;br /&gt;
                      your &amp;quot;.muttrc&amp;quot; file to automatically connect, securely to the IMAP server?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       &lt;br /&gt;
     Below is an example of my &amp;quot;.muttrc&amp;quot; file. For this example, assume my password is &amp;quot;S0m3paSSw0r9&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             $ cat .muttrc&lt;br /&gt;
             set spoolfile = &amp;quot;imaps://chirico:S0m3paSSw0r9@squeezel.squeezel.com/&lt;br /&gt;
             set imap_force_ssl=yes&lt;br /&gt;
             set certificate_file=~/.mutt/certificates/72d31154.0&lt;br /&gt;
&lt;br /&gt;
     Now, you want to copy the certificate as a &amp;quot;file.pem&amp;quot; and run &amp;quot;c_rehash&amp;quot; to convert this&lt;br /&gt;
     file to a number. See the article. See the following article on how to do this under the &lt;br /&gt;
     fetchmail section.&lt;br /&gt;
&lt;br /&gt;
          http://souptonuts.sourceforge.net/postfix_tutorial.html&lt;br /&gt;
&lt;br /&gt;
     This is a quick summary of creating this key.&lt;br /&gt;
&lt;br /&gt;
             $ openssl s_client -connect squeezel.squeezel.com:995 -showcerts &amp;gt; file.pem&lt;br /&gt;
             $ c_rehash ~/.mutt/certificates&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 191:&lt;br /&gt;
&lt;br /&gt;
     Apache - CGI scripts.  There are two ways to enable CGI scripts. The second method is the&lt;br /&gt;
              prefered method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           First way, the easy way. Look for the &amp;quot;http.conf&amp;quot; file. On Fedora Core, this file can be&lt;br /&gt;
           found under &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;. Edit this file as follows to make &lt;br /&gt;
           &amp;quot;http://squeezel.squeezel.com/chirico-cgi/&amp;quot; execute scripts.&lt;br /&gt;
&lt;br /&gt;
                     ScriptAlias /chirico-cgi/ &amp;quot;/home/chirico/cgi-bin/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           Second way, the better way. Instead of doing the above, make the following change in &lt;br /&gt;
           &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                     &amp;lt;Directory /home/chirico/cgi-bin&amp;gt;&lt;br /&gt;
                      Options +ExecCGI&lt;br /&gt;
                      SetHandler chirico-cgi&lt;br /&gt;
                     &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Running a test script. Now copy the following test script into the directory &amp;quot;/home/chirico/cgi-bin&amp;quot;&lt;br /&gt;
        and change the rights to execute for the user running this.&lt;br /&gt;
&lt;br /&gt;
                  #!/bin/sh&lt;br /&gt;
                  # Save as test.cgi&lt;br /&gt;
                  #  chown apache.apache test.cgi&lt;br /&gt;
                  #  chmod 700 test.cgi&lt;br /&gt;
                  echo &amp;quot;Content-Type: text/html&amp;quot;&lt;br /&gt;
                  echo&lt;br /&gt;
                  echo &amp;quot;Hello world from user &amp;lt;b&amp;gt;`whoami`&amp;lt;/b&amp;gt;! &amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 192:&lt;br /&gt;
&lt;br /&gt;
     Bash - using getopts for your bash scripts.&lt;br /&gt;
&lt;br /&gt;
                   #!/bin/bash&lt;br /&gt;
                   while getopts &amp;quot;ab:cd:&amp;quot; Option&lt;br /&gt;
                   # b and d take arguments&lt;br /&gt;
                   #&lt;br /&gt;
                   do&lt;br /&gt;
                     case $Option in&lt;br /&gt;
                       a) echo -e &amp;quot;a = $OPTIND&amp;quot;;;&lt;br /&gt;
                       b) echo -e &amp;quot;b = $OPTIND $OPTARG&amp;quot;;;&lt;br /&gt;
                       c) echo -e &amp;quot;c = $OPTIND&amp;quot;;;&lt;br /&gt;
                       d) echo -e &amp;quot;d = $OPTIND $OPTARG&amp;quot;;;&lt;br /&gt;
                    esac&lt;br /&gt;
                  done&lt;br /&gt;
                  shift $(($OPTIND - 1))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 193:&lt;br /&gt;
&lt;br /&gt;
     Sieve - creating sieve recipes with &amp;quot;sieveshell&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     The following sieve script put all jefferson.edu mail into the &lt;br /&gt;
     folder jefferson. This assumes that I have already created the IMP &lt;br /&gt;
     directory, or mail box (INBOX.jefferson), which can be done in mutt &lt;br /&gt;
     with the &amp;quot;C&amp;quot; command. Below is an example of finding &amp;quot;jefferson.edu&amp;quot;&lt;br /&gt;
     anywhere in the header. &lt;br /&gt;
&lt;br /&gt;
         # This is a file named jefferson.siv&lt;br /&gt;
         require [&amp;quot;fileinto&amp;quot;];&lt;br /&gt;
         if header :contains &amp;quot;Received&amp;quot; &amp;quot;from jefferson.edu&amp;quot; {&lt;br /&gt;
           fileinto &amp;quot;INBOX.jefferson&amp;quot;;&lt;br /&gt;
           stop;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
     Now, from the command propt execute &amp;quot;sieveshell&amp;quot; with the hostname of the&lt;br /&gt;
     imap server. My server is squeezel.squeezel.com, so I would execute the &lt;br /&gt;
     following:&lt;br /&gt;
&lt;br /&gt;
          $ sieveshell squeezel.squeezel.com&lt;br /&gt;
          connecting to squeezel.squeezel.com&lt;br /&gt;
          Please enter your password:****&lt;br /&gt;
          &amp;gt; put jefferson.siv&lt;br /&gt;
          &amp;gt; activate jefferson.siv&lt;br /&gt;
          &amp;gt; list&lt;br /&gt;
          jefferson.siv  &amp;lt;- active script&lt;br /&gt;
          &amp;gt; quit&lt;br /&gt;
&lt;br /&gt;
     Note the put brings in the script. And you need to activiate it.&lt;br /&gt;
&lt;br /&gt;
     You can activate a sieve script for any user on your system if you are&lt;br /&gt;
     root. This is an example of activating a script for user chirico. Assume&lt;br /&gt;
     below the root prompt is &amp;quot;#&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          # sieveshell -a chirico -u chirico squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
     You can also automate everything from a bash script. But note after&lt;br /&gt;
     the -e the commands, and not a file with the commands, follows within&lt;br /&gt;
     quotes. This is the script I use for my home system.&lt;br /&gt;
&lt;br /&gt;
         #!/bin/bash&lt;br /&gt;
         sieveshell -a chirico -u chirico -e 'deactivate&lt;br /&gt;
         delete chirico.siv&lt;br /&gt;
         put chirico.siv&lt;br /&gt;
         activate chirico.siv&lt;br /&gt;
         list&lt;br /&gt;
         '  squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     References:&lt;br /&gt;
         http://wiki.fastmail.fm/index.php/SieveRecipes&lt;br /&gt;
         http://www.cyrusoft.com/sieve/#documents&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 194:&lt;br /&gt;
&lt;br /&gt;
     emacs - editing files remotely with tramp. Tramp comes with the latest version of emacs.&lt;br /&gt;
             That means if you're using Fedora core 4, with emacs, you have tramp. This is &lt;br /&gt;
             ideal for editing files on remote computers that do not use emacs.&lt;br /&gt;
&lt;br /&gt;
             Edit the &amp;quot;.emacs&amp;quot; file and add the following line:&lt;br /&gt;
&lt;br /&gt;
                 (require 'tramp)&lt;br /&gt;
                 (setq tramp-default-method &amp;quot;scp&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
             Now, to edit a file on computer tape.squeezel.com (C-x, C-f) and&lt;br /&gt;
             enter the following in Find file:&lt;br /&gt;
&lt;br /&gt;
                 Find file:/chirico@tape.squeezel.com:test.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             References:&lt;br /&gt;
&lt;br /&gt;
                    http://savannah.gnu.org/projects/tramp/&lt;br /&gt;
&lt;br /&gt;
             &lt;br /&gt;
&lt;br /&gt;
TIP 195:&lt;br /&gt;
&lt;br /&gt;
     trusted X11 forwarding - running gnome and KDE both on one screen, at the same&lt;br /&gt;
             time securely. The following assumes gnome is running on the current&lt;br /&gt;
             computer and &amp;quot;closet.squeezel.com&amp;quot; has KDE&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y  closet.squeezel.com&lt;br /&gt;
              $ startkde&lt;br /&gt;
&lt;br /&gt;
          Or assume you want to run gnome on &amp;quot;closet.squeezel.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y  closet.squeezel.com&lt;br /&gt;
              $ gnome-session&lt;br /&gt;
&lt;br /&gt;
          By default Fedora Core allows ForwardX11 over ssh. Note you want to use&lt;br /&gt;
          the -Y option above and NOT -X. &lt;br /&gt;
&lt;br /&gt;
          Suppose you want a remote &amp;quot;gnome-session&amp;quot; on ctl-alt-F12. Below is an &lt;br /&gt;
          example of getting the remote computer closet.squeezel.com, and you&lt;br /&gt;
          can still have the above configuration.&lt;br /&gt;
&lt;br /&gt;
          First you must allow magic cookies for each server connection.&lt;br /&gt;
             &lt;br /&gt;
              $ MCOOKIE=$(mcookie)&lt;br /&gt;
              $ xauth add $(hostname)/unix:1 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
              $ xauth add localhost/unix:1 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
  &lt;br /&gt;
          Again, note that you have to add this for EACH connection. So if you wanted 2 as well&lt;br /&gt;
&lt;br /&gt;
              $ MCOOKIE=$(mcookie)&lt;br /&gt;
              $ xauth add $(hostname)/unix:2 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
              $ xauth add localhost/unix:2 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
&lt;br /&gt;
          On squeezel.squeezel.com create a new xterm. If :1 is take below&lt;br /&gt;
          try :2. The vt12 is for switching to ctl-alt-F12.&lt;br /&gt;
&lt;br /&gt;
              $ xinit -- :1 vt12&lt;br /&gt;
&lt;br /&gt;
          Note, if you do not add the above cookies, you will get the follow error:&lt;br /&gt;
         &lt;br /&gt;
               Xlib: connection to &amp;quot;:1.0&amp;quot; refused by server&lt;br /&gt;
               Xlib: No protocol specified&lt;br /&gt;
&lt;br /&gt;
          The screen may be hard to read. At this point ssh -Y to the remote computer.&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y closet.squeezel.com&lt;br /&gt;
              $ gnome-session&lt;br /&gt;
&lt;br /&gt;
          Yes, you will get errors about sound and some custom drivers is the remove &lt;br /&gt;
          computer has different hardware. After is loads, you can switch back and&lt;br /&gt;
          forth between session with (ctl-alt-F12)  and (ctl-alt-F7)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 196:&lt;br /&gt;
&lt;br /&gt;
     Suspend ssh session - you have just sshed into a computer &amp;quot;ssh -l user example.com&amp;quot;, and you&lt;br /&gt;
          want to get back to the terminal prompt of the computer you started with. Escapte, by &lt;br /&gt;
          default with ssh is &amp;quot;~&amp;quot;, so enter &amp;quot;~&amp;quot; followed by &amp;quot;ctl-z&amp;quot; to suspend.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 197:&lt;br /&gt;
&lt;br /&gt;
     Quick way to send a text file &lt;br /&gt;
&lt;br /&gt;
              $ sendmail -f mike.chirico@gmail.com mchirico@comcast.net &amp;lt; /etc/fstab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 198:&lt;br /&gt;
&lt;br /&gt;
     size - determining the size of the text segment, data segment, and &amp;quot;bss&amp;quot; or uninitialized data segment.&lt;br /&gt;
&lt;br /&gt;
              $ size /bin/sh /bin/bash&lt;br /&gt;
               text        data     bss     dec     hex filename&lt;br /&gt;
              586946      22444   18784  628174   995ce /bin/sh&lt;br /&gt;
              586946      22444   18784  628174   995ce /bin/bash&lt;br /&gt;
&lt;br /&gt;
          Note above that &amp;quot;/bin/sh&amp;quot; and &amp;quot;/bin/bash&amp;quot; have equal text,data and bss numbers. It's&lt;br /&gt;
          highly likely that these are the same programs.&lt;br /&gt;
&lt;br /&gt;
              $ ls -l /bin/sh&lt;br /&gt;
               lrwxrwxrwx  1 root root 4 Jan 14  2005 /bin/sh -&amp;gt; bash&lt;br /&gt;
&lt;br /&gt;
          Yep, it's the same program. Here's a further definition of each segment.&lt;br /&gt;
&lt;br /&gt;
              Text segment: The machine instructions that the CPU executes. This is usually&lt;br /&gt;
                            read only and sharable.&lt;br /&gt;
&lt;br /&gt;
              Data segment: Contains initialized variables in a program. You also know these&lt;br /&gt;
                            as declarations and definitions.&lt;br /&gt;
&lt;br /&gt;
                               int max = 200;&lt;br /&gt;
&lt;br /&gt;
              Uninitialized data segment: Think of this as a declaration only, or data that&lt;br /&gt;
                            is only initialized by the kernel to arithmetic 0 or null pointers&lt;br /&gt;
                            before program execution.&lt;br /&gt;
&lt;br /&gt;
                               char s[10];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 199:&lt;br /&gt;
&lt;br /&gt;
     Using the at command.&lt;br /&gt;
&lt;br /&gt;
       Below is a simple example if running the ls command at 11:42am that&lt;br /&gt;
       will send mail -m to the user that executed it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       We'll execute job1 defined as follows and set to be executable. &lt;br /&gt;
&lt;br /&gt;
           $ cat ./job1&lt;br /&gt;
           #!/bin/bash&lt;br /&gt;
           date &amp;gt;&amp;gt; /tmp/job1&lt;br /&gt;
&lt;br /&gt;
       The at command is listed below. For queue &amp;quot;-q&amp;quot; names you can only&lt;br /&gt;
       specify one letter. Here we're using x. The letter determines the&lt;br /&gt;
       priority with &amp;quot;a&amp;quot; the highest.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x  -f ./job1 -m  11:54am&lt;br /&gt;
           job 3 at 2005-10-04 11:54&lt;br /&gt;
&lt;br /&gt;
       Now, if you execute the atq command, you'll get the following.&lt;br /&gt;
&lt;br /&gt;
           $ atq&lt;br /&gt;
           3       2005-10-04 11:54 x chirico&lt;br /&gt;
&lt;br /&gt;
       It's also possible to execute jobs at the command line entering&lt;br /&gt;
       a ctl-d at the end of the input.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x  -m 12:08pm&lt;br /&gt;
           at&amp;gt; ls -l&lt;br /&gt;
           at&amp;gt; who&lt;br /&gt;
           at&amp;gt; date&lt;br /&gt;
           at&amp;gt; ^D&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Or for a job to execute 1 minute from now.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x -m `date -d '1 minute' +&amp;quot;%H:%M&amp;quot;`&lt;br /&gt;
           at&amp;gt; ls -l&lt;br /&gt;
           at&amp;gt; date&lt;br /&gt;
     &lt;br /&gt;
&lt;br /&gt;
     Important points: The atd daemon must be running. To check if&lt;br /&gt;
      it's running do the following:&lt;br /&gt;
&lt;br /&gt;
            $ /etc/init.d/atd status&lt;br /&gt;
&lt;br /&gt;
      Also, if there is an /etc/at.allow file, then only users in that&lt;br /&gt;
      file will be allowed to execute at.&lt;br /&gt;
&lt;br /&gt;
      If /etc/at.deny exists but is empty and there is no /etc/at.allow,&lt;br /&gt;
      then, everyone can execute the at command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 200:&lt;br /&gt;
&lt;br /&gt;
     lsusb - command will display all USB buses and all devices connected.&lt;br /&gt;
&lt;br /&gt;
        $ lsusb&lt;br /&gt;
        Bus 005 Device 003: ID 413c:2010 Dell Computer Corp.&lt;br /&gt;
        Bus 005 Device 002: ID 413c:1003 Dell Computer Corp.&lt;br /&gt;
        Bus 005 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 004 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 003 Device 003: ID 0fc5:1227 Delcom Engineering&lt;br /&gt;
        Bus 003 Device 002: ID 046d:c016 Logitech, Inc. Optical Mouse&lt;br /&gt;
        Bus 003 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 002 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 001 Device 001: ID 0000:0000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 201:&lt;br /&gt;
&lt;br /&gt;
     Memory fragmentation - if you suspect workload memory fragmentation issues&lt;br /&gt;
     and you want to monitor the current state of you system, then, consider&lt;br /&gt;
     looking at the output from /proc/buddyinfo on recent kernels.&lt;br /&gt;
&lt;br /&gt;
        $ cat /proc/buddyinfo&lt;br /&gt;
      Node 0, zone      DMA    541    218     42      2      0      0      0      1      1      1      0 &lt;br /&gt;
      Node 0, zone   Normal   2508   2614     52      1      5      5      0      1      1      1      0 &lt;br /&gt;
      Node 0, zone  HighMem      0      1      3      0      1      0      0      0      0      0      0 &lt;br /&gt;
&lt;br /&gt;
     The following definition is taken from  ./Documentation/filesystems/proc.txt in the &lt;br /&gt;
     Linux kernel source.&lt;br /&gt;
&lt;br /&gt;
       Each column represents the number of pages of a certain order which are&lt;br /&gt;
       available.  In this case, there are 0 chunks of 2^0*PAGE_SIZE available in&lt;br /&gt;
       ZONE_DMA, 4 chunks of 2^1*PAGE_SIZE in ZONE_DMA, 101 chunks of 2^4*PAGE_SIZE&lt;br /&gt;
       available in ZONE_NORMAL, etc...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 202:&lt;br /&gt;
&lt;br /&gt;
     arp - Linux ARP kernel moduel.  This command implements the Address Resolution Protocol.&lt;br /&gt;
&lt;br /&gt;
     This is an example of the command.&lt;br /&gt;
&lt;br /&gt;
        $ arp&lt;br /&gt;
        Address                  HWtype  HWaddress           Flags Mask            Iface&lt;br /&gt;
        tape.squeezel.com        ether   00:50:DA:60:5B:AD   C                     eth0&lt;br /&gt;
        squeezel.squeezel.com    ether   00:11:11:8A:BE:3F   C                     eth0&lt;br /&gt;
        gw.squeezel.com          ether   00:0F:66:47:15:73   C                     eth0&lt;br /&gt;
&lt;br /&gt;
       &lt;br /&gt;
TIP 203:&lt;br /&gt;
&lt;br /&gt;
     dbench - performance monitoring. &lt;br /&gt;
&lt;br /&gt;
     So, how does your system react when the load average is above 600. Have you even seen a &lt;br /&gt;
     computer with a load average of 600? Well, this could be your chance. &lt;br /&gt;
&lt;br /&gt;
         Reference: http://freshmeat.net/projects/dbench/&lt;br /&gt;
&lt;br /&gt;
     The following gives a load average of 10 on my system.&lt;br /&gt;
&lt;br /&gt;
        $ dbench 34&lt;br /&gt;
&lt;br /&gt;
     If you want a higher load, just increase the number.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 204:&lt;br /&gt;
&lt;br /&gt;
     /etc guide - a listing of common files in the /etc directory.&lt;br /&gt;
&lt;br /&gt;
        /etc/exports: this file is used to configure NFS.&lt;br /&gt;
&lt;br /&gt;
        /etc/ftpusers: the users on your system who are restricted from FTP login.&lt;br /&gt;
&lt;br /&gt;
        /etc/motd: message of the day, which users see after login.&lt;br /&gt;
&lt;br /&gt;
        /etc/named.conf: DNS config file.&lt;br /&gt;
&lt;br /&gt;
        /etc/profile: common user information.&lt;br /&gt;
&lt;br /&gt;
        /etc/inittab: this file contains runlevel start information.&lt;br /&gt;
&lt;br /&gt;
        /etc/services: the services and their respective ports.&lt;br /&gt;
&lt;br /&gt;
        /etc/shells: this contains the names of all shells installed on the system.&lt;br /&gt;
&lt;br /&gt;
        /etc/passwd: this file contains user information.&lt;br /&gt;
&lt;br /&gt;
        /etc/group: security group rights.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
TIP 205: &lt;br /&gt;
&lt;br /&gt;
     logger - is a bash command utility for writing to /var/log/messages or the&lt;br /&gt;
            other files defined in /etc/syslog.conf.&lt;br /&gt;
&lt;br /&gt;
            $ logger -t TEST more of a test here&lt;br /&gt;
&lt;br /&gt;
         This is what shows up in /var/log/messages&lt;br /&gt;
  &lt;br /&gt;
            Oct 28 07:15:50 squeezel TEST: more of a test here&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
TIP 206: &lt;br /&gt;
&lt;br /&gt;
     accton, lastcomm - accouting on and last command. This is &lt;br /&gt;
         a way to monitor users on your system. As root, you &lt;br /&gt;
         would implement this as follows:&lt;br /&gt;
&lt;br /&gt;
           $ accton -h&lt;br /&gt;
            Usage: accton [-hV] [file]&lt;br /&gt;
            [--help] [--version]&lt;br /&gt;
&lt;br /&gt;
            The system's default process accounting file is /var/account/pacct.&lt;br /&gt;
&lt;br /&gt;
         Note the default file location is /var/account/pacct so we'll turn&lt;br /&gt;
         it on system wide with the following command.&lt;br /&gt;
&lt;br /&gt;
           $ accton /var/account/pacct&lt;br /&gt;
&lt;br /&gt;
         Now take a look at this file. It will grow. To see command that&lt;br /&gt;
         are executed, use the lastcomm command.&lt;br /&gt;
&lt;br /&gt;
           $ lastcomm&lt;br /&gt;
&lt;br /&gt;
         The above command gives output for all users. To get the data&lt;br /&gt;
         for user &amp;quot;chirico&amp;quot; execute the following command:&lt;br /&gt;
&lt;br /&gt;
           $ lastcomm --user chirico&lt;br /&gt;
&lt;br /&gt;
         You can also get a summary of commands with sa.&lt;br /&gt;
&lt;br /&gt;
           [chirico@big ~]$ sa&lt;br /&gt;
           30       5.23re       0.00cp    10185k&lt;br /&gt;
           11       4.83re       0.00cp     8961k   ***other&lt;br /&gt;
            8       0.13re       0.00cp    19744k   nagios*&lt;br /&gt;
            4       0.00re       0.00cp     2542k   automount*&lt;br /&gt;
            3       0.00re       0.00cp      680k   sa&lt;br /&gt;
            2       0.13re       0.00cp    17424k   check_ping&lt;br /&gt;
            2       0.13re       0.00cp      978k   ping&lt;br /&gt;
&lt;br /&gt;
         To turn off accounting, execute accton without a filename.&lt;br /&gt;
&lt;br /&gt;
           $ accton&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 207:&lt;br /&gt;
&lt;br /&gt;
     CPU Temperature on a laptop. The following is the temperature&lt;br /&gt;
       of my Dell laptop. &lt;br /&gt;
&lt;br /&gt;
           $ cat /proc/acpi/thermal_zone/THM/temperature&lt;br /&gt;
           temperature:             58 C&lt;br /&gt;
&lt;br /&gt;
      &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 208:&lt;br /&gt;
&lt;br /&gt;
     script -f with mkfifo to allow another user to view what you type&lt;br /&gt;
          in real-time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Step 1.  Create a fifo (first in first out) file that the other&lt;br /&gt;
              user can view. For this example create the file /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
               [chirico@laptop ~]$ mkfifo /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
        Step 2.  Have the second user, voyeur user, cat this file. Output will block&lt;br /&gt;
              for them until you complete step 3. The other user, voyer,&lt;br /&gt;
              is executing the command below.&lt;br /&gt;
 &lt;br /&gt;
               [voyeur@laptop ~]$ cat /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
        Step 3.  The original user runs the following command.&lt;br /&gt;
&lt;br /&gt;
               [chirico@laptop ~]$ script -f  /tmp/scriptout&lt;br /&gt;
               Script started, file is /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
             Now anything typed, including a vi session, will be displayed to the&lt;br /&gt;
             voyeur user in step 2. &lt;br /&gt;
&lt;br /&gt;
        See TIP 46.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 209:&lt;br /&gt;
&lt;br /&gt;
     fsck forced on next reboot.  To do this, as root issue the following commands.&lt;br /&gt;
&lt;br /&gt;
            $ cd /&lt;br /&gt;
            $ touch forcefsck&lt;br /&gt;
&lt;br /&gt;
          Now reboot the system, and when it comes up fsck will be forced on the system.&lt;br /&gt;
&lt;br /&gt;
            $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 210:&lt;br /&gt;
&lt;br /&gt;
     /dev/random and /dev/urandom differ in their random generating properties. /dev/random&lt;br /&gt;
        only returns bytes when enough noise has been generated from the entropy pool. In&lt;br /&gt;
        contrast /dev/urandom will always return bytes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference: http://sourceforge.net/direct-dl/mchirico/cpearls/simple_but_common.tar.gz (rand.c)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 211:&lt;br /&gt;
&lt;br /&gt;
     Want to find out the speed of your NIC?  (Full Duplex or Half), then use ethtool.&lt;br /&gt;
&lt;br /&gt;
               [root@squeezel ~]# ethtool eth0&lt;br /&gt;
               Settings for eth0:&lt;br /&gt;
                       Supported ports: [ MII ]&lt;br /&gt;
                       Supported link modes:   10baseT/Half 10baseT/Full&lt;br /&gt;
                                               100baseT/Half 100baseT/Full&lt;br /&gt;
                                               1000baseT/Half 1000baseT/Full&lt;br /&gt;
                       Supports auto-negotiation: Yes&lt;br /&gt;
                       Advertised link modes:  10baseT/Half 10baseT/Full&lt;br /&gt;
                                               100baseT/Half 100baseT/Full&lt;br /&gt;
                                               1000baseT/Half 1000baseT/Full&lt;br /&gt;
                       Advertised auto-negotiation: Yes&lt;br /&gt;
                       Speed: 100Mb/s&lt;br /&gt;
                       Duplex: Full&lt;br /&gt;
                       Port: Twisted Pair&lt;br /&gt;
                       PHYAD: 1&lt;br /&gt;
                       Transceiver: internal&lt;br /&gt;
                       Auto-negotiation: on&lt;br /&gt;
                       Supports Wake-on: g&lt;br /&gt;
                       Wake-on: d&lt;br /&gt;
                       Current message level: 0x000000ff (255)&lt;br /&gt;
                       Link detected: yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 212:&lt;br /&gt;
&lt;br /&gt;
     rpm install hang? You might need to delete the lock state information. &lt;br /&gt;
&lt;br /&gt;
        $ nl /etc/rc.d/rc.sysinit | grep rpm&lt;br /&gt;
        720   rm -f /var/lib/rpm/__db* &amp;amp;&amp;gt; /dev/null&lt;br /&gt;
&lt;br /&gt;
     Note the command &lt;br /&gt;
&lt;br /&gt;
        $ rm -f /var/lib/rpm/__db*&lt;br /&gt;
&lt;br /&gt;
     Because sometimes you will run &amp;quot;rpm -ivh somerpm&amp;quot; and it will just sit&lt;br /&gt;
     there.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 213:&lt;br /&gt;
&lt;br /&gt;
     Apache - limit access to certain directories based on IP address in the&lt;br /&gt;
         httpd.conf file.&lt;br /&gt;
&lt;br /&gt;
          You can do this completely from /etc/httpd/conf/httpd.conf which&lt;br /&gt;
          are shown below for multiple IP addresses. Note that all 3 setting&lt;br /&gt;
          are the same.&lt;br /&gt;
&lt;br /&gt;
                10.0.0.0/255.0.0.0&lt;br /&gt;
                10.0.0.0/8&lt;br /&gt;
                10&lt;br /&gt;
&lt;br /&gt;
          However, the following is different&lt;br /&gt;
&lt;br /&gt;
                10.0.0.0/24   only allows 10.0.0.1 to 10.0.0.254&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Some complete settings in /etc/httpd/conf/httpd.conf &lt;br /&gt;
&lt;br /&gt;
             &amp;lt;Directory /var/www/html/chirico/&amp;gt;&lt;br /&gt;
                 Order allow,deny&lt;br /&gt;
                 Allow from 10.0.0.0/8      # All 10.&lt;br /&gt;
                 Allow from 192.168.0.0/16  # All 192.168&lt;br /&gt;
                 Allow from 127             # All 127.&lt;br /&gt;
             &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          Don't forget to reload httpd with the following command.&lt;br /&gt;
        &lt;br /&gt;
             $ /etc/init.d/httpd reload&lt;br /&gt;
&lt;br /&gt;
          &lt;br /&gt;
&lt;br /&gt;
TIP 214:&lt;br /&gt;
&lt;br /&gt;
     Open Files - determining how many files are currently open.&lt;br /&gt;
&lt;br /&gt;
             $ cat /proc/sys/fs/file-nr&lt;br /&gt;
             2030    263     104851&lt;br /&gt;
              |       |        \- maximum open file descriptors &lt;br /&gt;
              |       |         &lt;br /&gt;
              |       \- total free allocated file descriptors&lt;br /&gt;
              |&lt;br /&gt;
              (Total allocated file descriptors since boot)&lt;br /&gt;
&lt;br /&gt;
        Note the maximum number can be set or changed.&lt;br /&gt;
&lt;br /&gt;
              $ cat /proc/sys/fs/file-max&lt;br /&gt;
              104851&lt;br /&gt;
&lt;br /&gt;
        To change this&lt;br /&gt;
&lt;br /&gt;
              $ echo &amp;quot;804854&amp;quot; &amp;gt; /proc/sys/fs/file-max&lt;br /&gt;
 &lt;br /&gt;
        Note lsof | wc -l will report higher numbers because this includes&lt;br /&gt;
        open files that are not using file descriptors such as directories,&lt;br /&gt;
        memory mapped files, and executable text files.&lt;br /&gt;
&lt;br /&gt;
        (Reference http://www.netadmintools.com/art295.html&lt;br /&gt;
         and also see the man page for this: man 5 proc )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 215:&lt;br /&gt;
&lt;br /&gt;
     Ctrl-Alt-Del will cause an immediate reboot, without syncing dirty buffers by&lt;br /&gt;
     setting the value &amp;gt; 0 in /proc/sys/kernel/ctrl-alt-del.&lt;br /&gt;
&lt;br /&gt;
               $ echo 1 &amp;gt; /proc/sys/kernel/ctrl-alt-del&lt;br /&gt;
       &lt;br /&gt;
&lt;br /&gt;
        (Reference: man 5 proc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 216:&lt;br /&gt;
&lt;br /&gt;
     Redefining keys in X using xev and xmodmap.  The program xev, used in an X window &lt;br /&gt;
     terminal screen will display information on mouse movements, keys pressed and &lt;br /&gt;
     released.&lt;br /&gt;
&lt;br /&gt;
        $ xev&lt;br /&gt;
&lt;br /&gt;
     Now type shift-4 and you'll notice the event details below:&lt;br /&gt;
&lt;br /&gt;
        KeyPress event, serial 29, synthetic NO, window 0x3800001,&lt;br /&gt;
            root 0x60, subw 0x0, time 55307049, (418,242), root:(428,339),&lt;br /&gt;
            state 0x1, keycode 13 (keysym 0x24, dollar), same_screen YES,&lt;br /&gt;
            XLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
            XmbLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
            XFilterEvent returns: False&lt;br /&gt;
        &lt;br /&gt;
        KeyRelease event, serial 29, synthetic NO, window 0x3800001,&lt;br /&gt;
            root 0x60, subw 0x0, time 55307184, (418,242), root:(428,339),&lt;br /&gt;
            state 0x1, keycode 13 (keysym 0x24, dollar), same_screen YES,&lt;br /&gt;
            XLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
       &lt;br /&gt;
     So, if you want to redefine this key to say copyright, see (/usr/X11R6/include/X11/keysymdef.h)&lt;br /&gt;
     you would type the following.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 copyright'&lt;br /&gt;
&lt;br /&gt;
     To get the key back to the dollar, issue the following command.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 dollar'&lt;br /&gt;
&lt;br /&gt;
     By the way it's possible to define multiple key codes for a sigle key. You'll need&lt;br /&gt;
     to have a key defined as the Mode_switch. Perhaps you'd like to use the Windows key,&lt;br /&gt;
     or the key with the Microsoft logo on it, since you're using Linux. This key is&lt;br /&gt;
     keycode 115&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 115 = Mode_switch'&lt;br /&gt;
&lt;br /&gt;
     Now you could define 3 values to the shift-4. For this example use ld, Yen and dollar.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 dollar sterling yen'&lt;br /&gt;
&lt;br /&gt;
     So pressing the keys gives you the following:&lt;br /&gt;
&lt;br /&gt;
          shift-$          (dollar sign)&lt;br /&gt;
          Windows-$        (lb sign)&lt;br /&gt;
          Windows-shift-$  (Yen sign)&lt;br /&gt;
&lt;br /&gt;
     You could go crazy and redefine all you keys.&lt;br /&gt;
&lt;br /&gt;
     (Thanks to hisham for this tip).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 217:&lt;br /&gt;
&lt;br /&gt;
     Threads - which version of threads are you using?&lt;br /&gt;
&lt;br /&gt;
          $ getconf GNU_LIBPTHREAD_VERSION&lt;br /&gt;
          NPTL 2.3.90&lt;br /&gt;
&lt;br /&gt;
     For a history on threads used with gcc reference the following:&lt;br /&gt;
          &lt;br /&gt;
          http://en.wikipedia.org/wiki/NPTL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 218:&lt;br /&gt;
&lt;br /&gt;
     Screenshots using ImageMagick. &lt;br /&gt;
&lt;br /&gt;
        If you want the entire screen, execute the following:&lt;br /&gt;
&lt;br /&gt;
            $ import -window root screen.png&lt;br /&gt;
&lt;br /&gt;
        Or to crosshair select the region with your mouse, execute &lt;br /&gt;
        the following instead.&lt;br /&gt;
&lt;br /&gt;
            $ import screen.png&lt;br /&gt;
&lt;br /&gt;
        KDE has the ability to take screenshots with the command below.&lt;br /&gt;
&lt;br /&gt;
            $ ksnapshot&lt;br /&gt;
&lt;br /&gt;
        GNOME likewise has a command too.&lt;br /&gt;
&lt;br /&gt;
            $ gnome-panel-screenshot --delay 6&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Visting ImageMagick again, the xwininfo command give window information and the id can be&lt;br /&gt;
        used to capture images with the import command.&lt;br /&gt;
&lt;br /&gt;
            $ xwininfo&lt;br /&gt;
&lt;br /&gt;
          xwininfo: Please select the window about which you&lt;br /&gt;
          would like information by clicking the&lt;br /&gt;
          mouse in that window.&lt;br /&gt;
&lt;br /&gt;
          xwininfo: Window id: 0x1e00007 &amp;quot;chirico@squeezel:/work/svn/souptonuts - Shell - Konsole&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          Absolute upper-left X:  4&lt;br /&gt;
          Absolute upper-left Y:  21&lt;br /&gt;
          Relative upper-left X:  0&lt;br /&gt;
          Relative upper-left Y:  0&lt;br /&gt;
          Width: 880&lt;br /&gt;
          Height: 510&lt;br /&gt;
          Depth: 24&lt;br /&gt;
          Visual Class: TrueColor&lt;br /&gt;
          Border width: 0&lt;br /&gt;
          Class: InputOutput&lt;br /&gt;
          Colormap: 0x20 (installed)&lt;br /&gt;
          Bit Gravity State: NorthWestGravity&lt;br /&gt;
          Window Gravity State: NorthWestGravity&lt;br /&gt;
          Backing Store State: NotUseful&lt;br /&gt;
          Save Under State: no&lt;br /&gt;
          Map State: IsViewable&lt;br /&gt;
          Override Redirect State: no&lt;br /&gt;
          Corners:  +4+21  -396+21  -396-493  +4-493&lt;br /&gt;
          -geometry 880x510+0+0&lt;br /&gt;
&lt;br /&gt;
        Now use the import command with the Window id. My example is shown below.&lt;br /&gt;
&lt;br /&gt;
             $ import -window 0x1e00007  id.miff&lt;br /&gt;
&lt;br /&gt;
        And to quickly display this image that you just saved, use the display command.&lt;br /&gt;
&lt;br /&gt;
             $ display id.miff &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 219:&lt;br /&gt;
&lt;br /&gt;
     File Access over SSH using FUSE (Filesystem in USErspace). This is a very good way to &lt;br /&gt;
     mount a remote filesystem locally. It's  like a secure NFS mount, but you don't require &lt;br /&gt;
     admin privileges on the remote computer. You do need to have fuse-sshfs installed on &lt;br /&gt;
     the local computer that will perform the filesystem mount.&lt;br /&gt;
&lt;br /&gt;
     The following works with Fedora Core 5. Only the users added to the fuse group can mout &lt;br /&gt;
     external drives. Below the user chirico is being added to the group fuse.&lt;br /&gt;
&lt;br /&gt;
             $ yum install fuse-sshfs&lt;br /&gt;
             $ usermod -a -G fuse chirico&lt;br /&gt;
     &lt;br /&gt;
     You'll need to reboot.&lt;br /&gt;
&lt;br /&gt;
             $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
             &lt;br /&gt;
     Next I'm going to mount the remote filesystem v0.squeezel.com. This is done as user chirico&lt;br /&gt;
     on the local computer. I'm using root on the remote computer v0.squeezel.com because I&lt;br /&gt;
     want to mount the complete drive.&lt;br /&gt;
&lt;br /&gt;
             $ mkdir v0&lt;br /&gt;
             $ sshfs root@v0.squeezel.com:/  v0&lt;br /&gt;
             $ cd v0&lt;br /&gt;
             $ ls -l&lt;br /&gt;
               bin   dev  home  lost+found     media  mnt  opt   q     sbin     srv  tmp  var&lt;br /&gt;
               boot  etc  lib   master_backup  misc   net  proc  root  selinux  sys  usr&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
     Now to unmount the filesystem&lt;br /&gt;
&lt;br /&gt;
             $ fusermount -u /home/chirico/v0&lt;br /&gt;
&lt;br /&gt;
     Yes, you can mount the filesystem on boot. Below shows an example entry for /etc/fstab, but&lt;br /&gt;
     this only allows user on the current system to view what is is /mnt/v0. &lt;br /&gt;
&lt;br /&gt;
             sshfs#root@v0.squeezel.com:/var/log             /mnt/v0 fuse defaults    0 0&lt;br /&gt;
&lt;br /&gt;
     References:&lt;br /&gt;
        (http://fuse.sourceforge.net/sshfs.html)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 220:&lt;br /&gt;
&lt;br /&gt;
     OpenVPN - A full-featured SSL VPN solution. The following demonstrates&lt;br /&gt;
               a very simple OpenVPN setup between two Fedora Core 5 computers&lt;br /&gt;
               big.squeezel.com 192.168.1.12 and tape.squeezel.com 192.168.1.155&lt;br /&gt;
&lt;br /&gt;
               As root install the package on both computers.&lt;br /&gt;
&lt;br /&gt;
                  $ yum -y install openvpn&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Setup on big.squeezel.com 192.168.1.12&lt;br /&gt;
&lt;br /&gt;
                  $ iptables -A INPUT -p udp -s 192.168.1.155  --dport 1194 -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tun+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A FORWARD -i tap+ -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
             Note - make sure you have commented out the following line &lt;br /&gt;
                    in /etc/sysconfig/iptables&lt;br /&gt;
&lt;br /&gt;
                  # -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
&lt;br /&gt;
             Now from continuting with the commands that need to be executed on &lt;br /&gt;
             big.squeezel.com 192.168.1.12 do one of the following&lt;br /&gt;
           &lt;br /&gt;
                  $ openvpn --remote tape.squeezel.com  --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 --verb 9&lt;br /&gt;
&lt;br /&gt;
             The above statement gives lots of errors. Once it's working you may want&lt;br /&gt;
             the following statement without the --verb 9 option.&lt;br /&gt;
&lt;br /&gt;
                  $ openvpn --remote tape.squeezel.com  --dev tun1 --ifconfig 10.4.0.1 10.4.0.2&lt;br /&gt;
&lt;br /&gt;
             After you finish the setup commands for tape.squeezel.com immediately below, you'll be&lt;br /&gt;
             able to access tape.squeezel.com as 10.4.0.2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Setup on tape.squeezel.com 192.168.1.155&lt;br /&gt;
&lt;br /&gt;
                  $ iptables -A INPUT -p udp -s 192.168.1.12  --dport 1194 -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tun+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A FORWARD -i tap+ -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
             Note - again, make sure you have commented out the following line &lt;br /&gt;
                    in /etc/sysconfig/iptables&lt;br /&gt;
&lt;br /&gt;
                  # -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
&lt;br /&gt;
             The openvpn commands are tape.squeezel.com are reversed from what is shown&lt;br /&gt;
             above.&lt;br /&gt;
&lt;br /&gt;
                  $ openvpn --remote big.squeezel.com --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 --verb 9&lt;br /&gt;
&lt;br /&gt;
             Or&lt;br /&gt;
                  $ openvpn --remote big.squeezel.com --dev tun1 --ifconfig 10.4.0.2 10.4.0.1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             Now you can access all services and ports from big.squeezel.com on 10.4.0.1 for &lt;br /&gt;
             such services as MySQL, secure Web, imap, etc. A quick test is nmap as follows:&lt;br /&gt;
&lt;br /&gt;
                  $ nmap -A -T4 10.4.0.1&lt;br /&gt;
&lt;br /&gt;
                  Starting Nmap 4.03 ( http://www.insecure.org/nmap/ ) at 2006-05-20 13:54 EDT&lt;br /&gt;
                  Interesting ports on 10.4.0.1:&lt;br /&gt;
                  (The 1671 ports scanned but not shown below are in state: closed)&lt;br /&gt;
                  PORT     STATE SERVICE VERSION&lt;br /&gt;
                  22/tcp   open  ssh     OpenSSH 4.3 (protocol 2.0)&lt;br /&gt;
                  111/tcp  open  rpcbind  2 (rpc #100000)&lt;br /&gt;
                  3306/tcp open  mysql   MySQL (unauthorized)&lt;br /&gt;
&lt;br /&gt;
                  Nmap finished: 1 IP address (1 host up) scanned in 7.116 seconds&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 221:&lt;br /&gt;
&lt;br /&gt;
     openssl - Some common commands.&lt;br /&gt;
&lt;br /&gt;
             Finding the openssldir (Directory for OpenSSL files).&lt;br /&gt;
&lt;br /&gt;
                  $ openssl version -a|grep OPENSSLDIR&lt;br /&gt;
                  OPENSSLDIR: &amp;quot;/etc/pki/tls&amp;quot;&lt;br /&gt;
&lt;br /&gt;
             Connect to a secure SMTP server with STARTTLS, assuming the server name is&lt;br /&gt;
             squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
                  $ openssl s_client -connect squeezel.squeezel.com:25 -starttls&lt;br /&gt;
&lt;br /&gt;
         &lt;br /&gt;
&lt;br /&gt;
      Reference (http://www.madboa.com/geek/openssl/)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 222:&lt;br /&gt;
&lt;br /&gt;
     Bash functions. This is easy, and I find it very useful to create bash functions&lt;br /&gt;
     for repeated commands. For example, suppose you want to create a quick bash function&lt;br /&gt;
     to cd to /var/log, tail messages and tail secure. You can create this function as&lt;br /&gt;
     follows:&lt;br /&gt;
&lt;br /&gt;
                  [root@v5 log]# m()&lt;br /&gt;
                  m()&lt;br /&gt;
                  &amp;gt; { cd /var/log&lt;br /&gt;
                  { cd /var/log&lt;br /&gt;
                  &amp;gt; tail messages&lt;br /&gt;
                  tail messages&lt;br /&gt;
                  &amp;gt; tail secure&lt;br /&gt;
                  tail secure&lt;br /&gt;
                  &amp;gt; }&lt;br /&gt;
                  }&lt;br /&gt;
                  &lt;br /&gt;
     Above I'm typing m() then hitting return. Note the echo on the next line followed&lt;br /&gt;
     by the prompt &amp;gt;. I then enter {. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 223:&lt;br /&gt;
&lt;br /&gt;
     Stats on DNS Server. You can get stats on your DNS server. &lt;br /&gt;
&lt;br /&gt;
       The following works for BIND 9:&lt;br /&gt;
&lt;br /&gt;
                  $ rndc stats&lt;br /&gt;
&lt;br /&gt;
         On my system I see the output in &amp;quot;/var/named/chroot/var/named/data/named_stats.txt&amp;quot;, which&lt;br /&gt;
         if an FC4 system. By the way, if you're using BIND 8, the command is &amp;quot;ndc stats&amp;quot;, but that&lt;br /&gt;
         has a completely different format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Format of the output&lt;br /&gt;
&lt;br /&gt;
            +++ Statistics Dump +++ (1153791199)&lt;br /&gt;
            success 297621&lt;br /&gt;
            referral 32&lt;br /&gt;
            nxrrset 21953&lt;br /&gt;
            nxdomain 33742&lt;br /&gt;
            recursion 28243&lt;br /&gt;
            failure 54&lt;br /&gt;
            --- Statistics Dump --- (1153791199)&lt;br /&gt;
&lt;br /&gt;
      The number (1153791199) can be converted with the date command.&lt;br /&gt;
&lt;br /&gt;
                  $ date -d '1970-01-01 1153791199 sec'&lt;br /&gt;
                  Tue Jul 25 02:33:19 EDT 2006&lt;br /&gt;
&lt;br /&gt;
      That's 1153791199 seconds since 1970-01-01 UCT. Which is 4 hours fast,&lt;br /&gt;
      from EDT.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 224:&lt;br /&gt;
&lt;br /&gt;
     snmp - simple network monitoring protocol. The following steps setup snmp on Fedora Core 5.&lt;br /&gt;
&lt;br /&gt;
                  $ yum install net-snmp*&lt;br /&gt;
&lt;br /&gt;
         Next add the following line in &amp;quot;/etc/snmp/snmpd.conf&amp;quot; at the bottom.&lt;br /&gt;
&lt;br /&gt;
                  rocommunity pA33worD&lt;br /&gt;
&lt;br /&gt;
         Start the snmp service.&lt;br /&gt;
&lt;br /&gt;
                  $ /etc/init.d/snmpd restart&lt;br /&gt;
&lt;br /&gt;
         Once started, from the command prompt, it's possible to get stats on the computer.&lt;br /&gt;
&lt;br /&gt;
                  $ snmpwalk -v 1 -c pA33worD localhost system&lt;br /&gt;
         Or&lt;br /&gt;
                  $ snmpwalk -v 1 -c pA33worD localhost interface&lt;br /&gt;
&lt;br /&gt;
         Or&lt;br /&gt;
                  $ snmpgetnext -v 1 -c pA33worD localhost sysUpTime&lt;br /&gt;
                  DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (26452) 0:04:24.52&lt;br /&gt;
&lt;br /&gt;
         Note the Timeticks is in 100th of a second. So the computer above has been running&lt;br /&gt;
         for 264.52 seconds.&lt;br /&gt;
&lt;br /&gt;
         Reference( TIP 225 shows how to use MRTG for gathering snmp stats).&lt;br /&gt;
                  http://www.net-snmp.org/tutorial/tutorial-5/commands/snmpv3.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 225:&lt;br /&gt;
&lt;br /&gt;
     MRTG - Multi Router Traffic Grapher.  &lt;br /&gt;
&lt;br /&gt;
                  $ cfgmaker --output=/etc/mrtg/v5.squeezel.com \&lt;br /&gt;
                    ifref=ip --global &amp;quot;workdir:/var/www/html/mrtg/stats&amp;quot;\&lt;br /&gt;
                    pA33worD@v5.squeezel.com&lt;br /&gt;
&lt;br /&gt;
        Reference: http://www.chinalinuxpub.com/doc/www.siliconvalleyccie.com/linux-hn/mrtg.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 226:&lt;br /&gt;
&lt;br /&gt;
     Back Trace - This is a method of getting a back trace for all processes on the system.&lt;br /&gt;
                  it assumes the following: a. Kernel was build with CONFIG_MAGIC_SYS-REQ &lt;br /&gt;
                  enabled (which Fedora 5 kernels are) b. You can get direct access to the &lt;br /&gt;
                  monitor.&lt;br /&gt;
&lt;br /&gt;
             Step 1.&lt;br /&gt;
&lt;br /&gt;
                  Ctl-Alt-F1 (This brings you to the text console)&lt;br /&gt;
&lt;br /&gt;
             Step 2.&lt;br /&gt;
&lt;br /&gt;
                  Alt-ScrollLock &lt;br /&gt;
                  Ctl-ScrollLock&lt;br /&gt;
          &lt;br /&gt;
                  Note above that's Alt-ScrollLock followed by Ctl-ScrollLock. You should see&lt;br /&gt;
                  a lot of text on the screen. To fast to read, but don't worry the text will&lt;br /&gt;
                  be in /var/log/messages at the end.&lt;br /&gt;
&lt;br /&gt;
                  On my system the ScrollLock key is next to the NumLock key. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 227:&lt;br /&gt;
&lt;br /&gt;
     Ext3 Tuning - One advantage of Ext3 over Ext2 is directory indexing, which  imporves file&lt;br /&gt;
                  access in directories containing large files or when the directory contains&lt;br /&gt;
                  many files. Directory indexing improves performance by using hashed binary &lt;br /&gt;
                  trees. &lt;br /&gt;
&lt;br /&gt;
                  There are two ways to enable dir_index. First, find the device using the mount&lt;br /&gt;
                  command.&lt;br /&gt;
&lt;br /&gt;
                      $ mount&lt;br /&gt;
&lt;br /&gt;
                      /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)&lt;br /&gt;
                      proc on /proc type proc (rw)&lt;br /&gt;
                      sysfs on /sys type sysfs (rw)&lt;br /&gt;
                      devpts on /dev/pts type devpts (rw,gid=5,mode=620)&lt;br /&gt;
                      /dev/sda1 on /boot type ext3 (rw) &amp;lt;--- This is the one you want&lt;br /&gt;
                      tmpfs on /dev/shm type tmpfs (rw)&lt;br /&gt;
                      none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)&lt;br /&gt;
                      sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)&lt;br /&gt;
                      automount(pid2001) on /net type autofs (rw,fd=4,pgrp=2001,minproto=2,maxproto=4)                   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                  From the above command, the device used is /dev/sda1.  Using the tune2fs command,&lt;br /&gt;
                  directory indexing will only apply to directories created after running the &lt;br /&gt;
                  command below.               &lt;br /&gt;
&lt;br /&gt;
                       $ tune2fs -O dir_index /dev/sda1&lt;br /&gt;
&lt;br /&gt;
                  However, if you want it to apply to all directories, use the e2fsck command as  &lt;br /&gt;
                  shown below:&lt;br /&gt;
&lt;br /&gt;
                       $ e2fsck -D -f /dev/sda1&lt;br /&gt;
&lt;br /&gt;
                  You'll need to bypass the warning message.&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
     Reference: &amp;quot;Tuning Journaling File Systems: A small amount of effort an dtime can yield big&lt;br /&gt;
                results&amp;quot;,by Steve Best. Linux Magazine, September 10, 2006. This author as has&lt;br /&gt;
                a very good book titled: &amp;quot;Linux Debugging and Performance Tuning.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 228:&lt;br /&gt;
&lt;br /&gt;
     NIC bonding - binding two or more NICs to one IP address to improve performance. The following&lt;br /&gt;
                instructions were done on Fedora Core 5.&lt;br /&gt;
&lt;br /&gt;
         Step 1.&lt;br /&gt;
             &lt;br /&gt;
            Create the file ifcfg-bond0 with the IP address, netmask and gateway. Shown&lt;br /&gt;
            below is my file.&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-bond0&lt;br /&gt;
&lt;br /&gt;
                   DEVICE=bond0&lt;br /&gt;
                   IPADDR=192.168.1.12&lt;br /&gt;
                   NETMASK=255.255.255.0&lt;br /&gt;
                   GATEWAY=192.168.1.1&lt;br /&gt;
                   USERCTL=no&lt;br /&gt;
                   BOOTPROTO=none&lt;br /&gt;
                   ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
         Step 2.&lt;br /&gt;
&lt;br /&gt;
            Modify eth0, eth1 and eth2. Shown below are each one of my files. Note that&lt;br /&gt;
            you must comment out, or remove the ip address, netmask, gateway and hardware&lt;br /&gt;
            address from each one of these files, since settings should only come from&lt;br /&gt;
            the ifcfg-bond0 file above. I've chosen to comment out the lines, instead of &lt;br /&gt;
            removing, should I decide to unbond my NICS sometime in the future.&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth0&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:9D&lt;br /&gt;
                  #IPADDR=192.168.1.12&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  #GATEWAY=192.168.1.1&lt;br /&gt;
                  #USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  # Settings for Bond&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth1&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth1&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:C9&lt;br /&gt;
                  #IPADDR=192.168.1.13&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  #&lt;br /&gt;
                  # Settings for bonding&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth2&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth2&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:9D&lt;br /&gt;
                  #IPADDR=192.168.1.12&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  #GATEWAY=192.168.1.1&lt;br /&gt;
                  #USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
         Step 3.&lt;br /&gt;
&lt;br /&gt;
            Set the load parameters for bond0 bonding kernel module. Append the&lt;br /&gt;
            following lines to /etc/modprobe.conf &lt;br /&gt;
&lt;br /&gt;
                 # bonding commands &lt;br /&gt;
                 alias bond0 bonding&lt;br /&gt;
                 options bond0 mode=balance-alb miimon=100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Step 4.&lt;br /&gt;
&lt;br /&gt;
            Load the bond driver module from the command prompt.&lt;br /&gt;
&lt;br /&gt;
                 $ modprobe bonding&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Step 5.&lt;br /&gt;
&lt;br /&gt;
            Restart the network, or restart the computer. Note I restarted to computer,&lt;br /&gt;
            since my NICs above had MAC assignments.&lt;br /&gt;
&lt;br /&gt;
                 $ service network restart   # Or restart computer&lt;br /&gt;
&lt;br /&gt;
             Take a look at the proc settings. &lt;br /&gt;
&lt;br /&gt;
                 $ cat /proc/net/bonding/bond0 &lt;br /&gt;
                 Ethernet Channel Bonding Driver: v3.0.3 (March 23, 2006)&lt;br /&gt;
&lt;br /&gt;
                 Bonding Mode: adaptive load balancing&lt;br /&gt;
                 Primary Slave: None&lt;br /&gt;
                 Currently Active Slave: eth2&lt;br /&gt;
                 MII Status: up&lt;br /&gt;
                 MII Polling Interval (ms): 100&lt;br /&gt;
                 Up Delay (ms): 0&lt;br /&gt;
                 Down Delay (ms): 0&lt;br /&gt;
&lt;br /&gt;
                 Slave Interface: eth2&lt;br /&gt;
                 MII Status: up&lt;br /&gt;
                 Link Failure Count: 0&lt;br /&gt;
                 Permanent HW addr: 00:13:72:80:62:f0&lt;br /&gt;
            &lt;br /&gt;
     References:&lt;br /&gt;
&lt;br /&gt;
         http://www.cyberciti.biz/nixcraft/vivek/blogger/2006/04/linux-bond-or-team-multiple-network.php&lt;br /&gt;
          Good, well written article describing the steps above.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=24692&amp;amp;package_id=146474&lt;br /&gt;
          Documentation for bonding that can also be found in the kernel&lt;br /&gt;
          ./Documentation/networking/bonding.txt&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 229:&lt;br /&gt;
&lt;br /&gt;
     /etc/nsswitch.conf - System Databases and Name Service Switch configuration file. &lt;br /&gt;
&lt;br /&gt;
         This file determines lookup order of services. For example, to match a name&lt;br /&gt;
         to an IP address, an entry can be put into the /etc/hosts file. Or a DNS query&lt;br /&gt;
         can be made. What's the order?  Normally, it's the entry in the /etc/hosts file.&lt;br /&gt;
         because /etc/nsswitch.conf contains the following setting&lt;br /&gt;
        &lt;br /&gt;
            hosts:      files dns&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	 See man nsswitch.conf for more settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
THE FOLLOWING SECTIONS STARTS THE PROGRAMMING TIPS&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 1:&lt;br /&gt;
&lt;br /&gt;
     Simple open command that restarts the close if a signal&lt;br /&gt;
     occurs.  Also note, the POSIX standards committee decided&lt;br /&gt;
     all new functions would not use errno and would instead&lt;br /&gt;
     directly return the error number in the function.&lt;br /&gt;
&lt;br /&gt;
     A lot of functions return -1 on an error condition, then,&lt;br /&gt;
     set errno to the value of the error.  This will still work&lt;br /&gt;
     for all the well known functions; but, it's changing.&lt;br /&gt;
&lt;br /&gt;
     /* start of code open.c&lt;br /&gt;
        Compile gcc -o open open.c&lt;br /&gt;
&lt;br /&gt;
        Reference (Look for simple_but_common_x.x.x.tar.gz):&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79066&lt;br /&gt;
&lt;br /&gt;
                             */&lt;br /&gt;
     #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     #include &amp;lt;string.h&amp;gt;             /* for strerror(int errno) */&lt;br /&gt;
     #include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     #define BUFLEN 100&lt;br /&gt;
     extern int errno;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     int&lt;br /&gt;
     main (void)&lt;br /&gt;
     {&lt;br /&gt;
       int fp,error;&lt;br /&gt;
       char buf[BUFLEN+1];&lt;br /&gt;
&lt;br /&gt;
       if ((fp = open (&amp;quot;data&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1)&lt;br /&gt;
         {&lt;br /&gt;
           fprintf (stderr, &amp;quot;Can't open data: %s\n&amp;quot;, strerror (errno));&lt;br /&gt;
           return 1;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
       snprintf (buf, BUFLEN, &amp;quot;123&amp;quot;);&lt;br /&gt;
       write (fp, buf, strlen (buf));&lt;br /&gt;
&lt;br /&gt;
       // Restart close should a signal occur */&lt;br /&gt;
       while((( error = close (fp) ) == -1) &amp;amp;&amp;amp; (errno == EINTR));&lt;br /&gt;
       if(error == -1)&lt;br /&gt;
         perror(&amp;quot;Failed to close the file\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
       return 0;&lt;br /&gt;
      }&lt;br /&gt;
     /* end of open.c */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 2:&lt;br /&gt;
&lt;br /&gt;
     Example of setting the effective UID on a file&lt;br /&gt;
&lt;br /&gt;
     /*  start of code&lt;br /&gt;
       gcc uid_open.c -o uid_open&lt;br /&gt;
       su&lt;br /&gt;
       chown root.chirico uid_open&lt;br /&gt;
       chmod u+s uid_open&lt;br /&gt;
       exit&lt;br /&gt;
&lt;br /&gt;
       Now you can run this as chirico and write to the&lt;br /&gt;
       root directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     */&lt;br /&gt;
     #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;string.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     int main()&lt;br /&gt;
     {&lt;br /&gt;
             int fd;&lt;br /&gt;
&lt;br /&gt;
             if ((fd = open(&amp;quot;/root/datajunk&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1) {&lt;br /&gt;
                     fprintf(stderr, &amp;quot;Can't open file \n&amp;quot;);&lt;br /&gt;
                     return 1;&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
             write(fd, &amp;quot;0123456&amp;quot;, strlen(&amp;quot;0123456&amp;quot;));&lt;br /&gt;
             close(fd);&lt;br /&gt;
             return 0;&lt;br /&gt;
     }&lt;br /&gt;
&lt;br /&gt;
     /* end of code */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 3:&lt;br /&gt;
&lt;br /&gt;
     Writing a C http post.&lt;br /&gt;
&lt;br /&gt;
     For downloads reference:&lt;br /&gt;
      http://prdownloads.sourceforge.net/cpearls/spider.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 4:&lt;br /&gt;
&lt;br /&gt;
     Writing a 2.6.x Kernel Module:&lt;br /&gt;
&lt;br /&gt;
       Look for the latest version of &amp;quot;procreadwrite&amp;quot;.  This is a 2.6 kernel&lt;br /&gt;
       modules that demonstrates how to create /proc entires and write directly&lt;br /&gt;
       to user-land via tty.  It's updated to reflect replacement of &amp;quot;current-&amp;gt;tty&amp;quot;&lt;br /&gt;
       with &amp;quot;current-&amp;gt;signal-&amp;gt;tty&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79066&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 5:&lt;br /&gt;
&lt;br /&gt;
     Creating a filename with '\n'.  This goes with (TIP 71)&lt;br /&gt;
&lt;br /&gt;
         /**** topen.c ***********************************************************&lt;br /&gt;
           Filenames can be created with any character except the null character&lt;br /&gt;
           and a slash.&lt;br /&gt;
&lt;br /&gt;
           This example creates a file with returns '\n\n'&lt;br /&gt;
&lt;br /&gt;
           There's a way to remove a file by inode:&lt;br /&gt;
&lt;br /&gt;
               $ ls -libt *&lt;br /&gt;
&lt;br /&gt;
           And, once you know the inode&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec mv '{}' goodstuff \;&lt;br /&gt;
&lt;br /&gt;
           or&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec rm '{}' goodstuff \;&lt;br /&gt;
&lt;br /&gt;
           or&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec cat '{}' \;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Compile:&lt;br /&gt;
&lt;br /&gt;
             gcc -o topen -Wall -W -O2 -s -pipe  topen.c&lt;br /&gt;
&lt;br /&gt;
         Reference:&lt;br /&gt;
           http://prdownloads.sourceforge.net/cpearls/simple_but_common_0.0.14.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
         */&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         #include &amp;lt;string.h&amp;gt;             /* for strerror(int errno) */&lt;br /&gt;
         #include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         #define BUFLEN 100&lt;br /&gt;
         extern int errno;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         int&lt;br /&gt;
         main (void)&lt;br /&gt;
         {&lt;br /&gt;
           int fp,error;&lt;br /&gt;
           char buf[BUFLEN+1];&lt;br /&gt;
&lt;br /&gt;
           if ((fp = open (&amp;quot;\n\n\n\n\n\n\n\n\n&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1)&lt;br /&gt;
             {&lt;br /&gt;
               fprintf (stderr, &amp;quot;Can't open data: %s\n&amp;quot;, strerror (errno));&lt;br /&gt;
               return 1;&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
           snprintf (buf, BUFLEN, &amp;quot;123&amp;quot;);&lt;br /&gt;
           write (fp, buf, strlen (buf));&lt;br /&gt;
&lt;br /&gt;
           // Restart close should a signal occur */&lt;br /&gt;
           while((( error = close (fp) ) == -1) &amp;amp;&amp;amp; (errno == EINTR));&lt;br /&gt;
           if(error == -1)&lt;br /&gt;
             perror(&amp;quot;Failed to close the file\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
           return 0;&lt;br /&gt;
&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  **Note, if you want email notification after every 50 new tips have been&lt;br /&gt;
    added, then, click on the following link:&lt;br /&gt;
&lt;br /&gt;
     https://sourceforge.net/project/filemodule_monitor.php?filemodule_id=120838&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 6:&lt;br /&gt;
&lt;br /&gt;
     Working With The Lemon Parser Generator.&lt;br /&gt;
     http://prdownloads.sourceforge.net/souptonuts/lemon_examples.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 7:&lt;br /&gt;
&lt;br /&gt;
     copy command for std container output.&lt;br /&gt;
&lt;br /&gt;
        #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
        #include &amp;lt;list&amp;gt;&lt;br /&gt;
        #include &amp;lt;vector&amp;gt;&lt;br /&gt;
        #include &amp;lt;iterator&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        using namespace std;&lt;br /&gt;
        int main(void)&lt;br /&gt;
        {&lt;br /&gt;
          vector&amp;lt;int&amp;gt; v;&lt;br /&gt;
          list&amp;lt;int&amp;gt; l;&lt;br /&gt;
&lt;br /&gt;
          v.push_back(1);&lt;br /&gt;
          v.push_back(2);&lt;br /&gt;
          copy(v.begin(),v.end(),ostream_iterator&amp;lt;int&amp;gt;(cout,&amp;quot;\n&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          l.push_back(23);&lt;br /&gt;
          l.push_back(12);&lt;br /&gt;
          copy(l.begin(),l.end(),ostream_iterator&amp;lt;int&amp;gt;(cout,&amp;quot;\n&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 8:&lt;br /&gt;
&lt;br /&gt;
  /* Copyright (c) 2005 Mike Chirico mchirico@comcast.net mchirico@users.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Example of using virtual functions. Note the use of &amp;quot;initialization lists&amp;quot;&lt;br /&gt;
              for assinging the variable first and last.&lt;br /&gt;
&lt;br /&gt;
      Compile:&lt;br /&gt;
        g++ -o virtualfunc -Wall -W -O2 -s -pipe  virtual_function.cc&lt;br /&gt;
&lt;br /&gt;
      Download:&lt;br /&gt;
        http://prdownloads.sourceforge.net/cpearls/simple_but_common_cpp.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  */&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
  #include &amp;lt;string&amp;gt;&lt;br /&gt;
  #include &amp;lt;list&amp;gt;&lt;br /&gt;
  #include &amp;lt;algorithm&amp;gt;&lt;br /&gt;
  #include &amp;lt;iterator&amp;gt;&lt;br /&gt;
  #include &amp;lt;functional&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  using namespace std;&lt;br /&gt;
&lt;br /&gt;
  class Employee {&lt;br /&gt;
  string first,last;&lt;br /&gt;
  public:&lt;br /&gt;
    Employee(const string&amp;amp; fn=&amp;quot;John&amp;quot;,const  string&amp;amp; ln=&amp;quot;Smith&amp;quot;): first(fn),last(ln) {}&lt;br /&gt;
    virtual void print() const {&lt;br /&gt;
    cout &amp;lt;&amp;lt; &amp;quot;First name: &amp;quot; &amp;lt;&amp;lt; first &amp;lt;&amp;lt; &amp;quot;, Last name: &amp;quot; &amp;lt;&amp;lt; last &amp;lt;&amp;lt; endl;&lt;br /&gt;
    }&lt;br /&gt;
    virtual ~Employee() {}&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  class Manager : public Employee {&lt;br /&gt;
    int level;&lt;br /&gt;
    list&amp;lt;Employee*&amp;gt; subordinates;&lt;br /&gt;
  public:&lt;br /&gt;
    Manager(const string&amp;amp; fn=&amp;quot;Ivan&amp;quot;,const string&amp;amp; ln=&amp;quot;Stedwick&amp;quot;, int lvl=1): Employee(fn,ln), level(lvl) {}&lt;br /&gt;
    void print() {&lt;br /&gt;
      cout &amp;lt;&amp;lt; &amp;quot;Manager level: &amp;quot; &amp;lt;&amp;lt; level &amp;lt;&amp;lt; &amp;quot;  &amp;quot;;&lt;br /&gt;
      Employee::print();&lt;br /&gt;
      cout &amp;lt;&amp;lt; &amp;quot;Supervises:&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
      for_each(subordinates.begin(),subordinates.end(),mem_fun(&amp;amp;Employee::print));&lt;br /&gt;
      cout &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; endl;&lt;br /&gt;
    }&lt;br /&gt;
    void addstaff(Employee&amp;amp; staff){&lt;br /&gt;
      subordinates.push_front(&amp;amp;staff);&lt;br /&gt;
    }&lt;br /&gt;
    void addstaff(Employee* staff){&lt;br /&gt;
      subordinates.push_front(staff);&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   int main()&lt;br /&gt;
   {&lt;br /&gt;
     Employee p0(&amp;quot;Lisa&amp;quot;,&amp;quot;Payne&amp;quot;);&lt;br /&gt;
     Manager m0;&lt;br /&gt;
&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Zoe&amp;quot;,&amp;quot;Bear&amp;quot;)); /* uses void addstaff(Employee* staff) */&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Leah&amp;quot;,&amp;quot;Bopper&amp;quot;));&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Abby&amp;quot;,&amp;quot;Chicken&amp;quot;));&lt;br /&gt;
     m0.addstaff(p0);  /* void addstaff(Employee&amp;amp; staff)  needed for this one */&lt;br /&gt;
     m0.addstaff(new Employee());&lt;br /&gt;
     m0.print();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     return 0;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 9:&lt;br /&gt;
&lt;br /&gt;
   /*  Named Constructor Idiom.&lt;br /&gt;
       Reference: http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.6&lt;br /&gt;
&lt;br /&gt;
   */&lt;br /&gt;
   #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
   #include &amp;lt;cmath&amp;gt;&lt;br /&gt;
   using namespace std;&lt;br /&gt;
&lt;br /&gt;
   class Point {&lt;br /&gt;
&lt;br /&gt;
   public:&lt;br /&gt;
     static Point rectangular(float x, float y);&lt;br /&gt;
     static Point polar(float radius, float angle);&lt;br /&gt;
     float get_x() { return x_; }&lt;br /&gt;
     float get_y() { return y_; }&lt;br /&gt;
&lt;br /&gt;
   private:&lt;br /&gt;
     Point(float x, float y);&lt;br /&gt;
     float x_, y_;&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
   inline Point::Point(float x, float y)&lt;br /&gt;
     : x_(x), y_(y) {}&lt;br /&gt;
&lt;br /&gt;
   inline Point Point::rectangular(float x, float y)&lt;br /&gt;
   { return Point(x,y); }&lt;br /&gt;
&lt;br /&gt;
   inline Point Point::polar(float radius, float angle)&lt;br /&gt;
   { return Point(radius*cos(angle),radius*sin(angle)); }&lt;br /&gt;
&lt;br /&gt;
   int main(void)&lt;br /&gt;
   {&lt;br /&gt;
     Point p1 = Point::rectangular(5.7,1.2);&lt;br /&gt;
     Point p2 = Point::polar(5.7,1.2);&lt;br /&gt;
&lt;br /&gt;
     cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; p1.get_x() &amp;lt;&amp;lt; &amp;quot;, &amp;quot; &amp;lt;&amp;lt; p1.get_y() &amp;lt;&amp;lt; &amp;quot;)&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
     cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; p2.get_x() &amp;lt;&amp;lt; &amp;quot;, &amp;quot; &amp;lt;&amp;lt; p2.get_y() &amp;lt;&amp;lt; &amp;quot;)&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 10:&lt;br /&gt;
&lt;br /&gt;
   /* Copy_constructor_assignment.cc&lt;br /&gt;
      Copyright (c) 2004 GPL Mike Chirico, mchirico@comcast.net or mchirico@users.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
      Reference: &amp;quot;The C++ Programming Language&amp;quot;, 3rd ed, by Stroustrup&lt;br /&gt;
      pg. 246.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Download:&lt;br /&gt;
      http://prdownloads.sourceforge.net/cpearls/simple_but_common.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
   */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   class Name {&lt;br /&gt;
   public:&lt;br /&gt;
     char* s;&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   class Table {&lt;br /&gt;
     Name *p;&lt;br /&gt;
     size_t sz;&lt;br /&gt;
   public:&lt;br /&gt;
     Table(size_t s=15) {&lt;br /&gt;
               p = new Name[sz=s];&lt;br /&gt;
               for(size_t i=0; i&amp;lt; sz; ++i) p[i].s=&amp;quot;****&amp;quot;;&lt;br /&gt;
                          }&lt;br /&gt;
     Table(const Table &amp;amp;t);&lt;br /&gt;
     Table&amp;amp; operator=(const Table&amp;amp;);&lt;br /&gt;
     int prt();&lt;br /&gt;
     void asgn(char* ts,size_t index);&lt;br /&gt;
     ~Table(){ delete[] p; }&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Table&amp;amp; Table::operator=(const Table &amp;amp;t)&lt;br /&gt;
   {&lt;br /&gt;
     if( this != &amp;amp;t) {&lt;br /&gt;
       delete[] p;&lt;br /&gt;
       p = new Name[sz=t.sz];&lt;br /&gt;
       for(size_t i=0; i&amp;lt; t.sz; ++i) p[i]=t.p[i];&lt;br /&gt;
     }&lt;br /&gt;
     return *this;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   int Table::prt()&lt;br /&gt;
   {&lt;br /&gt;
     for(size_t i=0; i&amp;lt; sz; ++i) std::cout &amp;lt;&amp;lt; p[i].s &amp;lt;&amp;lt; &amp;quot; &amp;quot;;&lt;br /&gt;
     std::cout &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
     return 0;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   /*&lt;br /&gt;
     asgn will increase the array of strings, if needed&lt;br /&gt;
     to size index+1, and add the string ts to position&lt;br /&gt;
     index.&lt;br /&gt;
   */&lt;br /&gt;
   void Table::asgn(char* ts,size_t index)&lt;br /&gt;
   {&lt;br /&gt;
     if(index &amp;lt; sz ) {&lt;br /&gt;
        p[index].s=ts;&lt;br /&gt;
     }else if ( index &amp;gt;= sz ){&lt;br /&gt;
        Name *tp;&lt;br /&gt;
        tp=p;&lt;br /&gt;
&lt;br /&gt;
        p = new Name[index+1];&lt;br /&gt;
&lt;br /&gt;
        for(size_t i=0; i&amp;lt; sz; ++i) p[i].s=tp[i].s;&lt;br /&gt;
        delete [] tp;&lt;br /&gt;
        for(size_t i=sz; i &amp;lt; index; ++i)p[i].s=&amp;quot;****&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
        p[index].s=ts;&lt;br /&gt;
        sz=index+1;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   int main(void)&lt;br /&gt;
   {&lt;br /&gt;
&lt;br /&gt;
     Table t1;&lt;br /&gt;
     Table t2(5);&lt;br /&gt;
&lt;br /&gt;
     // this is bigger than initial sz&lt;br /&gt;
     t1.asgn(&amp;quot;myname&amp;quot;,20);&lt;br /&gt;
     t1.prt();&lt;br /&gt;
     t2.prt();&lt;br /&gt;
&lt;br /&gt;
     t1=t2;&lt;br /&gt;
&lt;br /&gt;
     t1.prt();&lt;br /&gt;
     t2.prt();&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REFERENCES:&lt;br /&gt;
&lt;br /&gt;
  (1)  http://www.tldp.org/LDP/abs/html/index.html&lt;br /&gt;
  (2)  http://www.shelldorado.com/&lt;br /&gt;
  (3)  http://www.faqs.org/ftp/usenet/news.answers/unix-faq/faq/part1&lt;br /&gt;
  (4)  http://www-106.ibm.com/developerworks/library/l-rpm1/&lt;br /&gt;
  (5)  http://www-136.ibm.com/developerworks/linux/&lt;br /&gt;
  (6)  http://www.gnu.org/manual/manual.html&lt;br /&gt;
  (7)  http://fedora.redhat.com/&lt;br /&gt;
  (8)  http://souptonuts.sourceforge.net/chirico/index.php&lt;br /&gt;
  (9)  http://www.faqs.org/faqs/&lt;br /&gt;
 (10)  http://www.faqs.org/docs/linux_network/&lt;br /&gt;
 (11)  http://www.tml.hut.fi/~viu/linux/sag/sag-0.6.2.html/index.html&lt;br /&gt;
 (12)  http://www.yolinux.com/TUTORIALS/LinuxTutorialSysAdmin.html&lt;br /&gt;
 (13)  http://sed.sourceforge.net/grabbag/scripts/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  SUMMARY:&lt;br /&gt;
   (1)(2)(3) Excellent resource for bash scripts.&lt;br /&gt;
   (4)       rpm resource&lt;br /&gt;
   (6)       GNU Manuals Online&lt;br /&gt;
   (7)       Fedora&lt;br /&gt;
   (8)       Authors Website&lt;br /&gt;
   (11)(12)  System Admin&lt;br /&gt;
   (13)      Excellent source of sed scripts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
HIGHLY RECOMMENDED BOOKS:&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX Network Programming, The Sockets Networking API&amp;quot;, Volume 1, Third Edition.&lt;br /&gt;
        W. Richard Stevens, Bill Fenner, Andrew M. Rudoff.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX Network Programming, Interprocess Communications&amp;quot;, Volume 2, Second Edition.&lt;br /&gt;
        W. Richard Stevens.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX SYSTEMS Programming, Communication, Concurrency, and Threads&amp;quot;, Kay A. Robbins,&lt;br /&gt;
        Steven Robbins&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming with POSIX Threads&amp;quot;, David R. Butenhof. Addison-Wesley&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;The C++ Programming Language&amp;quot; Third Edition. Bjarne Stroustrup. Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C Programming Language&amp;quot; (2nd Edition), Second Edition, Kernighan and Ritchie&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Advanced Linux Programming&amp;quot; by Mark Mitchell, Jeffrey Oldham, and Alex Samuel, of&lt;br /&gt;
        CodeSourcery LL. This book if free at the following resource:&lt;br /&gt;
        http://www.advancedlinuxprogramming.com/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Accelerated C++, Practical Programming by Example&amp;quot; Andrew Koenig, Barbara E. Moo.&lt;br /&gt;
        Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C: A Reference Manual&amp;quot;, Fifth Edition, Samuel P. Harbison, Guy L. Steele.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Standard Library: A Tutorial and Reference, The&amp;quot;, Nicolai M. Josuttis. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Templates: The Complete Guide&amp;quot;, David Vandevoorde, Nicolai M. Josuttis. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Exceptional C++: 47 Engineering Puzzles, Programming Problems, and Solutions&amp;quot;, Herb Sutter.&lt;br /&gt;
     Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;More Exceptional C++&amp;quot;, Herb Sutter.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Exceptional C++ Style: 40 New Engineering Puzzles, Programming Problems, and Solutions&amp;quot;,&lt;br /&gt;
       Herb Sutter. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;The Art of Computer Programming (TAOCP)&amp;quot;, Vol 1,Vol 2, Vol 3. Donald E. Knuth. Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming Perl, 3rd Edition&amp;quot;, Tom Christiansen, Jon Orwant, Larry Wall. O'Reilly.&lt;br /&gt;
       http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming from the Ground Up&amp;quot;, Jonathan Bartlett, Edited by Dominick Bruno, Jr.&lt;br /&gt;
       http://savannah.nongnu.org/download/pgubook/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Expert C Programming&amp;quot;, Peter van der Linden, Prentice Hall PTR.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Coding Standards 101 Rules, Guidelines, and Best Practices&amp;quot;, by Herb Sutter and&lt;br /&gt;
       Andrei Alexandrescu.  http://www.gotw.ca/publications/c++cs/bibliography.htm&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Linux Kernel Development: A practical guide to the design and implementation of&lt;br /&gt;
       the Linux kernel&amp;quot;, by Robert Love, Sams Publishing.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond&amp;quot;, by&lt;br /&gt;
       David Abrahams and Aleksey Gurtovoy. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
HIGHLY RECOMMENDED: PHILOSOPHICAL&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;Zen and the Art of Motorcycle Maintenance: An Inquiry into Values&amp;quot;, Robert Pirsig.&lt;br /&gt;
        http://www.virtualschool.edu/mon/Quality/PirsigZen/index.html&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;Lila: An Inquiry Into Morals&amp;quot;, Robert Pirsig.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RECOMMENDED BOOKS:&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Structure and Interpretation of Computer Programs&amp;quot;, Harold Abelson, Gerald Jay Sussman,&lt;br /&gt;
      Julie Sussman. This book is free:&lt;br /&gt;
        http://mitpress.mit.edu/sicp/full-text/book/book.html&lt;br /&gt;
              and&lt;br /&gt;
        http://www.gnu.org/software/mit-scheme/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RECOMMENDED HOTOS:&lt;br /&gt;
&lt;br /&gt;
    Linux Networking-HOWTO (Previously the Net-3 Howto)&lt;br /&gt;
     http://en.tldp.org/HOWTO/NET3-4-HOWTO.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CORRECTIONS:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following people made suggestions and corrections:&lt;br /&gt;
  - Jorge Fabregas &amp;lt;fabregasj@prtc.net&amp;gt; TIP 21&lt;br /&gt;
  - Malcolm Parsons &amp;lt;malcolm.parsons@gmail.com&amp;gt; TIP 44&lt;br /&gt;
  - Andreas Haunschmidt &amp;lt;Andreas.Haunschmidt@utanet.at&amp;gt; TIP 102, TIP 90&lt;br /&gt;
  - P@draigBrady.com (Following links )&lt;br /&gt;
  - Jacques.GARNIER-EXTERIEUR@EU.RHODIA.COM TIP 46&lt;br /&gt;
&lt;br /&gt;
                http://www.pixelbeat.org/cmdline.html&lt;br /&gt;
                http://www.pixelbeat.org/rotagator/linux.tips/rotagator.fortune&lt;br /&gt;
                http://www.pixelbeat.org/scripts/&lt;br /&gt;
&lt;br /&gt;
  - Tobias Nix &amp;lt;tobias.nix@gmail.com&amp;gt; TIP 12&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>C4tboCcdro</name></author>	</entry>

	<entry>
		<id>https://wiki.gacq.com/index.php?title=Linux_tips&amp;diff=2765</id>
		<title>Linux tips</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacq.com/index.php?title=Linux_tips&amp;diff=2765"/>
				<updated>2009-01-10T13:32:33Z</updated>
		
		<summary type="html">&lt;p&gt;C4tboCcdro: http://bukgetert.0lx.net/article-1659.htm&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://bukgetert.0lx.net/article-1659.htm skinny dipping videos] [http://ettaelt.strefa.pl/news-1716.html actor male movie] [http://mahohmie.qsh.eu/resource776.htm quotes from the movie stick it] [http://zelfibu.strefa.pl/korolald-1009.html movie online show tv watch] [http://acsitzar.0lx.net/news-jennifer-aniston-2008-11-10.html jennifer aniston video clip] &lt;br /&gt;
[http://bukgetert.0lx.net/article-287.htm sad movies always make me cry] [http://tarobasal.strefa.pl/sitemap.htm webmap] [http://betheres.qsh.eu/comment-141.htm revolutionary war movies] [http://dronoubr.0lx.net/angelina-antonio.html angelina antonio banderas jolie video] [http://mahohmie.qsh.eu/resource1532.htm new realeased movies] &lt;br /&gt;
[http://huruple.qsh.eu/20081227-sara-jay-xxx.htm sara jay xxx movie] [http://naceceli.qsh.eu/sitemap.html link] [http://huruple.qsh.eu/20090105-adc-video-patch.htm adc video patch panel] [http://tulilre.strefa.pl/2008-12-27-imovie-5-download.html imovie 5 download] [http://faquafav.is-the-boss.com/text-545.htm pinnacle studio 9.0 serial] &lt;br /&gt;
[http://mahohmie.qsh.eu/resource1805.htm spongebob tv movie character toy] [http://fademon.0lx.net/article-1434.htm put music videos on your psp for free] [http://acsitzar.0lx.net/news-joes-movies-2008-11-12.html joes movies] [http://caraines.qsh.eu/defanele.htm iran movie] [http://betheres.qsh.eu/comment-180.htm movie prime cut] &lt;br /&gt;
[http://caraines.qsh.eu/zelgolg.htm amc movie .com] [http://caraines.qsh.eu/zmexplnrb.htm ejaculate galleries.squirting video] [http://spfortne.qsh.eu/20081226-adult-alyssa.html adult alyssa milano movie] [http://lofaako.strefa.pl/sitemap.html map] [http://caraines.qsh.eu/caelttro.htm anne curtis video scandal download] &lt;br /&gt;
[http://zelgetgo.0lx.net/sitemap.htm url] [http://relquaca.is-the-boss.com/20090104-lanhound-serial.html lanhound serial number] [http://bukgetert.0lx.net/article-28.htm sitemap] [http://fispruil.qsh.eu/news1763.html she will be loved video cast maroon 5] [http://bukgetert.0lx.net/article-52.htm make a movie screen] &lt;br /&gt;
[http://lifokdron.0lx.net/1739.html michael thriller video] [http://huruple.qsh.eu/20090101-interracial-video.htm interracial video tgp] [http://relquaca.is-the-boss.com/20090103-password-stealer.html password stealer crack] [http://acsitzar.0lx.net/news-most-wanted-2008-11-17.html most wanted movie] [http://vihencbr.0lx.net/secure-video.html secure video chat] &lt;br /&gt;
[http://acsitzar.0lx.net/news-jethro-tull-videos-2008-11-19.html jethro tull videos] [http://bukgetert.0lx.net/sitemap.htm links] [http://lifokdron.0lx.net/504.html movie theater in virginia] [http://flheddin.qsh.eu/brfadron-453.html motivational military videos] [http://sematild.qsh.eu/resource322.htm real player video codecs] &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Mike Chirico (mchirico@users.sourceforge.net) or (mchirico@comcast.net)&lt;br /&gt;
Copyright (C) 2004 (GNU Free Documentation License)&lt;br /&gt;
Last Updated: Thu Dec 28 16:42:50 EST 2006&lt;br /&gt;
&lt;br /&gt;
The latest version of this document can be found at:&lt;br /&gt;
http://souptonuts.sourceforge.net/how_to_linux_and_open_source.htm&lt;br /&gt;
  or text version ( if you have trouble downloading the full document: over 140 pages )&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/How_to_Linux_and_Open_Source.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on Gmail with Postix and Fetchmail&lt;br /&gt;
http://souptonuts.sourceforge.net/postfix_tutorial.html&lt;br /&gt;
&lt;br /&gt;
For tips on using SQLite (over 25 pages)&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_sqlite_tutorial.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on MySQL reference:&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_mysql.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For a recommended reading list&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/Recommended_Reading.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on upgrading RedHat 9 or 8.0 to 2.6.x src kernel&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_26.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on Comcast Email with Home Linux Box&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_COMCAST_EMAIL.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  **Note, if you want email notification after every 50 new tips have been&lt;br /&gt;
    added, then, click on the following link:&lt;br /&gt;
     https://sourceforge.net/project/filemodule_monitor.php?filemodule_id=120838&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 1:&lt;br /&gt;
&lt;br /&gt;
     Is NTP Working?&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Test the current server):&lt;br /&gt;
&lt;br /&gt;
          Try issuing the following command:&lt;br /&gt;
&lt;br /&gt;
          $ ntpq -pn&lt;br /&gt;
&lt;br /&gt;
           remote refid st t when poll reach delay offset jitter&lt;br /&gt;
           ===================================================&lt;br /&gt;
           tock.usno.navy 0.0.0.0 16 u - 64 0 0.000 0.000 4000.00&lt;br /&gt;
&lt;br /&gt;
          The above is an example of a problem.&lt;br /&gt;
          Compare it to a working configuration.&lt;br /&gt;
&lt;br /&gt;
          $ ntpq -pn&lt;br /&gt;
&lt;br /&gt;
           remote refid st t when poll reach delay offset jitter&lt;br /&gt;
           ========================================================&lt;br /&gt;
           +128.4.40.12 128.4.40.10 2 u 107 128 377 25.642 3.350 1.012&lt;br /&gt;
           127.127.1.0 127.127.1.0 10 l 40 64 377 0.000 0.000 0.008&lt;br /&gt;
           +128.91.2.13 128.4.40.12 3 u 34 128 377 21.138 6.118 0.398&lt;br /&gt;
           *192.5.41.41 .USNO. 1 u 110 128 377 33.69 9.533 3.534&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Configure the /etc/ntp.conf):&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/ntp.conf&lt;br /&gt;
&lt;br /&gt;
            # My simple client-only ntp configuration.&lt;br /&gt;
            server timeserver1.upenn.edu&lt;br /&gt;
            # ping -a timeserver1.upenn.edu shows the IP address 128.91.2.13&lt;br /&gt;
            # which is used in the restrict below&lt;br /&gt;
            restrict 128.91.2.13&lt;br /&gt;
            server tock.usno.navy.mil&lt;br /&gt;
            restrict 192.5.41.41&lt;br /&gt;
            server 128.4.40.12&lt;br /&gt;
            restrict 128.4.40.12&lt;br /&gt;
            server 127.127.1.0 # local clock&lt;br /&gt;
            fudge 127.127.1.0 stratum 10&lt;br /&gt;
            driftfile /etc/ntp/drift&lt;br /&gt;
            restrict default ignore&lt;br /&gt;
            restrict 127.0.0.0 mask 255.0.0.0&lt;br /&gt;
            authenticate no&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Configure /etc/ntp/step-tickers):&lt;br /&gt;
&lt;br /&gt;
          The values for server above are placed in the &amp;quot;/etc/ntp/step-tickers&amp;quot; file&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/ntp/step-tickers&lt;br /&gt;
&lt;br /&gt;
              timeserver1.upenn.edu&lt;br /&gt;
              tock.usno.navy.mil&lt;br /&gt;
              128.4.40.12&lt;br /&gt;
&lt;br /&gt;
          The startup script /etc/rc.d/init.d/ntpd will grab the servers in this&lt;br /&gt;
          file and execute the ntpdate command as follows:&lt;br /&gt;
&lt;br /&gt;
             /usr/sbin/ntpdate -s -b -p 8 timeserver1.upenn.edu&lt;br /&gt;
&lt;br /&gt;
          Why? Because if the time is off ntpd will not start. The command above set the&lt;br /&gt;
          clock. If System Time deviates from true time by more than 1000 seconds, then,&lt;br /&gt;
          the ntpd daemon  will enter panic mode and exit.&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Restart the service and check):&lt;br /&gt;
&lt;br /&gt;
          Issue the restart command&lt;br /&gt;
&lt;br /&gt;
            /etc/init.d/ntpd restart&lt;br /&gt;
&lt;br /&gt;
          check the values for &amp;quot;ntpq -pn&amp;quot;,&lt;br /&gt;
          which should match step 1.&lt;br /&gt;
&lt;br /&gt;
             ntpq -pn&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE:&lt;br /&gt;
&lt;br /&gt;
          Time is always stored in the kernel as the number of seconds since&lt;br /&gt;
          midnight of the 1st of January 1970 UTC, regardless of whether the&lt;br /&gt;
          hardware clock is stored as UTC or not.  Conversions to local time&lt;br /&gt;
          are done at run-time. So, it's easy to get the time in different&lt;br /&gt;
          timezones for only the current session as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ export TZ=EST&lt;br /&gt;
              $ date&lt;br /&gt;
              Mon Aug  2 10:34:04 EST 2004&lt;br /&gt;
&lt;br /&gt;
              $ export TZ=NET&lt;br /&gt;
              $ date&lt;br /&gt;
              Mon Aug  2 15:34:18 NET 2004&lt;br /&gt;
&lt;br /&gt;
          The following are possible values for TZ:&lt;br /&gt;
&lt;br /&gt;
              Hours From Greenwich Mean Time (GMT) Value Description&lt;br /&gt;
              0 GMT Greenwich Mean Time&lt;br /&gt;
              +1 ECT European Central Time&lt;br /&gt;
              +2 EET European Eastern Time&lt;br /&gt;
              +2 ART&lt;br /&gt;
              +3 EAT Saudi Arabia&lt;br /&gt;
              +3.5 MET Iran&lt;br /&gt;
              +4 NET&lt;br /&gt;
              +5 PLT West Asia&lt;br /&gt;
              +5.5 IST India&lt;br /&gt;
              +6 BST Central Asia&lt;br /&gt;
              +7 VST Bangkok&lt;br /&gt;
              +8 CTT China&lt;br /&gt;
              +9 JST Japan&lt;br /&gt;
              +9.5 ACT Central Australia&lt;br /&gt;
              +10 AET Eastern Australia&lt;br /&gt;
              +11 SST Central Pacific&lt;br /&gt;
              +12 NST New Zealand&lt;br /&gt;
              -11 MIT Samoa&lt;br /&gt;
              -10 HST Hawaii&lt;br /&gt;
              -9 AST Alaska&lt;br /&gt;
              -8 PST Pacific Standard Time&lt;br /&gt;
              -7 PNT Arizona&lt;br /&gt;
              -7 MST Mountain Standard Time&lt;br /&gt;
              -6 CST Central Standard Time&lt;br /&gt;
              -5 EST Eastern Standard Time&lt;br /&gt;
              -5 IET Indiana East&lt;br /&gt;
              -4 PRT Atlantic Standard Time&lt;br /&gt;
              -3.5 CNT Newfoundland&lt;br /&gt;
              -3 AGT Eastern South America&lt;br /&gt;
              -3 BET Eastern South America&lt;br /&gt;
              -1 CAT Azores&lt;br /&gt;
&lt;br /&gt;
              DST timezone&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              0      BST for British Summer.&lt;br /&gt;
              +400   ADT for Atlantic Daylight.&lt;br /&gt;
              +500   EDT for Eastern Daylight.&lt;br /&gt;
              +600   CDT for Central Daylight.&lt;br /&gt;
              +700   MDT for Mountain Daylight.&lt;br /&gt;
              +800   PDT for Pacific Daylight.&lt;br /&gt;
              +900   YDT for Yukon Daylight.&lt;br /&gt;
              +1000  HDT for Hawaii Daylight.&lt;br /&gt;
              -100   MEST for Middle European Summer,&lt;br /&gt;
                         MESZ for Middle European Summer,&lt;br /&gt;
                         SST for Swedish Summer and FST for French Summer.&lt;br /&gt;
              -700   WADT for West Australian Daylight.&lt;br /&gt;
              -1000  EADT for Eastern Australian Daylight.&lt;br /&gt;
              -1200  NZDT for New Zealand Daylight.&lt;br /&gt;
&lt;br /&gt;
     The following is an example of setting the TZ environment variable&lt;br /&gt;
     for the timezone, only when timezone changes go into effect.&lt;br /&gt;
&lt;br /&gt;
               $ export TZ=EST+5EDT,M4.1.0/2,M10.5.0/2&lt;br /&gt;
&lt;br /&gt;
     Take a look at the last line &amp;quot;M10.5.0/2&amp;quot;. What does it mean? Here is the&lt;br /&gt;
     documentation&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Mm.w.d This  specifies  day  d (0 &amp;lt;= d &amp;lt;= 6) of week w (1 &amp;lt;= w &amp;lt;= 5) of&lt;br /&gt;
              month m (1 &amp;lt;= m &amp;lt;= 12).  Week 1 is the first week in which day d&lt;br /&gt;
              occurs and week 5 is the last week in which day d occurs.  Day 0&lt;br /&gt;
              is a Sunday.&lt;br /&gt;
&lt;br /&gt;
              The time fields specify when, in the local time  currently  in&lt;br /&gt;
              effect, the  change  to  the  other  time  occurs.   If omitted,&lt;br /&gt;
              the default is  02:00:00.&lt;br /&gt;
&lt;br /&gt;
      So this is what it means. M10 stands for October, the 5 is the fifth week&lt;br /&gt;
      that includes a Sunday (note 0 in M10.5.0/2 is Sunday). To see that it is&lt;br /&gt;
      the fifth week see the calendar below. The time change occurs a 2am in&lt;br /&gt;
      the morning.&lt;br /&gt;
&lt;br /&gt;
                                October&lt;br /&gt;
                         Su Mo Tu We Th Fr Sa&lt;br /&gt;
                                         1  2&lt;br /&gt;
                          3  4  5  6  7  8  9&lt;br /&gt;
                         10 11 12 13 14 15 16&lt;br /&gt;
                         17 18 19 20 21 22 23&lt;br /&gt;
                         24 25 26 27 28 29 30&lt;br /&gt;
                         31&lt;br /&gt;
&lt;br /&gt;
       Prove it. Take the following program sunrise, which can calcuates sunrise&lt;br /&gt;
       and sunset for an latitude and longitude. This program can be downloaded&lt;br /&gt;
       from the following location:&lt;br /&gt;
           http://sourceforge.net/direct-dl/mchirico/souptonuts/working_with_time.tar.gz&lt;br /&gt;
&lt;br /&gt;
       Below is a bash script that will run the program for the next 100 days.&lt;br /&gt;
&lt;br /&gt;
          #!/bin/bash&lt;br /&gt;
          #  program: next100days  Mike Chirico&lt;br /&gt;
          #  download:&lt;br /&gt;
          #  http://sourceforge.net/direct-dl/mchirico/souptonuts/working_with_time.tar.gz&lt;br /&gt;
          #&lt;br /&gt;
          #  This will calculate the sunrise and sunset for&lt;br /&gt;
          #  latitude     39.95  Note must convert to degrees&lt;br /&gt;
          #  longitude  75.15  Note must convert to degrees&lt;br /&gt;
          lat=39.95&lt;br /&gt;
          long=75.15&lt;br /&gt;
          for (( i=0; i &amp;lt;= 100; i++))&lt;br /&gt;
          do&lt;br /&gt;
            sunrise    `date -d &amp;quot;+$i day&amp;quot; &amp;quot;+%Y %m %d&amp;quot;` $lat $long&lt;br /&gt;
          done&lt;br /&gt;
&lt;br /&gt;
       Take a look at the following sample output.&lt;br /&gt;
&lt;br /&gt;
           $ export TZ=EST+5EDT,M4.1.0/2,M10.5.0/2&lt;br /&gt;
           $ ./next100days&lt;br /&gt;
&lt;br /&gt;
          Sunrise  08-24-2004  06:21:12   Sunset 08-24-2004  19:43:42&lt;br /&gt;
          Sunrise  08-25-2004  06:22:09   Sunset 08-25-2004  19:42:12&lt;br /&gt;
          Sunrise  08-26-2004  06:23:06   Sunset 08-26-2004  19:40:41&lt;br /&gt;
          Sunrise  08-27-2004  06:24:03   Sunset 08-27-2004  19:39:09&lt;br /&gt;
          Sunrise  08-28-2004  06:25:00   Sunset 08-28-2004  19:37:37&lt;br /&gt;
          Sunrise  08-29-2004  06:25:56   Sunset 08-29-2004  19:36:04&lt;br /&gt;
          Sunrise  08-30-2004  06:26:53   Sunset 08-30-2004  19:34:31&lt;br /&gt;
          Sunrise  08-31-2004  06:27:50   Sunset 08-31-2004  19:32:57&lt;br /&gt;
          Sunrise  09-01-2004  06:28:46   Sunset 09-01-2004  19:31:22&lt;br /&gt;
          Sunrise  09-02-2004  06:29:43   Sunset 09-02-2004  19:29:47&lt;br /&gt;
          ..[values omitted ]&lt;br /&gt;
          Sunrise  10-28-2004  07:25:31   Sunset 10-28-2004  18:02:34&lt;br /&gt;
          Sunrise  10-29-2004  07:26:38   Sunset 10-29-2004  18:01:19&lt;br /&gt;
          Sunrise  10-30-2004  07:27:46   Sunset 10-30-2004  18:00:06&lt;br /&gt;
          Sunrise  10-31-2004  06:28:53   Sunset 10-31-2004  16:58:54&lt;br /&gt;
          Sunrise  11-01-2004  06:30:01   Sunset 11-01-2004  16:57:44&lt;br /&gt;
          Sunrise  11-02-2004  06:31:10   Sunset 11-02-2004  16:56:35&lt;br /&gt;
&lt;br /&gt;
       Compare 10-30-2004 with 10-31-2004. Sunrise is an hour earlier because&lt;br /&gt;
       daylight saving time has ended, just as predicted.&lt;br /&gt;
&lt;br /&gt;
       There is an easier way to switch between timezones. Take a look at the&lt;br /&gt;
       directory zoneinfo as follows:&lt;br /&gt;
&lt;br /&gt;
            $ ls /usr/share/zoneinfo&lt;br /&gt;
&lt;br /&gt;
            Africa      Chile    Factory    Iceland      Mexico    posix       UCT&lt;br /&gt;
            America     CST6CDT  GB         Indian       Mideast   posixrules  Universal&lt;br /&gt;
            Antarctica  Cuba     GB-Eire    Iran         MST       PRC         US&lt;br /&gt;
            Arctic      EET      GMT        iso3166.tab  MST7MDT   PST8PDT     UTC&lt;br /&gt;
            Asia        Egypt    GMT0       Israel       Navajo    right       WET&lt;br /&gt;
            Atlantic    Eire     GMT-0      Jamaica      NZ        ROC         W-SU&lt;br /&gt;
            Australia   EST      GMT+0      Japan        NZ-CHAT   ROK         zone.tab&lt;br /&gt;
            Brazil      EST5EDT  Greenwich  Kwajalein    Pacific   Singapore   Zulu&lt;br /&gt;
            Canada      Etc      Hongkong   Libya        Poland    SystemV&lt;br /&gt;
            CET         Europe   HST        MET          Portugal  Turkey&lt;br /&gt;
&lt;br /&gt;
       TZ can be set to any one of these files. Some of these are directories and contain&lt;br /&gt;
       subdirectories, such as ./posix/America. This way you don not have to enter the&lt;br /&gt;
       timezone, offset, and range for dst, since it has already been calculated.&lt;br /&gt;
&lt;br /&gt;
           $ export TZ=:/usr/share/zoneinfo/posix/America/Aruba&lt;br /&gt;
           $ export TZ=:/usr/share/zoneinfo/Egypt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Reference:&lt;br /&gt;
          http://prdownloads.sourceforge.net/cpearls/date_calc.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
          Also see  (TIP 27).&lt;br /&gt;
          Also see  (TIP 103) using chrony which is very similiar to ntpd.&lt;br /&gt;
          Note time settings can usually be found in /etc/sysconfig/clock&lt;br /&gt;
         &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 2:&lt;br /&gt;
&lt;br /&gt;
     cpio works like tar, only better.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Create two directories with data ../dir1 an ../dir2)&lt;br /&gt;
&lt;br /&gt;
          mkdir -p ../dir1&lt;br /&gt;
          mkdir -p ../dir2&lt;br /&gt;
          cp /etc/*.conf ../dir1/.&lt;br /&gt;
          cp /etc/*.cnf ../dir2/.&lt;br /&gt;
&lt;br /&gt;
          Which will backup all your cnf and conf files.&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Piping the files to tar)&lt;br /&gt;
&lt;br /&gt;
          cpio works like tar but can take input&lt;br /&gt;
          from the &amp;quot;find&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar &amp;gt; test.tar&lt;br /&gt;
               or&lt;br /&gt;
           $ find ../dir1/ | cpio -o -H tar &amp;gt; test2.tar&lt;br /&gt;
&lt;br /&gt;
          Same command without the &amp;quot;&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar -F test.tar&lt;br /&gt;
              or&lt;br /&gt;
           $ find ../dir1/ | cpio -o -H tar -F test2.tar&lt;br /&gt;
&lt;br /&gt;
          Using append&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar -F test.tar&lt;br /&gt;
             or&lt;br /&gt;
           $ find ../dir2/ | cpio -o --format=tar --append -F test.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (List contents of the tar file)&lt;br /&gt;
&lt;br /&gt;
          $ cpio -it &amp;lt; test.tar&lt;br /&gt;
                or&lt;br /&gt;
          $ cpio -it -F test.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Extract the contents)&lt;br /&gt;
&lt;br /&gt;
          $ cpio -i -F test.tar&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 3:&lt;br /&gt;
&lt;br /&gt;
     Working with tar. The basics with encryption.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Using the tar command on the directory /stuff)&lt;br /&gt;
&lt;br /&gt;
          Suppose you have a directory /stuff&lt;br /&gt;
          To tar everything in stuff to create a &amp;quot;.tar&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
          $ tar -cvf stuff.tar stuff&lt;br /&gt;
&lt;br /&gt;
          Which will create &amp;quot;stuff.tar&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Using the tar command to create a &amp;quot;.tar.gz&amp;quot; of /stuff)&lt;br /&gt;
&lt;br /&gt;
          $ tar -czf stuff.tar.gz stuff&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (List the files in the archive)&lt;br /&gt;
&lt;br /&gt;
          $ tar -tzf stuff.tar.gz&lt;br /&gt;
               or&lt;br /&gt;
          $ tar -tf stuff.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (A way to list specific files)&lt;br /&gt;
&lt;br /&gt;
          Note, pipe the results to a file and edit&lt;br /&gt;
&lt;br /&gt;
           $ tar -tzf stuff.tar.gz &amp;gt; mout&lt;br /&gt;
&lt;br /&gt;
          Then, edit mout to only include the files you want&lt;br /&gt;
&lt;br /&gt;
           $ tar -T mout -xzf stuff.tar.gz&lt;br /&gt;
&lt;br /&gt;
          The above command will only get the files in mout.&lt;br /&gt;
          Of couse, if you want them all&lt;br /&gt;
&lt;br /&gt;
           $ tar -xzf stuff.tar.gz&lt;br /&gt;
&lt;br /&gt;
     STEP 5 (ENCRYPTION)&lt;br /&gt;
&lt;br /&gt;
           $ tar -zcvf - stuff|openssl des3 -salt -k secretpassword | dd of=stuff.des3&lt;br /&gt;
&lt;br /&gt;
          This will create stuff.des3...don't forget the password you&lt;br /&gt;
          put in place of  secretpassword. This can be done interactively as&lt;br /&gt;
          well.&lt;br /&gt;
&lt;br /&gt;
            $ dd if=stuff.des3 |openssl des3 -d -k secretpassword|tar zxf -&lt;br /&gt;
&lt;br /&gt;
     NOTE:  above there is a &amp;quot;-&amp;quot; at the end... this will&lt;br /&gt;
            extract everything.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 4:&lt;br /&gt;
&lt;br /&gt;
     Creating a Virtual File System and Mounting it with a Loopback Device.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Construct a 10MB file)&lt;br /&gt;
&lt;br /&gt;
           $ dd if=/dev/zero of=/tmp/disk-image count=20480&lt;br /&gt;
&lt;br /&gt;
          By default dd uses block of 512 so the size will be 20480*512&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Make an ext2 or ext3 file system) -- ext2 shown here.&lt;br /&gt;
&lt;br /&gt;
           $ mke2fs -q&lt;br /&gt;
&lt;br /&gt;
          or if you want ext3&lt;br /&gt;
&lt;br /&gt;
           $ mkfs -t ext3 -q /tmp/disk-image&lt;br /&gt;
&lt;br /&gt;
          yes, you can even use reiser, but you'll need to create a bigger&lt;br /&gt;
          disk image. Something like &amp;quot;dd if=/dev/zero of=/tmp/disk-image count=50480&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ mkfs -t reiserfs -q /tmp/disk-image&lt;br /&gt;
&lt;br /&gt;
          Hit yes for confirmation.  It only asks this because it's a file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Create a directory &amp;quot;virtual-fs&amp;quot; and mount. This has to be done as root)&lt;br /&gt;
&lt;br /&gt;
           $ mkdir /virtual-fs&lt;br /&gt;
           $ mount -o loop=/dev/loop0 /tmp/disk-image /virtual-fs&lt;br /&gt;
&lt;br /&gt;
         SPECIAL NOTE: if you mount a second device you will have to increase the&lt;br /&gt;
                       loop count: loop=/dev/loop1, loop=/dev/loop2, ... loop=/dev/loopn&lt;br /&gt;
&lt;br /&gt;
          Now it operates just like a disk. This virtual filesystem can be mounted&lt;br /&gt;
          when the system boots by adding the following to the &amp;quot;/etc/fstab&amp;quot; file. Then,&lt;br /&gt;
          to mount, just type &amp;quot;mount /virtual-fs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                 /tmp/disk-image /virtual-fs ext2               rw,loop=/dev/loop0 0 0&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (When done, umount it)&lt;br /&gt;
&lt;br /&gt;
           $ umount /virtual-fs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE: If you are using Fedora core 2, in the /etc/fstab you can take&lt;br /&gt;
              advantage of acl properties for this mount. Note the acl next to the&lt;br /&gt;
              rw entry. This is shown here with ext3.&lt;br /&gt;
&lt;br /&gt;
                 /tmp/disk-image     /virtual-fs ext3    rw,acl,loop=/dev/loop1 0 0&lt;br /&gt;
&lt;br /&gt;
              Also, if you are using Fedora core 2 and above, you can mount the file&lt;br /&gt;
              on a cryptoloop.&lt;br /&gt;
&lt;br /&gt;
                $ dd if=/dev/urandom of=disk-aes count=20480&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ modprobe loop&lt;br /&gt;
                $ modprobe cryptoloop&lt;br /&gt;
                $ modprobe aes&lt;br /&gt;
&lt;br /&gt;
                $ losetup -e aes /dev/loop0 disk-aes&lt;br /&gt;
                $ mkfs -t ext2 /dev/loop0&lt;br /&gt;
                $ mount -o loop,encryption=aes disk-aes &amp;lt;mount point&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              If you do not have Fedora core 2, then, you can build the kernel from source&lt;br /&gt;
              with some of the following options (not complete, yet)&lt;br /&gt;
               reference:&lt;br /&gt;
     http://cvs.sourceforge.net/viewcvs.py/cpearls/cpearls/src/posted_on_sf/acl/ehd.pdf?rev=1.1&amp;amp;view=log&lt;br /&gt;
&lt;br /&gt;
                      Cryptographic API Support (CONFIG_CRYPTO)&lt;br /&gt;
                      generic loop cryptographic (CONFIG_CRYPTOLOOP)&lt;br /&gt;
                      Cryptographic ciphers (CONFIG_CIPHERS)&lt;br /&gt;
                      Enable one or more  ciphers  (CONFIG CIPHER .*) such as AES.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     HELPFUL INFORMATION: It is possible to bind mount partitions, or associate the&lt;br /&gt;
                     mounted partition to a directory name.&lt;br /&gt;
&lt;br /&gt;
                  # mount --bind  /virtual-fs      /home/mchirico/vfs&lt;br /&gt;
&lt;br /&gt;
             Also, if you want to see what filesystems are currently mounted, &amp;quot;cat&amp;quot; the&lt;br /&gt;
             file &amp;quot;/etc/mtab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
                  $ cat /etc/mtab&lt;br /&gt;
&lt;br /&gt;
     Also see TIP 91.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 5:&lt;br /&gt;
&lt;br /&gt;
     Setting up 2 IP address on &amp;quot;One&amp;quot; NIC. This example is on ethernet.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (The settings for the initial IP address)&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
&lt;br /&gt;
            DEVICE=eth0&lt;br /&gt;
            BOOTPROTO=static&lt;br /&gt;
            BROADCAST=192.168.99.255&lt;br /&gt;
            IPADDR=192.168.1.155&lt;br /&gt;
            NETMASK=255.255.252.0&lt;br /&gt;
            NETWORK=192.168.1.0&lt;br /&gt;
            ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (2nd IP address: )&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/sysconfig/network-scripts/ifcfg-eth0:1&lt;br /&gt;
&lt;br /&gt;
            DEVICE=eth0:1&lt;br /&gt;
            BOOTPROTO=static&lt;br /&gt;
            BROADCAST=192.168.99.255&lt;br /&gt;
            IPADDR=192.168.1.182&lt;br /&gt;
            NETMASK=255.255.252.0&lt;br /&gt;
            NETWORK=192.168.1.0&lt;br /&gt;
            ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
     SUMMARY  Note, in STEP 1 the filename is &amp;quot;ifcfg-eth0&amp;quot;, whereas in&lt;br /&gt;
              STEP 2 it's &amp;quot;ifcfg-eth0:1&amp;quot; and also not the matching&lt;br /&gt;
              entries for &amp;quot;DEVICE=...&amp;quot;.  Also, obviously, the&lt;br /&gt;
              &amp;quot;IPADDR&amp;quot; is different as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 6:&lt;br /&gt;
&lt;br /&gt;
     Sharing Directories Among Several Users.&lt;br /&gt;
&lt;br /&gt;
     Several people are working on a project in &amp;quot;/home/share&amp;quot;&lt;br /&gt;
     and they need to create documents and programs so that&lt;br /&gt;
     others in the group can edit and execute these documents&lt;br /&gt;
     as needed. Also see (TIP 186) for adding existing users&lt;br /&gt;
     to groups.&lt;br /&gt;
&lt;br /&gt;
       $  /usr/sbin/groupadd share&lt;br /&gt;
       $  chown -R root.share /home/share&lt;br /&gt;
       $  /usr/bin/gpasswd -a &amp;lt;username&amp;gt; share&lt;br /&gt;
       $  chmod 2775 /home/share&lt;br /&gt;
&lt;br /&gt;
       $  ls -ld /home/share&lt;br /&gt;
             drwxrwsr-x    2 root     share        4096 Nov  8 16:19 /home/share&lt;br /&gt;
                   ^---------- Note the s bit, which was set with the chmod 2775&lt;br /&gt;
&lt;br /&gt;
       $  cat /etc/group&lt;br /&gt;
          ...&lt;br /&gt;
           share:x:502:chirico,donkey,zoe&lt;br /&gt;
          ...          ^------- users are added to this group.&lt;br /&gt;
&lt;br /&gt;
     The user may need to login again to get access. Or, if the user is currently&lt;br /&gt;
     logged in, they can run the following command:&lt;br /&gt;
&lt;br /&gt;
       $ su - &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Note, the above step is recommended over  &amp;quot;newgrp - share&amp;quot; since currently&lt;br /&gt;
     newgrp in FC2,FC3, and FC4 gets access to the group but the umask is not&lt;br /&gt;
     correctly formed.&lt;br /&gt;
&lt;br /&gt;
     As root you  can test their account.&lt;br /&gt;
&lt;br /&gt;
       $ su - &amp;lt;username&amp;gt;   &amp;quot;You need to '-' to pickup thier environment  '$ su - chirico' &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Note: SUID, SGID, Sticky bit. Only the left most octet is examined, and &amp;quot;chmod 755&amp;quot; is used&lt;br /&gt;
          as an example of the full command. But, anything else could be used as well. Normally&lt;br /&gt;
          you'd want executable permissions.&lt;br /&gt;
&lt;br /&gt;
        Octal digit  Binary value      Meaning                           Example usage&lt;br /&gt;
            0           000       all cleared                             $ chmod 0755 or chmod 755&lt;br /&gt;
            1           001       sticky                                  $ chmod 1755&lt;br /&gt;
            2           010       setgid                                  $ chmod 2755&lt;br /&gt;
            3           011       setgid, sticky                          $ chmod 3755&lt;br /&gt;
            4           100       setuid                                  $ chmod 4755&lt;br /&gt;
            5           101       setuid, sticky                          $ chmod 5755&lt;br /&gt;
            6           110       setuid, setgid                          $ chmod 6755&lt;br /&gt;
            7           111       setuid, setgid, sticky                  $ chmod 7755&lt;br /&gt;
&lt;br /&gt;
     A few examples applied to a directory below. In the first example all users in the group can&lt;br /&gt;
     add files to directory &amp;quot;dirA&amp;quot; and they can delete their own files. Users cannot delete other&lt;br /&gt;
     user's files.&lt;br /&gt;
&lt;br /&gt;
        Sticky bit:&lt;br /&gt;
           $ chmod 1770  dirA&lt;br /&gt;
&lt;br /&gt;
     Below files created within the directory have the group ID of the directory, rather than that&lt;br /&gt;
     of the default group setting for the user who created the file.&lt;br /&gt;
&lt;br /&gt;
        Set group ID bit:&lt;br /&gt;
           $ chmod 2755  dirB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 7:&lt;br /&gt;
&lt;br /&gt;
     Getting Infomation on Commands&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;info&amp;quot; is a great utility for getting information about the system.&lt;br /&gt;
     Here's a quick key on using &amp;quot;info&amp;quot; from the terminal prompt.&lt;br /&gt;
&lt;br /&gt;
       'q' exits.&lt;br /&gt;
       'u' moves up to the table of contents of the current section.&lt;br /&gt;
       'n' moves to the next chapter.&lt;br /&gt;
       'p' moves to the previous chapter.&lt;br /&gt;
       'space' goes into the selected section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The following is a good starting point:&lt;br /&gt;
&lt;br /&gt;
        $ info coreutils&lt;br /&gt;
&lt;br /&gt;
      Need to find out what a certain program does?&lt;br /&gt;
&lt;br /&gt;
        $ whatis  open&lt;br /&gt;
       open   (2)  - open and possibly create a file or device&lt;br /&gt;
       open   (3)  - perl pragma to set default PerlIO layers for input and output&lt;br /&gt;
       open   (3pm)  - perl pragma to set default PerlIO layers for input and output&lt;br /&gt;
       open   (n)  - Open a file-based or command pipeline channel&lt;br /&gt;
&lt;br /&gt;
      To get specific information about the open commmand&lt;br /&gt;
&lt;br /&gt;
        $ man 2 open&lt;br /&gt;
&lt;br /&gt;
       also try 'keyword' search, which is the same as the apropos command.&lt;br /&gt;
       For example, to find all the man pages on selinux, type the following:&lt;br /&gt;
&lt;br /&gt;
        $ man -k selinux&lt;br /&gt;
&lt;br /&gt;
       or the man full word search. Same as whatis command.&lt;br /&gt;
&lt;br /&gt;
        $ man -f &amp;lt;some string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       This is a hint once you are inside man.&lt;br /&gt;
&lt;br /&gt;
        space      moves forward one page&lt;br /&gt;
        b          moves backward&lt;br /&gt;
        y          scrolls up one line &amp;quot;yikes, I missed it!&amp;quot;&lt;br /&gt;
        g          goes to the beginning&lt;br /&gt;
        q          quits&lt;br /&gt;
        /&amp;lt;string&amp;gt;  search, repeat seach n&lt;br /&gt;
        m          mark, enter a letter like &amp;quot;a&amp;quot;, then, ' to go back&lt;br /&gt;
        '          enter a letter that is marked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       To get section numbers&lt;br /&gt;
&lt;br /&gt;
        $ man 8 ping&lt;br /&gt;
&lt;br /&gt;
       Note the numbers are used as follows&lt;br /&gt;
         (This is OpenBSD)&lt;br /&gt;
&lt;br /&gt;
         1  General Commands&lt;br /&gt;
         2  System Calls and Error Numbers&lt;br /&gt;
         3  C Libraries&lt;br /&gt;
         3p perl&lt;br /&gt;
         4  Devices and device drivers&lt;br /&gt;
         5  File Formats and config files&lt;br /&gt;
         6  Game instructions&lt;br /&gt;
         7  Miscellaneous information&lt;br /&gt;
         8  System maintenance&lt;br /&gt;
         9  Kernel internals&lt;br /&gt;
&lt;br /&gt;
       To find the man page directly, &amp;quot;ls&amp;quot; command:&lt;br /&gt;
&lt;br /&gt;
         $ whereis -m ls&lt;br /&gt;
         ls: /usr/share/man/man1/ls.1.gz /usr/share/man/man1/ls.1 /usr/share/man/man1p/ls.1p&lt;br /&gt;
&lt;br /&gt;
       To read this file directly, do the following:&lt;br /&gt;
&lt;br /&gt;
         $ man /usr/share/man/man1/ls.1.gz&lt;br /&gt;
&lt;br /&gt;
       If you want to know the manpath, execute manpath.&lt;br /&gt;
&lt;br /&gt;
         $ manpath&lt;br /&gt;
         /usr/share/man:/usr/X11R6/man:/usr/local/share/man:/usr/local/pgsql/man:/usr/man:/usr/local/man&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 8:&lt;br /&gt;
&lt;br /&gt;
     How to Put a &amp;quot;Running Job&amp;quot; in the Background.&lt;br /&gt;
&lt;br /&gt;
     You're running a job at the terminal prompt, and it's taking&lt;br /&gt;
     a very long time. You want to put the job in the backgroud.&lt;br /&gt;
&lt;br /&gt;
       &amp;quot;CTL - z&amp;quot; Temporarily suspends the job&lt;br /&gt;
       $ jobs     This will list all the jobs&lt;br /&gt;
       $ bg %jobnumber (bg %1)  To run in the background&lt;br /&gt;
       $ fg %jobnumber          To bring back in the foreground&lt;br /&gt;
&lt;br /&gt;
     Need to kill all jobs -- say you're using several suspended&lt;br /&gt;
     emacs sessions and you just want everything to exit.&lt;br /&gt;
&lt;br /&gt;
       $ kill -9  `jobs -p`&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;jobs -p&amp;quot; gives the process number of each job, and the&lt;br /&gt;
     kill -9 kills everything. Yes, sometimes &amp;quot;kill -9&amp;quot; is excessive&lt;br /&gt;
     and you should issue a &amp;quot;kill -15&amp;quot; that allows jobs to clean-up.&lt;br /&gt;
     However, for exacs session, I prefer &amp;quot;kill -9&amp;quot; and haven't had&lt;br /&gt;
     a problem.&lt;br /&gt;
&lt;br /&gt;
     Sometimes you need to list the process id along with job&lt;br /&gt;
     information. For instance, here's process id with the listing.&lt;br /&gt;
&lt;br /&gt;
       $ jobs -l&lt;br /&gt;
&lt;br /&gt;
     Note you can also renice a job, or give it lower priority.&lt;br /&gt;
&lt;br /&gt;
       $ nice -n +15 find . -ctime 2 -type f  -exec ls {} \; &amp;gt; last48hours&lt;br /&gt;
        ^z&lt;br /&gt;
       $  bg&lt;br /&gt;
&lt;br /&gt;
     So above that was a ctl-z to suppend. Then, bg to run it in&lt;br /&gt;
     the background. Now, if you want to change the priority lower&lt;br /&gt;
     you just renice it, once you know the process id.&lt;br /&gt;
&lt;br /&gt;
       $ jobs -pl&lt;br /&gt;
   [1]+ 29388 Running                 nice -n +15 find . -ctime 2 -exec ls -l {} \; &amp;gt;mout &amp;amp;&lt;br /&gt;
&lt;br /&gt;
       $ renice +30 -p 29388&lt;br /&gt;
        29388: old priority 15, new priority 19&lt;br /&gt;
&lt;br /&gt;
      19 was the lowest priority for this job. You cannot increase&lt;br /&gt;
      the priority unless you are root.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 9:&lt;br /&gt;
&lt;br /&gt;
     Need to Delete a File for Good -- not even GOD can recover.&lt;br /&gt;
&lt;br /&gt;
     You have a file &amp;quot;secret&amp;quot;.  The following makes it so no one&lt;br /&gt;
     can read it.  If the file was 12 bytes, it's now 4096 after it&lt;br /&gt;
     has been over written 100 times.  There's no way to recover this.&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z secret&lt;br /&gt;
&lt;br /&gt;
     Want to remove the file? Use the &amp;quot;u&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z -u test2&lt;br /&gt;
&lt;br /&gt;
     It can be applied to a device&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z -u /dev/fd0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       CAUTION: Note that shred relies on a very important assumption: that the file system  overwrites  data&lt;br /&gt;
       in  place.   This is the traditional way to do things, but many modern file system designs do not sat-&lt;br /&gt;
       isfy this assumption.  The following are examples of file systems on which shred is not effective,  or&lt;br /&gt;
       is not guaranteed to be effective in all file system modes:&lt;br /&gt;
&lt;br /&gt;
       * log-structured or journaled file systems, such as those supplied with&lt;br /&gt;
&lt;br /&gt;
              AIX and Solaris (and JFS, ReiserFS, XFS, Ext3, etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 52).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 10:&lt;br /&gt;
&lt;br /&gt;
     Who and What is doing What on Your System - finding open sockets,&lt;br /&gt;
     files etc.&lt;br /&gt;
&lt;br /&gt;
       $ lsof&lt;br /&gt;
          or as root&lt;br /&gt;
       $ watch lsof -i&lt;br /&gt;
&lt;br /&gt;
     To list all open Internet files, use:&lt;br /&gt;
&lt;br /&gt;
       $ lsof -i -U&lt;br /&gt;
&lt;br /&gt;
       (See TIP 118)&lt;br /&gt;
&lt;br /&gt;
     Also try fuser. Suppose you have a mounted file-system, and you need&lt;br /&gt;
     to umount it. To list the users on the file-system /work&lt;br /&gt;
&lt;br /&gt;
       $ fuser -u /work&lt;br /&gt;
&lt;br /&gt;
     To kill all processes accessing the file system /work  in  any way.&lt;br /&gt;
&lt;br /&gt;
       $ fuser -km /work&lt;br /&gt;
&lt;br /&gt;
     Or better yet, maybe you want to eject a cdrom on /mnt/cdrom&lt;br /&gt;
&lt;br /&gt;
       $ fuser -km /mnt/cdrom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     If you need IO load information about your system, you can execute&lt;br /&gt;
     iostat. But note, the very first iostat gives a snapshot since&lt;br /&gt;
     the last boot. You typically want the following command, which gives&lt;br /&gt;
     you 3 outputs every 5 seconds.&lt;br /&gt;
&lt;br /&gt;
       $ iostat -xtc 5 3&lt;br /&gt;
       Linux 2.6.12-1.1376_FC3smp (squeezel.squeezel.com) 	10/05/2005&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:04 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  0.97    0.06    1.94    0.62   96.41&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:09 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  0.60    0.00    1.70    0.00   97.70&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:14 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  1.00    0.00    1.60    0.00   97.39&lt;br /&gt;
&lt;br /&gt;
     vmstat reports memory statistics.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ vmstat&lt;br /&gt;
       $ ifconfig&lt;br /&gt;
       $ cat /proc/sys/vm/.. (entries under here)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      *NOTE: (TIP 77) shows sample usage of &amp;quot;ifconfig&amp;quot;. Also&lt;br /&gt;
       (TIP 84) shows sample output of &amp;quot;$ cat /proc/cpuinfo&amp;quot;. You can download iostat&lt;br /&gt;
       and other packages from (http://perso.wanadoo.fr/sebastien.godard/download_en.html).&lt;br /&gt;
       You also may want to look at iozone (TIP 178).&lt;br /&gt;
&lt;br /&gt;
     Also&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/meminfo&lt;br /&gt;
       $ cat /proc/stat&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/uptime&lt;br /&gt;
       1078623.55 1048008.34       First number is the number of seconds since boot.&lt;br /&gt;
                                   The second number is the number of idle seconds.&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/loadavg&lt;br /&gt;
       0.25 0.14 0.10 1/166 7778   This shows load at 1,5, and 15 minutes,&lt;br /&gt;
                                   a total of 1 current running process out&lt;br /&gt;
                                   from a total of 166. The 7778 is the last&lt;br /&gt;
                                   process id used.&lt;br /&gt;
                                   Ref: http://www.teamquest.com/resources/gunther/ldavg1.shtml&lt;br /&gt;
&lt;br /&gt;
     Or current process open file descriptors&lt;br /&gt;
&lt;br /&gt;
        $ ls -l /proc/self/fd/0&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lr-x------    1 chirico  chirico        64 Jun 29 13:17 3 -&amp;gt; /proc/26667/fd&lt;br /&gt;
&lt;br /&gt;
      So you could, $ echo &amp;quot;stuff&amp;quot; &amp;gt; /dev/pts/51, to get output. Note, tree is also&lt;br /&gt;
      helpful here:&lt;br /&gt;
&lt;br /&gt;
         $ tree /proc/self&lt;br /&gt;
&lt;br /&gt;
            /proc/self&lt;br /&gt;
            |-- auxv&lt;br /&gt;
            |-- cmdline&lt;br /&gt;
            |-- cwd -&amp;gt; /work/souptonuts/documentation/theBook&lt;br /&gt;
            |-- environ&lt;br /&gt;
            |-- exe -&amp;gt; /usr/bin/tree&lt;br /&gt;
            |-- fd&lt;br /&gt;
            |   |-- 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   |-- 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   |-- 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   `-- 3 -&amp;gt; /proc/26668/fd&lt;br /&gt;
            |-- maps&lt;br /&gt;
            |-- mem&lt;br /&gt;
            |-- mounts&lt;br /&gt;
            |-- root -&amp;gt; /&lt;br /&gt;
            |-- stat&lt;br /&gt;
            |-- statm&lt;br /&gt;
            |-- status&lt;br /&gt;
            |-- task&lt;br /&gt;
            |   `-- 26668&lt;br /&gt;
            |       |-- auxv&lt;br /&gt;
            |       |-- cmdline&lt;br /&gt;
            |       |-- cwd -&amp;gt; /work/souptonuts/documentation/theBook&lt;br /&gt;
            |       |-- environ&lt;br /&gt;
            |       |-- exe -&amp;gt; /usr/bin/tree&lt;br /&gt;
            |       |-- fd&lt;br /&gt;
            |       |   |-- 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   |-- 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   |-- 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   `-- 3 -&amp;gt; /proc/26668/task/26668/fd&lt;br /&gt;
            |       |-- maps&lt;br /&gt;
            |       |-- mem&lt;br /&gt;
            |       |-- mounts&lt;br /&gt;
            |       |-- root -&amp;gt; /&lt;br /&gt;
            |       |-- stat&lt;br /&gt;
            |       |-- statm&lt;br /&gt;
            |       |-- status&lt;br /&gt;
            |       `-- wchan&lt;br /&gt;
            `-- wchan&lt;br /&gt;
&lt;br /&gt;
            10 directories, 28 files&lt;br /&gt;
&lt;br /&gt;
     Need a listing of the system settings?&lt;br /&gt;
&lt;br /&gt;
       $ sysctl -a&lt;br /&gt;
&lt;br /&gt;
     Need IPC (Shared Memory Segments, Semaphore Arrays, Message Queue) status&lt;br /&gt;
     etc?&lt;br /&gt;
&lt;br /&gt;
       $ ipcs&lt;br /&gt;
       $ ipcs -l  &amp;quot;This gives limits&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Need to &amp;quot;watch&amp;quot; everything a user does?  The following watches donkey.&lt;br /&gt;
&lt;br /&gt;
       $ watch lsof -u donkey&lt;br /&gt;
&lt;br /&gt;
     Or, to see what in  going on in directory &amp;quot;/work/junk&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       $ watch lsof +D /work/junk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 11:&lt;br /&gt;
&lt;br /&gt;
     How to make a File &amp;quot;immutable&amp;quot; or &amp;quot;unalterable&amp;quot; -- it cannot be changed&lt;br /&gt;
     or deleted even by root. Note this works on (ext2/ext3) filesystems.&lt;br /&gt;
     And, yes, root can delete after it's changed back.&lt;br /&gt;
&lt;br /&gt;
     As root:&lt;br /&gt;
&lt;br /&gt;
       $ chattr +i filename&lt;br /&gt;
&lt;br /&gt;
     And to change it back:&lt;br /&gt;
&lt;br /&gt;
       $ chattr -i filename&lt;br /&gt;
&lt;br /&gt;
     List attributes&lt;br /&gt;
&lt;br /&gt;
       $ lsattr filename&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 12:&lt;br /&gt;
&lt;br /&gt;
     SSH - How to Generate the Key Pair.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     On the local server&lt;br /&gt;
&lt;br /&gt;
       $  ssh-keygen -t dsa -b 2048&lt;br /&gt;
&lt;br /&gt;
     This will create the two files:&lt;br /&gt;
&lt;br /&gt;
            .ssh/id_dsa (Private key)&lt;br /&gt;
            .ssh/id_dsa.pub  (Public key you can share)&lt;br /&gt;
&lt;br /&gt;
     Next insert &amp;quot;.ssh/id_dsa.pub&amp;quot; on the remote server&lt;br /&gt;
     in the file  &amp;quot;.ssh/authorized_keys&amp;quot; and &amp;quot;.ssh/authorized_keys2&amp;quot;&lt;br /&gt;
     and change the  permission of each file to (chmod 600). Plus, make&lt;br /&gt;
     sure the directory &amp;quot;.ssh&amp;quot; exists on the remote computer with 700 rights.&lt;br /&gt;
     Ok, assuming  192.168.1.155 is the remote server and &amp;quot;donkey&amp;quot; is the&lt;br /&gt;
     account on that remote server.&lt;br /&gt;
&lt;br /&gt;
       $ ssh donkey@192.168.1.155 &amp;quot;mkdir -p .ssh&amp;quot;&lt;br /&gt;
       $ ssh donkey@192.168.1.155 &amp;quot;chmod 700 .ssh&amp;quot;&lt;br /&gt;
       $ scp ./.ssh/id_dsa.pub  donkey@192.168.1.155:.ssh/newkey.pub&lt;br /&gt;
&lt;br /&gt;
     Now connect to that remote server &amp;quot;192.168.1.155&amp;quot; and add .ssh/newkey.pub&lt;br /&gt;
     to both &amp;quot;authorized_keys&amp;quot; and &amp;quot;authorized_keys2&amp;quot;.  When done, the permission&lt;br /&gt;
     on&lt;br /&gt;
       (This is on the remote server)&lt;br /&gt;
&lt;br /&gt;
        $chmod 600 .ssh/authorized_key*&lt;br /&gt;
&lt;br /&gt;
     Next, go back to the local server and issue the following:&lt;br /&gt;
&lt;br /&gt;
        $ ssh-agent $SHELL&lt;br /&gt;
        $ ssh-add&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;ssh-add&amp;quot; will allow you to enter the passphrase and it will&lt;br /&gt;
     save it for the current login session.&lt;br /&gt;
&lt;br /&gt;
     You don't have to enter a password when running &amp;quot;ssh-keygen&amp;quot; above. But,&lt;br /&gt;
     remember anyone with root access can &amp;quot;su - &amp;lt;username&amp;gt;&amp;quot; and then connect&lt;br /&gt;
     to your computers.  It's harder, however, not impossible, for root to do&lt;br /&gt;
     this if  you have a password.&lt;br /&gt;
&lt;br /&gt;
     (Reference TIP 151)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 13:&lt;br /&gt;
&lt;br /&gt;
     Securing the System: Don't allow root to login remotely.  Instead,&lt;br /&gt;
     the admin could login as another account, then, &amp;quot;su -&amp;quot;.  However,&lt;br /&gt;
     root can still login &amp;quot;from the local terminal&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     In the &amp;quot;/etc/ssh/sshd_config&amp;quot; file change the following lines:&lt;br /&gt;
&lt;br /&gt;
        Protocol 2&lt;br /&gt;
        PermitRootLogin no&lt;br /&gt;
        PermitEmptyPasswords no&lt;br /&gt;
&lt;br /&gt;
     Then, restart ssh&lt;br /&gt;
&lt;br /&gt;
        /etc/init.d/sshd restart&lt;br /&gt;
&lt;br /&gt;
     Why would you want to do this?  It's not possible for anyone to guess&lt;br /&gt;
     or keep trying the root account.  This is especially good for computers&lt;br /&gt;
     on the Internet. So, even if the &amp;quot;root&amp;quot; passwords is known, they can't&lt;br /&gt;
     get access to the system remotely.  Only from the terminal, which is locked&lt;br /&gt;
     in your computer room. However, if anyone has a account on the server,&lt;br /&gt;
     then, they can login under their  account then &amp;quot;su -&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Suppose you only want a limited number of users:  &amp;quot;mchirico&amp;quot; and &amp;quot;donkey&amp;quot;.&lt;br /&gt;
     Add the following line to &amp;quot;/etc/ssh/sshd_config&amp;quot;. Note, this allows access&lt;br /&gt;
     for chirico and donkey, but everyone else is denied.&lt;br /&gt;
&lt;br /&gt;
         #  Once you add AllowUsers - everyone else is denied.&lt;br /&gt;
         AllowUsers mchirico donkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 14:&lt;br /&gt;
&lt;br /&gt;
     Keep Logs Longer with Less Space.&lt;br /&gt;
&lt;br /&gt;
     Normally logs rotate monthly, over writing all the old data.  Here's a&lt;br /&gt;
     sample &amp;quot;/etc/logrotate.conf&amp;quot; that will keep 12 months of backup&lt;br /&gt;
     compressing the logfiles&lt;br /&gt;
&lt;br /&gt;
       $ cat /etc/logrotate.conf&lt;br /&gt;
&lt;br /&gt;
             # see &amp;quot;man logrotate&amp;quot; for details&lt;br /&gt;
             # rotate log files weekly&lt;br /&gt;
             #chirico changes to monthly&lt;br /&gt;
             monthly&lt;br /&gt;
&lt;br /&gt;
             # keep 4 weeks worth of backlogs&lt;br /&gt;
             # keep 12 months of backup&lt;br /&gt;
             rotate 12&lt;br /&gt;
&lt;br /&gt;
             # create new (empty) log files after rotating old ones&lt;br /&gt;
             create&lt;br /&gt;
&lt;br /&gt;
             # uncomment this if you want your log files compressed&lt;br /&gt;
             compress&lt;br /&gt;
&lt;br /&gt;
             # RPM packages drop log rotation information into this directory&lt;br /&gt;
             include /etc/logrotate.d&lt;br /&gt;
&lt;br /&gt;
             # no packages own wtmp -- we'll rotate them here&lt;br /&gt;
             /var/log/wtmp {&lt;br /&gt;
                 monthly&lt;br /&gt;
                 create 0664 root utmp&lt;br /&gt;
                 rotate 1&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
             # system-specific logs may be also be configured here.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Note: see tip 1. The clock should always be correctly set.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 15:&lt;br /&gt;
&lt;br /&gt;
     What Network Services are Running?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -atup&lt;br /&gt;
&lt;br /&gt;
     or&lt;br /&gt;
&lt;br /&gt;
          $ netstat -ap|grep LISTEN|less&lt;br /&gt;
&lt;br /&gt;
     This can be helpful to determine the services running.&lt;br /&gt;
&lt;br /&gt;
     Need stats on dropped UDP packets?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s -u&lt;br /&gt;
&lt;br /&gt;
     or TCP&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s -t&lt;br /&gt;
&lt;br /&gt;
     or summary of everything&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s&lt;br /&gt;
&lt;br /&gt;
     or looking for error rates on the interface?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -i&lt;br /&gt;
&lt;br /&gt;
     Listening interfaces?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -l&lt;br /&gt;
&lt;br /&gt;
     (Tip above provided by Amos Shapira)&lt;br /&gt;
&lt;br /&gt;
     Also see TIP 77.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 16:&lt;br /&gt;
&lt;br /&gt;
     Apache: Creating and Using an &amp;quot;.htaccess&amp;quot; File&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Below is a sample &amp;quot;.htaccess&amp;quot; file which goes in&lt;br /&gt;
     &amp;quot;/usr/local/apache/htdocs/chirico/alpha/.htaccess&amp;quot; for this&lt;br /&gt;
     example&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         AuthUserFile /usr/local/apache/htdocs/chirico/alpha/.htpasswd&lt;br /&gt;
         AuthGroupFile /dev/null&lt;br /&gt;
         AuthName &amp;quot;Your Name and regular password required&amp;quot;&lt;br /&gt;
         AuthType Basic&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;Limit GET POST&amp;gt;&lt;br /&gt;
         require valid-user&lt;br /&gt;
         &amp;lt;/Limit&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    In order for this to work /usr/local/apache/conf/httpd.conf must&lt;br /&gt;
    have the following line in it:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       #&lt;br /&gt;
       &amp;lt;Directory /usr/local/apache/htdocs/chirico/alpha&amp;gt;&lt;br /&gt;
           AllowOverride FileInfo AuthConfig Limit&lt;br /&gt;
           Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec&lt;br /&gt;
           &amp;lt;Limit GET POST OPTIONS PROPFIND&amp;gt;&lt;br /&gt;
               Order allow,deny&lt;br /&gt;
               Allow from all&lt;br /&gt;
           &amp;lt;/Limit&amp;gt;&lt;br /&gt;
           &amp;lt;LimitExcept GET POST OPTIONS PROPFIND&amp;gt;&lt;br /&gt;
               Order deny,allow&lt;br /&gt;
               Deny from all&lt;br /&gt;
           &amp;lt;/LimitExcept&amp;gt;&lt;br /&gt;
       &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Also, a password file must be created&lt;br /&gt;
&lt;br /&gt;
      $ /usr/local/apache/bin/htpasswd -c .htpasswd chirico&lt;br /&gt;
&lt;br /&gt;
    And enter the user names and passwords.&lt;br /&gt;
&lt;br /&gt;
    Next Reload Apache:&lt;br /&gt;
&lt;br /&gt;
      $ /etc/init.d/httpd reload&lt;br /&gt;
&lt;br /&gt;
    (Reference TIP 213 limit access to certain directories based on IP address).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 17:&lt;br /&gt;
&lt;br /&gt;
     Working with &amp;quot;mt&amp;quot; Commands: reading and writing to tape.&lt;br /&gt;
&lt;br /&gt;
     The following assumes the tape device is &amp;quot;/dev/st0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     STEP 1 ( rewind the tape)&lt;br /&gt;
&lt;br /&gt;
          # mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (check to see if you are at block 0)&lt;br /&gt;
&lt;br /&gt;
          # mt -f /dev/nst0 tell&lt;br /&gt;
            At block 0.&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Backup &amp;quot;tar compress&amp;quot;  directories &amp;quot;one&amp;quot;  and &amp;quot;two&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
          # tar -czf /dev/nst0 one two&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Check to see what block you are at)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
&lt;br /&gt;
       You should get something like block 2 at this point.&lt;br /&gt;
&lt;br /&gt;
     STEP 5 (Rewind the tape)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
     STEP 6 (List the files)&lt;br /&gt;
&lt;br /&gt;
           # tar -tzf /dev/nst0&lt;br /&gt;
              one/&lt;br /&gt;
              one/test&lt;br /&gt;
              two/&lt;br /&gt;
&lt;br /&gt;
     STEP 7 (Restore directory &amp;quot;one&amp;quot;  into directory &amp;quot;junk&amp;quot;).  Note, you&lt;br /&gt;
          have to first rewind the tape, since the last operation moved&lt;br /&gt;
          ahead 2 blocks. Check this with &amp;quot;mt -f /dev/nst0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           # cd junk&lt;br /&gt;
           # mt -f /dev/nst0 rewind&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
              At block 0.&lt;br /&gt;
           # tar -xzf /dev/nst0 one&lt;br /&gt;
&lt;br /&gt;
     STEP 8 (Next, take a look to see what block the tape is at)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
              At block 2.&lt;br /&gt;
&lt;br /&gt;
     STEP 9 (Now backup directories three  and four)&lt;br /&gt;
&lt;br /&gt;
           # tar -czf /dev/nst0 three four&lt;br /&gt;
&lt;br /&gt;
       After backing up the files, the tape should be past block 2.&lt;br /&gt;
       Check this.&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
             At block 4.&lt;br /&gt;
&lt;br /&gt;
          Currently the following exist:&lt;br /&gt;
&lt;br /&gt;
                At block 1:&lt;br /&gt;
                     one/&lt;br /&gt;
                    one/test&lt;br /&gt;
                    two/&lt;br /&gt;
&lt;br /&gt;
                At block 2:&lt;br /&gt;
                    three/&lt;br /&gt;
                    three/samplehere&lt;br /&gt;
                    four/&lt;br /&gt;
&lt;br /&gt;
                At block 4:&lt;br /&gt;
                    (* This is empty *)&lt;br /&gt;
&lt;br /&gt;
     A few notes. You can set the blocking factor and a label&lt;br /&gt;
     with tar. For example:&lt;br /&gt;
&lt;br /&gt;
      $ tar --label=&amp;quot;temp label&amp;quot; --create  --blocking-factor=128 --file=/dev/nst0 Notes&lt;br /&gt;
&lt;br /&gt;
     But note if you try to read it with the default, incorrect blocking&lt;br /&gt;
     factor, then, you will get the following error:&lt;br /&gt;
&lt;br /&gt;
        $ tar -t   --file=/dev/nst0&lt;br /&gt;
        tar: /dev/nst0: Cannot read: Cannot allocate memory&lt;br /&gt;
        tar: At beginning of tape, quitting now&lt;br /&gt;
        tar: Error is not recoverable: exiting now&lt;br /&gt;
&lt;br /&gt;
     However this is easily fixed with the correct blocking factor&lt;br /&gt;
&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ tar -t --blocking-factor=128 --file=/dev/nst0&lt;br /&gt;
         temp label&lt;br /&gt;
         Notes&lt;br /&gt;
&lt;br /&gt;
     Take advantage of the label command.&lt;br /&gt;
&lt;br /&gt;
         $ MYCOMMENTS=&amp;quot;Big_important_tape&amp;quot;&lt;br /&gt;
         $ tar --label=&amp;quot;$(date +%F)&amp;quot;+&amp;quot;${MYCOMMENTS}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Writing to tape on a remote 192.168.1.155 computer&lt;br /&gt;
&lt;br /&gt;
         $ tar cvzf - ./tmp | ssh -l chirico 192.168.1.155 '(mt -f /dev/nst0 rewind; dd of=/dev/st0 )'&lt;br /&gt;
&lt;br /&gt;
     Restoring the contents from tape on a remote computer&lt;br /&gt;
&lt;br /&gt;
         $ ssh -l chirico 192.168.1.155 '(mt -f /dev/nst0 rewind; dd if=/dev/st0  )'|tar xzf -&lt;br /&gt;
&lt;br /&gt;
     Getting data off of tape with dd command with odd blocking factor. Just set ibs very high&lt;br /&gt;
&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ tar --label=&amp;quot;Contenets of Notes&amp;quot; --create  --blocking-factor=128 --file=/dev/nst0 Notes&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ dd ibs=1048576 if=/dev/st0 of=notes.tar&lt;br /&gt;
&lt;br /&gt;
     The above will probably work with ibs=64k as well&lt;br /&gt;
&lt;br /&gt;
        (Also see TIP 136)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 18:&lt;br /&gt;
&lt;br /&gt;
     Encrypting Data to Tape using &amp;quot;tar&amp;quot; and &amp;quot;openssl&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     The following shows an example of writing the contents of &amp;quot;tapetest&amp;quot; to tape:&lt;br /&gt;
&lt;br /&gt;
        $ tar zcvf - tapetest|openssl des3 -salt  -k secretpassword | dd of=/dev/st0&lt;br /&gt;
&lt;br /&gt;
     Reading the data back:&lt;br /&gt;
&lt;br /&gt;
        $ dd if=/dev/st0|openssl des3 -d -k secretpassword|tar xzf -&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 19:&lt;br /&gt;
&lt;br /&gt;
     Mounting an ISO Image as a Filesystem -- this is great if you don't have the DVD&lt;br /&gt;
         hardware, but, need to get at the data.  The following show an example of&lt;br /&gt;
         mounting the Fedora core 2 as a file.&lt;br /&gt;
&lt;br /&gt;
         $ mkdir /iso0&lt;br /&gt;
         $ mount -o loop -t iso9660 /FC2-i386-DVD.iso  /iso0&lt;br /&gt;
&lt;br /&gt;
     Or to mount automatically at boot, add the following to &amp;quot;/etc/fstab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         /FC2-i386-DVD.iso /iso0     iso9660 rw,loop  0 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Reference: http://umn.dl.sourceforge.net/sourceforge/souptonuts/README_fedora.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 20:&lt;br /&gt;
&lt;br /&gt;
     Getting Information about the Hard drive and list all PCI devices.&lt;br /&gt;
&lt;br /&gt;
                $ hdparm /dev/hda&lt;br /&gt;
&lt;br /&gt;
                  /dev/hda:&lt;br /&gt;
                   multcount    = 16 (on)&lt;br /&gt;
                   IO_support   =  0 (default 16-bit)&lt;br /&gt;
                   unmaskirq    =  0 (off)&lt;br /&gt;
                   using_dma    =  1 (on)&lt;br /&gt;
                   keepsettings =  0 (off)&lt;br /&gt;
                   readonly     =  0 (off)&lt;br /&gt;
                   readahead    = 256 (on)&lt;br /&gt;
                   geometry     = 16383/255/63, sectors = 234375000, start = 0&lt;br /&gt;
&lt;br /&gt;
            or for SCSI&lt;br /&gt;
&lt;br /&gt;
                $ hdparm /dev/sda&lt;br /&gt;
&lt;br /&gt;
            Try it with the -i option for information&lt;br /&gt;
&lt;br /&gt;
                $ hdparm -i /dev/hda&lt;br /&gt;
&lt;br /&gt;
                /dev/hda:&lt;br /&gt;
&lt;br /&gt;
                Model=IC35L120AVV207-1, FwRev=V24OA66A, SerialNo=VNVD09G4CZ6E0T&lt;br /&gt;
                Config={ HardSect NotMFM HdSw&amp;gt;15uSec Fixed DTR&amp;gt;10Mbs }&lt;br /&gt;
                RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=52&lt;br /&gt;
                BuffType=DualPortCache, BuffSize=7965kB, MaxMultSect=16, MultSect=16&lt;br /&gt;
                CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=234375000&lt;br /&gt;
                IORDY=on/off, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}&lt;br /&gt;
                PIO modes:  pio0 pio1 pio2 pio3 pio4&lt;br /&gt;
                DMA modes:  mdma0 mdma1 mdma2&lt;br /&gt;
                UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5&lt;br /&gt;
                AdvancedPM=yes: disabled (255) WriteCache=enabled&lt;br /&gt;
                Drive conforms to: ATA/ATAPI-6 T13 1410D revision 3a:  2 3 4 5 6&lt;br /&gt;
&lt;br /&gt;
            How fast is your drive?&lt;br /&gt;
&lt;br /&gt;
                $ hdparm -tT /dev/hda&lt;br /&gt;
&lt;br /&gt;
                /dev/hda:&lt;br /&gt;
                Timing buffer-cache reads:   128 MB in  0.41 seconds =315.32 MB/sec&lt;br /&gt;
                Timing buffered disk reads:  64 MB in  1.19 seconds = 53.65 MB/sec&lt;br /&gt;
&lt;br /&gt;
            Need to find your device?&lt;br /&gt;
&lt;br /&gt;
                $ mount&lt;br /&gt;
                   or&lt;br /&gt;
                $ cat /proc/partitions&lt;br /&gt;
                   or&lt;br /&gt;
                $ dmesg | egrep '^(s|h)d'&lt;br /&gt;
&lt;br /&gt;
                   which for my system lists:&lt;br /&gt;
&lt;br /&gt;
                      hda: IC35L120AVV207-1, ATA DISK drive&lt;br /&gt;
                      hdc: Lite-On LTN486S 48x Max, ATAPI CD/DVD-ROM drive&lt;br /&gt;
                      hda: max request size: 1024KiB&lt;br /&gt;
                      hda: 234375000 sectors (120000 MB) w/7965KiB Cache, CHS=16383/255/63, UDMA(100)&lt;br /&gt;
&lt;br /&gt;
             By the way, if you want to turn on dma&lt;br /&gt;
&lt;br /&gt;
                 $ hdparm -d1 /dev/hda&lt;br /&gt;
                   setting using_dma to 1 (on)&lt;br /&gt;
                   using_dma    =  1 (on)&lt;br /&gt;
&lt;br /&gt;
         (Also see TIP 122 )&lt;br /&gt;
&lt;br /&gt;
     List all PCI devices&lt;br /&gt;
&lt;br /&gt;
                $ lspci -v&lt;br /&gt;
&lt;br /&gt;
          00:00.0 Host bridge: Intel Corp. 82845G/GL [Brookdale-G] Chipset Host Bridge (rev&lt;br /&gt;
                  Subsystem: Dell Computer Corporation: Unknown device 0160&lt;br /&gt;
                  Flags: bus master, fast devsel, latency 0&lt;br /&gt;
                  Memory at f0000000 (32-bit, prefetchable) [size=128M]&lt;br /&gt;
                  Capabilities: &amp;lt;available only to root&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              ... lots more ...&lt;br /&gt;
&lt;br /&gt;
           Note, there is also lspci -vv for even more information.&lt;br /&gt;
&lt;br /&gt;
          (Also see TIP 200)&lt;br /&gt;
&lt;br /&gt;
TIP 21:&lt;br /&gt;
&lt;br /&gt;
     Setting up &amp;quot;cron&amp;quot; Jobs.&lt;br /&gt;
&lt;br /&gt;
     If you want to use the emacs editor for editing cron jobs, then,&lt;br /&gt;
     set the following in your &amp;quot;/home/user/.bash_profile&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        EDITOR=emacs&lt;br /&gt;
&lt;br /&gt;
     Then, to edit cron jobs&lt;br /&gt;
&lt;br /&gt;
        $ crontab -e&lt;br /&gt;
&lt;br /&gt;
     You may want to put in the following header&lt;br /&gt;
&lt;br /&gt;
        #MINUTE(0-59) HOUR(0-23) DAYOFMONTH(1-31) MONTHOFYEAR(1-12) DAYOFWEEK(0-6) Note 0=Sun and 7=Sun&lt;br /&gt;
        #&lt;br /&gt;
        #14,15 10 * * 0   /usr/bin/somecommmand  &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     The sample &amp;quot;commented out command&amp;quot; will run at 10:14 and 10:15 every Sunday.  There will&lt;br /&gt;
     be no &amp;quot;mail&amp;quot; sent to the user because of the &amp;quot;&amp;gt;/dev/null 2&amp;gt;&amp;amp;1&amp;quot; entry.&lt;br /&gt;
&lt;br /&gt;
        $ crontab -l&lt;br /&gt;
&lt;br /&gt;
     The above will list all cron jobs. Or if you're root&lt;br /&gt;
&lt;br /&gt;
        $ crontab -l -u &amp;lt;username&amp;gt;&lt;br /&gt;
        $ crontab -e -u &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Reference &amp;quot;man 5 crontab&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
        The time and date fields are:&lt;br /&gt;
&lt;br /&gt;
                     field          allowed values&lt;br /&gt;
                     -----          --------------&lt;br /&gt;
                     minute         0-59&lt;br /&gt;
                     hour           0-23&lt;br /&gt;
                     day of month   1-31&lt;br /&gt;
                     month          1-12 (or names, see below)&lt;br /&gt;
                     day of week    0-7 (0 or 7 is Sun, or use names)&lt;br /&gt;
&lt;br /&gt;
              A field may be an asterisk (*), which always stands for ``first-last''.&lt;br /&gt;
&lt;br /&gt;
              Ranges of numbers are allowed.  Ranges are two numbers separated with a&lt;br /&gt;
              hyphen.   The  specified  range is inclusive.  For example, 8-11 for an&lt;br /&gt;
              ``hours'' entry specifies execution at hours 8, 9, 10 and 11.&lt;br /&gt;
&lt;br /&gt;
              Lists are allowed.  A list is a set of numbers (or ranges) separated by&lt;br /&gt;
              commas.  Examples: ``1,2,5,9'', ``0-4,8-12''.&lt;br /&gt;
&lt;br /&gt;
              Ranges can include &amp;quot;steps&amp;quot;, so &amp;quot;1-9/2&amp;quot; is the same as &amp;quot;1,3,5,7,9&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Note, you can run just every 5 minutes as follows:&lt;br /&gt;
&lt;br /&gt;
              */5 * * * * /etc/mrtg/domrtg  &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     To run jobs hourly,daily,weekly or monthly you can add shell scripts into the&lt;br /&gt;
     appropriate directory:&lt;br /&gt;
&lt;br /&gt;
             /etc/cron.hourly/&lt;br /&gt;
             /etc/cron.daily/&lt;br /&gt;
             /etc/cron.weekly/&lt;br /&gt;
             /etc/cron.monthly/&lt;br /&gt;
&lt;br /&gt;
     Note that the above are pre-configured schedules set in &amp;quot;/etc/crontab&amp;quot;, so&lt;br /&gt;
     if you want, you can change the schedule. Below is my /etc/crontab:&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/crontab&lt;br /&gt;
           SHELL=/bin/bash&lt;br /&gt;
           PATH=/sbin:/bin:/usr/sbin:/usr/bin&lt;br /&gt;
           MAILTO=root&lt;br /&gt;
           HOME=/&lt;br /&gt;
&lt;br /&gt;
           # run-parts&lt;br /&gt;
           01 * * * * root run-parts /etc/cron.hourly&lt;br /&gt;
           02 4 * * * root run-parts /etc/cron.daily&lt;br /&gt;
           22 4 * * 0 root run-parts /etc/cron.weekly&lt;br /&gt;
           42 4 1 * * root run-parts /etc/cron.monthly&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 22:&lt;br /&gt;
&lt;br /&gt;
     Keeping Files in Sync Between Servers.&lt;br /&gt;
&lt;br /&gt;
     The remote computer is &amp;quot;192.168.1.171&amp;quot; and has the account &amp;quot;donkey&amp;quot;.  You want&lt;br /&gt;
     to &amp;quot;keep in sync&amp;quot; the files under &amp;quot;/home/cu2000/Logs&amp;quot; on the remote computer&lt;br /&gt;
     with files on &amp;quot;/home/chirico/dev/MEDIA_Server&amp;quot; on the local computer.&lt;br /&gt;
&lt;br /&gt;
       $ rsync  -Lae ssh  donkey@192.168.1.171:/home/cu2000/Logs /home/chirico/dev/MEDIA_Server&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;rsync&amp;quot; is a convient command for keeping files in sync, and as shown here will work&lt;br /&gt;
     through ssh.  The -L option tells rsync to treat symbolic links like ordinary files.&lt;br /&gt;
&lt;br /&gt;
        Also see [http://www.rsnapshot.org/]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 23:&lt;br /&gt;
&lt;br /&gt;
     Looking up the Spelling of a Word.&lt;br /&gt;
&lt;br /&gt;
        $ look &amp;lt;partial spelling&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     so the following will list all words that&lt;br /&gt;
     start with stuff&lt;br /&gt;
&lt;br /&gt;
        $ look stuff&lt;br /&gt;
           stuff&lt;br /&gt;
           stuffage&lt;br /&gt;
           stuffata&lt;br /&gt;
           stuffed&lt;br /&gt;
           stuffender&lt;br /&gt;
           stuffer&lt;br /&gt;
           stuffers&lt;br /&gt;
           stuffgownsman&lt;br /&gt;
           stuffier&lt;br /&gt;
           stuffiest&lt;br /&gt;
           stuffily&lt;br /&gt;
           stuffiness&lt;br /&gt;
           stuffinesses&lt;br /&gt;
           stuffiness's&lt;br /&gt;
           stuffing&lt;br /&gt;
           stuffings&lt;br /&gt;
           stuffing's&lt;br /&gt;
           stuffless&lt;br /&gt;
           stuffs&lt;br /&gt;
           stuffy&lt;br /&gt;
&lt;br /&gt;
     It helps to have a large &amp;quot;linuxwords&amp;quot; dictionary.  You can download&lt;br /&gt;
     a much bigger dictionary from the following:&lt;br /&gt;
&lt;br /&gt;
              http://prdownloads.sourceforge.net/souptonuts/linuxwords.1.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
     Note: vim users can setup the .vimrc file with the following. Now when you type &lt;br /&gt;
       CTL-X CTL-T in insert mode, you'll get a thesaurus lookup.&lt;br /&gt;
&lt;br /&gt;
           set dictionary+=/usr/share/dict/words&lt;br /&gt;
           set thesaurus+=/usr/share/dict/words&lt;br /&gt;
&lt;br /&gt;
     Or, you can call aspell with the F6 command after putting the folling entry in your&lt;br /&gt;
     .vimrc file&lt;br /&gt;
&lt;br /&gt;
           :nmap &amp;lt;F6&amp;gt; :w&amp;lt;CR&amp;gt;:!aspell -e -c %&amp;lt;CR&amp;gt;:e&amp;lt;CR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Now, hit F6 when you're in vim, and you'll get a spell checker.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     There is also an X Windows dictionary that runs with the following command.&lt;br /&gt;
&lt;br /&gt;
           $ gnome-dictionary&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 24:&lt;br /&gt;
&lt;br /&gt;
     Find out if a Command is Aliased.&lt;br /&gt;
&lt;br /&gt;
         $ type -all &amp;lt;command&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Example:&lt;br /&gt;
&lt;br /&gt;
         $ type -all ls&lt;br /&gt;
            ls is aliased to `ls --color=tty'&lt;br /&gt;
            ls is /bin/ls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 25:&lt;br /&gt;
&lt;br /&gt;
     Create a Terminal Calculator&lt;br /&gt;
&lt;br /&gt;
      Put the following in your .bashrc file&lt;br /&gt;
&lt;br /&gt;
            function calc&lt;br /&gt;
            {&lt;br /&gt;
             echo &amp;quot;${1}&amp;quot;|bc -l;&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
      Or, run it at the shell prompt. Now&lt;br /&gt;
      &amp;quot;calc&amp;quot; from the shell will work as follows:&lt;br /&gt;
&lt;br /&gt;
            $ calc 3+45&lt;br /&gt;
               48&lt;br /&gt;
&lt;br /&gt;
      All functions  with a &amp;quot;(&amp;quot; or &amp;quot;)&amp;quot; must be enclosed&lt;br /&gt;
      in quotes.  For instance, to get the sin of .4&lt;br /&gt;
&lt;br /&gt;
            $ calc &amp;quot;s(.4)&amp;quot;&lt;br /&gt;
              .38941834230865049166&lt;br /&gt;
&lt;br /&gt;
          (See TIP 115 using the expr command)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 26:&lt;br /&gt;
&lt;br /&gt;
     Kill a User and All Their Current Processes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        #  This program will kill all processes from a&lt;br /&gt;
        #  user.  The user name is read from the command line.&lt;br /&gt;
        #&lt;br /&gt;
        #  This program also demonstrates reading a bash variable&lt;br /&gt;
        #  into an awk script.&lt;br /&gt;
        #&lt;br /&gt;
        #  Usage: kill9user &amp;lt;user&amp;gt;&lt;br /&gt;
        #&lt;br /&gt;
        kill -9 `ps aux|awk -v var=$1 '$1==var { print $2 }'`&lt;br /&gt;
&lt;br /&gt;
    or if you want want to create the above script the command&lt;br /&gt;
    below will kill the user &amp;quot;donkey&amp;quot; and all of his processes.&lt;br /&gt;
&lt;br /&gt;
        $ kill -9 `ps aux|awk -v var=&amp;quot;donkey&amp;quot; '$1==var { print $2 }'`&lt;br /&gt;
&lt;br /&gt;
    Check their cron jobs and &amp;quot;at&amp;quot; jobs, if you have a security issue.&lt;br /&gt;
&lt;br /&gt;
          $ crontab -u &amp;lt;user&amp;gt; -e&lt;br /&gt;
&lt;br /&gt;
    Lock the account:&lt;br /&gt;
&lt;br /&gt;
          $ passwd -l &amp;lt;user&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Remove all authorized_keys&lt;br /&gt;
&lt;br /&gt;
          $ rm /home/user/.shosts&lt;br /&gt;
          $ rm /home/user/.rhosts&lt;br /&gt;
          $ rm -rf /home/user/.ssh&lt;br /&gt;
          $ rm /home/user/.forward&lt;br /&gt;
&lt;br /&gt;
      or consider&lt;br /&gt;
&lt;br /&gt;
          $ mv /home/user  /home/safeuser&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Change the shell&lt;br /&gt;
&lt;br /&gt;
          $ chsh -s /bin/true &amp;lt;user&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Do an inventory&lt;br /&gt;
&lt;br /&gt;
          $ find / -user &amp;lt;user&amp;gt;  &amp;gt; list_of_user_files&lt;br /&gt;
&lt;br /&gt;
    NOTE: Also see (TIP 10).&lt;br /&gt;
&lt;br /&gt;
    To see all users, except the current user. Do not use the&lt;br /&gt;
    dash &amp;quot;ps -aux&amp;quot; is wrong but the following is correct:&lt;br /&gt;
&lt;br /&gt;
          $ ps aux| awk '!/'${USER}'/{printf(&amp;quot;%s \n&amp;quot;,$0)}'&lt;br /&gt;
&lt;br /&gt;
     or (ww = wide, wide output)&lt;br /&gt;
&lt;br /&gt;
          $ ps auwwx| awk '!/'${USER}'/{printf(&amp;quot;%s \n&amp;quot;,$0)}'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    The following codes may be useful:&lt;br /&gt;
&lt;br /&gt;
       D    Uninterruptible sleep (usually IO)&lt;br /&gt;
       R    Running or runnable (on run queue)&lt;br /&gt;
       S    Interruptible sleep (waiting for an event to complete)&lt;br /&gt;
       T    Stopped, either by a job control signal or because it is being traced.&lt;br /&gt;
       W    paging (not valid since the 2.6.xx kernel)&lt;br /&gt;
       X    dead (should never be seen)&lt;br /&gt;
       Z    Defunct (&amp;quot;zombie&amp;quot;) process, terminated but not reaped by its parent.&lt;br /&gt;
&lt;br /&gt;
    For BSD formats and when the stat keyword is used, additional&lt;br /&gt;
       characters may be displayed:&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;    high-priority (not nice to other users)&lt;br /&gt;
       N    low-priority (nice to other users)&lt;br /&gt;
       L    has pages locked into memory (for real-time and custom IO)&lt;br /&gt;
       s    is a session leader&lt;br /&gt;
       l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)&lt;br /&gt;
       +    is in the foreground process group&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Also see TIP 28. and TIP 89.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 27:&lt;br /&gt;
&lt;br /&gt;
     Format Dates for Logs and Files&lt;br /&gt;
&lt;br /&gt;
         $ date &amp;quot;+%m%d%y %A,%B %d %Y %X&amp;quot;&lt;br /&gt;
             061704 Thursday,June 17 2004 07:13:40 PM&lt;br /&gt;
&lt;br /&gt;
         $ date &amp;quot;+%m%d%Y&amp;quot;&lt;br /&gt;
             06172004&lt;br /&gt;
&lt;br /&gt;
         $ date -d '1 day ago' &amp;quot;+%m%d%Y&amp;quot;&lt;br /&gt;
             06162004&lt;br /&gt;
&lt;br /&gt;
         $ date -d '3 months 1 day  2 hour  15 minutes 2 seconds ago'&lt;br /&gt;
&lt;br /&gt;
      or to go into the future remove the &amp;quot;ago&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         $ date -d '3 months 1 day  2 hour  15 minutes 2 seconds '&lt;br /&gt;
&lt;br /&gt;
            Also the following works:&lt;br /&gt;
&lt;br /&gt;
                $ date -d '+2 year +1 month -1 week  +3 day -8 hour +2 min -5 seconds'&lt;br /&gt;
&lt;br /&gt;
      Quick question: If there are 100,000,000 stars in the visible sky, and you can&lt;br /&gt;
      count them, round the clock, at a rate of a star per second starting now, when&lt;br /&gt;
      would you finish counting?  Would you still be alive?&lt;br /&gt;
&lt;br /&gt;
                $ date -d '+100000000 seconds'&lt;br /&gt;
&lt;br /&gt;
      Sooner than you think!&lt;br /&gt;
&lt;br /&gt;
      This can be assigned to variables&lt;br /&gt;
&lt;br /&gt;
         $ mdate=`date -d '3 months 1 day  2 hour  15 minutes 2 seconds ' &amp;quot;+%m%d%Y_%A_%B_%D_%Y_%X&amp;quot;  `&lt;br /&gt;
         $ echo $mdate&lt;br /&gt;
             09182004_Saturday_September_09/18/04_2004_09:40:41 PM&lt;br /&gt;
             ^---- Easy to sort   ^-------^----- Easy to read&lt;br /&gt;
&lt;br /&gt;
      See TIP 28 below.&lt;br /&gt;
&lt;br /&gt;
      See TIP 87 when working with large delta time changes -40 years, or -200 years ago, or even&lt;br /&gt;
      1,000,000 days into the future.&lt;br /&gt;
&lt;br /&gt;
      Also see (TIP 1) for working with time zones.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 28:&lt;br /&gt;
&lt;br /&gt;
     Need Ascii Codes? For instance, for printing quotes:&lt;br /&gt;
&lt;br /&gt;
                         awk 'BEGIN { msg = &amp;quot;Don\047t Panic!&amp;quot;; printf &amp;quot;%s \n&amp;quot;,msg }'&lt;br /&gt;
              or&lt;br /&gt;
                         awk 'BEGIN { msg = &amp;quot;Don\x027t Panic!&amp;quot;; printf &amp;quot;%s \n&amp;quot;,msg }'&lt;br /&gt;
&lt;br /&gt;
     It's better to use \047, because certain characters that follow \x027 may cause problems.&lt;br /&gt;
&lt;br /&gt;
     For example, take a look at the following two lines. The first line prints a &amp;quot;}&amp;quot; caused&lt;br /&gt;
     by the extra D in \x027D. The the line immediately below does not work as expected.&lt;br /&gt;
&lt;br /&gt;
                      awk 'BEGIN {printf(&amp;quot;The D causes problems \x027D\n&amp;quot;)}'&lt;br /&gt;
&lt;br /&gt;
            However, the line below works fine:&lt;br /&gt;
&lt;br /&gt;
                      awk 'BEGIN {printf(&amp;quot;The D does not cause problems \047D\n&amp;quot;)}'&lt;br /&gt;
&lt;br /&gt;
     Or if you wanted to use the date command in &amp;quot;awk&amp;quot; to print date.time.nanosecond.timezone for&lt;br /&gt;
     each line of a file &amp;quot;test&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     The following date can be used in awk because the single quotes are enclosed within the&lt;br /&gt;
     double quotes.&lt;br /&gt;
&lt;br /&gt;
             date '+%m%d%Y.%H%M%S.%N%z'&lt;br /&gt;
&lt;br /&gt;
       $ awk 'BEGIN { &amp;quot;date '+%m%d%Y.%H%M%S.%N%z'&amp;quot; | getline MyDate  } { print MyDate,$0 }' &amp;lt; data&lt;br /&gt;
&lt;br /&gt;
     But it's also possible to replace  &amp;quot;+&amp;quot;  with  \x2B,  &amp;quot;%&amp;quot; with \x25, and &amp;quot;d&amp;quot; with \x64 as follows:&lt;br /&gt;
&lt;br /&gt;
       $ awk 'BEGIN { &amp;quot;date \x27\x2B\x25m\x25\x64\x25Y.\x25H\x25M\x25S.\x25N\x25z\x27&amp;quot; | getline MyDate  } { print MyDate,$0 }' &amp;lt; test&lt;br /&gt;
&lt;br /&gt;
             07062004.113820.346033000-0400 bob 71&lt;br /&gt;
             07062004.113820.346033000-0400 tom 43&lt;br /&gt;
             07062004.113820.346033000-0400 sal 34&lt;br /&gt;
             07062004.113820.346033000-0400 bob 89&lt;br /&gt;
             07062004.113820.346033000-0400 tom 66&lt;br /&gt;
             07062004.113820.346033000-0400 sal 99&lt;br /&gt;
&lt;br /&gt;
     For this example it's not needed because single quotes are used inside of double quotes; however, there may be times when&lt;br /&gt;
     hex replacement is easier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ man ascii&lt;br /&gt;
&lt;br /&gt;
        Oct   Dec   Hex   Char           Oct   Dec   Hex   Char&lt;br /&gt;
            -----------------------------------------------------------&lt;br /&gt;
            000   0     00    NUL '\0'       100   64    40    @&lt;br /&gt;
            001   1     01    SOH            101   65    41    A&lt;br /&gt;
            002   2     02    STX            102   66    42    B&lt;br /&gt;
            003   3     03    ETX            103   67    43    C&lt;br /&gt;
            004   4     04    EOT            104   68    44    D&lt;br /&gt;
            005   5     05    ENQ            105   69    45    E&lt;br /&gt;
            006   6     06    ACK            106   70    46    F&lt;br /&gt;
            007   7     07    BEL '\a'       107   71    47    G&lt;br /&gt;
            010   8     08    BS  '\b'       110   72    48    H&lt;br /&gt;
            011   9     09    HT  '\t'       111   73    49    I&lt;br /&gt;
            012   10    0A    LF  '\n'       112   74    4A    J&lt;br /&gt;
            013   11    0B    VT  '\v'       113   75    4B    K&lt;br /&gt;
            014   12    0C    FF  '\f'       114   76    4C    L&lt;br /&gt;
            015   13    0D    CR  '\r'       115   77    4D    M&lt;br /&gt;
            016   14    0E    SO             116   78    4E    N&lt;br /&gt;
            017   15    0F    SI             117   79    4F    O&lt;br /&gt;
            020   16    10    DLE            120   80    50    P&lt;br /&gt;
            021   17    11    DC1            121   81    51    Q&lt;br /&gt;
            022   18    12    DC2            122   82    52    R&lt;br /&gt;
            023   19    13    DC3            123   83    53    S&lt;br /&gt;
            024   20    14    DC4            124   84    54    T&lt;br /&gt;
            025   21    15    NAK            125   85    55    U&lt;br /&gt;
            026   22    16    SYN            126   86    56    V&lt;br /&gt;
            027   23    17    ETB            127   87    57    W&lt;br /&gt;
            030   24    18    CAN            130   88    58    X&lt;br /&gt;
            031   25    19    EM             131   89    59    Y&lt;br /&gt;
            032   26    1A    SUB            132   90    5A    Z&lt;br /&gt;
            033   27    1B    ESC            133   91    5B    [&lt;br /&gt;
            034   28    1C    FS             134   92    5C    \   '\\'&lt;br /&gt;
            035   29    1D    GS             135   93    5D    ]&lt;br /&gt;
            036   30    1E    RS             136   94    5E    ^&lt;br /&gt;
            037   31    1F    US             137   95    5F    _&lt;br /&gt;
            040   32    20    SPACE          140   96    60    `&lt;br /&gt;
            041   33    21    !              141   97    61    a&lt;br /&gt;
            042   34    22    &amp;quot;              142   98    62    b&lt;br /&gt;
            043   35    23    #              143   99    63    c&lt;br /&gt;
            044   36    24    $              144   100   64    d&lt;br /&gt;
            045   37    25    %              145   101   65    e&lt;br /&gt;
            046   38    26    &amp;amp;              146   102   66    f&lt;br /&gt;
            047   39    27    '              147   103   67    g&lt;br /&gt;
            050   40    28    (              150   104   68    h&lt;br /&gt;
            051   41    29    )              151   105   69    i&lt;br /&gt;
            052   42    2A    *              152   106   6A    j&lt;br /&gt;
            053   43    2B    +              153   107   6B    k&lt;br /&gt;
            054   44    2C    ,              154   108   6C    l&lt;br /&gt;
            055   45    2D    -              155   109   6D    m&lt;br /&gt;
            056   46    2E    .              156   110   6E    n&lt;br /&gt;
            057   47    2F    /              157   111   6F    o&lt;br /&gt;
            060   48    30    0              160   112   70    p&lt;br /&gt;
            061   49    31    1              161   113   71    q&lt;br /&gt;
            062   50    32    2              162   114   72    r&lt;br /&gt;
            063   51    33    3              163   115   73    s&lt;br /&gt;
            064   52    34    4              164   116   74    t&lt;br /&gt;
            065   53    35    5              165   117   75    u&lt;br /&gt;
            066   54    36    6              166   118   76    v&lt;br /&gt;
            067   55    37    7              167   119   77    w&lt;br /&gt;
            070   56    38    8              170   120   78    x&lt;br /&gt;
            071   57    39    9              171   121   79    y&lt;br /&gt;
            072   58    3A    :              172   122   7A    z&lt;br /&gt;
            073   59    3B    ;              173   123   7B    {&lt;br /&gt;
            074   60    3C    &amp;lt;              174   124   7C    |&lt;br /&gt;
            075   61    3D    =              175   125   7D    }&lt;br /&gt;
            076   62    3E    &amp;gt;              176   126   7E    ~&lt;br /&gt;
            077   63    3F    ?              177   127   7F    DEL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 29:&lt;br /&gt;
&lt;br /&gt;
     Need a WWW Browser for the Terminal Session? Try lynx or elinks.&lt;br /&gt;
&lt;br /&gt;
         $ lynx&lt;br /&gt;
&lt;br /&gt;
     Or to read all these tips, with the latest updates&lt;br /&gt;
&lt;br /&gt;
      $ lynx http://umn.dl.sourceforge.net/sourceforge/souptonuts/How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Or, better yet elinks.&lt;br /&gt;
&lt;br /&gt;
         $ elinks http://somepage.&lt;br /&gt;
&lt;br /&gt;
     You can get elinks at the following site:&lt;br /&gt;
&lt;br /&gt;
             http://elinks.or.cz/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 30:&lt;br /&gt;
&lt;br /&gt;
    screen - screen manager with VT100/ANSI terminal emulation&lt;br /&gt;
&lt;br /&gt;
         This is an excellent utility. But if you work a lot in Emacs,&lt;br /&gt;
         then, you should place the following in your ~./.bashrc&lt;br /&gt;
&lt;br /&gt;
             alias s='screen -e^Pa -D -R'&lt;br /&gt;
&lt;br /&gt;
         After loging in again (or source .bashrc) ,&lt;br /&gt;
         type the following to load &amp;quot;screen&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
             $ s&lt;br /&gt;
&lt;br /&gt;
         If you're using the not using the alias command above, substitute&lt;br /&gt;
         CTL-a for CTL-p below. :&lt;br /&gt;
&lt;br /&gt;
             CTL-p CTL-C       To get a new session&lt;br /&gt;
             CTL-p  &amp;quot;           To list sessions, and arrow keys to move&lt;br /&gt;
             CTL-p SHFT-A      To name sessions&lt;br /&gt;
             CTL-p S            To split screens&lt;br /&gt;
             CLT-p Q            To unsplit screens&lt;br /&gt;
             CLT-p TAB          To switch between screens&lt;br /&gt;
             CLT-p :resize n    To resize screen to n rows, on split screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Screen is very powerful.  Should you become disconneced, you can&lt;br /&gt;
         still resume work after loggin in.&lt;br /&gt;
&lt;br /&gt;
             $ man screen&lt;br /&gt;
&lt;br /&gt;
         The above command will give you more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 31:&lt;br /&gt;
&lt;br /&gt;
     Need to Find the Factors of a Number?&lt;br /&gt;
&lt;br /&gt;
           $ factor 2345678992&lt;br /&gt;
                2345678992: 2 2 2 2 6581 22277&lt;br /&gt;
&lt;br /&gt;
     It's a quick way to find out if a number is prime&lt;br /&gt;
&lt;br /&gt;
           $ factor 7867&lt;br /&gt;
                7867: 7867&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 32:&lt;br /&gt;
&lt;br /&gt;
     Less is More -- piping to less to scroll backword and forward&lt;br /&gt;
&lt;br /&gt;
      For large &amp;quot;ls&amp;quot; listings try the followin, then, use the arrow key&lt;br /&gt;
      to move up and down the list.&lt;br /&gt;
&lt;br /&gt;
           $ ls /some_large_dir/ | less&lt;br /&gt;
&lt;br /&gt;
                 or&lt;br /&gt;
&lt;br /&gt;
           $ cat some_large_file | less&lt;br /&gt;
&lt;br /&gt;
                 or&lt;br /&gt;
&lt;br /&gt;
           $ less some_large_file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 33:&lt;br /&gt;
&lt;br /&gt;
     C &amp;quot;indent&amp;quot; Settings for Kernel Development&lt;br /&gt;
&lt;br /&gt;
           $ indent -kr -i8  program.c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 34:&lt;br /&gt;
&lt;br /&gt;
     FTP auto-login.  &amp;quot;ftp&amp;quot; to a site and have the password stored.&lt;br /&gt;
&lt;br /&gt;
     For instance, here's a sample &amp;quot;.net&amp;quot; file in a user's home&lt;br /&gt;
     directory for uploading to sourceforge. Note, sourceforge will&lt;br /&gt;
     take any password, so m@temp.com is used here for login &amp;quot;anonymous&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ cat ~/.netrc&lt;br /&gt;
               machine upload.sourceforge.net login anonymous password m@temp.com&lt;br /&gt;
               default login anonymous password user@site&lt;br /&gt;
&lt;br /&gt;
     It might be a good idea to change the rights on this file&lt;br /&gt;
&lt;br /&gt;
           $ chmod 0400 ~/.netrc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         #!/bin/bash&lt;br /&gt;
         #&lt;br /&gt;
         #  Sample ftp automated script to download&lt;br /&gt;
         #  file to ${dwnld}&lt;br /&gt;
         #&lt;br /&gt;
         dwnld=&amp;quot;/work/faq/unix-faq&amp;quot;&lt;br /&gt;
         cd ${dwnld}&lt;br /&gt;
         ftp &amp;lt;&amp;lt; FTPSTRING&lt;br /&gt;
         prompt off&lt;br /&gt;
         open rtfm.mit.edu&lt;br /&gt;
         cd /pub/usenet-by-group/news.answers/unix-faq/faq&lt;br /&gt;
         mget contents&lt;br /&gt;
         mget diff&lt;br /&gt;
         mget part*&lt;br /&gt;
         bye&lt;br /&gt;
         FTPSTRING&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      (Also see TIP 114 for ncftpget, which is a very powerful restarting&lt;br /&gt;
                            ftp program)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 35:&lt;br /&gt;
&lt;br /&gt;
     Bash Brace Expansion&lt;br /&gt;
&lt;br /&gt;
           $ echo f{ee,ie,oe,um}&lt;br /&gt;
                fee fie foe fum&lt;br /&gt;
&lt;br /&gt;
     This works with almost any command&lt;br /&gt;
&lt;br /&gt;
           $ mkdir -p /work/junk/{one,two,three,four}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 36:&lt;br /&gt;
&lt;br /&gt;
     Getting a List of Users on the System&lt;br /&gt;
&lt;br /&gt;
           $ cut -d: -f1 /etc/passwd | sort&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 37:&lt;br /&gt;
&lt;br /&gt;
     Editing a Bash Command&lt;br /&gt;
&lt;br /&gt;
      Try typing a long command say, then, type &amp;quot;fc&amp;quot; for an easy way&lt;br /&gt;
      to edit the command.&lt;br /&gt;
&lt;br /&gt;
           $ find /etc -iname '*.cnf' -exec grep -H 'log' {} \;&lt;br /&gt;
           $ fc&lt;br /&gt;
&lt;br /&gt;
      &amp;quot;fc&amp;quot; will bring the last command typed into an editor, &amp;quot;emacs&amp;quot; if&lt;br /&gt;
      that's the default editor. Type &amp;quot;fc -l&amp;quot; to list last few commands.&lt;br /&gt;
&lt;br /&gt;
      To seach for a command, try typing &amp;quot;CTL-r&amp;quot; at the shell prompt for&lt;br /&gt;
      searching. &amp;quot;CTL-t&amp;quot; to transpose, say &amp;quot;sl&amp;quot; was typed by you want &amp;quot;ls&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Hints when using &amp;quot;fc: in emacs:&lt;br /&gt;
&lt;br /&gt;
           ESC-b     move one word backward&lt;br /&gt;
           ESC-f     move one word forward&lt;br /&gt;
           ESC-DEL   kill one word backward&lt;br /&gt;
           CTL-k     kill point to end&lt;br /&gt;
           CTL-y     un-yank killed region at point&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 38:&lt;br /&gt;
&lt;br /&gt;
     Moving around Directories.&lt;br /&gt;
&lt;br /&gt;
     Change to the home directory:&lt;br /&gt;
          $ cd ~&lt;br /&gt;
            or&lt;br /&gt;
          $ cd&lt;br /&gt;
&lt;br /&gt;
     To go back to the last directory&lt;br /&gt;
          $ cd -&lt;br /&gt;
&lt;br /&gt;
     Instead of &amp;quot;cd&amp;quot; to a directory try &amp;quot;pushd&amp;quot; and look&lt;br /&gt;
     at the heading...you can see a list of directories.&lt;br /&gt;
&lt;br /&gt;
          $ pushd /etc&lt;br /&gt;
          $ pushd /usr/local&lt;br /&gt;
&lt;br /&gt;
      Then, to get back &amp;quot;popd&amp;quot; or &amp;quot;popd 1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      To list all the directories pushed on the stack&lt;br /&gt;
      use the &amp;quot;dirs -v&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
          $ dirs -v&lt;br /&gt;
           0  /usr/local&lt;br /&gt;
           1  /etc&lt;br /&gt;
           2  /work/souptonuts/documentation/theBook&lt;br /&gt;
&lt;br /&gt;
      Now, if you &amp;quot;pushd +1&amp;quot; you will be moved to &amp;quot;/etc&amp;quot;, since&lt;br /&gt;
      is number &amp;quot;1&amp;quot; on the stack, and this directory will become&lt;br /&gt;
      &amp;quot;0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ pwd&lt;br /&gt;
           /usr/local&lt;br /&gt;
          $ pushd +1&lt;br /&gt;
          $ pwd&lt;br /&gt;
           /etc&lt;br /&gt;
&lt;br /&gt;
          $ dirs -v&lt;br /&gt;
           0  /etc&lt;br /&gt;
           1  /work/souptonuts/documentation/theBook&lt;br /&gt;
           2  /usr/local&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 39:&lt;br /&gt;
&lt;br /&gt;
     Need an Underscore after a Variable?&lt;br /&gt;
&lt;br /&gt;
       Enclose the variable in &amp;quot;{}&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $echo ${UID}_&lt;br /&gt;
&lt;br /&gt;
       Compare to&lt;br /&gt;
&lt;br /&gt;
          $echo $UID_&lt;br /&gt;
&lt;br /&gt;
       Also try the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ m=&amp;quot;my stuff here&amp;quot;&lt;br /&gt;
                $ echo -e ${m// /'\n'}&lt;br /&gt;
                        my&lt;br /&gt;
                        stuff&lt;br /&gt;
                        here&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 40:&lt;br /&gt;
&lt;br /&gt;
     Bash Variable Offset and String Operators&lt;br /&gt;
&lt;br /&gt;
        $ r=&amp;quot;this is stuff&amp;quot;&lt;br /&gt;
        $ echo ${r:3}&lt;br /&gt;
        $ echo ${r:5:2}&lt;br /&gt;
&lt;br /&gt;
      Note, ${varname:offset:length}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         ${varname:?message}  If varname exist and isn't null return value, else,&lt;br /&gt;
                              print var and message.&lt;br /&gt;
&lt;br /&gt;
           $ r=&amp;quot;new stuff&amp;quot;&lt;br /&gt;
           $ echo ${r:? &amp;quot;that's r for you&amp;quot;}&lt;br /&gt;
               new stuff&lt;br /&gt;
           $ unset r&lt;br /&gt;
           $ echo ${r:? &amp;quot;that's r for you&amp;quot;}&lt;br /&gt;
               bash: r:  that's r for you&lt;br /&gt;
&lt;br /&gt;
         ${varname:+word}    If varname exist and not null return word. Else, return null.&lt;br /&gt;
&lt;br /&gt;
         ${varname:-word}    If varname exist and not null return value. Else, return word.&lt;br /&gt;
&lt;br /&gt;
      Working with arrays in bash - bash arrays.&lt;br /&gt;
&lt;br /&gt;
           $ unset p&lt;br /&gt;
           $ p=(one two three)&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[@]}&amp;quot;&lt;br /&gt;
           one two three&lt;br /&gt;
&lt;br /&gt;
      or&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[*]}&amp;quot;&lt;br /&gt;
           one two three&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${#p[@]}&amp;quot;&lt;br /&gt;
           3&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[0]}&amp;quot;&lt;br /&gt;
           one&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[1]}&amp;quot;&lt;br /&gt;
           two&lt;br /&gt;
&lt;br /&gt;
            Also see (TIP 95)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 41:&lt;br /&gt;
&lt;br /&gt;
     Loops in Bash&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The command below loops through directories listed in $PATH.&lt;br /&gt;
&lt;br /&gt;
          $ path=$PATH:&lt;br /&gt;
          $ while [ $path ]; do echo &amp;quot; ${path%%:*} &amp;quot;; path=${path#*:}; done&lt;br /&gt;
&lt;br /&gt;
       The command below will also loop through directories in your path.&lt;br /&gt;
&lt;br /&gt;
          $IFS=:&lt;br /&gt;
          $ for dir in $PATH&lt;br /&gt;
          &amp;gt; do&lt;br /&gt;
          &amp;gt; ls -ld $dir&lt;br /&gt;
          &amp;gt; done&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Jun 10 20:16 /usr/local/bin&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Jun 13 23:12 /bin&lt;br /&gt;
              drwxr-xr-x    3 root     root        40960 Jun 12 08:00 /usr/bin&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Feb 14 03:12 /usr/X11R6/bin&lt;br /&gt;
              drwxrwxr-x    2 chirico  chirico      4096 Jun  6 13:06 /home/chirico/bin&lt;br /&gt;
&lt;br /&gt;
     Other ways of doing loops:&lt;br /&gt;
&lt;br /&gt;
        for (( i=1; i &amp;lt;= 20; i++))&lt;br /&gt;
                do&lt;br /&gt;
                        echo -n &amp;quot;$i &amp;quot;&lt;br /&gt;
                done&lt;br /&gt;
&lt;br /&gt;
     Note, to do it all on one line, do the following:&lt;br /&gt;
&lt;br /&gt;
        $ for (( i=1; i &amp;lt;= 20; i++)); do echo -n &amp;quot;$i&amp;quot;; done&lt;br /&gt;
&lt;br /&gt;
     Below, is an example of declaring i an integer so that you do not&lt;br /&gt;
     have to preface with let.&lt;br /&gt;
&lt;br /&gt;
          $ declare -i i&lt;br /&gt;
          $ i=5;&lt;br /&gt;
          $ while (( $i &amp;gt; 1 )); do&lt;br /&gt;
          &amp;gt; i=i-1&lt;br /&gt;
          &amp;gt; echo $i&lt;br /&gt;
          &amp;gt; done&lt;br /&gt;
          4&lt;br /&gt;
          3&lt;br /&gt;
          2&lt;br /&gt;
&lt;br /&gt;
     You can also use &amp;quot;while [ $i -gt 1 ]; do&amp;quot;  in place of &amp;quot;while (( $i &amp;gt; 1 )); do&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     To get a listing of all declared values&lt;br /&gt;
&lt;br /&gt;
          $ declare -i&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Try putting a few words in the file &amp;quot;test&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         $ while read filename; do echo  &amp;quot;- $filename &amp;quot;; done &amp;lt; test |nl -w1&lt;br /&gt;
&lt;br /&gt;
     Or, using an array&lt;br /&gt;
&lt;br /&gt;
                declare -a Array&lt;br /&gt;
                Array[0]=&amp;quot;zero&amp;quot;&lt;br /&gt;
                Array[1]=&amp;quot;one&amp;quot;&lt;br /&gt;
                Array[2]=&amp;quot;two&amp;quot;&lt;br /&gt;
                for i in `seq ${#Array[@]}`&lt;br /&gt;
                do&lt;br /&gt;
                  echo $Array[$i-1]&lt;br /&gt;
                done&lt;br /&gt;
&lt;br /&gt;
         Also see (TIP 95 and TIP 133).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 42:&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;diff&amp;quot; and &amp;quot;patch&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
        You have created a program &amp;quot;prog.c&amp;quot;, saved as this name and also copied&lt;br /&gt;
        to  &amp;quot;prog.c.old&amp;quot;. You post &amp;quot;prog.c&amp;quot; to users.  Next, you make changes&lt;br /&gt;
        to prog.c&lt;br /&gt;
&lt;br /&gt;
          $ diff -c prog.c.old prog.c &amp;gt; prog.patch&lt;br /&gt;
&lt;br /&gt;
        Now, users can get the latest updates by running.&lt;br /&gt;
&lt;br /&gt;
          $ patch &amp;lt; prog.patch&lt;br /&gt;
&lt;br /&gt;
        By the way, you can make backups of your data easily.&lt;br /&gt;
&lt;br /&gt;
          $ cp /etc/fstab{,.bak}&lt;br /&gt;
&lt;br /&gt;
        Now, you do your edits to &amp;quot;/etc/fstab&amp;quot; and if you need&lt;br /&gt;
        to go back to the original, you can find it at&lt;br /&gt;
        &amp;quot;/etc/fstab.bak&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 43:&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;cat&amp;quot; the Contents of Files Listed in a File, in That Order.&lt;br /&gt;
&lt;br /&gt;
       SETUP (Assume you have the following)&lt;br /&gt;
&lt;br /&gt;
              $ cat file_of_files&lt;br /&gt;
                  file1&lt;br /&gt;
                  file2&lt;br /&gt;
&lt;br /&gt;
              $ cat file1&lt;br /&gt;
                  This is the data in file1&lt;br /&gt;
&lt;br /&gt;
              $ cat file 2&lt;br /&gt;
                  This is the data in file2&lt;br /&gt;
&lt;br /&gt;
       So there are 3 files here &amp;quot;file_of_files&amp;quot; which contains the name of&lt;br /&gt;
       other files.  In this case &amp;quot;file1&amp;quot; and &amp;quot;file2&amp;quot;. And the contents of&lt;br /&gt;
       &amp;quot;file1&amp;quot; and &amp;quot;file2&amp;quot; is shown above.&lt;br /&gt;
&lt;br /&gt;
               $ cat file_of_files|xargs cat&lt;br /&gt;
                    This is the data in  file1&lt;br /&gt;
                    This is the data in  file2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 44:&lt;br /&gt;
&lt;br /&gt;
     Columns and Rows -- getting anything you want.&lt;br /&gt;
&lt;br /&gt;
     Assume you have the following file.&lt;br /&gt;
&lt;br /&gt;
        $ cat data&lt;br /&gt;
           1 2 3&lt;br /&gt;
           4 5&lt;br /&gt;
           6 7 8 9 10&lt;br /&gt;
           11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
     How to you get everything in  2 columns?&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l2&lt;br /&gt;
           1 2&lt;br /&gt;
           3 4&lt;br /&gt;
           5 6&lt;br /&gt;
           7 8&lt;br /&gt;
           9 10&lt;br /&gt;
           11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
    Three columns?&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l3&lt;br /&gt;
           1 2 3&lt;br /&gt;
           4 5 6&lt;br /&gt;
           7 8 9&lt;br /&gt;
           10 11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
    What's the row sum of the &amp;quot;three columns?&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
           6&lt;br /&gt;
           15&lt;br /&gt;
           24&lt;br /&gt;
           33&lt;br /&gt;
           27&lt;br /&gt;
&lt;br /&gt;
    or&lt;br /&gt;
&lt;br /&gt;
        $ tr ' ' '\n' &amp;lt; data |xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
&lt;br /&gt;
    NOTE &amp;quot;Steven Heiner's rule&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
             cat one_file | program&lt;br /&gt;
&lt;br /&gt;
           can always be rewritten as&lt;br /&gt;
&lt;br /&gt;
             program &amp;lt; one_file&lt;br /&gt;
&lt;br /&gt;
   Note: thanks to Steven Heiner (http://www.shelldorado.com/) the above can be&lt;br /&gt;
       shortened as follows:&lt;br /&gt;
&lt;br /&gt;
               $ tr ' ' '\n' &amp;lt; data|xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
&lt;br /&gt;
          Need to &amp;quot;tr&amp;quot; from the stdin?&lt;br /&gt;
&lt;br /&gt;
               $ tr &amp;quot;xy&amp;quot; &amp;quot;yx&amp;quot;| ... | ...&lt;br /&gt;
&lt;br /&gt;
       But there is a the &amp;quot;Stephane CHAZELAS&amp;quot; condition here&lt;br /&gt;
&lt;br /&gt;
         &amp;quot;Note that tr, sed, and awk mail fail on files containing '\0'&lt;br /&gt;
          sed and awk have unspecified behaviors if the input&lt;br /&gt;
          doesn't end in a '\n' (or to sum up, cat works for&lt;br /&gt;
          binary and text files, text utilities such as sed or awk&lt;br /&gt;
          work only for text files).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 45:&lt;br /&gt;
&lt;br /&gt;
     Auto Directory Spelling Corrections.&lt;br /&gt;
&lt;br /&gt;
      To turn this on:&lt;br /&gt;
&lt;br /&gt;
           $ shopt -s cdspell&lt;br /&gt;
&lt;br /&gt;
      Now mispell a directory in the cd command.&lt;br /&gt;
&lt;br /&gt;
           $ cd /usk/local&lt;br /&gt;
                   ^-------- still gets you to --&lt;br /&gt;
                                                |&lt;br /&gt;
                                            /usr/local&lt;br /&gt;
&lt;br /&gt;
      What other options can you set? The following will list&lt;br /&gt;
      all the options:&lt;br /&gt;
&lt;br /&gt;
           $ shopt -p&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 46:&lt;br /&gt;
&lt;br /&gt;
     Record Eveything Printed on Your Terminal Screen.&lt;br /&gt;
&lt;br /&gt;
            $ script -a &amp;lt;filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Now start doing stuff and &amp;quot;everything&amp;quot; is appended to &amp;lt;filename&amp;gt;.&lt;br /&gt;
     For example&lt;br /&gt;
&lt;br /&gt;
            $ script installation&lt;br /&gt;
&lt;br /&gt;
            $ (command)&lt;br /&gt;
&lt;br /&gt;
            $ (result)&lt;br /&gt;
&lt;br /&gt;
            $ ...&lt;br /&gt;
&lt;br /&gt;
            $ ...&lt;br /&gt;
&lt;br /&gt;
            $ (command)&lt;br /&gt;
&lt;br /&gt;
            $ (result)&lt;br /&gt;
&lt;br /&gt;
            $ exit&lt;br /&gt;
&lt;br /&gt;
     The whole session log is in the installation file that you can later&lt;br /&gt;
     read and/or cleanup and add to a documentation.&lt;br /&gt;
&lt;br /&gt;
     This command can also be used to redirect the contents to another user,&lt;br /&gt;
     but you must be root to do this.&lt;br /&gt;
&lt;br /&gt;
     Step 1 - find out what pts they are using.&lt;br /&gt;
&lt;br /&gt;
            $ w&lt;br /&gt;
&lt;br /&gt;
     Step 2 - Run script on that pts. After running this command below&lt;br /&gt;
              everything you type will appear on their screen.&lt;br /&gt;
&lt;br /&gt;
            $ script /dev/pts/4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Thanks to Jacques.GARNIER-EXTERIEUR@EU.RHODIA.COM for his contribution&lt;br /&gt;
     to this tip.&lt;br /&gt;
&lt;br /&gt;
     Also reference TIP 208.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 47:&lt;br /&gt;
&lt;br /&gt;
     Monitor all Network Traffic Except Your Current ssh Connection.&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX -s 1500 port not 22&lt;br /&gt;
&lt;br /&gt;
       Or to filter out port 123 as well getting the full length of the packet&lt;br /&gt;
       (-s 0), use the following:&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX -s 0 port not 22  and port not 123&lt;br /&gt;
&lt;br /&gt;
       Or to filter only a certain host say 81.169.158.205&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX  port not 22 and host 81.169.158.205&lt;br /&gt;
&lt;br /&gt;
     Just want ip addresses and a little bit of data, then,&lt;br /&gt;
     use this. The &amp;quot;-c 20&amp;quot; is to stop after 20 packets.&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN  -s 1500 port not 22 -c 20&lt;br /&gt;
&lt;br /&gt;
     If you're looking for sign of DOS attacks, the following show just the SYN&lt;br /&gt;
     packets on all interfaces:&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump 'tcp[13] &amp;amp; 2 == 2'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 48:&lt;br /&gt;
&lt;br /&gt;
     Where are the GNU Reference Manuals?&lt;br /&gt;
&lt;br /&gt;
           http://www.gnu.org/manual/manual.html&lt;br /&gt;
&lt;br /&gt;
     Also worth a look the &amp;quot;Linux Documentation Project&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           http://en.tldp.org/&lt;br /&gt;
&lt;br /&gt;
     and Red Hat manuals&lt;br /&gt;
&lt;br /&gt;
           http://www.redhat.com/docs/manuals/enterprise/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 49:&lt;br /&gt;
&lt;br /&gt;
     Setting or Changing the Library Path.&lt;br /&gt;
&lt;br /&gt;
     The following contains the settings to be added or deleted&lt;br /&gt;
&lt;br /&gt;
           /etc/ld.so.conf&lt;br /&gt;
&lt;br /&gt;
     After this file is edited, you must run the following:&lt;br /&gt;
&lt;br /&gt;
           $ ldconfig&lt;br /&gt;
&lt;br /&gt;
     See &amp;quot;man ldconfig&amp;quot; for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 50:&lt;br /&gt;
&lt;br /&gt;
     Working with Libraries in C&lt;br /&gt;
&lt;br /&gt;
     Assume the following 3 programs:&lt;br /&gt;
&lt;br /&gt;
      $ cat ./src/test.c&lt;br /&gt;
&lt;br /&gt;
         int test(int t)&lt;br /&gt;
         {&lt;br /&gt;
           printf(&amp;quot;%d\n&amp;quot;,t);&lt;br /&gt;
           return t;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      $ cat ./src/prog1.c&lt;br /&gt;
&lt;br /&gt;
         /*&lt;br /&gt;
          program: prog1.c&lt;br /&gt;
          dependences: test.c&lt;br /&gt;
&lt;br /&gt;
          compiling this program:&lt;br /&gt;
          gcc -o prog test.c prog1.c&lt;br /&gt;
&lt;br /&gt;
          Note the libpersonal include&lt;br /&gt;
          should be remove if NOT using the&lt;br /&gt;
          library&lt;br /&gt;
         */&lt;br /&gt;
&lt;br /&gt;
         #include &amp;lt;libpersonal.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         int&lt;br /&gt;
         main(int argc, char **argv)&lt;br /&gt;
         {&lt;br /&gt;
           test(45);&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
      $ cat ./include/libpersonal.h&lt;br /&gt;
&lt;br /&gt;
         extern int test(int);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Prog1.c needs the test function in  test.c&lt;br /&gt;
     To compile, so that both programs work together, do the following:&lt;br /&gt;
&lt;br /&gt;
          $ cd src&lt;br /&gt;
          $ gcc -o prog test.c prog1.c -I../include&lt;br /&gt;
&lt;br /&gt;
     However, if you want to create your own static library, then, run the following:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p ../lib&lt;br /&gt;
          $ gcc -c test.c  -o ../lib/test.o&lt;br /&gt;
          $ cd ../lib&lt;br /&gt;
          $ ar r libpersonal.a test.o&lt;br /&gt;
          $ ranlib libpersonal.a&lt;br /&gt;
&lt;br /&gt;
     or, the ar and ranlib command can be combined as follows:&lt;br /&gt;
&lt;br /&gt;
          $ ar rs libpersonal.a test.o&lt;br /&gt;
&lt;br /&gt;
     To compile the program with the static library:&lt;br /&gt;
&lt;br /&gt;
          $ cd ../src&lt;br /&gt;
          $ gcc -I../include -L../lib -o prog1 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     The -I../include  tells  gcc to look in the ../include directory for&lt;br /&gt;
     libpersonal.h. and -L../lib, tells gcc to look for the&lt;br /&gt;
     &amp;quot;libpersonal.a&amp;quot; library.&lt;br /&gt;
&lt;br /&gt;
           $ cd ..&lt;br /&gt;
           $ tree src lib include&lt;br /&gt;
           src&lt;br /&gt;
           |-- prog&lt;br /&gt;
           |-- prog1&lt;br /&gt;
           |-- prog1.c&lt;br /&gt;
           `-- test.c&lt;br /&gt;
           lib&lt;br /&gt;
           |-- libpersonal.a&lt;br /&gt;
           `-- test.o&lt;br /&gt;
           include&lt;br /&gt;
           `-- libpersonal.h&lt;br /&gt;
&lt;br /&gt;
     This was a STATIC library. Often times you will want to use a SHARED&lt;br /&gt;
     or dynamic library.&lt;br /&gt;
&lt;br /&gt;
     SHARED LIBRARY:&lt;br /&gt;
&lt;br /&gt;
     You must recompile test.c with -fpic option.&lt;br /&gt;
&lt;br /&gt;
          $ cd ../lib&lt;br /&gt;
          $ gcc -c -fpic ../src/test.c -o test.o&lt;br /&gt;
&lt;br /&gt;
     Next create the libpersonal.so file.&lt;br /&gt;
&lt;br /&gt;
          $ gcc -shared -o libpersonal.so test.o&lt;br /&gt;
&lt;br /&gt;
     Now, compile the source prog1.c as follows:&lt;br /&gt;
&lt;br /&gt;
          $ cd ../src&lt;br /&gt;
          $ gcc -Wl,-R../lib -L../lib -I../include -o prog2 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
     This should work fine. But, take a look at prog2 using the ldd command.&lt;br /&gt;
&lt;br /&gt;
          $ ldd prog2&lt;br /&gt;
&lt;br /&gt;
        libpersonal.so =&amp;gt; ../lib/libpersonal.so (0x40017000)&lt;br /&gt;
        libc.so.6 =&amp;gt; /lib/tls/libc.so.6 (0x42000000)&lt;br /&gt;
        /lib/ld-linux.so.2 =&amp;gt; /lib/ld-linux.so.2 (0x40000000)&lt;br /&gt;
&lt;br /&gt;
     If you move the program prog2 to a different location, it will not run.&lt;br /&gt;
     Instead you will get the following error:&lt;br /&gt;
&lt;br /&gt;
           prog2: error while loading shared libraries: libpersonal.so:&lt;br /&gt;
                     cannot open shared object file: No such file or directory&lt;br /&gt;
&lt;br /&gt;
     To fix this, you should specify the direct path to the library. And in my&lt;br /&gt;
     case it is rather long&lt;br /&gt;
&lt;br /&gt;
      $  gcc -Wl,-R/work/souptonuts/documentation/theBook/lib -L../lib -I../include -o prog2 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE: The -R must always follow the -Wl.  (-Wl,-R&amp;lt;directory&amp;gt;) They always go together&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 51:&lt;br /&gt;
&lt;br /&gt;
     Actively Monitor a File and Send Email when Expression Occurs.&lt;br /&gt;
&lt;br /&gt;
     This is a way to monitor &amp;quot;/var/log/messages&amp;quot; or any file for certain changes.&lt;br /&gt;
     The example below actively monitors &amp;quot;stuff&amp;quot; for the work &amp;quot;now&amp;quot; and as soon as&lt;br /&gt;
     &amp;quot;now&amp;quot; is added to the file, the contents of msg are sent to the user&lt;br /&gt;
     mikechirico@hotmail.com&lt;br /&gt;
&lt;br /&gt;
          $ tail -f stuff | \&lt;br /&gt;
              awk ' /now/ { system(&amp;quot;mail -s \&amp;quot;This is working\&amp;quot;  mikechirico@hotmail.com &amp;lt; msg&amp;quot;) }'&lt;br /&gt;
&lt;br /&gt;
     Or, you can run a program, say get headings on slashdot from the program &amp;quot;getslash.php&amp;quot; which&lt;br /&gt;
     runs on  &amp;quot;192.168.1.155&amp;quot; with account &amp;quot;chirico&amp;quot;. Assuming you have ssh keys setup, then, the following&lt;br /&gt;
     will send mail from the output:&lt;br /&gt;
&lt;br /&gt;
          $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;|mail -s &amp;quot;Slash cron Headlines&amp;quot;  mchirico@comcast.net&lt;br /&gt;
&lt;br /&gt;
     See (TIP 80) for scraping the headings on slash dot and how to get a copy of &amp;quot;getslash.php&amp;quot;.  If you still&lt;br /&gt;
     want to use awk:&lt;br /&gt;
&lt;br /&gt;
           $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;| \&lt;br /&gt;
                      awk '{ print $0 | &amp;quot;mail -s \x27 Slash Topics \x27 mchirico@comcast.net &amp;quot;}'&lt;br /&gt;
&lt;br /&gt;
     Note the &amp;quot;\x27&amp;quot; is a quote.  Maybe you only want articles dealing with &amp;quot;Linux&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
           $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;| \&lt;br /&gt;
                      awk '/Linux/{ print $0 | &amp;quot;mail -s \x27 Slash Topics \x27 mchirico@comcast.net &amp;quot;}'&lt;br /&gt;
&lt;br /&gt;
     For $60, you can get a numeric display from &amp;quot;delcom engineering&amp;quot; that you can send messages and&lt;br /&gt;
     data to.  I get weather information off the internet and send it to this device.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/projects/delcom/&lt;br /&gt;
&lt;br /&gt;
     (Reference TIP 151 for ssh tips)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 52:&lt;br /&gt;
&lt;br /&gt;
     Need to Keep Secrets? Encrypt it.&lt;br /&gt;
&lt;br /&gt;
      To Encrypt:&lt;br /&gt;
&lt;br /&gt;
            $ openssl des3 -salt -in file.txt -out file.des3&lt;br /&gt;
&lt;br /&gt;
      The above will prompt for a password, or you can put it in&lt;br /&gt;
      with a -k option, assuming you're on a trusted server.&lt;br /&gt;
&lt;br /&gt;
      To Decrypt&lt;br /&gt;
&lt;br /&gt;
            $  openssl des3 -d -salt -in file.des3 -out file.txt -k mypassword&lt;br /&gt;
&lt;br /&gt;
      Need to encrypt what you type? Enter the following, then start typing&lt;br /&gt;
      and  ^D to end.&lt;br /&gt;
&lt;br /&gt;
            $ openssl des3 -salt -out stuff.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 53:&lt;br /&gt;
&lt;br /&gt;
     Check that a File has Not Been Tampered With: Use Cryptographic Hashing Function.&lt;br /&gt;
&lt;br /&gt;
     The md5sum is popular but dated&lt;br /&gt;
&lt;br /&gt;
              $ md5sum file&lt;br /&gt;
&lt;br /&gt;
     Instead, use one of the following;&lt;br /&gt;
&lt;br /&gt;
              $ openssl dgst -sha1 -c file&lt;br /&gt;
&lt;br /&gt;
              $ openssl dgst -ripemd160 -c  file&lt;br /&gt;
&lt;br /&gt;
     All calls give a fixed length string or &amp;quot;message digest&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 54:&lt;br /&gt;
&lt;br /&gt;
     Need to View Information About a Secure Web Server? A SSL/TLS test.&lt;br /&gt;
&lt;br /&gt;
           $ openssl s_client -connect www.sourceforge.net:443&lt;br /&gt;
&lt;br /&gt;
     Above will give a long listing of certificates.&lt;br /&gt;
&lt;br /&gt;
     Note, it is also possible to get certificate information about a mail server&lt;br /&gt;
&lt;br /&gt;
           $ openssl s_client -connect mail.comcast.net:995 -showcerts&lt;br /&gt;
&lt;br /&gt;
     When you do the above command you get two certificates. If you copy&lt;br /&gt;
     past both certificates by taking the following contents include the&lt;br /&gt;
     begin and end show below:&lt;br /&gt;
&lt;br /&gt;
                 -----BEGIN CERTIFICATE-----&lt;br /&gt;
                 ....&lt;br /&gt;
                 -----END CERTIFICATE-----&lt;br /&gt;
&lt;br /&gt;
     Then create files &amp;quot;comcast0.pem&amp;quot; and &amp;quot;comcast1.pem&amp;quot; out of these certificaties and&lt;br /&gt;
     put them in a directory &amp;quot;/home/donkey/.certs&amp;quot;, then, with the openssl src package, in&lt;br /&gt;
     the &amp;quot;./tools/c_rehash&amp;quot; run&lt;br /&gt;
&lt;br /&gt;
            $ c_rehash .certs&lt;br /&gt;
            Doing .certs&lt;br /&gt;
            comcast0.pem =&amp;gt; 72f90dc0.0&lt;br /&gt;
            comcast1.pem =&amp;gt; f73e89fd.0&lt;br /&gt;
&lt;br /&gt;
     Now it's possible to have fetchmail work with these certs.&lt;br /&gt;
&lt;br /&gt;
       #&lt;br /&gt;
       #&lt;br /&gt;
       # Sample .fetchmailrc file for Comcast&lt;br /&gt;
       #&lt;br /&gt;
       # Check mail every 90 seconds&lt;br /&gt;
       set daemon 90&lt;br /&gt;
       set syslog&lt;br /&gt;
       set postmaster donkey&lt;br /&gt;
       #set bouncemail&lt;br /&gt;
       #&lt;br /&gt;
       # Comcast email is zdonkey but computer account is  just donkey&lt;br /&gt;
       #&lt;br /&gt;
       poll mail.comcast.net with proto POP3 and options no dns&lt;br /&gt;
              user 'zdonkey' with pass &amp;quot;somethin35&amp;quot;  is 'donkey' here options ssl sslcertck sslcertpath '/home/donkey/.certs'&lt;br /&gt;
              smtphost comcast.net&lt;br /&gt;
       # currently not used&lt;br /&gt;
       mda '/usr/bin/procmail -d %T'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     REFERENCE: http://www.openssl.org/&lt;br /&gt;
                http://www.catb.org/~esr/fetchmail/fetchmail-6.2.5.tar.gz&lt;br /&gt;
                http://www.madboa.com/geek/openssl/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 55:&lt;br /&gt;
&lt;br /&gt;
     cp --parents. What does this option do?&lt;br /&gt;
&lt;br /&gt;
     Assume you have the following directory structure&lt;br /&gt;
&lt;br /&gt;
            .&lt;br /&gt;
            |-- a&lt;br /&gt;
            |   `-- b&lt;br /&gt;
            |       `-- c&lt;br /&gt;
            |           `-- d&lt;br /&gt;
            |               |-- file1&lt;br /&gt;
            |               `-- file2&lt;br /&gt;
            `-- newdir&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Issue the following command:&lt;br /&gt;
&lt;br /&gt;
         $ cp --parents ./a/b/c/d/* ./newdir/&lt;br /&gt;
&lt;br /&gt;
     Now you have the following:&lt;br /&gt;
&lt;br /&gt;
            .&lt;br /&gt;
            |-- a&lt;br /&gt;
            |   `-- b&lt;br /&gt;
            |       `-- c&lt;br /&gt;
            |           `-- d&lt;br /&gt;
            |               |-- file1&lt;br /&gt;
            |               `-- file2&lt;br /&gt;
            `-- newdir&lt;br /&gt;
                `-- a&lt;br /&gt;
                    `-- b&lt;br /&gt;
                        `-- c&lt;br /&gt;
                            `-- d&lt;br /&gt;
                                |-- file1&lt;br /&gt;
                                `-- file2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 56:&lt;br /&gt;
&lt;br /&gt;
     Quickly Locating files.&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;locate&amp;quot; command quickly searches the indexed database for files.  It just&lt;br /&gt;
     gives the name of the files; but, if you need more information use it as follows&lt;br /&gt;
&lt;br /&gt;
         $ locate document|xargs ls -l&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;locate&amp;quot; database may only get updated every 24 hours.  For more recent finds,&lt;br /&gt;
     use the &amp;quot;find&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 57:&lt;br /&gt;
&lt;br /&gt;
     Using the &amp;quot;find&amp;quot; Command.&lt;br /&gt;
&lt;br /&gt;
     List only directories, max 2 nodes down that have &amp;quot;net&amp;quot; in the name&lt;br /&gt;
&lt;br /&gt;
       $ find /proc -type d -maxdepth 2 -iname '*net*'&lt;br /&gt;
&lt;br /&gt;
     Find all *.c and *.h files starting from the current &amp;quot;.&amp;quot; position.&lt;br /&gt;
&lt;br /&gt;
       $ find . \( -iname '*.c'  -o -iname '*.h' \) -print&lt;br /&gt;
&lt;br /&gt;
     Find all, but skip what's in &amp;quot;/CVS&amp;quot; and &amp;quot;/junk&amp;quot;. Start from &amp;quot;/work&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ find /work \( -iregex '.*/CVS'  -o -iregex '.*/junk' \)  -prune -o -print&lt;br /&gt;
&lt;br /&gt;
     Note -regex and -iregex work on the directory as well, which means&lt;br /&gt;
     you must consider the &amp;quot;./&amp;quot; that comes before all listings.&lt;br /&gt;
&lt;br /&gt;
     Here is another example. Find all files except what is under the CVS, including&lt;br /&gt;
     CVS listings. Also exclude &amp;quot;#&amp;quot; and &amp;quot;~&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       $ find . -regex '.*' ! \( -regex '.*CVS.*'  -o -regex '.*[#|~].*' \)&lt;br /&gt;
&lt;br /&gt;
     Find a *.c file, then run grep on it looking for &amp;quot;stdio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       $ find . -iname '*.c' -exec grep -H 'stdio.h' {} \;&lt;br /&gt;
         sample output --&amp;gt;  ./prog1.c:#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
                            ./test.c:#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Looking for the disk-hog on the whole system?&lt;br /&gt;
&lt;br /&gt;
       $ find /  -size +10000k 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
     Looking for files changed in the last 24 hours? Make sure you add the&lt;br /&gt;
     minus sign &amp;quot;-1&amp;quot;, otherwise, you will only find files changed exactly&lt;br /&gt;
     24 hours from now. With the &amp;quot;-1&amp;quot; you get files changed from now to 24&lt;br /&gt;
     hours.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ find  . -ctime -1  -printf &amp;quot;%a %f\n&amp;quot;&lt;br /&gt;
       Wed Oct  6 12:51:56 2004 .&lt;br /&gt;
       Wed Oct  6 12:35:16 2004 How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
     Or if you just want files.&lt;br /&gt;
&lt;br /&gt;
       $ find . -type f -ctime -1  -printf &amp;quot;%a %f\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Details on file status change in the last 48 hours, current directory. Also note &amp;quot;-atime -2&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
       $ find . -ctime -2 -type f -exec ls -l {} \;&lt;br /&gt;
&lt;br /&gt;
             NOTE: if you don't use -type f, you make get &amp;quot;.&amp;quot; returned, which&lt;br /&gt;
             when run through ls &amp;quot;ls .&amp;quot; may list more than what you want.&lt;br /&gt;
&lt;br /&gt;
             Also you may only want the current directory&lt;br /&gt;
&lt;br /&gt;
       $ find . -ctime -2 -type f -maxdepth 1 -exec ls -l {} \;&lt;br /&gt;
&lt;br /&gt;
     To find files modified within the last 5 to 10 minutes&lt;br /&gt;
&lt;br /&gt;
       $ find . -mmin +5 -mmin -10 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     For more example &amp;quot;find&amp;quot; commands, reference the following looking&lt;br /&gt;
     for the latest version of &amp;quot;bashscripts.x.x.x.tar.gz&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79320&amp;amp;package_id=80711&lt;br /&gt;
&lt;br /&gt;
     See &amp;quot;TIP 71&amp;quot; for examples of find using the inode feature. &amp;quot; $ find . -inum &amp;lt;inode&amp;gt; -exec rm -- '{}' \; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     If you don't want error messages, or need to redirect error messages &amp;quot;&amp;gt; /dev/null 2&amp;gt;&amp;amp;1&amp;quot;, or see&lt;br /&gt;
     &amp;quot;TIP 81&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 58:&lt;br /&gt;
&lt;br /&gt;
     Using the &amp;quot;rm&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
     How do you remove a file that has the name &amp;quot;-&amp;quot;.  For instance, if you run the command&lt;br /&gt;
     &amp;quot;$ cat &amp;gt; - &amp;quot; and type some text followed by ^d, how does the &amp;quot;-&amp;quot; file get deleted?&lt;br /&gt;
&lt;br /&gt;
        $ rm -- -&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;--&amp;quot; nullifies any rm options.&lt;br /&gt;
&lt;br /&gt;
     How do you delete the directory &amp;quot;one&amp;quot;, all it's sub-directories, and any data?&lt;br /&gt;
&lt;br /&gt;
        $ rm -rf ./one&lt;br /&gt;
&lt;br /&gt;
     Note, to selectively delete stuff on a directory, use the find command &amp;quot;TIP 57&amp;quot;.&lt;br /&gt;
     To delete by inode, see &amp;quot;TIP 71&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 59:&lt;br /&gt;
&lt;br /&gt;
     Giving ownership.&lt;br /&gt;
&lt;br /&gt;
     How do you give the user &amp;quot;donkey&amp;quot; ownership to all directories and files under&lt;br /&gt;
     &amp;quot;./fordonkey&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          $ chown -R donkey ./fordonkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 60:&lt;br /&gt;
&lt;br /&gt;
     Only Permit root login -- give others a message when they try to login.&lt;br /&gt;
&lt;br /&gt;
     Create the file &amp;quot;/etc/nologin&amp;quot; with &amp;quot;nologin&amp;quot; containing the contents&lt;br /&gt;
     of the message.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 61:&lt;br /&gt;
&lt;br /&gt;
     Limits: file size, open files, pipe size, stack size, max memory size&lt;br /&gt;
             cpu time, plus others.&lt;br /&gt;
&lt;br /&gt;
     To get a listing of current limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -a&lt;br /&gt;
             core file size        (blocks, -c) 0&lt;br /&gt;
             data seg size         (kbytes, -d) unlimited&lt;br /&gt;
             file size             (blocks, -f) unlimited&lt;br /&gt;
             max locked memory     (kbytes, -l) unlimited&lt;br /&gt;
             max memory size       (kbytes, -m) unlimited&lt;br /&gt;
             open files                    (-n) 1024&lt;br /&gt;
             pipe size          (512 bytes, -p) 8&lt;br /&gt;
             stack size            (kbytes, -s) 8192&lt;br /&gt;
             cpu time             (seconds, -t) unlimited&lt;br /&gt;
             max user processes            (-u) 8179&lt;br /&gt;
             virtual memory        (kbytes, -v) unlimited&lt;br /&gt;
&lt;br /&gt;
     Note as a user you can decrease your limits in the current&lt;br /&gt;
     shell session; but, you cannot increase.  This can be ideal&lt;br /&gt;
     for testing programs.  But, first you may want to create&lt;br /&gt;
     another shell &amp;quot;sh&amp;quot; so that you can &amp;quot;go back to where started&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -f 10&lt;br /&gt;
&lt;br /&gt;
     Now try&lt;br /&gt;
&lt;br /&gt;
          $ yes &amp;gt;&amp;gt; out&lt;br /&gt;
             File size limit exceeded&lt;br /&gt;
&lt;br /&gt;
     To set limits on users, make changes to &amp;quot;/etc/security/limits.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           bozo   - maxlogins 1&lt;br /&gt;
&lt;br /&gt;
     Will keep bozo from loging in more than once.&lt;br /&gt;
&lt;br /&gt;
     To list hard limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -Ha&lt;br /&gt;
&lt;br /&gt;
     To list soft limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -Sa&lt;br /&gt;
&lt;br /&gt;
     To restrict user access by time, day make changes to&lt;br /&gt;
             &amp;quot;/etc/security/time.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Also take a look at &amp;quot;/etc/profile&amp;quot; to see what other changes&lt;br /&gt;
     can be made, plus take a look under &amp;quot;/etc/security/*.conf&amp;quot; for&lt;br /&gt;
     other configuration files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 62:&lt;br /&gt;
&lt;br /&gt;
     Stupid &amp;quot;cat&amp;quot; Tricks.&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 43).&lt;br /&gt;
&lt;br /&gt;
     If you have multiple blank lines, squeeze these lines down to one,&lt;br /&gt;
     then, try the following:&lt;br /&gt;
&lt;br /&gt;
          $ cat -s &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to number the lines?&lt;br /&gt;
&lt;br /&gt;
          $ cat -n &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to show tabs?&lt;br /&gt;
&lt;br /&gt;
          $ cat -t &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Need to mark end of lines by &amp;quot;$&amp;quot;? The following was suggested by  (Amos Shapira)&lt;br /&gt;
&lt;br /&gt;
          $ cat -e &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to see all the ctl characters?&lt;br /&gt;
&lt;br /&gt;
          /* ctlgen.c&lt;br /&gt;
            Program to generate ctl characters.&lt;br /&gt;
&lt;br /&gt;
            Compile:&lt;br /&gt;
&lt;br /&gt;
               gcc -o ctlgen ctlgen.c&lt;br /&gt;
&lt;br /&gt;
            Run:&lt;br /&gt;
&lt;br /&gt;
               ./ctlgen &amp;gt; mout&lt;br /&gt;
&lt;br /&gt;
            Now see the characters:&lt;br /&gt;
&lt;br /&gt;
               cat -v mout&lt;br /&gt;
&lt;br /&gt;
            Here's a sample output:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               $ cat -v mout|tail&lt;br /&gt;
                   test M-v&lt;br /&gt;
                   test M-w&lt;br /&gt;
                   test M-x&lt;br /&gt;
                   test M-y&lt;br /&gt;
                   test M-z&lt;br /&gt;
                   test M-{&lt;br /&gt;
                   test M-|&lt;br /&gt;
                   test M-}&lt;br /&gt;
                   test M-~&lt;br /&gt;
                   test M-^?&lt;br /&gt;
&lt;br /&gt;
          */&lt;br /&gt;
          #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
          #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
          int main()&lt;br /&gt;
          {&lt;br /&gt;
            int i;&lt;br /&gt;
&lt;br /&gt;
            for(i=0; i &amp;lt; 256; ++i)&lt;br /&gt;
              printf(&amp;quot;test %c \n&amp;quot;,i);&lt;br /&gt;
&lt;br /&gt;
            return 0;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 63:&lt;br /&gt;
&lt;br /&gt;
     Guard against SYN attacks and &amp;quot;ping&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     As root do the following:&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/tcp_syncookies&lt;br /&gt;
&lt;br /&gt;
     Want to disable &amp;quot;ping&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_all&lt;br /&gt;
&lt;br /&gt;
     Disable broadcast/multicast &amp;quot;ping&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts&lt;br /&gt;
&lt;br /&gt;
     And to enable again:&lt;br /&gt;
&lt;br /&gt;
          echo 0 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_all&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 64:&lt;br /&gt;
&lt;br /&gt;
     Make changes to .bash_profile and need to update the current session?&lt;br /&gt;
&lt;br /&gt;
       $ source .bash_profile&lt;br /&gt;
&lt;br /&gt;
     With the above command, the user does not have to logout.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 65:&lt;br /&gt;
&lt;br /&gt;
     What are the Special Shell Variables?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        $#   The number of arguments.&lt;br /&gt;
        $@   All arguments, as separate words.&lt;br /&gt;
        $*   All arguments, as one word.&lt;br /&gt;
        $$   ID of the current process.&lt;br /&gt;
        $?   Exit status of the last command.&lt;br /&gt;
        $0,$1,..$9,${10},${11}...${N}    Positional parameters. After &amp;quot;9&amp;quot; you must use the ${k} syntax.&lt;br /&gt;
&lt;br /&gt;
     Note that 0 is true. For example if you execute the following, which is true you get zero.&lt;br /&gt;
&lt;br /&gt;
         $  [[ -f /etc/passwd ]]&lt;br /&gt;
         $  echo $?&lt;br /&gt;
         0&lt;br /&gt;
     And the following is false, which returns a 1.&lt;br /&gt;
&lt;br /&gt;
         $  [[ -f /etc/passwdjabberwisnohere ]]&lt;br /&gt;
         $  echo $?&lt;br /&gt;
         1&lt;br /&gt;
&lt;br /&gt;
     So true=0 and false=1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Sample program &amp;quot;mdo&amp;quot;  to show the difference between &amp;quot;$@&amp;quot; and &amp;quot;$*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        function myarg&lt;br /&gt;
        {&lt;br /&gt;
            echo &amp;quot;$# in myarg function&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
        echo -e &amp;quot;$# parameters on the cmd line\n&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;calling: myarg \&amp;quot;\$@\&amp;quot; and myarg \&amp;quot;\$*\&amp;quot;\n&amp;quot;&lt;br /&gt;
        myarg &amp;quot;$@&amp;quot;&lt;br /&gt;
        myarg &amp;quot;$*&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;\ncalling: myarg \$@ and myarg \$* without quotes\n&amp;quot;&lt;br /&gt;
        myarg $@&lt;br /&gt;
        myarg $*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The result of running &amp;quot;./mdo one two&amp;quot;. Note that when quoted, myarg &amp;quot;$*&amp;quot;,&lt;br /&gt;
      returns 1 ... all parameters are smushed together as one word.&lt;br /&gt;
&lt;br /&gt;
            [chirico@third-fl-71 theBook]$ ./mdo one two&lt;br /&gt;
            2 parameters on the cmd line&lt;br /&gt;
&lt;br /&gt;
            calling: myarg &amp;quot;$@&amp;quot; and myarg &amp;quot;$*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
            1 in myarg function&lt;br /&gt;
&lt;br /&gt;
            calling: myarg $@ and myarg $* without quotes&lt;br /&gt;
&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
&lt;br /&gt;
      Example program &amp;quot;mdo2&amp;quot; shows how the input separator can be changed.&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        IFS=|&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=,&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=\;&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=$1&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            [chirico@third-fl-71 theBook]$ ./mdo2 one two three four five&lt;br /&gt;
            one two three four five&lt;br /&gt;
&lt;br /&gt;
            one,two,three,four,five&lt;br /&gt;
&lt;br /&gt;
            one;two;three;four;five&lt;br /&gt;
&lt;br /&gt;
            oneotwoothreeofourofive&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 66:&lt;br /&gt;
&lt;br /&gt;
     Replace all &amp;quot;x&amp;quot; with &amp;quot;y&amp;quot; and all &amp;quot;y&amp;quot; with &amp;quot;x&amp;quot; in file data.&lt;br /&gt;
&lt;br /&gt;
        $ cata data&lt;br /&gt;
          x y&lt;br /&gt;
          y x&lt;br /&gt;
&lt;br /&gt;
        $ tr &amp;quot;xy&amp;quot;  &amp;quot;yx&amp;quot; &amp;lt; data&lt;br /&gt;
          y x&lt;br /&gt;
          x y&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 67:&lt;br /&gt;
&lt;br /&gt;
     On a Linux 2.6.x Kernel, how do you directly measure disk activity,&lt;br /&gt;
     and where is this information documented?&lt;br /&gt;
&lt;br /&gt;
          o The information is documented in the kernel source&lt;br /&gt;
               ./Documentation/iostats.txt&lt;br /&gt;
&lt;br /&gt;
          o The new way of getting this info in 2.6.x is&lt;br /&gt;
              $ cat /sys/block/hda/stat&lt;br /&gt;
            151121 5694 1932358 796675 37867 76770 916994 8353762 0 800672 9150437&lt;br /&gt;
&lt;br /&gt;
             Field  1 -- # of reads issued&lt;br /&gt;
                 This is the total number of reads completed successfully.&lt;br /&gt;
             Field  2 -- # of reads merged, field 6 -- # of writes merged&lt;br /&gt;
                 Reads and writes which are adjacent to each other may be merged for&lt;br /&gt;
                 efficiency.  Thus two 4K reads may become one 8K read before it is&lt;br /&gt;
                 ultimately handed to the disk, and so it will be counted (and queued)&lt;br /&gt;
                 as only one I/O.  This field lets you know how often this was done.&lt;br /&gt;
             Field  3 -- # of sectors read&lt;br /&gt;
                 This is the total number of sectors read successfully.&lt;br /&gt;
             Field  4 -- # of milliseconds spent reading&lt;br /&gt;
                 This is the total number of milliseconds spent by all reads (as&lt;br /&gt;
                 measured from __make_request() to end_that_request_last()).&lt;br /&gt;
             Field  5 -- # of writes completed&lt;br /&gt;
                 This is the total number of writes completed successfully.&lt;br /&gt;
             Field  7 -- # of sectors written&lt;br /&gt;
                 This is the total number of sectors written successfully.&lt;br /&gt;
             Field  8 -- # of milliseconds spent writing&lt;br /&gt;
                 This is the total number of milliseconds spent by all writes (as&lt;br /&gt;
                 measured from __make_request() to end_that_request_last()).&lt;br /&gt;
             Field  9 -- # of I/Os currently in progress&lt;br /&gt;
                 The only field that should go to zero. Incremented as requests are&lt;br /&gt;
                 given to appropriate request_queue_t and decremented as they finish.&lt;br /&gt;
             Field 10 -- # of milliseconds spent doing I/Os&lt;br /&gt;
                 This field is increases so long as field 9 is nonzero.&lt;br /&gt;
             Field 11 -- weighted # of milliseconds spent doing I/Os&lt;br /&gt;
                 This field is incremented at each I/O start, I/O completion, I/O&lt;br /&gt;
                 merge, or read of these stats by the number of I/Os in progress&lt;br /&gt;
                 (field 9) times the number of milliseconds spent doing I/O since the&lt;br /&gt;
                 last update of this field.  This can provide an easy measure of both&lt;br /&gt;
                 I/O completion time and the backlog that may be accumulating.&lt;br /&gt;
&lt;br /&gt;
       Note, this is device specific.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 68:&lt;br /&gt;
&lt;br /&gt;
     Passing Outbound Mail, plus Masquerading User and Hostname.&lt;br /&gt;
&lt;br /&gt;
     Here's a specific example:&lt;br /&gt;
&lt;br /&gt;
         How does one send and receive Comcast email from a home Linux box,&lt;br /&gt;
         which uses Comcast as the ISP, if the local account on the Linux&lt;br /&gt;
         box is different from the Comcast email.  For instance, the&lt;br /&gt;
         account on the Linux box is &amp;quot;chirico@third-fl-71&amp;quot; and the Comcast&lt;br /&gt;
         email account is &amp;quot;mchirico@comcast.net&amp;quot;.  Note both the hostname and&lt;br /&gt;
         username are different.&lt;br /&gt;
&lt;br /&gt;
         So, the user &amp;quot;chirico&amp;quot; using &amp;quot;mutt&amp;quot;, &amp;quot;elm&amp;quot; or any email program would&lt;br /&gt;
         like to send out email to say &amp;quot;donkey@comcast.net&amp;quot;; yet, donkey would&lt;br /&gt;
         see the email from &amp;quot;mchirico@comcast.net&amp;quot; and not &amp;quot;chirico@third-fl-71&amp;quot;&lt;br /&gt;
         but chirico@third-fl-71 would get the replies.&lt;br /&gt;
&lt;br /&gt;
         For a full description of how to solve this problem, including related&lt;br /&gt;
         &amp;quot;sendmail.mc&amp;quot;, &amp;quot;site.config.m4&amp;quot;, &amp;quot;genericstable&amp;quot;, &amp;quot;genericsdomain&amp;quot;,&lt;br /&gt;
         &amp;quot;.procmailrc&amp;quot;, and &amp;quot;.forward&amp;quot; files,  reference the following:&lt;br /&gt;
&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/README_COMCAST_EMAIL.txt?download&lt;br /&gt;
&lt;br /&gt;
         Included in the above link are instructions for building sendmail with&lt;br /&gt;
         &amp;quot;SASL&amp;quot; and &amp;quot;STARTTLS&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 69:&lt;br /&gt;
&lt;br /&gt;
     How do you remove just the last 2 lines from a file and save the result?&lt;br /&gt;
&lt;br /&gt;
         $ sed  '$d' file | sed '$d' &amp;gt; savefile&lt;br /&gt;
&lt;br /&gt;
     Or, as Amos Shapira pointed out, it's much easier with the head command.&lt;br /&gt;
&lt;br /&gt;
         $ head -2 file&lt;br /&gt;
&lt;br /&gt;
      And, of course, removing just the last line&lt;br /&gt;
&lt;br /&gt;
         $ sed '$d' file &amp;gt; savefile&lt;br /&gt;
&lt;br /&gt;
         (See REFERENCES (13))&lt;br /&gt;
&lt;br /&gt;
     How do you remove extra spaces at the end of a line?&lt;br /&gt;
&lt;br /&gt;
         $ sed 's/[ ]*$//g'&lt;br /&gt;
&lt;br /&gt;
     How do you remove blank lines, or lines with just spaces and tabs,&lt;br /&gt;
     saving the origional file as file.backup?&lt;br /&gt;
&lt;br /&gt;
         $ perl -pi.backup -e &amp;quot;s/^(\s)*\n//&amp;quot;  file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 70:&lt;br /&gt;
&lt;br /&gt;
     Generating Random Numbers.&lt;br /&gt;
&lt;br /&gt;
         $ od -vAn -N4 -tu4 &amp;lt; /dev/urandom&lt;br /&gt;
             3905158199&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 71:&lt;br /&gt;
&lt;br /&gt;
     Deleting a File by it's Inode Value.&lt;br /&gt;
&lt;br /&gt;
       See (PROGRAMMING TIP 5) for creating the file, or&lt;br /&gt;
&lt;br /&gt;
       $ cat &amp;gt; '\n\n\n\n\n\n\n'&lt;br /&gt;
         type some text&lt;br /&gt;
         ^D&lt;br /&gt;
&lt;br /&gt;
     To list the inode and display the characters.&lt;br /&gt;
&lt;br /&gt;
       $ ls -libt *&lt;br /&gt;
&lt;br /&gt;
     To remove by inode. Note the &amp;quot;--&amp;quot; option.  This&lt;br /&gt;
     will keep any special characters in the file from being&lt;br /&gt;
     interpreted at &amp;quot;rm&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
       $ find . -inum &amp;lt;inode&amp;gt; -exec rm -- '{}' \;&lt;br /&gt;
&lt;br /&gt;
     Or to check contents&lt;br /&gt;
&lt;br /&gt;
       $ find . -inum &amp;lt;inode&amp;gt; -exec cat '{}' \;&lt;br /&gt;
&lt;br /&gt;
     Reference:&lt;br /&gt;
         http://www.faqs.org/ftp/usenet/news.answers/unix-faq/faq/part2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 72:&lt;br /&gt;
&lt;br /&gt;
     Sending Attachments Using Mutt -- On the Command Line.&lt;br /&gt;
&lt;br /&gt;
        $ mutt -s &amp;quot;See Attachment&amp;quot; -a file.doc user@domain.net &amp;lt; message.txt&lt;br /&gt;
&lt;br /&gt;
          or just the message:&lt;br /&gt;
&lt;br /&gt;
        $ echo | mutt -a sample.tar.gz user@domain.net&lt;br /&gt;
&lt;br /&gt;
      Reference:&lt;br /&gt;
          http://www.shelldorado.com/articles/mailattachments.html&lt;br /&gt;
&lt;br /&gt;
        Also see (TIP 51).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 73:&lt;br /&gt;
&lt;br /&gt;
     Want to find out what functions a program calls?&lt;br /&gt;
&lt;br /&gt;
         $ strace &amp;lt;program&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Try this with &amp;quot;topen.c&amp;quot; (see PROGRAMMING TIP 5)&lt;br /&gt;
&lt;br /&gt;
         $ strace  ./topen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 74:&lt;br /&gt;
&lt;br /&gt;
     RPM Usage Summary.&lt;br /&gt;
&lt;br /&gt;
     Install. Full filename is needed.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -ivh Fedora/RPMS/postgresql-libs-7.4.2-1.i386.rpm&lt;br /&gt;
&lt;br /&gt;
     To view list of files installed with a particular package.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -ql postgresql-libs&lt;br /&gt;
                /usr/lib/libecpg.so.4&lt;br /&gt;
                /usr/lib/libecpg.so.4.1&lt;br /&gt;
                /usr/lib/libecpg_compat.so.1&lt;br /&gt;
                /usr/lib/libecpg_compat.so.1.1&lt;br /&gt;
                /usr/lib/libpgtypes.so.1&lt;br /&gt;
                ...&lt;br /&gt;
&lt;br /&gt;
     Or, to get the file listing from a package that is not installed use the&lt;br /&gt;
     &amp;quot;-p&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -pql /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/CHANGES&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/LICENSE&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/README&lt;br /&gt;
               /usr/share/man/man3/pcap.3.gz&lt;br /&gt;
&lt;br /&gt;
     For dependencies listing, use the &amp;quot;R&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qpR /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /sbin/ldconfig&lt;br /&gt;
               /sbin/ldconfig&lt;br /&gt;
               kernel &amp;gt;= 2.2.0&lt;br /&gt;
               libc.so.6&lt;br /&gt;
               libc.so.6(GLIBC_2.0)&lt;br /&gt;
               libc.so.6(GLIBC_2.1)&lt;br /&gt;
               libc.so.6(GLIBC_2.1.3)&lt;br /&gt;
               libc.so.6(GLIBC_2.3)&lt;br /&gt;
               openssl&lt;br /&gt;
               rpmlib(CompressedFileNames) &amp;lt;= 3.0.4-1&lt;br /&gt;
               rpmlib(PayloadFilesHavePrefix) &amp;lt;= 4.0-1&lt;br /&gt;
&lt;br /&gt;
     To check the integrity, use the &amp;quot;-K&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -K /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm: (sha1) dsa sha1 md5 gpg OK&lt;br /&gt;
&lt;br /&gt;
     To list all packages installed.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qa&lt;br /&gt;
&lt;br /&gt;
     To find out which file a package belongs to.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qf /usr/lib/libecpg.so.4.1&lt;br /&gt;
&lt;br /&gt;
     To uninstall a package&lt;br /&gt;
&lt;br /&gt;
         $ rpm -e&lt;br /&gt;
&lt;br /&gt;
     For building rpm packages reference the following:&lt;br /&gt;
       http://www-106.ibm.com/developerworks/library/l-rpm1/&lt;br /&gt;
&lt;br /&gt;
     To verify md5 sum so that you know it downloaded ok&lt;br /&gt;
&lt;br /&gt;
         $ rpm -K  *.rpm&lt;br /&gt;
&lt;br /&gt;
     The following is a good reference:&lt;br /&gt;
        http://www.rpm.org/max-rpm/s1-rpm-install-additional-options.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 75:&lt;br /&gt;
&lt;br /&gt;
     Listing Output from a Bash Script.&lt;br /&gt;
&lt;br /&gt;
     Add &amp;quot;set -x&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          #!/bin/bash&lt;br /&gt;
          set -x&lt;br /&gt;
          ls&lt;br /&gt;
          date&lt;br /&gt;
&lt;br /&gt;
     Will list the files and output as follows:&lt;br /&gt;
&lt;br /&gt;
           + ls&lt;br /&gt;
           ChangeLog  CVS  data  test&lt;br /&gt;
           + date&lt;br /&gt;
           Thu Jul  1 20:41:04 EDT 2004&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 76:&lt;br /&gt;
&lt;br /&gt;
     Using wget.&lt;br /&gt;
&lt;br /&gt;
     Grap a webpage and pipe it to less. For example suppose you wanted to pipe the&lt;br /&gt;
     contents of all these tips, directly from the web.&lt;br /&gt;
&lt;br /&gt;
      $ wget -O - http://sourceforge.net/direct-dl/mchirico/souptonuts/How_to_Linux_and_Open_Source.txt|less&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 77:&lt;br /&gt;
&lt;br /&gt;
     Finding IP address and MAC address.&lt;br /&gt;
&lt;br /&gt;
       $ /sbin/ifconfig&lt;br /&gt;
&lt;br /&gt;
     Note the following output &amp;quot;eth0&amp;quot; and &amp;quot;eth0:1&amp;quot; which means&lt;br /&gt;
     two IP addresses are tied to 1 NIC (Network Interface Card).&lt;br /&gt;
&lt;br /&gt;
             eth0      Link encap:Ethernet  HWaddr 00:50:DA:60:5B:AD&lt;br /&gt;
                       inet addr:192.168.1.155  Bcast:192.168.99.255  Mask:255.255.252.0&lt;br /&gt;
                       UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
                       RX packets:982757 errors:116 dropped:0 overruns:0 frame:116&lt;br /&gt;
                       TX packets:439297 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:1000&lt;br /&gt;
                       RX bytes:693529078 (661.4 Mb)  TX bytes:78400296 (74.7 Mb)&lt;br /&gt;
                       Interrupt:10 Base address:0xa800&lt;br /&gt;
&lt;br /&gt;
             eth0:1    Link encap:Ethernet  HWaddr 00:50:DA:60:5B:AD&lt;br /&gt;
                       inet addr:192.168.1.182  Bcast:192.168.3.255  Mask:255.255.252.0&lt;br /&gt;
                       UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
                       RX packets:982757 errors:116 dropped:0 overruns:0 frame:116&lt;br /&gt;
                       TX packets:439299 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:1000&lt;br /&gt;
                       RX bytes:693529078 (661.4 Mb)  TX bytes:78400636 (74.7 Mb)&lt;br /&gt;
                       Interrupt:10 Base address:0xa800&lt;br /&gt;
&lt;br /&gt;
             lo        Link encap:Local Loopback&lt;br /&gt;
                       inet addr:127.0.0.1  Mask:255.0.0.0&lt;br /&gt;
                       UP LOOPBACK RUNNING  MTU:16436  Metric:1&lt;br /&gt;
                       RX packets:785 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
                       TX packets:785 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:0&lt;br /&gt;
                       RX bytes:2372833 (2.2 Mb)  TX bytes:2372833 (2.2 Mb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 78:&lt;br /&gt;
&lt;br /&gt;
     DOS to UNIX and UNIX to DOS.&lt;br /&gt;
&lt;br /&gt;
        $ dos2unix file.txt&lt;br /&gt;
&lt;br /&gt;
     And to go the other way from UNIX to DOS&lt;br /&gt;
&lt;br /&gt;
        $ unix2dos unixfile&lt;br /&gt;
&lt;br /&gt;
     See the man page, since there are MAC options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     NOTE: If you're working file DOS files, you'll probably want to use&lt;br /&gt;
           &amp;quot;zip&amp;quot; instead of &amp;quot;gzip&amp;quot; so users on Windows can unzip them.&lt;br /&gt;
&lt;br /&gt;
              $ zip test.zip test.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 79:&lt;br /&gt;
&lt;br /&gt;
     Need to Run Interactive Commands? Try &amp;quot;expect&amp;quot;.&lt;br /&gt;
       http://expect.nist.gov/expect.tar.gz&lt;br /&gt;
&lt;br /&gt;
     This simple example waits for the input &amp;quot;hi&amp;quot;, in some form before&lt;br /&gt;
     returning, immediately, &amp;quot;hello there!&amp;quot;. Otherwise, it will wait for&lt;br /&gt;
     60 seconds, then, return &amp;quot;hello there!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/expect&lt;br /&gt;
          set timeout 60&lt;br /&gt;
          expect &amp;quot;hi\n&amp;quot;&lt;br /&gt;
          send &amp;quot;hello there!\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference:&lt;br /&gt;
        http://www.oreilly.com/catalog/expect/chapter/ch03.html&lt;br /&gt;
&lt;br /&gt;
        http://www.cotse.com/dlf/man/expect/bulletproof1.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 80:&lt;br /&gt;
&lt;br /&gt;
     Using PHP as a Command Line Scripting Language.&lt;br /&gt;
&lt;br /&gt;
     The following will grab the complete file from slashdot.&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/php -q&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;?php&lt;br /&gt;
         $fileName = &amp;quot;http://slashdot.org/slashdot.xml&amp;quot;;&lt;br /&gt;
         $rss = file($fileName) or die (&amp;quot;Cannot open file $fileName\n&amp;quot;);&lt;br /&gt;
         for ($index=0; $index &amp;lt; count($rss); $index++)&lt;br /&gt;
              {&lt;br /&gt;
              echo $rss[$index];&lt;br /&gt;
              }&lt;br /&gt;
         ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       Note, if you want an example that parses the XML of&lt;br /&gt;
       slashdot, then, download the following:&lt;br /&gt;
&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/php_scripts.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 81:&lt;br /&gt;
&lt;br /&gt;
     Discarding all output -- including stderr messages.&lt;br /&gt;
&lt;br /&gt;
         $ ls  &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     Or sending all output to a file&lt;br /&gt;
&lt;br /&gt;
         $ someprog &amp;gt; /tmp/file 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     Sometimes, find displays a lot of errors when searching through&lt;br /&gt;
     directories that the user doesn't have access to. To discard&lt;br /&gt;
     error messages &amp;quot;stderr&amp;quot;, which is normally file descripter &amp;quot;2&amp;quot;&lt;br /&gt;
     work the following:&lt;br /&gt;
&lt;br /&gt;
         $ find / -iname 'stuff' 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
          or to pipe results elsewhere&lt;br /&gt;
&lt;br /&gt;
         $ find / -iname 'stuff' &amp;gt; /tmp/results_of_find  2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 118).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 82:&lt;br /&gt;
&lt;br /&gt;
     Using MIX.  D. Knuth's  assembly language/machine-code instruction set used in&lt;br /&gt;
     his books to illustrate his algorithms.&lt;br /&gt;
&lt;br /&gt;
     Download the source:&lt;br /&gt;
&lt;br /&gt;
       http://sourceforge.net/project/showfiles.php?group_id=13897&lt;br /&gt;
&lt;br /&gt;
       $ ./configure&lt;br /&gt;
       $ make&lt;br /&gt;
       $ make install&lt;br /&gt;
&lt;br /&gt;
     Documentation can be found at the following link. The link on&lt;br /&gt;
     sourceforge is not correct, but, the one below works.&lt;br /&gt;
&lt;br /&gt;
       http://www.gnu.org/software/mdk/manual/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 83:&lt;br /&gt;
&lt;br /&gt;
     Gnuplot [ http://sourceforge.net/projects/gnuplot/ ].&lt;br /&gt;
&lt;br /&gt;
     This software is ideal for printing graphs.&lt;br /&gt;
&lt;br /&gt;
         gnuplot&amp;gt; set term png&lt;br /&gt;
         gnuplot&amp;gt; set output 'testcos.png'&lt;br /&gt;
         gnuplot&amp;gt; plot cos(x)*sin(x)&lt;br /&gt;
         gnuplot&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
     Or the following command can be put into &amp;quot;file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            $ cat &amp;gt; file&lt;br /&gt;
            set term png&lt;br /&gt;
            set output 'testcos.png'&lt;br /&gt;
            plot cos(x)*sin(x)&lt;br /&gt;
            exit&lt;br /&gt;
            ^D&lt;br /&gt;
&lt;br /&gt;
     Then, run as follows:&lt;br /&gt;
&lt;br /&gt;
            $ gnuplot file&lt;br /&gt;
&lt;br /&gt;
     Or, suppose you have the following file &amp;quot;/home/chirico/data&amp;quot;. Comments&lt;br /&gt;
     with &amp;quot;#&amp;quot; are not read by gnuplot.&lt;br /&gt;
&lt;br /&gt;
            # File /home/chirico/data&lt;br /&gt;
            #&lt;br /&gt;
            2005-07-26  1    2.3    3&lt;br /&gt;
            2005-07-27  2    3.4    5&lt;br /&gt;
            2005-07-28  3    4    6.6&lt;br /&gt;
            2005-07-29  4    6    2.5&lt;br /&gt;
&lt;br /&gt;
     And you have the following new &amp;quot;file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            set term png&lt;br /&gt;
            set xdata time&lt;br /&gt;
            set timefmt &amp;quot;%Y-%m-%d &amp;quot;&lt;br /&gt;
            set format x &amp;quot;%Y/%m/%d&amp;quot;&lt;br /&gt;
            set output '/var/www/html/chirico/gnuplot/data.png'&lt;br /&gt;
            plot '/home/chirico/data' using 1:2 w linespoints  title '1st col', \&lt;br /&gt;
             '/home/chirico/data' using 1:3 w linespoints  title '2nd col', \&lt;br /&gt;
             '/home/chirico/data' using 1:4 w linespoints  title '3rd col'&lt;br /&gt;
            exit&lt;br /&gt;
&lt;br /&gt;
     You can now get a graph of this data running the following:&lt;br /&gt;
&lt;br /&gt;
            $ gnuplot file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 84:&lt;br /&gt;
&lt;br /&gt;
     CPU Information - speed, processor, cache.&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/cpuinfo&lt;br /&gt;
&lt;br /&gt;
               processor       : 0&lt;br /&gt;
               vendor_id       : GenuineIntel&lt;br /&gt;
               cpu family      : 15&lt;br /&gt;
               model           : 2&lt;br /&gt;
               model name      : Intel(R) Pentium(R) 4 CPU 2.20GHz&lt;br /&gt;
               stepping        : 9&lt;br /&gt;
               cpu MHz         : 2193.221&lt;br /&gt;
               cache size      : 512 KB&lt;br /&gt;
               fdiv_bug        : no&lt;br /&gt;
               hlt_bug         : no&lt;br /&gt;
               f00f_bug        : no&lt;br /&gt;
               coma_bug        : no&lt;br /&gt;
               fpu             : yes&lt;br /&gt;
               fpu_exception   : yes&lt;br /&gt;
               cpuid level     : 2&lt;br /&gt;
               wp              : yes&lt;br /&gt;
               flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr&lt;br /&gt;
               bogomips        : 4325.37&lt;br /&gt;
&lt;br /&gt;
      &amp;quot;bogomips&amp;quot; is a rough but good way to quickly compare two computer speeds. True it's a&lt;br /&gt;
      bogus reading; but, a &amp;quot;good enough&amp;quot; for government work calculation.  See (TIP 10) for&lt;br /&gt;
      &amp;quot;vmstat&amp;quot; and &amp;quot;iostat&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 85:&lt;br /&gt;
&lt;br /&gt;
     POVRAY - Making Animated GIFs&lt;br /&gt;
&lt;br /&gt;
     To see this in action, reference:&lt;br /&gt;
      http://souptonuts.sourceforge.net/povray/orbit.pov.html&lt;br /&gt;
&lt;br /&gt;
     These are the basic command to create:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        $ povray orbit.ini -Iorbit.pov&lt;br /&gt;
        $ convert -delay 20 *.ppm orbit.gif&lt;br /&gt;
&lt;br /&gt;
     By the way, convert is a program from imagemagick, and it can&lt;br /&gt;
     be downloaded from ( http://www.imagemagick.org ).&lt;br /&gt;
&lt;br /&gt;
    The following is &amp;quot;orbit.pov&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          #include &amp;quot;colors.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;finish.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;metals.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;textures.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;stones.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;skies.inc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          camera {&lt;br /&gt;
            location &amp;lt; 2, 3, -8 &amp;gt;&lt;br /&gt;
            look_at  &amp;lt; 0, 0, 0 &amp;gt;&lt;br /&gt;
            focal_point &amp;lt;0, 0, 0&amp;gt;&lt;br /&gt;
            blur_samples 20&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          light_source {&lt;br /&gt;
                  &amp;lt; 0, 10, 0&amp;gt;&lt;br /&gt;
                  color White&lt;br /&gt;
                  area_light &amp;lt;2,0,0&amp;gt;,&amp;lt;0,0,2&amp;gt;, 2, 2&lt;br /&gt;
                  adaptive 1&lt;br /&gt;
                  fade_distance 8&lt;br /&gt;
                  fade_power 1&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          sky_sphere {&lt;br /&gt;
            S_Cloud3&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          plane { &amp;lt;0, 1, 0&amp;gt;, -1&lt;br /&gt;
                  texture {&lt;br /&gt;
                          pigment {&lt;br /&gt;
                                  checker color Blue, color White&lt;br /&gt;
                          }&lt;br /&gt;
                          finish {Phong_Glossy}&lt;br /&gt;
                  }&lt;br /&gt;
          }&lt;br /&gt;
          #declare ball0=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;0.5, 0.5, 0&amp;gt;, 1&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Yellow}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          #declare ball1=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;3, 2, 0&amp;gt;, 0.5&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Blue}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          #declare ball2=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;3, 1, 0&amp;gt;, 1&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Green}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          object {ball0 rotate 360*clock*y}&lt;br /&gt;
          object {ball1 rotate 720*clock*y}&lt;br /&gt;
          object {ball2 rotate 360*(1 - clock)*y}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    And, &amp;quot;orbit.ini&amp;quot; follows:&lt;br /&gt;
&lt;br /&gt;
          Output_File_Type=P&lt;br /&gt;
&lt;br /&gt;
          Width=320&lt;br /&gt;
          Height=240&lt;br /&gt;
&lt;br /&gt;
          Initial_Frame=1&lt;br /&gt;
          Final_Frame=10&lt;br /&gt;
          Antialias=true&lt;br /&gt;
&lt;br /&gt;
          Subset_Start_Frame=1&lt;br /&gt;
          Subset_End_Frame=10&lt;br /&gt;
&lt;br /&gt;
          Cyclic_Animation=on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 86:&lt;br /&gt;
&lt;br /&gt;
     GPG --  GnuPG&lt;br /&gt;
&lt;br /&gt;
        Reference: http://www.gnupg.org/documentation/faqs.html&lt;br /&gt;
                   http://codesorcery.net/mutt/mutt-gnupg-howto&lt;br /&gt;
                   http://www.gnupg.org/(en)/download/index.html&lt;br /&gt;
                   (SCRIPT 4) on following link:&lt;br /&gt;
                   http://prdownloads.sourceforge.net/souptonuts/README_common_script_commands.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Generage key:&lt;br /&gt;
&lt;br /&gt;
        $ gpg --gen-key&lt;br /&gt;
&lt;br /&gt;
     Generate public key ID and fingerprint&lt;br /&gt;
&lt;br /&gt;
        $ gpg --fingerprint&lt;br /&gt;
&lt;br /&gt;
     Get a list of keys:&lt;br /&gt;
&lt;br /&gt;
        $ gpg --list-keys&lt;br /&gt;
&lt;br /&gt;
          pub  1024D/A11C1499 2004-07-15 Mike Chirico &amp;lt;mchirico@comcast.net&amp;gt;&lt;br /&gt;
          sub  1024g/E1A3C2B3 2004-07-15&lt;br /&gt;
&lt;br /&gt;
     Encrypt&lt;br /&gt;
&lt;br /&gt;
        $ gpg -r Mike  --encrypt sample.txt&lt;br /&gt;
&lt;br /&gt;
       This will produce &amp;quot;sample.txt.asc&amp;quot;, which is a binary file.  Note, I can use &amp;quot;Mike&amp;quot; because that's the&lt;br /&gt;
       name on the list of keys. Again, it will be a binary file.&lt;br /&gt;
&lt;br /&gt;
     Encrypt using &amp;quot;ASCII-armored text&amp;quot;  (--armor), which is probably what you want when sending &amp;quot;in&amp;quot; the body of an&lt;br /&gt;
     email, or some document.&lt;br /&gt;
&lt;br /&gt;
        $ gpg  -r Mike  --encrypt --armor sample.txt&lt;br /&gt;
            or&lt;br /&gt;
        $ gpg -r Mike -e -a sample.txt&lt;br /&gt;
            or&lt;br /&gt;
        $ gpg --output somefile.asc --armor -r Mike  --encrypt --armor sample.txt&lt;br /&gt;
&lt;br /&gt;
     The above 3 statements will still produce &amp;quot;sample.txt.asc&amp;quot;, but look at it, or &amp;quot;$ cat sample.txt.asc&amp;quot; without &lt;br /&gt;
     fear, since there are no binary characters. Yes, you could even compile a program &amp;quot;$ g++ -o test test.c&amp;quot; , then,&lt;br /&gt;
     &amp;quot;$ gpg --output test.asc  -r Mike --encrypt --armor test&amp;quot;. However, when decrypting make sure to pipe&lt;br /&gt;
     the results.&lt;br /&gt;
&lt;br /&gt;
            $ gpg --decrypt test.asc &amp;gt; test&lt;br /&gt;
&lt;br /&gt;
     Export &amp;quot;public&amp;quot; key:&lt;br /&gt;
&lt;br /&gt;
           $ gpg --armor --export Mike &amp;gt; m1.asc&lt;br /&gt;
&lt;br /&gt;
     Signing the file &amp;quot;message.txt&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
           $ gpg --clearsign message.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Sending the key to the &amp;quot;key-server&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        First, list the keys.&lt;br /&gt;
&lt;br /&gt;
                $ gpg --list-keys&lt;br /&gt;
                    /home/chirico/.gnupg/pubring.gpg&lt;br /&gt;
                                 v------------------ Use this with &amp;quot;0x&amp;quot; in front -------&lt;br /&gt;
                  pub  1024D/A11C1499 2004-07-15 Mike Chirico  &amp;lt;mchirico@comcast.net&amp;gt;   |&lt;br /&gt;
                  sub  1024g/E1A3C2B3 2004-07-15                                        |&lt;br /&gt;
                                                                                        |&lt;br /&gt;
                                   v----------------------------------------------------&lt;br /&gt;
                $ gpg --send-keys 0xA11C1499&lt;br /&gt;
&lt;br /&gt;
             The above sends it to the keyserver defined in &amp;quot;/home/chirico/.gnupg/gpg.conf&amp;quot;.  Other key servers:&lt;br /&gt;
&lt;br /&gt;
                            wwwkeys.pgp.net&lt;br /&gt;
                            search.keyserver.net&lt;br /&gt;
                            pgp.ai.mit.edu&lt;br /&gt;
&lt;br /&gt;
             When you go to your user-group meetings, you need to bring 2 forms of ID, and&lt;br /&gt;
             list your Key fingerprint. Shown below is the command for getting this fingerprint.&lt;br /&gt;
&lt;br /&gt;
                $ gpg --fingerprint mchirico@comcast.net&lt;br /&gt;
                 pub   1024D/A11C1499 2004-07-15&lt;br /&gt;
                 Key fingerprint = 9D7F C80D BB7B 4BAB CCA4  1BE9 9056 5BEC A11C 1499&lt;br /&gt;
                 uid   Mike Chirico (http://souptonuts.sourceforge.net/chirico/index.php) &amp;lt;mchirico@comcast.net&amp;gt;&lt;br /&gt;
                 sub   1024g/E1A3C2B3 2004-07-15&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Receving keys:&lt;br /&gt;
&lt;br /&gt;
        The following will retrieve my mchirico@comcast.net key&lt;br /&gt;
&lt;br /&gt;
               $ gpg --recv-keys 0xA11C1499&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Special Note: If you get the following error &amp;quot;GPG: Warning: Using Insecure Memory&amp;quot; , then,&lt;br /&gt;
                   &amp;quot; chmod 4755 /path/to/gpg&amp;quot;  to setuid(root) permissioins on the gpg binary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     NOTE: If using mutt, just before sending with the &amp;quot;y&amp;quot; option, hit &amp;quot;p&amp;quot; to sign or encrypt.&lt;br /&gt;
&lt;br /&gt;
     It's possible to create a gpg/pgp email from the command line. For a tutorial on this,&lt;br /&gt;
     reference (SCRIPT 4) at the following link:&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/README_common_script_commands.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 87:&lt;br /&gt;
&lt;br /&gt;
     Working with Dates: Steffen Beyer has developed a Perl and C module for working with dates&lt;br /&gt;
&lt;br /&gt;
     This softare can be downloaded from the following location:&lt;br /&gt;
        http://www.engelschall.com/u/sb/download/pkg/Date-Calc-5.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
         $ wget http://www.engelschall.com/u/sb/download/pkg/Date-Calc-5.3.tar.gz&lt;br /&gt;
         $ tar -xzvf Date-Calc-5.3.tar.gz&lt;br /&gt;
         $ cd Date-Calc-5.3&lt;br /&gt;
         $ cp ./examples/cal.c .&lt;br /&gt;
         $ gcc cal.c DateCalc.c -o mcal&lt;br /&gt;
&lt;br /&gt;
     The file cal.c contains sample function calls from DateCalc.c.  Note, &amp;quot;DateCalc.c&amp;quot;&lt;br /&gt;
     is just a list of functions and includes for &amp;quot;DateCalc.h&amp;quot; and &amp;quot;ToolBox.h&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Or, and this may be easier, just download the following:&lt;br /&gt;
         http://prdownloads.sourceforge.net/cpearls/date_calc.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
     The above link contains a few examples.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 88:&lt;br /&gt;
&lt;br /&gt;
     Color patterns for mutt.&lt;br /&gt;
&lt;br /&gt;
     The colors can be changed in the /home/user/.muttrc file. The first field begins with&lt;br /&gt;
     color, the second field is the foreground color, and the third field is the background&lt;br /&gt;
     color, or default.&lt;br /&gt;
&lt;br /&gt;
     An example .muttrc for colors:&lt;br /&gt;
&lt;br /&gt;
       # color patterns for mutt&lt;br /&gt;
       color normal     white          black # normal text&lt;br /&gt;
       color indicator  black          yellow  # actual message&lt;br /&gt;
       color tree       brightmagenta  default # thread arrows&lt;br /&gt;
       color status     brightyellow         default # status line&lt;br /&gt;
       color error      brightred      default # errors&lt;br /&gt;
       color message    magenta        default # info messages&lt;br /&gt;
       color signature  magenta        default # signature&lt;br /&gt;
       color attachment brightyellow   red     # MIME attachments&lt;br /&gt;
       color search     brightyellow   red     # search matches&lt;br /&gt;
       color tilde      brightmagenta  default # ~ at bottom of msg&lt;br /&gt;
       color markers    red            default # + at beginning of wrapped lines&lt;br /&gt;
       color hdrdefault cyan           default # default header lines&lt;br /&gt;
       color bold       red            default # hiliting bold patterns in body&lt;br /&gt;
       color underline  green          default # hiliting underlined patterns in body&lt;br /&gt;
       color quoted     cyan           default # quoted text&lt;br /&gt;
       color quoted1    magenta        default&lt;br /&gt;
       color quoted2    red            default&lt;br /&gt;
       color quoted3    green          default&lt;br /&gt;
       color quoted4    magenta           default&lt;br /&gt;
       color quoted5    cyan           default&lt;br /&gt;
       color quoted6    magenta        default&lt;br /&gt;
       color quoted7    red            default&lt;br /&gt;
       color quoted8    green          default&lt;br /&gt;
       color quoted9    cyan           default&lt;br /&gt;
       color body   cyan  default  &amp;quot;((ftp|http|https)://|news:)[^ &amp;gt;)\&amp;quot;\t]+&amp;quot;&lt;br /&gt;
       color body   cyan  default  &amp;quot;[-a-z_0-9.+]+@[-a-z_0-9.]+&amp;quot;&lt;br /&gt;
       color body   red   default  &amp;quot;(^| )\\*[-a-z0-9*]+\\*[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color body   green default  &amp;quot;(^| )_[-a-z0-9_]+_[,.?]?[\n]&amp;quot;&lt;br /&gt;
       color body   red   default  &amp;quot;(^| )\\*[-a-z0-9*]+\\*[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color body   green default  &amp;quot;(^| )_[-a-z0-9_]+_[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color index  cyan  default  ~F         # Flagged&lt;br /&gt;
       color index  red   default  ~N         # New&lt;br /&gt;
       color index  magenta    default  ~T         # Tagged&lt;br /&gt;
       color index  cyan       default  ~D         # Deleted&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 190)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 89:&lt;br /&gt;
&lt;br /&gt;
     ps command in detail&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Here are the possible codes when using state &amp;quot;$ ps -e -o state,cmd&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             PROCESS STATE CODES&lt;br /&gt;
                  D   uninterruptible sleep (usually IO)&lt;br /&gt;
                  R   runnable (on run queue)&lt;br /&gt;
                  S   sleeping&lt;br /&gt;
                  T   traced or stopped&lt;br /&gt;
                  Z   a defunct (&amp;quot;zombie&amp;quot;) process&lt;br /&gt;
&lt;br /&gt;
                  &amp;lt;    high-priority (not nice to other users)&lt;br /&gt;
                  N    low-priority (nice to other users)&lt;br /&gt;
                  L    has pages locked into memory (for real-time and custom IO)&lt;br /&gt;
                  s    is a session leader&lt;br /&gt;
                  l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)&lt;br /&gt;
                  +    is in the foreground process group&lt;br /&gt;
&lt;br /&gt;
    For instance:&lt;br /&gt;
&lt;br /&gt;
     Note that the -o is for user defined, and -e is for select&lt;br /&gt;
     all process.&lt;br /&gt;
&lt;br /&gt;
       $ ps -e -o pid,state,start,time,etime,cmd&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
             9946 S 15:40:45 00:00:00    02:23:29 /bin/bash -i&lt;br /&gt;
             9985 T 15:41:24 00:00:01    02:22:50 emacs mout2&lt;br /&gt;
            10003 T 15:43:59 00:00:00    02:20:15 emacs NOTES&lt;br /&gt;
            10320 T 17:38:42 00:00:00       25:32 emacs stuff.c&lt;br /&gt;
         ...&lt;br /&gt;
&lt;br /&gt;
     You may want to command below, without the -e, which will give the&lt;br /&gt;
     process only under the current terminal.&lt;br /&gt;
&lt;br /&gt;
       $ ps -o pid,state,start,time,etime,cmd&lt;br /&gt;
&lt;br /&gt;
     Want to find what 's impacting your load?&lt;br /&gt;
&lt;br /&gt;
       $ ps -e -o %cpu,pid,state,start,time,etime,%cpu,%mem,cmd|sort -rn|less&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ ps aux&lt;br /&gt;
&lt;br /&gt;
            USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND&lt;br /&gt;
            root         1  0.0  0.0  1380  480 ?        S    Aug04   0:00 init [3]&lt;br /&gt;
            root         2  0.0  0.0     0    0 ?        SWN  Aug04   0:00 [ksoftirqd/0]&lt;br /&gt;
            root         3  0.0  0.0     0    0 ?        SW&amp;lt;  Aug04   0:00 [events/0]&lt;br /&gt;
            root         4  0.0  0.0     0    0 ?        SW&amp;lt;  Aug04   0:00 [khelper]&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     Or, if you want to see the environment add the -e option&lt;br /&gt;
&lt;br /&gt;
       $ ps aeux&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
            chirico   2735  0.0  0.1  4400 1492 pts/0    S    Aug04   0:00 -bash USER=chirico LOGNAME=chirico HOME=/home/chirico PATH=/usr/&lt;br /&gt;
            chirico   2771  0.0  0.0  4328  924 pts/0    S    Aug04   0:00 screen -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm S&lt;br /&gt;
            chirico   2772  0.0  0.6  9476 6352 ?        S    Aug04   0:54 SCREEN -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm S&lt;br /&gt;
            chirico   2773  0.0  0.1  4432 1548 pts/1    S    Aug04   0:10 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            chirico   2797  0.0  0.1  4416 1496 pts/2    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            root      2821  0.0  0.0  4100  952 pts/2    S    Aug04   0:00 su -&lt;br /&gt;
            root      2822  0.0  0.1  4384 1480 pts/2    S    Aug04   0:00 -bash&lt;br /&gt;
            chirico   2862  0.0  0.1  4428 1524 pts/3    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            sporkey   2946  0.0  0.2  6836 2960 ?        S    Aug04   0:15 fetchmail&lt;br /&gt;
            chirico   2952  0.0  0.1  4436 1552 pts/5    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            chirico   3880  0.0  0.1  4416 1496 pts/6    S    Aug05   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            root      3904  0.0  0.0  4100  956 pts/6    S    Aug05   0:00 su - donkey&lt;br /&gt;
            donkey    3905  0.0  0.1  4336 1452 pts/6    S    Aug05   0:00 -bash&lt;br /&gt;
            donkey    3938  0.0  0.2  6732 2856 ?        S    Aug05   0:14 fetchmail&lt;br /&gt;
            chirico   3944  0.0  0.1  4416 1496 pts/7    S    Aug05   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     There is also a -f &amp;quot;forrest&amp;quot; option. Also note below &amp;quot; -bash&amp;quot; is the start of a login shell.&lt;br /&gt;
&lt;br /&gt;
      $ ps aeuxwwf &lt;br /&gt;
     &lt;br /&gt;
     The ww option above gives a wide format with all variables. Use the above command if you plan&lt;br /&gt;
     to parse through a Perl script. Otherwise, it may be easier to do a quick read using the command&lt;br /&gt;
     below, without &amp;quot;ww&amp;quot;.    &lt;br /&gt;
&lt;br /&gt;
      $ ps aeuxf&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
            root      2339  0.0  0.1  3512 1444 ?        S    Dec01   0:00 /usr/sbin/sshd&lt;br /&gt;
            root     25651  0.0  0.1  6764 1980 ?        S    Dec23   0:00  \_ /usr/sbin/sshd&lt;br /&gt;
            chirico  25653  0.0  0.2  6840 2236 ?        S    Dec23   0:14      \_ /usr/sbin/sshd&lt;br /&gt;
            chirico  25654  0.0  0.1  4364 1440 pts/4    S    Dec23   0:00          \_ -bash USER=chirico LOGNAME=chirico HOME=/home/chirico&lt;br /&gt;
            chirico  25690  0.0  0.0  4328  920 pts/4    S    Dec23   0:00              \_ screen -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm&lt;br /&gt;
            root      2355  0.0  0.0  2068  904 ?        S    Dec01   0:00 xinetd -stayalive -pidfile /var/run/xinetd.pid&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     It is also possible to list the process by command line. For example, the following command will only list the emacs&lt;br /&gt;
     processes.&lt;br /&gt;
&lt;br /&gt;
      $ ps -fC emacs&lt;br /&gt;
       UID        PID  PPID  C STIME TTY          TIME CMD&lt;br /&gt;
       chirico   5049  5020  0 May11 pts/13   00:00:00 emacs -nw Notes&lt;br /&gt;
       chirico  12368  5104  0 May12 pts/18   00:00:00 emacs -nw dnotify.c&lt;br /&gt;
       chirico  19792 18028  0 May13 pts/20   00:00:00 emacs -nw hello.c&lt;br /&gt;
       chirico  14034 27367  0 18:52 pts/8    00:00:00 emacs -nw How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
     You may also want to consider using top in batch mode. Here the &amp;quot;-n 1&amp;quot; means refresh once,&lt;br /&gt;
     and the &amp;quot;b&amp;quot; is for batch. The &amp;quot;fmt -s&amp;quot; is to put it in a more readable format.&lt;br /&gt;
&lt;br /&gt;
       $ top -n 1 b |fmt  -s &amp;gt;&amp;gt;statfile&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 90:&lt;br /&gt;
&lt;br /&gt;
     Learning Assembly.&lt;br /&gt;
&lt;br /&gt;
     Once you have written the source, assuming the file is &amp;quot;exit.s&amp;quot;, it can be compiled as follows:&lt;br /&gt;
&lt;br /&gt;
            $ as exit.s -o exit.o&lt;br /&gt;
            $ ld exit.o -o exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Here is the program:&lt;br /&gt;
&lt;br /&gt;
         #&lt;br /&gt;
         #INPUT:  none&lt;br /&gt;
         #&lt;br /&gt;
         #OUTPUT:         returns a status code. This can be viewed&lt;br /&gt;
         # by typing&lt;br /&gt;
         #&lt;br /&gt;
         # echo $?&lt;br /&gt;
         #&lt;br /&gt;
         # after running the program&lt;br /&gt;
         #&lt;br /&gt;
         #VARIABLES:&lt;br /&gt;
         # %eax holds the system call number&lt;br /&gt;
         # (this is always the case)&lt;br /&gt;
         #&lt;br /&gt;
         # %ebx holds the return status&lt;br /&gt;
         #&lt;br /&gt;
                 .section .data&lt;br /&gt;
                 .section .text&lt;br /&gt;
&lt;br /&gt;
                 .globl _start&lt;br /&gt;
         _start:&lt;br /&gt;
                 movl $1, %eax # this is the linux kernel command&lt;br /&gt;
                 # number (system call) for exiting&lt;br /&gt;
                 # a program&lt;br /&gt;
                 movl $0, %ebx # this is the status number we will&lt;br /&gt;
                 # return to the operating system.&lt;br /&gt;
                 # Change this around and it will&lt;br /&gt;
                 # return different things to&lt;br /&gt;
                 # echo $?&lt;br /&gt;
                 int $0x80 # this wakes up the kernel to run&lt;br /&gt;
                 # the exit command&lt;br /&gt;
&lt;br /&gt;
     After running this program, you can get the exit code.&lt;br /&gt;
&lt;br /&gt;
            $ exit $?&lt;br /&gt;
            0&lt;br /&gt;
&lt;br /&gt;
     That is about all it does; but, get the book for more details. The&lt;br /&gt;
     book is free.&lt;br /&gt;
&lt;br /&gt;
          http://savannah.nongnu.org/download/pgubook/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 91:&lt;br /&gt;
&lt;br /&gt;
     Creating a sandbox for reiserfstune,debugreiserfs and ACL.  Also see TIP 4.&lt;br /&gt;
&lt;br /&gt;
     Assume you have a reisers files system created from a disk file, which&lt;br /&gt;
     means you have done something like the following:&lt;br /&gt;
&lt;br /&gt;
          # dd if=/dev/zero of=disk-rfs count=102400&lt;br /&gt;
          # losetup  /dev/loop4 ./disk-rfs&lt;br /&gt;
          # mkfs -t reiserfs /dev/loop4&lt;br /&gt;
          # mkdir /fs2&lt;br /&gt;
          # mount -o loop,acl ./disk-rfs /fs2&lt;br /&gt;
&lt;br /&gt;
     Now, you can run reiserfstune. But, first you will need to umount fs2&lt;br /&gt;
&lt;br /&gt;
          # umount /fs2&lt;br /&gt;
          # reiserfstune ./disk-rfs&lt;br /&gt;
&lt;br /&gt;
     Or you can run the debug command&lt;br /&gt;
&lt;br /&gt;
          # debugreiserfs -J ./disk-rfs&lt;br /&gt;
&lt;br /&gt;
     Now, suppose you run through a lot of the debug options on&lt;br /&gt;
     http://www.namesys.com/ and you destroy this file.&lt;br /&gt;
&lt;br /&gt;
     You can recreate the file and delete the loop device.&lt;br /&gt;
&lt;br /&gt;
          # dd if=/dev/zero of=disk-rfs count=102400&lt;br /&gt;
          # losetup -d /dev/loop4&lt;br /&gt;
          # mount -o loop,acl ./disk-rfs /fs2&lt;br /&gt;
&lt;br /&gt;
     Now, try working with some of the ACL options - you can only do this&lt;br /&gt;
     with the latest kernel and tools -- Fedora Core 2 will work.&lt;br /&gt;
&lt;br /&gt;
     Assume you have 3 users, donkey, chirico and bozo2. You can give&lt;br /&gt;
     everyone rights to this file system as follows:&lt;br /&gt;
&lt;br /&gt;
          # setfacl -R -m d:u:donkey:rwx,d:u:chirico:rwx,d:u:bozo2:rwx /fs2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 92:&lt;br /&gt;
&lt;br /&gt;
     SpamAssassin - Setup.&lt;br /&gt;
&lt;br /&gt;
     Step 1.&lt;br /&gt;
&lt;br /&gt;
           Installing the SpamAssassin CPAN utility. You will need to do this&lt;br /&gt;
           as root.&lt;br /&gt;
        &lt;br /&gt;
              $ su -&lt;br /&gt;
&lt;br /&gt;
           Once you have root privileges invoke cpan.&lt;br /&gt;
        &lt;br /&gt;
              # perl -MCPAN -e shell&lt;br /&gt;
&lt;br /&gt;
              cpan&amp;gt;&lt;br /&gt;
&lt;br /&gt;
           Now install with prerequisites policy set to ask.&lt;br /&gt;
        &lt;br /&gt;
              cpan&amp;gt; o conf prerequisites_policy ask&lt;br /&gt;
        &lt;br /&gt;
              cpan&amp;gt; install Mail::SpamAssassin&lt;br /&gt;
        &lt;br /&gt;
           You will get lots of output as the necessary modules are downloaded and&lt;br /&gt;
           compiled and installed.&lt;br /&gt;
&lt;br /&gt;
     Step 2.&lt;br /&gt;
&lt;br /&gt;
            Configuration.&lt;br /&gt;
&lt;br /&gt;
            Edit the following &amp;quot;/etc/mail/spamassassin/local.cf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            Here is a look at my file&lt;br /&gt;
&lt;br /&gt;
                $ cat /etc/mail/spamassassin/local.cf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                # This is the right place to customize your installation of SpamAssassin.&lt;br /&gt;
                #&lt;br /&gt;
                # See 'perldoc Mail::SpamAssassin::Conf' for details of what can be&lt;br /&gt;
                # tweaked.&lt;br /&gt;
                #&lt;br /&gt;
                ###########################################################################&lt;br /&gt;
                #&lt;br /&gt;
                # rewrite_subject 0&lt;br /&gt;
                # report_safe 1&lt;br /&gt;
                # trusted_networks 212.17.35.&lt;br /&gt;
                #&lt;br /&gt;
                &lt;br /&gt;
                # Below added from book&lt;br /&gt;
                # You may want to set this to 5, then, work your way down.&lt;br /&gt;
                # Currently I have this 3&lt;br /&gt;
                required_hits 3&lt;br /&gt;
                &lt;br /&gt;
                # This determines how spam is reported. Currently safe email is reported&lt;br /&gt;
                # in the message.&lt;br /&gt;
                report_safe 1&lt;br /&gt;
                &lt;br /&gt;
                # The will rewrite the tag of the spam message.&lt;br /&gt;
                rewrite_subject 1&lt;br /&gt;
                &lt;br /&gt;
                # By default, SpamAssassin will run RBL checks.  If your ISP already&lt;br /&gt;
                # does this, set this to 1.&lt;br /&gt;
                skip_rbl_checks 0&lt;br /&gt;
&lt;br /&gt;
     Step 3.&lt;br /&gt;
&lt;br /&gt;
            Update .procmail.&lt;br /&gt;
&lt;br /&gt;
            You should update the .procmail file as follows. Here is my /home/chirico/.procmail file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ cat /home/chirico/.procmailrc&lt;br /&gt;
&lt;br /&gt;
                PATH=/bin:/usr/bin:/usr/local/bin&lt;br /&gt;
                MAILDIR=/var/spool/mail&lt;br /&gt;
                DEFAULT=/var/spool/mail/chirico&lt;br /&gt;
                LOGFILE=/home/chirico/MailBAG&lt;br /&gt;
                MYHOME=/home/chirico&lt;br /&gt;
                #  Must have folder MailTRASH&lt;br /&gt;
                TRASH=/home/chirico/MailTRASH&lt;br /&gt;
                &lt;br /&gt;
                # Will get everything from this mail&lt;br /&gt;
                :0&lt;br /&gt;
                * ^From:.*sporkey@comcast.net&lt;br /&gt;
                        $DEFAULT&lt;br /&gt;
                &lt;br /&gt;
                # Spamassassin&lt;br /&gt;
                :0fw&lt;br /&gt;
                * &amp;lt;300000&lt;br /&gt;
                |/usr/local/bin/spamassassin&lt;br /&gt;
&lt;br /&gt;
      Reference:&lt;br /&gt;
        http://pm-doc.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 93:&lt;br /&gt;
&lt;br /&gt;
     Make Graphs: using dot and neato.&lt;br /&gt;
&lt;br /&gt;
       $ dot -Tpng dotfile -o myout.png&lt;br /&gt;
&lt;br /&gt;
     To see the output reference the following:&lt;br /&gt;
       http://souptonuts.sourceforge.net/code/myout.png&lt;br /&gt;
&lt;br /&gt;
     Where &amp;quot;dotfile&amp;quot; is the following:&lt;br /&gt;
&lt;br /&gt;
       $ cat dotfile&lt;br /&gt;
&lt;br /&gt;
       digraph g&lt;br /&gt;
       {&lt;br /&gt;
               node [shape = record];&lt;br /&gt;
&lt;br /&gt;
               node0 [ label =&amp;quot;&amp;lt;f0&amp;gt; stuff | &amp;lt;f1&amp;gt; J | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node1 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; E | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node4 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; C | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node6 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; I | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node2 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; U | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node5 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; N | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node9 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; Y | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node8 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; W | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node10 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; Z | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node7 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; A | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node3 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; G | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node0&amp;quot;:f0 -&amp;gt; &amp;quot;node1&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node0&amp;quot;:f2 -&amp;gt; &amp;quot;node2&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node1&amp;quot;:f0 -&amp;gt; &amp;quot;node4&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node1&amp;quot;:f2 -&amp;gt; &amp;quot;node6&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node4&amp;quot;:f0 -&amp;gt; &amp;quot;node7&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node4&amp;quot;:f2 -&amp;gt; &amp;quot;node3&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node2&amp;quot;:f0 -&amp;gt; &amp;quot;node5&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node2&amp;quot;:f2 -&amp;gt; &amp;quot;node9&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node9&amp;quot;:f0 -&amp;gt; &amp;quot;node8&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node9&amp;quot;:f2 -&amp;gt; &amp;quot;node10&amp;quot;:f1;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
     Checkout the following article:&lt;br /&gt;
        http://www.linuxjournal.com/article.php?sid=7275&lt;br /&gt;
&lt;br /&gt;
     To download this software&lt;br /&gt;
        http://www.graphviz.org/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 94:&lt;br /&gt;
&lt;br /&gt;
     Makefile: working with conditions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     First note that all the indentations of the file must be&lt;br /&gt;
     a single tab. There cannot be any spaces, or make will&lt;br /&gt;
     not run.&lt;br /&gt;
&lt;br /&gt;
       $ cat Makefile&lt;br /&gt;
&lt;br /&gt;
        # Compiler flags&lt;br /&gt;
        sqliteLIB := $(shell ls /usr/local/lib/libsqlite.so)&lt;br /&gt;
        sqlite3LIB := $(shell ls /usr/local/lib/libsqlite3.so)&lt;br /&gt;
        # all assumes sqlite and sqlite3 are installed&lt;br /&gt;
        #&lt;br /&gt;
&lt;br /&gt;
        test:&lt;br /&gt;
        ifeq (&amp;quot;$(sqlite3LIB)&amp;quot;,&amp;quot;/usr/local/lib/libsqlite3.so&amp;quot;)&lt;br /&gt;
             @echo -e &amp;quot;True -- we found the file&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
             @echo &amp;quot;False -- we did not find the file&amp;quot;&lt;br /&gt;
        endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     So, if I run make I will get the following output.&lt;br /&gt;
&lt;br /&gt;
       $ make&lt;br /&gt;
       True -- we found the file&lt;br /&gt;
&lt;br /&gt;
     This is because I have a file /usr/local/lib/libsqlite3.so on my system.&lt;br /&gt;
     Note how the assignment is made, with the shell command&lt;br /&gt;
&lt;br /&gt;
           sqlite3LIB := $(shell ls /usr/local/lib/libsqlite3.so)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 95:&lt;br /&gt;
&lt;br /&gt;
     Bash: Conditional Expressions&lt;br /&gt;
&lt;br /&gt;
          if [ -e /etc/ntp.conf ]&lt;br /&gt;
            then&lt;br /&gt;
              echo &amp;quot;You have the ntp config file&amp;quot;&lt;br /&gt;
            else&lt;br /&gt;
              echo &amp;quot;You do not have the ntp config file&amp;quot;&lt;br /&gt;
          fi&lt;br /&gt;
&lt;br /&gt;
       Now using an AND condition inside the [ ]. By the way, above, you&lt;br /&gt;
       can put the &amp;quot;then&amp;quot; on the same line as the if &amp;quot;if [ -e /etc/ntp.conf ]; then&amp;quot;&lt;br /&gt;
       as long as you use the &amp;quot;;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           if [ \( -e /etc/ntp.conf \) -a \( -e /etc/ntp/ntpservers \) ]&lt;br /&gt;
             then&lt;br /&gt;
               echo &amp;quot;You have ntp config and ntpservers&amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp.conf ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntp.conf &amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp/ntpservers ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntpservers &amp;quot;&lt;br /&gt;
             else&lt;br /&gt;
               echo &amp;quot; you have neither ntp.conf or ntpservers&amp;quot;&lt;br /&gt;
           fi&lt;br /&gt;
&lt;br /&gt;
        A few things to note above. Else if statement is written as &amp;quot;elif&amp;quot;, and when&lt;br /&gt;
        dealing with &amp;quot;(&amp;quot; you will need to insert &amp;quot;\(&amp;quot;. By the way &amp;quot;-o&amp;quot; can replace &amp;quot;-a&amp;quot;&lt;br /&gt;
        and the &amp;quot;-o&amp;quot; is for OR condition. AND can be done as follows too.&lt;br /&gt;
&lt;br /&gt;
           if [ -e /etc/ntp.conf ] &amp;amp;&amp;amp; [ -e /etc/ntp/ntpservers ]&lt;br /&gt;
             then&lt;br /&gt;
               echo &amp;quot;You have ntp config and ntpservers&amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp.conf ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntp.conf &amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp/ntpservers ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntpservers &amp;quot;&lt;br /&gt;
             else&lt;br /&gt;
               echo &amp;quot; you have neither ntp.conf or ntpservers&amp;quot;&lt;br /&gt;
           fi&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (files).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             -b file      True if file exists and is a block file&lt;br /&gt;
             -c file      True if file exists and is a character device file&lt;br /&gt;
             -d file      True if file exists and is a directory&lt;br /&gt;
             -e file      True if file exists&lt;br /&gt;
             -f file      True if file exists and is a regular file&lt;br /&gt;
             -g file      True if file exists and is set goup id&lt;br /&gt;
             -G file      True if owned by the effective group ID&lt;br /&gt;
&lt;br /&gt;
             -k file      True if &amp;quot;sticky&amp;quot; bit is set and file exists&lt;br /&gt;
             -L file      True if file exists and is a symbolic link&lt;br /&gt;
             -n string    True if string is non-null&lt;br /&gt;
&lt;br /&gt;
             -O file      Ture if file exists and is owned by the effective user ID&lt;br /&gt;
&lt;br /&gt;
             -p file      True if file is a named pipe (FIFO)&lt;br /&gt;
             -r file      True if file is readable&lt;br /&gt;
             -s file      True if file has size &amp;gt; 0&lt;br /&gt;
             -S file      True if file exists and is a socket&lt;br /&gt;
&lt;br /&gt;
             -t file      True if file is open and refers to a terminal.&lt;br /&gt;
             -u file      True if setuid bit is set&lt;br /&gt;
             -w file      True if file exists and is writeable&lt;br /&gt;
             -x file      True if file executable&lt;br /&gt;
             -x dir       True if directory can be searched&lt;br /&gt;
&lt;br /&gt;
             file1 -nt file2     True if file1 modification date newer than file2&lt;br /&gt;
             file1 -ot file2     True if file1 modification date older than file2&lt;br /&gt;
             file1 -ef file2     True if file1 and file2 have same inode&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (Integers).&lt;br /&gt;
&lt;br /&gt;
             -lt  Less than&lt;br /&gt;
             -le  Less than or equal&lt;br /&gt;
             -eq  Equal&lt;br /&gt;
             -ge  Greater than or equal&lt;br /&gt;
             -gt  Greater than&lt;br /&gt;
             -ne  Not equal&lt;br /&gt;
&lt;br /&gt;
          Example usage.&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
             {&lt;br /&gt;
               while read num value; do&lt;br /&gt;
                if [ $num -gt  2 ]; then&lt;br /&gt;
                  echo $value&lt;br /&gt;
                fi&lt;br /&gt;
               done&lt;br /&gt;
             } &amp;lt; somefile&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (Strings).&lt;br /&gt;
&lt;br /&gt;
             str1 = str2      str1 matches str2&lt;br /&gt;
             str1 != str2     str1 does not matches str2&lt;br /&gt;
             str1 &amp;lt; str2      str1 is less than str2&lt;br /&gt;
             str1 &amp;gt;  str2     str1 is greater than str2&lt;br /&gt;
             -n str1          str1 is not null (length greater than 0)&lt;br /&gt;
             -z str1          str1 is null (las length 0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 96:&lt;br /&gt;
&lt;br /&gt;
     CVS: Working with cvs&lt;br /&gt;
&lt;br /&gt;
      INITIAL REPOSITORY:&lt;br /&gt;
&lt;br /&gt;
       To create a repository, and this is normally done by the system admin. This&lt;br /&gt;
       is NOT creating a project to checkout, but the location where everything&lt;br /&gt;
       will be stored! The initial repository!&lt;br /&gt;
&lt;br /&gt;
             cvs -d repository_root_directory init&lt;br /&gt;
&lt;br /&gt;
       Or here is a specific example:&lt;br /&gt;
&lt;br /&gt;
             cvs -d /work/cvsREPOSITORY/   init&lt;br /&gt;
&lt;br /&gt;
       Creating a directory tree from scratch. For a new project, the easiest thing to&lt;br /&gt;
       do is probably to create an empty directory structure, like this:&lt;br /&gt;
&lt;br /&gt;
             $ mkdir sqlite_examples&lt;br /&gt;
             $ mkdir sqlite_examples/man&lt;br /&gt;
             $ mkdir sqlite_examples/testing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       After that, you use the import command to create the&lt;br /&gt;
       corresponding (empty) directory structure inside the repository:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             $ cd &amp;lt;directory&amp;gt;&lt;br /&gt;
             $ cvs -d repository_root_directory import  -m &amp;quot;Created directory structure&amp;quot; yoyodyne/dir yoyo start&lt;br /&gt;
&lt;br /&gt;
       Or, here is a specific example.&lt;br /&gt;
&lt;br /&gt;
             $  cd sqlite_examples&lt;br /&gt;
             $  cvs  -d /work/cvsREPOSITORY/ import -m 'test SQlite'  sqlite_examples sqlite_examples start&lt;br /&gt;
&lt;br /&gt;
       Now, you can delete the directory sqlite_examples, or go to another directory and type&lt;br /&gt;
       the following:&lt;br /&gt;
&lt;br /&gt;
             $ cvs -d /work/cvsREPOSITORY/ co sqlite_examples&lt;br /&gt;
&lt;br /&gt;
     COOL TOOLS:&lt;br /&gt;
&lt;br /&gt;
           1. cvsps&lt;br /&gt;
           2. cvsreport&lt;br /&gt;
&lt;br /&gt;
         cvsps which you can find at http://www.cobite.com/cvsps/cvsps-2.0rc1.tar.gz&lt;br /&gt;
&lt;br /&gt;
             $ cvsps -f README_sqlite_tutorial.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 97:&lt;br /&gt;
&lt;br /&gt;
     Common vi and vim commands&lt;br /&gt;
&lt;br /&gt;
           Command mode ESC&lt;br /&gt;
&lt;br /&gt;
                dd       delete&lt;br /&gt;
                u        undelete&lt;br /&gt;
                y        yank (copy to buffer)&lt;br /&gt;
                p/P      p before cursor/P after cursor&lt;br /&gt;
&lt;br /&gt;
                Ctl-g    show current line number&lt;br /&gt;
                shft-G   end of file&lt;br /&gt;
              n shft-G   move to line n&lt;br /&gt;
&lt;br /&gt;
               /stuff/   search&lt;br /&gt;
                  n   repeat in same direction&lt;br /&gt;
                  N   repeat in opposite direction&lt;br /&gt;
                  /return  repeat seach forward&lt;br /&gt;
                  ?return  repeat seach backward&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;dyy  Yank current line to buffer d&lt;br /&gt;
               &amp;quot;a7yy Yank next 7 lines to buffer a&lt;br /&gt;
                    or&lt;br /&gt;
               :1,7ya a  Yank [ya] lines 1,7 to buffer a&lt;br /&gt;
               :1,7ya b  Yank [ya] lines 1,7 to buffer b&lt;br /&gt;
&lt;br /&gt;
               :5 pu b   Put [pu] buffer b after line 5&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;dP   Put the content of buffer d before cursor&lt;br /&gt;
               &amp;quot;ap   Put the contents of buffer a after cursor&lt;br /&gt;
&lt;br /&gt;
               :1,4 w! file2  Write lines 1,4 to file2&lt;br /&gt;
               :1,3&lt;br /&gt;
&lt;br /&gt;
               :set nu     Display line numbers&lt;br /&gt;
               :set nonum  Turns off display&lt;br /&gt;
&lt;br /&gt;
               :e &amp;lt;filename&amp;gt; Edit a file in a new buffer&lt;br /&gt;
&lt;br /&gt;
            vim&lt;br /&gt;
               :split&lt;br /&gt;
               :split &amp;lt;filename&amp;gt;&lt;br /&gt;
               :sp &amp;lt;filename&amp;gt;&lt;br /&gt;
               :split new&lt;br /&gt;
&lt;br /&gt;
                   ctl-w   To move between windows&lt;br /&gt;
                   ctl-w+&lt;br /&gt;
                   ctl-w-  To change size&lt;br /&gt;
                   ctl+wv  Split windows vertically&lt;br /&gt;
                   ctl-wq  Close window&lt;br /&gt;
&lt;br /&gt;
               :only       To view only 1 window&lt;br /&gt;
&lt;br /&gt;
            vim dictionary - put the following command in ~/.vimrc&lt;br /&gt;
&lt;br /&gt;
                   set dictionary+=/usr/share/dict/words&lt;br /&gt;
                   set thesaurus+=/usr/share/dict/words&lt;br /&gt;
              &lt;br /&gt;
               Now, after you type a word &amp;lt;ctl-x&amp;gt;&amp;lt;ctl-k&amp;gt;&amp;lt;ctl-n&amp;gt; and to &lt;br /&gt;
               go back in the listing &amp;lt;ctl-p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                   butter&amp;lt;ctl-x&amp;gt;&amp;lt;ctl-k&amp;gt;&amp;lt;ctl-n&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 98:&lt;br /&gt;
&lt;br /&gt;
     Using apt-get&lt;br /&gt;
&lt;br /&gt;
          $ apt-get update&lt;br /&gt;
          $ apt-get -s install &amp;lt;pkage&amp;gt;    &amp;lt;---- if everything is ok, then, remove the s&lt;br /&gt;
&lt;br /&gt;
     Note you may want to use dpkg to purge if you have to do a reinstall.&lt;br /&gt;
&lt;br /&gt;
          $ dpkg --purge exim4-base&lt;br /&gt;
          $ dpkg --purge exim4-config&lt;br /&gt;
          $ apt-get install exim4&lt;br /&gt;
&lt;br /&gt;
          $ dpkg-reconfigure exim4-config&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 99:&lt;br /&gt;
&lt;br /&gt;
     Mounting a cdrom on openbsd and installing packages&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /cdrom&lt;br /&gt;
          $ mount /dev/cd0a /cdrom&lt;br /&gt;
          $ cd /cdrom&lt;br /&gt;
&lt;br /&gt;
     To add packages&lt;br /&gt;
&lt;br /&gt;
          $ pkg_add -v  &amp;lt;directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Mounting a cdrom on linux to a user's home sub-directory:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /home/chirico/cdrom&lt;br /&gt;
          $ mount /dev/cdrom /home/chirico/cdrom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 100:&lt;br /&gt;
&lt;br /&gt;
    Creating a boot floppy for knoppix cd:&lt;br /&gt;
&lt;br /&gt;
          $ dd if=/mnt/cdrom/KNOPPIX/boot.img of=/dev/fd0 bs=1440k&lt;br /&gt;
&lt;br /&gt;
    References:&lt;br /&gt;
        http://www.knoppix.net/docs/index.php/BootFloppyHowTo&lt;br /&gt;
&lt;br /&gt;
    For a lot of the knoppix how-to's&lt;br /&gt;
        http://www.knoppix.net/docs/index.php/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 101:&lt;br /&gt;
&lt;br /&gt;
    Diction and Style Tools for Linux  http://ftp.gnu.org/gnu/diction/&lt;br /&gt;
&lt;br /&gt;
        $ diction mytext|less&lt;br /&gt;
&lt;br /&gt;
    Or, this can be done interactively&lt;br /&gt;
&lt;br /&gt;
        $ diction&lt;br /&gt;
        This is more text to read and you can do with it&lt;br /&gt;
        what you want.&lt;br /&gt;
        (stdin):1: This is more text to read and you [can -&amp;gt; (do not confuse with &amp;quot;may&amp;quot;)] do with it what you want.&lt;br /&gt;
&lt;br /&gt;
    DESCRIPTION&lt;br /&gt;
       Diction finds all sentences in a document, that contain phrases from  a&lt;br /&gt;
       database  of  frequently  misused,  bad  or  wordy diction.  It further&lt;br /&gt;
       checks for double words.  If no files are given, the document  is  read&lt;br /&gt;
       from  standard input.  Each found phrase is enclosed in [ ] (brackets).&lt;br /&gt;
       Suggestions and advice, if any, are printed headed by a right arrow -&amp;gt;.&lt;br /&gt;
       A  sentence is a sequence of words, that starts with a capitalised word&lt;br /&gt;
       and ends with a full stop, double colon, question mark or  exclaimation&lt;br /&gt;
       mark.  A single letter followed by a dot is considered an abbreviation,&lt;br /&gt;
       so it does not terminate a sentence.   Various  multi-letter  abbrevia-&lt;br /&gt;
       tions are recognized, they do not terminate a sentence as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 102:&lt;br /&gt;
&lt;br /&gt;
    Using a mail alias.&lt;br /&gt;
&lt;br /&gt;
       Suppose all root mail on your system to go to one root account root@main.com&lt;br /&gt;
&lt;br /&gt;
       In the following file:&lt;br /&gt;
&lt;br /&gt;
             /etc/aliases&lt;br /&gt;
&lt;br /&gt;
       Add this line&lt;br /&gt;
&lt;br /&gt;
             root:    root@main.com&lt;br /&gt;
&lt;br /&gt;
       Next, run newaliases [/usr/bin/newaliases] as follows:&lt;br /&gt;
&lt;br /&gt;
             $ newaliases&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Special note: It's possible to send mail to more than one address. Suppose you want&lt;br /&gt;
                     mail going to root@main.com above, plus you want it going to user donkey&lt;br /&gt;
                     on the local system.&lt;br /&gt;
&lt;br /&gt;
             root:  root@main.com donkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 103:&lt;br /&gt;
&lt;br /&gt;
    Chrony - this service is similiar to ntp. It keeps accurate time&lt;br /&gt;
            on your computer against a very accurate clock in across&lt;br /&gt;
            a network with various time delays.&lt;br /&gt;
&lt;br /&gt;
    Reference: http://go.to/chrony&lt;br /&gt;
&lt;br /&gt;
        In the file &amp;quot;/etc/chrony/chrony.conf&amp;quot; add/replace the following&lt;br /&gt;
&lt;br /&gt;
             server 146.186.218.60&lt;br /&gt;
             server 128.118.25.3&lt;br /&gt;
             server 128.2.129.21&lt;br /&gt;
&lt;br /&gt;
        Next start the chrony service&lt;br /&gt;
&lt;br /&gt;
           $ /etc/init.d/chrony restart&lt;br /&gt;
&lt;br /&gt;
     Next verify that this is working. It may take 20 or 30 minutes to update&lt;br /&gt;
     the clock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Shell command:&lt;br /&gt;
       # chronyc&lt;br /&gt;
       chronyc&amp;gt; sourcestats&lt;br /&gt;
       210 Number of sources = 3&lt;br /&gt;
       Name/IP Address            NP  NR  Span  Frequency   Freq Skew   Std Dev&lt;br /&gt;
       ========================================================================&lt;br /&gt;
       b50.cede.psu.edu            2   0    64       0.000    2000.000  4000ms&lt;br /&gt;
       otc2.psu.edu                2   0    66       0.000    2000.000  4000ms&lt;br /&gt;
       FS3.ECE.CMU.EDU             2   0    64       0.000    2000.000  4000ms&lt;br /&gt;
       chronyc&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    It is probably best to let chrony do its work. However, if you want to&lt;br /&gt;
    set both the hardware and software clock, the following will work:&lt;br /&gt;
&lt;br /&gt;
      Sets the hardware clock&lt;br /&gt;
        # hwclock --set --date=&amp;quot;12/10/04 10:18:05&amp;quot;&lt;br /&gt;
      Sync the hardware clock to software&lt;br /&gt;
        # hwclock --hctosys&lt;br /&gt;
&lt;br /&gt;
    Normally the system keep accurate time with the software clock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 104:&lt;br /&gt;
&lt;br /&gt;
    NFS mount&lt;br /&gt;
&lt;br /&gt;
     SERVER (192.168.1.182)&lt;br /&gt;
&lt;br /&gt;
       Make sure nfs is running on the server&lt;br /&gt;
 &lt;br /&gt;
           $ /etc/init.d/nfs restart&lt;br /&gt;
&lt;br /&gt;
       At the server the contents of /etc/exports for&lt;br /&gt;
       allowing 2 computers (192.168.1.171 and 192.168.1.71)&lt;br /&gt;
       to access the home directory of this server. Note that&lt;br /&gt;
       read write (rw) access is allowed.&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/exports&lt;br /&gt;
         /home   192.168.1.171(rw)&lt;br /&gt;
         /home   192.168.1.71(rw)&lt;br /&gt;
&lt;br /&gt;
       Or, if you have a lot of clients on 192.168.1.* then consider&lt;br /&gt;
       the following:&lt;br /&gt;
&lt;br /&gt;
          /home 192.168.1.0/255.255.252.0(rw)&lt;br /&gt;
&lt;br /&gt;
       Next, still at the server, run the exportfs command&lt;br /&gt;
&lt;br /&gt;
          $ exportfs -rv&lt;br /&gt;
&lt;br /&gt;
       IPTABLES (lokkit). If you're using fedora with default lokkit firewall&lt;br /&gt;
                then you can put the following under &amp;quot;Other ports&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                  Other ports nfs:tcp nfs:udp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       If the above does not work or you are not using lokkit&lt;br /&gt;
        IPTABLES (values in /etc/sysconfig/iptables on SERVER )&lt;br /&gt;
&lt;br /&gt;
        # NFS Need to accept fragmented packets and may not have header&lt;br /&gt;
        #             so you will not know where they are coming from&lt;br /&gt;
        -A INPUT -f -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -m tcp -s 192.168.1.171 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -s 192.168.1.171 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -m udp -s 192.168.1.171 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -s 192.168.1.171 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        &lt;br /&gt;
        -A INPUT -f -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -m tcp -s 192.168.1.71 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -s 192.168.1.71 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -m udp -s 192.168.1.71 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -s 192.168.1.71 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        (Reference: http://nfs.sourceforge.net/nfs-howto/server.html)&lt;br /&gt;
                  and&lt;br /&gt;
        (Reference: http://nfs.sourceforge.net/nfs-howto/security.html)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     CLIENT1 (192.168.1.171)&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /home2&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/fstab&lt;br /&gt;
         192.168.1.182:/home          /home2     nfs     rw 0 0&lt;br /&gt;
&lt;br /&gt;
          $ mount -a -t nfs&lt;br /&gt;
&lt;br /&gt;
        Or to do a one time mounting by hand&lt;br /&gt;
&lt;br /&gt;
          $ mount -t nfs 192.168.1.182:/home  /home2&lt;br /&gt;
&lt;br /&gt;
        Now /home2 on the client will be /home on the server&lt;br /&gt;
&lt;br /&gt;
        Reference:&lt;br /&gt;
          http://nfs.sourceforge.net/nfs-howto/index.html&lt;br /&gt;
&lt;br /&gt;
     MONITOR NFS:&lt;br /&gt;
&lt;br /&gt;
        To monitor the client:&lt;br /&gt;
&lt;br /&gt;
          $ nfsstat -c&lt;br /&gt;
&lt;br /&gt;
           Also note you can &amp;quot;cat /proc/net/rpc/nfs&amp;quot; as well.&lt;br /&gt;
&lt;br /&gt;
       To monitor the server (note the -s instead of the -c).&lt;br /&gt;
&lt;br /&gt;
         $ nfsstat -s&lt;br /&gt;
&lt;br /&gt;
           Also note you can &amp;quot;cat /proc/net/rpc/nfsd&amp;quot; as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       The following &amp;quot;cat&amp;quot; command is done on the NFS server, and shows which&lt;br /&gt;
       clients are mounting. This does not go with examples above. By the way,&lt;br /&gt;
       &amp;quot;root_squash&amp;quot; is the default, and means that root access on the clients is&lt;br /&gt;
       denied. So, how does the client root get access to these filesystems? You have&lt;br /&gt;
       to &amp;quot;su - &amp;lt;someuser&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
              $ cat /proc/fs/nfs/exports&lt;br /&gt;
              # Version 1.1&lt;br /&gt;
              # Path Client(Flags) # IPs&lt;br /&gt;
              /home   192.168.1.102(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   squeezel.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   192.168.1.106(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   livingroom.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   10.8.0.1(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   closet.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
&lt;br /&gt;
     (Reference: http://www.vanemery.com/Linux/NFSv4/NFSv4-no-rpcsec.html#automount )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 105:&lt;br /&gt;
&lt;br /&gt;
      Ports used for Microsoft products&lt;br /&gt;
               http://www.microsoft.com/canada/smallbiz/sgc/articles/ref_net_ports_ms_prod.mspx?pf=true&lt;br /&gt;
          Firewalling?&lt;br /&gt;
               http://www.microsoft.com/technet/prodtechnol/windowsserver2003/library/ServerHelp/428c1bbf-2ceb-4f76-a1ef-0219982eca10.mspx&lt;br /&gt;
&lt;br /&gt;
      To find out common port mappings, take a look at &amp;quot;/etc/services&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 106:&lt;br /&gt;
&lt;br /&gt;
      Man pages: If man pages are formatting incorrectly with PuTTY, try editing&lt;br /&gt;
      the &amp;quot;/etc/man.config&amp;quot; file with the following changes:&lt;br /&gt;
&lt;br /&gt;
           NROFF /usr/bin/groff -Tlatin1 -mandoc&lt;br /&gt;
           NEQN /usr/bin/geqn -Tlatin1&lt;br /&gt;
&lt;br /&gt;
         (Reference TIP 7 for using man)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 107:&lt;br /&gt;
&lt;br /&gt;
      Valgrind: check for memory leaks in your programs. (http://valgrind.org/)&lt;br /&gt;
&lt;br /&gt;
       This is how you can run it on the program &amp;quot;a.out&amp;quot; for valgrind version 2.2.0&lt;br /&gt;
&lt;br /&gt;
         $ valgrind --logfile=valgrind.output   --tool=memcheck ./a.out&lt;br /&gt;
&lt;br /&gt;
       This is how you write the logfile &amp;quot;--log-file&amp;quot; for valgrind-3.0.1&lt;br /&gt;
&lt;br /&gt;
         $ valgrind  --log-file=valgrind --leak-check=yes --tool=memcheck ./a.out&lt;br /&gt;
&lt;br /&gt;
       With C++ programs with gcc 3.4 and later that use STL, export GLIBCXX_FORCE_NEW &lt;br /&gt;
       only when testing to disable memory caching. Remember to enable for production&lt;br /&gt;
       as this will have a performance penalty. Reference  http://valgrind.org/docs/FAQ/ &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 108:&lt;br /&gt;
&lt;br /&gt;
      Runlevel Configuring.&lt;br /&gt;
&lt;br /&gt;
       These two programs, run as root give you a ncurses GUI to what will&lt;br /&gt;
       run on your system on boot.&lt;br /&gt;
&lt;br /&gt;
            # ntsysv&lt;br /&gt;
&lt;br /&gt;
            # chkconfig&lt;br /&gt;
&lt;br /&gt;
       Note, you can also set these manually. For example, normally you will&lt;br /&gt;
       have files in &amp;quot;/etc/init.d/&amp;quot; that will take parameters like &amp;quot;start&amp;quot;,&amp;quot;stop&amp;quot;&lt;br /&gt;
       &amp;quot;restart&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       Take a look at &amp;quot;/etc/init.d/mysql&amp;quot; this file will start and stop the&lt;br /&gt;
       mysql daemon. So, how does know which run levels, and the order it gets&lt;br /&gt;
       loaded in the run level to other programs? By the K&amp;lt;number&amp;gt; and S&amp;lt;number&amp;gt;&lt;br /&gt;
       values.&lt;br /&gt;
&lt;br /&gt;
            $ ls /etc/rc3.d/*mysql&lt;br /&gt;
&lt;br /&gt;
                /etc/rc3.d/K85mysql&lt;br /&gt;
                /etc/rc3.d/S85mysql&lt;br /&gt;
&lt;br /&gt;
       So here on my system the start value is 85. Looking in /etc/rc3.d, which is&lt;br /&gt;
       run level 3, any program with a lower number S84something will get loaded&lt;br /&gt;
       before mysql.&lt;br /&gt;
&lt;br /&gt;
       I manually set the run level as follows for mysql.&lt;br /&gt;
&lt;br /&gt;
            # cd /etc/rc3.d&lt;br /&gt;
            # ln -s ../init.d/mysql S85mysql&lt;br /&gt;
            # ln -s ../init.d/mysql K85mysql&lt;br /&gt;
&lt;br /&gt;
            # cd /etc/rc5.d&lt;br /&gt;
            # ln -s ../init.d/mysql S85mysql&lt;br /&gt;
            # ln -s ../init.d/mysql K85mysql&lt;br /&gt;
&lt;br /&gt;
       Note that I could have chose other numbers as well. &amp;quot;ntsysv&amp;quot; gives&lt;br /&gt;
       you a graphical interface.&lt;br /&gt;
&lt;br /&gt;
       This is a way of doing this with &amp;quot;chkconfig&amp;quot; at the command prompt.&lt;br /&gt;
&lt;br /&gt;
            # chkconfig --list mysqld&lt;br /&gt;
            mysqld          0:off   1:off   2:off   3:on    4:off   5:on    6:off&lt;br /&gt;
&lt;br /&gt;
       Above you can see it's on. Here's how we would have turned this on with chkconfig.&lt;br /&gt;
&lt;br /&gt;
            # chkconfig --level 35 mysqld on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 109:&lt;br /&gt;
&lt;br /&gt;
       File Alteration Monitor - Gamin a FAM replacement&lt;br /&gt;
        http://www.gnome.org/~veillard/gamin/&lt;br /&gt;
        http://www.gnome.org/~veillard/gamin/sources/&lt;br /&gt;
       ******  EXAMPLE NOT COMPLETE *****&lt;br /&gt;
&lt;br /&gt;
       Working with fam  - file alteration monitor.  Mail uses this to signify&lt;br /&gt;
           a change in a file's status.&lt;br /&gt;
&lt;br /&gt;
        Below is the sample C program ftest.c which can be compiled as&lt;br /&gt;
        follows:&lt;br /&gt;
&lt;br /&gt;
              $ gcc -o ftest ftest.c  -lfam&lt;br /&gt;
&lt;br /&gt;
        You will need to work with this as root&lt;br /&gt;
&lt;br /&gt;
              #  ./ftest &amp;lt;somefile absolute path&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Reference:&lt;br /&gt;
            http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?db=man&amp;amp;fname=/usr/share/catman/p_man/cat3x/fam.z&lt;br /&gt;
            http://www.devchannel.org/devtoolschannel/04/05/13/2146252.shtml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 110:&lt;br /&gt;
&lt;br /&gt;
       glibc - this is the main library used by C, and the following&lt;br /&gt;
        link below gives you examples on everything from sockets,math,&lt;br /&gt;
        date and time functions, user environment, and much more.&lt;br /&gt;
&lt;br /&gt;
         http://www.gnu.org/software/libc/manual/html_mono/libc.html&lt;br /&gt;
&lt;br /&gt;
       How do you know which version of glibc you are running?&lt;br /&gt;
&lt;br /&gt;
          #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
          #include &amp;lt;gnu/libc-version.h&amp;gt;&lt;br /&gt;
          int main (void)&lt;br /&gt;
           {&lt;br /&gt;
             puts (gnu_get_libc_version ());&lt;br /&gt;
             return 0;&lt;br /&gt;
           }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 111:&lt;br /&gt;
&lt;br /&gt;
       nslookup and dig - query Internet name servers interactively.&lt;br /&gt;
&lt;br /&gt;
         $ nslookup&lt;br /&gt;
         &amp;gt;chirico.org&lt;br /&gt;
         Server:        68.80.0.6&lt;br /&gt;
         Address:       68.80.0.6#53&lt;br /&gt;
&lt;br /&gt;
         Name: chirico.org&lt;br /&gt;
         Address: 66.35.250.210&lt;br /&gt;
         &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      The nslookup command will query the dns server is &amp;quot;/etc/resolve.conf&amp;quot;&lt;br /&gt;
      However, you can force a certain dns with &amp;quot;- server&amp;quot;.  For example the&lt;br /&gt;
      command below goes to the server named dilbert&lt;br /&gt;
&lt;br /&gt;
         $ nslookup - dilbert&lt;br /&gt;
         &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      dig:&lt;br /&gt;
&lt;br /&gt;
      dig gives you more information. You should probably use dig instead&lt;br /&gt;
      of nslookup.&lt;br /&gt;
&lt;br /&gt;
      Below I am forcing the lookup from DNS 68.80.0.6 of the name chirico.org, and&lt;br /&gt;
      note that the query time is return too.&lt;br /&gt;
&lt;br /&gt;
         $ dig @68.80.0.6  +qr chirico.org&lt;br /&gt;
&lt;br /&gt;
         ; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.2.1 &amp;lt;&amp;lt;&amp;gt;&amp;gt; @68.80.0.6 +qr chirico.org&lt;br /&gt;
         ;; global options:  printcmd&lt;br /&gt;
         ;; Sending:&lt;br /&gt;
         ;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 55908&lt;br /&gt;
         ;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0&lt;br /&gt;
        &lt;br /&gt;
         ;; QUESTION SECTION:&lt;br /&gt;
         ;chirico.org.                   IN      A&lt;br /&gt;
        &lt;br /&gt;
         ;; Got answer:&lt;br /&gt;
         ;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 55908&lt;br /&gt;
         ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
        &lt;br /&gt;
         ;; QUESTION SECTION:&lt;br /&gt;
         ;chirico.org.                   IN      A&lt;br /&gt;
        &lt;br /&gt;
         ;; ANSWER SECTION:&lt;br /&gt;
         chirico.org.            5538    IN      A       66.35.250.210&lt;br /&gt;
        &lt;br /&gt;
         ;; AUTHORITY SECTION:&lt;br /&gt;
         chirico.org.            30599   IN      NS      ns78.worldnic.com.&lt;br /&gt;
         chirico.org.            30599   IN      NS      ns77.worldnic.com.&lt;br /&gt;
        &lt;br /&gt;
         ;; ADDITIONAL SECTION:&lt;br /&gt;
         ns78.worldnic.com.      16022   IN      A       216.168.225.218&lt;br /&gt;
         ns77.worldnic.com.      7       IN      A       216.168.228.41&lt;br /&gt;
        &lt;br /&gt;
         ;; Query time: 155 msec&lt;br /&gt;
         ;; SERVER: 68.80.0.6#53(68.80.0.6)&lt;br /&gt;
         ;; WHEN: Thu Dec 23 07:48:23 2004&lt;br /&gt;
         ;; MSG SIZE  rcvd: 127&lt;br /&gt;
&lt;br /&gt;
      So what if you wanted to know what name the IP address 66.35.250.210&lt;br /&gt;
      resolves to, when using dns 68.80.0.12.&lt;br /&gt;
&lt;br /&gt;
          $ dig @68.80.0.12 -x 66.35.250.210&lt;br /&gt;
          ...&lt;br /&gt;
          ;; ANSWER SECTION:&lt;br /&gt;
          210.250.35.66.in-addr.arpa. 3600 IN   CNAME   210.0/24.250.35.66.in-addr.arpa.&lt;br /&gt;
          210.0/24.250.35.66.in-addr.arpa. 3600 IN PTR  vhost.sourceforge.net.&lt;br /&gt;
&lt;br /&gt;
      Above you can see it resolved to &amp;quot;vhost.sourceforge.net&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      Reference ( http://www.tldp.org/HOWTO/DNS-HOWTO-5.html )&lt;br /&gt;
        Also see TIP 223.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 112:&lt;br /&gt;
&lt;br /&gt;
       Using GNU Autotools - so you can produce the familiar &amp;quot;./configure&amp;quot;  &amp;quot;make&amp;quot;  and &amp;quot;make install&amp;quot;&lt;br /&gt;
                             commands. There is also a &amp;quot;make dist&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                The program sqlite3api.cc and the rest of this code can be found at&lt;br /&gt;
                 http://prdownloads.sourceforge.net/cpearls/autotools.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         A &amp;quot;Makefile.am&amp;quot; is required:&lt;br /&gt;
&lt;br /&gt;
            bin_PROGRAMS = sprog&lt;br /&gt;
            sprog_SOURCES = sqlite3api.cc&lt;br /&gt;
            sprog_LDADD = @INCLUDES@ @SQLIBOBJS@&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         In addition, a &amp;quot;configure.in&amp;quot; file is required. Note, AC_CHECK_LIB will&lt;br /&gt;
         check the &amp;quot;libsqlite3.so&amp;quot; file for the &amp;quot;sqlite3_open&amp;quot; file. Note that&lt;br /&gt;
         &amp;quot;sqlite3&amp;quot;, is a shortcut for &amp;quot;libsqlite3&amp;quot; by convention. If this file&lt;br /&gt;
         is not found, AC_CHECK_FILE looks for &amp;quot;/usr/local/lib/libsqlite3.a&amp;quot;. If&lt;br /&gt;
         this is found, then, &amp;quot;-lsqlite3&amp;quot; is added to the LIBS environment variable.&lt;br /&gt;
         Also, &amp;quot;-I/usr/local/include&amp;quot; and &amp;quot;-L/usr/local/lib&amp;quot; will be added on the&lt;br /&gt;
         command line. This is common when some one does not have the library in&lt;br /&gt;
         the path.  (See TIP 49)&lt;br /&gt;
&lt;br /&gt;
            dnl Process this file with autoconf to produce a configure script.&lt;br /&gt;
            AC_INIT(sqlite3api.cc)&lt;br /&gt;
            AM_INIT_AUTOMAKE(sqliteprog, 1.0)&lt;br /&gt;
            AC_PROG_CXX&lt;br /&gt;
            CXXFLAGS='-Wall -W -O2 -s -pipe'&lt;br /&gt;
            AC_CHECK_LIB(sqlite3,sqlite3_open,[],found=no)&lt;br /&gt;
             if test &amp;quot;$found&amp;quot; = &amp;quot;no&amp;quot;; then&lt;br /&gt;
               AC_CHECK_FILE(/usr/local/lib/libsqlite3.a, found=yes)&lt;br /&gt;
               if test &amp;quot;$found&amp;quot; = &amp;quot;yes&amp;quot;; then&lt;br /&gt;
                 LIBS=&amp;quot;$LIBS -lsqlite3&amp;quot;&lt;br /&gt;
                 INCLUDES=&amp;quot;$INCLUDES -I/usr/local/include&amp;quot;&lt;br /&gt;
                 EXTRALIB='-L/usr/local/lib'&lt;br /&gt;
                else&lt;br /&gt;
                 echo &amp;quot;Are you SURE sqlite3 is installed?&amp;quot;&lt;br /&gt;
               fi&lt;br /&gt;
             fi&lt;br /&gt;
            SQLIBOBJS='-Wl,-R/usr/local/lib'&lt;br /&gt;
            AC_SUBST(INCLUDES)&lt;br /&gt;
            AC_SUBST(SQLIBOBJS)&lt;br /&gt;
            AC_SUBST(EXTRALIB)&lt;br /&gt;
            AC_OUTPUT(Makefile)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         To build the configure file, just run the following:&lt;br /&gt;
&lt;br /&gt;
             $ aclocal&lt;br /&gt;
             $ autoconf&lt;br /&gt;
             $ touch NEWS README AUTHORS ChangeLog&lt;br /&gt;
             $ automake --add-missing&lt;br /&gt;
&lt;br /&gt;
         Now if you want to make a tar.gz file &amp;quot;sqliteprog-1.0.tar.gz&amp;quot;, then&lt;br /&gt;
         all you have to run is the following:&lt;br /&gt;
&lt;br /&gt;
             $ make dist&lt;br /&gt;
&lt;br /&gt;
         Note: did you ever want to save all the output from a ./configure? Well, it&lt;br /&gt;
               is automatically saved in the &amp;quot;config.log&amp;quot; file. In fact, this file may&lt;br /&gt;
               contain a lot more than what you saw on the screen.&lt;br /&gt;
&lt;br /&gt;
               Also, you may need to rerun ./configure. But before you do, delete&lt;br /&gt;
               the &amp;quot;config.cache&amp;quot; file to get a clean build.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 113:&lt;br /&gt;
&lt;br /&gt;
       EMACS - common emacs commands.&lt;br /&gt;
&lt;br /&gt;
         M is the ESC&lt;br /&gt;
         C or c is the Ctl&lt;br /&gt;
&lt;br /&gt;
        Shell - when working in a shell. &amp;quot;M-x rename-uniquely&amp;quot; is good for split screen editing.&lt;br /&gt;
&lt;br /&gt;
          M-x rename-uniquely   Use this for multiple shells (renames buffer so it's not the same shell)&lt;br /&gt;
          C-c C-z               Send job in background (when working in a shell)&lt;br /&gt;
          C-c C-o               commit-kill-output (gets rid of a lot of shell output)&lt;br /&gt;
          C-c C-r               reposition at beginning of output&lt;br /&gt;
          C-c C-e               reposition at end of output&lt;br /&gt;
          M-x send-invisible    Hide passwords - use this before typing a password&lt;br /&gt;
&lt;br /&gt;
         Note: if the shell prompt does not show up correctly, then, you may want to creat a &amp;quot;.emacs_bash&amp;quot;&lt;br /&gt;
               file with the following contents:&lt;br /&gt;
&lt;br /&gt;
                          PS1=&amp;quot;emacs:\W \$ &amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Directories  (C-x d) give you a directory listing. You know all those annoying &amp;quot;~&amp;quot; and &amp;quot;#&amp;quot;&lt;br /&gt;
                     file that you get? You can easily delete these when in &amp;quot;dired&amp;quot; mode by hitting&lt;br /&gt;
                     &amp;quot;~&amp;quot;, then  &amp;quot;d&amp;quot; to flag it for delete. Then, hit &amp;quot;x&amp;quot; to and confirm deletion.&lt;br /&gt;
&lt;br /&gt;
                     These are other command that work on highlighted files in &amp;quot;dired&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
                          R   rename&lt;br /&gt;
                          v   view&lt;br /&gt;
                          Z   compress the file&lt;br /&gt;
                          +   create directory&lt;br /&gt;
&lt;br /&gt;
        Other common commands:&lt;br /&gt;
&lt;br /&gt;
          c-x l          list the line you are on, and how many lines in the document.&lt;br /&gt;
                         You will get something like: Page has 4881 lines (4440 + 442),&lt;br /&gt;
                         which means you are on the 4440 line.&lt;br /&gt;
&lt;br /&gt;
          c-x rm bookmark make&lt;br /&gt;
          c-x rb bookmark bounce&lt;br /&gt;
        &lt;br /&gt;
          c-x rb notes&lt;br /&gt;
          c-x rb emacs&lt;br /&gt;
        &lt;br /&gt;
          c-x / &amp;lt;r&amp;gt; (save position in register &amp;lt;r&amp;gt;)&lt;br /&gt;
          c-x j &amp;lt;r&amp;gt; (jump to position in register &amp;lt;r&amp;gt;)&lt;br /&gt;
          c-x r SPC 1 (mark current point in register 1)&lt;br /&gt;
          c-x r j 1 (jump to marked point in register 1)&lt;br /&gt;
          c-x r t &amp;lt;string&amp;gt;  (insert string into register)&lt;br /&gt;
        &lt;br /&gt;
          c-x r s 1 (save marked region in register 1)&lt;br /&gt;
          c-x r i 1 (insert marked region)&lt;br /&gt;
        &lt;br /&gt;
          c-x c-o (delete all blank lines, except one)&lt;br /&gt;
        &lt;br /&gt;
          c-x z (repeat the last command ... stop with an a)&lt;br /&gt;
          c-x zz (repeat the last command twice)&lt;br /&gt;
&lt;br /&gt;
          rectangle&lt;br /&gt;
          ---------&lt;br /&gt;
          C-SPC&lt;br /&gt;
          goto the next region&lt;br /&gt;
          C-x&lt;br /&gt;
          C-x&lt;br /&gt;
          then, C-x r r &amp;quot;name of register&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
          to insert the register&lt;br /&gt;
          C-x r i &amp;quot;name of register&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
          macros:&lt;br /&gt;
          -------&lt;br /&gt;
          c-x (    start macro&lt;br /&gt;
          c-x )    end macro&lt;br /&gt;
          c-x e    execute macro&lt;br /&gt;
        &lt;br /&gt;
          mail:&lt;br /&gt;
          -----&lt;br /&gt;
          c-x m   mail&lt;br /&gt;
          c-c c-s send&lt;br /&gt;
        &lt;br /&gt;
          C-x C-e&lt;br /&gt;
          (insert &amp;quot;\n\nExtra Line of text&amp;quot;)&lt;br /&gt;
        &lt;br /&gt;
          ;; chirico functions in .emacs&lt;br /&gt;
          ;; This creates an html template&lt;br /&gt;
          (defun my-html ()&lt;br /&gt;
          (interactive)&lt;br /&gt;
          (insert &amp;quot;&amp;lt;html&amp;gt;&lt;br /&gt;
          &amp;lt;head&amp;gt;&lt;br /&gt;
          &amp;lt;META HTTP-EQUIV=\&amp;quot;Pragma\&amp;quot; CONTENT=\&amp;quot;no-cache\&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;META HTTP-EQUIV=\&amp;quot;Expires\&amp;quot; CONTENT=\&amp;quot;-1\&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;/head&amp;gt;&lt;br /&gt;
          &amp;lt;body bgcolor=\&amp;quot;#ffffff\&amp;quot;&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
          &amp;lt;/body&amp;gt;&lt;br /&gt;
          &amp;lt;/html&amp;gt;&amp;quot;)&lt;br /&gt;
          )&lt;br /&gt;
&lt;br /&gt;
     Backspace issues when using &amp;quot;emacs -nw&amp;quot;? They putting the following in your &amp;quot;~/.emacs&amp;quot; file&lt;br /&gt;
&lt;br /&gt;
             (global-set-key &amp;quot;\C-d&amp;quot; 'backward-delete-char)&lt;br /&gt;
             (global-set-key &amp;quot;\C-h&amp;quot; 'backward-delete-char)&lt;br /&gt;
             (global-set-key (kbd &amp;quot;DEL&amp;quot;) 'delete-char)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 114:&lt;br /&gt;
&lt;br /&gt;
        ncftpget - an intelligent ftp client (http://www.ncftp.com/). Also&lt;br /&gt;
                   check your fedora or debian install. This package allows&lt;br /&gt;
                   you to easily download packages from ftp sites.&lt;br /&gt;
&lt;br /&gt;
          This is an example of connect to an ftp site, with a subdirectory, and&lt;br /&gt;
          downloading all in one command.&lt;br /&gt;
&lt;br /&gt;
           $ ncftpget ftp://ftp.gnu.org/pub/gnu/gcc/gcc-3.2.3/gcc-3.2.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
          Of if you want to get the fedora core 3 installs&lt;br /&gt;
&lt;br /&gt;
           $ ncftpget ftp://ftp.linux.ncsu.edu/pub/fedora/linux/core/3/i386/iso/FC3*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 115:&lt;br /&gt;
&lt;br /&gt;
        expr - evaluate expressions. You can use this on the command line&lt;br /&gt;
&lt;br /&gt;
           $ expr 6 + 4&lt;br /&gt;
           10&lt;br /&gt;
&lt;br /&gt;
         Note the spaces. Without spaces, you get the following:&lt;br /&gt;
&lt;br /&gt;
           $ expr 6+4&lt;br /&gt;
           6+4&lt;br /&gt;
&lt;br /&gt;
         If you're using &amp;quot;*&amp;quot;, you'll need a &amp;quot;\&amp;quot; before it&lt;br /&gt;
&lt;br /&gt;
           $ expr 10 \* 10&lt;br /&gt;
           100&lt;br /&gt;
&lt;br /&gt;
         This also works for variables&lt;br /&gt;
&lt;br /&gt;
           $ var1=34&lt;br /&gt;
           $ expr $var1 + 3&lt;br /&gt;
           37&lt;br /&gt;
&lt;br /&gt;
         or&lt;br /&gt;
&lt;br /&gt;
           $ var1=2&lt;br /&gt;
           $ var1=`expr $var1 \* 2`&lt;br /&gt;
           $ echo $var1&lt;br /&gt;
           4&lt;br /&gt;
&lt;br /&gt;
         see (TIP 25) you can get the cosine(.23)&lt;br /&gt;
&lt;br /&gt;
           $ var1=`echo &amp;quot;c(.23)&amp;quot;|bc -l`&lt;br /&gt;
           $ echo $var1&lt;br /&gt;
           .97366639500537483696&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         You can also do substrings:&lt;br /&gt;
&lt;br /&gt;
           $ expr substr &amp;quot;BigBear&amp;quot; 4 4&lt;br /&gt;
           Bear&lt;br /&gt;
&lt;br /&gt;
         And length of strings&lt;br /&gt;
&lt;br /&gt;
           $ mstr=&amp;quot;12345&amp;quot;&lt;br /&gt;
           $ expr length $mstr&lt;br /&gt;
           5&lt;br /&gt;
&lt;br /&gt;
         Regular expressions&lt;br /&gt;
&lt;br /&gt;
           $ expr &amp;quot;a3&amp;quot; : [a-z][1-9]&lt;br /&gt;
           2&lt;br /&gt;
&lt;br /&gt;
         Or you can get a bit fancy&lt;br /&gt;
&lt;br /&gt;
           $ myexpr=&amp;quot;[a-z][1-9]&amp;quot;&lt;br /&gt;
           $ echo $myexpr&lt;br /&gt;
           [a-z][1-9]&lt;br /&gt;
&lt;br /&gt;
           $ expr &amp;quot;a3&amp;quot; : $myexpr&lt;br /&gt;
           2&lt;br /&gt;
&lt;br /&gt;
         This may not be the best way to find out if it is Friday, but&lt;br /&gt;
         it seems to work. It's more of an exercise in xargs.&lt;br /&gt;
&lt;br /&gt;
           $ date&lt;br /&gt;
           Fri Dec 31 16:44:47 EST 2004&lt;br /&gt;
           $ date|xargs -i expr {} : &amp;quot;[Fri]&amp;quot;&lt;br /&gt;
           1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 116:&lt;br /&gt;
&lt;br /&gt;
        eval&lt;br /&gt;
&lt;br /&gt;
           $ mypipe=&amp;quot;|&amp;quot;&lt;br /&gt;
           $ eval ls $mypipe wc&lt;br /&gt;
           6       6     129&lt;br /&gt;
&lt;br /&gt;
        Did you catch that? The above statement is the same as&lt;br /&gt;
&lt;br /&gt;
           $ ls | wc&lt;br /&gt;
&lt;br /&gt;
        Where &amp;quot;|&amp;quot; is put into the variable $mypipe&lt;br /&gt;
&lt;br /&gt;
        (also see TIP 118)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 117:&lt;br /&gt;
&lt;br /&gt;
        lxr, glimpse, patchset - tools for reading the kernel source&lt;br /&gt;
&lt;br /&gt;
          This example puts some of the files in /home/src since my home&lt;br /&gt;
          partition is the largest. Plus, you do not want to over write&lt;br /&gt;
          the source in /usr/src/ If you want to put your files elsewhere&lt;br /&gt;
          just substitute /home/src for your desired directory.&lt;br /&gt;
&lt;br /&gt;
         patchset -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ export SRCDIR=/home/src&lt;br /&gt;
            $ cd $SRCDIR&lt;br /&gt;
            $ wget http://www.csn.ul.ie/~mel/projects/patchset/patchset-0.5.tar.gz&lt;br /&gt;
            $ export PATH=$PATH:$SRCDIR/patchset-0.5/bin&lt;br /&gt;
&lt;br /&gt;
          Now edit &amp;quot;/home/src/patchset-0.5/etc/patchset.conf&amp;quot; and set WWW_USER to&lt;br /&gt;
          whatever your website runs as&lt;br /&gt;
&lt;br /&gt;
                  export WWW_USER=nobody&lt;br /&gt;
&lt;br /&gt;
          Getting kernel source. The last step builds and asks a lot of questions. Enter&lt;br /&gt;
          yes to things that interest you, since this is what you will see in the source&lt;br /&gt;
          code. It is not going to build for booting. The &amp;quot;downlaod -p&amp;quot; is for downloading&lt;br /&gt;
          a patch.&lt;br /&gt;
&lt;br /&gt;
            $ download 2.6.10&lt;br /&gt;
            $ createset 2.6.10&lt;br /&gt;
            $ make-kernel -b 2.6.10&lt;br /&gt;
&lt;br /&gt;
        glimpse -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ mkdir -p /home/src/glimpse&lt;br /&gt;
            $ cd /home/src/glimpse&lt;br /&gt;
            $ wget http://webglimpse.net/trial/glimpse-latest.tar.gz&lt;br /&gt;
            $ tar -xzf glimpse-latest.tar.gz&lt;br /&gt;
            $ cd glimpse-4.18.0&lt;br /&gt;
            $ ./configure; make&lt;br /&gt;
            $ make install&lt;br /&gt;
&lt;br /&gt;
        lxr -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ make -p /home/src/lxr&lt;br /&gt;
            $ cd /home/src/lxr&lt;br /&gt;
            $ wget http://heanet.dl.sourceforge.net/sourceforge/lxr/lxr-0.3.1.tar.gz&lt;br /&gt;
            $ cd lxr-0.3&lt;br /&gt;
&lt;br /&gt;
          Edit &amp;quot;Makefile&amp;quot; and set PERLBIN to &amp;quot;/usr/bin/perl&amp;quot; or the where perl is&lt;br /&gt;
          on your system. Also set INSTALLPREFIX to &amp;quot;/var/www/lxr&amp;quot;.  Then, as root&lt;br /&gt;
          do the following:&lt;br /&gt;
&lt;br /&gt;
            $ make install&lt;br /&gt;
&lt;br /&gt;
         Apache changes&lt;br /&gt;
&lt;br /&gt;
          Next edit the apache httpd.conf. On my system it is&lt;br /&gt;
          &amp;quot;/usr/local/apache2/conf/httpd.conf&amp;quot;, but if you did a fedora install&lt;br /&gt;
          I think this file is located at &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             Alias  /lxr/ &amp;quot;/var/www/lxr/&amp;quot;&lt;br /&gt;
             &amp;lt;Directory &amp;quot;/var/www/lxr/&amp;quot;&amp;gt;&lt;br /&gt;
               Options ExecCGI Indexes Includes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride all&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
&lt;br /&gt;
              &amp;lt;Files ~ (search|source|ident|diff|find)&amp;gt;&lt;br /&gt;
                    SetHandler cgi-script&lt;br /&gt;
              &amp;lt;/Files&amp;gt;&lt;br /&gt;
             &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          lxr - continued &amp;quot;/var/www/lxr/http/lxr.conf&amp;quot; changes.  The following contains&lt;br /&gt;
                my lxr.conf with changes made to almost every variable. Make sure you use&lt;br /&gt;
                your website in place of 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
                 # Configuration file.&lt;br /&gt;
                &lt;br /&gt;
                 # Define typed variable &amp;quot;v&amp;quot;, read valueset from file.&lt;br /&gt;
                 variable: v, Version, [/var/www/lxr/source/versions], [/var/www/lxr/source/defversion]&lt;br /&gt;
                &lt;br /&gt;
                 # Define typed variable &amp;quot;a&amp;quot;.  First value is default.&lt;br /&gt;
                 variable: a, Architecture, (i386, alpha, m68k, mips, ppc, sparc, sparc64)&lt;br /&gt;
                &lt;br /&gt;
                 # Define the base url for the LXR files.&lt;br /&gt;
                 baseurl: http://192.168.1.71/lxr/http/&lt;br /&gt;
                &lt;br /&gt;
                 # These are the templates for the HTML heading, directory listing and&lt;br /&gt;
                 # footer, respectively.&lt;br /&gt;
                 htmlhead: /var/www/lxr/http/template-head&lt;br /&gt;
                 htmltail: /var/www/lxr/http/template-tail&lt;br /&gt;
                 htmldir:  /var/www/lxr/http/template-dir&lt;br /&gt;
                &lt;br /&gt;
                 # The source is here.&lt;br /&gt;
                 sourceroot: /var/www/lxr/source/$v/&lt;br /&gt;
                 srcrootname: Linux&lt;br /&gt;
                &lt;br /&gt;
                 # &amp;quot;#include &amp;lt;foo.h&amp;gt;&amp;quot; is mapped to this directory (in the LXR source&lt;br /&gt;
                 # tree)&lt;br /&gt;
                 incprefix: /include&lt;br /&gt;
                &lt;br /&gt;
                 # The database files go here.&lt;br /&gt;
                 dbdir: /var/www/lxr/source/$v/&lt;br /&gt;
                &lt;br /&gt;
                 # Glimpse can be found here.&lt;br /&gt;
                 glimpsebin: /usr/local/bin/glimpse&lt;br /&gt;
                &lt;br /&gt;
                 # The power of regexps.  This is pretty Linux-specific, but quite&lt;br /&gt;
                 # useful.  Tinker with it and see what it does.  (How's that for&lt;br /&gt;
                 # documentation?)&lt;br /&gt;
                 map: /include/asm[^\/]*/ /include/asm-$a/&lt;br /&gt;
                 map: /arch/[^\/]+/ /arch/$a/&lt;br /&gt;
&lt;br /&gt;
         Now you should be ready to run &amp;quot;make-lxr&amp;quot;. Make sure the path is setup to patchset,&lt;br /&gt;
         which is repeated here. The last step take awhile.&lt;br /&gt;
&lt;br /&gt;
            $ export SRCDIR=/home/src&lt;br /&gt;
            $ cd $SRCDIR&lt;br /&gt;
            $ export PATH=$PATH:$SRCDIR/patchset-0.5/bin&lt;br /&gt;
&lt;br /&gt;
            $  make-lxr 2.6.10&lt;br /&gt;
&lt;br /&gt;
         Now you need to index the source. Below the ./glimpse_* file will be put in&lt;br /&gt;
         root. Checkout the -H option if you do not want them here on a temporary&lt;br /&gt;
         bases of if you run out of room.&lt;br /&gt;
&lt;br /&gt;
            $ glimpseindex -o -t -w 5000 /var/www/lxr/source/2.6.10 &amp;gt;&amp;amp; .glimpse_out&lt;br /&gt;
&lt;br /&gt;
         Since the above put the files under /root/.glimpse_* they should be moved&lt;br /&gt;
&lt;br /&gt;
            $ mv /root/.glimps_* /var/www/lxr/source/2.6.10/.&lt;br /&gt;
            $ chown -R nobody.nobody ./.glimpse_*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 118:&lt;br /&gt;
&lt;br /&gt;
        exec - you can change standard output and input without starting a new&lt;br /&gt;
               process.&lt;br /&gt;
&lt;br /&gt;
          The exec redirect the output from ls and date to a file. Nothing&lt;br /&gt;
          is show on the terminal until &amp;quot;exec &amp;gt; /dev/tty&amp;quot; is performed&lt;br /&gt;
&lt;br /&gt;
            $ exec &amp;gt; mfile&lt;br /&gt;
            $ ls&lt;br /&gt;
            $ date&lt;br /&gt;
            $ exec &amp;gt; /dev/tty&lt;br /&gt;
&lt;br /&gt;
          This is an example of assigning file descriptor 3 to file &amp;quot;output3&amp;quot; for&lt;br /&gt;
          output, then, redirecting &amp;quot;ls&amp;quot; to this descriptor. Finally, file descriptor&lt;br /&gt;
          3 is used for input, and the contents are read into the cat command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
            $ exec 3&amp;gt;output3&lt;br /&gt;
            $ ls  &amp;gt;&amp;amp; 3&lt;br /&gt;
            $ exec 3&amp;lt;output3&lt;br /&gt;
            $ cat &amp;lt;&amp;amp;3&lt;br /&gt;
            ChangeLog&lt;br /&gt;
            CVS&lt;br /&gt;
            How_to_Linux_and_Open_Source.txt&lt;br /&gt;
            How_to_Linux_and_Open_Source.txt.~1.193.~&lt;br /&gt;
            mfile&lt;br /&gt;
            mfile2&lt;br /&gt;
            mfile3&lt;br /&gt;
            mftp&lt;br /&gt;
            output3&lt;br /&gt;
&lt;br /&gt;
        Could you redirect the output to 3 files and stderr?&lt;br /&gt;
&lt;br /&gt;
            $ exec 3&amp;gt;output3&lt;br /&gt;
            $ exec 4&amp;gt;output4&lt;br /&gt;
            $ exec 5&amp;gt;output5&lt;br /&gt;
&lt;br /&gt;
            $ ls &amp;gt;&amp;amp; 3 &amp;gt;&amp;amp; 4 &amp;gt;&amp;amp; 5 &amp;gt;&amp;amp; 2   // Nope, can't do this.&lt;br /&gt;
            output3  output4  output5&lt;br /&gt;
&lt;br /&gt;
         Instead, you should do the following:&lt;br /&gt;
&lt;br /&gt;
            $ ls | tee output3 | tee output4 |tee output5&lt;br /&gt;
&lt;br /&gt;
         Closing the &amp;quot;output&amp;quot; file descriptor&lt;br /&gt;
&lt;br /&gt;
            $ &amp;gt;&amp;amp;3-&lt;br /&gt;
&lt;br /&gt;
         Closing the &amp;quot;input&amp;quot; file descriptor&lt;br /&gt;
&lt;br /&gt;
            $ 3&amp;lt;&amp;amp;-&lt;br /&gt;
&lt;br /&gt;
         See what is still open on 0-10&lt;br /&gt;
&lt;br /&gt;
            $ lsof -a -p $$ -d 0-10&lt;br /&gt;
&lt;br /&gt;
         Recursion - the following counts to 5, then, quits.&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
            sleep 1&lt;br /&gt;
            declare -x n&lt;br /&gt;
            let n=${n:=0}+1&lt;br /&gt;
            [ $n -le 5 ] &amp;amp;&amp;amp; echo &amp;quot;$n&amp;quot; &amp;amp;&amp;amp;  exec $0&lt;br /&gt;
&lt;br /&gt;
         There are some real-life applications for this technique, as follows:&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
            declare -x N&lt;br /&gt;
            declare -x n&lt;br /&gt;
            N=${N:=$(od -vAn -N1 -tu4 &amp;lt; /dev/urandom)}&lt;br /&gt;
            let n=${n:=0}+1&lt;br /&gt;
            [ $(($n%2)) -eq 0 ] &amp;amp;&amp;amp; echo &amp;quot;She Loves Me!&amp;quot; || echo &amp;quot;She Loves Me NOT!&amp;quot;&lt;br /&gt;
            [ $n -lt $N ] &amp;amp;&amp;amp;  exec $0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 119:&lt;br /&gt;
&lt;br /&gt;
        runlevel - need to know the current runlevel?&lt;br /&gt;
&lt;br /&gt;
           $ who -r&lt;br /&gt;
           run-level 3  Dec 31 19:02                   last=S&lt;br /&gt;
&lt;br /&gt;
        Need to know the architecture?&lt;br /&gt;
&lt;br /&gt;
          $ arch&lt;br /&gt;
          i686&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 120:&lt;br /&gt;
&lt;br /&gt;
        at - executes commands at a specified time.&lt;br /&gt;
&lt;br /&gt;
         A few examples here. The 1970 program will run&lt;br /&gt;
         next Auguest 2 even though the year 1970 has long past.&lt;br /&gt;
&lt;br /&gt;
          $ at 6:30am Jan 12 &amp;lt; program&lt;br /&gt;
          $ at noon tomorrow &amp;lt; program&lt;br /&gt;
          $ at 1970 pm August 2 &amp;lt; program&lt;br /&gt;
&lt;br /&gt;
        This is an interactive way to use the command:&lt;br /&gt;
&lt;br /&gt;
          $ at now + 6 minutes&lt;br /&gt;
          warning: commands will be executed using (in order) a) $SHELL b) login shell c) /bin/sh&lt;br /&gt;
          at&amp;gt; ls&lt;br /&gt;
          at&amp;gt; date &amp;gt; /tmp/5min&lt;br /&gt;
          at&amp;gt; ^D&lt;br /&gt;
          job 3 at 2005-01-01 08:50&lt;br /&gt;
&lt;br /&gt;
        What jobs are in the queue?&lt;br /&gt;
&lt;br /&gt;
          $ atq&lt;br /&gt;
&lt;br /&gt;
        or&lt;br /&gt;
&lt;br /&gt;
          $ at -l&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 121:&lt;br /&gt;
&lt;br /&gt;
        Creating a Manpage&lt;br /&gt;
&lt;br /&gt;
         As root you can copy the following to /usr/local/man/man1/soup.1 which will&lt;br /&gt;
         give you a manpage for soup.&lt;br /&gt;
&lt;br /&gt;
              .\&amp;quot; Manpage for souptonuts.&lt;br /&gt;
              .\&amp;quot; Contact mchirico@users.sourceforge.com to correct errors or omissions.&lt;br /&gt;
              .TH man 1 &amp;quot;04 January 2005&amp;quot; &amp;quot;1.0&amp;quot; &amp;quot;souptonuts man page&amp;quot;&lt;br /&gt;
              .SH NAME&lt;br /&gt;
              soup \- man page for souptonuts&lt;br /&gt;
              .SH SYNOPSIS&lt;br /&gt;
              soup&lt;br /&gt;
              .SH DESCRIPTION&lt;br /&gt;
              souptonuts is a collection of linux and open&lt;br /&gt;
              source tips.&lt;br /&gt;
              off for golf.&lt;br /&gt;
              .SH OPTIONS&lt;br /&gt;
              The souptonuts does not take any options.&lt;br /&gt;
              .SH SEE ALSO&lt;br /&gt;
              doughnut(1), golf(8)&lt;br /&gt;
              .SH BUGS&lt;br /&gt;
              No known bugs at this time.&lt;br /&gt;
              .SH AUTHOR&lt;br /&gt;
              Mike Chirico (mchirico@comcast.net mchirico@users.sourceforge.net)&lt;br /&gt;
&lt;br /&gt;
         So, to view this man page&lt;br /&gt;
&lt;br /&gt;
            $ man soup&lt;br /&gt;
&lt;br /&gt;
         It's also possible to compress&lt;br /&gt;
&lt;br /&gt;
            $ gzip /usr/local/man/man1/soup.1&lt;br /&gt;
&lt;br /&gt;
         For plenty of examples look at the other man pages. Also the following&lt;br /&gt;
         is helpful. The last one is a tutorial &amp;quot;man 7 mdoc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            $ man manpath&lt;br /&gt;
            $ man groff&lt;br /&gt;
            $ man 7 mdoc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 122:&lt;br /&gt;
&lt;br /&gt;
        dmesg - print out boot messages, or what is in the kernel ring buffer.&lt;br /&gt;
&lt;br /&gt;
          If you missed the messages on boot-up, you can use dmesg to print them.&lt;br /&gt;
&lt;br /&gt;
            $ dmesg &amp;gt; boot.msg&lt;br /&gt;
&lt;br /&gt;
          Or to print, then, clear the ring&lt;br /&gt;
&lt;br /&gt;
            # dmesg -c &amp;gt; boot.msg&lt;br /&gt;
&lt;br /&gt;
          (also see TIP 20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 123:&lt;br /&gt;
&lt;br /&gt;
        gnus - emacs email nntp news reader (comcast as example with NO TLS or SSL)&lt;br /&gt;
&lt;br /&gt;
          First check that you can connect to the news group:&lt;br /&gt;
&lt;br /&gt;
                 $ telnet newsgroups.comcast.net 119&lt;br /&gt;
                 Trying 216.196.97.136...&lt;br /&gt;
                 Connected to newsgroups.comcast.net.&lt;br /&gt;
                 Escape character is '^]'.&lt;br /&gt;
                 200 News.GigaNews.Com&lt;br /&gt;
&lt;br /&gt;
          If you want to check for TLS or SSL see (TIP 54).&lt;br /&gt;
&lt;br /&gt;
          Here is a very simple configuration example without encryption. It&lt;br /&gt;
          appears that comcast does not support ssl or TLS.&lt;br /&gt;
&lt;br /&gt;
          In the &amp;quot;~/.emacs&amp;quot; file you would add the following to get comcast&lt;br /&gt;
          news groups&lt;br /&gt;
&lt;br /&gt;
             (setq gnus-select-method '(nntp &amp;quot;newsgroups.comcast.net&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
          Then, create an &amp;quot;~/.authinfo&amp;quot; file with the following settings using&lt;br /&gt;
          you own username and password.&lt;br /&gt;
&lt;br /&gt;
             machine newsgroups.comcast.net login borkey@comcast.net  password borkeypass0rd&lt;br /&gt;
&lt;br /&gt;
          Next create a &amp;quot;~/.newsrc&amp;quot; with your groups&lt;br /&gt;
&lt;br /&gt;
             news.announce.newusers:&lt;br /&gt;
             comp.lang.c++.moderated! 1-500&lt;br /&gt;
             comp.unix.programmer! 1-500&lt;br /&gt;
             comp.unix.shell! 1-500&lt;br /&gt;
             gnu.emacs.gnus! 1-500&lt;br /&gt;
&lt;br /&gt;
          Finally, create a &amp;quot;~/.gnus&amp;quot; with the following email settings for you&lt;br /&gt;
&lt;br /&gt;
             (setq user-mail-address &amp;quot;mchirico@comcast.net&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
             (defun my-message-mode-setup ()&lt;br /&gt;
               (setq fill-column 72)&lt;br /&gt;
               (turn-on-auto-fill))&lt;br /&gt;
               (add-hook 'message-mode-hook 'my-message-mode-setup)&lt;br /&gt;
&lt;br /&gt;
          To get into gnus&lt;br /&gt;
&lt;br /&gt;
              E-x gnus&lt;br /&gt;
&lt;br /&gt;
          The following are common gnus commands&lt;br /&gt;
&lt;br /&gt;
                RET  view the article under the cursor&lt;br /&gt;
&lt;br /&gt;
                A A (shift-a, shift a): List all newsgroups known&lt;br /&gt;
                                        to the server.&lt;br /&gt;
&lt;br /&gt;
                l (lower-case L)      : List only  subscribed groups&lt;br /&gt;
                                        with unread articles.&lt;br /&gt;
&lt;br /&gt;
                L                     : List all newsgroups in .newsrc file.&lt;br /&gt;
&lt;br /&gt;
                g                     : See if new articles have arrived.&lt;br /&gt;
&lt;br /&gt;
            Some commands for reading&lt;br /&gt;
&lt;br /&gt;
                n  next unread article&lt;br /&gt;
&lt;br /&gt;
                p  previous article&lt;br /&gt;
&lt;br /&gt;
                SPC  scroll down  moves to next unread&lt;br /&gt;
                     when at the bottom of the article&lt;br /&gt;
&lt;br /&gt;
                del  scroll up&lt;br /&gt;
&lt;br /&gt;
                F  follow-up to group on the article you are&lt;br /&gt;
                   reading now.&lt;br /&gt;
&lt;br /&gt;
                f  follow-up to group without citing the article&lt;br /&gt;
&lt;br /&gt;
                R  reply by mail and cite the article&lt;br /&gt;
&lt;br /&gt;
                r  reply by mail without citing the article&lt;br /&gt;
&lt;br /&gt;
                m  new mail&lt;br /&gt;
&lt;br /&gt;
                a  new posting&lt;br /&gt;
&lt;br /&gt;
                c  Catchup&lt;br /&gt;
&lt;br /&gt;
                C-u / t  Show only young headers&lt;br /&gt;
                         / t without C-u limits the summary&lt;br /&gt;
                         to old headers&lt;br /&gt;
&lt;br /&gt;
                T T  toggle threading&lt;br /&gt;
&lt;br /&gt;
                C-u g  Display raw article&lt;br /&gt;
                       hit g to return to normal view&lt;br /&gt;
&lt;br /&gt;
                t  Show all headers  it's a toggle&lt;br /&gt;
&lt;br /&gt;
                W w  Wordwrap the current article&lt;br /&gt;
&lt;br /&gt;
                W r  Decode ROT13  a toggle&lt;br /&gt;
&lt;br /&gt;
                ^  fetch parent of article&lt;br /&gt;
&lt;br /&gt;
                L  create a scorefile-entry based&lt;br /&gt;
                   on the current article (low score)&lt;br /&gt;
                   ? gives you information what each char means&lt;br /&gt;
&lt;br /&gt;
                I  like L but high score&lt;br /&gt;
&lt;br /&gt;
          Commands to send email&lt;br /&gt;
&lt;br /&gt;
            C-c C-c  send message&lt;br /&gt;
&lt;br /&gt;
            C-c C-d  save message as draft&lt;br /&gt;
&lt;br /&gt;
            C-c C-k  kill message&lt;br /&gt;
&lt;br /&gt;
            C-c C-m f  attach file&lt;br /&gt;
&lt;br /&gt;
            M-q  reformat paragraph&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 124:&lt;br /&gt;
&lt;br /&gt;
        Sending Email from telnet&lt;br /&gt;
&lt;br /&gt;
           Note, if you are on the computer you can sometime use the local loopback.&lt;br /&gt;
           In fact, sometimes you can only use the local loop back 127.0.0.1 in&lt;br /&gt;
           place of &amp;quot;bozo.company.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            1     [mchirico@soup Notes]$ telnet bozo.company.com 25&lt;br /&gt;
            2     Trying 192.168.0.204...&lt;br /&gt;
            3     Connected to bozo.company.com.&lt;br /&gt;
            4     Escape character is '^]'.&lt;br /&gt;
            5     220 bozo.company.com ESMTP Postfix (Postfix-20010228-pl03) (Mandrake Linux)&lt;br /&gt;
            6     HELO fakedomain.com&lt;br /&gt;
            7     HELO fakedomain.com         // server echo&lt;br /&gt;
            8     250 bozo.company.com&lt;br /&gt;
            9     MAIL FROM: test@fakedomain.com&lt;br /&gt;
           10     MAIL FROM: test@fakedomain.com   // server echo&lt;br /&gt;
           11     250 Ok&lt;br /&gt;
           12     RCPT TO: mchirico@someother.com&lt;br /&gt;
           13     RCPT TO: mchirico@someother.com   // server echo&lt;br /&gt;
           14     250 Ok&lt;br /&gt;
           15     DATA&lt;br /&gt;
           16     DATA    // echo&lt;br /&gt;
           17     354 Enter mail, end with &amp;quot;.&amp;quot; on a line by itself&lt;br /&gt;
           18     This is a test message&lt;br /&gt;
           19     This is a test message&lt;br /&gt;
           20     to send&lt;br /&gt;
           21     to send&lt;br /&gt;
           22     .&lt;br /&gt;
           23     250 2.0.0 j0B0uH3L018469 Message accepted for delivery&lt;br /&gt;
&lt;br /&gt;
          Above on line 6 you can type in any domain name. Line 7 is an echo. All&lt;br /&gt;
          echos are listed in the comment field.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 125:&lt;br /&gt;
&lt;br /&gt;
          IP forwarding, IP Masquerade&lt;br /&gt;
&lt;br /&gt;
             # echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
             # ipchains -F forward&lt;br /&gt;
             # ipchains -P forward DENY&lt;br /&gt;
             # ipchains -A forward -s 192.168.0.0/24 -j MASQ&lt;br /&gt;
             # ipchains -A forward -i eth1 -j MASQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          This assumes that your internal network is 192.168.0.0 on eth1, and the&lt;br /&gt;
          internet is connected to eth0.&lt;br /&gt;
&lt;br /&gt;
          (Also See TIP 182)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 126:&lt;br /&gt;
&lt;br /&gt;
         Setting KDE as the default desktop manager&lt;br /&gt;
&lt;br /&gt;
               Edit &amp;quot;/etc/sysconfig/desktop&amp;quot; to include the two lines:&lt;br /&gt;
&lt;br /&gt;
                 DESKTOP=&amp;quot;KDE&amp;quot;&lt;br /&gt;
                 DISPLAYMANAGER=&amp;quot;KDE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 127:&lt;br /&gt;
&lt;br /&gt;
        Have a file and you do not know whay type it is (tar, gz, ASCII, binary) ?&lt;br /&gt;
        Use the file command.  Below it is used on the file &amp;quot;mftp&amp;quot;&lt;br /&gt;
&lt;br /&gt;
               $ file mftp&lt;br /&gt;
               mftp: Bourne-Again shell script text executable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 128:&lt;br /&gt;
&lt;br /&gt;
        Software RAID: Two good references&lt;br /&gt;
&lt;br /&gt;
          http://www.tldp.org/HOWTO/Software-RAID-HOWTO-1.html&lt;br /&gt;
          http://lists.us.dell.com/pipermail/linux-poweredge/2003-July/014331.html&lt;br /&gt;
&lt;br /&gt;
        Note, you must setup grub for each RAID 1 device. Suppose you have&lt;br /&gt;
        2 SCSI drives (sda and sdb). By default grub is setup on sda; but, you&lt;br /&gt;
        need to enable it for sdb (/dev/hdb for ide) as follows:&lt;br /&gt;
&lt;br /&gt;
           grub&amp;gt;device (hd0) /dev/sdb&lt;br /&gt;
           grub&amp;gt;root (hd0,0)&lt;br /&gt;
           grub&amp;gt;setup (hd0)&lt;br /&gt;
&lt;br /&gt;
           Checking if &amp;quot;/boot/grub/stage1&amp;quot; exists... no&lt;br /&gt;
           Checking if &amp;quot;/grub/stage1&amp;quot; exists... yes&lt;br /&gt;
           Checking if &amp;quot;/grub/stage2&amp;quot; exists... yes&lt;br /&gt;
           Checking if &amp;quot;/grub/e2fs_stage1_5&amp;quot; exists.. yes&lt;br /&gt;
           Running &amp;quot;embed /grub/e2fs_stage1_5 (hd0)&amp;quot;... 16 sectors are embedded.&lt;br /&gt;
          succeeded&lt;br /&gt;
           Running &amp;quot;install /grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/grub/stage2 /grub/grub&lt;br /&gt;
         .conf&amp;quot;... succeeded.&lt;br /&gt;
         Done.&lt;br /&gt;
&lt;br /&gt;
          grub&amp;gt;&lt;br /&gt;
          grub&amp;gt;quit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Checking to see if everything is working:&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
        Checking the drives&lt;br /&gt;
&lt;br /&gt;
          $ sfdisk -d /dev/sdb&lt;br /&gt;
          $ sfdisk -d /dev/sda&lt;br /&gt;
&lt;br /&gt;
          $ fdisk -l /dev/sda  &amp;quot;This will give general information&amp;quot;&lt;br /&gt;
          $ fdisk -l           &amp;quot;General information for all drives&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Adding raid (assume you want to add the first drive &amp;quot;sda1&amp;quot;, or if it is the second&lt;br /&gt;
                    drive then substitute &amp;quot;sda2&amp;quot; below )&lt;br /&gt;
&lt;br /&gt;
          $ raidhotadd /dev/md0 /dev/sda1&lt;br /&gt;
          $ raidhotadd /dev/md1 /dev/sda2&lt;br /&gt;
          $ raidhotadd /dev/md2 /dev/sda3&lt;br /&gt;
&lt;br /&gt;
        This is an example of an cat /proc/mdstat that is working. Note that&lt;br /&gt;
        there is a listing for both sda1[0] and sdb1[1]&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
                Personalities : [raid1]&lt;br /&gt;
                read_ahead 1024 sectors&lt;br /&gt;
                Event: 12&lt;br /&gt;
                md0 : active raid1 sda1[0] sdb1[1]&lt;br /&gt;
                      104320 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md1 : active raid1 sda2[0] sdb2[1]&lt;br /&gt;
                      1044160 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md2 : active raid1 sda3[0] sdb3[1]&lt;br /&gt;
                      34411136 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        Compare that to this where md2 is missing sdb3&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
                Personalities : [raid1]&lt;br /&gt;
                read_ahead 1024 sectors&lt;br /&gt;
                Event: 9&lt;br /&gt;
                md0 : active raid1 sda1[0] sdb1[1]&lt;br /&gt;
                      104320 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md1 : active raid1 sda2[0] sdb2[1]&lt;br /&gt;
                      1044160 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md2 : active raid1 sdb3[1]        &amp;lt;---- HERE&lt;br /&gt;
                      34411136 blocks [2/1] [_U]&lt;br /&gt;
&lt;br /&gt;
                unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        If you are rebuilding an array, you can watch it by doing the following:&lt;br /&gt;
&lt;br /&gt;
           $ watch -n1 cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
        Need to know the raid setup?&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/raidtab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 129:&lt;br /&gt;
&lt;br /&gt;
        Resetting Redhat Linux Passwords using GRUB&lt;br /&gt;
&lt;br /&gt;
           1. Press 'e'&lt;br /&gt;
           2. Press 'e' again&lt;br /&gt;
           3. Append 'single' to the kernel version listing&lt;br /&gt;
&lt;br /&gt;
          See&lt;br /&gt;
             http://linuxgazette.net/107/tomar.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 130:&lt;br /&gt;
&lt;br /&gt;
        mtr - matt's traceroute. This is an advanced traceroute that keeps&lt;br /&gt;
              [http://www.bitwizard.nl/mtr/]&lt;br /&gt;
                  $ mtr www.yahoo.com&lt;br /&gt;
&lt;br /&gt;
                                              Matt's traceroute  [v0.52]&lt;br /&gt;
                     third-fl-71.localdomain                            Thu Jan 20 11:05:57 2005&lt;br /&gt;
                     Keys:  D - Display mode    R - Restart statistics    Q - Quit&lt;br /&gt;
                                                            Packets               Pings&lt;br /&gt;
                     Hostname                            %Loss  Rcv  Snt  Last Best  Avg  Worst&lt;br /&gt;
                      1. 192.168.1.1                        0%    3    3     0    0    0      1&lt;br /&gt;
                      2. ???&lt;br /&gt;
                      3. fe-2-6-rr01.willogrove5.pa.pa01    0%    3    3     8    7    7      8&lt;br /&gt;
                      4. srp-8-1-ar01.willowgrove1.pa.pa    0%    2    2     8    8    8      8&lt;br /&gt;
                      5. pos7-3-cr01.torresdale.pa.core.    0%    2    2     8    8    8      8&lt;br /&gt;
                      6. 12.119.53.53                       0%    2    2    12   12   12     13&lt;br /&gt;
                      7. tbr1-p012401.phlpa.ip.att.net      0%    2    2    12   12   13     13&lt;br /&gt;
                      8. tbr1-cl8.n54ny.ip.att.net          0%    2    2    13   13   13     13&lt;br /&gt;
                      9. ggr2-p310.n54ny.ip.att.net         0%    2    2    12   12   13     14&lt;br /&gt;
                     10. so-1-0-0.gar4.NewYork1.Level3.n    0%    2    2    14   14   37     61&lt;br /&gt;
                     11. ae-1-54.bbr2.NewYork1.Level3.ne    0%    2    2    13   12   13     13&lt;br /&gt;
                     12. ge-0-3-0.bbr2.Washington1.Level    0%    2    2    19   19   19     19&lt;br /&gt;
                     13. ge-1-1-51.car1.Washington1.Leve    0%    2    2    18   18   19     20&lt;br /&gt;
                     14. 4.79.228.6                         0%    2    2    21   19   20     21&lt;br /&gt;
                     15. UNKNOWN-216-109-120-201.yahoo.c    0%    2    2    21   20   20     21&lt;br /&gt;
                     16. w2.rc.vip.dcn.yahoo.com            0%    2    2    23   21   22     23&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 131:&lt;br /&gt;
&lt;br /&gt;
        chfn - change finger information&lt;br /&gt;
&lt;br /&gt;
            $ chfn&lt;br /&gt;
&lt;br /&gt;
          Next you are asked for a password and user information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 132:&lt;br /&gt;
&lt;br /&gt;
        chsh - change login shell&lt;br /&gt;
&lt;br /&gt;
          First, you may want to get a listing of all the possible&lt;br /&gt;
          shells.&lt;br /&gt;
&lt;br /&gt;
             $ chsh -l&lt;br /&gt;
&lt;br /&gt;
               /bin/sh&lt;br /&gt;
               /bin/bash&lt;br /&gt;
               /sbin/nologin&lt;br /&gt;
               /bin/ash&lt;br /&gt;
               /bin/bsh&lt;br /&gt;
               /bin/ksh&lt;br /&gt;
               /usr/bin/ksh&lt;br /&gt;
               /usr/bin/pdksh&lt;br /&gt;
               /bin/tcsh&lt;br /&gt;
               /bin/csh&lt;br /&gt;
               /bin/zsh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 133:&lt;br /&gt;
&lt;br /&gt;
        bash - working with binary, hex and base 3.&lt;br /&gt;
&lt;br /&gt;
         For the variable must be declare as an integer. Then&lt;br /&gt;
         specify the  &amp;lt;base&amp;gt;#&amp;lt;value&amp;gt;. The example below is 22 in&lt;br /&gt;
         base 3.&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n&lt;br /&gt;
              $ n=3#22&lt;br /&gt;
              $ echo $n&lt;br /&gt;
                8&lt;br /&gt;
&lt;br /&gt;
           Base 16 (hex)&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n2&lt;br /&gt;
              $ n2=16#a&lt;br /&gt;
              $ echo $n2&lt;br /&gt;
                10&lt;br /&gt;
&lt;br /&gt;
           Base 8 (octal)&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n3&lt;br /&gt;
              $ n3=8#11&lt;br /&gt;
              $ echo $n3&lt;br /&gt;
                9   Note 8+1=9&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 134:&lt;br /&gt;
&lt;br /&gt;
        monitoring IP traffic. Try iptraf http://iptraf.seul.org/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 135:&lt;br /&gt;
&lt;br /&gt;
        enscript - convert text files to PostScript&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 136:&lt;br /&gt;
&lt;br /&gt;
        dd and tar - blocking factor. How to determine the blocking factor, block size&lt;br /&gt;
                   so that tar and dd can work together.&lt;br /&gt;
&lt;br /&gt;
        Step 1: Create a large file on local disk, in a directory &amp;quot;1&amp;quot; that will eventually&lt;br /&gt;
                be written to tape. This will be created with dd as follows:&lt;br /&gt;
&lt;br /&gt;
                $ mkdir 1&lt;br /&gt;
                $ dd if=/dev/zero of=disk-image count=40960&lt;br /&gt;
                  40960+0 records in&lt;br /&gt;
                  40960+0 records out&lt;br /&gt;
&lt;br /&gt;
                $ cd ..&lt;br /&gt;
&lt;br /&gt;
        Step 2: tar the directory and contents to tape. First rewind the tape. These examples&lt;br /&gt;
                use /dev/nst0 as the location of the tape. Make sure to substitute your values&lt;br /&gt;
                if needed.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ tar --label=&amp;quot;Test 1&amp;quot; --create --blocking-factor=128 --file=/dev/nst0 1&lt;br /&gt;
&lt;br /&gt;
        Step 3: Read data from the tape using a block size of 128k. If you get an I/O error, which&lt;br /&gt;
                could happend if you used a different blocking factor above, then, you may need&lt;br /&gt;
                to increase the bs to 256, or 512 etc. as needed.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=/dev/nst0 bs=128k of=testblocksz count=1&lt;br /&gt;
                 0+1 records in&lt;br /&gt;
                 0+1 records out&lt;br /&gt;
&lt;br /&gt;
                $ ls -l testblocksz&lt;br /&gt;
                 -rw-r--r--    1 root     root        65536 Feb  9 10:41 testblocksz&lt;br /&gt;
&lt;br /&gt;
                $ ls -lh testblocksz&lt;br /&gt;
                 -rw-r--r--    1 root     root          64k Feb  9 10:41 testblocksz&lt;br /&gt;
&lt;br /&gt;
               Note above that the size 65536 is equal to 64k. That &amp;quot;h&amp;quot; switch in &amp;quot;ls&amp;quot; is for&lt;br /&gt;
               human readable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 4: tar uses a multiplier of 512*blocking-factor to get block size. Again&lt;br /&gt;
&lt;br /&gt;
                 512 * blocking-factor = block size used in dd command.&lt;br /&gt;
&lt;br /&gt;
              Putting in the values, we see that&lt;br /&gt;
&lt;br /&gt;
                 512 * 128 = 65536&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 5: So what does this tell you? You can now use these numbers to &amp;quot;dd&amp;quot; files&lt;br /&gt;
              to tape. But, first tar will be used to create the file locally.&lt;br /&gt;
&lt;br /&gt;
                $ tar --label=&amp;quot;Test 1&amp;quot; --create --blocking-factor=128 --file=test.tar 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 6: Send this to tape with the dd command. Remember 64k is equal to 65536.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=test.tar bs=64k of=/dev/nst0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 7: Now test that it can be read with tar command using blocking-factor=128.&lt;br /&gt;
             Note the &amp;quot;t&amp;quot; command in tar is for tell. It will not write data.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ tar -tvf /dev/nst0 --blocking-factor=128&lt;br /&gt;
                 V--------- 0/0               0 2005-02-09 10:38:20 Test 1--Volume Header--&lt;br /&gt;
                 drwxr-xr-x root/root         0 2005-02-09 10:34:10 1/&lt;br /&gt;
                 -rw-r--r-- root/root  20971520 2005-02-09 10:34:11 1/disk-image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 8: Reading tape data with dd. Most of the time a high &amp;quot;ibs&amp;quot; input block size&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=/dev/nst0 of=outfromdd.tar ibs=64k&lt;br /&gt;
                 321+0 records in&lt;br /&gt;
                 41088+0 records out&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 9: Verify that outfromdd.tar can be read by tar with blocking-factor=128&lt;br /&gt;
&lt;br /&gt;
                $ tar -tvf outfromdd.tar --blocking-factor=128&lt;br /&gt;
                 V--------- 0/0               0 2005-02-09 10:38:20 Test 1--Volume Header--&lt;br /&gt;
                 drwxr-xr-x root/root         0 2005-02-09 10:34:10 1/&lt;br /&gt;
                 -rw-r--r-- root/root  20971520 2005-02-09 10:34:11 1/disk-image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       PULLING FILES:  The dd command can be used to pull files.&lt;br /&gt;
&lt;br /&gt;
              ssh target_address dd if=remotefile | dd of=localfile&lt;br /&gt;
&lt;br /&gt;
           Or, a specific example of getting a file from a computer called hamlet.&lt;br /&gt;
&lt;br /&gt;
              $ ssh root@hamlet  dd if=/home/cvs/test | dd of=/home/storage/test&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        GOING BACKWARD AND FORWARD ON TAPE:&lt;br /&gt;
&lt;br /&gt;
             Go to end of data&lt;br /&gt;
              $ mt -f /dev/nst0  eod&lt;br /&gt;
&lt;br /&gt;
             Previous record&lt;br /&gt;
              $ mt -f /dev/nst0  bsfm 1&lt;br /&gt;
&lt;br /&gt;
             Forward record&lt;br /&gt;
              $ mt -f /dev/nst0  fsf 1&lt;br /&gt;
&lt;br /&gt;
             Rewind&lt;br /&gt;
              $ mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
             Tell&lt;br /&gt;
              $ mt -f /dev/nst0 tell&lt;br /&gt;
&lt;br /&gt;
         (Reference TIP 151 - for how to get around firewalls)&lt;br /&gt;
&lt;br /&gt;
         Below is a script that I use to backup computers via ssh. The&lt;br /&gt;
         tape drive is on &amp;quot;nis&amp;quot; and the extra space is on &amp;quot;hamlet&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                #!/bin/bash&lt;br /&gt;
                # Program to backup server remotely&lt;br /&gt;
                # Assume remote server is nis, you are on squeezel&lt;br /&gt;
                #&lt;br /&gt;
                # Recover from tape&lt;br /&gt;
                #&lt;br /&gt;
                #   dd if=/dev/nst0 of=test.tar.gz bs=64k&lt;br /&gt;
                #&lt;br /&gt;
                filename=&amp;quot;support1.$(date &amp;quot;+%m%d%y%H%M&amp;quot;).tar.gz&amp;quot;&lt;br /&gt;
                DIRTOBACKUP=/var/www&lt;br /&gt;
                #tar cvzf - $DIRTOBACKUP | ssh  root@nis  '(mt -f /dev/nst0 rewind; dd of=/dev/nst0 bs=64k )'&lt;br /&gt;
                tar cvzf - $DIRTOBACKUP | ssh  support1@hamlet &amp;quot;dd of=/home/support1/backups/${filename} &amp;quot;&lt;br /&gt;
&lt;br /&gt;
         Another example program, below, pushes the last &amp;quot;.tar.gz&amp;quot; file to tape:&lt;br /&gt;
&lt;br /&gt;
                #!/bin/bash&lt;br /&gt;
                # Program to push files to tape&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                # Notes on recovering from tape&lt;br /&gt;
                #&lt;br /&gt;
                #   dd if=/dev/nst0 of=test.tar.gz ibs=64k&lt;br /&gt;
                #    or&lt;br /&gt;
                #  $ ssh root@tapeserver &amp;quot;mt -f /dev/nst0 rewind&amp;quot;&lt;br /&gt;
                #  $ ssh root@tapeserver &amp;quot;dd if=/dev/nst0 ibs=64k&amp;quot;|dd of=cvs1.tar.gz&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                # First rewind tape&lt;br /&gt;
                ssh root@tapeserver 'mt -f /dev/nst0 rewind'&lt;br /&gt;
                #&lt;br /&gt;
                # Grab only the last file&lt;br /&gt;
                file=$(find /home/cvs  -iname 'cvs*.tar.gz'|sort|tail -n 1)&lt;br /&gt;
                dd if=${file}|ssh root@tapeserver 'dd of=/dev/nst0 bs=64k'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 137:&lt;br /&gt;
&lt;br /&gt;
        Apache - redirecting pages. All changes are in httpd.conf&lt;br /&gt;
&lt;br /&gt;
               RedirectMatch (.*)\.gif$ http://www.anotherserver.com$1.jpg&lt;br /&gt;
&lt;br /&gt;
               Redirect /service http://foo2.bar.com/service&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 138:&lt;br /&gt;
&lt;br /&gt;
        samba mounts via ssh - mounting a samba share through an ssh tunnel, going&lt;br /&gt;
               through an intermediate computer, that accepts ssh. We'll call this&lt;br /&gt;
               intermediate computer middle [65.219.4.23], and we want to get to&lt;br /&gt;
               destination [192.168.0.81]. The user will be mchirico.&lt;br /&gt;
&lt;br /&gt;
          STEP 1:&lt;br /&gt;
&lt;br /&gt;
               $ mkdir -p /samba/share&lt;br /&gt;
&lt;br /&gt;
          STEP 2:&lt;br /&gt;
&lt;br /&gt;
            This has to be done as root, since we are using a lower port.&lt;br /&gt;
&lt;br /&gt;
               $ ssh -N -L 139:192.168.0.81:139 mchirico@65.219.4.23&lt;br /&gt;
&lt;br /&gt;
          STEP 3:&lt;br /&gt;
&lt;br /&gt;
              umount /samba/sales&lt;br /&gt;
              /bin/mount -t smbfs -o  username=donkey,workgroup=donkeydomain,&lt;br /&gt;
                      password=passw0rk1,port=139,dmask=770,fmask=660,&lt;br /&gt;
                      netbiosname=homecpu //localhost/share /samba/share&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 139:&lt;br /&gt;
&lt;br /&gt;
        Music on Fedora Core -- How to play music on http://magnatune.com with &amp;quot;xmms&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           The following command will show the sound driver:&lt;br /&gt;
&lt;br /&gt;
              $ lspci|grep -i audio&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          STEP 1:&lt;br /&gt;
&lt;br /&gt;
                Unmute amixer with the following command:&lt;br /&gt;
&lt;br /&gt;
              $ amixer set Master 100% unmute&lt;br /&gt;
              $ amixer set PCM 100%  unmute&lt;br /&gt;
&lt;br /&gt;
                Note you can also get a graphical interface with &amp;quot;alsamixer&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              $ alsamixer&lt;br /&gt;
&lt;br /&gt;
                 h,F1   -- for help&lt;br /&gt;
                 Esc    -- exit&lt;br /&gt;
                 Tab    -- move to selections&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          STEP 2:&lt;br /&gt;
&lt;br /&gt;
                Test a sound file &amp;quot;*.au&amp;quot; with aplay. To quickly find files on your system use&lt;br /&gt;
                the &amp;quot;locate *.au&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
                  $ aplay /usr/lib/python2.3/test/audiotest.au&lt;br /&gt;
&lt;br /&gt;
          STEP 3:&lt;br /&gt;
&lt;br /&gt;
                Install &amp;quot;xmms-mp3-1.2.10-9.2.1.fc3.rf.i386.rpm&amp;quot; which does not come with Fedora because&lt;br /&gt;
                of GPL license restrictions.  The latest version of this package can be found&lt;br /&gt;
                at the following url:&lt;br /&gt;
&lt;br /&gt;
                  http://rpmseek.com/rpm-pl/xmms-mp3.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                  $ rpm -ivh xmms-mp3-1.2.10-9.2.1.fc3.rf.i386.rpm&lt;br /&gt;
&lt;br /&gt;
          STEP 4:&lt;br /&gt;
&lt;br /&gt;
                Go to magnatun &amp;quot;http://magnatune.com/&amp;quot;, select genre and make sure xmms&lt;br /&gt;
                is the default player.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 140:&lt;br /&gt;
&lt;br /&gt;
        Routing -- getting access to a network 1 hop away. You are currently on the 192 network&lt;br /&gt;
                   and you want access to the 172.21.0.0 network that has a computer straddling&lt;br /&gt;
                   the two, with /proc/sys/net/ipv4/ip_forward set to 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               $ route add -net 172.21.0.0 netmask 255.255.255.0 gw 192.168.0.204&lt;br /&gt;
&lt;br /&gt;
         To undo:&lt;br /&gt;
&lt;br /&gt;
               $ route del -net 172.21.0.0 netmask 255.255.255.0 gw 192.168.0.204&lt;br /&gt;
&lt;br /&gt;
         Now you can ping 172.21.0.21.&lt;br /&gt;
&lt;br /&gt;
         Does not work?&lt;br /&gt;
&lt;br /&gt;
         Go on to 192.168.0.204 and execute the following commands:&lt;br /&gt;
&lt;br /&gt;
               $ echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
               $ cat /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
               1&lt;br /&gt;
&lt;br /&gt;
         To Look at the the gateway, execute the following command.&lt;br /&gt;
&lt;br /&gt;
               $ netstat -r&lt;br /&gt;
&lt;br /&gt;
         References: &lt;br /&gt;
&lt;br /&gt;
               http://lartc.org/lartc.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 141:&lt;br /&gt;
&lt;br /&gt;
        RAM disk -- creating a filesystem in RAM.&lt;br /&gt;
&lt;br /&gt;
               $ mkfs -t ext3 -q /dev/ram1 4096&lt;br /&gt;
               $ mkdir -p /fsram&lt;br /&gt;
               $ mount /dev/ram1 /fsram -o defaults,rw&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 142:&lt;br /&gt;
&lt;br /&gt;
        Create a Live Linux CDROM  using  BusyBox and OpenSSH.&lt;br /&gt;
&lt;br /&gt;
            These steps are rather long. A complete tutorial is given at&lt;br /&gt;
            the following link:&lt;br /&gt;
             http://prdownloads.sourceforge.net/souptonuts/instructions_boot_system.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 143:&lt;br /&gt;
&lt;br /&gt;
      SystemImager (http://www.systemimager.org/) SystemImager is software that automates Linux installs,&lt;br /&gt;
                       software distribution, and production deployment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 144:&lt;br /&gt;
&lt;br /&gt;
      Mounted a filesystem in rescue mode, yet, you cannot read and write?  Remount.&lt;br /&gt;
&lt;br /&gt;
             $ mount -o remount /&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 145:&lt;br /&gt;
&lt;br /&gt;
      Nmap commands to check for Microsoft VPN connection.&lt;br /&gt;
&lt;br /&gt;
         $ nmap -sO -p 47 vpn1.someserver.com&lt;br /&gt;
         $ nmap -sS -p T:1723 vpn1.someserver.com&lt;br /&gt;
&lt;br /&gt;
      By the way, with nmap you can specify multiple ports. Below&lt;br /&gt;
      is an example of multiple ports; but, use the commands above&lt;br /&gt;
      for Microsoft VPN services.&lt;br /&gt;
&lt;br /&gt;
         $ nmap -sS -p T:1723-3000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 146:&lt;br /&gt;
&lt;br /&gt;
      Perl and ssh - monitoring systems. The output from ssh can be parsed. Below is&lt;br /&gt;
      a simple procedure to just to read the ssh ouput into perl.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #&lt;br /&gt;
          $pid = open $readme, &amp;quot;ssh root\@hamlet df -lh|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
          while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
           print $_&lt;br /&gt;
          }&lt;br /&gt;
          close $readme&lt;br /&gt;
&lt;br /&gt;
      But note, you probably want to do something more complex. Below is a more robust&lt;br /&gt;
      example that bypassed all the fortune, heading junk that you may encounter when&lt;br /&gt;
      logging in.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #&lt;br /&gt;
          $pid = open $readme, &amp;quot;ssh root\@hamlet df -lh 2&amp;gt;/dev/null|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
          while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
           print $_&lt;br /&gt;
          }&lt;br /&gt;
          close $readme&lt;br /&gt;
&lt;br /&gt;
      NO! you CANNOT do bidirectional communication with the open statement. Note the &amp;quot;|&amp;quot; before&lt;br /&gt;
      and after below, which cannot be done.&lt;br /&gt;
&lt;br /&gt;
          # Cannot do this!&lt;br /&gt;
          $pid = open $readme, &amp;quot;|ssh root\@hamlet df -lh 2&amp;gt;/dev/null|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
      Below is a simple Perl example working with arrays:&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          @ArrayOfArray = (&lt;br /&gt;
                   [ &amp;quot;ant&amp;quot;, &amp;quot;bee&amp;quot; ],&lt;br /&gt;
                   [ &amp;quot;mouse&amp;quot;, &amp;quot;mole&amp;quot;, &amp;quot;rat&amp;quot; ],&lt;br /&gt;
                   [ &amp;quot;duck&amp;quot;, &amp;quot;goose&amp;quot;, &amp;quot;flamingo&amp;quot; ],&lt;br /&gt;
                   [  &amp;quot;rose&amp;quot;,&amp;quot;carnation&amp;quot;,&amp;quot;sunflower&amp;quot;],&lt;br /&gt;
                  );&lt;br /&gt;
&lt;br /&gt;
          for $i ( 0 .. $#ArrayOfArray ) {&lt;br /&gt;
              for $j ( 0 .. $#{$ArrayOfArray[$i]} ) {&lt;br /&gt;
                  print &amp;quot;Element $i $j is $ArrayOfArray[$i][$j]\n&amp;quot;;&lt;br /&gt;
              }&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          # Or this is another way to list elements&lt;br /&gt;
          foreach( @ArrayOfArray ) {&lt;br /&gt;
             foreach $i (0..$#$_) {&lt;br /&gt;
                print &amp;quot;$_-&amp;gt;[$i] &amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
             print &amp;quot;\n&amp;quot;;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Below is an example of working with Hash of Arrays:&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #  ./program &amp;lt; /etc/passwd&lt;br /&gt;
          while(&amp;lt;&amp;gt;){&lt;br /&gt;
              next unless s/^(.*?):\s*//;&lt;br /&gt;
              $HoA{$1} = [ split(/:/) ];&lt;br /&gt;
          }&lt;br /&gt;
          for $i (keys %HoA ) {&lt;br /&gt;
              print &amp;quot;$i: @{ $HoA{$i} } \n&amp;quot;;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
      Example of regular expression. This is my most used regular expression - I like&lt;br /&gt;
      this sample. See the &amp;quot;www.unix.org.ua&amp;quot; link at the end of this tip.&lt;br /&gt;
&lt;br /&gt;
          &amp;quot;hot cross buns&amp;quot; =~ /cross/;&lt;br /&gt;
          print &amp;quot;Matched: &amp;lt;$`&amp;gt; $&amp;amp; &amp;lt;$'&amp;gt;\n&amp;quot;;    # Matched: &amp;lt;hot &amp;gt; cross &amp;lt; buns&amp;gt;&lt;br /&gt;
          print &amp;quot;Left:    &amp;lt;$`&amp;gt;\n&amp;quot;;            # Left:    &amp;lt;hot &amp;gt;&lt;br /&gt;
          print &amp;quot;Match:   &amp;lt;$&amp;amp;&amp;gt;\n&amp;quot;;            # Match:   &amp;lt;cross&amp;gt;&lt;br /&gt;
          print &amp;quot;Right:   &amp;lt;$'&amp;gt;\n&amp;quot;;            # Right:   &amp;lt; buns&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      If you're looking for Perl information, type &amp;quot;man perl&amp;quot;, which will show you how&lt;br /&gt;
      to get even more information. Or better yet, take a look at the following&lt;br /&gt;
      link:&lt;br /&gt;
&lt;br /&gt;
          http://www.unix.org.ua/orelly/perl/prog3/ch09_01.htm&lt;br /&gt;
               also&lt;br /&gt;
          http://www.stonehenge.com/merlyn/UnixReview/&lt;br /&gt;
&lt;br /&gt;
      For a quick example on using Perl with SQLite, see the following links:&lt;br /&gt;
&lt;br /&gt;
          http://prdownloads.sourceforge.net/souptonuts/README_sqlite_tutorial.html?download&lt;br /&gt;
            or&lt;br /&gt;
          http://freshmeat.net/articles/view/1428/&lt;br /&gt;
            or&lt;br /&gt;
          http://www.perl.com/pub/a/1999/09/refererents.html&lt;br /&gt;
&lt;br /&gt;
      Standard input for files. This example will read from stdin, or open a file if given as&lt;br /&gt;
      an argument, and convert all &amp;quot;&amp;lt;&amp;quot; to &amp;quot;&amp;amp;lt;&amp;quot; and &amp;quot;&amp;gt;&amp;quot; to &amp;quot;&amp;amp;gt;&amp;quot;, which can be handy when&lt;br /&gt;
      converting text files to html files. Note the &amp;quot;while(&amp;lt;&amp;gt;)&amp;quot; will take multiple file names&lt;br /&gt;
      on the command line.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          while(&amp;lt;&amp;gt;) {&lt;br /&gt;
             s/&amp;amp;amp;/&amp;amp;amp;amp;/g;&lt;br /&gt;
             s/&amp;amp;lt;/&amp;amp;amp;lt;/g;&lt;br /&gt;
             s/&amp;amp;gt;/&amp;amp;amp;gt;/g;&lt;br /&gt;
             s/&amp;lt;/&amp;amp;lt;/g;&lt;br /&gt;
             s/&amp;gt;/&amp;amp;gt;/g;&lt;br /&gt;
             print;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
      Perl Debugger is very useful for testing commands and works like an interpreter, just&lt;br /&gt;
      like python. So to get into the Perl Debugger execute the command below, &amp;quot;q&amp;quot; to quit.&lt;br /&gt;
&lt;br /&gt;
          $ perl -de 0&lt;br /&gt;
&lt;br /&gt;
      Reference TIP 170&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 147:&lt;br /&gt;
&lt;br /&gt;
      Shutdown&lt;br /&gt;
&lt;br /&gt;
          # shutdown 8:00 -- Shutdown at 8:00&lt;br /&gt;
&lt;br /&gt;
          # shutdown +13  -- Shutdown after 13min&lt;br /&gt;
&lt;br /&gt;
          # shutdown -r now  -- Shutdown now and restart&lt;br /&gt;
&lt;br /&gt;
          # shutdown -k +2  -- &amp;quot;The system is going DOWN to maintenance mode in 2 minutes!&amp;quot;&lt;br /&gt;
                              The above is only a warning.&lt;br /&gt;
&lt;br /&gt;
          # shutdown -h now   -- Shutdown now and halt&lt;br /&gt;
&lt;br /&gt;
          # shutdown -c    -- Cancel shutdown&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 148:&lt;br /&gt;
&lt;br /&gt;
      ac -  print statistics about users connect time&lt;br /&gt;
&lt;br /&gt;
          $ ac -p    -- print hour usage by user (individual)&lt;br /&gt;
          $ ac -dy   -- print daily usage&lt;br /&gt;
&lt;br /&gt;
       Options can also be combined&lt;br /&gt;
&lt;br /&gt;
          $ ac -dyp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 149:&lt;br /&gt;
&lt;br /&gt;
      Smart Monitoring Tools:&lt;br /&gt;
      Disk failing? Or want to know the temperature of your hard-drive?&lt;br /&gt;
&lt;br /&gt;
         http://smartmontools.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
      For a good, quick tutorial, see the Linux Journal article&lt;br /&gt;
        http://www.linuxjournal.com/article/6983&lt;br /&gt;
&lt;br /&gt;
      Below are some common commands:&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -i /dev/hda&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -Hc /dev/hda&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -A /dev/hda&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 150:&lt;br /&gt;
&lt;br /&gt;
      Monitor dhcp trafic - dhcpdump and tcpdump.&lt;br /&gt;
&lt;br /&gt;
      Download dhcpdump&lt;br /&gt;
&lt;br /&gt;
         $ wget  http://voxel.dl.sourceforge.net/sourceforge/mavetju/dhcpdump-1.5.tar.gz&lt;br /&gt;
         $ ./configure&lt;br /&gt;
         $ make &amp;amp;&amp;amp; make install&lt;br /&gt;
&lt;br /&gt;
     Once it's installed, you can monitor all dhcp traffic as follows, if done with root.&lt;br /&gt;
&lt;br /&gt;
         $ tcpdump -lenx -i eth0 -s 1500 port bootps or port bootpc| dhcpdump&lt;br /&gt;
&lt;br /&gt;
     The above assumes you are using eth0 (ethernet port 0).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 151:&lt;br /&gt;
&lt;br /&gt;
      Breaking Firewalls with ssh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      A sample .ssh/config file (note this must have chmod 600 rights)&lt;br /&gt;
&lt;br /&gt;
           ## Server1 ##&lt;br /&gt;
           Host 130.21.19.227&lt;br /&gt;
               LocalForward 20000 192.168.0.66:80&lt;br /&gt;
               LocalForward 22000 192.168.0.66:22&lt;br /&gt;
&lt;br /&gt;
      With the above &amp;quot;~/.ssh/config&amp;quot; file, after sshing into 130.21.19.227 it&lt;br /&gt;
      is then possible to ssh into nearby computers directly.&lt;br /&gt;
&lt;br /&gt;
         $ ssh -l mchirico 130.21.19.227&lt;br /&gt;
         $ scp -P 22000 authorized_keys* mchirico@localhost:.&lt;br /&gt;
         $ ssh -l mchirico localhost -p 22000&lt;br /&gt;
&lt;br /&gt;
      For the complete article reference the following link:&lt;br /&gt;
        http://souptonuts.sourceforge.net/sshtips.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 152:&lt;br /&gt;
&lt;br /&gt;
      Renaming files - suppose you want to rename all the &amp;quot;.htm&amp;quot; files to &amp;quot;.html&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          $ rename .htm .html *.htm&lt;br /&gt;
&lt;br /&gt;
      Or, suppose you files file1, file2, file3 ...&lt;br /&gt;
&lt;br /&gt;
          $ touch file1 file2 file3 file4 file5 file6&lt;br /&gt;
          $ rename file file. file*&lt;br /&gt;
&lt;br /&gt;
      The above command will give you &amp;quot;file.1&amp;quot;, &amp;quot;file.2&amp;quot; ... &amp;quot;file.6&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 153:&lt;br /&gt;
&lt;br /&gt;
      Renaming files with Perl - this is taken from &amp;quot;Programming Perl 3rd Edition&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          # rename - change filenames&lt;br /&gt;
          $op = shift;&lt;br /&gt;
          for (@ARGV) {&lt;br /&gt;
              $was = $_;&lt;br /&gt;
              eval $op;&lt;br /&gt;
              die if $@;&lt;br /&gt;
              # next line calls built-in function, not the script&lt;br /&gt;
              rename($was,$_) unless $was eq $_;&lt;br /&gt;
           }&lt;br /&gt;
&lt;br /&gt;
      The above Perl program can be used as follows:&lt;br /&gt;
&lt;br /&gt;
           $ rename 's/\.orig$//'    *.orig&lt;br /&gt;
           $ rename 'y/A-Z/a-z/ unless /^Make/' *&lt;br /&gt;
&lt;br /&gt;
      Also reference:&lt;br /&gt;
           http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 154:&lt;br /&gt;
&lt;br /&gt;
      R project (http://www.r-project.org)&lt;br /&gt;
&lt;br /&gt;
      To start R, just type &amp;quot;R&amp;quot; at the command prompt and &amp;quot;q()&amp;quot; to quit. Below&lt;br /&gt;
      2 is raised to powers 0 through 6 and thrown into an array.&lt;br /&gt;
&lt;br /&gt;
           $ R&lt;br /&gt;
           &amp;gt; N &amp;lt;- 2^(0:6)&lt;br /&gt;
           &amp;gt; N&lt;br /&gt;
           [1]  1  2  4  8 16 32 64&lt;br /&gt;
           &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      There is a summary summary() command.&lt;br /&gt;
&lt;br /&gt;
           &amp;gt; summary(N)&lt;br /&gt;
           Min. 1st Qu.  Median    Mean 3rd Qu.    Max.&lt;br /&gt;
           1.00    3.00    8.00   18.14   24.00   64.00&lt;br /&gt;
&lt;br /&gt;
      Note that the array begins as 1 and not 0&lt;br /&gt;
&lt;br /&gt;
           &amp;gt; N[1:3]&lt;br /&gt;
           [1] 1 2 4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 155:&lt;br /&gt;
&lt;br /&gt;
      ls - listing files by size, with the biggest file listed last&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           $ ls --sort=size -lhr&lt;br /&gt;
&lt;br /&gt;
      The above command sorts files by size, listing the contents in&lt;br /&gt;
      &amp;quot;h&amp;quot; human readable format in reverse order.&lt;br /&gt;
&lt;br /&gt;
      Note the options:  --sort={none,time,size,extension}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 156:&lt;br /&gt;
&lt;br /&gt;
     Perl - program to clean up old versions of files&lt;br /&gt;
&lt;br /&gt;
       #!/usr/bin/perl&lt;br /&gt;
       #   Copyright (c) GPL 2005 Mike Chirico&lt;br /&gt;
       # This program deletes old files from several directories&lt;br /&gt;
       # and within each directory there must be x number of copies&lt;br /&gt;
       # each y number of bytes&lt;br /&gt;
       #&lt;br /&gt;
&lt;br /&gt;
       sub delete_old_ones {&lt;br /&gt;
           $directory_and_file=$_[0];&lt;br /&gt;
           $save_count=$_[1];&lt;br /&gt;
           $bytes_in_file=$_[2];&lt;br /&gt;
         # Don't change setting here of '-lt'&lt;br /&gt;
           $pid = open $readme, &amp;quot;ls -lt $directory_and_file|&amp;quot; or die &amp;quot;Could not execute\n&amp;quot;;&lt;br /&gt;
           while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
               my @fields = split;&lt;br /&gt;
              # Make sure we have $save_count good ones with data&lt;br /&gt;
               if ($fields[4] &amp;gt; $bytes_in_file &amp;amp;&amp;amp; $save_count &amp;gt; 0) {&lt;br /&gt;
                   $save_count--;&lt;br /&gt;
                   print &amp;quot;Kept files: $fields[4] $fields[8]\n&amp;quot;;&lt;br /&gt;
               }&lt;br /&gt;
              # delete the old ones&lt;br /&gt;
              if ($save_count &amp;lt;= 0 )&lt;br /&gt;
              {&lt;br /&gt;
                  print &amp;quot;Deleted files: $fields[4] $fields[8]\n&amp;quot;;&lt;br /&gt;
                  unlink $fields[8];&lt;br /&gt;
              }&lt;br /&gt;
           }&lt;br /&gt;
           close $readme;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       @AofA = (&lt;br /&gt;
          [ &amp;quot;/home/cvs/backups/*.gz&amp;quot;, &amp;quot;6&amp;quot;,196621 ],&lt;br /&gt;
          [ &amp;quot;/home/mail/backups/*.gz&amp;quot;,&amp;quot;5&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/snort/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/server1/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/actserver/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/server2/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
                );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       foreach( @AofA ) {&lt;br /&gt;
           &amp;amp;delete_old_ones($_-&amp;gt;[0],$_-&amp;gt;[1],$_-&amp;gt;[2]);&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
     Reference TIP 170 and the following link:&lt;br /&gt;
       http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 157:&lt;br /&gt;
&lt;br /&gt;
     Graphics and Visualization Software that runs on Linux&lt;br /&gt;
        http://www.tldp.org/HOWTO/Scientific-Computing-with-GNU-Linux/graphvis.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 158:&lt;br /&gt;
&lt;br /&gt;
     Keeping files in sync going both ways. Unlike rsync, this is not a one way mirror&lt;br /&gt;
     option.&lt;br /&gt;
&lt;br /&gt;
     You will need ocaml installed first.&lt;br /&gt;
&lt;br /&gt;
       $ wget http://caml.inria.fr/pub/distrib/ocaml-3.08/ocaml-3.08.3.tar.gz&lt;br /&gt;
       $ tar -xzf ocaml-3.08.3.tar.gz&lt;br /&gt;
       $ cd ocaml-3.08.3&lt;br /&gt;
&lt;br /&gt;
       $ ./configure&lt;br /&gt;
       $ make world&lt;br /&gt;
       $ make opt&lt;br /&gt;
       $ make install&lt;br /&gt;
&lt;br /&gt;
     Next, get unison and put it in a different directory.&lt;br /&gt;
     [http://www.cis.upenn.edu/~bcpierce/unison/]&lt;br /&gt;
&lt;br /&gt;
       $ wget http://www.cis.upenn.edu/~bcpierce/unison/download/stable/latest/unison-2.10.2.tar.gz&lt;br /&gt;
       $ tar -xzf unison-2.10.2.tar.gz&lt;br /&gt;
       $ cd unison-2.10.2&lt;br /&gt;
       $ make UISTYLE=text&lt;br /&gt;
       $ su&lt;br /&gt;
       # cp unison /usr/local/bin/.&lt;br /&gt;
&lt;br /&gt;
     Note, you have to copy the file manually.&lt;br /&gt;
&lt;br /&gt;
     See the following article [http://www.linuxjournal.com/article/7712]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 159:&lt;br /&gt;
&lt;br /&gt;
     Dump ext2/ext3 filesystem information with &amp;quot;dumpe2fs&amp;quot;. Perform the mount command&lt;br /&gt;
     and query away.&lt;br /&gt;
&lt;br /&gt;
       $ dumpe2fs /dev/sda1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 160:&lt;br /&gt;
&lt;br /&gt;
     sysreport - a script that generates an HTML report on the system configuration. It&lt;br /&gt;
     gathers information about the hardware and is somewhat redhat specific. The utility&lt;br /&gt;
     should be run as root.&lt;br /&gt;
&lt;br /&gt;
       $ /usr/sbin/sysreport&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 161:&lt;br /&gt;
&lt;br /&gt;
     Key Bindings Using bind.  You can bind, say, ctl-t to a command.&lt;br /&gt;
&lt;br /&gt;
     Add the following to you &amp;quot;~/.inputrc&amp;quot; file, just as it is typed below with quotes.&lt;br /&gt;
&lt;br /&gt;
           &amp;quot;\C-t&amp;quot;: ls -l&lt;br /&gt;
&lt;br /&gt;
     Next, run the command&lt;br /&gt;
&lt;br /&gt;
           $ bind -f .inputrc&lt;br /&gt;
&lt;br /&gt;
     Or, you can do everything on the command line; however, it won't be there the next time&lt;br /&gt;
     you log in. Below is the way to do everything on the command line.&lt;br /&gt;
&lt;br /&gt;
           $ bind -x '&amp;quot;\C-t&amp;quot;:ls -l'&lt;br /&gt;
&lt;br /&gt;
     To unbind use the &amp;quot;-r&amp;quot; option. Single quotes are not needed.&lt;br /&gt;
&lt;br /&gt;
           $ bind -r &amp;quot;\C-t&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Getting a list of all bindings can be done as follows, and not this can be redirected&lt;br /&gt;
     to the &amp;quot;.inputrc&amp;quot; file for further editing.&lt;br /&gt;
&lt;br /&gt;
           $ bind -p &amp;gt; .inputrc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 162:&lt;br /&gt;
&lt;br /&gt;
     awk - common awk commands.&lt;br /&gt;
&lt;br /&gt;
     Find device names &amp;quot;sd&amp;quot; or with major number 4 and device name &amp;quot;tty&amp;quot;. Print the&lt;br /&gt;
     record number NR, plus the major number and minor number.&lt;br /&gt;
&lt;br /&gt;
          $ awk '$2 == &amp;quot;sd&amp;quot;||$1 == 4 &amp;amp;&amp;amp; $2 == &amp;quot;tty&amp;quot; { print NR,$1,$2}' /proc/devices&lt;br /&gt;
&lt;br /&gt;
     Find device name equal to &amp;quot;sound&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ awk '/sound/{print NR,$1,$2}' /proc/devices&lt;br /&gt;
&lt;br /&gt;
     Print the 5th record, first field, in file test&lt;br /&gt;
&lt;br /&gt;
          $ awk 'NR==5{print $1}' test&lt;br /&gt;
&lt;br /&gt;
     Print a record, skip 4 records, print a record etc from file1&lt;br /&gt;
&lt;br /&gt;
          $ awk '(NR-1) % 4 == 0 {print $1}' file1&lt;br /&gt;
&lt;br /&gt;
     Print all records except the last one from file1&lt;br /&gt;
&lt;br /&gt;
          $ tac file1|awk 'NR &amp;gt; 1 {print $0}'|tac&lt;br /&gt;
&lt;br /&gt;
     Print A,B,C ..Z on each line, cycling back to A if greater than 26 lines&lt;br /&gt;
&lt;br /&gt;
          $ awk '{ print substr(&amp;quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&amp;quot;,(NR-1)%26+1,1),$0}' file1&lt;br /&gt;
&lt;br /&gt;
     Number of bytes in a directory.&lt;br /&gt;
&lt;br /&gt;
          $ ls -l|awk 'BEGIN{ c=0}{ c+=$5} END{ print c}'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 163:&lt;br /&gt;
&lt;br /&gt;
     Configuring Remote Logging.  If you have several servers on 192.168.1.0, you can setup remote logging&lt;br /&gt;
     as follows.&lt;br /&gt;
&lt;br /&gt;
     MAIN LOG SERVER (192.168.1.81):&lt;br /&gt;
&lt;br /&gt;
        Firewall - allow UDP port 514 on the main server that will receive the logs.&lt;br /&gt;
&lt;br /&gt;
          $ iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 514 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        Edit &amp;quot;/etc/sysconfig/syslog&amp;quot; and add the &amp;quot;-r&amp;quot; option to SYSLOGD_OPTIONS as shown below.&lt;br /&gt;
&lt;br /&gt;
          SYSLOGD_OPTIONS=&amp;quot;-r -m -0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Note, the &amp;quot;-r&amp;quot; is to allow remote logging and  &amp;quot;-m 0&amp;quot; specifies that that the syslog process should&lt;br /&gt;
        not write regular timestamps.  I prefer to only write timestamps for the clients.&lt;br /&gt;
&lt;br /&gt;
        Next, restart the logging process&lt;br /&gt;
&lt;br /&gt;
          $ service syslog restart&lt;br /&gt;
&lt;br /&gt;
     CLIENT LOG SERVER:&lt;br /&gt;
&lt;br /&gt;
        Edit &amp;quot;/etc/syslog.conf&amp;quot; and add the ip address of the log server, or put in the hostname.&lt;br /&gt;
&lt;br /&gt;
            *.* @192.168.1.81&lt;br /&gt;
&lt;br /&gt;
        Next, restart the logging process&lt;br /&gt;
&lt;br /&gt;
          $ service syslog restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 164:&lt;br /&gt;
&lt;br /&gt;
     kudzu - hardware on your system. To probe the hardware on your system without doing&lt;br /&gt;
             anything, issue the following command.&lt;br /&gt;
&lt;br /&gt;
          $ kudzu -p&lt;br /&gt;
&lt;br /&gt;
      But wait, a lot of this information is already recorded in the following file&lt;br /&gt;
&lt;br /&gt;
            /etc/sysconfig/hwconf&lt;br /&gt;
&lt;br /&gt;
      You can also use lspci to list all PCI devices.&lt;br /&gt;
&lt;br /&gt;
          $ lspci&lt;br /&gt;
&lt;br /&gt;
      Also, take a look at the script /etc/sbin/sysreport, since this script has a lot of&lt;br /&gt;
      info gathering commands. You can pick and choose what you want, or run the complete&lt;br /&gt;
      report.&lt;br /&gt;
&lt;br /&gt;
      If you just want information on the NIC&lt;br /&gt;
&lt;br /&gt;
          $ ip link show eth0&lt;br /&gt;
          2: eth0: &amp;lt;BROADCAST,MULTICAST,UP&amp;gt; mtu 1500 qdisc pfifo_fast qlen 1000&lt;br /&gt;
          link/ether 00:11:11:8a:be:3f brd ff:ff:ff:ff:ff:ff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 165:&lt;br /&gt;
&lt;br /&gt;
     cfengine - a very power agent for monitoring and administrating both a single computer&lt;br /&gt;
              and or multiple computers. [ http://www.cfengine.org/ ]&lt;br /&gt;
&lt;br /&gt;
     The following is a quick example on downloading and installing cfengine.&lt;br /&gt;
&lt;br /&gt;
          $ ncftpget ftp://ftp.iu.hio.no/pub/cfengine/cfengine-2.1.15.tar.gz&lt;br /&gt;
          $ md5sum cfengine-2.1.15.tar.gz&lt;br /&gt;
          f03de82709f84c3d6d916b6e557321f9  cfengine-2.1.15.tar.gz&lt;br /&gt;
&lt;br /&gt;
          $ tar -xzf cfengine-2.1.15.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You need to have a current version of BerkeleyDB (http://downloads.sleepycat.com/db-4.3.28.tar.gz).&lt;br /&gt;
     Note that BerkeleyDB has a funny install. You cd to the &amp;quot;build_unix&amp;quot; directory, then,&lt;br /&gt;
&lt;br /&gt;
          Installing BerkeleyDB if needed:&lt;br /&gt;
                 $ wget http://downloads.sleepycat.com/db-4.3.28.tar.gz&lt;br /&gt;
                 $ tar -xzf db-4.3.28.tar.gz&lt;br /&gt;
                 $ cd db-4.3.28/build_unix/&lt;br /&gt;
                 $ ../dist/configure&lt;br /&gt;
                 make&lt;br /&gt;
                 make install&lt;br /&gt;
&lt;br /&gt;
     You also need a current version of OpenSSL. For instructions on how to install OpenSSL see&lt;br /&gt;
     (http://souptonuts.sourceforge.net/postfix_tutorial.html).&lt;br /&gt;
&lt;br /&gt;
     See (TIP 49) on putting &amp;quot;/usr/local/BerkeleyDB.4.3/lib&amp;quot; in the &amp;quot;/etc/ld.so.conf&amp;quot; file. Or&lt;br /&gt;
     once BerkeleyDB is installed, you can put the location on the command line as follows:&lt;br /&gt;
&lt;br /&gt;
     Configuring cfengine with direct reference to BerkeleyDB.4.3.  First cd to the cfengine source.&lt;br /&gt;
&lt;br /&gt;
          $ ./configure --with-berkeleydb=/usr/local/BerkeleyDB.4.3/lib&lt;br /&gt;
          $ make&lt;br /&gt;
          $ make install&lt;br /&gt;
&lt;br /&gt;
     Next create the following directories:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /var/cfengine/bin&lt;br /&gt;
          $ mkdir -p /var/cfengine/inputs&lt;br /&gt;
&lt;br /&gt;
     Copy needed files (cfagent, cfdoc, cfenvd, cfenvgraph, cfexecd, cfkey, cfrun, cfservd, cfshow):&lt;br /&gt;
&lt;br /&gt;
          $ cp /usr/local/sbin/cf* /var/cfengine/bin&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You'll also need to generate keys. As root, execute the following:&lt;br /&gt;
&lt;br /&gt;
          $ cfkey&lt;br /&gt;
&lt;br /&gt;
     The command above will write the public and private keys in&lt;br /&gt;
     &amp;quot;/var/cfengine/ppkeys&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You probably want (cfexecd, cfservd, and cfenvd) running on all servers. If you&lt;br /&gt;
     add the following to &amp;quot;/etc/rc.local&amp;quot; these daemons will start on reboot.&lt;br /&gt;
&lt;br /&gt;
           # Lines in /etc/rc.local&lt;br /&gt;
           /usr/local/sbin/cfexecd&lt;br /&gt;
           /usr/local/sbin/cfservd&lt;br /&gt;
           /usr/local/sbin/cfenvd&lt;br /&gt;
&lt;br /&gt;
     Also, make sure you run each command now as follows:&lt;br /&gt;
&lt;br /&gt;
          $ /usr/local/sbin/cfexecd&lt;br /&gt;
          $ /usr/local/sbin/cfservd&lt;br /&gt;
          $ /usr/local/sbin/cfenvd&lt;br /&gt;
&lt;br /&gt;
     Firewall settings must be adjusted to allows 5308 for tcp/udp. My local network&lt;br /&gt;
     is 192.168.1.0, so I'm opening it up for all my computers.&lt;br /&gt;
&lt;br /&gt;
          $ iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 5308 -j ACCEPT&lt;br /&gt;
          $ iptables -A INPUT -p tcp -s 192.168.1.0/24  --dport 5308 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
     A set of keys needs to be on the server and hosts. For example, my key on &amp;quot;tape.squeezel.com&amp;quot;&lt;br /&gt;
     should be copied over to the server &amp;quot;squeezel.squeezel.com&amp;quot; as follows:&lt;br /&gt;
&lt;br /&gt;
     This is done from tape.squeezel.com&lt;br /&gt;
&lt;br /&gt;
          $ scp /var/cfengine/ppkeys/localhost.pub  root@squeezel.squeezel.com:/var/cfengine/ppkeys/root-tape.squeezel.com.pub&lt;br /&gt;
          $ scp root@squeezel.squeezel.com:/var/cfengine/ppkeys/localhost.pub /var/cfengine/ppkeys/root-squeezel.squeezel.com.pub&lt;br /&gt;
&lt;br /&gt;
     Also, &amp;quot;/var/cfengine/inputs/cfrun.hosts&amp;quot; on the server &amp;quot;squeezel.squeezel.com&amp;quot; must contain&lt;br /&gt;
     all the computers that will get updated. This is &amp;quot;cfrun.hosts&amp;quot; on &amp;quot;squeezel.squeezel.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          closet.squeezel.com&lt;br /&gt;
          tape.squeezel.com&lt;br /&gt;
&lt;br /&gt;
     Once I'm done, from &amp;quot;tape.squeezel.com&amp;quot; I can run the following test:&lt;br /&gt;
&lt;br /&gt;
          $ cfrun squeezel.squeezel.com -v&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 166:&lt;br /&gt;
&lt;br /&gt;
     cfengine - a quick example. This example will be run as root. You create the file &amp;quot;cfagent.conf&amp;quot; in&lt;br /&gt;
     &amp;quot;/var/cfengine/inputs/&amp;quot;. The example below will checksum all the files in /home/chirico/deleteme/tripwire,&lt;br /&gt;
     it will also comment out the line &amp;quot;finger&amp;quot; in any file located in /tmp/testdir/stuff, also appending&lt;br /&gt;
     the command in this file &amp;quot; Edit change with cfengine&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          # /var/cfengine/inputs/cfagent.conf&lt;br /&gt;
          #&lt;br /&gt;
          # You run this with the following:&lt;br /&gt;
          #   cfagent -vK&lt;br /&gt;
        &lt;br /&gt;
          control:&lt;br /&gt;
                 actionsequence = ( files tidy editfiles )&lt;br /&gt;
                 ChecksumDatabase = ( /var/cfengine/cache.db )&lt;br /&gt;
                 # Below, true to update md5&lt;br /&gt;
                 ChecksumUpdates = ( true )&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
          files:&lt;br /&gt;
                 /home/chirico/deleteme/tripwire checksum=md5 recurse=inf&lt;br /&gt;
                 /home/chirico/deleteme/tripwire/moredata checksum=md5 recurse=inf&lt;br /&gt;
                 #/home/chirico/deleteme/tripwire/compress  recurse=inf include=*.txt acti on=compress&lt;br /&gt;
                   # If the database isn't secure, nothing is secure...&lt;br /&gt;
                 /var/cfengine/cache.db  mode=600 owner=root action=fixall&lt;br /&gt;
        &lt;br /&gt;
          tidy:&lt;br /&gt;
                 /home/chirico/deleteme/tripwire pattern=*~ recurse=inf age=0&lt;br /&gt;
                 # You must put an age. 0 runs now.&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
          editfiles:&lt;br /&gt;
        &lt;br /&gt;
                {  /tmp/testdir/stuff&lt;br /&gt;
&lt;br /&gt;
                   HashCommentLinesContaining &amp;quot;finger&amp;quot;&lt;br /&gt;
                   AppendIfNoSuchLine &amp;quot;# Edit Change with cfengine &amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     A few further notes on the above. The command &amp;quot;actionsequence = ( files tidy editfiles) tells the order&lt;br /&gt;
     of what to execute. The heading &amp;quot;tidy:&amp;quot; deletes files, and of course, &amp;quot;editfiles&amp;quot; does the editing of files.&lt;br /&gt;
&lt;br /&gt;
     To run the example, execute the following command. The  &amp;quot;-K&amp;quot; causes the lock file to be ignored.&lt;br /&gt;
&lt;br /&gt;
            $ cfagent -vK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 167:&lt;br /&gt;
&lt;br /&gt;
     Implementing Disk Quotas - a quick example that can easily be done on a live system for testing. There&lt;br /&gt;
     is no need to reboot, since you'll be creating a virtual filesystem.&lt;br /&gt;
&lt;br /&gt;
     Do the following as root. First create a mount point.&lt;br /&gt;
&lt;br /&gt;
            # mkdir -p /quota&lt;br /&gt;
&lt;br /&gt;
     Next, create 20M file. Since I have many of these files, I created a special directory &amp;quot;/usr/disk-img&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            # mkdir -p /usr/disk-img&lt;br /&gt;
            # dd if=/dev/zero of=/usr/disk-img/disk-quota.ext3 count=40960&lt;br /&gt;
&lt;br /&gt;
     The dd command above create a 20 MB file because, by default, dd uses a block size of 512 bytes. That makes&lt;br /&gt;
     the size: 40960*512=20971520.&lt;br /&gt;
&lt;br /&gt;
     Next, format this as an ext3 filesystem&lt;br /&gt;
&lt;br /&gt;
            # /sbin/mkfs -t ext3 -q /usr/disk-img/disk-quota.ext3 -F&lt;br /&gt;
&lt;br /&gt;
     Add the following line to &amp;quot;/etc/fstab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            /usr/disk-img/disk-quota.ext3    /quota ext3    rw,loop,usrquota,grpquota  0 0&lt;br /&gt;
&lt;br /&gt;
     Now, mount this filesystem&lt;br /&gt;
&lt;br /&gt;
            # mount /quota&lt;br /&gt;
&lt;br /&gt;
     Take a look at it:&lt;br /&gt;
&lt;br /&gt;
            # ls -l /quota&lt;br /&gt;
            lost+found&lt;br /&gt;
&lt;br /&gt;
     Now, run &amp;quot;quotacheck&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            # quotacheck -vug /quota&lt;br /&gt;
&lt;br /&gt;
     You'll get errors the first time this is run, because you have no quota files.&lt;br /&gt;
     But, run it a second time and you'll see something similiar to the following:&lt;br /&gt;
&lt;br /&gt;
            # quotacheck -vug /quota&lt;br /&gt;
            quotacheck: Scanning /dev/loop2 [/quota] done&lt;br /&gt;
            quotacheck: Checked 3 directories and 4 files&lt;br /&gt;
&lt;br /&gt;
     Now take a look at the files:&lt;br /&gt;
&lt;br /&gt;
            # ls -l /quota&lt;br /&gt;
            total 26&lt;br /&gt;
            -rw-------  1 root root  6144 Jun 14 12:23 aquota.group&lt;br /&gt;
            -rw-------  1 root root  6144 Jun 14 12:23 aquota.user&lt;br /&gt;
            drwx------  2 root root 12288 Jun 14 12:18 lost+found&lt;br /&gt;
&lt;br /&gt;
     Next use &amp;quot;edquota&amp;quot; to grant the user &amp;quot;chirico&amp;quot; a certain quota&lt;br /&gt;
&lt;br /&gt;
            # edquota -f /quota chirico&lt;br /&gt;
&lt;br /&gt;
     This will bring up a menu, and here I have edited so that user &amp;quot;chirico&amp;quot;&lt;br /&gt;
     has a soft limit of 120*512=61K, and a soft limit of 2 inodes and a hard limit of 5.&lt;br /&gt;
&lt;br /&gt;
             Disk quotas for user chirico (uid 500):&lt;br /&gt;
             Filesystem                   blocks       soft       hard     inodes     soft     hard&lt;br /&gt;
             /dev/loop2                        2        120        150         1        2         3&lt;br /&gt;
&lt;br /&gt;
     Next, turn quotas on with the following command:&lt;br /&gt;
&lt;br /&gt;
             $ quotaon /quota&lt;br /&gt;
&lt;br /&gt;
     If you need to turn off quotas, the command is &amp;quot;quotaoff -a&amp;quot; for all filesystems. You'll run into&lt;br /&gt;
     errors if you try to run quotacheck, say &amp;quot;quotacheck -avug&amp;quot; because this tries to unmount and mount&lt;br /&gt;
     the filesystem. You need to turn off quotas first &amp;quot;quotaoff /quota&amp;quot;. Note you only need to run&lt;br /&gt;
     quotacheck once, or when doing maintenance after a system crash.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      To get a report on the quote, runn &amp;quot;repquota&amp;quot; as follows:&lt;br /&gt;
&lt;br /&gt;
           $ repquota /quota&lt;br /&gt;
            *** Report for user quotas on device /dev/loop0&lt;br /&gt;
            Block grace time: 7days; Inode grace time: 7days&lt;br /&gt;
                                    Block limits                File limits&lt;br /&gt;
            User            used    soft    hard  grace    used  soft  hard  grace&lt;br /&gt;
            ----------------------------------------------------------------------&lt;br /&gt;
            root      --    1189       0       0              2     0     0&lt;br /&gt;
            chirico   -+      93       0       0              4     2     5  6days&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Note above that user &amp;quot;chirico&amp;quot; has used 4 on the file limits. This user has a hard&lt;br /&gt;
      limit of 5. So when this user tries to create 2 more files (bring this over the limit of 5)&lt;br /&gt;
      then he will get the following error as demonstrated below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           [chirico@squeezel chirico]$ touch one&lt;br /&gt;
           [chirico@squeezel chirico]$ touch two&lt;br /&gt;
           loop0: write failed, user file limit reached.&lt;br /&gt;
           touch: cannot touch `two': Disk quota exceeded&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Now, if repquota (run by root) is executed it shows the following:&lt;br /&gt;
&lt;br /&gt;
           $ repquota /quota&lt;br /&gt;
           *** Report for user quotas on device /dev/loop0&lt;br /&gt;
           Block grace time: 7days; Inode grace time: 7days&lt;br /&gt;
                                   Block limits                File limits&lt;br /&gt;
           User            used    soft    hard  grace    used  soft  hard  grace&lt;br /&gt;
           ----------------------------------------------------------------------&lt;br /&gt;
           root      --    1189       0       0              2     0     0&lt;br /&gt;
           chirico   -+      94       0       0              5     2     5  6days&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Note the &amp;quot;+&amp;quot; sign above. User &amp;quot;chirico&amp;quot; is above the File soft limits, and in this case&lt;br /&gt;
      above the hard limits.&lt;br /&gt;
&lt;br /&gt;
      To warn user by sending email to them, run &amp;quot;warnquota&amp;quot;, but you need check that&lt;br /&gt;
      &amp;quot;/etc/warnquota.conf&amp;quot; is setup correctly. For the example above, this file should&lt;br /&gt;
      look as follows:&lt;br /&gt;
&lt;br /&gt;
            $ cat /etc/quotatab&lt;br /&gt;
            #&lt;br /&gt;
            #  This is sample quotatab (/etc/quotatab)&lt;br /&gt;
            #  Here you can specify description of each device for user&lt;br /&gt;
            #&lt;br /&gt;
            #  Comments begin with hash in the beginning of the line&lt;br /&gt;
&lt;br /&gt;
            # Example of description&lt;br /&gt;
            /dev/loop0: This is loopback device&lt;br /&gt;
&lt;br /&gt;
      Just run the following as root:&lt;br /&gt;
&lt;br /&gt;
            $ warnquota&lt;br /&gt;
&lt;br /&gt;
      By the way, if you want to change the grace period, it can only be done on a filesystem&lt;br /&gt;
      basis. Not per user.&lt;br /&gt;
&lt;br /&gt;
            $  edquota -t&lt;br /&gt;
&lt;br /&gt;
      Users can run &amp;quot;quota&amp;quot; to see their usage as follows:&lt;br /&gt;
&lt;br /&gt;
            [chirico@squeezel ~]$ quota&lt;br /&gt;
            Disk quotas for user chirico (uid 500):&lt;br /&gt;
                 Filesystem  blocks   quota   limit   grace   files   quota   limit   grace&lt;br /&gt;
                 /dev/loop0      94       0       0               5      10      50&lt;br /&gt;
&lt;br /&gt;
      As you can see from above, I changed my inode limit to 50.&lt;br /&gt;
&lt;br /&gt;
      What about running this on the whole filesystem? Yes, below is an example where I'm running&lt;br /&gt;
      this on FC3, on the root of the filesystem &amp;quot;/&amp;quot;. This assumes that you have installed the&lt;br /&gt;
      quota package. Try doing &amp;quot;rpm -q quota&amp;quot; to see if this package is installed.&lt;br /&gt;
&lt;br /&gt;
        Step 1:&lt;br /&gt;
&lt;br /&gt;
           Check to make sure the quota software is installed. You can either do a &amp;quot;whereis quota&amp;quot;,&lt;br /&gt;
           or check for the rpm package.&lt;br /&gt;
&lt;br /&gt;
             $ whereis quota&lt;br /&gt;
             whereis quota&lt;br /&gt;
             quota: /usr/bin/quota /usr/share/man/man1/quota.1.gz&lt;br /&gt;
&lt;br /&gt;
           Checking for the rpm package.&lt;br /&gt;
&lt;br /&gt;
            $ rpm -q quota&lt;br /&gt;
            quota-3.12-5&lt;br /&gt;
&lt;br /&gt;
        Step 2:&lt;br /&gt;
&lt;br /&gt;
           Edit /etc/fstab and add usrquota and grpquota options for &amp;quot;/dev/VolGroup00/LogVol00&amp;quot;,&lt;br /&gt;
           which is shown on the first line below:&lt;br /&gt;
&lt;br /&gt;
             /dev/VolGroup00/LogVol00 /                      ext3    defaults,usrquota,grpquota        1 1&lt;br /&gt;
             LABEL=/boot             /boot                   ext3    defaults        1 2&lt;br /&gt;
             none                    /dev/pts                devpts  gid=5,mode=620  0 0&lt;br /&gt;
             none                    /dev/shm                tmpfs   defaults        0 0&lt;br /&gt;
             none                    /proc                   proc    defaults        0 0&lt;br /&gt;
             none                    /sys                    sysfs   defaults        0 0&lt;br /&gt;
             /dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0&lt;br /&gt;
&lt;br /&gt;
        Step 3:&lt;br /&gt;
&lt;br /&gt;
           Remount the filesystem as follows:&lt;br /&gt;
&lt;br /&gt;
             $ mount -o remount /&lt;br /&gt;
&lt;br /&gt;
        Step 4:&lt;br /&gt;
&lt;br /&gt;
           Run quotacheck with the &amp;quot;-m&amp;quot; option. Like the above statement, this will have to be run with&lt;br /&gt;
           root priviliges. This creates the quota database files, and it can take a long time if it is&lt;br /&gt;
           a large full filesystem.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             $ quotacheck -cugm /&lt;br /&gt;
&lt;br /&gt;
        Step 5:&lt;br /&gt;
&lt;br /&gt;
           This step is optional, but it's good to know if you need to recalculate quotas because of a&lt;br /&gt;
           system crash. It's demonstrated here, because at this point quota's have not been turned on.&lt;br /&gt;
           Again, note the &amp;quot;m&amp;quot; option below.&lt;br /&gt;
&lt;br /&gt;
             $ quotacheck -avumg&lt;br /&gt;
&lt;br /&gt;
        Step 6:&lt;br /&gt;
&lt;br /&gt;
           Set limits for specific users or groups using the &amp;quot;edquota&amp;quot; command. Shown below is the command&lt;br /&gt;
           to setup quotas for user &amp;quot;chirico&amp;quot;. Shown below this user has used 161560 blocks, he has a soft&lt;br /&gt;
           limit of 1161560 and a hard limit of 900000. He has used 3085 inodes and has a soft limit of 10000&lt;br /&gt;
           and a hard limit of 12000.&lt;br /&gt;
&lt;br /&gt;
             $ edquota -f / chirico&lt;br /&gt;
&lt;br /&gt;
             Disk quotas for user chirico (uid 500):&lt;br /&gt;
               Filesystem                   blocks       soft       hard     inodes     soft     hard&lt;br /&gt;
               /dev/mapper/VolGroup00-LogVol00     161560    1161560     900000       3085    10000    12000&lt;br /&gt;
&lt;br /&gt;
           You can put quotas on groups as well. The following is done as root. See (TIP 186 and TIP 6) for creating&lt;br /&gt;
           groups and adding users to groups.&lt;br /&gt;
&lt;br /&gt;
             $ edquota -g share&lt;br /&gt;
&lt;br /&gt;
           If you create a sharable directory for anyone in the group &amp;quot;share&amp;quot; (TIP 6), quota restrictions against&lt;br /&gt;
           group &amp;quot;share&amp;quot; will only apply to files added in the &amp;quot;/home/share&amp;quot; directory. When user &amp;quot;chirico&amp;quot; creates&lt;br /&gt;
           files in &amp;quot;/home/share&amp;quot; they also go against this user quota as well. However, when files are created in&lt;br /&gt;
           his home directory they do not go against the &amp;quot;share&amp;quot; group.&lt;br /&gt;
&lt;br /&gt;
           Note - if you get errors when trying to run &amp;quot;edquota -g share&amp;quot;, turn quotas off &amp;quot;quotaoff /&amp;quot; and&lt;br /&gt;
                  run &amp;quot;quotacheck -avugm&amp;quot;. Then, turn the quotas back on &amp;quot;quotaon /&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           You can see the status of the group quota with the following command:&lt;br /&gt;
&lt;br /&gt;
             $ quota -g share&lt;br /&gt;
&lt;br /&gt;
        Step 7:&lt;br /&gt;
&lt;br /&gt;
           Turn on quotas with the &amp;quot;qutoaon&amp;quot; command. This command needs to be done with root privileges.&lt;br /&gt;
&lt;br /&gt;
             $ quotaon /&lt;br /&gt;
&lt;br /&gt;
        Step 8:&lt;br /&gt;
&lt;br /&gt;
           Check &amp;quot;/etc/quotatab&amp;quot; file for the correct entries. Note that when you do the &amp;quot;mount&amp;quot; command&lt;br /&gt;
           the filesystem returned needs to match what is in the &amp;quot;quotatab&amp;quot; file. I have noticed that this&lt;br /&gt;
           is not the case by default.&lt;br /&gt;
&lt;br /&gt;
             $ mount&lt;br /&gt;
             /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw,usrquota,grpquota)&lt;br /&gt;
&lt;br /&gt;
           So the &amp;quot;/etc/quotatab&amp;quot; must contain the following line.&lt;br /&gt;
&lt;br /&gt;
             /dev/mapper/VolGroup00-LogVol00: This is the Volume group&lt;br /&gt;
&lt;br /&gt;
        Step 9:&lt;br /&gt;
&lt;br /&gt;
           Run &amp;quot;warnquota&amp;quot; as a check that the &amp;quot;/etc/quotatab&amp;quot; files is setup correctly.&lt;br /&gt;
&lt;br /&gt;
              $ warnquota&lt;br /&gt;
&lt;br /&gt;
        Step 10:&lt;br /&gt;
&lt;br /&gt;
           Setup a daily cron job for running &amp;quot;warnquota&amp;quot;. The following should be placed&lt;br /&gt;
           in &amp;quot;/etc/cron.daily&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              #!/bin/sh&lt;br /&gt;
              # Place this file in /etc/cron.daily&lt;br /&gt;
              # with rights 0755&lt;br /&gt;
              /usr/sbin/warnquota&lt;br /&gt;
              EXITVALUE=$?&lt;br /&gt;
              if [ $EXITVALUE != 0 ]; then&lt;br /&gt;
                 /usr/bin/logger -t warnquota &amp;quot;ALERT exited abnormally with [$EXITVALUE]&amp;quot;&lt;br /&gt;
              fi&lt;br /&gt;
              exit 0&lt;br /&gt;
&lt;br /&gt;
      References:&lt;br /&gt;
        http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/sysadmin-guide/ch-disk-quotas.html&lt;br /&gt;
        (TIP 6, TIP 186, and TIP 205)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 168:&lt;br /&gt;
&lt;br /&gt;
     rdist - remote file distribution client program. You can use this program in combination with&lt;br /&gt;
     ssh. This program does more than just copy files. Once a file has been copied, you can dictate&lt;br /&gt;
     other actions to be performed. Or you can hold off copying all together if the destination is&lt;br /&gt;
     running low on inodes, or disk space.&lt;br /&gt;
&lt;br /&gt;
     For the purpose of this example, all commands will been run on &amp;quot;squeezel.squeezel.com&amp;quot;, and the&lt;br /&gt;
     computers that will be updated are &amp;quot;tape.squeezel.com&amp;quot; and &amp;quot;closet.squeezel.com&amp;quot;. Obviously, you&lt;br /&gt;
     would substitute your computer names.&lt;br /&gt;
&lt;br /&gt;
     It helps to setup ssh keys on each computer first. Reference [http://souptonuts.sourceforge.net/sshtips.htm]&lt;br /&gt;
     and (TIP 12).&lt;br /&gt;
&lt;br /&gt;
     Step 1: Create the Configuration file myDistfile&lt;br /&gt;
&lt;br /&gt;
       Below is my sample &amp;quot;myDistfile&amp;quot;. This file will access hosts &amp;quot;tape.squeezel.com&amp;quot; using username chirico&lt;br /&gt;
       and &amp;quot;closet.squeezel.com&amp;quot; with the username running this command, and copy the&lt;br /&gt;
       files &amp;quot;/home/chirico/file1&amp;quot; and &amp;quot;/home/chirico/file2&amp;quot; to the these two servers creating the&lt;br /&gt;
       directory ~/tmpdir if it doesn't exist. Once these files are updated, a mail check (&amp;quot;sendmail -bv&amp;quot;)&lt;br /&gt;
       will be performed, and mail will be sent to &amp;quot;chirico@squeezel&amp;quot;. This happens twice, once for each file.&lt;br /&gt;
&lt;br /&gt;
       Note, the line &amp;quot;/home/chirico/file2 -&amp;gt; tape.squeezel.com&amp;quot; which moves the file &amp;quot;file2&amp;quot; to&lt;br /&gt;
       tape.squeezel.com renaming the file to &amp;quot;tapedest&amp;quot; in the directory &amp;quot;/home/chirico&amp;quot;. Once this file&lt;br /&gt;
       is copied, the rights are modified to &amp;quot;chmod +r&amp;quot;.  Likewise, &amp;quot;/home/chirico/file2 -&amp;gt; closet.squeezel.com&amp;quot;&lt;br /&gt;
       copies the file file2, which is renamed as closetdest.&lt;br /&gt;
&lt;br /&gt;
                 # Contents of myDistfile&lt;br /&gt;
                 HOSTS = ( chirico@tape.squeezel.com closet.squeezel.com )&lt;br /&gt;
&lt;br /&gt;
                 FILES = ( /home/chirico/file1 /home/chirico/file2 )&lt;br /&gt;
&lt;br /&gt;
                 ${FILES} -&amp;gt; ${HOSTS}&lt;br /&gt;
                    # Directory tmpdir will be created if it doesn't exist&lt;br /&gt;
                    install tmpdir ;&lt;br /&gt;
                    special /home/chirico/file1  &amp;quot;/usr/sbin/sendmail -bv mchirico@gmail.com&amp;quot;;&lt;br /&gt;
                    notify chirico@squeezel;&lt;br /&gt;
&lt;br /&gt;
                 /home/chirico/file2 -&amp;gt; tape.squeezel.com&lt;br /&gt;
                    install  /home/chirico/tapedest;&lt;br /&gt;
                    special  /home/chirico/tapedest &amp;quot;chmod +r /home/chirico/tapedest&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
                 /home/chirico/file2 -&amp;gt; closet.squeezel.com&lt;br /&gt;
                    install /home/chirico/closetdest;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 2: Command from squeezel.squeezel.com to run myDistfile above&lt;br /&gt;
&lt;br /&gt;
       Below is the command that will execute the contents in &amp;quot;myDistfile&amp;quot;. This command is run from the&lt;br /&gt;
       computer &amp;quot;squeezel.squeezel.com&amp;quot;. All output will go in the file &amp;quot;cmd1rdist.log&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ rdist -P /usr/local/bin/ssh -f ./myDistfile -l file=./cmd1rdist.log=all&lt;br /&gt;
&lt;br /&gt;
       Obviously you want a secure copy (using scp), so the -P option uses ssh as your secure&lt;br /&gt;
       transport mechanism.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 169:&lt;br /&gt;
&lt;br /&gt;
     Restricting root logins (/etc/securetty). ctl-alt-F4 will give you a prompt for tty3. Note&lt;br /&gt;
     that it is one number less. Take a look at the contents of &amp;quot;/etc/securetty&amp;quot;. To prevent&lt;br /&gt;
     root from logging in on this device, take out tty3 from this listing. Note, you can always&lt;br /&gt;
     login as another user, then, su to root.  Below is an example of the default&lt;br /&gt;
     &amp;quot;/etc/securetty&amp;quot; that allows root to login to everything.&lt;br /&gt;
&lt;br /&gt;
         [root@squeezel ~]# cat /etc/securetty&lt;br /&gt;
         console&lt;br /&gt;
         vc/1&lt;br /&gt;
         vc/2&lt;br /&gt;
         vc/3&lt;br /&gt;
         vc/4&lt;br /&gt;
         vc/5&lt;br /&gt;
         vc/6&lt;br /&gt;
         vc/7&lt;br /&gt;
         vc/8&lt;br /&gt;
         vc/9&lt;br /&gt;
         vc/10&lt;br /&gt;
         vc/11&lt;br /&gt;
         tty1&lt;br /&gt;
         tty2&lt;br /&gt;
         tty3&lt;br /&gt;
         tty4&lt;br /&gt;
         tty5&lt;br /&gt;
         tty6&lt;br /&gt;
         tty7&lt;br /&gt;
         tty8&lt;br /&gt;
         tty9&lt;br /&gt;
         tty10&lt;br /&gt;
         tty11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 170:&lt;br /&gt;
&lt;br /&gt;
     Perl map function. Try the following to get a quick take on this function,&lt;br /&gt;
     which increments each value in the array a;&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map {$_++} @a;&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot; } @a;&lt;br /&gt;
&lt;br /&gt;
     or&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     And you can easily make modifications, like reversing the order&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     Plus there is a grep() function that works on each element as well&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse grep{ $_ &amp;gt; 3} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     To get only odd numbers in reverse order:&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse grep{ !($_ % 2)} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference: http://www-128.ibm.com/developerworks/linux/library/l-road4.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 171:&lt;br /&gt;
&lt;br /&gt;
     Perl - subroutine call and shifting through variables. A simple and useful&lt;br /&gt;
     technique.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          sub test {&lt;br /&gt;
            local $mval;&lt;br /&gt;
            while( $mval = shift ) {&lt;br /&gt;
              print &amp;quot; $mval\n&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          test(&amp;quot;one&amp;quot;,&amp;quot;two&amp;quot;,&amp;quot;three&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 172:&lt;br /&gt;
&lt;br /&gt;
     Tcp wrappers - First &amp;quot;/etc/hosts.allow&amp;quot; is check, and if there is an entry in this file, no more&lt;br /&gt;
     checking it done.  If are no matches in &amp;quot;/etc/hosts.allow&amp;quot;, the &amp;quot;/etc/hosts.deny&amp;quot; file is checked&lt;br /&gt;
     and if a match is found, that service is blocked for that host.&lt;br /&gt;
&lt;br /&gt;
     Example &amp;quot;/etc/hosts.deny&amp;quot; file:&lt;br /&gt;
&lt;br /&gt;
         sshd: 192.168.1.171&lt;br /&gt;
&lt;br /&gt;
     The above file blocks access to computer 192.168.1.171. It's also possible to run commands when&lt;br /&gt;
     someone from this computer tries to ssh in. This example sends mail.&lt;br /&gt;
&lt;br /&gt;
         sshd: 192.168.1.171: spawn (echo -e &amp;quot;%d %h %H %u&amp;quot;| /bin/mail -s 'hosts.deny entry' root)&lt;br /&gt;
&lt;br /&gt;
     Of course, you can also run commands in the &amp;quot;/etc/hosts.allow&amp;quot; if you wanted mail sent for a successful&lt;br /&gt;
     login.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 173:&lt;br /&gt;
&lt;br /&gt;
     pgrep, pkill - look up or signal process based on name and other attributes.&lt;br /&gt;
&lt;br /&gt;
     To quick find all instances of ssh running, for user root, execute the following&lt;br /&gt;
     command:&lt;br /&gt;
&lt;br /&gt;
           $ pgrep -u root -l ssh&lt;br /&gt;
&lt;br /&gt;
     To kill a process, or send a signal use the &amp;quot;pkill&amp;quot; option. For example, to&lt;br /&gt;
     make syslog reread its configuration file:&lt;br /&gt;
&lt;br /&gt;
           $ pkill -HUP syslogd&lt;br /&gt;
&lt;br /&gt;
     Another command command is &amp;quot;pidof&amp;quot; that can tell you how many processes are running.&lt;br /&gt;
     This can be useful for detecting DOS attacks.&lt;br /&gt;
&lt;br /&gt;
           $ pidof sshd&lt;br /&gt;
           4783 4781 30008 30006 29888 29886 2246&lt;br /&gt;
&lt;br /&gt;
     Above there are 7 sshd's running. Reference &amp;quot;Tcpdump, Raw Socket and Libpap Tutorial&amp;quot;&lt;br /&gt;
     at [http://souptonuts.sourceforge.net/tcpdump_tutorial.html].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 174:&lt;br /&gt;
&lt;br /&gt;
     Password Cracking - tools to check your users passwords:&lt;br /&gt;
&lt;br /&gt;
      John The Ripper&lt;br /&gt;
        http://www.openwall.com/john/&lt;br /&gt;
&lt;br /&gt;
      Crack&lt;br /&gt;
        http://www.crypticide.com/users/alecm/&lt;br /&gt;
&lt;br /&gt;
      Slurpie&lt;br /&gt;
        http://www.ussrback.com/distributed.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 175:&lt;br /&gt;
&lt;br /&gt;
     Password Aging - setting the number of days a password is valid.&lt;br /&gt;
&lt;br /&gt;
         $ chage -M 90 &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 176:&lt;br /&gt;
&lt;br /&gt;
     Kernel Performance Tuning - /Documentation/sysctl/vm.txt documents kernel settings to&lt;br /&gt;
     improve performance. Below are some examples.&lt;br /&gt;
&lt;br /&gt;
       overcommit_memory:  0 -- default estimates the amount of memory for malloc&lt;br /&gt;
                           1 -- kernel pretends there is always enough memory until it runs out&lt;br /&gt;
                           3 -- never overcommit&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/overcommit_memory&lt;br /&gt;
          0&lt;br /&gt;
&lt;br /&gt;
       page-cluster:&lt;br /&gt;
            The Linux VM subsystem avoids excessive disk seeks by reading&lt;br /&gt;
            multiple pages on a page fault. The number of pages it reads&lt;br /&gt;
            is dependent on the amount of memory in your machine.&lt;br /&gt;
        &lt;br /&gt;
            The number of pages the kernel reads in at once is equal to&lt;br /&gt;
            2 ^ page-cluster. Values above 2 ^ 5 don't make much sense&lt;br /&gt;
            for swap because we only cluster swap data in 32-page groups.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/page-cluster&lt;br /&gt;
          3&lt;br /&gt;
&lt;br /&gt;
       min_free_kbytes:&lt;br /&gt;
            This is used to force the Linux VM to keep a minimum number&lt;br /&gt;
            of kilobytes free.  The VM uses this number to compute a pages_min&lt;br /&gt;
            value for each lowmem zone in the system.  Each lowmem zone gets&lt;br /&gt;
            a number of reserved free pages based proportionally on its size.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/min_free_kbytes&lt;br /&gt;
          3831&lt;br /&gt;
&lt;br /&gt;
       max_map_count:&lt;br /&gt;
            This file contains the maximum number of memory map areas a process&lt;br /&gt;
            may have. Memory map areas are used as a side-effect of calling&lt;br /&gt;
            malloc, directly by mmap and mprotect, and also when loading shared&lt;br /&gt;
            libraries.&lt;br /&gt;
&lt;br /&gt;
            While most applications need less than a thousand maps, certain&lt;br /&gt;
            programs, particularly malloc debuggers, may consume lots of them,&lt;br /&gt;
            e.g., up to one or two maps per allocation.&lt;br /&gt;
&lt;br /&gt;
            The default value is 65536.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/max_map_count&lt;br /&gt;
          65536&lt;br /&gt;
&lt;br /&gt;
        Also see http://people.redhat.com/alikins/system_tuning.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 177:&lt;br /&gt;
&lt;br /&gt;
     IO Scheduler - /Documentation/block/as-iosched.txt documents kernel settings for disk&lt;br /&gt;
     performance.&lt;br /&gt;
&lt;br /&gt;
     If you're not sure what partitions you have &amp;quot;$ cat /proc/partitions&amp;quot;. This example&lt;br /&gt;
     assumes hda, and you can see some of the kernel settings:&lt;br /&gt;
&lt;br /&gt;
          $ ls /sys/block/hda/queue/iosched&lt;br /&gt;
          back_seek_max  back_seek_penalty  clear_elapsed  fifo_batch_expire  fifo_expire_async&lt;br /&gt;
           fifo_expire_sync  find_best_crq  key_type  quantum  queued&lt;br /&gt;
&lt;br /&gt;
     References: http://lwn.net/Articles/102505/&lt;br /&gt;
                 http://bhhdoa.org.au/pipermail/ck/2004-September/000961.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 178:&lt;br /&gt;
&lt;br /&gt;
     iozone -- getting data on disk performance (http://www.iozone.org/). This is a very&lt;br /&gt;
     comprehensive package.&lt;br /&gt;
&lt;br /&gt;
           $ wget http://www.iozone.org/src/current/iozone3_242.tar&lt;br /&gt;
           $ tar -xf iozone3_242.tar&lt;br /&gt;
           $ cd iozone3_242/src/current&lt;br /&gt;
           $ make linux&lt;br /&gt;
&lt;br /&gt;
     At this point you should read the documentation. There is no &amp;quot;make install&amp;quot;. You&lt;br /&gt;
     copy it to each filesystem you want to run this program on. Below are some quick&lt;br /&gt;
     start commands.&lt;br /&gt;
&lt;br /&gt;
       Good comprehensive test.&lt;br /&gt;
&lt;br /&gt;
           $ iozone -a&lt;br /&gt;
&lt;br /&gt;
       I prefer this for small filesystems. It limits the record size to 10000 and does&lt;br /&gt;
       the output in operations per second (higher numbers mean faster drive).&lt;br /&gt;
&lt;br /&gt;
           $ ./iozone -a -s 10000 -O&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 179:&lt;br /&gt;
&lt;br /&gt;
     history - bash command to get a history of all commands typed. But, here is a way&lt;br /&gt;
     that you can get date and time listed as well.&lt;br /&gt;
&lt;br /&gt;
           $ HISTTIMEFORMAT=&amp;quot;%y/%m/%d %T &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Defining the environment variable above give you the date/time info when you&lt;br /&gt;
     execute history:&lt;br /&gt;
&lt;br /&gt;
           $ history&lt;br /&gt;
              ...&lt;br /&gt;
               175  05/06/30 12:51:46 grep '141.162.' mout &amp;gt; mout2&lt;br /&gt;
               176  05/06/30 12:51:48 e mout2&lt;br /&gt;
               177  05/06/30 12:56:59 ls&lt;br /&gt;
               178  05/06/30 12:57:02 ls&lt;br /&gt;
               179  05/06/30 12:57:39 ls&lt;br /&gt;
               180  05/06/30 12:57:49 ls -l&lt;br /&gt;
               181  05/06/30 13:01:10 history&lt;br /&gt;
               182  05/06/30 13:01:20 HISTTIMEFORMAT=&amp;quot;%y/%m/%d %T &amp;quot;&lt;br /&gt;
               183  05/06/30 13:01:23 history&lt;br /&gt;
              ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 180:&lt;br /&gt;
&lt;br /&gt;
     .config - Fedora Core getting the .config to rebuild the kernel. You can find&lt;br /&gt;
     this file, the &amp;quot;.config&amp;quot; file at the following location:&lt;br /&gt;
&lt;br /&gt;
          $ ls &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Or, to see the contents&lt;br /&gt;
&lt;br /&gt;
          $ cat &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     This can be important, if you're planning to build your own kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 181:&lt;br /&gt;
&lt;br /&gt;
     Listing control key settings.&lt;br /&gt;
&lt;br /&gt;
          $ stty -a&lt;br /&gt;
          speed 38400 baud; rows 0; columns 0; line = 0;&lt;br /&gt;
          intr = ^C; quit = ^\; erase = &amp;lt;undef&amp;gt;; kill = &amp;lt;undef&amp;gt;; eof = ^D; eol = &amp;lt;undef&amp;gt;; eol2 = &amp;lt;undef&amp;gt;; start = ^Q;&lt;br /&gt;
          stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;&lt;br /&gt;
          -parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts&lt;br /&gt;
          -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel&lt;br /&gt;
          opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0&lt;br /&gt;
          isig icanon iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 182:&lt;br /&gt;
&lt;br /&gt;
     iptables DNAT and SNAT. You have a webserver on 192.168.1.71. When people query this webserver, you want them&lt;br /&gt;
     to goto 192.168.1.81, with no indication that they are going to another web server. In fact, they always make&lt;br /&gt;
     their web hits to 192.168.1.71.&lt;br /&gt;
&lt;br /&gt;
     The following is the iptables commands:&lt;br /&gt;
&lt;br /&gt;
        $ echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
        $ iptables -t nat -A PREROUTING -d 192.168.1.71 -p tcp --dport 80 -j DNAT --to 192.168.1.81&lt;br /&gt;
        $ iptables -t nat -A POSTROUTING -d 192.168.1.81 -s 192.168.1.0/24 -p tcp --dport 80 -j SNAT --to 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
     Change 192.168.1.0/24 to whatever source you expect the web browser to come in on. Below is the tcpdump showing&lt;br /&gt;
     all traffic is relayed via 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
         [root@closet iptables]# tcpdump -nN port 80&lt;br /&gt;
&lt;br /&gt;
         17:34:58.790398 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: S 3620106373:3620106373(0) win 16384 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790465 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: S 3620106373:3620106373(0) win 16384 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790703 IP 192.168.1.81.80 &amp;gt; 192.168.1.71.1158: S 1973665156:1973665156(0) ack 3620106374 win 5840 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790720 IP 192.168.1.71.80 &amp;gt; 192.168.1.102.1158: S 1973665156:1973665156(0) ack 3620106374 win 5840 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790951 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: . ack 1 win 17520&lt;br /&gt;
         17:34:58.790965 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: . ack 1 win 17520&lt;br /&gt;
         17:34:58.791451 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: P 1:327(326) ack 1 win 17520&lt;br /&gt;
         17:34:58.791472 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: P 1:327(326) ack 1 win 17520&lt;br /&gt;
         17:34:58.791973 IP 192.168.1.81.80 &amp;gt; 192.168.1.71.1158: . ack 327 win 6432&lt;br /&gt;
&lt;br /&gt;
     Above the web client is on &amp;quot;192.168.1.102&amp;quot;. You can see that the 1st server &amp;quot;192.168.1.71&amp;quot; then goes out to&lt;br /&gt;
     the 2nd server &amp;quot;192.168.1.81&amp;quot; on the second line. The third line shows the 2nd server &amp;quot;192.168.1.81&amp;quot; responding to&lt;br /&gt;
     the 1st server, and the forth line passes this data back to the web client &amp;quot;192.168.1.102&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Note: You can save your current iptables setting with the following command:&lt;br /&gt;
&lt;br /&gt;
         $ iptables-save &amp;gt; iptables_store&lt;br /&gt;
&lt;br /&gt;
       The big advantage is that you can store the counters as well.&lt;br /&gt;
&lt;br /&gt;
         $ iptables-save -c &amp;gt; iptables_store_w_cnts&lt;br /&gt;
&lt;br /&gt;
       To restore the file, use the following:&lt;br /&gt;
&lt;br /&gt;
         $ iptables-restore -c &amp;lt; iptables_store_w_cnts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 183:&lt;br /&gt;
&lt;br /&gt;
     mailstats - display mail statistics. This file reads data from &amp;quot;/var/log/mail/statistics&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         [root@closet ~]# mailstats&lt;br /&gt;
         Statistics from Sat Jun 25 15:59:52 2005&lt;br /&gt;
          M   msgsfr  bytes_from   msgsto    bytes_to  msgsrej msgsdis msgsqur  Mailer&lt;br /&gt;
          4        1          2K        0          0K        0       0       0  esmtp&lt;br /&gt;
          9        0          0K        1          2K        0       0       0  local&lt;br /&gt;
         =====================================================================&lt;br /&gt;
          T        1          2K        1          2K        0       0       0&lt;br /&gt;
          C        1                    0                    0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 184:&lt;br /&gt;
&lt;br /&gt;
     Profiling C Applications - Assume you have the following program p1.c:&lt;br /&gt;
&lt;br /&gt;
         /* Program  p1.c */&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
         t1(int i)&lt;br /&gt;
         {&lt;br /&gt;
                 printf(&amp;quot;t1:%d\n&amp;quot;, i);&lt;br /&gt;
         }&lt;br /&gt;
        &lt;br /&gt;
         t2(int j)&lt;br /&gt;
         {&lt;br /&gt;
                 printf(&amp;quot;t2:%d\n&amp;quot;, j);&lt;br /&gt;
         }&lt;br /&gt;
        &lt;br /&gt;
         int main(void)&lt;br /&gt;
         {&lt;br /&gt;
                 int i, j;&lt;br /&gt;
        &lt;br /&gt;
                 for (i = 0; i &amp;lt; 5; ++i) {&lt;br /&gt;
                         t1(i);&lt;br /&gt;
                         for (j = 0; j &amp;lt; 2; ++j) {&lt;br /&gt;
                                 t2(j);&lt;br /&gt;
                         }&lt;br /&gt;
                 }&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
     Compile the program as follows:&lt;br /&gt;
&lt;br /&gt;
        $ gcc -pg -g -o p1 p1.c&lt;br /&gt;
        $ ./p1&lt;br /&gt;
        t1:0&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:1&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:2&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:3&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:4&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
&lt;br /&gt;
     Next, to get the profile graph.&lt;br /&gt;
&lt;br /&gt;
        $ gprof -p -b p1&lt;br /&gt;
        Flat profile:&lt;br /&gt;
        &lt;br /&gt;
        Each sample counts as 0.01 seconds.&lt;br /&gt;
         no time accumulated&lt;br /&gt;
        &lt;br /&gt;
          %   cumulative   self              self     total&lt;br /&gt;
         time   seconds   seconds    calls  Ts/call  Ts/call  name&lt;br /&gt;
          0.00      0.00     0.00       10     0.00     0.00  t2&lt;br /&gt;
          0.00      0.00     0.00        5     0.00     0.00  t1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Above note the 10 calls to t2 and 5 calls to t1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 185:&lt;br /&gt;
&lt;br /&gt;
     CDPATH - this is a bash variable like PATH that defines a search path&lt;br /&gt;
              for the cd command.&lt;br /&gt;
&lt;br /&gt;
     Suppose you have the following directory structure:&lt;br /&gt;
&lt;br /&gt;
             /home/chirico/stuff&lt;br /&gt;
                               |-- dirA&lt;br /&gt;
                               `-- dirB&lt;br /&gt;
&lt;br /&gt;
     Assume you define CDPATH as follows:&lt;br /&gt;
&lt;br /&gt;
             CDPATH=/home/chirico/stuff&lt;br /&gt;
&lt;br /&gt;
     Now, no matter what directory you are in if you use the cd command below&lt;br /&gt;
     you will automatically move to &amp;quot;/home/chirico/stuff/dirA&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             $ cd dirA&lt;br /&gt;
&lt;br /&gt;
     Note you could be in &amp;quot;/etc&amp;quot; and will move directly to &amp;quot;/home/chirico/stuff/dirA&amp;quot;.&lt;br /&gt;
     This command has the same format as PATH - multiple entries are separated by a colon.&lt;br /&gt;
     If the current directory contain a sub-directory dirA, then, it gets priority.&lt;br /&gt;
&lt;br /&gt;
     The following is part of my .bash_profile&lt;br /&gt;
&lt;br /&gt;
             CDPATH=/work/cpearls/src/posted_on_sf/:/work/souptonuts/documentation/:/home/chirico/deleteme/&lt;br /&gt;
             export PATH CVS_RSH EDITOR JAVA_HOME CDPATH&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 186:&lt;br /&gt;
&lt;br /&gt;
     Groups - add groups and users to groups. The following shows how to create the group &amp;quot;share&amp;quot;&lt;br /&gt;
              and add the user &amp;quot;chirico&amp;quot; to this group. The following should be done as root, and&lt;br /&gt;
              assumes the account &amp;quot;chirico&amp;quot; already exits.&lt;br /&gt;
&lt;br /&gt;
             $ groupadd share&lt;br /&gt;
             $ usermod -G share chirico&lt;br /&gt;
&lt;br /&gt;
     Note the change made to &amp;quot;/etc/group&amp;quot; below:&lt;br /&gt;
&lt;br /&gt;
             $ cat /etc/group|grep 'share'&lt;br /&gt;
             share:x:616:chirico&lt;br /&gt;
&lt;br /&gt;
     If the user chirico is currently logged in, he should run the following&lt;br /&gt;
     command to immediately have group &amp;quot;share&amp;quot; rights. Or, the next time he logs&lt;br /&gt;
     in he will have access to this group.&lt;br /&gt;
&lt;br /&gt;
             $ newgrp share&lt;br /&gt;
&lt;br /&gt;
     Reference the following (TIP 6, TIP 167).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 187:&lt;br /&gt;
&lt;br /&gt;
     oprofile - steps for running oprofile on Fedora.&lt;br /&gt;
&lt;br /&gt;
     Step 1:&lt;br /&gt;
&lt;br /&gt;
       Find out what version of the kernel you are running.&lt;br /&gt;
&lt;br /&gt;
           $ uname -a&lt;br /&gt;
           Linux closet.squeezel.com 2.6.12-1.1398_FC4 #1 Fri Jul 15 00:52:32 EDT 2005 i686 i686 i386 GNU/Linux&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 2:&lt;br /&gt;
&lt;br /&gt;
       Download the source in a chosen directory. Above, I'm running 2.6.12-1, but I'm going to go for 2.6.12.3, since&lt;br /&gt;
       it's a little later. You want the signed file as well.&lt;br /&gt;
&lt;br /&gt;
           $ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.12.3.tar.gz&lt;br /&gt;
           $ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.12.3.tar.gz.sign&lt;br /&gt;
&lt;br /&gt;
       Now, check the signature.&lt;br /&gt;
&lt;br /&gt;
           $ gpg --verify linux-2.6.12.3.tar.gz.sign linux-2.6.12.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 3:&lt;br /&gt;
&lt;br /&gt;
       Unpack the file.&lt;br /&gt;
&lt;br /&gt;
           $ tar -xzf linux-2.6.12.3.tar.gz&lt;br /&gt;
           $ cd cd linux-2.6.12.3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 4:&lt;br /&gt;
&lt;br /&gt;
       Copy the &amp;quot;.config&amp;quot; used to compile your previous kernel. You should find it&lt;br /&gt;
       in the following direcotry &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       Copy it to the linux-2.6.12.3 directory.&lt;br /&gt;
&lt;br /&gt;
           $ cp &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot; .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 5:&lt;br /&gt;
&lt;br /&gt;
       Run make as follows. It will ask for a few questions on &amp;quot;make oldconfig&amp;quot;. The&lt;br /&gt;
       make installs below will have to be done with root privileges.&lt;br /&gt;
&lt;br /&gt;
          $ make oldconfig&lt;br /&gt;
          $ make bzImage&lt;br /&gt;
          $ make modules&lt;br /&gt;
          $ make modules_install&lt;br /&gt;
          $ make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 6:&lt;br /&gt;
&lt;br /&gt;
       Edit the &amp;quot;/boot/grub/grub.conf&amp;quot; and set default = 0  as shown below in this&lt;br /&gt;
       file.&lt;br /&gt;
&lt;br /&gt;
            default=0&lt;br /&gt;
            timeout=5&lt;br /&gt;
            splashimage=(hd0,2)/grub/splash.xpm.gz&lt;br /&gt;
            hiddenmenu&lt;br /&gt;
            title Fedora Core (2.6.12.3)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.12.3 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.12.3.img&lt;br /&gt;
            title Fedora Core (2.6.12-1.1398_FC4)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.12-1.1398_FC4 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.12-1.1398_FC4.img&lt;br /&gt;
            title Fedora Core (2.6.11-1.1369_FC4)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.11-1.1369_FC4 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.11-1.1369_FC4.img&lt;br /&gt;
            title Other&lt;br /&gt;
                    rootnoverify (hd0,1)&lt;br /&gt;
                    chainloader +1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 7:&lt;br /&gt;
&lt;br /&gt;
       Shutdown with the restart option.&lt;br /&gt;
&lt;br /&gt;
           $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 8:&lt;br /&gt;
&lt;br /&gt;
       Run opcontrol. The commands below are done as root.  My kernel was compiled in the following&lt;br /&gt;
       directory &amp;quot;/home/kernel/linux-2.6.12.3/&amp;quot;, so I'll run opcontrol as follows:&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --vmlinux=/home/kernel/linux-2.6.12.3/vmlinux&lt;br /&gt;
&lt;br /&gt;
       Now start.&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --start&lt;br /&gt;
           Using 2.6+ OProfile kernel interface.&lt;br /&gt;
           Reading module info.&lt;br /&gt;
           Using log file /var/lib/oprofile/oprofiled.log&lt;br /&gt;
           Daemon started.&lt;br /&gt;
           Profiler running.&lt;br /&gt;
&lt;br /&gt;
       Shutdown opcontrol.&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --shutdown&lt;br /&gt;
&lt;br /&gt;
       Run report.&lt;br /&gt;
&lt;br /&gt;
           $ opreport&lt;br /&gt;
&lt;br /&gt;
           CPU: CPU with timer interrupt, speed 0 MHz (estimated)&lt;br /&gt;
           Profiling through timer interrupt&lt;br /&gt;
                     TIMER:0|&lt;br /&gt;
             samples|      %|&lt;br /&gt;
           ------------------&lt;br /&gt;
              156088 99.8746 vmlinux&lt;br /&gt;
                  60  0.0384 libc-2.3.5.so&lt;br /&gt;
                  30  0.0192 oprofiled&lt;br /&gt;
                  23  0.0147 libcrypto.so.0.9.7f&lt;br /&gt;
                  13  0.0083 bash&lt;br /&gt;
                  12  0.0077 screen&lt;br /&gt;
                  10  0.0064 sshd&lt;br /&gt;
                   9  0.0058 ssh&lt;br /&gt;
                   6  0.0038 ip_tables&lt;br /&gt;
                   6  0.0038 libncurses.so.5.4&lt;br /&gt;
                   5  0.0032 b44&lt;br /&gt;
                   5  0.0032 ext3&lt;br /&gt;
                   5  0.0032 ld-2.3.5.so&lt;br /&gt;
                   4  0.0026 ip_conntrack&lt;br /&gt;
                   4  0.0026 jbd&lt;br /&gt;
                   2  0.0013 grep&lt;br /&gt;
                   1 6.4e-04 libdns.so.20.0.2&lt;br /&gt;
                   1 6.4e-04 libisc.so.9.1.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Reference the following for more documentation:&lt;br /&gt;
             http://oprofile.sourceforge.net/doc/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 188:&lt;br /&gt;
&lt;br /&gt;
     cyrus-imapd with Postfix using sasldb for authentication. For this example&lt;br /&gt;
     the server is tape.squeezel.com and the user is chirico.&lt;br /&gt;
&lt;br /&gt;
        Step 1:&lt;br /&gt;
        &lt;br /&gt;
                   $ yum install cyrus-imapd&lt;br /&gt;
                   $ yum install cyrus-imapd-utils&lt;br /&gt;
        &lt;br /&gt;
            You need &amp;quot;cyrus-imapd-utils&amp;quot; for cyradm.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 2:&lt;br /&gt;
        &lt;br /&gt;
          Edit /etc/imapd.conf&lt;br /&gt;
        &lt;br /&gt;
               configdirectory: /var/lib/imap&lt;br /&gt;
               partition-default: /var/spool/imap&lt;br /&gt;
               admins: cyrus&lt;br /&gt;
               sievedir: /var/lib/imap/sieve&lt;br /&gt;
               sendmail: /usr/sbin/sendmail&lt;br /&gt;
               hashimapspool: true&lt;br /&gt;
               # Chirico Commented the below line&lt;br /&gt;
               # sasl_pwcheck_method: saslauthd&lt;br /&gt;
               # Because using sasldb&lt;br /&gt;
               sasl_pwcheck_method: auxprop&lt;br /&gt;
               sasl_auxprop_plugin: sasldb&lt;br /&gt;
               #  Chirico end change&lt;br /&gt;
               sasl_mech_list: PLAIN&lt;br /&gt;
               tls_cert_file: /usr/share/ssl/certs/cyrus-imapd.pem&lt;br /&gt;
               tls_key_file: /usr/share/ssl/certs/cyrus-imapd.pem&lt;br /&gt;
               tls_ca_file: /usr/share/ssl/certs/ca-bundle.crt&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 3:&lt;br /&gt;
        &lt;br /&gt;
           Create a user and password:&lt;br /&gt;
        &lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` cyrus&lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` chirico&lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` allmail&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
           This will automatically create the file /etc/sasldb2. But look&lt;br /&gt;
           at the default rights, assuming you ran saslpasswd2 as root:&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /etc/sasldb2&lt;br /&gt;
                 -rw-r-----  1 root root 12288 Jul 31 09:50 /etc/sasldb2&lt;br /&gt;
        &lt;br /&gt;
           We need to correct this in step 4.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 4:&lt;br /&gt;
        &lt;br /&gt;
                 $ chown root.mail /etc/sasldb2&lt;br /&gt;
                 $ ls -l /etc/sasldb2&lt;br /&gt;
                 -rw-r-----  1 root mail 12288 Jul 31 09:50 /etc/sasldb2&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 5:&lt;br /&gt;
        &lt;br /&gt;
            Update &amp;quot;/etc/postfix/main.cf&amp;quot;. Note in /etc/imapd.conf the configdirectory&lt;br /&gt;
            points to /var/lib/imap, and if I look at this directory I see the&lt;br /&gt;
            socket directory. However, after staring /etc/init.d/cyrus-imapd  there&lt;br /&gt;
            will be a socket file &amp;quot;/var/lib/imap/socket/lmtp&amp;quot;. (See step 6).&lt;br /&gt;
        &lt;br /&gt;
                  mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp&lt;br /&gt;
                  mailbox_transport = cyrus&lt;br /&gt;
        &lt;br /&gt;
            Restart postfix.&lt;br /&gt;
        &lt;br /&gt;
                  /etc/init.d/postfix restart&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 6:&lt;br /&gt;
&lt;br /&gt;
            Start cyrus-imapd and look for the socket file.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
                   $ /etc/init.d/cyrus-imapd restart&lt;br /&gt;
                   Shutting down cyrus-imapd:                                 [  OK  ]&lt;br /&gt;
                   Starting cyrus-imapd: preparing databases... done.         [  OK  ]&lt;br /&gt;
        &lt;br /&gt;
            Now you should see the lmtp file:&lt;br /&gt;
        &lt;br /&gt;
                   $ ls -l /var/lib/imap/socket/lmtp&lt;br /&gt;
                   srwxrwxrwx  1 root root 0 Jul 31 10:04 /var/lib/imap/socket/lmtp&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 7:&lt;br /&gt;
        &lt;br /&gt;
            Add users. Note, you may have to go back to step 3 to add them to /etc/sasldb2&lt;br /&gt;
            as well.&lt;br /&gt;
        &lt;br /&gt;
                   $ su - cyrus&lt;br /&gt;
                   $ cyradm tape.squeezel.com&lt;br /&gt;
                   tape.squeezel.com&amp;gt; cm user.chirico&lt;br /&gt;
                   tape.squeezel.com&amp;gt; quit&lt;br /&gt;
        &lt;br /&gt;
            Now got back as root, and check that everything was created correctly.&lt;br /&gt;
        &lt;br /&gt;
                   $ ls /var/spool/imap/c/user/&lt;br /&gt;
                   total 8&lt;br /&gt;
                   drwx------  2 cyrus mail 4096 Jul 31 10:21 chirico&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 8:&lt;br /&gt;
        &lt;br /&gt;
             Run a mail test. We'll do this as root to the chirico account.&lt;br /&gt;
        &lt;br /&gt;
                   $ mail -s 'First test'  chirico&lt;br /&gt;
                   first test&lt;br /&gt;
                   .&lt;br /&gt;
        &lt;br /&gt;
             Now, still as root check the maillog. Normally everything should work.&lt;br /&gt;
        &lt;br /&gt;
                  $ tail /var/log/maillog&lt;br /&gt;
        &lt;br /&gt;
             However, I got the following error below.&lt;br /&gt;
&lt;br /&gt;
                     Jul 31 10:29:03 tape postfix/cleanup[30124]: AE7CB1B34A4: message-id=&amp;lt;20050731142903.AE7CB1B34A4@tape.squeezel.com&amp;gt;&lt;br /&gt;
                     Jul 31 10:29:03 tape postfix/qmgr[30120]: AE7CB1B34A4: from=&amp;lt;root@tape.squeezel.com&amp;gt;, size=315, nrcpt=1 (queue active)&lt;br /&gt;
                     Jul 31 10:29:03 tape pipe[30128]: fatal: pipe_comand: execvp /cyrus/bin/deliver: No such file or directory&lt;br /&gt;
&lt;br /&gt;
             If you get a similiar error, you may need to adjust the settting in /etc/postfix/master.cf&lt;br /&gt;
        &lt;br /&gt;
                 # This is the problem in /etc/postfix/master.cf&lt;br /&gt;
                 cyrus     unix  -       n       n       -       -       pipe&lt;br /&gt;
                   user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}&lt;br /&gt;
        &lt;br /&gt;
             My deliver file is the following&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
                 -rwxr-xr-x  1 root root 846228 Apr  4 18:59 /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
        &lt;br /&gt;
             So I need to change my /etc/postfix/master.cf as follows:&lt;br /&gt;
        &lt;br /&gt;
                 # Fix because by deliver file is under  /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
                 cyrus     unix  -       n       n       -       -       pipe&lt;br /&gt;
                   user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -r ${sender} -m ${extension} ${user}&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
             If changes were needed, like I had to do, restart postfix&lt;br /&gt;
        &lt;br /&gt;
                 $ /etc/init.d/postfix restart&lt;br /&gt;
        &lt;br /&gt;
             Now, if everything works, you should start to see numbers in the spool directory like &amp;quot;1.&amp;quot; and&lt;br /&gt;
             &amp;quot;2.&amp;quot;.&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /var/spool/imap/c/user/chirico/&lt;br /&gt;
                 total 40&lt;br /&gt;
                 -rw-------  1 cyrus mail  545 Jul 31 10:44 1.&lt;br /&gt;
                 -rw-------  1 cyrus mail  547 Jul 31 10:45 2.&lt;br /&gt;
                 -rw-------  1 cyrus mail 1276 Jul 31 10:45 cyrus.cache&lt;br /&gt;
                 -rw-------  1 cyrus mail  153 Jul 31 10:21 cyrus.header&lt;br /&gt;
                 -rw-------  1 cyrus mail  196 Jul 31 10:45 cyrus.index&lt;br /&gt;
&lt;br /&gt;
        Step 9:&lt;br /&gt;
        &lt;br /&gt;
             Local firewall.&lt;br /&gt;
        &lt;br /&gt;
                 # imap&lt;br /&gt;
                iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 143 -j ACCEPT&lt;br /&gt;
                iptables -A INPUT -p tcp -s 192.168.1.0/24  --dport 143 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        Step 10:&lt;br /&gt;
        &lt;br /&gt;
             Configure cyrus-imapd to start for run-level 3 and 5.&lt;br /&gt;
&lt;br /&gt;
                 # chkconfig --level 35 cyrus-imapd on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       HINTS - &lt;br /&gt;
&lt;br /&gt;
        Something to watch out for:&lt;br /&gt;
&lt;br /&gt;
              Something to watch out for: If a user creates a .forward file in their shell account with the&lt;br /&gt;
              following entry, then, mail will not get mail relayed to cyrus.&lt;br /&gt;
&lt;br /&gt;
                  &amp;quot;|exec /usr/bin/procmail&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             The /etc/maillog will show something like this:&lt;br /&gt;
&lt;br /&gt;
                    to=&amp;lt;chirico@squeezel.squeezel.com&amp;gt;, orig_to=&amp;lt;chirico&amp;gt;, relay=local, delay=0,&lt;br /&gt;
                          status=sent (delivered to command: exec /usr/bin/procmail)&lt;br /&gt;
&lt;br /&gt;
             Remove the &amp;quot;.forward&amp;quot; file from their home directory and you'll get the following:&lt;br /&gt;
&lt;br /&gt;
                    to=&amp;lt;chirico@squeezel.squeezel.com&amp;gt;, relay=cyrus, delay=0,&lt;br /&gt;
                          status=sent (squeezel.squeezel.com)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              mutt with IMAP?  (See TIP 190)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 189:&lt;br /&gt;
&lt;br /&gt;
     expand - convert tabs to spaces in a file.&lt;br /&gt;
&lt;br /&gt;
             $ expand How_to_Linux_and_Open_Source.txt &amp;gt; notabs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 190:&lt;br /&gt;
&lt;br /&gt;
     mutt with imap - assume you have setup imap (see tip 188). Now how do you configure&lt;br /&gt;
                      your &amp;quot;.muttrc&amp;quot; file to automatically connect, securely to the IMAP server?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       &lt;br /&gt;
     Below is an example of my &amp;quot;.muttrc&amp;quot; file. For this example, assume my password is &amp;quot;S0m3paSSw0r9&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             $ cat .muttrc&lt;br /&gt;
             set spoolfile = &amp;quot;imaps://chirico:S0m3paSSw0r9@squeezel.squeezel.com/&lt;br /&gt;
             set imap_force_ssl=yes&lt;br /&gt;
             set certificate_file=~/.mutt/certificates/72d31154.0&lt;br /&gt;
&lt;br /&gt;
     Now, you want to copy the certificate as a &amp;quot;file.pem&amp;quot; and run &amp;quot;c_rehash&amp;quot; to convert this&lt;br /&gt;
     file to a number. See the article. See the following article on how to do this under the &lt;br /&gt;
     fetchmail section.&lt;br /&gt;
&lt;br /&gt;
          http://souptonuts.sourceforge.net/postfix_tutorial.html&lt;br /&gt;
&lt;br /&gt;
     This is a quick summary of creating this key.&lt;br /&gt;
&lt;br /&gt;
             $ openssl s_client -connect squeezel.squeezel.com:995 -showcerts &amp;gt; file.pem&lt;br /&gt;
             $ c_rehash ~/.mutt/certificates&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 191:&lt;br /&gt;
&lt;br /&gt;
     Apache - CGI scripts.  There are two ways to enable CGI scripts. The second method is the&lt;br /&gt;
              prefered method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           First way, the easy way. Look for the &amp;quot;http.conf&amp;quot; file. On Fedora Core, this file can be&lt;br /&gt;
           found under &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;. Edit this file as follows to make &lt;br /&gt;
           &amp;quot;http://squeezel.squeezel.com/chirico-cgi/&amp;quot; execute scripts.&lt;br /&gt;
&lt;br /&gt;
                     ScriptAlias /chirico-cgi/ &amp;quot;/home/chirico/cgi-bin/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           Second way, the better way. Instead of doing the above, make the following change in &lt;br /&gt;
           &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                     &amp;lt;Directory /home/chirico/cgi-bin&amp;gt;&lt;br /&gt;
                      Options +ExecCGI&lt;br /&gt;
                      SetHandler chirico-cgi&lt;br /&gt;
                     &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Running a test script. Now copy the following test script into the directory &amp;quot;/home/chirico/cgi-bin&amp;quot;&lt;br /&gt;
        and change the rights to execute for the user running this.&lt;br /&gt;
&lt;br /&gt;
                  #!/bin/sh&lt;br /&gt;
                  # Save as test.cgi&lt;br /&gt;
                  #  chown apache.apache test.cgi&lt;br /&gt;
                  #  chmod 700 test.cgi&lt;br /&gt;
                  echo &amp;quot;Content-Type: text/html&amp;quot;&lt;br /&gt;
                  echo&lt;br /&gt;
                  echo &amp;quot;Hello world from user &amp;lt;b&amp;gt;`whoami`&amp;lt;/b&amp;gt;! &amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 192:&lt;br /&gt;
&lt;br /&gt;
     Bash - using getopts for your bash scripts.&lt;br /&gt;
&lt;br /&gt;
                   #!/bin/bash&lt;br /&gt;
                   while getopts &amp;quot;ab:cd:&amp;quot; Option&lt;br /&gt;
                   # b and d take arguments&lt;br /&gt;
                   #&lt;br /&gt;
                   do&lt;br /&gt;
                     case $Option in&lt;br /&gt;
                       a) echo -e &amp;quot;a = $OPTIND&amp;quot;;;&lt;br /&gt;
                       b) echo -e &amp;quot;b = $OPTIND $OPTARG&amp;quot;;;&lt;br /&gt;
                       c) echo -e &amp;quot;c = $OPTIND&amp;quot;;;&lt;br /&gt;
                       d) echo -e &amp;quot;d = $OPTIND $OPTARG&amp;quot;;;&lt;br /&gt;
                    esac&lt;br /&gt;
                  done&lt;br /&gt;
                  shift $(($OPTIND - 1))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 193:&lt;br /&gt;
&lt;br /&gt;
     Sieve - creating sieve recipes with &amp;quot;sieveshell&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     The following sieve script put all jefferson.edu mail into the &lt;br /&gt;
     folder jefferson. This assumes that I have already created the IMP &lt;br /&gt;
     directory, or mail box (INBOX.jefferson), which can be done in mutt &lt;br /&gt;
     with the &amp;quot;C&amp;quot; command. Below is an example of finding &amp;quot;jefferson.edu&amp;quot;&lt;br /&gt;
     anywhere in the header. &lt;br /&gt;
&lt;br /&gt;
         # This is a file named jefferson.siv&lt;br /&gt;
         require [&amp;quot;fileinto&amp;quot;];&lt;br /&gt;
         if header :contains &amp;quot;Received&amp;quot; &amp;quot;from jefferson.edu&amp;quot; {&lt;br /&gt;
           fileinto &amp;quot;INBOX.jefferson&amp;quot;;&lt;br /&gt;
           stop;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
     Now, from the command propt execute &amp;quot;sieveshell&amp;quot; with the hostname of the&lt;br /&gt;
     imap server. My server is squeezel.squeezel.com, so I would execute the &lt;br /&gt;
     following:&lt;br /&gt;
&lt;br /&gt;
          $ sieveshell squeezel.squeezel.com&lt;br /&gt;
          connecting to squeezel.squeezel.com&lt;br /&gt;
          Please enter your password:****&lt;br /&gt;
          &amp;gt; put jefferson.siv&lt;br /&gt;
          &amp;gt; activate jefferson.siv&lt;br /&gt;
          &amp;gt; list&lt;br /&gt;
          jefferson.siv  &amp;lt;- active script&lt;br /&gt;
          &amp;gt; quit&lt;br /&gt;
&lt;br /&gt;
     Note the put brings in the script. And you need to activiate it.&lt;br /&gt;
&lt;br /&gt;
     You can activate a sieve script for any user on your system if you are&lt;br /&gt;
     root. This is an example of activating a script for user chirico. Assume&lt;br /&gt;
     below the root prompt is &amp;quot;#&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          # sieveshell -a chirico -u chirico squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
     You can also automate everything from a bash script. But note after&lt;br /&gt;
     the -e the commands, and not a file with the commands, follows within&lt;br /&gt;
     quotes. This is the script I use for my home system.&lt;br /&gt;
&lt;br /&gt;
         #!/bin/bash&lt;br /&gt;
         sieveshell -a chirico -u chirico -e 'deactivate&lt;br /&gt;
         delete chirico.siv&lt;br /&gt;
         put chirico.siv&lt;br /&gt;
         activate chirico.siv&lt;br /&gt;
         list&lt;br /&gt;
         '  squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     References:&lt;br /&gt;
         http://wiki.fastmail.fm/index.php/SieveRecipes&lt;br /&gt;
         http://www.cyrusoft.com/sieve/#documents&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 194:&lt;br /&gt;
&lt;br /&gt;
     emacs - editing files remotely with tramp. Tramp comes with the latest version of emacs.&lt;br /&gt;
             That means if you're using Fedora core 4, with emacs, you have tramp. This is &lt;br /&gt;
             ideal for editing files on remote computers that do not use emacs.&lt;br /&gt;
&lt;br /&gt;
             Edit the &amp;quot;.emacs&amp;quot; file and add the following line:&lt;br /&gt;
&lt;br /&gt;
                 (require 'tramp)&lt;br /&gt;
                 (setq tramp-default-method &amp;quot;scp&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
             Now, to edit a file on computer tape.squeezel.com (C-x, C-f) and&lt;br /&gt;
             enter the following in Find file:&lt;br /&gt;
&lt;br /&gt;
                 Find file:/chirico@tape.squeezel.com:test.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             References:&lt;br /&gt;
&lt;br /&gt;
                    http://savannah.gnu.org/projects/tramp/&lt;br /&gt;
&lt;br /&gt;
             &lt;br /&gt;
&lt;br /&gt;
TIP 195:&lt;br /&gt;
&lt;br /&gt;
     trusted X11 forwarding - running gnome and KDE both on one screen, at the same&lt;br /&gt;
             time securely. The following assumes gnome is running on the current&lt;br /&gt;
             computer and &amp;quot;closet.squeezel.com&amp;quot; has KDE&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y  closet.squeezel.com&lt;br /&gt;
              $ startkde&lt;br /&gt;
&lt;br /&gt;
          Or assume you want to run gnome on &amp;quot;closet.squeezel.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y  closet.squeezel.com&lt;br /&gt;
              $ gnome-session&lt;br /&gt;
&lt;br /&gt;
          By default Fedora Core allows ForwardX11 over ssh. Note you want to use&lt;br /&gt;
          the -Y option above and NOT -X. &lt;br /&gt;
&lt;br /&gt;
          Suppose you want a remote &amp;quot;gnome-session&amp;quot; on ctl-alt-F12. Below is an &lt;br /&gt;
          example of getting the remote computer closet.squeezel.com, and you&lt;br /&gt;
          can still have the above configuration.&lt;br /&gt;
&lt;br /&gt;
          First you must allow magic cookies for each server connection.&lt;br /&gt;
             &lt;br /&gt;
              $ MCOOKIE=$(mcookie)&lt;br /&gt;
              $ xauth add $(hostname)/unix:1 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
              $ xauth add localhost/unix:1 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
  &lt;br /&gt;
          Again, note that you have to add this for EACH connection. So if you wanted 2 as well&lt;br /&gt;
&lt;br /&gt;
              $ MCOOKIE=$(mcookie)&lt;br /&gt;
              $ xauth add $(hostname)/unix:2 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
              $ xauth add localhost/unix:2 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
&lt;br /&gt;
          On squeezel.squeezel.com create a new xterm. If :1 is take below&lt;br /&gt;
          try :2. The vt12 is for switching to ctl-alt-F12.&lt;br /&gt;
&lt;br /&gt;
              $ xinit -- :1 vt12&lt;br /&gt;
&lt;br /&gt;
          Note, if you do not add the above cookies, you will get the follow error:&lt;br /&gt;
         &lt;br /&gt;
               Xlib: connection to &amp;quot;:1.0&amp;quot; refused by server&lt;br /&gt;
               Xlib: No protocol specified&lt;br /&gt;
&lt;br /&gt;
          The screen may be hard to read. At this point ssh -Y to the remote computer.&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y closet.squeezel.com&lt;br /&gt;
              $ gnome-session&lt;br /&gt;
&lt;br /&gt;
          Yes, you will get errors about sound and some custom drivers is the remove &lt;br /&gt;
          computer has different hardware. After is loads, you can switch back and&lt;br /&gt;
          forth between session with (ctl-alt-F12)  and (ctl-alt-F7)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 196:&lt;br /&gt;
&lt;br /&gt;
     Suspend ssh session - you have just sshed into a computer &amp;quot;ssh -l user example.com&amp;quot;, and you&lt;br /&gt;
          want to get back to the terminal prompt of the computer you started with. Escapte, by &lt;br /&gt;
          default with ssh is &amp;quot;~&amp;quot;, so enter &amp;quot;~&amp;quot; followed by &amp;quot;ctl-z&amp;quot; to suspend.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 197:&lt;br /&gt;
&lt;br /&gt;
     Quick way to send a text file &lt;br /&gt;
&lt;br /&gt;
              $ sendmail -f mike.chirico@gmail.com mchirico@comcast.net &amp;lt; /etc/fstab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 198:&lt;br /&gt;
&lt;br /&gt;
     size - determining the size of the text segment, data segment, and &amp;quot;bss&amp;quot; or uninitialized data segment.&lt;br /&gt;
&lt;br /&gt;
              $ size /bin/sh /bin/bash&lt;br /&gt;
               text        data     bss     dec     hex filename&lt;br /&gt;
              586946      22444   18784  628174   995ce /bin/sh&lt;br /&gt;
              586946      22444   18784  628174   995ce /bin/bash&lt;br /&gt;
&lt;br /&gt;
          Note above that &amp;quot;/bin/sh&amp;quot; and &amp;quot;/bin/bash&amp;quot; have equal text,data and bss numbers. It's&lt;br /&gt;
          highly likely that these are the same programs.&lt;br /&gt;
&lt;br /&gt;
              $ ls -l /bin/sh&lt;br /&gt;
               lrwxrwxrwx  1 root root 4 Jan 14  2005 /bin/sh -&amp;gt; bash&lt;br /&gt;
&lt;br /&gt;
          Yep, it's the same program. Here's a further definition of each segment.&lt;br /&gt;
&lt;br /&gt;
              Text segment: The machine instructions that the CPU executes. This is usually&lt;br /&gt;
                            read only and sharable.&lt;br /&gt;
&lt;br /&gt;
              Data segment: Contains initialized variables in a program. You also know these&lt;br /&gt;
                            as declarations and definitions.&lt;br /&gt;
&lt;br /&gt;
                               int max = 200;&lt;br /&gt;
&lt;br /&gt;
              Uninitialized data segment: Think of this as a declaration only, or data that&lt;br /&gt;
                            is only initialized by the kernel to arithmetic 0 or null pointers&lt;br /&gt;
                            before program execution.&lt;br /&gt;
&lt;br /&gt;
                               char s[10];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 199:&lt;br /&gt;
&lt;br /&gt;
     Using the at command.&lt;br /&gt;
&lt;br /&gt;
       Below is a simple example if running the ls command at 11:42am that&lt;br /&gt;
       will send mail -m to the user that executed it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       We'll execute job1 defined as follows and set to be executable. &lt;br /&gt;
&lt;br /&gt;
           $ cat ./job1&lt;br /&gt;
           #!/bin/bash&lt;br /&gt;
           date &amp;gt;&amp;gt; /tmp/job1&lt;br /&gt;
&lt;br /&gt;
       The at command is listed below. For queue &amp;quot;-q&amp;quot; names you can only&lt;br /&gt;
       specify one letter. Here we're using x. The letter determines the&lt;br /&gt;
       priority with &amp;quot;a&amp;quot; the highest.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x  -f ./job1 -m  11:54am&lt;br /&gt;
           job 3 at 2005-10-04 11:54&lt;br /&gt;
&lt;br /&gt;
       Now, if you execute the atq command, you'll get the following.&lt;br /&gt;
&lt;br /&gt;
           $ atq&lt;br /&gt;
           3       2005-10-04 11:54 x chirico&lt;br /&gt;
&lt;br /&gt;
       It's also possible to execute jobs at the command line entering&lt;br /&gt;
       a ctl-d at the end of the input.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x  -m 12:08pm&lt;br /&gt;
           at&amp;gt; ls -l&lt;br /&gt;
           at&amp;gt; who&lt;br /&gt;
           at&amp;gt; date&lt;br /&gt;
           at&amp;gt; ^D&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Or for a job to execute 1 minute from now.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x -m `date -d '1 minute' +&amp;quot;%H:%M&amp;quot;`&lt;br /&gt;
           at&amp;gt; ls -l&lt;br /&gt;
           at&amp;gt; date&lt;br /&gt;
     &lt;br /&gt;
&lt;br /&gt;
     Important points: The atd daemon must be running. To check if&lt;br /&gt;
      it's running do the following:&lt;br /&gt;
&lt;br /&gt;
            $ /etc/init.d/atd status&lt;br /&gt;
&lt;br /&gt;
      Also, if there is an /etc/at.allow file, then only users in that&lt;br /&gt;
      file will be allowed to execute at.&lt;br /&gt;
&lt;br /&gt;
      If /etc/at.deny exists but is empty and there is no /etc/at.allow,&lt;br /&gt;
      then, everyone can execute the at command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 200:&lt;br /&gt;
&lt;br /&gt;
     lsusb - command will display all USB buses and all devices connected.&lt;br /&gt;
&lt;br /&gt;
        $ lsusb&lt;br /&gt;
        Bus 005 Device 003: ID 413c:2010 Dell Computer Corp.&lt;br /&gt;
        Bus 005 Device 002: ID 413c:1003 Dell Computer Corp.&lt;br /&gt;
        Bus 005 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 004 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 003 Device 003: ID 0fc5:1227 Delcom Engineering&lt;br /&gt;
        Bus 003 Device 002: ID 046d:c016 Logitech, Inc. Optical Mouse&lt;br /&gt;
        Bus 003 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 002 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 001 Device 001: ID 0000:0000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 201:&lt;br /&gt;
&lt;br /&gt;
     Memory fragmentation - if you suspect workload memory fragmentation issues&lt;br /&gt;
     and you want to monitor the current state of you system, then, consider&lt;br /&gt;
     looking at the output from /proc/buddyinfo on recent kernels.&lt;br /&gt;
&lt;br /&gt;
        $ cat /proc/buddyinfo&lt;br /&gt;
      Node 0, zone      DMA    541    218     42      2      0      0      0      1      1      1      0 &lt;br /&gt;
      Node 0, zone   Normal   2508   2614     52      1      5      5      0      1      1      1      0 &lt;br /&gt;
      Node 0, zone  HighMem      0      1      3      0      1      0      0      0      0      0      0 &lt;br /&gt;
&lt;br /&gt;
     The following definition is taken from  ./Documentation/filesystems/proc.txt in the &lt;br /&gt;
     Linux kernel source.&lt;br /&gt;
&lt;br /&gt;
       Each column represents the number of pages of a certain order which are&lt;br /&gt;
       available.  In this case, there are 0 chunks of 2^0*PAGE_SIZE available in&lt;br /&gt;
       ZONE_DMA, 4 chunks of 2^1*PAGE_SIZE in ZONE_DMA, 101 chunks of 2^4*PAGE_SIZE&lt;br /&gt;
       available in ZONE_NORMAL, etc...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 202:&lt;br /&gt;
&lt;br /&gt;
     arp - Linux ARP kernel moduel.  This command implements the Address Resolution Protocol.&lt;br /&gt;
&lt;br /&gt;
     This is an example of the command.&lt;br /&gt;
&lt;br /&gt;
        $ arp&lt;br /&gt;
        Address                  HWtype  HWaddress           Flags Mask            Iface&lt;br /&gt;
        tape.squeezel.com        ether   00:50:DA:60:5B:AD   C                     eth0&lt;br /&gt;
        squeezel.squeezel.com    ether   00:11:11:8A:BE:3F   C                     eth0&lt;br /&gt;
        gw.squeezel.com          ether   00:0F:66:47:15:73   C                     eth0&lt;br /&gt;
&lt;br /&gt;
       &lt;br /&gt;
TIP 203:&lt;br /&gt;
&lt;br /&gt;
     dbench - performance monitoring. &lt;br /&gt;
&lt;br /&gt;
     So, how does your system react when the load average is above 600. Have you even seen a &lt;br /&gt;
     computer with a load average of 600? Well, this could be your chance. &lt;br /&gt;
&lt;br /&gt;
         Reference: http://freshmeat.net/projects/dbench/&lt;br /&gt;
&lt;br /&gt;
     The following gives a load average of 10 on my system.&lt;br /&gt;
&lt;br /&gt;
        $ dbench 34&lt;br /&gt;
&lt;br /&gt;
     If you want a higher load, just increase the number.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 204:&lt;br /&gt;
&lt;br /&gt;
     /etc guide - a listing of common files in the /etc directory.&lt;br /&gt;
&lt;br /&gt;
        /etc/exports: this file is used to configure NFS.&lt;br /&gt;
&lt;br /&gt;
        /etc/ftpusers: the users on your system who are restricted from FTP login.&lt;br /&gt;
&lt;br /&gt;
        /etc/motd: message of the day, which users see after login.&lt;br /&gt;
&lt;br /&gt;
        /etc/named.conf: DNS config file.&lt;br /&gt;
&lt;br /&gt;
        /etc/profile: common user information.&lt;br /&gt;
&lt;br /&gt;
        /etc/inittab: this file contains runlevel start information.&lt;br /&gt;
&lt;br /&gt;
        /etc/services: the services and their respective ports.&lt;br /&gt;
&lt;br /&gt;
        /etc/shells: this contains the names of all shells installed on the system.&lt;br /&gt;
&lt;br /&gt;
        /etc/passwd: this file contains user information.&lt;br /&gt;
&lt;br /&gt;
        /etc/group: security group rights.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
TIP 205: &lt;br /&gt;
&lt;br /&gt;
     logger - is a bash command utility for writing to /var/log/messages or the&lt;br /&gt;
            other files defined in /etc/syslog.conf.&lt;br /&gt;
&lt;br /&gt;
            $ logger -t TEST more of a test here&lt;br /&gt;
&lt;br /&gt;
         This is what shows up in /var/log/messages&lt;br /&gt;
  &lt;br /&gt;
            Oct 28 07:15:50 squeezel TEST: more of a test here&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
TIP 206: &lt;br /&gt;
&lt;br /&gt;
     accton, lastcomm - accouting on and last command. This is &lt;br /&gt;
         a way to monitor users on your system. As root, you &lt;br /&gt;
         would implement this as follows:&lt;br /&gt;
&lt;br /&gt;
           $ accton -h&lt;br /&gt;
            Usage: accton [-hV] [file]&lt;br /&gt;
            [--help] [--version]&lt;br /&gt;
&lt;br /&gt;
            The system's default process accounting file is /var/account/pacct.&lt;br /&gt;
&lt;br /&gt;
         Note the default file location is /var/account/pacct so we'll turn&lt;br /&gt;
         it on system wide with the following command.&lt;br /&gt;
&lt;br /&gt;
           $ accton /var/account/pacct&lt;br /&gt;
&lt;br /&gt;
         Now take a look at this file. It will grow. To see command that&lt;br /&gt;
         are executed, use the lastcomm command.&lt;br /&gt;
&lt;br /&gt;
           $ lastcomm&lt;br /&gt;
&lt;br /&gt;
         The above command gives output for all users. To get the data&lt;br /&gt;
         for user &amp;quot;chirico&amp;quot; execute the following command:&lt;br /&gt;
&lt;br /&gt;
           $ lastcomm --user chirico&lt;br /&gt;
&lt;br /&gt;
         You can also get a summary of commands with sa.&lt;br /&gt;
&lt;br /&gt;
           [chirico@big ~]$ sa&lt;br /&gt;
           30       5.23re       0.00cp    10185k&lt;br /&gt;
           11       4.83re       0.00cp     8961k   ***other&lt;br /&gt;
            8       0.13re       0.00cp    19744k   nagios*&lt;br /&gt;
            4       0.00re       0.00cp     2542k   automount*&lt;br /&gt;
            3       0.00re       0.00cp      680k   sa&lt;br /&gt;
            2       0.13re       0.00cp    17424k   check_ping&lt;br /&gt;
            2       0.13re       0.00cp      978k   ping&lt;br /&gt;
&lt;br /&gt;
         To turn off accounting, execute accton without a filename.&lt;br /&gt;
&lt;br /&gt;
           $ accton&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 207:&lt;br /&gt;
&lt;br /&gt;
     CPU Temperature on a laptop. The following is the temperature&lt;br /&gt;
       of my Dell laptop. &lt;br /&gt;
&lt;br /&gt;
           $ cat /proc/acpi/thermal_zone/THM/temperature&lt;br /&gt;
           temperature:             58 C&lt;br /&gt;
&lt;br /&gt;
      &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 208:&lt;br /&gt;
&lt;br /&gt;
     script -f with mkfifo to allow another user to view what you type&lt;br /&gt;
          in real-time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Step 1.  Create a fifo (first in first out) file that the other&lt;br /&gt;
              user can view. For this example create the file /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
               [chirico@laptop ~]$ mkfifo /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
        Step 2.  Have the second user, voyeur user, cat this file. Output will block&lt;br /&gt;
              for them until you complete step 3. The other user, voyer,&lt;br /&gt;
              is executing the command below.&lt;br /&gt;
 &lt;br /&gt;
               [voyeur@laptop ~]$ cat /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
        Step 3.  The original user runs the following command.&lt;br /&gt;
&lt;br /&gt;
               [chirico@laptop ~]$ script -f  /tmp/scriptout&lt;br /&gt;
               Script started, file is /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
             Now anything typed, including a vi session, will be displayed to the&lt;br /&gt;
             voyeur user in step 2. &lt;br /&gt;
&lt;br /&gt;
        See TIP 46.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 209:&lt;br /&gt;
&lt;br /&gt;
     fsck forced on next reboot.  To do this, as root issue the following commands.&lt;br /&gt;
&lt;br /&gt;
            $ cd /&lt;br /&gt;
            $ touch forcefsck&lt;br /&gt;
&lt;br /&gt;
          Now reboot the system, and when it comes up fsck will be forced on the system.&lt;br /&gt;
&lt;br /&gt;
            $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 210:&lt;br /&gt;
&lt;br /&gt;
     /dev/random and /dev/urandom differ in their random generating properties. /dev/random&lt;br /&gt;
        only returns bytes when enough noise has been generated from the entropy pool. In&lt;br /&gt;
        contrast /dev/urandom will always return bytes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference: http://sourceforge.net/direct-dl/mchirico/cpearls/simple_but_common.tar.gz (rand.c)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 211:&lt;br /&gt;
&lt;br /&gt;
     Want to find out the speed of your NIC?  (Full Duplex or Half), then use ethtool.&lt;br /&gt;
&lt;br /&gt;
               [root@squeezel ~]# ethtool eth0&lt;br /&gt;
               Settings for eth0:&lt;br /&gt;
                       Supported ports: [ MII ]&lt;br /&gt;
                       Supported link modes:   10baseT/Half 10baseT/Full&lt;br /&gt;
                                               100baseT/Half 100baseT/Full&lt;br /&gt;
                                               1000baseT/Half 1000baseT/Full&lt;br /&gt;
                       Supports auto-negotiation: Yes&lt;br /&gt;
                       Advertised link modes:  10baseT/Half 10baseT/Full&lt;br /&gt;
                                               100baseT/Half 100baseT/Full&lt;br /&gt;
                                               1000baseT/Half 1000baseT/Full&lt;br /&gt;
                       Advertised auto-negotiation: Yes&lt;br /&gt;
                       Speed: 100Mb/s&lt;br /&gt;
                       Duplex: Full&lt;br /&gt;
                       Port: Twisted Pair&lt;br /&gt;
                       PHYAD: 1&lt;br /&gt;
                       Transceiver: internal&lt;br /&gt;
                       Auto-negotiation: on&lt;br /&gt;
                       Supports Wake-on: g&lt;br /&gt;
                       Wake-on: d&lt;br /&gt;
                       Current message level: 0x000000ff (255)&lt;br /&gt;
                       Link detected: yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 212:&lt;br /&gt;
&lt;br /&gt;
     rpm install hang? You might need to delete the lock state information. &lt;br /&gt;
&lt;br /&gt;
        $ nl /etc/rc.d/rc.sysinit | grep rpm&lt;br /&gt;
        720   rm -f /var/lib/rpm/__db* &amp;amp;&amp;gt; /dev/null&lt;br /&gt;
&lt;br /&gt;
     Note the command &lt;br /&gt;
&lt;br /&gt;
        $ rm -f /var/lib/rpm/__db*&lt;br /&gt;
&lt;br /&gt;
     Because sometimes you will run &amp;quot;rpm -ivh somerpm&amp;quot; and it will just sit&lt;br /&gt;
     there.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 213:&lt;br /&gt;
&lt;br /&gt;
     Apache - limit access to certain directories based on IP address in the&lt;br /&gt;
         httpd.conf file.&lt;br /&gt;
&lt;br /&gt;
          You can do this completely from /etc/httpd/conf/httpd.conf which&lt;br /&gt;
          are shown below for multiple IP addresses. Note that all 3 setting&lt;br /&gt;
          are the same.&lt;br /&gt;
&lt;br /&gt;
                10.0.0.0/255.0.0.0&lt;br /&gt;
                10.0.0.0/8&lt;br /&gt;
                10&lt;br /&gt;
&lt;br /&gt;
          However, the following is different&lt;br /&gt;
&lt;br /&gt;
                10.0.0.0/24   only allows 10.0.0.1 to 10.0.0.254&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Some complete settings in /etc/httpd/conf/httpd.conf &lt;br /&gt;
&lt;br /&gt;
             &amp;lt;Directory /var/www/html/chirico/&amp;gt;&lt;br /&gt;
                 Order allow,deny&lt;br /&gt;
                 Allow from 10.0.0.0/8      # All 10.&lt;br /&gt;
                 Allow from 192.168.0.0/16  # All 192.168&lt;br /&gt;
                 Allow from 127             # All 127.&lt;br /&gt;
             &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          Don't forget to reload httpd with the following command.&lt;br /&gt;
        &lt;br /&gt;
             $ /etc/init.d/httpd reload&lt;br /&gt;
&lt;br /&gt;
          &lt;br /&gt;
&lt;br /&gt;
TIP 214:&lt;br /&gt;
&lt;br /&gt;
     Open Files - determining how many files are currently open.&lt;br /&gt;
&lt;br /&gt;
             $ cat /proc/sys/fs/file-nr&lt;br /&gt;
             2030    263     104851&lt;br /&gt;
              |       |        \- maximum open file descriptors &lt;br /&gt;
              |       |         &lt;br /&gt;
              |       \- total free allocated file descriptors&lt;br /&gt;
              |&lt;br /&gt;
              (Total allocated file descriptors since boot)&lt;br /&gt;
&lt;br /&gt;
        Note the maximum number can be set or changed.&lt;br /&gt;
&lt;br /&gt;
              $ cat /proc/sys/fs/file-max&lt;br /&gt;
              104851&lt;br /&gt;
&lt;br /&gt;
        To change this&lt;br /&gt;
&lt;br /&gt;
              $ echo &amp;quot;804854&amp;quot; &amp;gt; /proc/sys/fs/file-max&lt;br /&gt;
 &lt;br /&gt;
        Note lsof | wc -l will report higher numbers because this includes&lt;br /&gt;
        open files that are not using file descriptors such as directories,&lt;br /&gt;
        memory mapped files, and executable text files.&lt;br /&gt;
&lt;br /&gt;
        (Reference http://www.netadmintools.com/art295.html&lt;br /&gt;
         and also see the man page for this: man 5 proc )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 215:&lt;br /&gt;
&lt;br /&gt;
     Ctrl-Alt-Del will cause an immediate reboot, without syncing dirty buffers by&lt;br /&gt;
     setting the value &amp;gt; 0 in /proc/sys/kernel/ctrl-alt-del.&lt;br /&gt;
&lt;br /&gt;
               $ echo 1 &amp;gt; /proc/sys/kernel/ctrl-alt-del&lt;br /&gt;
       &lt;br /&gt;
&lt;br /&gt;
        (Reference: man 5 proc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 216:&lt;br /&gt;
&lt;br /&gt;
     Redefining keys in X using xev and xmodmap.  The program xev, used in an X window &lt;br /&gt;
     terminal screen will display information on mouse movements, keys pressed and &lt;br /&gt;
     released.&lt;br /&gt;
&lt;br /&gt;
        $ xev&lt;br /&gt;
&lt;br /&gt;
     Now type shift-4 and you'll notice the event details below:&lt;br /&gt;
&lt;br /&gt;
        KeyPress event, serial 29, synthetic NO, window 0x3800001,&lt;br /&gt;
            root 0x60, subw 0x0, time 55307049, (418,242), root:(428,339),&lt;br /&gt;
            state 0x1, keycode 13 (keysym 0x24, dollar), same_screen YES,&lt;br /&gt;
            XLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
            XmbLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
            XFilterEvent returns: False&lt;br /&gt;
        &lt;br /&gt;
        KeyRelease event, serial 29, synthetic NO, window 0x3800001,&lt;br /&gt;
            root 0x60, subw 0x0, time 55307184, (418,242), root:(428,339),&lt;br /&gt;
            state 0x1, keycode 13 (keysym 0x24, dollar), same_screen YES,&lt;br /&gt;
            XLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
       &lt;br /&gt;
     So, if you want to redefine this key to say copyright, see (/usr/X11R6/include/X11/keysymdef.h)&lt;br /&gt;
     you would type the following.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 copyright'&lt;br /&gt;
&lt;br /&gt;
     To get the key back to the dollar, issue the following command.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 dollar'&lt;br /&gt;
&lt;br /&gt;
     By the way it's possible to define multiple key codes for a sigle key. You'll need&lt;br /&gt;
     to have a key defined as the Mode_switch. Perhaps you'd like to use the Windows key,&lt;br /&gt;
     or the key with the Microsoft logo on it, since you're using Linux. This key is&lt;br /&gt;
     keycode 115&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 115 = Mode_switch'&lt;br /&gt;
&lt;br /&gt;
     Now you could define 3 values to the shift-4. For this example use ld, Yen and dollar.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 dollar sterling yen'&lt;br /&gt;
&lt;br /&gt;
     So pressing the keys gives you the following:&lt;br /&gt;
&lt;br /&gt;
          shift-$          (dollar sign)&lt;br /&gt;
          Windows-$        (lb sign)&lt;br /&gt;
          Windows-shift-$  (Yen sign)&lt;br /&gt;
&lt;br /&gt;
     You could go crazy and redefine all you keys.&lt;br /&gt;
&lt;br /&gt;
     (Thanks to hisham for this tip).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 217:&lt;br /&gt;
&lt;br /&gt;
     Threads - which version of threads are you using?&lt;br /&gt;
&lt;br /&gt;
          $ getconf GNU_LIBPTHREAD_VERSION&lt;br /&gt;
          NPTL 2.3.90&lt;br /&gt;
&lt;br /&gt;
     For a history on threads used with gcc reference the following:&lt;br /&gt;
          &lt;br /&gt;
          http://en.wikipedia.org/wiki/NPTL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 218:&lt;br /&gt;
&lt;br /&gt;
     Screenshots using ImageMagick. &lt;br /&gt;
&lt;br /&gt;
        If you want the entire screen, execute the following:&lt;br /&gt;
&lt;br /&gt;
            $ import -window root screen.png&lt;br /&gt;
&lt;br /&gt;
        Or to crosshair select the region with your mouse, execute &lt;br /&gt;
        the following instead.&lt;br /&gt;
&lt;br /&gt;
            $ import screen.png&lt;br /&gt;
&lt;br /&gt;
        KDE has the ability to take screenshots with the command below.&lt;br /&gt;
&lt;br /&gt;
            $ ksnapshot&lt;br /&gt;
&lt;br /&gt;
        GNOME likewise has a command too.&lt;br /&gt;
&lt;br /&gt;
            $ gnome-panel-screenshot --delay 6&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Visting ImageMagick again, the xwininfo command give window information and the id can be&lt;br /&gt;
        used to capture images with the import command.&lt;br /&gt;
&lt;br /&gt;
            $ xwininfo&lt;br /&gt;
&lt;br /&gt;
          xwininfo: Please select the window about which you&lt;br /&gt;
          would like information by clicking the&lt;br /&gt;
          mouse in that window.&lt;br /&gt;
&lt;br /&gt;
          xwininfo: Window id: 0x1e00007 &amp;quot;chirico@squeezel:/work/svn/souptonuts - Shell - Konsole&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          Absolute upper-left X:  4&lt;br /&gt;
          Absolute upper-left Y:  21&lt;br /&gt;
          Relative upper-left X:  0&lt;br /&gt;
          Relative upper-left Y:  0&lt;br /&gt;
          Width: 880&lt;br /&gt;
          Height: 510&lt;br /&gt;
          Depth: 24&lt;br /&gt;
          Visual Class: TrueColor&lt;br /&gt;
          Border width: 0&lt;br /&gt;
          Class: InputOutput&lt;br /&gt;
          Colormap: 0x20 (installed)&lt;br /&gt;
          Bit Gravity State: NorthWestGravity&lt;br /&gt;
          Window Gravity State: NorthWestGravity&lt;br /&gt;
          Backing Store State: NotUseful&lt;br /&gt;
          Save Under State: no&lt;br /&gt;
          Map State: IsViewable&lt;br /&gt;
          Override Redirect State: no&lt;br /&gt;
          Corners:  +4+21  -396+21  -396-493  +4-493&lt;br /&gt;
          -geometry 880x510+0+0&lt;br /&gt;
&lt;br /&gt;
        Now use the import command with the Window id. My example is shown below.&lt;br /&gt;
&lt;br /&gt;
             $ import -window 0x1e00007  id.miff&lt;br /&gt;
&lt;br /&gt;
        And to quickly display this image that you just saved, use the display command.&lt;br /&gt;
&lt;br /&gt;
             $ display id.miff &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 219:&lt;br /&gt;
&lt;br /&gt;
     File Access over SSH using FUSE (Filesystem in USErspace). This is a very good way to &lt;br /&gt;
     mount a remote filesystem locally. It's  like a secure NFS mount, but you don't require &lt;br /&gt;
     admin privileges on the remote computer. You do need to have fuse-sshfs installed on &lt;br /&gt;
     the local computer that will perform the filesystem mount.&lt;br /&gt;
&lt;br /&gt;
     The following works with Fedora Core 5. Only the users added to the fuse group can mout &lt;br /&gt;
     external drives. Below the user chirico is being added to the group fuse.&lt;br /&gt;
&lt;br /&gt;
             $ yum install fuse-sshfs&lt;br /&gt;
             $ usermod -a -G fuse chirico&lt;br /&gt;
     &lt;br /&gt;
     You'll need to reboot.&lt;br /&gt;
&lt;br /&gt;
             $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
             &lt;br /&gt;
     Next I'm going to mount the remote filesystem v0.squeezel.com. This is done as user chirico&lt;br /&gt;
     on the local computer. I'm using root on the remote computer v0.squeezel.com because I&lt;br /&gt;
     want to mount the complete drive.&lt;br /&gt;
&lt;br /&gt;
             $ mkdir v0&lt;br /&gt;
             $ sshfs root@v0.squeezel.com:/  v0&lt;br /&gt;
             $ cd v0&lt;br /&gt;
             $ ls -l&lt;br /&gt;
               bin   dev  home  lost+found     media  mnt  opt   q     sbin     srv  tmp  var&lt;br /&gt;
               boot  etc  lib   master_backup  misc   net  proc  root  selinux  sys  usr&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
     Now to unmount the filesystem&lt;br /&gt;
&lt;br /&gt;
             $ fusermount -u /home/chirico/v0&lt;br /&gt;
&lt;br /&gt;
     Yes, you can mount the filesystem on boot. Below shows an example entry for /etc/fstab, but&lt;br /&gt;
     this only allows user on the current system to view what is is /mnt/v0. &lt;br /&gt;
&lt;br /&gt;
             sshfs#root@v0.squeezel.com:/var/log             /mnt/v0 fuse defaults    0 0&lt;br /&gt;
&lt;br /&gt;
     References:&lt;br /&gt;
        (http://fuse.sourceforge.net/sshfs.html)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 220:&lt;br /&gt;
&lt;br /&gt;
     OpenVPN - A full-featured SSL VPN solution. The following demonstrates&lt;br /&gt;
               a very simple OpenVPN setup between two Fedora Core 5 computers&lt;br /&gt;
               big.squeezel.com 192.168.1.12 and tape.squeezel.com 192.168.1.155&lt;br /&gt;
&lt;br /&gt;
               As root install the package on both computers.&lt;br /&gt;
&lt;br /&gt;
                  $ yum -y install openvpn&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Setup on big.squeezel.com 192.168.1.12&lt;br /&gt;
&lt;br /&gt;
                  $ iptables -A INPUT -p udp -s 192.168.1.155  --dport 1194 -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tun+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A FORWARD -i tap+ -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
             Note - make sure you have commented out the following line &lt;br /&gt;
                    in /etc/sysconfig/iptables&lt;br /&gt;
&lt;br /&gt;
                  # -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
&lt;br /&gt;
             Now from continuting with the commands that need to be executed on &lt;br /&gt;
             big.squeezel.com 192.168.1.12 do one of the following&lt;br /&gt;
           &lt;br /&gt;
                  $ openvpn --remote tape.squeezel.com  --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 --verb 9&lt;br /&gt;
&lt;br /&gt;
             The above statement gives lots of errors. Once it's working you may want&lt;br /&gt;
             the following statement without the --verb 9 option.&lt;br /&gt;
&lt;br /&gt;
                  $ openvpn --remote tape.squeezel.com  --dev tun1 --ifconfig 10.4.0.1 10.4.0.2&lt;br /&gt;
&lt;br /&gt;
             After you finish the setup commands for tape.squeezel.com immediately below, you'll be&lt;br /&gt;
             able to access tape.squeezel.com as 10.4.0.2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Setup on tape.squeezel.com 192.168.1.155&lt;br /&gt;
&lt;br /&gt;
                  $ iptables -A INPUT -p udp -s 192.168.1.12  --dport 1194 -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tun+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A FORWARD -i tap+ -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
             Note - again, make sure you have commented out the following line &lt;br /&gt;
                    in /etc/sysconfig/iptables&lt;br /&gt;
&lt;br /&gt;
                  # -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
&lt;br /&gt;
             The openvpn commands are tape.squeezel.com are reversed from what is shown&lt;br /&gt;
             above.&lt;br /&gt;
&lt;br /&gt;
                  $ openvpn --remote big.squeezel.com --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 --verb 9&lt;br /&gt;
&lt;br /&gt;
             Or&lt;br /&gt;
                  $ openvpn --remote big.squeezel.com --dev tun1 --ifconfig 10.4.0.2 10.4.0.1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             Now you can access all services and ports from big.squeezel.com on 10.4.0.1 for &lt;br /&gt;
             such services as MySQL, secure Web, imap, etc. A quick test is nmap as follows:&lt;br /&gt;
&lt;br /&gt;
                  $ nmap -A -T4 10.4.0.1&lt;br /&gt;
&lt;br /&gt;
                  Starting Nmap 4.03 ( http://www.insecure.org/nmap/ ) at 2006-05-20 13:54 EDT&lt;br /&gt;
                  Interesting ports on 10.4.0.1:&lt;br /&gt;
                  (The 1671 ports scanned but not shown below are in state: closed)&lt;br /&gt;
                  PORT     STATE SERVICE VERSION&lt;br /&gt;
                  22/tcp   open  ssh     OpenSSH 4.3 (protocol 2.0)&lt;br /&gt;
                  111/tcp  open  rpcbind  2 (rpc #100000)&lt;br /&gt;
                  3306/tcp open  mysql   MySQL (unauthorized)&lt;br /&gt;
&lt;br /&gt;
                  Nmap finished: 1 IP address (1 host up) scanned in 7.116 seconds&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 221:&lt;br /&gt;
&lt;br /&gt;
     openssl - Some common commands.&lt;br /&gt;
&lt;br /&gt;
             Finding the openssldir (Directory for OpenSSL files).&lt;br /&gt;
&lt;br /&gt;
                  $ openssl version -a|grep OPENSSLDIR&lt;br /&gt;
                  OPENSSLDIR: &amp;quot;/etc/pki/tls&amp;quot;&lt;br /&gt;
&lt;br /&gt;
             Connect to a secure SMTP server with STARTTLS, assuming the server name is&lt;br /&gt;
             squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
                  $ openssl s_client -connect squeezel.squeezel.com:25 -starttls&lt;br /&gt;
&lt;br /&gt;
         &lt;br /&gt;
&lt;br /&gt;
      Reference (http://www.madboa.com/geek/openssl/)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 222:&lt;br /&gt;
&lt;br /&gt;
     Bash functions. This is easy, and I find it very useful to create bash functions&lt;br /&gt;
     for repeated commands. For example, suppose you want to create a quick bash function&lt;br /&gt;
     to cd to /var/log, tail messages and tail secure. You can create this function as&lt;br /&gt;
     follows:&lt;br /&gt;
&lt;br /&gt;
                  [root@v5 log]# m()&lt;br /&gt;
                  m()&lt;br /&gt;
                  &amp;gt; { cd /var/log&lt;br /&gt;
                  { cd /var/log&lt;br /&gt;
                  &amp;gt; tail messages&lt;br /&gt;
                  tail messages&lt;br /&gt;
                  &amp;gt; tail secure&lt;br /&gt;
                  tail secure&lt;br /&gt;
                  &amp;gt; }&lt;br /&gt;
                  }&lt;br /&gt;
                  &lt;br /&gt;
     Above I'm typing m() then hitting return. Note the echo on the next line followed&lt;br /&gt;
     by the prompt &amp;gt;. I then enter {. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 223:&lt;br /&gt;
&lt;br /&gt;
     Stats on DNS Server. You can get stats on your DNS server. &lt;br /&gt;
&lt;br /&gt;
       The following works for BIND 9:&lt;br /&gt;
&lt;br /&gt;
                  $ rndc stats&lt;br /&gt;
&lt;br /&gt;
         On my system I see the output in &amp;quot;/var/named/chroot/var/named/data/named_stats.txt&amp;quot;, which&lt;br /&gt;
         if an FC4 system. By the way, if you're using BIND 8, the command is &amp;quot;ndc stats&amp;quot;, but that&lt;br /&gt;
         has a completely different format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Format of the output&lt;br /&gt;
&lt;br /&gt;
            +++ Statistics Dump +++ (1153791199)&lt;br /&gt;
            success 297621&lt;br /&gt;
            referral 32&lt;br /&gt;
            nxrrset 21953&lt;br /&gt;
            nxdomain 33742&lt;br /&gt;
            recursion 28243&lt;br /&gt;
            failure 54&lt;br /&gt;
            --- Statistics Dump --- (1153791199)&lt;br /&gt;
&lt;br /&gt;
      The number (1153791199) can be converted with the date command.&lt;br /&gt;
&lt;br /&gt;
                  $ date -d '1970-01-01 1153791199 sec'&lt;br /&gt;
                  Tue Jul 25 02:33:19 EDT 2006&lt;br /&gt;
&lt;br /&gt;
      That's 1153791199 seconds since 1970-01-01 UCT. Which is 4 hours fast,&lt;br /&gt;
      from EDT.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 224:&lt;br /&gt;
&lt;br /&gt;
     snmp - simple network monitoring protocol. The following steps setup snmp on Fedora Core 5.&lt;br /&gt;
&lt;br /&gt;
                  $ yum install net-snmp*&lt;br /&gt;
&lt;br /&gt;
         Next add the following line in &amp;quot;/etc/snmp/snmpd.conf&amp;quot; at the bottom.&lt;br /&gt;
&lt;br /&gt;
                  rocommunity pA33worD&lt;br /&gt;
&lt;br /&gt;
         Start the snmp service.&lt;br /&gt;
&lt;br /&gt;
                  $ /etc/init.d/snmpd restart&lt;br /&gt;
&lt;br /&gt;
         Once started, from the command prompt, it's possible to get stats on the computer.&lt;br /&gt;
&lt;br /&gt;
                  $ snmpwalk -v 1 -c pA33worD localhost system&lt;br /&gt;
         Or&lt;br /&gt;
                  $ snmpwalk -v 1 -c pA33worD localhost interface&lt;br /&gt;
&lt;br /&gt;
         Or&lt;br /&gt;
                  $ snmpgetnext -v 1 -c pA33worD localhost sysUpTime&lt;br /&gt;
                  DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (26452) 0:04:24.52&lt;br /&gt;
&lt;br /&gt;
         Note the Timeticks is in 100th of a second. So the computer above has been running&lt;br /&gt;
         for 264.52 seconds.&lt;br /&gt;
&lt;br /&gt;
         Reference( TIP 225 shows how to use MRTG for gathering snmp stats).&lt;br /&gt;
                  http://www.net-snmp.org/tutorial/tutorial-5/commands/snmpv3.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 225:&lt;br /&gt;
&lt;br /&gt;
     MRTG - Multi Router Traffic Grapher.  &lt;br /&gt;
&lt;br /&gt;
                  $ cfgmaker --output=/etc/mrtg/v5.squeezel.com \&lt;br /&gt;
                    ifref=ip --global &amp;quot;workdir:/var/www/html/mrtg/stats&amp;quot;\&lt;br /&gt;
                    pA33worD@v5.squeezel.com&lt;br /&gt;
&lt;br /&gt;
        Reference: http://www.chinalinuxpub.com/doc/www.siliconvalleyccie.com/linux-hn/mrtg.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 226:&lt;br /&gt;
&lt;br /&gt;
     Back Trace - This is a method of getting a back trace for all processes on the system.&lt;br /&gt;
                  it assumes the following: a. Kernel was build with CONFIG_MAGIC_SYS-REQ &lt;br /&gt;
                  enabled (which Fedora 5 kernels are) b. You can get direct access to the &lt;br /&gt;
                  monitor.&lt;br /&gt;
&lt;br /&gt;
             Step 1.&lt;br /&gt;
&lt;br /&gt;
                  Ctl-Alt-F1 (This brings you to the text console)&lt;br /&gt;
&lt;br /&gt;
             Step 2.&lt;br /&gt;
&lt;br /&gt;
                  Alt-ScrollLock &lt;br /&gt;
                  Ctl-ScrollLock&lt;br /&gt;
          &lt;br /&gt;
                  Note above that's Alt-ScrollLock followed by Ctl-ScrollLock. You should see&lt;br /&gt;
                  a lot of text on the screen. To fast to read, but don't worry the text will&lt;br /&gt;
                  be in /var/log/messages at the end.&lt;br /&gt;
&lt;br /&gt;
                  On my system the ScrollLock key is next to the NumLock key. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 227:&lt;br /&gt;
&lt;br /&gt;
     Ext3 Tuning - One advantage of Ext3 over Ext2 is directory indexing, which  imporves file&lt;br /&gt;
                  access in directories containing large files or when the directory contains&lt;br /&gt;
                  many files. Directory indexing improves performance by using hashed binary &lt;br /&gt;
                  trees. &lt;br /&gt;
&lt;br /&gt;
                  There are two ways to enable dir_index. First, find the device using the mount&lt;br /&gt;
                  command.&lt;br /&gt;
&lt;br /&gt;
                      $ mount&lt;br /&gt;
&lt;br /&gt;
                      /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)&lt;br /&gt;
                      proc on /proc type proc (rw)&lt;br /&gt;
                      sysfs on /sys type sysfs (rw)&lt;br /&gt;
                      devpts on /dev/pts type devpts (rw,gid=5,mode=620)&lt;br /&gt;
                      /dev/sda1 on /boot type ext3 (rw) &amp;lt;--- This is the one you want&lt;br /&gt;
                      tmpfs on /dev/shm type tmpfs (rw)&lt;br /&gt;
                      none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)&lt;br /&gt;
                      sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)&lt;br /&gt;
                      automount(pid2001) on /net type autofs (rw,fd=4,pgrp=2001,minproto=2,maxproto=4)                   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                  From the above command, the device used is /dev/sda1.  Using the tune2fs command,&lt;br /&gt;
                  directory indexing will only apply to directories created after running the &lt;br /&gt;
                  command below.               &lt;br /&gt;
&lt;br /&gt;
                       $ tune2fs -O dir_index /dev/sda1&lt;br /&gt;
&lt;br /&gt;
                  However, if you want it to apply to all directories, use the e2fsck command as  &lt;br /&gt;
                  shown below:&lt;br /&gt;
&lt;br /&gt;
                       $ e2fsck -D -f /dev/sda1&lt;br /&gt;
&lt;br /&gt;
                  You'll need to bypass the warning message.&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
     Reference: &amp;quot;Tuning Journaling File Systems: A small amount of effort an dtime can yield big&lt;br /&gt;
                results&amp;quot;,by Steve Best. Linux Magazine, September 10, 2006. This author as has&lt;br /&gt;
                a very good book titled: &amp;quot;Linux Debugging and Performance Tuning.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 228:&lt;br /&gt;
&lt;br /&gt;
     NIC bonding - binding two or more NICs to one IP address to improve performance. The following&lt;br /&gt;
                instructions were done on Fedora Core 5.&lt;br /&gt;
&lt;br /&gt;
         Step 1.&lt;br /&gt;
             &lt;br /&gt;
            Create the file ifcfg-bond0 with the IP address, netmask and gateway. Shown&lt;br /&gt;
            below is my file.&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-bond0&lt;br /&gt;
&lt;br /&gt;
                   DEVICE=bond0&lt;br /&gt;
                   IPADDR=192.168.1.12&lt;br /&gt;
                   NETMASK=255.255.255.0&lt;br /&gt;
                   GATEWAY=192.168.1.1&lt;br /&gt;
                   USERCTL=no&lt;br /&gt;
                   BOOTPROTO=none&lt;br /&gt;
                   ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
         Step 2.&lt;br /&gt;
&lt;br /&gt;
            Modify eth0, eth1 and eth2. Shown below are each one of my files. Note that&lt;br /&gt;
            you must comment out, or remove the ip address, netmask, gateway and hardware&lt;br /&gt;
            address from each one of these files, since settings should only come from&lt;br /&gt;
            the ifcfg-bond0 file above. I've chosen to comment out the lines, instead of &lt;br /&gt;
            removing, should I decide to unbond my NICS sometime in the future.&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth0&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:9D&lt;br /&gt;
                  #IPADDR=192.168.1.12&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  #GATEWAY=192.168.1.1&lt;br /&gt;
                  #USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  # Settings for Bond&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth1&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth1&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:C9&lt;br /&gt;
                  #IPADDR=192.168.1.13&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  #&lt;br /&gt;
                  # Settings for bonding&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth2&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth2&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:9D&lt;br /&gt;
                  #IPADDR=192.168.1.12&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  #GATEWAY=192.168.1.1&lt;br /&gt;
                  #USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
         Step 3.&lt;br /&gt;
&lt;br /&gt;
            Set the load parameters for bond0 bonding kernel module. Append the&lt;br /&gt;
            following lines to /etc/modprobe.conf &lt;br /&gt;
&lt;br /&gt;
                 # bonding commands &lt;br /&gt;
                 alias bond0 bonding&lt;br /&gt;
                 options bond0 mode=balance-alb miimon=100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Step 4.&lt;br /&gt;
&lt;br /&gt;
            Load the bond driver module from the command prompt.&lt;br /&gt;
&lt;br /&gt;
                 $ modprobe bonding&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Step 5.&lt;br /&gt;
&lt;br /&gt;
            Restart the network, or restart the computer. Note I restarted to computer,&lt;br /&gt;
            since my NICs above had MAC assignments.&lt;br /&gt;
&lt;br /&gt;
                 $ service network restart   # Or restart computer&lt;br /&gt;
&lt;br /&gt;
             Take a look at the proc settings. &lt;br /&gt;
&lt;br /&gt;
                 $ cat /proc/net/bonding/bond0 &lt;br /&gt;
                 Ethernet Channel Bonding Driver: v3.0.3 (March 23, 2006)&lt;br /&gt;
&lt;br /&gt;
                 Bonding Mode: adaptive load balancing&lt;br /&gt;
                 Primary Slave: None&lt;br /&gt;
                 Currently Active Slave: eth2&lt;br /&gt;
                 MII Status: up&lt;br /&gt;
                 MII Polling Interval (ms): 100&lt;br /&gt;
                 Up Delay (ms): 0&lt;br /&gt;
                 Down Delay (ms): 0&lt;br /&gt;
&lt;br /&gt;
                 Slave Interface: eth2&lt;br /&gt;
                 MII Status: up&lt;br /&gt;
                 Link Failure Count: 0&lt;br /&gt;
                 Permanent HW addr: 00:13:72:80:62:f0&lt;br /&gt;
            &lt;br /&gt;
     References:&lt;br /&gt;
&lt;br /&gt;
         http://www.cyberciti.biz/nixcraft/vivek/blogger/2006/04/linux-bond-or-team-multiple-network.php&lt;br /&gt;
          Good, well written article describing the steps above.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=24692&amp;amp;package_id=146474&lt;br /&gt;
          Documentation for bonding that can also be found in the kernel&lt;br /&gt;
          ./Documentation/networking/bonding.txt&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 229:&lt;br /&gt;
&lt;br /&gt;
     /etc/nsswitch.conf - System Databases and Name Service Switch configuration file. &lt;br /&gt;
&lt;br /&gt;
         This file determines lookup order of services. For example, to match a name&lt;br /&gt;
         to an IP address, an entry can be put into the /etc/hosts file. Or a DNS query&lt;br /&gt;
         can be made. What's the order?  Normally, it's the entry in the /etc/hosts file.&lt;br /&gt;
         because /etc/nsswitch.conf contains the following setting&lt;br /&gt;
        &lt;br /&gt;
            hosts:      files dns&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	 See man nsswitch.conf for more settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
THE FOLLOWING SECTIONS STARTS THE PROGRAMMING TIPS&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 1:&lt;br /&gt;
&lt;br /&gt;
     Simple open command that restarts the close if a signal&lt;br /&gt;
     occurs.  Also note, the POSIX standards committee decided&lt;br /&gt;
     all new functions would not use errno and would instead&lt;br /&gt;
     directly return the error number in the function.&lt;br /&gt;
&lt;br /&gt;
     A lot of functions return -1 on an error condition, then,&lt;br /&gt;
     set errno to the value of the error.  This will still work&lt;br /&gt;
     for all the well known functions; but, it's changing.&lt;br /&gt;
&lt;br /&gt;
     /* start of code open.c&lt;br /&gt;
        Compile gcc -o open open.c&lt;br /&gt;
&lt;br /&gt;
        Reference (Look for simple_but_common_x.x.x.tar.gz):&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79066&lt;br /&gt;
&lt;br /&gt;
                             */&lt;br /&gt;
     #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     #include &amp;lt;string.h&amp;gt;             /* for strerror(int errno) */&lt;br /&gt;
     #include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     #define BUFLEN 100&lt;br /&gt;
     extern int errno;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     int&lt;br /&gt;
     main (void)&lt;br /&gt;
     {&lt;br /&gt;
       int fp,error;&lt;br /&gt;
       char buf[BUFLEN+1];&lt;br /&gt;
&lt;br /&gt;
       if ((fp = open (&amp;quot;data&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1)&lt;br /&gt;
         {&lt;br /&gt;
           fprintf (stderr, &amp;quot;Can't open data: %s\n&amp;quot;, strerror (errno));&lt;br /&gt;
           return 1;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
       snprintf (buf, BUFLEN, &amp;quot;123&amp;quot;);&lt;br /&gt;
       write (fp, buf, strlen (buf));&lt;br /&gt;
&lt;br /&gt;
       // Restart close should a signal occur */&lt;br /&gt;
       while((( error = close (fp) ) == -1) &amp;amp;&amp;amp; (errno == EINTR));&lt;br /&gt;
       if(error == -1)&lt;br /&gt;
         perror(&amp;quot;Failed to close the file\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
       return 0;&lt;br /&gt;
      }&lt;br /&gt;
     /* end of open.c */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 2:&lt;br /&gt;
&lt;br /&gt;
     Example of setting the effective UID on a file&lt;br /&gt;
&lt;br /&gt;
     /*  start of code&lt;br /&gt;
       gcc uid_open.c -o uid_open&lt;br /&gt;
       su&lt;br /&gt;
       chown root.chirico uid_open&lt;br /&gt;
       chmod u+s uid_open&lt;br /&gt;
       exit&lt;br /&gt;
&lt;br /&gt;
       Now you can run this as chirico and write to the&lt;br /&gt;
       root directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     */&lt;br /&gt;
     #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;string.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     int main()&lt;br /&gt;
     {&lt;br /&gt;
             int fd;&lt;br /&gt;
&lt;br /&gt;
             if ((fd = open(&amp;quot;/root/datajunk&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1) {&lt;br /&gt;
                     fprintf(stderr, &amp;quot;Can't open file \n&amp;quot;);&lt;br /&gt;
                     return 1;&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
             write(fd, &amp;quot;0123456&amp;quot;, strlen(&amp;quot;0123456&amp;quot;));&lt;br /&gt;
             close(fd);&lt;br /&gt;
             return 0;&lt;br /&gt;
     }&lt;br /&gt;
&lt;br /&gt;
     /* end of code */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 3:&lt;br /&gt;
&lt;br /&gt;
     Writing a C http post.&lt;br /&gt;
&lt;br /&gt;
     For downloads reference:&lt;br /&gt;
      http://prdownloads.sourceforge.net/cpearls/spider.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 4:&lt;br /&gt;
&lt;br /&gt;
     Writing a 2.6.x Kernel Module:&lt;br /&gt;
&lt;br /&gt;
       Look for the latest version of &amp;quot;procreadwrite&amp;quot;.  This is a 2.6 kernel&lt;br /&gt;
       modules that demonstrates how to create /proc entires and write directly&lt;br /&gt;
       to user-land via tty.  It's updated to reflect replacement of &amp;quot;current-&amp;gt;tty&amp;quot;&lt;br /&gt;
       with &amp;quot;current-&amp;gt;signal-&amp;gt;tty&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79066&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 5:&lt;br /&gt;
&lt;br /&gt;
     Creating a filename with '\n'.  This goes with (TIP 71)&lt;br /&gt;
&lt;br /&gt;
         /**** topen.c ***********************************************************&lt;br /&gt;
           Filenames can be created with any character except the null character&lt;br /&gt;
           and a slash.&lt;br /&gt;
&lt;br /&gt;
           This example creates a file with returns '\n\n'&lt;br /&gt;
&lt;br /&gt;
           There's a way to remove a file by inode:&lt;br /&gt;
&lt;br /&gt;
               $ ls -libt *&lt;br /&gt;
&lt;br /&gt;
           And, once you know the inode&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec mv '{}' goodstuff \;&lt;br /&gt;
&lt;br /&gt;
           or&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec rm '{}' goodstuff \;&lt;br /&gt;
&lt;br /&gt;
           or&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec cat '{}' \;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Compile:&lt;br /&gt;
&lt;br /&gt;
             gcc -o topen -Wall -W -O2 -s -pipe  topen.c&lt;br /&gt;
&lt;br /&gt;
         Reference:&lt;br /&gt;
           http://prdownloads.sourceforge.net/cpearls/simple_but_common_0.0.14.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
         */&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         #include &amp;lt;string.h&amp;gt;             /* for strerror(int errno) */&lt;br /&gt;
         #include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         #define BUFLEN 100&lt;br /&gt;
         extern int errno;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         int&lt;br /&gt;
         main (void)&lt;br /&gt;
         {&lt;br /&gt;
           int fp,error;&lt;br /&gt;
           char buf[BUFLEN+1];&lt;br /&gt;
&lt;br /&gt;
           if ((fp = open (&amp;quot;\n\n\n\n\n\n\n\n\n&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1)&lt;br /&gt;
             {&lt;br /&gt;
               fprintf (stderr, &amp;quot;Can't open data: %s\n&amp;quot;, strerror (errno));&lt;br /&gt;
               return 1;&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
           snprintf (buf, BUFLEN, &amp;quot;123&amp;quot;);&lt;br /&gt;
           write (fp, buf, strlen (buf));&lt;br /&gt;
&lt;br /&gt;
           // Restart close should a signal occur */&lt;br /&gt;
           while((( error = close (fp) ) == -1) &amp;amp;&amp;amp; (errno == EINTR));&lt;br /&gt;
           if(error == -1)&lt;br /&gt;
             perror(&amp;quot;Failed to close the file\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
           return 0;&lt;br /&gt;
&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  **Note, if you want email notification after every 50 new tips have been&lt;br /&gt;
    added, then, click on the following link:&lt;br /&gt;
&lt;br /&gt;
     https://sourceforge.net/project/filemodule_monitor.php?filemodule_id=120838&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 6:&lt;br /&gt;
&lt;br /&gt;
     Working With The Lemon Parser Generator.&lt;br /&gt;
     http://prdownloads.sourceforge.net/souptonuts/lemon_examples.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 7:&lt;br /&gt;
&lt;br /&gt;
     copy command for std container output.&lt;br /&gt;
&lt;br /&gt;
        #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
        #include &amp;lt;list&amp;gt;&lt;br /&gt;
        #include &amp;lt;vector&amp;gt;&lt;br /&gt;
        #include &amp;lt;iterator&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        using namespace std;&lt;br /&gt;
        int main(void)&lt;br /&gt;
        {&lt;br /&gt;
          vector&amp;lt;int&amp;gt; v;&lt;br /&gt;
          list&amp;lt;int&amp;gt; l;&lt;br /&gt;
&lt;br /&gt;
          v.push_back(1);&lt;br /&gt;
          v.push_back(2);&lt;br /&gt;
          copy(v.begin(),v.end(),ostream_iterator&amp;lt;int&amp;gt;(cout,&amp;quot;\n&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          l.push_back(23);&lt;br /&gt;
          l.push_back(12);&lt;br /&gt;
          copy(l.begin(),l.end(),ostream_iterator&amp;lt;int&amp;gt;(cout,&amp;quot;\n&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 8:&lt;br /&gt;
&lt;br /&gt;
  /* Copyright (c) 2005 Mike Chirico mchirico@comcast.net mchirico@users.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Example of using virtual functions. Note the use of &amp;quot;initialization lists&amp;quot;&lt;br /&gt;
              for assinging the variable first and last.&lt;br /&gt;
&lt;br /&gt;
      Compile:&lt;br /&gt;
        g++ -o virtualfunc -Wall -W -O2 -s -pipe  virtual_function.cc&lt;br /&gt;
&lt;br /&gt;
      Download:&lt;br /&gt;
        http://prdownloads.sourceforge.net/cpearls/simple_but_common_cpp.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  */&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
  #include &amp;lt;string&amp;gt;&lt;br /&gt;
  #include &amp;lt;list&amp;gt;&lt;br /&gt;
  #include &amp;lt;algorithm&amp;gt;&lt;br /&gt;
  #include &amp;lt;iterator&amp;gt;&lt;br /&gt;
  #include &amp;lt;functional&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  using namespace std;&lt;br /&gt;
&lt;br /&gt;
  class Employee {&lt;br /&gt;
  string first,last;&lt;br /&gt;
  public:&lt;br /&gt;
    Employee(const string&amp;amp; fn=&amp;quot;John&amp;quot;,const  string&amp;amp; ln=&amp;quot;Smith&amp;quot;): first(fn),last(ln) {}&lt;br /&gt;
    virtual void print() const {&lt;br /&gt;
    cout &amp;lt;&amp;lt; &amp;quot;First name: &amp;quot; &amp;lt;&amp;lt; first &amp;lt;&amp;lt; &amp;quot;, Last name: &amp;quot; &amp;lt;&amp;lt; last &amp;lt;&amp;lt; endl;&lt;br /&gt;
    }&lt;br /&gt;
    virtual ~Employee() {}&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  class Manager : public Employee {&lt;br /&gt;
    int level;&lt;br /&gt;
    list&amp;lt;Employee*&amp;gt; subordinates;&lt;br /&gt;
  public:&lt;br /&gt;
    Manager(const string&amp;amp; fn=&amp;quot;Ivan&amp;quot;,const string&amp;amp; ln=&amp;quot;Stedwick&amp;quot;, int lvl=1): Employee(fn,ln), level(lvl) {}&lt;br /&gt;
    void print() {&lt;br /&gt;
      cout &amp;lt;&amp;lt; &amp;quot;Manager level: &amp;quot; &amp;lt;&amp;lt; level &amp;lt;&amp;lt; &amp;quot;  &amp;quot;;&lt;br /&gt;
      Employee::print();&lt;br /&gt;
      cout &amp;lt;&amp;lt; &amp;quot;Supervises:&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
      for_each(subordinates.begin(),subordinates.end(),mem_fun(&amp;amp;Employee::print));&lt;br /&gt;
      cout &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; endl;&lt;br /&gt;
    }&lt;br /&gt;
    void addstaff(Employee&amp;amp; staff){&lt;br /&gt;
      subordinates.push_front(&amp;amp;staff);&lt;br /&gt;
    }&lt;br /&gt;
    void addstaff(Employee* staff){&lt;br /&gt;
      subordinates.push_front(staff);&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   int main()&lt;br /&gt;
   {&lt;br /&gt;
     Employee p0(&amp;quot;Lisa&amp;quot;,&amp;quot;Payne&amp;quot;);&lt;br /&gt;
     Manager m0;&lt;br /&gt;
&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Zoe&amp;quot;,&amp;quot;Bear&amp;quot;)); /* uses void addstaff(Employee* staff) */&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Leah&amp;quot;,&amp;quot;Bopper&amp;quot;));&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Abby&amp;quot;,&amp;quot;Chicken&amp;quot;));&lt;br /&gt;
     m0.addstaff(p0);  /* void addstaff(Employee&amp;amp; staff)  needed for this one */&lt;br /&gt;
     m0.addstaff(new Employee());&lt;br /&gt;
     m0.print();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     return 0;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 9:&lt;br /&gt;
&lt;br /&gt;
   /*  Named Constructor Idiom.&lt;br /&gt;
       Reference: http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.6&lt;br /&gt;
&lt;br /&gt;
   */&lt;br /&gt;
   #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
   #include &amp;lt;cmath&amp;gt;&lt;br /&gt;
   using namespace std;&lt;br /&gt;
&lt;br /&gt;
   class Point {&lt;br /&gt;
&lt;br /&gt;
   public:&lt;br /&gt;
     static Point rectangular(float x, float y);&lt;br /&gt;
     static Point polar(float radius, float angle);&lt;br /&gt;
     float get_x() { return x_; }&lt;br /&gt;
     float get_y() { return y_; }&lt;br /&gt;
&lt;br /&gt;
   private:&lt;br /&gt;
     Point(float x, float y);&lt;br /&gt;
     float x_, y_;&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
   inline Point::Point(float x, float y)&lt;br /&gt;
     : x_(x), y_(y) {}&lt;br /&gt;
&lt;br /&gt;
   inline Point Point::rectangular(float x, float y)&lt;br /&gt;
   { return Point(x,y); }&lt;br /&gt;
&lt;br /&gt;
   inline Point Point::polar(float radius, float angle)&lt;br /&gt;
   { return Point(radius*cos(angle),radius*sin(angle)); }&lt;br /&gt;
&lt;br /&gt;
   int main(void)&lt;br /&gt;
   {&lt;br /&gt;
     Point p1 = Point::rectangular(5.7,1.2);&lt;br /&gt;
     Point p2 = Point::polar(5.7,1.2);&lt;br /&gt;
&lt;br /&gt;
     cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; p1.get_x() &amp;lt;&amp;lt; &amp;quot;, &amp;quot; &amp;lt;&amp;lt; p1.get_y() &amp;lt;&amp;lt; &amp;quot;)&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
     cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; p2.get_x() &amp;lt;&amp;lt; &amp;quot;, &amp;quot; &amp;lt;&amp;lt; p2.get_y() &amp;lt;&amp;lt; &amp;quot;)&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 10:&lt;br /&gt;
&lt;br /&gt;
   /* Copy_constructor_assignment.cc&lt;br /&gt;
      Copyright (c) 2004 GPL Mike Chirico, mchirico@comcast.net or mchirico@users.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
      Reference: &amp;quot;The C++ Programming Language&amp;quot;, 3rd ed, by Stroustrup&lt;br /&gt;
      pg. 246.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Download:&lt;br /&gt;
      http://prdownloads.sourceforge.net/cpearls/simple_but_common.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
   */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   class Name {&lt;br /&gt;
   public:&lt;br /&gt;
     char* s;&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   class Table {&lt;br /&gt;
     Name *p;&lt;br /&gt;
     size_t sz;&lt;br /&gt;
   public:&lt;br /&gt;
     Table(size_t s=15) {&lt;br /&gt;
               p = new Name[sz=s];&lt;br /&gt;
               for(size_t i=0; i&amp;lt; sz; ++i) p[i].s=&amp;quot;****&amp;quot;;&lt;br /&gt;
                          }&lt;br /&gt;
     Table(const Table &amp;amp;t);&lt;br /&gt;
     Table&amp;amp; operator=(const Table&amp;amp;);&lt;br /&gt;
     int prt();&lt;br /&gt;
     void asgn(char* ts,size_t index);&lt;br /&gt;
     ~Table(){ delete[] p; }&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Table&amp;amp; Table::operator=(const Table &amp;amp;t)&lt;br /&gt;
   {&lt;br /&gt;
     if( this != &amp;amp;t) {&lt;br /&gt;
       delete[] p;&lt;br /&gt;
       p = new Name[sz=t.sz];&lt;br /&gt;
       for(size_t i=0; i&amp;lt; t.sz; ++i) p[i]=t.p[i];&lt;br /&gt;
     }&lt;br /&gt;
     return *this;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   int Table::prt()&lt;br /&gt;
   {&lt;br /&gt;
     for(size_t i=0; i&amp;lt; sz; ++i) std::cout &amp;lt;&amp;lt; p[i].s &amp;lt;&amp;lt; &amp;quot; &amp;quot;;&lt;br /&gt;
     std::cout &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
     return 0;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   /*&lt;br /&gt;
     asgn will increase the array of strings, if needed&lt;br /&gt;
     to size index+1, and add the string ts to position&lt;br /&gt;
     index.&lt;br /&gt;
   */&lt;br /&gt;
   void Table::asgn(char* ts,size_t index)&lt;br /&gt;
   {&lt;br /&gt;
     if(index &amp;lt; sz ) {&lt;br /&gt;
        p[index].s=ts;&lt;br /&gt;
     }else if ( index &amp;gt;= sz ){&lt;br /&gt;
        Name *tp;&lt;br /&gt;
        tp=p;&lt;br /&gt;
&lt;br /&gt;
        p = new Name[index+1];&lt;br /&gt;
&lt;br /&gt;
        for(size_t i=0; i&amp;lt; sz; ++i) p[i].s=tp[i].s;&lt;br /&gt;
        delete [] tp;&lt;br /&gt;
        for(size_t i=sz; i &amp;lt; index; ++i)p[i].s=&amp;quot;****&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
        p[index].s=ts;&lt;br /&gt;
        sz=index+1;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   int main(void)&lt;br /&gt;
   {&lt;br /&gt;
&lt;br /&gt;
     Table t1;&lt;br /&gt;
     Table t2(5);&lt;br /&gt;
&lt;br /&gt;
     // this is bigger than initial sz&lt;br /&gt;
     t1.asgn(&amp;quot;myname&amp;quot;,20);&lt;br /&gt;
     t1.prt();&lt;br /&gt;
     t2.prt();&lt;br /&gt;
&lt;br /&gt;
     t1=t2;&lt;br /&gt;
&lt;br /&gt;
     t1.prt();&lt;br /&gt;
     t2.prt();&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REFERENCES:&lt;br /&gt;
&lt;br /&gt;
  (1)  http://www.tldp.org/LDP/abs/html/index.html&lt;br /&gt;
  (2)  http://www.shelldorado.com/&lt;br /&gt;
  (3)  http://www.faqs.org/ftp/usenet/news.answers/unix-faq/faq/part1&lt;br /&gt;
  (4)  http://www-106.ibm.com/developerworks/library/l-rpm1/&lt;br /&gt;
  (5)  http://www-136.ibm.com/developerworks/linux/&lt;br /&gt;
  (6)  http://www.gnu.org/manual/manual.html&lt;br /&gt;
  (7)  http://fedora.redhat.com/&lt;br /&gt;
  (8)  http://souptonuts.sourceforge.net/chirico/index.php&lt;br /&gt;
  (9)  http://www.faqs.org/faqs/&lt;br /&gt;
 (10)  http://www.faqs.org/docs/linux_network/&lt;br /&gt;
 (11)  http://www.tml.hut.fi/~viu/linux/sag/sag-0.6.2.html/index.html&lt;br /&gt;
 (12)  http://www.yolinux.com/TUTORIALS/LinuxTutorialSysAdmin.html&lt;br /&gt;
 (13)  http://sed.sourceforge.net/grabbag/scripts/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  SUMMARY:&lt;br /&gt;
   (1)(2)(3) Excellent resource for bash scripts.&lt;br /&gt;
   (4)       rpm resource&lt;br /&gt;
   (6)       GNU Manuals Online&lt;br /&gt;
   (7)       Fedora&lt;br /&gt;
   (8)       Authors Website&lt;br /&gt;
   (11)(12)  System Admin&lt;br /&gt;
   (13)      Excellent source of sed scripts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
HIGHLY RECOMMENDED BOOKS:&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX Network Programming, The Sockets Networking API&amp;quot;, Volume 1, Third Edition.&lt;br /&gt;
        W. Richard Stevens, Bill Fenner, Andrew M. Rudoff.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX Network Programming, Interprocess Communications&amp;quot;, Volume 2, Second Edition.&lt;br /&gt;
        W. Richard Stevens.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX SYSTEMS Programming, Communication, Concurrency, and Threads&amp;quot;, Kay A. Robbins,&lt;br /&gt;
        Steven Robbins&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming with POSIX Threads&amp;quot;, David R. Butenhof. Addison-Wesley&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;The C++ Programming Language&amp;quot; Third Edition. Bjarne Stroustrup. Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C Programming Language&amp;quot; (2nd Edition), Second Edition, Kernighan and Ritchie&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Advanced Linux Programming&amp;quot; by Mark Mitchell, Jeffrey Oldham, and Alex Samuel, of&lt;br /&gt;
        CodeSourcery LL. This book if free at the following resource:&lt;br /&gt;
        http://www.advancedlinuxprogramming.com/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Accelerated C++, Practical Programming by Example&amp;quot; Andrew Koenig, Barbara E. Moo.&lt;br /&gt;
        Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C: A Reference Manual&amp;quot;, Fifth Edition, Samuel P. Harbison, Guy L. Steele.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Standard Library: A Tutorial and Reference, The&amp;quot;, Nicolai M. Josuttis. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Templates: The Complete Guide&amp;quot;, David Vandevoorde, Nicolai M. Josuttis. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Exceptional C++: 47 Engineering Puzzles, Programming Problems, and Solutions&amp;quot;, Herb Sutter.&lt;br /&gt;
     Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;More Exceptional C++&amp;quot;, Herb Sutter.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Exceptional C++ Style: 40 New Engineering Puzzles, Programming Problems, and Solutions&amp;quot;,&lt;br /&gt;
       Herb Sutter. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;The Art of Computer Programming (TAOCP)&amp;quot;, Vol 1,Vol 2, Vol 3. Donald E. Knuth. Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming Perl, 3rd Edition&amp;quot;, Tom Christiansen, Jon Orwant, Larry Wall. O'Reilly.&lt;br /&gt;
       http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming from the Ground Up&amp;quot;, Jonathan Bartlett, Edited by Dominick Bruno, Jr.&lt;br /&gt;
       http://savannah.nongnu.org/download/pgubook/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Expert C Programming&amp;quot;, Peter van der Linden, Prentice Hall PTR.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Coding Standards 101 Rules, Guidelines, and Best Practices&amp;quot;, by Herb Sutter and&lt;br /&gt;
       Andrei Alexandrescu.  http://www.gotw.ca/publications/c++cs/bibliography.htm&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Linux Kernel Development: A practical guide to the design and implementation of&lt;br /&gt;
       the Linux kernel&amp;quot;, by Robert Love, Sams Publishing.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond&amp;quot;, by&lt;br /&gt;
       David Abrahams and Aleksey Gurtovoy. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
HIGHLY RECOMMENDED: PHILOSOPHICAL&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;Zen and the Art of Motorcycle Maintenance: An Inquiry into Values&amp;quot;, Robert Pirsig.&lt;br /&gt;
        http://www.virtualschool.edu/mon/Quality/PirsigZen/index.html&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;Lila: An Inquiry Into Morals&amp;quot;, Robert Pirsig.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RECOMMENDED BOOKS:&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Structure and Interpretation of Computer Programs&amp;quot;, Harold Abelson, Gerald Jay Sussman,&lt;br /&gt;
      Julie Sussman. This book is free:&lt;br /&gt;
        http://mitpress.mit.edu/sicp/full-text/book/book.html&lt;br /&gt;
              and&lt;br /&gt;
        http://www.gnu.org/software/mit-scheme/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RECOMMENDED HOTOS:&lt;br /&gt;
&lt;br /&gt;
    Linux Networking-HOWTO (Previously the Net-3 Howto)&lt;br /&gt;
     http://en.tldp.org/HOWTO/NET3-4-HOWTO.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CORRECTIONS:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following people made suggestions and corrections:&lt;br /&gt;
  - Jorge Fabregas &amp;lt;fabregasj@prtc.net&amp;gt; TIP 21&lt;br /&gt;
  - Malcolm Parsons &amp;lt;malcolm.parsons@gmail.com&amp;gt; TIP 44&lt;br /&gt;
  - Andreas Haunschmidt &amp;lt;Andreas.Haunschmidt@utanet.at&amp;gt; TIP 102, TIP 90&lt;br /&gt;
  - P@draigBrady.com (Following links )&lt;br /&gt;
  - Jacques.GARNIER-EXTERIEUR@EU.RHODIA.COM TIP 46&lt;br /&gt;
&lt;br /&gt;
                http://www.pixelbeat.org/cmdline.html&lt;br /&gt;
                http://www.pixelbeat.org/rotagator/linux.tips/rotagator.fortune&lt;br /&gt;
                http://www.pixelbeat.org/scripts/&lt;br /&gt;
&lt;br /&gt;
  - Tobias Nix &amp;lt;tobias.nix@gmail.com&amp;gt; TIP 12&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>C4tboCcdro</name></author>	</entry>

	<entry>
		<id>https://wiki.gacq.com/index.php?title=Linux_tips&amp;diff=2761</id>
		<title>Linux tips</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacq.com/index.php?title=Linux_tips&amp;diff=2761"/>
				<updated>2009-01-10T08:04:20Z</updated>
		
		<summary type="html">&lt;p&gt;C4tboCcdro: http://bukgetert.0lx.net/article-287.htm&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://bukgetert.0lx.net/article-287.htm sad movies always make me cry] [http://tarobasal.strefa.pl/sitemap.htm webmap] [http://betheres.qsh.eu/comment-141.htm revolutionary war movies] [http://dronoubr.0lx.net/angelina-antonio.html angelina antonio banderas jolie video] [http://mahohmie.qsh.eu/resource1532.htm new realeased movies] &lt;br /&gt;
[http://huruple.qsh.eu/20081227-sara-jay-xxx.htm sara jay xxx movie] [http://naceceli.qsh.eu/sitemap.html link] [http://huruple.qsh.eu/20090105-adc-video-patch.htm adc video patch panel] [http://tulilre.strefa.pl/2008-12-27-imovie-5-download.html imovie 5 download] [http://faquafav.is-the-boss.com/text-545.htm pinnacle studio 9.0 serial] &lt;br /&gt;
[http://mahohmie.qsh.eu/resource1805.htm spongebob tv movie character toy] [http://fademon.0lx.net/article-1434.htm put music videos on your psp for free] [http://acsitzar.0lx.net/news-joes-movies-2008-11-12.html joes movies] [http://caraines.qsh.eu/defanele.htm iran movie] [http://betheres.qsh.eu/comment-180.htm movie prime cut] &lt;br /&gt;
[http://caraines.qsh.eu/zelgolg.htm amc movie .com] [http://caraines.qsh.eu/zmexplnrb.htm ejaculate galleries.squirting video] [http://spfortne.qsh.eu/20081226-adult-alyssa.html adult alyssa milano movie] [http://lofaako.strefa.pl/sitemap.html map] [http://caraines.qsh.eu/caelttro.htm anne curtis video scandal download] &lt;br /&gt;
[http://zelgetgo.0lx.net/sitemap.htm url] [http://relquaca.is-the-boss.com/20090104-lanhound-serial.html lanhound serial number] [http://bukgetert.0lx.net/article-28.htm sitemap] [http://fispruil.qsh.eu/news1763.html she will be loved video cast maroon 5] [http://bukgetert.0lx.net/article-52.htm make a movie screen] &lt;br /&gt;
[http://lifokdron.0lx.net/1739.html michael thriller video] [http://huruple.qsh.eu/20090101-interracial-video.htm interracial video tgp] [http://relquaca.is-the-boss.com/20090103-password-stealer.html password stealer crack] [http://acsitzar.0lx.net/news-most-wanted-2008-11-17.html most wanted movie] [http://vihencbr.0lx.net/secure-video.html secure video chat] &lt;br /&gt;
[http://acsitzar.0lx.net/news-jethro-tull-videos-2008-11-19.html jethro tull videos] [http://bukgetert.0lx.net/sitemap.htm links] [http://lifokdron.0lx.net/504.html movie theater in virginia] [http://flheddin.qsh.eu/brfadron-453.html motivational military videos] [http://sematild.qsh.eu/resource322.htm real player video codecs] &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Mike Chirico (mchirico@users.sourceforge.net) or (mchirico@comcast.net)&lt;br /&gt;
Copyright (C) 2004 (GNU Free Documentation License)&lt;br /&gt;
Last Updated: Thu Dec 28 16:42:50 EST 2006&lt;br /&gt;
&lt;br /&gt;
The latest version of this document can be found at:&lt;br /&gt;
http://souptonuts.sourceforge.net/how_to_linux_and_open_source.htm&lt;br /&gt;
  or text version ( if you have trouble downloading the full document: over 140 pages )&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/How_to_Linux_and_Open_Source.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on Gmail with Postix and Fetchmail&lt;br /&gt;
http://souptonuts.sourceforge.net/postfix_tutorial.html&lt;br /&gt;
&lt;br /&gt;
For tips on using SQLite (over 25 pages)&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_sqlite_tutorial.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on MySQL reference:&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_mysql.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For a recommended reading list&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/Recommended_Reading.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on upgrading RedHat 9 or 8.0 to 2.6.x src kernel&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_26.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on Comcast Email with Home Linux Box&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_COMCAST_EMAIL.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  **Note, if you want email notification after every 50 new tips have been&lt;br /&gt;
    added, then, click on the following link:&lt;br /&gt;
     https://sourceforge.net/project/filemodule_monitor.php?filemodule_id=120838&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 1:&lt;br /&gt;
&lt;br /&gt;
     Is NTP Working?&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Test the current server):&lt;br /&gt;
&lt;br /&gt;
          Try issuing the following command:&lt;br /&gt;
&lt;br /&gt;
          $ ntpq -pn&lt;br /&gt;
&lt;br /&gt;
           remote refid st t when poll reach delay offset jitter&lt;br /&gt;
           ===================================================&lt;br /&gt;
           tock.usno.navy 0.0.0.0 16 u - 64 0 0.000 0.000 4000.00&lt;br /&gt;
&lt;br /&gt;
          The above is an example of a problem.&lt;br /&gt;
          Compare it to a working configuration.&lt;br /&gt;
&lt;br /&gt;
          $ ntpq -pn&lt;br /&gt;
&lt;br /&gt;
           remote refid st t when poll reach delay offset jitter&lt;br /&gt;
           ========================================================&lt;br /&gt;
           +128.4.40.12 128.4.40.10 2 u 107 128 377 25.642 3.350 1.012&lt;br /&gt;
           127.127.1.0 127.127.1.0 10 l 40 64 377 0.000 0.000 0.008&lt;br /&gt;
           +128.91.2.13 128.4.40.12 3 u 34 128 377 21.138 6.118 0.398&lt;br /&gt;
           *192.5.41.41 .USNO. 1 u 110 128 377 33.69 9.533 3.534&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Configure the /etc/ntp.conf):&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/ntp.conf&lt;br /&gt;
&lt;br /&gt;
            # My simple client-only ntp configuration.&lt;br /&gt;
            server timeserver1.upenn.edu&lt;br /&gt;
            # ping -a timeserver1.upenn.edu shows the IP address 128.91.2.13&lt;br /&gt;
            # which is used in the restrict below&lt;br /&gt;
            restrict 128.91.2.13&lt;br /&gt;
            server tock.usno.navy.mil&lt;br /&gt;
            restrict 192.5.41.41&lt;br /&gt;
            server 128.4.40.12&lt;br /&gt;
            restrict 128.4.40.12&lt;br /&gt;
            server 127.127.1.0 # local clock&lt;br /&gt;
            fudge 127.127.1.0 stratum 10&lt;br /&gt;
            driftfile /etc/ntp/drift&lt;br /&gt;
            restrict default ignore&lt;br /&gt;
            restrict 127.0.0.0 mask 255.0.0.0&lt;br /&gt;
            authenticate no&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Configure /etc/ntp/step-tickers):&lt;br /&gt;
&lt;br /&gt;
          The values for server above are placed in the &amp;quot;/etc/ntp/step-tickers&amp;quot; file&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/ntp/step-tickers&lt;br /&gt;
&lt;br /&gt;
              timeserver1.upenn.edu&lt;br /&gt;
              tock.usno.navy.mil&lt;br /&gt;
              128.4.40.12&lt;br /&gt;
&lt;br /&gt;
          The startup script /etc/rc.d/init.d/ntpd will grab the servers in this&lt;br /&gt;
          file and execute the ntpdate command as follows:&lt;br /&gt;
&lt;br /&gt;
             /usr/sbin/ntpdate -s -b -p 8 timeserver1.upenn.edu&lt;br /&gt;
&lt;br /&gt;
          Why? Because if the time is off ntpd will not start. The command above set the&lt;br /&gt;
          clock. If System Time deviates from true time by more than 1000 seconds, then,&lt;br /&gt;
          the ntpd daemon  will enter panic mode and exit.&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Restart the service and check):&lt;br /&gt;
&lt;br /&gt;
          Issue the restart command&lt;br /&gt;
&lt;br /&gt;
            /etc/init.d/ntpd restart&lt;br /&gt;
&lt;br /&gt;
          check the values for &amp;quot;ntpq -pn&amp;quot;,&lt;br /&gt;
          which should match step 1.&lt;br /&gt;
&lt;br /&gt;
             ntpq -pn&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE:&lt;br /&gt;
&lt;br /&gt;
          Time is always stored in the kernel as the number of seconds since&lt;br /&gt;
          midnight of the 1st of January 1970 UTC, regardless of whether the&lt;br /&gt;
          hardware clock is stored as UTC or not.  Conversions to local time&lt;br /&gt;
          are done at run-time. So, it's easy to get the time in different&lt;br /&gt;
          timezones for only the current session as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ export TZ=EST&lt;br /&gt;
              $ date&lt;br /&gt;
              Mon Aug  2 10:34:04 EST 2004&lt;br /&gt;
&lt;br /&gt;
              $ export TZ=NET&lt;br /&gt;
              $ date&lt;br /&gt;
              Mon Aug  2 15:34:18 NET 2004&lt;br /&gt;
&lt;br /&gt;
          The following are possible values for TZ:&lt;br /&gt;
&lt;br /&gt;
              Hours From Greenwich Mean Time (GMT) Value Description&lt;br /&gt;
              0 GMT Greenwich Mean Time&lt;br /&gt;
              +1 ECT European Central Time&lt;br /&gt;
              +2 EET European Eastern Time&lt;br /&gt;
              +2 ART&lt;br /&gt;
              +3 EAT Saudi Arabia&lt;br /&gt;
              +3.5 MET Iran&lt;br /&gt;
              +4 NET&lt;br /&gt;
              +5 PLT West Asia&lt;br /&gt;
              +5.5 IST India&lt;br /&gt;
              +6 BST Central Asia&lt;br /&gt;
              +7 VST Bangkok&lt;br /&gt;
              +8 CTT China&lt;br /&gt;
              +9 JST Japan&lt;br /&gt;
              +9.5 ACT Central Australia&lt;br /&gt;
              +10 AET Eastern Australia&lt;br /&gt;
              +11 SST Central Pacific&lt;br /&gt;
              +12 NST New Zealand&lt;br /&gt;
              -11 MIT Samoa&lt;br /&gt;
              -10 HST Hawaii&lt;br /&gt;
              -9 AST Alaska&lt;br /&gt;
              -8 PST Pacific Standard Time&lt;br /&gt;
              -7 PNT Arizona&lt;br /&gt;
              -7 MST Mountain Standard Time&lt;br /&gt;
              -6 CST Central Standard Time&lt;br /&gt;
              -5 EST Eastern Standard Time&lt;br /&gt;
              -5 IET Indiana East&lt;br /&gt;
              -4 PRT Atlantic Standard Time&lt;br /&gt;
              -3.5 CNT Newfoundland&lt;br /&gt;
              -3 AGT Eastern South America&lt;br /&gt;
              -3 BET Eastern South America&lt;br /&gt;
              -1 CAT Azores&lt;br /&gt;
&lt;br /&gt;
              DST timezone&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              0      BST for British Summer.&lt;br /&gt;
              +400   ADT for Atlantic Daylight.&lt;br /&gt;
              +500   EDT for Eastern Daylight.&lt;br /&gt;
              +600   CDT for Central Daylight.&lt;br /&gt;
              +700   MDT for Mountain Daylight.&lt;br /&gt;
              +800   PDT for Pacific Daylight.&lt;br /&gt;
              +900   YDT for Yukon Daylight.&lt;br /&gt;
              +1000  HDT for Hawaii Daylight.&lt;br /&gt;
              -100   MEST for Middle European Summer,&lt;br /&gt;
                         MESZ for Middle European Summer,&lt;br /&gt;
                         SST for Swedish Summer and FST for French Summer.&lt;br /&gt;
              -700   WADT for West Australian Daylight.&lt;br /&gt;
              -1000  EADT for Eastern Australian Daylight.&lt;br /&gt;
              -1200  NZDT for New Zealand Daylight.&lt;br /&gt;
&lt;br /&gt;
     The following is an example of setting the TZ environment variable&lt;br /&gt;
     for the timezone, only when timezone changes go into effect.&lt;br /&gt;
&lt;br /&gt;
               $ export TZ=EST+5EDT,M4.1.0/2,M10.5.0/2&lt;br /&gt;
&lt;br /&gt;
     Take a look at the last line &amp;quot;M10.5.0/2&amp;quot;. What does it mean? Here is the&lt;br /&gt;
     documentation&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Mm.w.d This  specifies  day  d (0 &amp;lt;= d &amp;lt;= 6) of week w (1 &amp;lt;= w &amp;lt;= 5) of&lt;br /&gt;
              month m (1 &amp;lt;= m &amp;lt;= 12).  Week 1 is the first week in which day d&lt;br /&gt;
              occurs and week 5 is the last week in which day d occurs.  Day 0&lt;br /&gt;
              is a Sunday.&lt;br /&gt;
&lt;br /&gt;
              The time fields specify when, in the local time  currently  in&lt;br /&gt;
              effect, the  change  to  the  other  time  occurs.   If omitted,&lt;br /&gt;
              the default is  02:00:00.&lt;br /&gt;
&lt;br /&gt;
      So this is what it means. M10 stands for October, the 5 is the fifth week&lt;br /&gt;
      that includes a Sunday (note 0 in M10.5.0/2 is Sunday). To see that it is&lt;br /&gt;
      the fifth week see the calendar below. The time change occurs a 2am in&lt;br /&gt;
      the morning.&lt;br /&gt;
&lt;br /&gt;
                                October&lt;br /&gt;
                         Su Mo Tu We Th Fr Sa&lt;br /&gt;
                                         1  2&lt;br /&gt;
                          3  4  5  6  7  8  9&lt;br /&gt;
                         10 11 12 13 14 15 16&lt;br /&gt;
                         17 18 19 20 21 22 23&lt;br /&gt;
                         24 25 26 27 28 29 30&lt;br /&gt;
                         31&lt;br /&gt;
&lt;br /&gt;
       Prove it. Take the following program sunrise, which can calcuates sunrise&lt;br /&gt;
       and sunset for an latitude and longitude. This program can be downloaded&lt;br /&gt;
       from the following location:&lt;br /&gt;
           http://sourceforge.net/direct-dl/mchirico/souptonuts/working_with_time.tar.gz&lt;br /&gt;
&lt;br /&gt;
       Below is a bash script that will run the program for the next 100 days.&lt;br /&gt;
&lt;br /&gt;
          #!/bin/bash&lt;br /&gt;
          #  program: next100days  Mike Chirico&lt;br /&gt;
          #  download:&lt;br /&gt;
          #  http://sourceforge.net/direct-dl/mchirico/souptonuts/working_with_time.tar.gz&lt;br /&gt;
          #&lt;br /&gt;
          #  This will calculate the sunrise and sunset for&lt;br /&gt;
          #  latitude     39.95  Note must convert to degrees&lt;br /&gt;
          #  longitude  75.15  Note must convert to degrees&lt;br /&gt;
          lat=39.95&lt;br /&gt;
          long=75.15&lt;br /&gt;
          for (( i=0; i &amp;lt;= 100; i++))&lt;br /&gt;
          do&lt;br /&gt;
            sunrise    `date -d &amp;quot;+$i day&amp;quot; &amp;quot;+%Y %m %d&amp;quot;` $lat $long&lt;br /&gt;
          done&lt;br /&gt;
&lt;br /&gt;
       Take a look at the following sample output.&lt;br /&gt;
&lt;br /&gt;
           $ export TZ=EST+5EDT,M4.1.0/2,M10.5.0/2&lt;br /&gt;
           $ ./next100days&lt;br /&gt;
&lt;br /&gt;
          Sunrise  08-24-2004  06:21:12   Sunset 08-24-2004  19:43:42&lt;br /&gt;
          Sunrise  08-25-2004  06:22:09   Sunset 08-25-2004  19:42:12&lt;br /&gt;
          Sunrise  08-26-2004  06:23:06   Sunset 08-26-2004  19:40:41&lt;br /&gt;
          Sunrise  08-27-2004  06:24:03   Sunset 08-27-2004  19:39:09&lt;br /&gt;
          Sunrise  08-28-2004  06:25:00   Sunset 08-28-2004  19:37:37&lt;br /&gt;
          Sunrise  08-29-2004  06:25:56   Sunset 08-29-2004  19:36:04&lt;br /&gt;
          Sunrise  08-30-2004  06:26:53   Sunset 08-30-2004  19:34:31&lt;br /&gt;
          Sunrise  08-31-2004  06:27:50   Sunset 08-31-2004  19:32:57&lt;br /&gt;
          Sunrise  09-01-2004  06:28:46   Sunset 09-01-2004  19:31:22&lt;br /&gt;
          Sunrise  09-02-2004  06:29:43   Sunset 09-02-2004  19:29:47&lt;br /&gt;
          ..[values omitted ]&lt;br /&gt;
          Sunrise  10-28-2004  07:25:31   Sunset 10-28-2004  18:02:34&lt;br /&gt;
          Sunrise  10-29-2004  07:26:38   Sunset 10-29-2004  18:01:19&lt;br /&gt;
          Sunrise  10-30-2004  07:27:46   Sunset 10-30-2004  18:00:06&lt;br /&gt;
          Sunrise  10-31-2004  06:28:53   Sunset 10-31-2004  16:58:54&lt;br /&gt;
          Sunrise  11-01-2004  06:30:01   Sunset 11-01-2004  16:57:44&lt;br /&gt;
          Sunrise  11-02-2004  06:31:10   Sunset 11-02-2004  16:56:35&lt;br /&gt;
&lt;br /&gt;
       Compare 10-30-2004 with 10-31-2004. Sunrise is an hour earlier because&lt;br /&gt;
       daylight saving time has ended, just as predicted.&lt;br /&gt;
&lt;br /&gt;
       There is an easier way to switch between timezones. Take a look at the&lt;br /&gt;
       directory zoneinfo as follows:&lt;br /&gt;
&lt;br /&gt;
            $ ls /usr/share/zoneinfo&lt;br /&gt;
&lt;br /&gt;
            Africa      Chile    Factory    Iceland      Mexico    posix       UCT&lt;br /&gt;
            America     CST6CDT  GB         Indian       Mideast   posixrules  Universal&lt;br /&gt;
            Antarctica  Cuba     GB-Eire    Iran         MST       PRC         US&lt;br /&gt;
            Arctic      EET      GMT        iso3166.tab  MST7MDT   PST8PDT     UTC&lt;br /&gt;
            Asia        Egypt    GMT0       Israel       Navajo    right       WET&lt;br /&gt;
            Atlantic    Eire     GMT-0      Jamaica      NZ        ROC         W-SU&lt;br /&gt;
            Australia   EST      GMT+0      Japan        NZ-CHAT   ROK         zone.tab&lt;br /&gt;
            Brazil      EST5EDT  Greenwich  Kwajalein    Pacific   Singapore   Zulu&lt;br /&gt;
            Canada      Etc      Hongkong   Libya        Poland    SystemV&lt;br /&gt;
            CET         Europe   HST        MET          Portugal  Turkey&lt;br /&gt;
&lt;br /&gt;
       TZ can be set to any one of these files. Some of these are directories and contain&lt;br /&gt;
       subdirectories, such as ./posix/America. This way you don not have to enter the&lt;br /&gt;
       timezone, offset, and range for dst, since it has already been calculated.&lt;br /&gt;
&lt;br /&gt;
           $ export TZ=:/usr/share/zoneinfo/posix/America/Aruba&lt;br /&gt;
           $ export TZ=:/usr/share/zoneinfo/Egypt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Reference:&lt;br /&gt;
          http://prdownloads.sourceforge.net/cpearls/date_calc.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
          Also see  (TIP 27).&lt;br /&gt;
          Also see  (TIP 103) using chrony which is very similiar to ntpd.&lt;br /&gt;
          Note time settings can usually be found in /etc/sysconfig/clock&lt;br /&gt;
         &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 2:&lt;br /&gt;
&lt;br /&gt;
     cpio works like tar, only better.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Create two directories with data ../dir1 an ../dir2)&lt;br /&gt;
&lt;br /&gt;
          mkdir -p ../dir1&lt;br /&gt;
          mkdir -p ../dir2&lt;br /&gt;
          cp /etc/*.conf ../dir1/.&lt;br /&gt;
          cp /etc/*.cnf ../dir2/.&lt;br /&gt;
&lt;br /&gt;
          Which will backup all your cnf and conf files.&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Piping the files to tar)&lt;br /&gt;
&lt;br /&gt;
          cpio works like tar but can take input&lt;br /&gt;
          from the &amp;quot;find&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar &amp;gt; test.tar&lt;br /&gt;
               or&lt;br /&gt;
           $ find ../dir1/ | cpio -o -H tar &amp;gt; test2.tar&lt;br /&gt;
&lt;br /&gt;
          Same command without the &amp;quot;&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar -F test.tar&lt;br /&gt;
              or&lt;br /&gt;
           $ find ../dir1/ | cpio -o -H tar -F test2.tar&lt;br /&gt;
&lt;br /&gt;
          Using append&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar -F test.tar&lt;br /&gt;
             or&lt;br /&gt;
           $ find ../dir2/ | cpio -o --format=tar --append -F test.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (List contents of the tar file)&lt;br /&gt;
&lt;br /&gt;
          $ cpio -it &amp;lt; test.tar&lt;br /&gt;
                or&lt;br /&gt;
          $ cpio -it -F test.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Extract the contents)&lt;br /&gt;
&lt;br /&gt;
          $ cpio -i -F test.tar&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 3:&lt;br /&gt;
&lt;br /&gt;
     Working with tar. The basics with encryption.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Using the tar command on the directory /stuff)&lt;br /&gt;
&lt;br /&gt;
          Suppose you have a directory /stuff&lt;br /&gt;
          To tar everything in stuff to create a &amp;quot;.tar&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
          $ tar -cvf stuff.tar stuff&lt;br /&gt;
&lt;br /&gt;
          Which will create &amp;quot;stuff.tar&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Using the tar command to create a &amp;quot;.tar.gz&amp;quot; of /stuff)&lt;br /&gt;
&lt;br /&gt;
          $ tar -czf stuff.tar.gz stuff&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (List the files in the archive)&lt;br /&gt;
&lt;br /&gt;
          $ tar -tzf stuff.tar.gz&lt;br /&gt;
               or&lt;br /&gt;
          $ tar -tf stuff.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (A way to list specific files)&lt;br /&gt;
&lt;br /&gt;
          Note, pipe the results to a file and edit&lt;br /&gt;
&lt;br /&gt;
           $ tar -tzf stuff.tar.gz &amp;gt; mout&lt;br /&gt;
&lt;br /&gt;
          Then, edit mout to only include the files you want&lt;br /&gt;
&lt;br /&gt;
           $ tar -T mout -xzf stuff.tar.gz&lt;br /&gt;
&lt;br /&gt;
          The above command will only get the files in mout.&lt;br /&gt;
          Of couse, if you want them all&lt;br /&gt;
&lt;br /&gt;
           $ tar -xzf stuff.tar.gz&lt;br /&gt;
&lt;br /&gt;
     STEP 5 (ENCRYPTION)&lt;br /&gt;
&lt;br /&gt;
           $ tar -zcvf - stuff|openssl des3 -salt -k secretpassword | dd of=stuff.des3&lt;br /&gt;
&lt;br /&gt;
          This will create stuff.des3...don't forget the password you&lt;br /&gt;
          put in place of  secretpassword. This can be done interactively as&lt;br /&gt;
          well.&lt;br /&gt;
&lt;br /&gt;
            $ dd if=stuff.des3 |openssl des3 -d -k secretpassword|tar zxf -&lt;br /&gt;
&lt;br /&gt;
     NOTE:  above there is a &amp;quot;-&amp;quot; at the end... this will&lt;br /&gt;
            extract everything.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 4:&lt;br /&gt;
&lt;br /&gt;
     Creating a Virtual File System and Mounting it with a Loopback Device.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Construct a 10MB file)&lt;br /&gt;
&lt;br /&gt;
           $ dd if=/dev/zero of=/tmp/disk-image count=20480&lt;br /&gt;
&lt;br /&gt;
          By default dd uses block of 512 so the size will be 20480*512&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Make an ext2 or ext3 file system) -- ext2 shown here.&lt;br /&gt;
&lt;br /&gt;
           $ mke2fs -q&lt;br /&gt;
&lt;br /&gt;
          or if you want ext3&lt;br /&gt;
&lt;br /&gt;
           $ mkfs -t ext3 -q /tmp/disk-image&lt;br /&gt;
&lt;br /&gt;
          yes, you can even use reiser, but you'll need to create a bigger&lt;br /&gt;
          disk image. Something like &amp;quot;dd if=/dev/zero of=/tmp/disk-image count=50480&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ mkfs -t reiserfs -q /tmp/disk-image&lt;br /&gt;
&lt;br /&gt;
          Hit yes for confirmation.  It only asks this because it's a file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Create a directory &amp;quot;virtual-fs&amp;quot; and mount. This has to be done as root)&lt;br /&gt;
&lt;br /&gt;
           $ mkdir /virtual-fs&lt;br /&gt;
           $ mount -o loop=/dev/loop0 /tmp/disk-image /virtual-fs&lt;br /&gt;
&lt;br /&gt;
         SPECIAL NOTE: if you mount a second device you will have to increase the&lt;br /&gt;
                       loop count: loop=/dev/loop1, loop=/dev/loop2, ... loop=/dev/loopn&lt;br /&gt;
&lt;br /&gt;
          Now it operates just like a disk. This virtual filesystem can be mounted&lt;br /&gt;
          when the system boots by adding the following to the &amp;quot;/etc/fstab&amp;quot; file. Then,&lt;br /&gt;
          to mount, just type &amp;quot;mount /virtual-fs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                 /tmp/disk-image /virtual-fs ext2               rw,loop=/dev/loop0 0 0&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (When done, umount it)&lt;br /&gt;
&lt;br /&gt;
           $ umount /virtual-fs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE: If you are using Fedora core 2, in the /etc/fstab you can take&lt;br /&gt;
              advantage of acl properties for this mount. Note the acl next to the&lt;br /&gt;
              rw entry. This is shown here with ext3.&lt;br /&gt;
&lt;br /&gt;
                 /tmp/disk-image     /virtual-fs ext3    rw,acl,loop=/dev/loop1 0 0&lt;br /&gt;
&lt;br /&gt;
              Also, if you are using Fedora core 2 and above, you can mount the file&lt;br /&gt;
              on a cryptoloop.&lt;br /&gt;
&lt;br /&gt;
                $ dd if=/dev/urandom of=disk-aes count=20480&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ modprobe loop&lt;br /&gt;
                $ modprobe cryptoloop&lt;br /&gt;
                $ modprobe aes&lt;br /&gt;
&lt;br /&gt;
                $ losetup -e aes /dev/loop0 disk-aes&lt;br /&gt;
                $ mkfs -t ext2 /dev/loop0&lt;br /&gt;
                $ mount -o loop,encryption=aes disk-aes &amp;lt;mount point&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              If you do not have Fedora core 2, then, you can build the kernel from source&lt;br /&gt;
              with some of the following options (not complete, yet)&lt;br /&gt;
               reference:&lt;br /&gt;
     http://cvs.sourceforge.net/viewcvs.py/cpearls/cpearls/src/posted_on_sf/acl/ehd.pdf?rev=1.1&amp;amp;view=log&lt;br /&gt;
&lt;br /&gt;
                      Cryptographic API Support (CONFIG_CRYPTO)&lt;br /&gt;
                      generic loop cryptographic (CONFIG_CRYPTOLOOP)&lt;br /&gt;
                      Cryptographic ciphers (CONFIG_CIPHERS)&lt;br /&gt;
                      Enable one or more  ciphers  (CONFIG CIPHER .*) such as AES.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     HELPFUL INFORMATION: It is possible to bind mount partitions, or associate the&lt;br /&gt;
                     mounted partition to a directory name.&lt;br /&gt;
&lt;br /&gt;
                  # mount --bind  /virtual-fs      /home/mchirico/vfs&lt;br /&gt;
&lt;br /&gt;
             Also, if you want to see what filesystems are currently mounted, &amp;quot;cat&amp;quot; the&lt;br /&gt;
             file &amp;quot;/etc/mtab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
                  $ cat /etc/mtab&lt;br /&gt;
&lt;br /&gt;
     Also see TIP 91.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 5:&lt;br /&gt;
&lt;br /&gt;
     Setting up 2 IP address on &amp;quot;One&amp;quot; NIC. This example is on ethernet.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (The settings for the initial IP address)&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
&lt;br /&gt;
            DEVICE=eth0&lt;br /&gt;
            BOOTPROTO=static&lt;br /&gt;
            BROADCAST=192.168.99.255&lt;br /&gt;
            IPADDR=192.168.1.155&lt;br /&gt;
            NETMASK=255.255.252.0&lt;br /&gt;
            NETWORK=192.168.1.0&lt;br /&gt;
            ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (2nd IP address: )&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/sysconfig/network-scripts/ifcfg-eth0:1&lt;br /&gt;
&lt;br /&gt;
            DEVICE=eth0:1&lt;br /&gt;
            BOOTPROTO=static&lt;br /&gt;
            BROADCAST=192.168.99.255&lt;br /&gt;
            IPADDR=192.168.1.182&lt;br /&gt;
            NETMASK=255.255.252.0&lt;br /&gt;
            NETWORK=192.168.1.0&lt;br /&gt;
            ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
     SUMMARY  Note, in STEP 1 the filename is &amp;quot;ifcfg-eth0&amp;quot;, whereas in&lt;br /&gt;
              STEP 2 it's &amp;quot;ifcfg-eth0:1&amp;quot; and also not the matching&lt;br /&gt;
              entries for &amp;quot;DEVICE=...&amp;quot;.  Also, obviously, the&lt;br /&gt;
              &amp;quot;IPADDR&amp;quot; is different as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 6:&lt;br /&gt;
&lt;br /&gt;
     Sharing Directories Among Several Users.&lt;br /&gt;
&lt;br /&gt;
     Several people are working on a project in &amp;quot;/home/share&amp;quot;&lt;br /&gt;
     and they need to create documents and programs so that&lt;br /&gt;
     others in the group can edit and execute these documents&lt;br /&gt;
     as needed. Also see (TIP 186) for adding existing users&lt;br /&gt;
     to groups.&lt;br /&gt;
&lt;br /&gt;
       $  /usr/sbin/groupadd share&lt;br /&gt;
       $  chown -R root.share /home/share&lt;br /&gt;
       $  /usr/bin/gpasswd -a &amp;lt;username&amp;gt; share&lt;br /&gt;
       $  chmod 2775 /home/share&lt;br /&gt;
&lt;br /&gt;
       $  ls -ld /home/share&lt;br /&gt;
             drwxrwsr-x    2 root     share        4096 Nov  8 16:19 /home/share&lt;br /&gt;
                   ^---------- Note the s bit, which was set with the chmod 2775&lt;br /&gt;
&lt;br /&gt;
       $  cat /etc/group&lt;br /&gt;
          ...&lt;br /&gt;
           share:x:502:chirico,donkey,zoe&lt;br /&gt;
          ...          ^------- users are added to this group.&lt;br /&gt;
&lt;br /&gt;
     The user may need to login again to get access. Or, if the user is currently&lt;br /&gt;
     logged in, they can run the following command:&lt;br /&gt;
&lt;br /&gt;
       $ su - &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Note, the above step is recommended over  &amp;quot;newgrp - share&amp;quot; since currently&lt;br /&gt;
     newgrp in FC2,FC3, and FC4 gets access to the group but the umask is not&lt;br /&gt;
     correctly formed.&lt;br /&gt;
&lt;br /&gt;
     As root you  can test their account.&lt;br /&gt;
&lt;br /&gt;
       $ su - &amp;lt;username&amp;gt;   &amp;quot;You need to '-' to pickup thier environment  '$ su - chirico' &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Note: SUID, SGID, Sticky bit. Only the left most octet is examined, and &amp;quot;chmod 755&amp;quot; is used&lt;br /&gt;
          as an example of the full command. But, anything else could be used as well. Normally&lt;br /&gt;
          you'd want executable permissions.&lt;br /&gt;
&lt;br /&gt;
        Octal digit  Binary value      Meaning                           Example usage&lt;br /&gt;
            0           000       all cleared                             $ chmod 0755 or chmod 755&lt;br /&gt;
            1           001       sticky                                  $ chmod 1755&lt;br /&gt;
            2           010       setgid                                  $ chmod 2755&lt;br /&gt;
            3           011       setgid, sticky                          $ chmod 3755&lt;br /&gt;
            4           100       setuid                                  $ chmod 4755&lt;br /&gt;
            5           101       setuid, sticky                          $ chmod 5755&lt;br /&gt;
            6           110       setuid, setgid                          $ chmod 6755&lt;br /&gt;
            7           111       setuid, setgid, sticky                  $ chmod 7755&lt;br /&gt;
&lt;br /&gt;
     A few examples applied to a directory below. In the first example all users in the group can&lt;br /&gt;
     add files to directory &amp;quot;dirA&amp;quot; and they can delete their own files. Users cannot delete other&lt;br /&gt;
     user's files.&lt;br /&gt;
&lt;br /&gt;
        Sticky bit:&lt;br /&gt;
           $ chmod 1770  dirA&lt;br /&gt;
&lt;br /&gt;
     Below files created within the directory have the group ID of the directory, rather than that&lt;br /&gt;
     of the default group setting for the user who created the file.&lt;br /&gt;
&lt;br /&gt;
        Set group ID bit:&lt;br /&gt;
           $ chmod 2755  dirB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 7:&lt;br /&gt;
&lt;br /&gt;
     Getting Infomation on Commands&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;info&amp;quot; is a great utility for getting information about the system.&lt;br /&gt;
     Here's a quick key on using &amp;quot;info&amp;quot; from the terminal prompt.&lt;br /&gt;
&lt;br /&gt;
       'q' exits.&lt;br /&gt;
       'u' moves up to the table of contents of the current section.&lt;br /&gt;
       'n' moves to the next chapter.&lt;br /&gt;
       'p' moves to the previous chapter.&lt;br /&gt;
       'space' goes into the selected section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The following is a good starting point:&lt;br /&gt;
&lt;br /&gt;
        $ info coreutils&lt;br /&gt;
&lt;br /&gt;
      Need to find out what a certain program does?&lt;br /&gt;
&lt;br /&gt;
        $ whatis  open&lt;br /&gt;
       open   (2)  - open and possibly create a file or device&lt;br /&gt;
       open   (3)  - perl pragma to set default PerlIO layers for input and output&lt;br /&gt;
       open   (3pm)  - perl pragma to set default PerlIO layers for input and output&lt;br /&gt;
       open   (n)  - Open a file-based or command pipeline channel&lt;br /&gt;
&lt;br /&gt;
      To get specific information about the open commmand&lt;br /&gt;
&lt;br /&gt;
        $ man 2 open&lt;br /&gt;
&lt;br /&gt;
       also try 'keyword' search, which is the same as the apropos command.&lt;br /&gt;
       For example, to find all the man pages on selinux, type the following:&lt;br /&gt;
&lt;br /&gt;
        $ man -k selinux&lt;br /&gt;
&lt;br /&gt;
       or the man full word search. Same as whatis command.&lt;br /&gt;
&lt;br /&gt;
        $ man -f &amp;lt;some string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       This is a hint once you are inside man.&lt;br /&gt;
&lt;br /&gt;
        space      moves forward one page&lt;br /&gt;
        b          moves backward&lt;br /&gt;
        y          scrolls up one line &amp;quot;yikes, I missed it!&amp;quot;&lt;br /&gt;
        g          goes to the beginning&lt;br /&gt;
        q          quits&lt;br /&gt;
        /&amp;lt;string&amp;gt;  search, repeat seach n&lt;br /&gt;
        m          mark, enter a letter like &amp;quot;a&amp;quot;, then, ' to go back&lt;br /&gt;
        '          enter a letter that is marked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       To get section numbers&lt;br /&gt;
&lt;br /&gt;
        $ man 8 ping&lt;br /&gt;
&lt;br /&gt;
       Note the numbers are used as follows&lt;br /&gt;
         (This is OpenBSD)&lt;br /&gt;
&lt;br /&gt;
         1  General Commands&lt;br /&gt;
         2  System Calls and Error Numbers&lt;br /&gt;
         3  C Libraries&lt;br /&gt;
         3p perl&lt;br /&gt;
         4  Devices and device drivers&lt;br /&gt;
         5  File Formats and config files&lt;br /&gt;
         6  Game instructions&lt;br /&gt;
         7  Miscellaneous information&lt;br /&gt;
         8  System maintenance&lt;br /&gt;
         9  Kernel internals&lt;br /&gt;
&lt;br /&gt;
       To find the man page directly, &amp;quot;ls&amp;quot; command:&lt;br /&gt;
&lt;br /&gt;
         $ whereis -m ls&lt;br /&gt;
         ls: /usr/share/man/man1/ls.1.gz /usr/share/man/man1/ls.1 /usr/share/man/man1p/ls.1p&lt;br /&gt;
&lt;br /&gt;
       To read this file directly, do the following:&lt;br /&gt;
&lt;br /&gt;
         $ man /usr/share/man/man1/ls.1.gz&lt;br /&gt;
&lt;br /&gt;
       If you want to know the manpath, execute manpath.&lt;br /&gt;
&lt;br /&gt;
         $ manpath&lt;br /&gt;
         /usr/share/man:/usr/X11R6/man:/usr/local/share/man:/usr/local/pgsql/man:/usr/man:/usr/local/man&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 8:&lt;br /&gt;
&lt;br /&gt;
     How to Put a &amp;quot;Running Job&amp;quot; in the Background.&lt;br /&gt;
&lt;br /&gt;
     You're running a job at the terminal prompt, and it's taking&lt;br /&gt;
     a very long time. You want to put the job in the backgroud.&lt;br /&gt;
&lt;br /&gt;
       &amp;quot;CTL - z&amp;quot; Temporarily suspends the job&lt;br /&gt;
       $ jobs     This will list all the jobs&lt;br /&gt;
       $ bg %jobnumber (bg %1)  To run in the background&lt;br /&gt;
       $ fg %jobnumber          To bring back in the foreground&lt;br /&gt;
&lt;br /&gt;
     Need to kill all jobs -- say you're using several suspended&lt;br /&gt;
     emacs sessions and you just want everything to exit.&lt;br /&gt;
&lt;br /&gt;
       $ kill -9  `jobs -p`&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;jobs -p&amp;quot; gives the process number of each job, and the&lt;br /&gt;
     kill -9 kills everything. Yes, sometimes &amp;quot;kill -9&amp;quot; is excessive&lt;br /&gt;
     and you should issue a &amp;quot;kill -15&amp;quot; that allows jobs to clean-up.&lt;br /&gt;
     However, for exacs session, I prefer &amp;quot;kill -9&amp;quot; and haven't had&lt;br /&gt;
     a problem.&lt;br /&gt;
&lt;br /&gt;
     Sometimes you need to list the process id along with job&lt;br /&gt;
     information. For instance, here's process id with the listing.&lt;br /&gt;
&lt;br /&gt;
       $ jobs -l&lt;br /&gt;
&lt;br /&gt;
     Note you can also renice a job, or give it lower priority.&lt;br /&gt;
&lt;br /&gt;
       $ nice -n +15 find . -ctime 2 -type f  -exec ls {} \; &amp;gt; last48hours&lt;br /&gt;
        ^z&lt;br /&gt;
       $  bg&lt;br /&gt;
&lt;br /&gt;
     So above that was a ctl-z to suppend. Then, bg to run it in&lt;br /&gt;
     the background. Now, if you want to change the priority lower&lt;br /&gt;
     you just renice it, once you know the process id.&lt;br /&gt;
&lt;br /&gt;
       $ jobs -pl&lt;br /&gt;
   [1]+ 29388 Running                 nice -n +15 find . -ctime 2 -exec ls -l {} \; &amp;gt;mout &amp;amp;&lt;br /&gt;
&lt;br /&gt;
       $ renice +30 -p 29388&lt;br /&gt;
        29388: old priority 15, new priority 19&lt;br /&gt;
&lt;br /&gt;
      19 was the lowest priority for this job. You cannot increase&lt;br /&gt;
      the priority unless you are root.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 9:&lt;br /&gt;
&lt;br /&gt;
     Need to Delete a File for Good -- not even GOD can recover.&lt;br /&gt;
&lt;br /&gt;
     You have a file &amp;quot;secret&amp;quot;.  The following makes it so no one&lt;br /&gt;
     can read it.  If the file was 12 bytes, it's now 4096 after it&lt;br /&gt;
     has been over written 100 times.  There's no way to recover this.&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z secret&lt;br /&gt;
&lt;br /&gt;
     Want to remove the file? Use the &amp;quot;u&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z -u test2&lt;br /&gt;
&lt;br /&gt;
     It can be applied to a device&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z -u /dev/fd0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       CAUTION: Note that shred relies on a very important assumption: that the file system  overwrites  data&lt;br /&gt;
       in  place.   This is the traditional way to do things, but many modern file system designs do not sat-&lt;br /&gt;
       isfy this assumption.  The following are examples of file systems on which shred is not effective,  or&lt;br /&gt;
       is not guaranteed to be effective in all file system modes:&lt;br /&gt;
&lt;br /&gt;
       * log-structured or journaled file systems, such as those supplied with&lt;br /&gt;
&lt;br /&gt;
              AIX and Solaris (and JFS, ReiserFS, XFS, Ext3, etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 52).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 10:&lt;br /&gt;
&lt;br /&gt;
     Who and What is doing What on Your System - finding open sockets,&lt;br /&gt;
     files etc.&lt;br /&gt;
&lt;br /&gt;
       $ lsof&lt;br /&gt;
          or as root&lt;br /&gt;
       $ watch lsof -i&lt;br /&gt;
&lt;br /&gt;
     To list all open Internet files, use:&lt;br /&gt;
&lt;br /&gt;
       $ lsof -i -U&lt;br /&gt;
&lt;br /&gt;
       (See TIP 118)&lt;br /&gt;
&lt;br /&gt;
     Also try fuser. Suppose you have a mounted file-system, and you need&lt;br /&gt;
     to umount it. To list the users on the file-system /work&lt;br /&gt;
&lt;br /&gt;
       $ fuser -u /work&lt;br /&gt;
&lt;br /&gt;
     To kill all processes accessing the file system /work  in  any way.&lt;br /&gt;
&lt;br /&gt;
       $ fuser -km /work&lt;br /&gt;
&lt;br /&gt;
     Or better yet, maybe you want to eject a cdrom on /mnt/cdrom&lt;br /&gt;
&lt;br /&gt;
       $ fuser -km /mnt/cdrom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     If you need IO load information about your system, you can execute&lt;br /&gt;
     iostat. But note, the very first iostat gives a snapshot since&lt;br /&gt;
     the last boot. You typically want the following command, which gives&lt;br /&gt;
     you 3 outputs every 5 seconds.&lt;br /&gt;
&lt;br /&gt;
       $ iostat -xtc 5 3&lt;br /&gt;
       Linux 2.6.12-1.1376_FC3smp (squeezel.squeezel.com) 	10/05/2005&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:04 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  0.97    0.06    1.94    0.62   96.41&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:09 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  0.60    0.00    1.70    0.00   97.70&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:14 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  1.00    0.00    1.60    0.00   97.39&lt;br /&gt;
&lt;br /&gt;
     vmstat reports memory statistics.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ vmstat&lt;br /&gt;
       $ ifconfig&lt;br /&gt;
       $ cat /proc/sys/vm/.. (entries under here)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      *NOTE: (TIP 77) shows sample usage of &amp;quot;ifconfig&amp;quot;. Also&lt;br /&gt;
       (TIP 84) shows sample output of &amp;quot;$ cat /proc/cpuinfo&amp;quot;. You can download iostat&lt;br /&gt;
       and other packages from (http://perso.wanadoo.fr/sebastien.godard/download_en.html).&lt;br /&gt;
       You also may want to look at iozone (TIP 178).&lt;br /&gt;
&lt;br /&gt;
     Also&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/meminfo&lt;br /&gt;
       $ cat /proc/stat&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/uptime&lt;br /&gt;
       1078623.55 1048008.34       First number is the number of seconds since boot.&lt;br /&gt;
                                   The second number is the number of idle seconds.&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/loadavg&lt;br /&gt;
       0.25 0.14 0.10 1/166 7778   This shows load at 1,5, and 15 minutes,&lt;br /&gt;
                                   a total of 1 current running process out&lt;br /&gt;
                                   from a total of 166. The 7778 is the last&lt;br /&gt;
                                   process id used.&lt;br /&gt;
                                   Ref: http://www.teamquest.com/resources/gunther/ldavg1.shtml&lt;br /&gt;
&lt;br /&gt;
     Or current process open file descriptors&lt;br /&gt;
&lt;br /&gt;
        $ ls -l /proc/self/fd/0&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lr-x------    1 chirico  chirico        64 Jun 29 13:17 3 -&amp;gt; /proc/26667/fd&lt;br /&gt;
&lt;br /&gt;
      So you could, $ echo &amp;quot;stuff&amp;quot; &amp;gt; /dev/pts/51, to get output. Note, tree is also&lt;br /&gt;
      helpful here:&lt;br /&gt;
&lt;br /&gt;
         $ tree /proc/self&lt;br /&gt;
&lt;br /&gt;
            /proc/self&lt;br /&gt;
            |-- auxv&lt;br /&gt;
            |-- cmdline&lt;br /&gt;
            |-- cwd -&amp;gt; /work/souptonuts/documentation/theBook&lt;br /&gt;
            |-- environ&lt;br /&gt;
            |-- exe -&amp;gt; /usr/bin/tree&lt;br /&gt;
            |-- fd&lt;br /&gt;
            |   |-- 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   |-- 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   |-- 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   `-- 3 -&amp;gt; /proc/26668/fd&lt;br /&gt;
            |-- maps&lt;br /&gt;
            |-- mem&lt;br /&gt;
            |-- mounts&lt;br /&gt;
            |-- root -&amp;gt; /&lt;br /&gt;
            |-- stat&lt;br /&gt;
            |-- statm&lt;br /&gt;
            |-- status&lt;br /&gt;
            |-- task&lt;br /&gt;
            |   `-- 26668&lt;br /&gt;
            |       |-- auxv&lt;br /&gt;
            |       |-- cmdline&lt;br /&gt;
            |       |-- cwd -&amp;gt; /work/souptonuts/documentation/theBook&lt;br /&gt;
            |       |-- environ&lt;br /&gt;
            |       |-- exe -&amp;gt; /usr/bin/tree&lt;br /&gt;
            |       |-- fd&lt;br /&gt;
            |       |   |-- 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   |-- 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   |-- 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   `-- 3 -&amp;gt; /proc/26668/task/26668/fd&lt;br /&gt;
            |       |-- maps&lt;br /&gt;
            |       |-- mem&lt;br /&gt;
            |       |-- mounts&lt;br /&gt;
            |       |-- root -&amp;gt; /&lt;br /&gt;
            |       |-- stat&lt;br /&gt;
            |       |-- statm&lt;br /&gt;
            |       |-- status&lt;br /&gt;
            |       `-- wchan&lt;br /&gt;
            `-- wchan&lt;br /&gt;
&lt;br /&gt;
            10 directories, 28 files&lt;br /&gt;
&lt;br /&gt;
     Need a listing of the system settings?&lt;br /&gt;
&lt;br /&gt;
       $ sysctl -a&lt;br /&gt;
&lt;br /&gt;
     Need IPC (Shared Memory Segments, Semaphore Arrays, Message Queue) status&lt;br /&gt;
     etc?&lt;br /&gt;
&lt;br /&gt;
       $ ipcs&lt;br /&gt;
       $ ipcs -l  &amp;quot;This gives limits&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Need to &amp;quot;watch&amp;quot; everything a user does?  The following watches donkey.&lt;br /&gt;
&lt;br /&gt;
       $ watch lsof -u donkey&lt;br /&gt;
&lt;br /&gt;
     Or, to see what in  going on in directory &amp;quot;/work/junk&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       $ watch lsof +D /work/junk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 11:&lt;br /&gt;
&lt;br /&gt;
     How to make a File &amp;quot;immutable&amp;quot; or &amp;quot;unalterable&amp;quot; -- it cannot be changed&lt;br /&gt;
     or deleted even by root. Note this works on (ext2/ext3) filesystems.&lt;br /&gt;
     And, yes, root can delete after it's changed back.&lt;br /&gt;
&lt;br /&gt;
     As root:&lt;br /&gt;
&lt;br /&gt;
       $ chattr +i filename&lt;br /&gt;
&lt;br /&gt;
     And to change it back:&lt;br /&gt;
&lt;br /&gt;
       $ chattr -i filename&lt;br /&gt;
&lt;br /&gt;
     List attributes&lt;br /&gt;
&lt;br /&gt;
       $ lsattr filename&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 12:&lt;br /&gt;
&lt;br /&gt;
     SSH - How to Generate the Key Pair.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     On the local server&lt;br /&gt;
&lt;br /&gt;
       $  ssh-keygen -t dsa -b 2048&lt;br /&gt;
&lt;br /&gt;
     This will create the two files:&lt;br /&gt;
&lt;br /&gt;
            .ssh/id_dsa (Private key)&lt;br /&gt;
            .ssh/id_dsa.pub  (Public key you can share)&lt;br /&gt;
&lt;br /&gt;
     Next insert &amp;quot;.ssh/id_dsa.pub&amp;quot; on the remote server&lt;br /&gt;
     in the file  &amp;quot;.ssh/authorized_keys&amp;quot; and &amp;quot;.ssh/authorized_keys2&amp;quot;&lt;br /&gt;
     and change the  permission of each file to (chmod 600). Plus, make&lt;br /&gt;
     sure the directory &amp;quot;.ssh&amp;quot; exists on the remote computer with 700 rights.&lt;br /&gt;
     Ok, assuming  192.168.1.155 is the remote server and &amp;quot;donkey&amp;quot; is the&lt;br /&gt;
     account on that remote server.&lt;br /&gt;
&lt;br /&gt;
       $ ssh donkey@192.168.1.155 &amp;quot;mkdir -p .ssh&amp;quot;&lt;br /&gt;
       $ ssh donkey@192.168.1.155 &amp;quot;chmod 700 .ssh&amp;quot;&lt;br /&gt;
       $ scp ./.ssh/id_dsa.pub  donkey@192.168.1.155:.ssh/newkey.pub&lt;br /&gt;
&lt;br /&gt;
     Now connect to that remote server &amp;quot;192.168.1.155&amp;quot; and add .ssh/newkey.pub&lt;br /&gt;
     to both &amp;quot;authorized_keys&amp;quot; and &amp;quot;authorized_keys2&amp;quot;.  When done, the permission&lt;br /&gt;
     on&lt;br /&gt;
       (This is on the remote server)&lt;br /&gt;
&lt;br /&gt;
        $chmod 600 .ssh/authorized_key*&lt;br /&gt;
&lt;br /&gt;
     Next, go back to the local server and issue the following:&lt;br /&gt;
&lt;br /&gt;
        $ ssh-agent $SHELL&lt;br /&gt;
        $ ssh-add&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;ssh-add&amp;quot; will allow you to enter the passphrase and it will&lt;br /&gt;
     save it for the current login session.&lt;br /&gt;
&lt;br /&gt;
     You don't have to enter a password when running &amp;quot;ssh-keygen&amp;quot; above. But,&lt;br /&gt;
     remember anyone with root access can &amp;quot;su - &amp;lt;username&amp;gt;&amp;quot; and then connect&lt;br /&gt;
     to your computers.  It's harder, however, not impossible, for root to do&lt;br /&gt;
     this if  you have a password.&lt;br /&gt;
&lt;br /&gt;
     (Reference TIP 151)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 13:&lt;br /&gt;
&lt;br /&gt;
     Securing the System: Don't allow root to login remotely.  Instead,&lt;br /&gt;
     the admin could login as another account, then, &amp;quot;su -&amp;quot;.  However,&lt;br /&gt;
     root can still login &amp;quot;from the local terminal&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     In the &amp;quot;/etc/ssh/sshd_config&amp;quot; file change the following lines:&lt;br /&gt;
&lt;br /&gt;
        Protocol 2&lt;br /&gt;
        PermitRootLogin no&lt;br /&gt;
        PermitEmptyPasswords no&lt;br /&gt;
&lt;br /&gt;
     Then, restart ssh&lt;br /&gt;
&lt;br /&gt;
        /etc/init.d/sshd restart&lt;br /&gt;
&lt;br /&gt;
     Why would you want to do this?  It's not possible for anyone to guess&lt;br /&gt;
     or keep trying the root account.  This is especially good for computers&lt;br /&gt;
     on the Internet. So, even if the &amp;quot;root&amp;quot; passwords is known, they can't&lt;br /&gt;
     get access to the system remotely.  Only from the terminal, which is locked&lt;br /&gt;
     in your computer room. However, if anyone has a account on the server,&lt;br /&gt;
     then, they can login under their  account then &amp;quot;su -&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Suppose you only want a limited number of users:  &amp;quot;mchirico&amp;quot; and &amp;quot;donkey&amp;quot;.&lt;br /&gt;
     Add the following line to &amp;quot;/etc/ssh/sshd_config&amp;quot;. Note, this allows access&lt;br /&gt;
     for chirico and donkey, but everyone else is denied.&lt;br /&gt;
&lt;br /&gt;
         #  Once you add AllowUsers - everyone else is denied.&lt;br /&gt;
         AllowUsers mchirico donkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 14:&lt;br /&gt;
&lt;br /&gt;
     Keep Logs Longer with Less Space.&lt;br /&gt;
&lt;br /&gt;
     Normally logs rotate monthly, over writing all the old data.  Here's a&lt;br /&gt;
     sample &amp;quot;/etc/logrotate.conf&amp;quot; that will keep 12 months of backup&lt;br /&gt;
     compressing the logfiles&lt;br /&gt;
&lt;br /&gt;
       $ cat /etc/logrotate.conf&lt;br /&gt;
&lt;br /&gt;
             # see &amp;quot;man logrotate&amp;quot; for details&lt;br /&gt;
             # rotate log files weekly&lt;br /&gt;
             #chirico changes to monthly&lt;br /&gt;
             monthly&lt;br /&gt;
&lt;br /&gt;
             # keep 4 weeks worth of backlogs&lt;br /&gt;
             # keep 12 months of backup&lt;br /&gt;
             rotate 12&lt;br /&gt;
&lt;br /&gt;
             # create new (empty) log files after rotating old ones&lt;br /&gt;
             create&lt;br /&gt;
&lt;br /&gt;
             # uncomment this if you want your log files compressed&lt;br /&gt;
             compress&lt;br /&gt;
&lt;br /&gt;
             # RPM packages drop log rotation information into this directory&lt;br /&gt;
             include /etc/logrotate.d&lt;br /&gt;
&lt;br /&gt;
             # no packages own wtmp -- we'll rotate them here&lt;br /&gt;
             /var/log/wtmp {&lt;br /&gt;
                 monthly&lt;br /&gt;
                 create 0664 root utmp&lt;br /&gt;
                 rotate 1&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
             # system-specific logs may be also be configured here.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Note: see tip 1. The clock should always be correctly set.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 15:&lt;br /&gt;
&lt;br /&gt;
     What Network Services are Running?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -atup&lt;br /&gt;
&lt;br /&gt;
     or&lt;br /&gt;
&lt;br /&gt;
          $ netstat -ap|grep LISTEN|less&lt;br /&gt;
&lt;br /&gt;
     This can be helpful to determine the services running.&lt;br /&gt;
&lt;br /&gt;
     Need stats on dropped UDP packets?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s -u&lt;br /&gt;
&lt;br /&gt;
     or TCP&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s -t&lt;br /&gt;
&lt;br /&gt;
     or summary of everything&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s&lt;br /&gt;
&lt;br /&gt;
     or looking for error rates on the interface?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -i&lt;br /&gt;
&lt;br /&gt;
     Listening interfaces?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -l&lt;br /&gt;
&lt;br /&gt;
     (Tip above provided by Amos Shapira)&lt;br /&gt;
&lt;br /&gt;
     Also see TIP 77.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 16:&lt;br /&gt;
&lt;br /&gt;
     Apache: Creating and Using an &amp;quot;.htaccess&amp;quot; File&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Below is a sample &amp;quot;.htaccess&amp;quot; file which goes in&lt;br /&gt;
     &amp;quot;/usr/local/apache/htdocs/chirico/alpha/.htaccess&amp;quot; for this&lt;br /&gt;
     example&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         AuthUserFile /usr/local/apache/htdocs/chirico/alpha/.htpasswd&lt;br /&gt;
         AuthGroupFile /dev/null&lt;br /&gt;
         AuthName &amp;quot;Your Name and regular password required&amp;quot;&lt;br /&gt;
         AuthType Basic&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;Limit GET POST&amp;gt;&lt;br /&gt;
         require valid-user&lt;br /&gt;
         &amp;lt;/Limit&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    In order for this to work /usr/local/apache/conf/httpd.conf must&lt;br /&gt;
    have the following line in it:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       #&lt;br /&gt;
       &amp;lt;Directory /usr/local/apache/htdocs/chirico/alpha&amp;gt;&lt;br /&gt;
           AllowOverride FileInfo AuthConfig Limit&lt;br /&gt;
           Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec&lt;br /&gt;
           &amp;lt;Limit GET POST OPTIONS PROPFIND&amp;gt;&lt;br /&gt;
               Order allow,deny&lt;br /&gt;
               Allow from all&lt;br /&gt;
           &amp;lt;/Limit&amp;gt;&lt;br /&gt;
           &amp;lt;LimitExcept GET POST OPTIONS PROPFIND&amp;gt;&lt;br /&gt;
               Order deny,allow&lt;br /&gt;
               Deny from all&lt;br /&gt;
           &amp;lt;/LimitExcept&amp;gt;&lt;br /&gt;
       &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Also, a password file must be created&lt;br /&gt;
&lt;br /&gt;
      $ /usr/local/apache/bin/htpasswd -c .htpasswd chirico&lt;br /&gt;
&lt;br /&gt;
    And enter the user names and passwords.&lt;br /&gt;
&lt;br /&gt;
    Next Reload Apache:&lt;br /&gt;
&lt;br /&gt;
      $ /etc/init.d/httpd reload&lt;br /&gt;
&lt;br /&gt;
    (Reference TIP 213 limit access to certain directories based on IP address).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 17:&lt;br /&gt;
&lt;br /&gt;
     Working with &amp;quot;mt&amp;quot; Commands: reading and writing to tape.&lt;br /&gt;
&lt;br /&gt;
     The following assumes the tape device is &amp;quot;/dev/st0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     STEP 1 ( rewind the tape)&lt;br /&gt;
&lt;br /&gt;
          # mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (check to see if you are at block 0)&lt;br /&gt;
&lt;br /&gt;
          # mt -f /dev/nst0 tell&lt;br /&gt;
            At block 0.&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Backup &amp;quot;tar compress&amp;quot;  directories &amp;quot;one&amp;quot;  and &amp;quot;two&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
          # tar -czf /dev/nst0 one two&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Check to see what block you are at)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
&lt;br /&gt;
       You should get something like block 2 at this point.&lt;br /&gt;
&lt;br /&gt;
     STEP 5 (Rewind the tape)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
     STEP 6 (List the files)&lt;br /&gt;
&lt;br /&gt;
           # tar -tzf /dev/nst0&lt;br /&gt;
              one/&lt;br /&gt;
              one/test&lt;br /&gt;
              two/&lt;br /&gt;
&lt;br /&gt;
     STEP 7 (Restore directory &amp;quot;one&amp;quot;  into directory &amp;quot;junk&amp;quot;).  Note, you&lt;br /&gt;
          have to first rewind the tape, since the last operation moved&lt;br /&gt;
          ahead 2 blocks. Check this with &amp;quot;mt -f /dev/nst0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           # cd junk&lt;br /&gt;
           # mt -f /dev/nst0 rewind&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
              At block 0.&lt;br /&gt;
           # tar -xzf /dev/nst0 one&lt;br /&gt;
&lt;br /&gt;
     STEP 8 (Next, take a look to see what block the tape is at)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
              At block 2.&lt;br /&gt;
&lt;br /&gt;
     STEP 9 (Now backup directories three  and four)&lt;br /&gt;
&lt;br /&gt;
           # tar -czf /dev/nst0 three four&lt;br /&gt;
&lt;br /&gt;
       After backing up the files, the tape should be past block 2.&lt;br /&gt;
       Check this.&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
             At block 4.&lt;br /&gt;
&lt;br /&gt;
          Currently the following exist:&lt;br /&gt;
&lt;br /&gt;
                At block 1:&lt;br /&gt;
                     one/&lt;br /&gt;
                    one/test&lt;br /&gt;
                    two/&lt;br /&gt;
&lt;br /&gt;
                At block 2:&lt;br /&gt;
                    three/&lt;br /&gt;
                    three/samplehere&lt;br /&gt;
                    four/&lt;br /&gt;
&lt;br /&gt;
                At block 4:&lt;br /&gt;
                    (* This is empty *)&lt;br /&gt;
&lt;br /&gt;
     A few notes. You can set the blocking factor and a label&lt;br /&gt;
     with tar. For example:&lt;br /&gt;
&lt;br /&gt;
      $ tar --label=&amp;quot;temp label&amp;quot; --create  --blocking-factor=128 --file=/dev/nst0 Notes&lt;br /&gt;
&lt;br /&gt;
     But note if you try to read it with the default, incorrect blocking&lt;br /&gt;
     factor, then, you will get the following error:&lt;br /&gt;
&lt;br /&gt;
        $ tar -t   --file=/dev/nst0&lt;br /&gt;
        tar: /dev/nst0: Cannot read: Cannot allocate memory&lt;br /&gt;
        tar: At beginning of tape, quitting now&lt;br /&gt;
        tar: Error is not recoverable: exiting now&lt;br /&gt;
&lt;br /&gt;
     However this is easily fixed with the correct blocking factor&lt;br /&gt;
&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ tar -t --blocking-factor=128 --file=/dev/nst0&lt;br /&gt;
         temp label&lt;br /&gt;
         Notes&lt;br /&gt;
&lt;br /&gt;
     Take advantage of the label command.&lt;br /&gt;
&lt;br /&gt;
         $ MYCOMMENTS=&amp;quot;Big_important_tape&amp;quot;&lt;br /&gt;
         $ tar --label=&amp;quot;$(date +%F)&amp;quot;+&amp;quot;${MYCOMMENTS}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Writing to tape on a remote 192.168.1.155 computer&lt;br /&gt;
&lt;br /&gt;
         $ tar cvzf - ./tmp | ssh -l chirico 192.168.1.155 '(mt -f /dev/nst0 rewind; dd of=/dev/st0 )'&lt;br /&gt;
&lt;br /&gt;
     Restoring the contents from tape on a remote computer&lt;br /&gt;
&lt;br /&gt;
         $ ssh -l chirico 192.168.1.155 '(mt -f /dev/nst0 rewind; dd if=/dev/st0  )'|tar xzf -&lt;br /&gt;
&lt;br /&gt;
     Getting data off of tape with dd command with odd blocking factor. Just set ibs very high&lt;br /&gt;
&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ tar --label=&amp;quot;Contenets of Notes&amp;quot; --create  --blocking-factor=128 --file=/dev/nst0 Notes&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ dd ibs=1048576 if=/dev/st0 of=notes.tar&lt;br /&gt;
&lt;br /&gt;
     The above will probably work with ibs=64k as well&lt;br /&gt;
&lt;br /&gt;
        (Also see TIP 136)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 18:&lt;br /&gt;
&lt;br /&gt;
     Encrypting Data to Tape using &amp;quot;tar&amp;quot; and &amp;quot;openssl&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     The following shows an example of writing the contents of &amp;quot;tapetest&amp;quot; to tape:&lt;br /&gt;
&lt;br /&gt;
        $ tar zcvf - tapetest|openssl des3 -salt  -k secretpassword | dd of=/dev/st0&lt;br /&gt;
&lt;br /&gt;
     Reading the data back:&lt;br /&gt;
&lt;br /&gt;
        $ dd if=/dev/st0|openssl des3 -d -k secretpassword|tar xzf -&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 19:&lt;br /&gt;
&lt;br /&gt;
     Mounting an ISO Image as a Filesystem -- this is great if you don't have the DVD&lt;br /&gt;
         hardware, but, need to get at the data.  The following show an example of&lt;br /&gt;
         mounting the Fedora core 2 as a file.&lt;br /&gt;
&lt;br /&gt;
         $ mkdir /iso0&lt;br /&gt;
         $ mount -o loop -t iso9660 /FC2-i386-DVD.iso  /iso0&lt;br /&gt;
&lt;br /&gt;
     Or to mount automatically at boot, add the following to &amp;quot;/etc/fstab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         /FC2-i386-DVD.iso /iso0     iso9660 rw,loop  0 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Reference: http://umn.dl.sourceforge.net/sourceforge/souptonuts/README_fedora.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 20:&lt;br /&gt;
&lt;br /&gt;
     Getting Information about the Hard drive and list all PCI devices.&lt;br /&gt;
&lt;br /&gt;
                $ hdparm /dev/hda&lt;br /&gt;
&lt;br /&gt;
                  /dev/hda:&lt;br /&gt;
                   multcount    = 16 (on)&lt;br /&gt;
                   IO_support   =  0 (default 16-bit)&lt;br /&gt;
                   unmaskirq    =  0 (off)&lt;br /&gt;
                   using_dma    =  1 (on)&lt;br /&gt;
                   keepsettings =  0 (off)&lt;br /&gt;
                   readonly     =  0 (off)&lt;br /&gt;
                   readahead    = 256 (on)&lt;br /&gt;
                   geometry     = 16383/255/63, sectors = 234375000, start = 0&lt;br /&gt;
&lt;br /&gt;
            or for SCSI&lt;br /&gt;
&lt;br /&gt;
                $ hdparm /dev/sda&lt;br /&gt;
&lt;br /&gt;
            Try it with the -i option for information&lt;br /&gt;
&lt;br /&gt;
                $ hdparm -i /dev/hda&lt;br /&gt;
&lt;br /&gt;
                /dev/hda:&lt;br /&gt;
&lt;br /&gt;
                Model=IC35L120AVV207-1, FwRev=V24OA66A, SerialNo=VNVD09G4CZ6E0T&lt;br /&gt;
                Config={ HardSect NotMFM HdSw&amp;gt;15uSec Fixed DTR&amp;gt;10Mbs }&lt;br /&gt;
                RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=52&lt;br /&gt;
                BuffType=DualPortCache, BuffSize=7965kB, MaxMultSect=16, MultSect=16&lt;br /&gt;
                CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=234375000&lt;br /&gt;
                IORDY=on/off, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}&lt;br /&gt;
                PIO modes:  pio0 pio1 pio2 pio3 pio4&lt;br /&gt;
                DMA modes:  mdma0 mdma1 mdma2&lt;br /&gt;
                UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5&lt;br /&gt;
                AdvancedPM=yes: disabled (255) WriteCache=enabled&lt;br /&gt;
                Drive conforms to: ATA/ATAPI-6 T13 1410D revision 3a:  2 3 4 5 6&lt;br /&gt;
&lt;br /&gt;
            How fast is your drive?&lt;br /&gt;
&lt;br /&gt;
                $ hdparm -tT /dev/hda&lt;br /&gt;
&lt;br /&gt;
                /dev/hda:&lt;br /&gt;
                Timing buffer-cache reads:   128 MB in  0.41 seconds =315.32 MB/sec&lt;br /&gt;
                Timing buffered disk reads:  64 MB in  1.19 seconds = 53.65 MB/sec&lt;br /&gt;
&lt;br /&gt;
            Need to find your device?&lt;br /&gt;
&lt;br /&gt;
                $ mount&lt;br /&gt;
                   or&lt;br /&gt;
                $ cat /proc/partitions&lt;br /&gt;
                   or&lt;br /&gt;
                $ dmesg | egrep '^(s|h)d'&lt;br /&gt;
&lt;br /&gt;
                   which for my system lists:&lt;br /&gt;
&lt;br /&gt;
                      hda: IC35L120AVV207-1, ATA DISK drive&lt;br /&gt;
                      hdc: Lite-On LTN486S 48x Max, ATAPI CD/DVD-ROM drive&lt;br /&gt;
                      hda: max request size: 1024KiB&lt;br /&gt;
                      hda: 234375000 sectors (120000 MB) w/7965KiB Cache, CHS=16383/255/63, UDMA(100)&lt;br /&gt;
&lt;br /&gt;
             By the way, if you want to turn on dma&lt;br /&gt;
&lt;br /&gt;
                 $ hdparm -d1 /dev/hda&lt;br /&gt;
                   setting using_dma to 1 (on)&lt;br /&gt;
                   using_dma    =  1 (on)&lt;br /&gt;
&lt;br /&gt;
         (Also see TIP 122 )&lt;br /&gt;
&lt;br /&gt;
     List all PCI devices&lt;br /&gt;
&lt;br /&gt;
                $ lspci -v&lt;br /&gt;
&lt;br /&gt;
          00:00.0 Host bridge: Intel Corp. 82845G/GL [Brookdale-G] Chipset Host Bridge (rev&lt;br /&gt;
                  Subsystem: Dell Computer Corporation: Unknown device 0160&lt;br /&gt;
                  Flags: bus master, fast devsel, latency 0&lt;br /&gt;
                  Memory at f0000000 (32-bit, prefetchable) [size=128M]&lt;br /&gt;
                  Capabilities: &amp;lt;available only to root&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              ... lots more ...&lt;br /&gt;
&lt;br /&gt;
           Note, there is also lspci -vv for even more information.&lt;br /&gt;
&lt;br /&gt;
          (Also see TIP 200)&lt;br /&gt;
&lt;br /&gt;
TIP 21:&lt;br /&gt;
&lt;br /&gt;
     Setting up &amp;quot;cron&amp;quot; Jobs.&lt;br /&gt;
&lt;br /&gt;
     If you want to use the emacs editor for editing cron jobs, then,&lt;br /&gt;
     set the following in your &amp;quot;/home/user/.bash_profile&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        EDITOR=emacs&lt;br /&gt;
&lt;br /&gt;
     Then, to edit cron jobs&lt;br /&gt;
&lt;br /&gt;
        $ crontab -e&lt;br /&gt;
&lt;br /&gt;
     You may want to put in the following header&lt;br /&gt;
&lt;br /&gt;
        #MINUTE(0-59) HOUR(0-23) DAYOFMONTH(1-31) MONTHOFYEAR(1-12) DAYOFWEEK(0-6) Note 0=Sun and 7=Sun&lt;br /&gt;
        #&lt;br /&gt;
        #14,15 10 * * 0   /usr/bin/somecommmand  &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     The sample &amp;quot;commented out command&amp;quot; will run at 10:14 and 10:15 every Sunday.  There will&lt;br /&gt;
     be no &amp;quot;mail&amp;quot; sent to the user because of the &amp;quot;&amp;gt;/dev/null 2&amp;gt;&amp;amp;1&amp;quot; entry.&lt;br /&gt;
&lt;br /&gt;
        $ crontab -l&lt;br /&gt;
&lt;br /&gt;
     The above will list all cron jobs. Or if you're root&lt;br /&gt;
&lt;br /&gt;
        $ crontab -l -u &amp;lt;username&amp;gt;&lt;br /&gt;
        $ crontab -e -u &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Reference &amp;quot;man 5 crontab&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
        The time and date fields are:&lt;br /&gt;
&lt;br /&gt;
                     field          allowed values&lt;br /&gt;
                     -----          --------------&lt;br /&gt;
                     minute         0-59&lt;br /&gt;
                     hour           0-23&lt;br /&gt;
                     day of month   1-31&lt;br /&gt;
                     month          1-12 (or names, see below)&lt;br /&gt;
                     day of week    0-7 (0 or 7 is Sun, or use names)&lt;br /&gt;
&lt;br /&gt;
              A field may be an asterisk (*), which always stands for ``first-last''.&lt;br /&gt;
&lt;br /&gt;
              Ranges of numbers are allowed.  Ranges are two numbers separated with a&lt;br /&gt;
              hyphen.   The  specified  range is inclusive.  For example, 8-11 for an&lt;br /&gt;
              ``hours'' entry specifies execution at hours 8, 9, 10 and 11.&lt;br /&gt;
&lt;br /&gt;
              Lists are allowed.  A list is a set of numbers (or ranges) separated by&lt;br /&gt;
              commas.  Examples: ``1,2,5,9'', ``0-4,8-12''.&lt;br /&gt;
&lt;br /&gt;
              Ranges can include &amp;quot;steps&amp;quot;, so &amp;quot;1-9/2&amp;quot; is the same as &amp;quot;1,3,5,7,9&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Note, you can run just every 5 minutes as follows:&lt;br /&gt;
&lt;br /&gt;
              */5 * * * * /etc/mrtg/domrtg  &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     To run jobs hourly,daily,weekly or monthly you can add shell scripts into the&lt;br /&gt;
     appropriate directory:&lt;br /&gt;
&lt;br /&gt;
             /etc/cron.hourly/&lt;br /&gt;
             /etc/cron.daily/&lt;br /&gt;
             /etc/cron.weekly/&lt;br /&gt;
             /etc/cron.monthly/&lt;br /&gt;
&lt;br /&gt;
     Note that the above are pre-configured schedules set in &amp;quot;/etc/crontab&amp;quot;, so&lt;br /&gt;
     if you want, you can change the schedule. Below is my /etc/crontab:&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/crontab&lt;br /&gt;
           SHELL=/bin/bash&lt;br /&gt;
           PATH=/sbin:/bin:/usr/sbin:/usr/bin&lt;br /&gt;
           MAILTO=root&lt;br /&gt;
           HOME=/&lt;br /&gt;
&lt;br /&gt;
           # run-parts&lt;br /&gt;
           01 * * * * root run-parts /etc/cron.hourly&lt;br /&gt;
           02 4 * * * root run-parts /etc/cron.daily&lt;br /&gt;
           22 4 * * 0 root run-parts /etc/cron.weekly&lt;br /&gt;
           42 4 1 * * root run-parts /etc/cron.monthly&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 22:&lt;br /&gt;
&lt;br /&gt;
     Keeping Files in Sync Between Servers.&lt;br /&gt;
&lt;br /&gt;
     The remote computer is &amp;quot;192.168.1.171&amp;quot; and has the account &amp;quot;donkey&amp;quot;.  You want&lt;br /&gt;
     to &amp;quot;keep in sync&amp;quot; the files under &amp;quot;/home/cu2000/Logs&amp;quot; on the remote computer&lt;br /&gt;
     with files on &amp;quot;/home/chirico/dev/MEDIA_Server&amp;quot; on the local computer.&lt;br /&gt;
&lt;br /&gt;
       $ rsync  -Lae ssh  donkey@192.168.1.171:/home/cu2000/Logs /home/chirico/dev/MEDIA_Server&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;rsync&amp;quot; is a convient command for keeping files in sync, and as shown here will work&lt;br /&gt;
     through ssh.  The -L option tells rsync to treat symbolic links like ordinary files.&lt;br /&gt;
&lt;br /&gt;
        Also see [http://www.rsnapshot.org/]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 23:&lt;br /&gt;
&lt;br /&gt;
     Looking up the Spelling of a Word.&lt;br /&gt;
&lt;br /&gt;
        $ look &amp;lt;partial spelling&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     so the following will list all words that&lt;br /&gt;
     start with stuff&lt;br /&gt;
&lt;br /&gt;
        $ look stuff&lt;br /&gt;
           stuff&lt;br /&gt;
           stuffage&lt;br /&gt;
           stuffata&lt;br /&gt;
           stuffed&lt;br /&gt;
           stuffender&lt;br /&gt;
           stuffer&lt;br /&gt;
           stuffers&lt;br /&gt;
           stuffgownsman&lt;br /&gt;
           stuffier&lt;br /&gt;
           stuffiest&lt;br /&gt;
           stuffily&lt;br /&gt;
           stuffiness&lt;br /&gt;
           stuffinesses&lt;br /&gt;
           stuffiness's&lt;br /&gt;
           stuffing&lt;br /&gt;
           stuffings&lt;br /&gt;
           stuffing's&lt;br /&gt;
           stuffless&lt;br /&gt;
           stuffs&lt;br /&gt;
           stuffy&lt;br /&gt;
&lt;br /&gt;
     It helps to have a large &amp;quot;linuxwords&amp;quot; dictionary.  You can download&lt;br /&gt;
     a much bigger dictionary from the following:&lt;br /&gt;
&lt;br /&gt;
              http://prdownloads.sourceforge.net/souptonuts/linuxwords.1.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
     Note: vim users can setup the .vimrc file with the following. Now when you type &lt;br /&gt;
       CTL-X CTL-T in insert mode, you'll get a thesaurus lookup.&lt;br /&gt;
&lt;br /&gt;
           set dictionary+=/usr/share/dict/words&lt;br /&gt;
           set thesaurus+=/usr/share/dict/words&lt;br /&gt;
&lt;br /&gt;
     Or, you can call aspell with the F6 command after putting the folling entry in your&lt;br /&gt;
     .vimrc file&lt;br /&gt;
&lt;br /&gt;
           :nmap &amp;lt;F6&amp;gt; :w&amp;lt;CR&amp;gt;:!aspell -e -c %&amp;lt;CR&amp;gt;:e&amp;lt;CR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Now, hit F6 when you're in vim, and you'll get a spell checker.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     There is also an X Windows dictionary that runs with the following command.&lt;br /&gt;
&lt;br /&gt;
           $ gnome-dictionary&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 24:&lt;br /&gt;
&lt;br /&gt;
     Find out if a Command is Aliased.&lt;br /&gt;
&lt;br /&gt;
         $ type -all &amp;lt;command&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Example:&lt;br /&gt;
&lt;br /&gt;
         $ type -all ls&lt;br /&gt;
            ls is aliased to `ls --color=tty'&lt;br /&gt;
            ls is /bin/ls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 25:&lt;br /&gt;
&lt;br /&gt;
     Create a Terminal Calculator&lt;br /&gt;
&lt;br /&gt;
      Put the following in your .bashrc file&lt;br /&gt;
&lt;br /&gt;
            function calc&lt;br /&gt;
            {&lt;br /&gt;
             echo &amp;quot;${1}&amp;quot;|bc -l;&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
      Or, run it at the shell prompt. Now&lt;br /&gt;
      &amp;quot;calc&amp;quot; from the shell will work as follows:&lt;br /&gt;
&lt;br /&gt;
            $ calc 3+45&lt;br /&gt;
               48&lt;br /&gt;
&lt;br /&gt;
      All functions  with a &amp;quot;(&amp;quot; or &amp;quot;)&amp;quot; must be enclosed&lt;br /&gt;
      in quotes.  For instance, to get the sin of .4&lt;br /&gt;
&lt;br /&gt;
            $ calc &amp;quot;s(.4)&amp;quot;&lt;br /&gt;
              .38941834230865049166&lt;br /&gt;
&lt;br /&gt;
          (See TIP 115 using the expr command)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 26:&lt;br /&gt;
&lt;br /&gt;
     Kill a User and All Their Current Processes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        #  This program will kill all processes from a&lt;br /&gt;
        #  user.  The user name is read from the command line.&lt;br /&gt;
        #&lt;br /&gt;
        #  This program also demonstrates reading a bash variable&lt;br /&gt;
        #  into an awk script.&lt;br /&gt;
        #&lt;br /&gt;
        #  Usage: kill9user &amp;lt;user&amp;gt;&lt;br /&gt;
        #&lt;br /&gt;
        kill -9 `ps aux|awk -v var=$1 '$1==var { print $2 }'`&lt;br /&gt;
&lt;br /&gt;
    or if you want want to create the above script the command&lt;br /&gt;
    below will kill the user &amp;quot;donkey&amp;quot; and all of his processes.&lt;br /&gt;
&lt;br /&gt;
        $ kill -9 `ps aux|awk -v var=&amp;quot;donkey&amp;quot; '$1==var { print $2 }'`&lt;br /&gt;
&lt;br /&gt;
    Check their cron jobs and &amp;quot;at&amp;quot; jobs, if you have a security issue.&lt;br /&gt;
&lt;br /&gt;
          $ crontab -u &amp;lt;user&amp;gt; -e&lt;br /&gt;
&lt;br /&gt;
    Lock the account:&lt;br /&gt;
&lt;br /&gt;
          $ passwd -l &amp;lt;user&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Remove all authorized_keys&lt;br /&gt;
&lt;br /&gt;
          $ rm /home/user/.shosts&lt;br /&gt;
          $ rm /home/user/.rhosts&lt;br /&gt;
          $ rm -rf /home/user/.ssh&lt;br /&gt;
          $ rm /home/user/.forward&lt;br /&gt;
&lt;br /&gt;
      or consider&lt;br /&gt;
&lt;br /&gt;
          $ mv /home/user  /home/safeuser&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Change the shell&lt;br /&gt;
&lt;br /&gt;
          $ chsh -s /bin/true &amp;lt;user&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Do an inventory&lt;br /&gt;
&lt;br /&gt;
          $ find / -user &amp;lt;user&amp;gt;  &amp;gt; list_of_user_files&lt;br /&gt;
&lt;br /&gt;
    NOTE: Also see (TIP 10).&lt;br /&gt;
&lt;br /&gt;
    To see all users, except the current user. Do not use the&lt;br /&gt;
    dash &amp;quot;ps -aux&amp;quot; is wrong but the following is correct:&lt;br /&gt;
&lt;br /&gt;
          $ ps aux| awk '!/'${USER}'/{printf(&amp;quot;%s \n&amp;quot;,$0)}'&lt;br /&gt;
&lt;br /&gt;
     or (ww = wide, wide output)&lt;br /&gt;
&lt;br /&gt;
          $ ps auwwx| awk '!/'${USER}'/{printf(&amp;quot;%s \n&amp;quot;,$0)}'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    The following codes may be useful:&lt;br /&gt;
&lt;br /&gt;
       D    Uninterruptible sleep (usually IO)&lt;br /&gt;
       R    Running or runnable (on run queue)&lt;br /&gt;
       S    Interruptible sleep (waiting for an event to complete)&lt;br /&gt;
       T    Stopped, either by a job control signal or because it is being traced.&lt;br /&gt;
       W    paging (not valid since the 2.6.xx kernel)&lt;br /&gt;
       X    dead (should never be seen)&lt;br /&gt;
       Z    Defunct (&amp;quot;zombie&amp;quot;) process, terminated but not reaped by its parent.&lt;br /&gt;
&lt;br /&gt;
    For BSD formats and when the stat keyword is used, additional&lt;br /&gt;
       characters may be displayed:&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;    high-priority (not nice to other users)&lt;br /&gt;
       N    low-priority (nice to other users)&lt;br /&gt;
       L    has pages locked into memory (for real-time and custom IO)&lt;br /&gt;
       s    is a session leader&lt;br /&gt;
       l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)&lt;br /&gt;
       +    is in the foreground process group&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Also see TIP 28. and TIP 89.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 27:&lt;br /&gt;
&lt;br /&gt;
     Format Dates for Logs and Files&lt;br /&gt;
&lt;br /&gt;
         $ date &amp;quot;+%m%d%y %A,%B %d %Y %X&amp;quot;&lt;br /&gt;
             061704 Thursday,June 17 2004 07:13:40 PM&lt;br /&gt;
&lt;br /&gt;
         $ date &amp;quot;+%m%d%Y&amp;quot;&lt;br /&gt;
             06172004&lt;br /&gt;
&lt;br /&gt;
         $ date -d '1 day ago' &amp;quot;+%m%d%Y&amp;quot;&lt;br /&gt;
             06162004&lt;br /&gt;
&lt;br /&gt;
         $ date -d '3 months 1 day  2 hour  15 minutes 2 seconds ago'&lt;br /&gt;
&lt;br /&gt;
      or to go into the future remove the &amp;quot;ago&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         $ date -d '3 months 1 day  2 hour  15 minutes 2 seconds '&lt;br /&gt;
&lt;br /&gt;
            Also the following works:&lt;br /&gt;
&lt;br /&gt;
                $ date -d '+2 year +1 month -1 week  +3 day -8 hour +2 min -5 seconds'&lt;br /&gt;
&lt;br /&gt;
      Quick question: If there are 100,000,000 stars in the visible sky, and you can&lt;br /&gt;
      count them, round the clock, at a rate of a star per second starting now, when&lt;br /&gt;
      would you finish counting?  Would you still be alive?&lt;br /&gt;
&lt;br /&gt;
                $ date -d '+100000000 seconds'&lt;br /&gt;
&lt;br /&gt;
      Sooner than you think!&lt;br /&gt;
&lt;br /&gt;
      This can be assigned to variables&lt;br /&gt;
&lt;br /&gt;
         $ mdate=`date -d '3 months 1 day  2 hour  15 minutes 2 seconds ' &amp;quot;+%m%d%Y_%A_%B_%D_%Y_%X&amp;quot;  `&lt;br /&gt;
         $ echo $mdate&lt;br /&gt;
             09182004_Saturday_September_09/18/04_2004_09:40:41 PM&lt;br /&gt;
             ^---- Easy to sort   ^-------^----- Easy to read&lt;br /&gt;
&lt;br /&gt;
      See TIP 28 below.&lt;br /&gt;
&lt;br /&gt;
      See TIP 87 when working with large delta time changes -40 years, or -200 years ago, or even&lt;br /&gt;
      1,000,000 days into the future.&lt;br /&gt;
&lt;br /&gt;
      Also see (TIP 1) for working with time zones.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 28:&lt;br /&gt;
&lt;br /&gt;
     Need Ascii Codes? For instance, for printing quotes:&lt;br /&gt;
&lt;br /&gt;
                         awk 'BEGIN { msg = &amp;quot;Don\047t Panic!&amp;quot;; printf &amp;quot;%s \n&amp;quot;,msg }'&lt;br /&gt;
              or&lt;br /&gt;
                         awk 'BEGIN { msg = &amp;quot;Don\x027t Panic!&amp;quot;; printf &amp;quot;%s \n&amp;quot;,msg }'&lt;br /&gt;
&lt;br /&gt;
     It's better to use \047, because certain characters that follow \x027 may cause problems.&lt;br /&gt;
&lt;br /&gt;
     For example, take a look at the following two lines. The first line prints a &amp;quot;}&amp;quot; caused&lt;br /&gt;
     by the extra D in \x027D. The the line immediately below does not work as expected.&lt;br /&gt;
&lt;br /&gt;
                      awk 'BEGIN {printf(&amp;quot;The D causes problems \x027D\n&amp;quot;)}'&lt;br /&gt;
&lt;br /&gt;
            However, the line below works fine:&lt;br /&gt;
&lt;br /&gt;
                      awk 'BEGIN {printf(&amp;quot;The D does not cause problems \047D\n&amp;quot;)}'&lt;br /&gt;
&lt;br /&gt;
     Or if you wanted to use the date command in &amp;quot;awk&amp;quot; to print date.time.nanosecond.timezone for&lt;br /&gt;
     each line of a file &amp;quot;test&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     The following date can be used in awk because the single quotes are enclosed within the&lt;br /&gt;
     double quotes.&lt;br /&gt;
&lt;br /&gt;
             date '+%m%d%Y.%H%M%S.%N%z'&lt;br /&gt;
&lt;br /&gt;
       $ awk 'BEGIN { &amp;quot;date '+%m%d%Y.%H%M%S.%N%z'&amp;quot; | getline MyDate  } { print MyDate,$0 }' &amp;lt; data&lt;br /&gt;
&lt;br /&gt;
     But it's also possible to replace  &amp;quot;+&amp;quot;  with  \x2B,  &amp;quot;%&amp;quot; with \x25, and &amp;quot;d&amp;quot; with \x64 as follows:&lt;br /&gt;
&lt;br /&gt;
       $ awk 'BEGIN { &amp;quot;date \x27\x2B\x25m\x25\x64\x25Y.\x25H\x25M\x25S.\x25N\x25z\x27&amp;quot; | getline MyDate  } { print MyDate,$0 }' &amp;lt; test&lt;br /&gt;
&lt;br /&gt;
             07062004.113820.346033000-0400 bob 71&lt;br /&gt;
             07062004.113820.346033000-0400 tom 43&lt;br /&gt;
             07062004.113820.346033000-0400 sal 34&lt;br /&gt;
             07062004.113820.346033000-0400 bob 89&lt;br /&gt;
             07062004.113820.346033000-0400 tom 66&lt;br /&gt;
             07062004.113820.346033000-0400 sal 99&lt;br /&gt;
&lt;br /&gt;
     For this example it's not needed because single quotes are used inside of double quotes; however, there may be times when&lt;br /&gt;
     hex replacement is easier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ man ascii&lt;br /&gt;
&lt;br /&gt;
        Oct   Dec   Hex   Char           Oct   Dec   Hex   Char&lt;br /&gt;
            -----------------------------------------------------------&lt;br /&gt;
            000   0     00    NUL '\0'       100   64    40    @&lt;br /&gt;
            001   1     01    SOH            101   65    41    A&lt;br /&gt;
            002   2     02    STX            102   66    42    B&lt;br /&gt;
            003   3     03    ETX            103   67    43    C&lt;br /&gt;
            004   4     04    EOT            104   68    44    D&lt;br /&gt;
            005   5     05    ENQ            105   69    45    E&lt;br /&gt;
            006   6     06    ACK            106   70    46    F&lt;br /&gt;
            007   7     07    BEL '\a'       107   71    47    G&lt;br /&gt;
            010   8     08    BS  '\b'       110   72    48    H&lt;br /&gt;
            011   9     09    HT  '\t'       111   73    49    I&lt;br /&gt;
            012   10    0A    LF  '\n'       112   74    4A    J&lt;br /&gt;
            013   11    0B    VT  '\v'       113   75    4B    K&lt;br /&gt;
            014   12    0C    FF  '\f'       114   76    4C    L&lt;br /&gt;
            015   13    0D    CR  '\r'       115   77    4D    M&lt;br /&gt;
            016   14    0E    SO             116   78    4E    N&lt;br /&gt;
            017   15    0F    SI             117   79    4F    O&lt;br /&gt;
            020   16    10    DLE            120   80    50    P&lt;br /&gt;
            021   17    11    DC1            121   81    51    Q&lt;br /&gt;
            022   18    12    DC2            122   82    52    R&lt;br /&gt;
            023   19    13    DC3            123   83    53    S&lt;br /&gt;
            024   20    14    DC4            124   84    54    T&lt;br /&gt;
            025   21    15    NAK            125   85    55    U&lt;br /&gt;
            026   22    16    SYN            126   86    56    V&lt;br /&gt;
            027   23    17    ETB            127   87    57    W&lt;br /&gt;
            030   24    18    CAN            130   88    58    X&lt;br /&gt;
            031   25    19    EM             131   89    59    Y&lt;br /&gt;
            032   26    1A    SUB            132   90    5A    Z&lt;br /&gt;
            033   27    1B    ESC            133   91    5B    [&lt;br /&gt;
            034   28    1C    FS             134   92    5C    \   '\\'&lt;br /&gt;
            035   29    1D    GS             135   93    5D    ]&lt;br /&gt;
            036   30    1E    RS             136   94    5E    ^&lt;br /&gt;
            037   31    1F    US             137   95    5F    _&lt;br /&gt;
            040   32    20    SPACE          140   96    60    `&lt;br /&gt;
            041   33    21    !              141   97    61    a&lt;br /&gt;
            042   34    22    &amp;quot;              142   98    62    b&lt;br /&gt;
            043   35    23    #              143   99    63    c&lt;br /&gt;
            044   36    24    $              144   100   64    d&lt;br /&gt;
            045   37    25    %              145   101   65    e&lt;br /&gt;
            046   38    26    &amp;amp;              146   102   66    f&lt;br /&gt;
            047   39    27    '              147   103   67    g&lt;br /&gt;
            050   40    28    (              150   104   68    h&lt;br /&gt;
            051   41    29    )              151   105   69    i&lt;br /&gt;
            052   42    2A    *              152   106   6A    j&lt;br /&gt;
            053   43    2B    +              153   107   6B    k&lt;br /&gt;
            054   44    2C    ,              154   108   6C    l&lt;br /&gt;
            055   45    2D    -              155   109   6D    m&lt;br /&gt;
            056   46    2E    .              156   110   6E    n&lt;br /&gt;
            057   47    2F    /              157   111   6F    o&lt;br /&gt;
            060   48    30    0              160   112   70    p&lt;br /&gt;
            061   49    31    1              161   113   71    q&lt;br /&gt;
            062   50    32    2              162   114   72    r&lt;br /&gt;
            063   51    33    3              163   115   73    s&lt;br /&gt;
            064   52    34    4              164   116   74    t&lt;br /&gt;
            065   53    35    5              165   117   75    u&lt;br /&gt;
            066   54    36    6              166   118   76    v&lt;br /&gt;
            067   55    37    7              167   119   77    w&lt;br /&gt;
            070   56    38    8              170   120   78    x&lt;br /&gt;
            071   57    39    9              171   121   79    y&lt;br /&gt;
            072   58    3A    :              172   122   7A    z&lt;br /&gt;
            073   59    3B    ;              173   123   7B    {&lt;br /&gt;
            074   60    3C    &amp;lt;              174   124   7C    |&lt;br /&gt;
            075   61    3D    =              175   125   7D    }&lt;br /&gt;
            076   62    3E    &amp;gt;              176   126   7E    ~&lt;br /&gt;
            077   63    3F    ?              177   127   7F    DEL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 29:&lt;br /&gt;
&lt;br /&gt;
     Need a WWW Browser for the Terminal Session? Try lynx or elinks.&lt;br /&gt;
&lt;br /&gt;
         $ lynx&lt;br /&gt;
&lt;br /&gt;
     Or to read all these tips, with the latest updates&lt;br /&gt;
&lt;br /&gt;
      $ lynx http://umn.dl.sourceforge.net/sourceforge/souptonuts/How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Or, better yet elinks.&lt;br /&gt;
&lt;br /&gt;
         $ elinks http://somepage.&lt;br /&gt;
&lt;br /&gt;
     You can get elinks at the following site:&lt;br /&gt;
&lt;br /&gt;
             http://elinks.or.cz/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 30:&lt;br /&gt;
&lt;br /&gt;
    screen - screen manager with VT100/ANSI terminal emulation&lt;br /&gt;
&lt;br /&gt;
         This is an excellent utility. But if you work a lot in Emacs,&lt;br /&gt;
         then, you should place the following in your ~./.bashrc&lt;br /&gt;
&lt;br /&gt;
             alias s='screen -e^Pa -D -R'&lt;br /&gt;
&lt;br /&gt;
         After loging in again (or source .bashrc) ,&lt;br /&gt;
         type the following to load &amp;quot;screen&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
             $ s&lt;br /&gt;
&lt;br /&gt;
         If you're using the not using the alias command above, substitute&lt;br /&gt;
         CTL-a for CTL-p below. :&lt;br /&gt;
&lt;br /&gt;
             CTL-p CTL-C       To get a new session&lt;br /&gt;
             CTL-p  &amp;quot;           To list sessions, and arrow keys to move&lt;br /&gt;
             CTL-p SHFT-A      To name sessions&lt;br /&gt;
             CTL-p S            To split screens&lt;br /&gt;
             CLT-p Q            To unsplit screens&lt;br /&gt;
             CLT-p TAB          To switch between screens&lt;br /&gt;
             CLT-p :resize n    To resize screen to n rows, on split screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Screen is very powerful.  Should you become disconneced, you can&lt;br /&gt;
         still resume work after loggin in.&lt;br /&gt;
&lt;br /&gt;
             $ man screen&lt;br /&gt;
&lt;br /&gt;
         The above command will give you more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 31:&lt;br /&gt;
&lt;br /&gt;
     Need to Find the Factors of a Number?&lt;br /&gt;
&lt;br /&gt;
           $ factor 2345678992&lt;br /&gt;
                2345678992: 2 2 2 2 6581 22277&lt;br /&gt;
&lt;br /&gt;
     It's a quick way to find out if a number is prime&lt;br /&gt;
&lt;br /&gt;
           $ factor 7867&lt;br /&gt;
                7867: 7867&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 32:&lt;br /&gt;
&lt;br /&gt;
     Less is More -- piping to less to scroll backword and forward&lt;br /&gt;
&lt;br /&gt;
      For large &amp;quot;ls&amp;quot; listings try the followin, then, use the arrow key&lt;br /&gt;
      to move up and down the list.&lt;br /&gt;
&lt;br /&gt;
           $ ls /some_large_dir/ | less&lt;br /&gt;
&lt;br /&gt;
                 or&lt;br /&gt;
&lt;br /&gt;
           $ cat some_large_file | less&lt;br /&gt;
&lt;br /&gt;
                 or&lt;br /&gt;
&lt;br /&gt;
           $ less some_large_file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 33:&lt;br /&gt;
&lt;br /&gt;
     C &amp;quot;indent&amp;quot; Settings for Kernel Development&lt;br /&gt;
&lt;br /&gt;
           $ indent -kr -i8  program.c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 34:&lt;br /&gt;
&lt;br /&gt;
     FTP auto-login.  &amp;quot;ftp&amp;quot; to a site and have the password stored.&lt;br /&gt;
&lt;br /&gt;
     For instance, here's a sample &amp;quot;.net&amp;quot; file in a user's home&lt;br /&gt;
     directory for uploading to sourceforge. Note, sourceforge will&lt;br /&gt;
     take any password, so m@temp.com is used here for login &amp;quot;anonymous&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ cat ~/.netrc&lt;br /&gt;
               machine upload.sourceforge.net login anonymous password m@temp.com&lt;br /&gt;
               default login anonymous password user@site&lt;br /&gt;
&lt;br /&gt;
     It might be a good idea to change the rights on this file&lt;br /&gt;
&lt;br /&gt;
           $ chmod 0400 ~/.netrc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         #!/bin/bash&lt;br /&gt;
         #&lt;br /&gt;
         #  Sample ftp automated script to download&lt;br /&gt;
         #  file to ${dwnld}&lt;br /&gt;
         #&lt;br /&gt;
         dwnld=&amp;quot;/work/faq/unix-faq&amp;quot;&lt;br /&gt;
         cd ${dwnld}&lt;br /&gt;
         ftp &amp;lt;&amp;lt; FTPSTRING&lt;br /&gt;
         prompt off&lt;br /&gt;
         open rtfm.mit.edu&lt;br /&gt;
         cd /pub/usenet-by-group/news.answers/unix-faq/faq&lt;br /&gt;
         mget contents&lt;br /&gt;
         mget diff&lt;br /&gt;
         mget part*&lt;br /&gt;
         bye&lt;br /&gt;
         FTPSTRING&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      (Also see TIP 114 for ncftpget, which is a very powerful restarting&lt;br /&gt;
                            ftp program)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 35:&lt;br /&gt;
&lt;br /&gt;
     Bash Brace Expansion&lt;br /&gt;
&lt;br /&gt;
           $ echo f{ee,ie,oe,um}&lt;br /&gt;
                fee fie foe fum&lt;br /&gt;
&lt;br /&gt;
     This works with almost any command&lt;br /&gt;
&lt;br /&gt;
           $ mkdir -p /work/junk/{one,two,three,four}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 36:&lt;br /&gt;
&lt;br /&gt;
     Getting a List of Users on the System&lt;br /&gt;
&lt;br /&gt;
           $ cut -d: -f1 /etc/passwd | sort&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 37:&lt;br /&gt;
&lt;br /&gt;
     Editing a Bash Command&lt;br /&gt;
&lt;br /&gt;
      Try typing a long command say, then, type &amp;quot;fc&amp;quot; for an easy way&lt;br /&gt;
      to edit the command.&lt;br /&gt;
&lt;br /&gt;
           $ find /etc -iname '*.cnf' -exec grep -H 'log' {} \;&lt;br /&gt;
           $ fc&lt;br /&gt;
&lt;br /&gt;
      &amp;quot;fc&amp;quot; will bring the last command typed into an editor, &amp;quot;emacs&amp;quot; if&lt;br /&gt;
      that's the default editor. Type &amp;quot;fc -l&amp;quot; to list last few commands.&lt;br /&gt;
&lt;br /&gt;
      To seach for a command, try typing &amp;quot;CTL-r&amp;quot; at the shell prompt for&lt;br /&gt;
      searching. &amp;quot;CTL-t&amp;quot; to transpose, say &amp;quot;sl&amp;quot; was typed by you want &amp;quot;ls&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Hints when using &amp;quot;fc: in emacs:&lt;br /&gt;
&lt;br /&gt;
           ESC-b     move one word backward&lt;br /&gt;
           ESC-f     move one word forward&lt;br /&gt;
           ESC-DEL   kill one word backward&lt;br /&gt;
           CTL-k     kill point to end&lt;br /&gt;
           CTL-y     un-yank killed region at point&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 38:&lt;br /&gt;
&lt;br /&gt;
     Moving around Directories.&lt;br /&gt;
&lt;br /&gt;
     Change to the home directory:&lt;br /&gt;
          $ cd ~&lt;br /&gt;
            or&lt;br /&gt;
          $ cd&lt;br /&gt;
&lt;br /&gt;
     To go back to the last directory&lt;br /&gt;
          $ cd -&lt;br /&gt;
&lt;br /&gt;
     Instead of &amp;quot;cd&amp;quot; to a directory try &amp;quot;pushd&amp;quot; and look&lt;br /&gt;
     at the heading...you can see a list of directories.&lt;br /&gt;
&lt;br /&gt;
          $ pushd /etc&lt;br /&gt;
          $ pushd /usr/local&lt;br /&gt;
&lt;br /&gt;
      Then, to get back &amp;quot;popd&amp;quot; or &amp;quot;popd 1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      To list all the directories pushed on the stack&lt;br /&gt;
      use the &amp;quot;dirs -v&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
          $ dirs -v&lt;br /&gt;
           0  /usr/local&lt;br /&gt;
           1  /etc&lt;br /&gt;
           2  /work/souptonuts/documentation/theBook&lt;br /&gt;
&lt;br /&gt;
      Now, if you &amp;quot;pushd +1&amp;quot; you will be moved to &amp;quot;/etc&amp;quot;, since&lt;br /&gt;
      is number &amp;quot;1&amp;quot; on the stack, and this directory will become&lt;br /&gt;
      &amp;quot;0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ pwd&lt;br /&gt;
           /usr/local&lt;br /&gt;
          $ pushd +1&lt;br /&gt;
          $ pwd&lt;br /&gt;
           /etc&lt;br /&gt;
&lt;br /&gt;
          $ dirs -v&lt;br /&gt;
           0  /etc&lt;br /&gt;
           1  /work/souptonuts/documentation/theBook&lt;br /&gt;
           2  /usr/local&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 39:&lt;br /&gt;
&lt;br /&gt;
     Need an Underscore after a Variable?&lt;br /&gt;
&lt;br /&gt;
       Enclose the variable in &amp;quot;{}&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $echo ${UID}_&lt;br /&gt;
&lt;br /&gt;
       Compare to&lt;br /&gt;
&lt;br /&gt;
          $echo $UID_&lt;br /&gt;
&lt;br /&gt;
       Also try the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ m=&amp;quot;my stuff here&amp;quot;&lt;br /&gt;
                $ echo -e ${m// /'\n'}&lt;br /&gt;
                        my&lt;br /&gt;
                        stuff&lt;br /&gt;
                        here&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 40:&lt;br /&gt;
&lt;br /&gt;
     Bash Variable Offset and String Operators&lt;br /&gt;
&lt;br /&gt;
        $ r=&amp;quot;this is stuff&amp;quot;&lt;br /&gt;
        $ echo ${r:3}&lt;br /&gt;
        $ echo ${r:5:2}&lt;br /&gt;
&lt;br /&gt;
      Note, ${varname:offset:length}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         ${varname:?message}  If varname exist and isn't null return value, else,&lt;br /&gt;
                              print var and message.&lt;br /&gt;
&lt;br /&gt;
           $ r=&amp;quot;new stuff&amp;quot;&lt;br /&gt;
           $ echo ${r:? &amp;quot;that's r for you&amp;quot;}&lt;br /&gt;
               new stuff&lt;br /&gt;
           $ unset r&lt;br /&gt;
           $ echo ${r:? &amp;quot;that's r for you&amp;quot;}&lt;br /&gt;
               bash: r:  that's r for you&lt;br /&gt;
&lt;br /&gt;
         ${varname:+word}    If varname exist and not null return word. Else, return null.&lt;br /&gt;
&lt;br /&gt;
         ${varname:-word}    If varname exist and not null return value. Else, return word.&lt;br /&gt;
&lt;br /&gt;
      Working with arrays in bash - bash arrays.&lt;br /&gt;
&lt;br /&gt;
           $ unset p&lt;br /&gt;
           $ p=(one two three)&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[@]}&amp;quot;&lt;br /&gt;
           one two three&lt;br /&gt;
&lt;br /&gt;
      or&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[*]}&amp;quot;&lt;br /&gt;
           one two three&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${#p[@]}&amp;quot;&lt;br /&gt;
           3&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[0]}&amp;quot;&lt;br /&gt;
           one&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[1]}&amp;quot;&lt;br /&gt;
           two&lt;br /&gt;
&lt;br /&gt;
            Also see (TIP 95)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 41:&lt;br /&gt;
&lt;br /&gt;
     Loops in Bash&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The command below loops through directories listed in $PATH.&lt;br /&gt;
&lt;br /&gt;
          $ path=$PATH:&lt;br /&gt;
          $ while [ $path ]; do echo &amp;quot; ${path%%:*} &amp;quot;; path=${path#*:}; done&lt;br /&gt;
&lt;br /&gt;
       The command below will also loop through directories in your path.&lt;br /&gt;
&lt;br /&gt;
          $IFS=:&lt;br /&gt;
          $ for dir in $PATH&lt;br /&gt;
          &amp;gt; do&lt;br /&gt;
          &amp;gt; ls -ld $dir&lt;br /&gt;
          &amp;gt; done&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Jun 10 20:16 /usr/local/bin&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Jun 13 23:12 /bin&lt;br /&gt;
              drwxr-xr-x    3 root     root        40960 Jun 12 08:00 /usr/bin&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Feb 14 03:12 /usr/X11R6/bin&lt;br /&gt;
              drwxrwxr-x    2 chirico  chirico      4096 Jun  6 13:06 /home/chirico/bin&lt;br /&gt;
&lt;br /&gt;
     Other ways of doing loops:&lt;br /&gt;
&lt;br /&gt;
        for (( i=1; i &amp;lt;= 20; i++))&lt;br /&gt;
                do&lt;br /&gt;
                        echo -n &amp;quot;$i &amp;quot;&lt;br /&gt;
                done&lt;br /&gt;
&lt;br /&gt;
     Note, to do it all on one line, do the following:&lt;br /&gt;
&lt;br /&gt;
        $ for (( i=1; i &amp;lt;= 20; i++)); do echo -n &amp;quot;$i&amp;quot;; done&lt;br /&gt;
&lt;br /&gt;
     Below, is an example of declaring i an integer so that you do not&lt;br /&gt;
     have to preface with let.&lt;br /&gt;
&lt;br /&gt;
          $ declare -i i&lt;br /&gt;
          $ i=5;&lt;br /&gt;
          $ while (( $i &amp;gt; 1 )); do&lt;br /&gt;
          &amp;gt; i=i-1&lt;br /&gt;
          &amp;gt; echo $i&lt;br /&gt;
          &amp;gt; done&lt;br /&gt;
          4&lt;br /&gt;
          3&lt;br /&gt;
          2&lt;br /&gt;
&lt;br /&gt;
     You can also use &amp;quot;while [ $i -gt 1 ]; do&amp;quot;  in place of &amp;quot;while (( $i &amp;gt; 1 )); do&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     To get a listing of all declared values&lt;br /&gt;
&lt;br /&gt;
          $ declare -i&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Try putting a few words in the file &amp;quot;test&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         $ while read filename; do echo  &amp;quot;- $filename &amp;quot;; done &amp;lt; test |nl -w1&lt;br /&gt;
&lt;br /&gt;
     Or, using an array&lt;br /&gt;
&lt;br /&gt;
                declare -a Array&lt;br /&gt;
                Array[0]=&amp;quot;zero&amp;quot;&lt;br /&gt;
                Array[1]=&amp;quot;one&amp;quot;&lt;br /&gt;
                Array[2]=&amp;quot;two&amp;quot;&lt;br /&gt;
                for i in `seq ${#Array[@]}`&lt;br /&gt;
                do&lt;br /&gt;
                  echo $Array[$i-1]&lt;br /&gt;
                done&lt;br /&gt;
&lt;br /&gt;
         Also see (TIP 95 and TIP 133).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 42:&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;diff&amp;quot; and &amp;quot;patch&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
        You have created a program &amp;quot;prog.c&amp;quot;, saved as this name and also copied&lt;br /&gt;
        to  &amp;quot;prog.c.old&amp;quot;. You post &amp;quot;prog.c&amp;quot; to users.  Next, you make changes&lt;br /&gt;
        to prog.c&lt;br /&gt;
&lt;br /&gt;
          $ diff -c prog.c.old prog.c &amp;gt; prog.patch&lt;br /&gt;
&lt;br /&gt;
        Now, users can get the latest updates by running.&lt;br /&gt;
&lt;br /&gt;
          $ patch &amp;lt; prog.patch&lt;br /&gt;
&lt;br /&gt;
        By the way, you can make backups of your data easily.&lt;br /&gt;
&lt;br /&gt;
          $ cp /etc/fstab{,.bak}&lt;br /&gt;
&lt;br /&gt;
        Now, you do your edits to &amp;quot;/etc/fstab&amp;quot; and if you need&lt;br /&gt;
        to go back to the original, you can find it at&lt;br /&gt;
        &amp;quot;/etc/fstab.bak&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 43:&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;cat&amp;quot; the Contents of Files Listed in a File, in That Order.&lt;br /&gt;
&lt;br /&gt;
       SETUP (Assume you have the following)&lt;br /&gt;
&lt;br /&gt;
              $ cat file_of_files&lt;br /&gt;
                  file1&lt;br /&gt;
                  file2&lt;br /&gt;
&lt;br /&gt;
              $ cat file1&lt;br /&gt;
                  This is the data in file1&lt;br /&gt;
&lt;br /&gt;
              $ cat file 2&lt;br /&gt;
                  This is the data in file2&lt;br /&gt;
&lt;br /&gt;
       So there are 3 files here &amp;quot;file_of_files&amp;quot; which contains the name of&lt;br /&gt;
       other files.  In this case &amp;quot;file1&amp;quot; and &amp;quot;file2&amp;quot;. And the contents of&lt;br /&gt;
       &amp;quot;file1&amp;quot; and &amp;quot;file2&amp;quot; is shown above.&lt;br /&gt;
&lt;br /&gt;
               $ cat file_of_files|xargs cat&lt;br /&gt;
                    This is the data in  file1&lt;br /&gt;
                    This is the data in  file2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 44:&lt;br /&gt;
&lt;br /&gt;
     Columns and Rows -- getting anything you want.&lt;br /&gt;
&lt;br /&gt;
     Assume you have the following file.&lt;br /&gt;
&lt;br /&gt;
        $ cat data&lt;br /&gt;
           1 2 3&lt;br /&gt;
           4 5&lt;br /&gt;
           6 7 8 9 10&lt;br /&gt;
           11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
     How to you get everything in  2 columns?&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l2&lt;br /&gt;
           1 2&lt;br /&gt;
           3 4&lt;br /&gt;
           5 6&lt;br /&gt;
           7 8&lt;br /&gt;
           9 10&lt;br /&gt;
           11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
    Three columns?&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l3&lt;br /&gt;
           1 2 3&lt;br /&gt;
           4 5 6&lt;br /&gt;
           7 8 9&lt;br /&gt;
           10 11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
    What's the row sum of the &amp;quot;three columns?&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
           6&lt;br /&gt;
           15&lt;br /&gt;
           24&lt;br /&gt;
           33&lt;br /&gt;
           27&lt;br /&gt;
&lt;br /&gt;
    or&lt;br /&gt;
&lt;br /&gt;
        $ tr ' ' '\n' &amp;lt; data |xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
&lt;br /&gt;
    NOTE &amp;quot;Steven Heiner's rule&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
             cat one_file | program&lt;br /&gt;
&lt;br /&gt;
           can always be rewritten as&lt;br /&gt;
&lt;br /&gt;
             program &amp;lt; one_file&lt;br /&gt;
&lt;br /&gt;
   Note: thanks to Steven Heiner (http://www.shelldorado.com/) the above can be&lt;br /&gt;
       shortened as follows:&lt;br /&gt;
&lt;br /&gt;
               $ tr ' ' '\n' &amp;lt; data|xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
&lt;br /&gt;
          Need to &amp;quot;tr&amp;quot; from the stdin?&lt;br /&gt;
&lt;br /&gt;
               $ tr &amp;quot;xy&amp;quot; &amp;quot;yx&amp;quot;| ... | ...&lt;br /&gt;
&lt;br /&gt;
       But there is a the &amp;quot;Stephane CHAZELAS&amp;quot; condition here&lt;br /&gt;
&lt;br /&gt;
         &amp;quot;Note that tr, sed, and awk mail fail on files containing '\0'&lt;br /&gt;
          sed and awk have unspecified behaviors if the input&lt;br /&gt;
          doesn't end in a '\n' (or to sum up, cat works for&lt;br /&gt;
          binary and text files, text utilities such as sed or awk&lt;br /&gt;
          work only for text files).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 45:&lt;br /&gt;
&lt;br /&gt;
     Auto Directory Spelling Corrections.&lt;br /&gt;
&lt;br /&gt;
      To turn this on:&lt;br /&gt;
&lt;br /&gt;
           $ shopt -s cdspell&lt;br /&gt;
&lt;br /&gt;
      Now mispell a directory in the cd command.&lt;br /&gt;
&lt;br /&gt;
           $ cd /usk/local&lt;br /&gt;
                   ^-------- still gets you to --&lt;br /&gt;
                                                |&lt;br /&gt;
                                            /usr/local&lt;br /&gt;
&lt;br /&gt;
      What other options can you set? The following will list&lt;br /&gt;
      all the options:&lt;br /&gt;
&lt;br /&gt;
           $ shopt -p&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 46:&lt;br /&gt;
&lt;br /&gt;
     Record Eveything Printed on Your Terminal Screen.&lt;br /&gt;
&lt;br /&gt;
            $ script -a &amp;lt;filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Now start doing stuff and &amp;quot;everything&amp;quot; is appended to &amp;lt;filename&amp;gt;.&lt;br /&gt;
     For example&lt;br /&gt;
&lt;br /&gt;
            $ script installation&lt;br /&gt;
&lt;br /&gt;
            $ (command)&lt;br /&gt;
&lt;br /&gt;
            $ (result)&lt;br /&gt;
&lt;br /&gt;
            $ ...&lt;br /&gt;
&lt;br /&gt;
            $ ...&lt;br /&gt;
&lt;br /&gt;
            $ (command)&lt;br /&gt;
&lt;br /&gt;
            $ (result)&lt;br /&gt;
&lt;br /&gt;
            $ exit&lt;br /&gt;
&lt;br /&gt;
     The whole session log is in the installation file that you can later&lt;br /&gt;
     read and/or cleanup and add to a documentation.&lt;br /&gt;
&lt;br /&gt;
     This command can also be used to redirect the contents to another user,&lt;br /&gt;
     but you must be root to do this.&lt;br /&gt;
&lt;br /&gt;
     Step 1 - find out what pts they are using.&lt;br /&gt;
&lt;br /&gt;
            $ w&lt;br /&gt;
&lt;br /&gt;
     Step 2 - Run script on that pts. After running this command below&lt;br /&gt;
              everything you type will appear on their screen.&lt;br /&gt;
&lt;br /&gt;
            $ script /dev/pts/4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Thanks to Jacques.GARNIER-EXTERIEUR@EU.RHODIA.COM for his contribution&lt;br /&gt;
     to this tip.&lt;br /&gt;
&lt;br /&gt;
     Also reference TIP 208.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 47:&lt;br /&gt;
&lt;br /&gt;
     Monitor all Network Traffic Except Your Current ssh Connection.&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX -s 1500 port not 22&lt;br /&gt;
&lt;br /&gt;
       Or to filter out port 123 as well getting the full length of the packet&lt;br /&gt;
       (-s 0), use the following:&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX -s 0 port not 22  and port not 123&lt;br /&gt;
&lt;br /&gt;
       Or to filter only a certain host say 81.169.158.205&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX  port not 22 and host 81.169.158.205&lt;br /&gt;
&lt;br /&gt;
     Just want ip addresses and a little bit of data, then,&lt;br /&gt;
     use this. The &amp;quot;-c 20&amp;quot; is to stop after 20 packets.&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN  -s 1500 port not 22 -c 20&lt;br /&gt;
&lt;br /&gt;
     If you're looking for sign of DOS attacks, the following show just the SYN&lt;br /&gt;
     packets on all interfaces:&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump 'tcp[13] &amp;amp; 2 == 2'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 48:&lt;br /&gt;
&lt;br /&gt;
     Where are the GNU Reference Manuals?&lt;br /&gt;
&lt;br /&gt;
           http://www.gnu.org/manual/manual.html&lt;br /&gt;
&lt;br /&gt;
     Also worth a look the &amp;quot;Linux Documentation Project&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           http://en.tldp.org/&lt;br /&gt;
&lt;br /&gt;
     and Red Hat manuals&lt;br /&gt;
&lt;br /&gt;
           http://www.redhat.com/docs/manuals/enterprise/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 49:&lt;br /&gt;
&lt;br /&gt;
     Setting or Changing the Library Path.&lt;br /&gt;
&lt;br /&gt;
     The following contains the settings to be added or deleted&lt;br /&gt;
&lt;br /&gt;
           /etc/ld.so.conf&lt;br /&gt;
&lt;br /&gt;
     After this file is edited, you must run the following:&lt;br /&gt;
&lt;br /&gt;
           $ ldconfig&lt;br /&gt;
&lt;br /&gt;
     See &amp;quot;man ldconfig&amp;quot; for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 50:&lt;br /&gt;
&lt;br /&gt;
     Working with Libraries in C&lt;br /&gt;
&lt;br /&gt;
     Assume the following 3 programs:&lt;br /&gt;
&lt;br /&gt;
      $ cat ./src/test.c&lt;br /&gt;
&lt;br /&gt;
         int test(int t)&lt;br /&gt;
         {&lt;br /&gt;
           printf(&amp;quot;%d\n&amp;quot;,t);&lt;br /&gt;
           return t;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      $ cat ./src/prog1.c&lt;br /&gt;
&lt;br /&gt;
         /*&lt;br /&gt;
          program: prog1.c&lt;br /&gt;
          dependences: test.c&lt;br /&gt;
&lt;br /&gt;
          compiling this program:&lt;br /&gt;
          gcc -o prog test.c prog1.c&lt;br /&gt;
&lt;br /&gt;
          Note the libpersonal include&lt;br /&gt;
          should be remove if NOT using the&lt;br /&gt;
          library&lt;br /&gt;
         */&lt;br /&gt;
&lt;br /&gt;
         #include &amp;lt;libpersonal.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         int&lt;br /&gt;
         main(int argc, char **argv)&lt;br /&gt;
         {&lt;br /&gt;
           test(45);&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
      $ cat ./include/libpersonal.h&lt;br /&gt;
&lt;br /&gt;
         extern int test(int);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Prog1.c needs the test function in  test.c&lt;br /&gt;
     To compile, so that both programs work together, do the following:&lt;br /&gt;
&lt;br /&gt;
          $ cd src&lt;br /&gt;
          $ gcc -o prog test.c prog1.c -I../include&lt;br /&gt;
&lt;br /&gt;
     However, if you want to create your own static library, then, run the following:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p ../lib&lt;br /&gt;
          $ gcc -c test.c  -o ../lib/test.o&lt;br /&gt;
          $ cd ../lib&lt;br /&gt;
          $ ar r libpersonal.a test.o&lt;br /&gt;
          $ ranlib libpersonal.a&lt;br /&gt;
&lt;br /&gt;
     or, the ar and ranlib command can be combined as follows:&lt;br /&gt;
&lt;br /&gt;
          $ ar rs libpersonal.a test.o&lt;br /&gt;
&lt;br /&gt;
     To compile the program with the static library:&lt;br /&gt;
&lt;br /&gt;
          $ cd ../src&lt;br /&gt;
          $ gcc -I../include -L../lib -o prog1 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     The -I../include  tells  gcc to look in the ../include directory for&lt;br /&gt;
     libpersonal.h. and -L../lib, tells gcc to look for the&lt;br /&gt;
     &amp;quot;libpersonal.a&amp;quot; library.&lt;br /&gt;
&lt;br /&gt;
           $ cd ..&lt;br /&gt;
           $ tree src lib include&lt;br /&gt;
           src&lt;br /&gt;
           |-- prog&lt;br /&gt;
           |-- prog1&lt;br /&gt;
           |-- prog1.c&lt;br /&gt;
           `-- test.c&lt;br /&gt;
           lib&lt;br /&gt;
           |-- libpersonal.a&lt;br /&gt;
           `-- test.o&lt;br /&gt;
           include&lt;br /&gt;
           `-- libpersonal.h&lt;br /&gt;
&lt;br /&gt;
     This was a STATIC library. Often times you will want to use a SHARED&lt;br /&gt;
     or dynamic library.&lt;br /&gt;
&lt;br /&gt;
     SHARED LIBRARY:&lt;br /&gt;
&lt;br /&gt;
     You must recompile test.c with -fpic option.&lt;br /&gt;
&lt;br /&gt;
          $ cd ../lib&lt;br /&gt;
          $ gcc -c -fpic ../src/test.c -o test.o&lt;br /&gt;
&lt;br /&gt;
     Next create the libpersonal.so file.&lt;br /&gt;
&lt;br /&gt;
          $ gcc -shared -o libpersonal.so test.o&lt;br /&gt;
&lt;br /&gt;
     Now, compile the source prog1.c as follows:&lt;br /&gt;
&lt;br /&gt;
          $ cd ../src&lt;br /&gt;
          $ gcc -Wl,-R../lib -L../lib -I../include -o prog2 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
     This should work fine. But, take a look at prog2 using the ldd command.&lt;br /&gt;
&lt;br /&gt;
          $ ldd prog2&lt;br /&gt;
&lt;br /&gt;
        libpersonal.so =&amp;gt; ../lib/libpersonal.so (0x40017000)&lt;br /&gt;
        libc.so.6 =&amp;gt; /lib/tls/libc.so.6 (0x42000000)&lt;br /&gt;
        /lib/ld-linux.so.2 =&amp;gt; /lib/ld-linux.so.2 (0x40000000)&lt;br /&gt;
&lt;br /&gt;
     If you move the program prog2 to a different location, it will not run.&lt;br /&gt;
     Instead you will get the following error:&lt;br /&gt;
&lt;br /&gt;
           prog2: error while loading shared libraries: libpersonal.so:&lt;br /&gt;
                     cannot open shared object file: No such file or directory&lt;br /&gt;
&lt;br /&gt;
     To fix this, you should specify the direct path to the library. And in my&lt;br /&gt;
     case it is rather long&lt;br /&gt;
&lt;br /&gt;
      $  gcc -Wl,-R/work/souptonuts/documentation/theBook/lib -L../lib -I../include -o prog2 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE: The -R must always follow the -Wl.  (-Wl,-R&amp;lt;directory&amp;gt;) They always go together&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 51:&lt;br /&gt;
&lt;br /&gt;
     Actively Monitor a File and Send Email when Expression Occurs.&lt;br /&gt;
&lt;br /&gt;
     This is a way to monitor &amp;quot;/var/log/messages&amp;quot; or any file for certain changes.&lt;br /&gt;
     The example below actively monitors &amp;quot;stuff&amp;quot; for the work &amp;quot;now&amp;quot; and as soon as&lt;br /&gt;
     &amp;quot;now&amp;quot; is added to the file, the contents of msg are sent to the user&lt;br /&gt;
     mikechirico@hotmail.com&lt;br /&gt;
&lt;br /&gt;
          $ tail -f stuff | \&lt;br /&gt;
              awk ' /now/ { system(&amp;quot;mail -s \&amp;quot;This is working\&amp;quot;  mikechirico@hotmail.com &amp;lt; msg&amp;quot;) }'&lt;br /&gt;
&lt;br /&gt;
     Or, you can run a program, say get headings on slashdot from the program &amp;quot;getslash.php&amp;quot; which&lt;br /&gt;
     runs on  &amp;quot;192.168.1.155&amp;quot; with account &amp;quot;chirico&amp;quot;. Assuming you have ssh keys setup, then, the following&lt;br /&gt;
     will send mail from the output:&lt;br /&gt;
&lt;br /&gt;
          $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;|mail -s &amp;quot;Slash cron Headlines&amp;quot;  mchirico@comcast.net&lt;br /&gt;
&lt;br /&gt;
     See (TIP 80) for scraping the headings on slash dot and how to get a copy of &amp;quot;getslash.php&amp;quot;.  If you still&lt;br /&gt;
     want to use awk:&lt;br /&gt;
&lt;br /&gt;
           $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;| \&lt;br /&gt;
                      awk '{ print $0 | &amp;quot;mail -s \x27 Slash Topics \x27 mchirico@comcast.net &amp;quot;}'&lt;br /&gt;
&lt;br /&gt;
     Note the &amp;quot;\x27&amp;quot; is a quote.  Maybe you only want articles dealing with &amp;quot;Linux&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
           $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;| \&lt;br /&gt;
                      awk '/Linux/{ print $0 | &amp;quot;mail -s \x27 Slash Topics \x27 mchirico@comcast.net &amp;quot;}'&lt;br /&gt;
&lt;br /&gt;
     For $60, you can get a numeric display from &amp;quot;delcom engineering&amp;quot; that you can send messages and&lt;br /&gt;
     data to.  I get weather information off the internet and send it to this device.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/projects/delcom/&lt;br /&gt;
&lt;br /&gt;
     (Reference TIP 151 for ssh tips)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 52:&lt;br /&gt;
&lt;br /&gt;
     Need to Keep Secrets? Encrypt it.&lt;br /&gt;
&lt;br /&gt;
      To Encrypt:&lt;br /&gt;
&lt;br /&gt;
            $ openssl des3 -salt -in file.txt -out file.des3&lt;br /&gt;
&lt;br /&gt;
      The above will prompt for a password, or you can put it in&lt;br /&gt;
      with a -k option, assuming you're on a trusted server.&lt;br /&gt;
&lt;br /&gt;
      To Decrypt&lt;br /&gt;
&lt;br /&gt;
            $  openssl des3 -d -salt -in file.des3 -out file.txt -k mypassword&lt;br /&gt;
&lt;br /&gt;
      Need to encrypt what you type? Enter the following, then start typing&lt;br /&gt;
      and  ^D to end.&lt;br /&gt;
&lt;br /&gt;
            $ openssl des3 -salt -out stuff.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 53:&lt;br /&gt;
&lt;br /&gt;
     Check that a File has Not Been Tampered With: Use Cryptographic Hashing Function.&lt;br /&gt;
&lt;br /&gt;
     The md5sum is popular but dated&lt;br /&gt;
&lt;br /&gt;
              $ md5sum file&lt;br /&gt;
&lt;br /&gt;
     Instead, use one of the following;&lt;br /&gt;
&lt;br /&gt;
              $ openssl dgst -sha1 -c file&lt;br /&gt;
&lt;br /&gt;
              $ openssl dgst -ripemd160 -c  file&lt;br /&gt;
&lt;br /&gt;
     All calls give a fixed length string or &amp;quot;message digest&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 54:&lt;br /&gt;
&lt;br /&gt;
     Need to View Information About a Secure Web Server? A SSL/TLS test.&lt;br /&gt;
&lt;br /&gt;
           $ openssl s_client -connect www.sourceforge.net:443&lt;br /&gt;
&lt;br /&gt;
     Above will give a long listing of certificates.&lt;br /&gt;
&lt;br /&gt;
     Note, it is also possible to get certificate information about a mail server&lt;br /&gt;
&lt;br /&gt;
           $ openssl s_client -connect mail.comcast.net:995 -showcerts&lt;br /&gt;
&lt;br /&gt;
     When you do the above command you get two certificates. If you copy&lt;br /&gt;
     past both certificates by taking the following contents include the&lt;br /&gt;
     begin and end show below:&lt;br /&gt;
&lt;br /&gt;
                 -----BEGIN CERTIFICATE-----&lt;br /&gt;
                 ....&lt;br /&gt;
                 -----END CERTIFICATE-----&lt;br /&gt;
&lt;br /&gt;
     Then create files &amp;quot;comcast0.pem&amp;quot; and &amp;quot;comcast1.pem&amp;quot; out of these certificaties and&lt;br /&gt;
     put them in a directory &amp;quot;/home/donkey/.certs&amp;quot;, then, with the openssl src package, in&lt;br /&gt;
     the &amp;quot;./tools/c_rehash&amp;quot; run&lt;br /&gt;
&lt;br /&gt;
            $ c_rehash .certs&lt;br /&gt;
            Doing .certs&lt;br /&gt;
            comcast0.pem =&amp;gt; 72f90dc0.0&lt;br /&gt;
            comcast1.pem =&amp;gt; f73e89fd.0&lt;br /&gt;
&lt;br /&gt;
     Now it's possible to have fetchmail work with these certs.&lt;br /&gt;
&lt;br /&gt;
       #&lt;br /&gt;
       #&lt;br /&gt;
       # Sample .fetchmailrc file for Comcast&lt;br /&gt;
       #&lt;br /&gt;
       # Check mail every 90 seconds&lt;br /&gt;
       set daemon 90&lt;br /&gt;
       set syslog&lt;br /&gt;
       set postmaster donkey&lt;br /&gt;
       #set bouncemail&lt;br /&gt;
       #&lt;br /&gt;
       # Comcast email is zdonkey but computer account is  just donkey&lt;br /&gt;
       #&lt;br /&gt;
       poll mail.comcast.net with proto POP3 and options no dns&lt;br /&gt;
              user 'zdonkey' with pass &amp;quot;somethin35&amp;quot;  is 'donkey' here options ssl sslcertck sslcertpath '/home/donkey/.certs'&lt;br /&gt;
              smtphost comcast.net&lt;br /&gt;
       # currently not used&lt;br /&gt;
       mda '/usr/bin/procmail -d %T'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     REFERENCE: http://www.openssl.org/&lt;br /&gt;
                http://www.catb.org/~esr/fetchmail/fetchmail-6.2.5.tar.gz&lt;br /&gt;
                http://www.madboa.com/geek/openssl/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 55:&lt;br /&gt;
&lt;br /&gt;
     cp --parents. What does this option do?&lt;br /&gt;
&lt;br /&gt;
     Assume you have the following directory structure&lt;br /&gt;
&lt;br /&gt;
            .&lt;br /&gt;
            |-- a&lt;br /&gt;
            |   `-- b&lt;br /&gt;
            |       `-- c&lt;br /&gt;
            |           `-- d&lt;br /&gt;
            |               |-- file1&lt;br /&gt;
            |               `-- file2&lt;br /&gt;
            `-- newdir&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Issue the following command:&lt;br /&gt;
&lt;br /&gt;
         $ cp --parents ./a/b/c/d/* ./newdir/&lt;br /&gt;
&lt;br /&gt;
     Now you have the following:&lt;br /&gt;
&lt;br /&gt;
            .&lt;br /&gt;
            |-- a&lt;br /&gt;
            |   `-- b&lt;br /&gt;
            |       `-- c&lt;br /&gt;
            |           `-- d&lt;br /&gt;
            |               |-- file1&lt;br /&gt;
            |               `-- file2&lt;br /&gt;
            `-- newdir&lt;br /&gt;
                `-- a&lt;br /&gt;
                    `-- b&lt;br /&gt;
                        `-- c&lt;br /&gt;
                            `-- d&lt;br /&gt;
                                |-- file1&lt;br /&gt;
                                `-- file2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 56:&lt;br /&gt;
&lt;br /&gt;
     Quickly Locating files.&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;locate&amp;quot; command quickly searches the indexed database for files.  It just&lt;br /&gt;
     gives the name of the files; but, if you need more information use it as follows&lt;br /&gt;
&lt;br /&gt;
         $ locate document|xargs ls -l&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;locate&amp;quot; database may only get updated every 24 hours.  For more recent finds,&lt;br /&gt;
     use the &amp;quot;find&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 57:&lt;br /&gt;
&lt;br /&gt;
     Using the &amp;quot;find&amp;quot; Command.&lt;br /&gt;
&lt;br /&gt;
     List only directories, max 2 nodes down that have &amp;quot;net&amp;quot; in the name&lt;br /&gt;
&lt;br /&gt;
       $ find /proc -type d -maxdepth 2 -iname '*net*'&lt;br /&gt;
&lt;br /&gt;
     Find all *.c and *.h files starting from the current &amp;quot;.&amp;quot; position.&lt;br /&gt;
&lt;br /&gt;
       $ find . \( -iname '*.c'  -o -iname '*.h' \) -print&lt;br /&gt;
&lt;br /&gt;
     Find all, but skip what's in &amp;quot;/CVS&amp;quot; and &amp;quot;/junk&amp;quot;. Start from &amp;quot;/work&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ find /work \( -iregex '.*/CVS'  -o -iregex '.*/junk' \)  -prune -o -print&lt;br /&gt;
&lt;br /&gt;
     Note -regex and -iregex work on the directory as well, which means&lt;br /&gt;
     you must consider the &amp;quot;./&amp;quot; that comes before all listings.&lt;br /&gt;
&lt;br /&gt;
     Here is another example. Find all files except what is under the CVS, including&lt;br /&gt;
     CVS listings. Also exclude &amp;quot;#&amp;quot; and &amp;quot;~&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       $ find . -regex '.*' ! \( -regex '.*CVS.*'  -o -regex '.*[#|~].*' \)&lt;br /&gt;
&lt;br /&gt;
     Find a *.c file, then run grep on it looking for &amp;quot;stdio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       $ find . -iname '*.c' -exec grep -H 'stdio.h' {} \;&lt;br /&gt;
         sample output --&amp;gt;  ./prog1.c:#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
                            ./test.c:#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Looking for the disk-hog on the whole system?&lt;br /&gt;
&lt;br /&gt;
       $ find /  -size +10000k 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
     Looking for files changed in the last 24 hours? Make sure you add the&lt;br /&gt;
     minus sign &amp;quot;-1&amp;quot;, otherwise, you will only find files changed exactly&lt;br /&gt;
     24 hours from now. With the &amp;quot;-1&amp;quot; you get files changed from now to 24&lt;br /&gt;
     hours.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ find  . -ctime -1  -printf &amp;quot;%a %f\n&amp;quot;&lt;br /&gt;
       Wed Oct  6 12:51:56 2004 .&lt;br /&gt;
       Wed Oct  6 12:35:16 2004 How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
     Or if you just want files.&lt;br /&gt;
&lt;br /&gt;
       $ find . -type f -ctime -1  -printf &amp;quot;%a %f\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Details on file status change in the last 48 hours, current directory. Also note &amp;quot;-atime -2&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
       $ find . -ctime -2 -type f -exec ls -l {} \;&lt;br /&gt;
&lt;br /&gt;
             NOTE: if you don't use -type f, you make get &amp;quot;.&amp;quot; returned, which&lt;br /&gt;
             when run through ls &amp;quot;ls .&amp;quot; may list more than what you want.&lt;br /&gt;
&lt;br /&gt;
             Also you may only want the current directory&lt;br /&gt;
&lt;br /&gt;
       $ find . -ctime -2 -type f -maxdepth 1 -exec ls -l {} \;&lt;br /&gt;
&lt;br /&gt;
     To find files modified within the last 5 to 10 minutes&lt;br /&gt;
&lt;br /&gt;
       $ find . -mmin +5 -mmin -10 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     For more example &amp;quot;find&amp;quot; commands, reference the following looking&lt;br /&gt;
     for the latest version of &amp;quot;bashscripts.x.x.x.tar.gz&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79320&amp;amp;package_id=80711&lt;br /&gt;
&lt;br /&gt;
     See &amp;quot;TIP 71&amp;quot; for examples of find using the inode feature. &amp;quot; $ find . -inum &amp;lt;inode&amp;gt; -exec rm -- '{}' \; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     If you don't want error messages, or need to redirect error messages &amp;quot;&amp;gt; /dev/null 2&amp;gt;&amp;amp;1&amp;quot;, or see&lt;br /&gt;
     &amp;quot;TIP 81&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 58:&lt;br /&gt;
&lt;br /&gt;
     Using the &amp;quot;rm&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
     How do you remove a file that has the name &amp;quot;-&amp;quot;.  For instance, if you run the command&lt;br /&gt;
     &amp;quot;$ cat &amp;gt; - &amp;quot; and type some text followed by ^d, how does the &amp;quot;-&amp;quot; file get deleted?&lt;br /&gt;
&lt;br /&gt;
        $ rm -- -&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;--&amp;quot; nullifies any rm options.&lt;br /&gt;
&lt;br /&gt;
     How do you delete the directory &amp;quot;one&amp;quot;, all it's sub-directories, and any data?&lt;br /&gt;
&lt;br /&gt;
        $ rm -rf ./one&lt;br /&gt;
&lt;br /&gt;
     Note, to selectively delete stuff on a directory, use the find command &amp;quot;TIP 57&amp;quot;.&lt;br /&gt;
     To delete by inode, see &amp;quot;TIP 71&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 59:&lt;br /&gt;
&lt;br /&gt;
     Giving ownership.&lt;br /&gt;
&lt;br /&gt;
     How do you give the user &amp;quot;donkey&amp;quot; ownership to all directories and files under&lt;br /&gt;
     &amp;quot;./fordonkey&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          $ chown -R donkey ./fordonkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 60:&lt;br /&gt;
&lt;br /&gt;
     Only Permit root login -- give others a message when they try to login.&lt;br /&gt;
&lt;br /&gt;
     Create the file &amp;quot;/etc/nologin&amp;quot; with &amp;quot;nologin&amp;quot; containing the contents&lt;br /&gt;
     of the message.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 61:&lt;br /&gt;
&lt;br /&gt;
     Limits: file size, open files, pipe size, stack size, max memory size&lt;br /&gt;
             cpu time, plus others.&lt;br /&gt;
&lt;br /&gt;
     To get a listing of current limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -a&lt;br /&gt;
             core file size        (blocks, -c) 0&lt;br /&gt;
             data seg size         (kbytes, -d) unlimited&lt;br /&gt;
             file size             (blocks, -f) unlimited&lt;br /&gt;
             max locked memory     (kbytes, -l) unlimited&lt;br /&gt;
             max memory size       (kbytes, -m) unlimited&lt;br /&gt;
             open files                    (-n) 1024&lt;br /&gt;
             pipe size          (512 bytes, -p) 8&lt;br /&gt;
             stack size            (kbytes, -s) 8192&lt;br /&gt;
             cpu time             (seconds, -t) unlimited&lt;br /&gt;
             max user processes            (-u) 8179&lt;br /&gt;
             virtual memory        (kbytes, -v) unlimited&lt;br /&gt;
&lt;br /&gt;
     Note as a user you can decrease your limits in the current&lt;br /&gt;
     shell session; but, you cannot increase.  This can be ideal&lt;br /&gt;
     for testing programs.  But, first you may want to create&lt;br /&gt;
     another shell &amp;quot;sh&amp;quot; so that you can &amp;quot;go back to where started&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -f 10&lt;br /&gt;
&lt;br /&gt;
     Now try&lt;br /&gt;
&lt;br /&gt;
          $ yes &amp;gt;&amp;gt; out&lt;br /&gt;
             File size limit exceeded&lt;br /&gt;
&lt;br /&gt;
     To set limits on users, make changes to &amp;quot;/etc/security/limits.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           bozo   - maxlogins 1&lt;br /&gt;
&lt;br /&gt;
     Will keep bozo from loging in more than once.&lt;br /&gt;
&lt;br /&gt;
     To list hard limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -Ha&lt;br /&gt;
&lt;br /&gt;
     To list soft limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -Sa&lt;br /&gt;
&lt;br /&gt;
     To restrict user access by time, day make changes to&lt;br /&gt;
             &amp;quot;/etc/security/time.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Also take a look at &amp;quot;/etc/profile&amp;quot; to see what other changes&lt;br /&gt;
     can be made, plus take a look under &amp;quot;/etc/security/*.conf&amp;quot; for&lt;br /&gt;
     other configuration files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 62:&lt;br /&gt;
&lt;br /&gt;
     Stupid &amp;quot;cat&amp;quot; Tricks.&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 43).&lt;br /&gt;
&lt;br /&gt;
     If you have multiple blank lines, squeeze these lines down to one,&lt;br /&gt;
     then, try the following:&lt;br /&gt;
&lt;br /&gt;
          $ cat -s &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to number the lines?&lt;br /&gt;
&lt;br /&gt;
          $ cat -n &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to show tabs?&lt;br /&gt;
&lt;br /&gt;
          $ cat -t &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Need to mark end of lines by &amp;quot;$&amp;quot;? The following was suggested by  (Amos Shapira)&lt;br /&gt;
&lt;br /&gt;
          $ cat -e &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to see all the ctl characters?&lt;br /&gt;
&lt;br /&gt;
          /* ctlgen.c&lt;br /&gt;
            Program to generate ctl characters.&lt;br /&gt;
&lt;br /&gt;
            Compile:&lt;br /&gt;
&lt;br /&gt;
               gcc -o ctlgen ctlgen.c&lt;br /&gt;
&lt;br /&gt;
            Run:&lt;br /&gt;
&lt;br /&gt;
               ./ctlgen &amp;gt; mout&lt;br /&gt;
&lt;br /&gt;
            Now see the characters:&lt;br /&gt;
&lt;br /&gt;
               cat -v mout&lt;br /&gt;
&lt;br /&gt;
            Here's a sample output:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               $ cat -v mout|tail&lt;br /&gt;
                   test M-v&lt;br /&gt;
                   test M-w&lt;br /&gt;
                   test M-x&lt;br /&gt;
                   test M-y&lt;br /&gt;
                   test M-z&lt;br /&gt;
                   test M-{&lt;br /&gt;
                   test M-|&lt;br /&gt;
                   test M-}&lt;br /&gt;
                   test M-~&lt;br /&gt;
                   test M-^?&lt;br /&gt;
&lt;br /&gt;
          */&lt;br /&gt;
          #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
          #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
          int main()&lt;br /&gt;
          {&lt;br /&gt;
            int i;&lt;br /&gt;
&lt;br /&gt;
            for(i=0; i &amp;lt; 256; ++i)&lt;br /&gt;
              printf(&amp;quot;test %c \n&amp;quot;,i);&lt;br /&gt;
&lt;br /&gt;
            return 0;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 63:&lt;br /&gt;
&lt;br /&gt;
     Guard against SYN attacks and &amp;quot;ping&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     As root do the following:&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/tcp_syncookies&lt;br /&gt;
&lt;br /&gt;
     Want to disable &amp;quot;ping&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_all&lt;br /&gt;
&lt;br /&gt;
     Disable broadcast/multicast &amp;quot;ping&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts&lt;br /&gt;
&lt;br /&gt;
     And to enable again:&lt;br /&gt;
&lt;br /&gt;
          echo 0 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_all&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 64:&lt;br /&gt;
&lt;br /&gt;
     Make changes to .bash_profile and need to update the current session?&lt;br /&gt;
&lt;br /&gt;
       $ source .bash_profile&lt;br /&gt;
&lt;br /&gt;
     With the above command, the user does not have to logout.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 65:&lt;br /&gt;
&lt;br /&gt;
     What are the Special Shell Variables?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        $#   The number of arguments.&lt;br /&gt;
        $@   All arguments, as separate words.&lt;br /&gt;
        $*   All arguments, as one word.&lt;br /&gt;
        $$   ID of the current process.&lt;br /&gt;
        $?   Exit status of the last command.&lt;br /&gt;
        $0,$1,..$9,${10},${11}...${N}    Positional parameters. After &amp;quot;9&amp;quot; you must use the ${k} syntax.&lt;br /&gt;
&lt;br /&gt;
     Note that 0 is true. For example if you execute the following, which is true you get zero.&lt;br /&gt;
&lt;br /&gt;
         $  [[ -f /etc/passwd ]]&lt;br /&gt;
         $  echo $?&lt;br /&gt;
         0&lt;br /&gt;
     And the following is false, which returns a 1.&lt;br /&gt;
&lt;br /&gt;
         $  [[ -f /etc/passwdjabberwisnohere ]]&lt;br /&gt;
         $  echo $?&lt;br /&gt;
         1&lt;br /&gt;
&lt;br /&gt;
     So true=0 and false=1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Sample program &amp;quot;mdo&amp;quot;  to show the difference between &amp;quot;$@&amp;quot; and &amp;quot;$*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        function myarg&lt;br /&gt;
        {&lt;br /&gt;
            echo &amp;quot;$# in myarg function&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
        echo -e &amp;quot;$# parameters on the cmd line\n&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;calling: myarg \&amp;quot;\$@\&amp;quot; and myarg \&amp;quot;\$*\&amp;quot;\n&amp;quot;&lt;br /&gt;
        myarg &amp;quot;$@&amp;quot;&lt;br /&gt;
        myarg &amp;quot;$*&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;\ncalling: myarg \$@ and myarg \$* without quotes\n&amp;quot;&lt;br /&gt;
        myarg $@&lt;br /&gt;
        myarg $*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The result of running &amp;quot;./mdo one two&amp;quot;. Note that when quoted, myarg &amp;quot;$*&amp;quot;,&lt;br /&gt;
      returns 1 ... all parameters are smushed together as one word.&lt;br /&gt;
&lt;br /&gt;
            [chirico@third-fl-71 theBook]$ ./mdo one two&lt;br /&gt;
            2 parameters on the cmd line&lt;br /&gt;
&lt;br /&gt;
            calling: myarg &amp;quot;$@&amp;quot; and myarg &amp;quot;$*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
            1 in myarg function&lt;br /&gt;
&lt;br /&gt;
            calling: myarg $@ and myarg $* without quotes&lt;br /&gt;
&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
&lt;br /&gt;
      Example program &amp;quot;mdo2&amp;quot; shows how the input separator can be changed.&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        IFS=|&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=,&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=\;&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=$1&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            [chirico@third-fl-71 theBook]$ ./mdo2 one two three four five&lt;br /&gt;
            one two three four five&lt;br /&gt;
&lt;br /&gt;
            one,two,three,four,five&lt;br /&gt;
&lt;br /&gt;
            one;two;three;four;five&lt;br /&gt;
&lt;br /&gt;
            oneotwoothreeofourofive&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 66:&lt;br /&gt;
&lt;br /&gt;
     Replace all &amp;quot;x&amp;quot; with &amp;quot;y&amp;quot; and all &amp;quot;y&amp;quot; with &amp;quot;x&amp;quot; in file data.&lt;br /&gt;
&lt;br /&gt;
        $ cata data&lt;br /&gt;
          x y&lt;br /&gt;
          y x&lt;br /&gt;
&lt;br /&gt;
        $ tr &amp;quot;xy&amp;quot;  &amp;quot;yx&amp;quot; &amp;lt; data&lt;br /&gt;
          y x&lt;br /&gt;
          x y&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 67:&lt;br /&gt;
&lt;br /&gt;
     On a Linux 2.6.x Kernel, how do you directly measure disk activity,&lt;br /&gt;
     and where is this information documented?&lt;br /&gt;
&lt;br /&gt;
          o The information is documented in the kernel source&lt;br /&gt;
               ./Documentation/iostats.txt&lt;br /&gt;
&lt;br /&gt;
          o The new way of getting this info in 2.6.x is&lt;br /&gt;
              $ cat /sys/block/hda/stat&lt;br /&gt;
            151121 5694 1932358 796675 37867 76770 916994 8353762 0 800672 9150437&lt;br /&gt;
&lt;br /&gt;
             Field  1 -- # of reads issued&lt;br /&gt;
                 This is the total number of reads completed successfully.&lt;br /&gt;
             Field  2 -- # of reads merged, field 6 -- # of writes merged&lt;br /&gt;
                 Reads and writes which are adjacent to each other may be merged for&lt;br /&gt;
                 efficiency.  Thus two 4K reads may become one 8K read before it is&lt;br /&gt;
                 ultimately handed to the disk, and so it will be counted (and queued)&lt;br /&gt;
                 as only one I/O.  This field lets you know how often this was done.&lt;br /&gt;
             Field  3 -- # of sectors read&lt;br /&gt;
                 This is the total number of sectors read successfully.&lt;br /&gt;
             Field  4 -- # of milliseconds spent reading&lt;br /&gt;
                 This is the total number of milliseconds spent by all reads (as&lt;br /&gt;
                 measured from __make_request() to end_that_request_last()).&lt;br /&gt;
             Field  5 -- # of writes completed&lt;br /&gt;
                 This is the total number of writes completed successfully.&lt;br /&gt;
             Field  7 -- # of sectors written&lt;br /&gt;
                 This is the total number of sectors written successfully.&lt;br /&gt;
             Field  8 -- # of milliseconds spent writing&lt;br /&gt;
                 This is the total number of milliseconds spent by all writes (as&lt;br /&gt;
                 measured from __make_request() to end_that_request_last()).&lt;br /&gt;
             Field  9 -- # of I/Os currently in progress&lt;br /&gt;
                 The only field that should go to zero. Incremented as requests are&lt;br /&gt;
                 given to appropriate request_queue_t and decremented as they finish.&lt;br /&gt;
             Field 10 -- # of milliseconds spent doing I/Os&lt;br /&gt;
                 This field is increases so long as field 9 is nonzero.&lt;br /&gt;
             Field 11 -- weighted # of milliseconds spent doing I/Os&lt;br /&gt;
                 This field is incremented at each I/O start, I/O completion, I/O&lt;br /&gt;
                 merge, or read of these stats by the number of I/Os in progress&lt;br /&gt;
                 (field 9) times the number of milliseconds spent doing I/O since the&lt;br /&gt;
                 last update of this field.  This can provide an easy measure of both&lt;br /&gt;
                 I/O completion time and the backlog that may be accumulating.&lt;br /&gt;
&lt;br /&gt;
       Note, this is device specific.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 68:&lt;br /&gt;
&lt;br /&gt;
     Passing Outbound Mail, plus Masquerading User and Hostname.&lt;br /&gt;
&lt;br /&gt;
     Here's a specific example:&lt;br /&gt;
&lt;br /&gt;
         How does one send and receive Comcast email from a home Linux box,&lt;br /&gt;
         which uses Comcast as the ISP, if the local account on the Linux&lt;br /&gt;
         box is different from the Comcast email.  For instance, the&lt;br /&gt;
         account on the Linux box is &amp;quot;chirico@third-fl-71&amp;quot; and the Comcast&lt;br /&gt;
         email account is &amp;quot;mchirico@comcast.net&amp;quot;.  Note both the hostname and&lt;br /&gt;
         username are different.&lt;br /&gt;
&lt;br /&gt;
         So, the user &amp;quot;chirico&amp;quot; using &amp;quot;mutt&amp;quot;, &amp;quot;elm&amp;quot; or any email program would&lt;br /&gt;
         like to send out email to say &amp;quot;donkey@comcast.net&amp;quot;; yet, donkey would&lt;br /&gt;
         see the email from &amp;quot;mchirico@comcast.net&amp;quot; and not &amp;quot;chirico@third-fl-71&amp;quot;&lt;br /&gt;
         but chirico@third-fl-71 would get the replies.&lt;br /&gt;
&lt;br /&gt;
         For a full description of how to solve this problem, including related&lt;br /&gt;
         &amp;quot;sendmail.mc&amp;quot;, &amp;quot;site.config.m4&amp;quot;, &amp;quot;genericstable&amp;quot;, &amp;quot;genericsdomain&amp;quot;,&lt;br /&gt;
         &amp;quot;.procmailrc&amp;quot;, and &amp;quot;.forward&amp;quot; files,  reference the following:&lt;br /&gt;
&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/README_COMCAST_EMAIL.txt?download&lt;br /&gt;
&lt;br /&gt;
         Included in the above link are instructions for building sendmail with&lt;br /&gt;
         &amp;quot;SASL&amp;quot; and &amp;quot;STARTTLS&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 69:&lt;br /&gt;
&lt;br /&gt;
     How do you remove just the last 2 lines from a file and save the result?&lt;br /&gt;
&lt;br /&gt;
         $ sed  '$d' file | sed '$d' &amp;gt; savefile&lt;br /&gt;
&lt;br /&gt;
     Or, as Amos Shapira pointed out, it's much easier with the head command.&lt;br /&gt;
&lt;br /&gt;
         $ head -2 file&lt;br /&gt;
&lt;br /&gt;
      And, of course, removing just the last line&lt;br /&gt;
&lt;br /&gt;
         $ sed '$d' file &amp;gt; savefile&lt;br /&gt;
&lt;br /&gt;
         (See REFERENCES (13))&lt;br /&gt;
&lt;br /&gt;
     How do you remove extra spaces at the end of a line?&lt;br /&gt;
&lt;br /&gt;
         $ sed 's/[ ]*$//g'&lt;br /&gt;
&lt;br /&gt;
     How do you remove blank lines, or lines with just spaces and tabs,&lt;br /&gt;
     saving the origional file as file.backup?&lt;br /&gt;
&lt;br /&gt;
         $ perl -pi.backup -e &amp;quot;s/^(\s)*\n//&amp;quot;  file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 70:&lt;br /&gt;
&lt;br /&gt;
     Generating Random Numbers.&lt;br /&gt;
&lt;br /&gt;
         $ od -vAn -N4 -tu4 &amp;lt; /dev/urandom&lt;br /&gt;
             3905158199&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 71:&lt;br /&gt;
&lt;br /&gt;
     Deleting a File by it's Inode Value.&lt;br /&gt;
&lt;br /&gt;
       See (PROGRAMMING TIP 5) for creating the file, or&lt;br /&gt;
&lt;br /&gt;
       $ cat &amp;gt; '\n\n\n\n\n\n\n'&lt;br /&gt;
         type some text&lt;br /&gt;
         ^D&lt;br /&gt;
&lt;br /&gt;
     To list the inode and display the characters.&lt;br /&gt;
&lt;br /&gt;
       $ ls -libt *&lt;br /&gt;
&lt;br /&gt;
     To remove by inode. Note the &amp;quot;--&amp;quot; option.  This&lt;br /&gt;
     will keep any special characters in the file from being&lt;br /&gt;
     interpreted at &amp;quot;rm&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
       $ find . -inum &amp;lt;inode&amp;gt; -exec rm -- '{}' \;&lt;br /&gt;
&lt;br /&gt;
     Or to check contents&lt;br /&gt;
&lt;br /&gt;
       $ find . -inum &amp;lt;inode&amp;gt; -exec cat '{}' \;&lt;br /&gt;
&lt;br /&gt;
     Reference:&lt;br /&gt;
         http://www.faqs.org/ftp/usenet/news.answers/unix-faq/faq/part2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 72:&lt;br /&gt;
&lt;br /&gt;
     Sending Attachments Using Mutt -- On the Command Line.&lt;br /&gt;
&lt;br /&gt;
        $ mutt -s &amp;quot;See Attachment&amp;quot; -a file.doc user@domain.net &amp;lt; message.txt&lt;br /&gt;
&lt;br /&gt;
          or just the message:&lt;br /&gt;
&lt;br /&gt;
        $ echo | mutt -a sample.tar.gz user@domain.net&lt;br /&gt;
&lt;br /&gt;
      Reference:&lt;br /&gt;
          http://www.shelldorado.com/articles/mailattachments.html&lt;br /&gt;
&lt;br /&gt;
        Also see (TIP 51).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 73:&lt;br /&gt;
&lt;br /&gt;
     Want to find out what functions a program calls?&lt;br /&gt;
&lt;br /&gt;
         $ strace &amp;lt;program&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Try this with &amp;quot;topen.c&amp;quot; (see PROGRAMMING TIP 5)&lt;br /&gt;
&lt;br /&gt;
         $ strace  ./topen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 74:&lt;br /&gt;
&lt;br /&gt;
     RPM Usage Summary.&lt;br /&gt;
&lt;br /&gt;
     Install. Full filename is needed.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -ivh Fedora/RPMS/postgresql-libs-7.4.2-1.i386.rpm&lt;br /&gt;
&lt;br /&gt;
     To view list of files installed with a particular package.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -ql postgresql-libs&lt;br /&gt;
                /usr/lib/libecpg.so.4&lt;br /&gt;
                /usr/lib/libecpg.so.4.1&lt;br /&gt;
                /usr/lib/libecpg_compat.so.1&lt;br /&gt;
                /usr/lib/libecpg_compat.so.1.1&lt;br /&gt;
                /usr/lib/libpgtypes.so.1&lt;br /&gt;
                ...&lt;br /&gt;
&lt;br /&gt;
     Or, to get the file listing from a package that is not installed use the&lt;br /&gt;
     &amp;quot;-p&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -pql /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/CHANGES&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/LICENSE&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/README&lt;br /&gt;
               /usr/share/man/man3/pcap.3.gz&lt;br /&gt;
&lt;br /&gt;
     For dependencies listing, use the &amp;quot;R&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qpR /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /sbin/ldconfig&lt;br /&gt;
               /sbin/ldconfig&lt;br /&gt;
               kernel &amp;gt;= 2.2.0&lt;br /&gt;
               libc.so.6&lt;br /&gt;
               libc.so.6(GLIBC_2.0)&lt;br /&gt;
               libc.so.6(GLIBC_2.1)&lt;br /&gt;
               libc.so.6(GLIBC_2.1.3)&lt;br /&gt;
               libc.so.6(GLIBC_2.3)&lt;br /&gt;
               openssl&lt;br /&gt;
               rpmlib(CompressedFileNames) &amp;lt;= 3.0.4-1&lt;br /&gt;
               rpmlib(PayloadFilesHavePrefix) &amp;lt;= 4.0-1&lt;br /&gt;
&lt;br /&gt;
     To check the integrity, use the &amp;quot;-K&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -K /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm: (sha1) dsa sha1 md5 gpg OK&lt;br /&gt;
&lt;br /&gt;
     To list all packages installed.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qa&lt;br /&gt;
&lt;br /&gt;
     To find out which file a package belongs to.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qf /usr/lib/libecpg.so.4.1&lt;br /&gt;
&lt;br /&gt;
     To uninstall a package&lt;br /&gt;
&lt;br /&gt;
         $ rpm -e&lt;br /&gt;
&lt;br /&gt;
     For building rpm packages reference the following:&lt;br /&gt;
       http://www-106.ibm.com/developerworks/library/l-rpm1/&lt;br /&gt;
&lt;br /&gt;
     To verify md5 sum so that you know it downloaded ok&lt;br /&gt;
&lt;br /&gt;
         $ rpm -K  *.rpm&lt;br /&gt;
&lt;br /&gt;
     The following is a good reference:&lt;br /&gt;
        http://www.rpm.org/max-rpm/s1-rpm-install-additional-options.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 75:&lt;br /&gt;
&lt;br /&gt;
     Listing Output from a Bash Script.&lt;br /&gt;
&lt;br /&gt;
     Add &amp;quot;set -x&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          #!/bin/bash&lt;br /&gt;
          set -x&lt;br /&gt;
          ls&lt;br /&gt;
          date&lt;br /&gt;
&lt;br /&gt;
     Will list the files and output as follows:&lt;br /&gt;
&lt;br /&gt;
           + ls&lt;br /&gt;
           ChangeLog  CVS  data  test&lt;br /&gt;
           + date&lt;br /&gt;
           Thu Jul  1 20:41:04 EDT 2004&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 76:&lt;br /&gt;
&lt;br /&gt;
     Using wget.&lt;br /&gt;
&lt;br /&gt;
     Grap a webpage and pipe it to less. For example suppose you wanted to pipe the&lt;br /&gt;
     contents of all these tips, directly from the web.&lt;br /&gt;
&lt;br /&gt;
      $ wget -O - http://sourceforge.net/direct-dl/mchirico/souptonuts/How_to_Linux_and_Open_Source.txt|less&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 77:&lt;br /&gt;
&lt;br /&gt;
     Finding IP address and MAC address.&lt;br /&gt;
&lt;br /&gt;
       $ /sbin/ifconfig&lt;br /&gt;
&lt;br /&gt;
     Note the following output &amp;quot;eth0&amp;quot; and &amp;quot;eth0:1&amp;quot; which means&lt;br /&gt;
     two IP addresses are tied to 1 NIC (Network Interface Card).&lt;br /&gt;
&lt;br /&gt;
             eth0      Link encap:Ethernet  HWaddr 00:50:DA:60:5B:AD&lt;br /&gt;
                       inet addr:192.168.1.155  Bcast:192.168.99.255  Mask:255.255.252.0&lt;br /&gt;
                       UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
                       RX packets:982757 errors:116 dropped:0 overruns:0 frame:116&lt;br /&gt;
                       TX packets:439297 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:1000&lt;br /&gt;
                       RX bytes:693529078 (661.4 Mb)  TX bytes:78400296 (74.7 Mb)&lt;br /&gt;
                       Interrupt:10 Base address:0xa800&lt;br /&gt;
&lt;br /&gt;
             eth0:1    Link encap:Ethernet  HWaddr 00:50:DA:60:5B:AD&lt;br /&gt;
                       inet addr:192.168.1.182  Bcast:192.168.3.255  Mask:255.255.252.0&lt;br /&gt;
                       UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
                       RX packets:982757 errors:116 dropped:0 overruns:0 frame:116&lt;br /&gt;
                       TX packets:439299 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:1000&lt;br /&gt;
                       RX bytes:693529078 (661.4 Mb)  TX bytes:78400636 (74.7 Mb)&lt;br /&gt;
                       Interrupt:10 Base address:0xa800&lt;br /&gt;
&lt;br /&gt;
             lo        Link encap:Local Loopback&lt;br /&gt;
                       inet addr:127.0.0.1  Mask:255.0.0.0&lt;br /&gt;
                       UP LOOPBACK RUNNING  MTU:16436  Metric:1&lt;br /&gt;
                       RX packets:785 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
                       TX packets:785 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:0&lt;br /&gt;
                       RX bytes:2372833 (2.2 Mb)  TX bytes:2372833 (2.2 Mb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 78:&lt;br /&gt;
&lt;br /&gt;
     DOS to UNIX and UNIX to DOS.&lt;br /&gt;
&lt;br /&gt;
        $ dos2unix file.txt&lt;br /&gt;
&lt;br /&gt;
     And to go the other way from UNIX to DOS&lt;br /&gt;
&lt;br /&gt;
        $ unix2dos unixfile&lt;br /&gt;
&lt;br /&gt;
     See the man page, since there are MAC options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     NOTE: If you're working file DOS files, you'll probably want to use&lt;br /&gt;
           &amp;quot;zip&amp;quot; instead of &amp;quot;gzip&amp;quot; so users on Windows can unzip them.&lt;br /&gt;
&lt;br /&gt;
              $ zip test.zip test.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 79:&lt;br /&gt;
&lt;br /&gt;
     Need to Run Interactive Commands? Try &amp;quot;expect&amp;quot;.&lt;br /&gt;
       http://expect.nist.gov/expect.tar.gz&lt;br /&gt;
&lt;br /&gt;
     This simple example waits for the input &amp;quot;hi&amp;quot;, in some form before&lt;br /&gt;
     returning, immediately, &amp;quot;hello there!&amp;quot;. Otherwise, it will wait for&lt;br /&gt;
     60 seconds, then, return &amp;quot;hello there!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/expect&lt;br /&gt;
          set timeout 60&lt;br /&gt;
          expect &amp;quot;hi\n&amp;quot;&lt;br /&gt;
          send &amp;quot;hello there!\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference:&lt;br /&gt;
        http://www.oreilly.com/catalog/expect/chapter/ch03.html&lt;br /&gt;
&lt;br /&gt;
        http://www.cotse.com/dlf/man/expect/bulletproof1.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 80:&lt;br /&gt;
&lt;br /&gt;
     Using PHP as a Command Line Scripting Language.&lt;br /&gt;
&lt;br /&gt;
     The following will grab the complete file from slashdot.&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/php -q&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;?php&lt;br /&gt;
         $fileName = &amp;quot;http://slashdot.org/slashdot.xml&amp;quot;;&lt;br /&gt;
         $rss = file($fileName) or die (&amp;quot;Cannot open file $fileName\n&amp;quot;);&lt;br /&gt;
         for ($index=0; $index &amp;lt; count($rss); $index++)&lt;br /&gt;
              {&lt;br /&gt;
              echo $rss[$index];&lt;br /&gt;
              }&lt;br /&gt;
         ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       Note, if you want an example that parses the XML of&lt;br /&gt;
       slashdot, then, download the following:&lt;br /&gt;
&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/php_scripts.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 81:&lt;br /&gt;
&lt;br /&gt;
     Discarding all output -- including stderr messages.&lt;br /&gt;
&lt;br /&gt;
         $ ls  &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     Or sending all output to a file&lt;br /&gt;
&lt;br /&gt;
         $ someprog &amp;gt; /tmp/file 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     Sometimes, find displays a lot of errors when searching through&lt;br /&gt;
     directories that the user doesn't have access to. To discard&lt;br /&gt;
     error messages &amp;quot;stderr&amp;quot;, which is normally file descripter &amp;quot;2&amp;quot;&lt;br /&gt;
     work the following:&lt;br /&gt;
&lt;br /&gt;
         $ find / -iname 'stuff' 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
          or to pipe results elsewhere&lt;br /&gt;
&lt;br /&gt;
         $ find / -iname 'stuff' &amp;gt; /tmp/results_of_find  2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 118).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 82:&lt;br /&gt;
&lt;br /&gt;
     Using MIX.  D. Knuth's  assembly language/machine-code instruction set used in&lt;br /&gt;
     his books to illustrate his algorithms.&lt;br /&gt;
&lt;br /&gt;
     Download the source:&lt;br /&gt;
&lt;br /&gt;
       http://sourceforge.net/project/showfiles.php?group_id=13897&lt;br /&gt;
&lt;br /&gt;
       $ ./configure&lt;br /&gt;
       $ make&lt;br /&gt;
       $ make install&lt;br /&gt;
&lt;br /&gt;
     Documentation can be found at the following link. The link on&lt;br /&gt;
     sourceforge is not correct, but, the one below works.&lt;br /&gt;
&lt;br /&gt;
       http://www.gnu.org/software/mdk/manual/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 83:&lt;br /&gt;
&lt;br /&gt;
     Gnuplot [ http://sourceforge.net/projects/gnuplot/ ].&lt;br /&gt;
&lt;br /&gt;
     This software is ideal for printing graphs.&lt;br /&gt;
&lt;br /&gt;
         gnuplot&amp;gt; set term png&lt;br /&gt;
         gnuplot&amp;gt; set output 'testcos.png'&lt;br /&gt;
         gnuplot&amp;gt; plot cos(x)*sin(x)&lt;br /&gt;
         gnuplot&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
     Or the following command can be put into &amp;quot;file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            $ cat &amp;gt; file&lt;br /&gt;
            set term png&lt;br /&gt;
            set output 'testcos.png'&lt;br /&gt;
            plot cos(x)*sin(x)&lt;br /&gt;
            exit&lt;br /&gt;
            ^D&lt;br /&gt;
&lt;br /&gt;
     Then, run as follows:&lt;br /&gt;
&lt;br /&gt;
            $ gnuplot file&lt;br /&gt;
&lt;br /&gt;
     Or, suppose you have the following file &amp;quot;/home/chirico/data&amp;quot;. Comments&lt;br /&gt;
     with &amp;quot;#&amp;quot; are not read by gnuplot.&lt;br /&gt;
&lt;br /&gt;
            # File /home/chirico/data&lt;br /&gt;
            #&lt;br /&gt;
            2005-07-26  1    2.3    3&lt;br /&gt;
            2005-07-27  2    3.4    5&lt;br /&gt;
            2005-07-28  3    4    6.6&lt;br /&gt;
            2005-07-29  4    6    2.5&lt;br /&gt;
&lt;br /&gt;
     And you have the following new &amp;quot;file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            set term png&lt;br /&gt;
            set xdata time&lt;br /&gt;
            set timefmt &amp;quot;%Y-%m-%d &amp;quot;&lt;br /&gt;
            set format x &amp;quot;%Y/%m/%d&amp;quot;&lt;br /&gt;
            set output '/var/www/html/chirico/gnuplot/data.png'&lt;br /&gt;
            plot '/home/chirico/data' using 1:2 w linespoints  title '1st col', \&lt;br /&gt;
             '/home/chirico/data' using 1:3 w linespoints  title '2nd col', \&lt;br /&gt;
             '/home/chirico/data' using 1:4 w linespoints  title '3rd col'&lt;br /&gt;
            exit&lt;br /&gt;
&lt;br /&gt;
     You can now get a graph of this data running the following:&lt;br /&gt;
&lt;br /&gt;
            $ gnuplot file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 84:&lt;br /&gt;
&lt;br /&gt;
     CPU Information - speed, processor, cache.&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/cpuinfo&lt;br /&gt;
&lt;br /&gt;
               processor       : 0&lt;br /&gt;
               vendor_id       : GenuineIntel&lt;br /&gt;
               cpu family      : 15&lt;br /&gt;
               model           : 2&lt;br /&gt;
               model name      : Intel(R) Pentium(R) 4 CPU 2.20GHz&lt;br /&gt;
               stepping        : 9&lt;br /&gt;
               cpu MHz         : 2193.221&lt;br /&gt;
               cache size      : 512 KB&lt;br /&gt;
               fdiv_bug        : no&lt;br /&gt;
               hlt_bug         : no&lt;br /&gt;
               f00f_bug        : no&lt;br /&gt;
               coma_bug        : no&lt;br /&gt;
               fpu             : yes&lt;br /&gt;
               fpu_exception   : yes&lt;br /&gt;
               cpuid level     : 2&lt;br /&gt;
               wp              : yes&lt;br /&gt;
               flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr&lt;br /&gt;
               bogomips        : 4325.37&lt;br /&gt;
&lt;br /&gt;
      &amp;quot;bogomips&amp;quot; is a rough but good way to quickly compare two computer speeds. True it's a&lt;br /&gt;
      bogus reading; but, a &amp;quot;good enough&amp;quot; for government work calculation.  See (TIP 10) for&lt;br /&gt;
      &amp;quot;vmstat&amp;quot; and &amp;quot;iostat&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 85:&lt;br /&gt;
&lt;br /&gt;
     POVRAY - Making Animated GIFs&lt;br /&gt;
&lt;br /&gt;
     To see this in action, reference:&lt;br /&gt;
      http://souptonuts.sourceforge.net/povray/orbit.pov.html&lt;br /&gt;
&lt;br /&gt;
     These are the basic command to create:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        $ povray orbit.ini -Iorbit.pov&lt;br /&gt;
        $ convert -delay 20 *.ppm orbit.gif&lt;br /&gt;
&lt;br /&gt;
     By the way, convert is a program from imagemagick, and it can&lt;br /&gt;
     be downloaded from ( http://www.imagemagick.org ).&lt;br /&gt;
&lt;br /&gt;
    The following is &amp;quot;orbit.pov&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          #include &amp;quot;colors.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;finish.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;metals.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;textures.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;stones.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;skies.inc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          camera {&lt;br /&gt;
            location &amp;lt; 2, 3, -8 &amp;gt;&lt;br /&gt;
            look_at  &amp;lt; 0, 0, 0 &amp;gt;&lt;br /&gt;
            focal_point &amp;lt;0, 0, 0&amp;gt;&lt;br /&gt;
            blur_samples 20&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          light_source {&lt;br /&gt;
                  &amp;lt; 0, 10, 0&amp;gt;&lt;br /&gt;
                  color White&lt;br /&gt;
                  area_light &amp;lt;2,0,0&amp;gt;,&amp;lt;0,0,2&amp;gt;, 2, 2&lt;br /&gt;
                  adaptive 1&lt;br /&gt;
                  fade_distance 8&lt;br /&gt;
                  fade_power 1&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          sky_sphere {&lt;br /&gt;
            S_Cloud3&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          plane { &amp;lt;0, 1, 0&amp;gt;, -1&lt;br /&gt;
                  texture {&lt;br /&gt;
                          pigment {&lt;br /&gt;
                                  checker color Blue, color White&lt;br /&gt;
                          }&lt;br /&gt;
                          finish {Phong_Glossy}&lt;br /&gt;
                  }&lt;br /&gt;
          }&lt;br /&gt;
          #declare ball0=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;0.5, 0.5, 0&amp;gt;, 1&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Yellow}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          #declare ball1=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;3, 2, 0&amp;gt;, 0.5&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Blue}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          #declare ball2=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;3, 1, 0&amp;gt;, 1&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Green}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          object {ball0 rotate 360*clock*y}&lt;br /&gt;
          object {ball1 rotate 720*clock*y}&lt;br /&gt;
          object {ball2 rotate 360*(1 - clock)*y}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    And, &amp;quot;orbit.ini&amp;quot; follows:&lt;br /&gt;
&lt;br /&gt;
          Output_File_Type=P&lt;br /&gt;
&lt;br /&gt;
          Width=320&lt;br /&gt;
          Height=240&lt;br /&gt;
&lt;br /&gt;
          Initial_Frame=1&lt;br /&gt;
          Final_Frame=10&lt;br /&gt;
          Antialias=true&lt;br /&gt;
&lt;br /&gt;
          Subset_Start_Frame=1&lt;br /&gt;
          Subset_End_Frame=10&lt;br /&gt;
&lt;br /&gt;
          Cyclic_Animation=on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 86:&lt;br /&gt;
&lt;br /&gt;
     GPG --  GnuPG&lt;br /&gt;
&lt;br /&gt;
        Reference: http://www.gnupg.org/documentation/faqs.html&lt;br /&gt;
                   http://codesorcery.net/mutt/mutt-gnupg-howto&lt;br /&gt;
                   http://www.gnupg.org/(en)/download/index.html&lt;br /&gt;
                   (SCRIPT 4) on following link:&lt;br /&gt;
                   http://prdownloads.sourceforge.net/souptonuts/README_common_script_commands.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Generage key:&lt;br /&gt;
&lt;br /&gt;
        $ gpg --gen-key&lt;br /&gt;
&lt;br /&gt;
     Generate public key ID and fingerprint&lt;br /&gt;
&lt;br /&gt;
        $ gpg --fingerprint&lt;br /&gt;
&lt;br /&gt;
     Get a list of keys:&lt;br /&gt;
&lt;br /&gt;
        $ gpg --list-keys&lt;br /&gt;
&lt;br /&gt;
          pub  1024D/A11C1499 2004-07-15 Mike Chirico &amp;lt;mchirico@comcast.net&amp;gt;&lt;br /&gt;
          sub  1024g/E1A3C2B3 2004-07-15&lt;br /&gt;
&lt;br /&gt;
     Encrypt&lt;br /&gt;
&lt;br /&gt;
        $ gpg -r Mike  --encrypt sample.txt&lt;br /&gt;
&lt;br /&gt;
       This will produce &amp;quot;sample.txt.asc&amp;quot;, which is a binary file.  Note, I can use &amp;quot;Mike&amp;quot; because that's the&lt;br /&gt;
       name on the list of keys. Again, it will be a binary file.&lt;br /&gt;
&lt;br /&gt;
     Encrypt using &amp;quot;ASCII-armored text&amp;quot;  (--armor), which is probably what you want when sending &amp;quot;in&amp;quot; the body of an&lt;br /&gt;
     email, or some document.&lt;br /&gt;
&lt;br /&gt;
        $ gpg  -r Mike  --encrypt --armor sample.txt&lt;br /&gt;
            or&lt;br /&gt;
        $ gpg -r Mike -e -a sample.txt&lt;br /&gt;
            or&lt;br /&gt;
        $ gpg --output somefile.asc --armor -r Mike  --encrypt --armor sample.txt&lt;br /&gt;
&lt;br /&gt;
     The above 3 statements will still produce &amp;quot;sample.txt.asc&amp;quot;, but look at it, or &amp;quot;$ cat sample.txt.asc&amp;quot; without &lt;br /&gt;
     fear, since there are no binary characters. Yes, you could even compile a program &amp;quot;$ g++ -o test test.c&amp;quot; , then,&lt;br /&gt;
     &amp;quot;$ gpg --output test.asc  -r Mike --encrypt --armor test&amp;quot;. However, when decrypting make sure to pipe&lt;br /&gt;
     the results.&lt;br /&gt;
&lt;br /&gt;
            $ gpg --decrypt test.asc &amp;gt; test&lt;br /&gt;
&lt;br /&gt;
     Export &amp;quot;public&amp;quot; key:&lt;br /&gt;
&lt;br /&gt;
           $ gpg --armor --export Mike &amp;gt; m1.asc&lt;br /&gt;
&lt;br /&gt;
     Signing the file &amp;quot;message.txt&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
           $ gpg --clearsign message.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Sending the key to the &amp;quot;key-server&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        First, list the keys.&lt;br /&gt;
&lt;br /&gt;
                $ gpg --list-keys&lt;br /&gt;
                    /home/chirico/.gnupg/pubring.gpg&lt;br /&gt;
                                 v------------------ Use this with &amp;quot;0x&amp;quot; in front -------&lt;br /&gt;
                  pub  1024D/A11C1499 2004-07-15 Mike Chirico  &amp;lt;mchirico@comcast.net&amp;gt;   |&lt;br /&gt;
                  sub  1024g/E1A3C2B3 2004-07-15                                        |&lt;br /&gt;
                                                                                        |&lt;br /&gt;
                                   v----------------------------------------------------&lt;br /&gt;
                $ gpg --send-keys 0xA11C1499&lt;br /&gt;
&lt;br /&gt;
             The above sends it to the keyserver defined in &amp;quot;/home/chirico/.gnupg/gpg.conf&amp;quot;.  Other key servers:&lt;br /&gt;
&lt;br /&gt;
                            wwwkeys.pgp.net&lt;br /&gt;
                            search.keyserver.net&lt;br /&gt;
                            pgp.ai.mit.edu&lt;br /&gt;
&lt;br /&gt;
             When you go to your user-group meetings, you need to bring 2 forms of ID, and&lt;br /&gt;
             list your Key fingerprint. Shown below is the command for getting this fingerprint.&lt;br /&gt;
&lt;br /&gt;
                $ gpg --fingerprint mchirico@comcast.net&lt;br /&gt;
                 pub   1024D/A11C1499 2004-07-15&lt;br /&gt;
                 Key fingerprint = 9D7F C80D BB7B 4BAB CCA4  1BE9 9056 5BEC A11C 1499&lt;br /&gt;
                 uid   Mike Chirico (http://souptonuts.sourceforge.net/chirico/index.php) &amp;lt;mchirico@comcast.net&amp;gt;&lt;br /&gt;
                 sub   1024g/E1A3C2B3 2004-07-15&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Receving keys:&lt;br /&gt;
&lt;br /&gt;
        The following will retrieve my mchirico@comcast.net key&lt;br /&gt;
&lt;br /&gt;
               $ gpg --recv-keys 0xA11C1499&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Special Note: If you get the following error &amp;quot;GPG: Warning: Using Insecure Memory&amp;quot; , then,&lt;br /&gt;
                   &amp;quot; chmod 4755 /path/to/gpg&amp;quot;  to setuid(root) permissioins on the gpg binary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     NOTE: If using mutt, just before sending with the &amp;quot;y&amp;quot; option, hit &amp;quot;p&amp;quot; to sign or encrypt.&lt;br /&gt;
&lt;br /&gt;
     It's possible to create a gpg/pgp email from the command line. For a tutorial on this,&lt;br /&gt;
     reference (SCRIPT 4) at the following link:&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/README_common_script_commands.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 87:&lt;br /&gt;
&lt;br /&gt;
     Working with Dates: Steffen Beyer has developed a Perl and C module for working with dates&lt;br /&gt;
&lt;br /&gt;
     This softare can be downloaded from the following location:&lt;br /&gt;
        http://www.engelschall.com/u/sb/download/pkg/Date-Calc-5.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
         $ wget http://www.engelschall.com/u/sb/download/pkg/Date-Calc-5.3.tar.gz&lt;br /&gt;
         $ tar -xzvf Date-Calc-5.3.tar.gz&lt;br /&gt;
         $ cd Date-Calc-5.3&lt;br /&gt;
         $ cp ./examples/cal.c .&lt;br /&gt;
         $ gcc cal.c DateCalc.c -o mcal&lt;br /&gt;
&lt;br /&gt;
     The file cal.c contains sample function calls from DateCalc.c.  Note, &amp;quot;DateCalc.c&amp;quot;&lt;br /&gt;
     is just a list of functions and includes for &amp;quot;DateCalc.h&amp;quot; and &amp;quot;ToolBox.h&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Or, and this may be easier, just download the following:&lt;br /&gt;
         http://prdownloads.sourceforge.net/cpearls/date_calc.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
     The above link contains a few examples.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 88:&lt;br /&gt;
&lt;br /&gt;
     Color patterns for mutt.&lt;br /&gt;
&lt;br /&gt;
     The colors can be changed in the /home/user/.muttrc file. The first field begins with&lt;br /&gt;
     color, the second field is the foreground color, and the third field is the background&lt;br /&gt;
     color, or default.&lt;br /&gt;
&lt;br /&gt;
     An example .muttrc for colors:&lt;br /&gt;
&lt;br /&gt;
       # color patterns for mutt&lt;br /&gt;
       color normal     white          black # normal text&lt;br /&gt;
       color indicator  black          yellow  # actual message&lt;br /&gt;
       color tree       brightmagenta  default # thread arrows&lt;br /&gt;
       color status     brightyellow         default # status line&lt;br /&gt;
       color error      brightred      default # errors&lt;br /&gt;
       color message    magenta        default # info messages&lt;br /&gt;
       color signature  magenta        default # signature&lt;br /&gt;
       color attachment brightyellow   red     # MIME attachments&lt;br /&gt;
       color search     brightyellow   red     # search matches&lt;br /&gt;
       color tilde      brightmagenta  default # ~ at bottom of msg&lt;br /&gt;
       color markers    red            default # + at beginning of wrapped lines&lt;br /&gt;
       color hdrdefault cyan           default # default header lines&lt;br /&gt;
       color bold       red            default # hiliting bold patterns in body&lt;br /&gt;
       color underline  green          default # hiliting underlined patterns in body&lt;br /&gt;
       color quoted     cyan           default # quoted text&lt;br /&gt;
       color quoted1    magenta        default&lt;br /&gt;
       color quoted2    red            default&lt;br /&gt;
       color quoted3    green          default&lt;br /&gt;
       color quoted4    magenta           default&lt;br /&gt;
       color quoted5    cyan           default&lt;br /&gt;
       color quoted6    magenta        default&lt;br /&gt;
       color quoted7    red            default&lt;br /&gt;
       color quoted8    green          default&lt;br /&gt;
       color quoted9    cyan           default&lt;br /&gt;
       color body   cyan  default  &amp;quot;((ftp|http|https)://|news:)[^ &amp;gt;)\&amp;quot;\t]+&amp;quot;&lt;br /&gt;
       color body   cyan  default  &amp;quot;[-a-z_0-9.+]+@[-a-z_0-9.]+&amp;quot;&lt;br /&gt;
       color body   red   default  &amp;quot;(^| )\\*[-a-z0-9*]+\\*[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color body   green default  &amp;quot;(^| )_[-a-z0-9_]+_[,.?]?[\n]&amp;quot;&lt;br /&gt;
       color body   red   default  &amp;quot;(^| )\\*[-a-z0-9*]+\\*[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color body   green default  &amp;quot;(^| )_[-a-z0-9_]+_[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color index  cyan  default  ~F         # Flagged&lt;br /&gt;
       color index  red   default  ~N         # New&lt;br /&gt;
       color index  magenta    default  ~T         # Tagged&lt;br /&gt;
       color index  cyan       default  ~D         # Deleted&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 190)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 89:&lt;br /&gt;
&lt;br /&gt;
     ps command in detail&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Here are the possible codes when using state &amp;quot;$ ps -e -o state,cmd&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             PROCESS STATE CODES&lt;br /&gt;
                  D   uninterruptible sleep (usually IO)&lt;br /&gt;
                  R   runnable (on run queue)&lt;br /&gt;
                  S   sleeping&lt;br /&gt;
                  T   traced or stopped&lt;br /&gt;
                  Z   a defunct (&amp;quot;zombie&amp;quot;) process&lt;br /&gt;
&lt;br /&gt;
                  &amp;lt;    high-priority (not nice to other users)&lt;br /&gt;
                  N    low-priority (nice to other users)&lt;br /&gt;
                  L    has pages locked into memory (for real-time and custom IO)&lt;br /&gt;
                  s    is a session leader&lt;br /&gt;
                  l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)&lt;br /&gt;
                  +    is in the foreground process group&lt;br /&gt;
&lt;br /&gt;
    For instance:&lt;br /&gt;
&lt;br /&gt;
     Note that the -o is for user defined, and -e is for select&lt;br /&gt;
     all process.&lt;br /&gt;
&lt;br /&gt;
       $ ps -e -o pid,state,start,time,etime,cmd&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
             9946 S 15:40:45 00:00:00    02:23:29 /bin/bash -i&lt;br /&gt;
             9985 T 15:41:24 00:00:01    02:22:50 emacs mout2&lt;br /&gt;
            10003 T 15:43:59 00:00:00    02:20:15 emacs NOTES&lt;br /&gt;
            10320 T 17:38:42 00:00:00       25:32 emacs stuff.c&lt;br /&gt;
         ...&lt;br /&gt;
&lt;br /&gt;
     You may want to command below, without the -e, which will give the&lt;br /&gt;
     process only under the current terminal.&lt;br /&gt;
&lt;br /&gt;
       $ ps -o pid,state,start,time,etime,cmd&lt;br /&gt;
&lt;br /&gt;
     Want to find what 's impacting your load?&lt;br /&gt;
&lt;br /&gt;
       $ ps -e -o %cpu,pid,state,start,time,etime,%cpu,%mem,cmd|sort -rn|less&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ ps aux&lt;br /&gt;
&lt;br /&gt;
            USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND&lt;br /&gt;
            root         1  0.0  0.0  1380  480 ?        S    Aug04   0:00 init [3]&lt;br /&gt;
            root         2  0.0  0.0     0    0 ?        SWN  Aug04   0:00 [ksoftirqd/0]&lt;br /&gt;
            root         3  0.0  0.0     0    0 ?        SW&amp;lt;  Aug04   0:00 [events/0]&lt;br /&gt;
            root         4  0.0  0.0     0    0 ?        SW&amp;lt;  Aug04   0:00 [khelper]&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     Or, if you want to see the environment add the -e option&lt;br /&gt;
&lt;br /&gt;
       $ ps aeux&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
            chirico   2735  0.0  0.1  4400 1492 pts/0    S    Aug04   0:00 -bash USER=chirico LOGNAME=chirico HOME=/home/chirico PATH=/usr/&lt;br /&gt;
            chirico   2771  0.0  0.0  4328  924 pts/0    S    Aug04   0:00 screen -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm S&lt;br /&gt;
            chirico   2772  0.0  0.6  9476 6352 ?        S    Aug04   0:54 SCREEN -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm S&lt;br /&gt;
            chirico   2773  0.0  0.1  4432 1548 pts/1    S    Aug04   0:10 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            chirico   2797  0.0  0.1  4416 1496 pts/2    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            root      2821  0.0  0.0  4100  952 pts/2    S    Aug04   0:00 su -&lt;br /&gt;
            root      2822  0.0  0.1  4384 1480 pts/2    S    Aug04   0:00 -bash&lt;br /&gt;
            chirico   2862  0.0  0.1  4428 1524 pts/3    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            sporkey   2946  0.0  0.2  6836 2960 ?        S    Aug04   0:15 fetchmail&lt;br /&gt;
            chirico   2952  0.0  0.1  4436 1552 pts/5    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            chirico   3880  0.0  0.1  4416 1496 pts/6    S    Aug05   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            root      3904  0.0  0.0  4100  956 pts/6    S    Aug05   0:00 su - donkey&lt;br /&gt;
            donkey    3905  0.0  0.1  4336 1452 pts/6    S    Aug05   0:00 -bash&lt;br /&gt;
            donkey    3938  0.0  0.2  6732 2856 ?        S    Aug05   0:14 fetchmail&lt;br /&gt;
            chirico   3944  0.0  0.1  4416 1496 pts/7    S    Aug05   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     There is also a -f &amp;quot;forrest&amp;quot; option. Also note below &amp;quot; -bash&amp;quot; is the start of a login shell.&lt;br /&gt;
&lt;br /&gt;
      $ ps aeuxwwf &lt;br /&gt;
     &lt;br /&gt;
     The ww option above gives a wide format with all variables. Use the above command if you plan&lt;br /&gt;
     to parse through a Perl script. Otherwise, it may be easier to do a quick read using the command&lt;br /&gt;
     below, without &amp;quot;ww&amp;quot;.    &lt;br /&gt;
&lt;br /&gt;
      $ ps aeuxf&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
            root      2339  0.0  0.1  3512 1444 ?        S    Dec01   0:00 /usr/sbin/sshd&lt;br /&gt;
            root     25651  0.0  0.1  6764 1980 ?        S    Dec23   0:00  \_ /usr/sbin/sshd&lt;br /&gt;
            chirico  25653  0.0  0.2  6840 2236 ?        S    Dec23   0:14      \_ /usr/sbin/sshd&lt;br /&gt;
            chirico  25654  0.0  0.1  4364 1440 pts/4    S    Dec23   0:00          \_ -bash USER=chirico LOGNAME=chirico HOME=/home/chirico&lt;br /&gt;
            chirico  25690  0.0  0.0  4328  920 pts/4    S    Dec23   0:00              \_ screen -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm&lt;br /&gt;
            root      2355  0.0  0.0  2068  904 ?        S    Dec01   0:00 xinetd -stayalive -pidfile /var/run/xinetd.pid&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     It is also possible to list the process by command line. For example, the following command will only list the emacs&lt;br /&gt;
     processes.&lt;br /&gt;
&lt;br /&gt;
      $ ps -fC emacs&lt;br /&gt;
       UID        PID  PPID  C STIME TTY          TIME CMD&lt;br /&gt;
       chirico   5049  5020  0 May11 pts/13   00:00:00 emacs -nw Notes&lt;br /&gt;
       chirico  12368  5104  0 May12 pts/18   00:00:00 emacs -nw dnotify.c&lt;br /&gt;
       chirico  19792 18028  0 May13 pts/20   00:00:00 emacs -nw hello.c&lt;br /&gt;
       chirico  14034 27367  0 18:52 pts/8    00:00:00 emacs -nw How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
     You may also want to consider using top in batch mode. Here the &amp;quot;-n 1&amp;quot; means refresh once,&lt;br /&gt;
     and the &amp;quot;b&amp;quot; is for batch. The &amp;quot;fmt -s&amp;quot; is to put it in a more readable format.&lt;br /&gt;
&lt;br /&gt;
       $ top -n 1 b |fmt  -s &amp;gt;&amp;gt;statfile&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 90:&lt;br /&gt;
&lt;br /&gt;
     Learning Assembly.&lt;br /&gt;
&lt;br /&gt;
     Once you have written the source, assuming the file is &amp;quot;exit.s&amp;quot;, it can be compiled as follows:&lt;br /&gt;
&lt;br /&gt;
            $ as exit.s -o exit.o&lt;br /&gt;
            $ ld exit.o -o exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Here is the program:&lt;br /&gt;
&lt;br /&gt;
         #&lt;br /&gt;
         #INPUT:  none&lt;br /&gt;
         #&lt;br /&gt;
         #OUTPUT:         returns a status code. This can be viewed&lt;br /&gt;
         # by typing&lt;br /&gt;
         #&lt;br /&gt;
         # echo $?&lt;br /&gt;
         #&lt;br /&gt;
         # after running the program&lt;br /&gt;
         #&lt;br /&gt;
         #VARIABLES:&lt;br /&gt;
         # %eax holds the system call number&lt;br /&gt;
         # (this is always the case)&lt;br /&gt;
         #&lt;br /&gt;
         # %ebx holds the return status&lt;br /&gt;
         #&lt;br /&gt;
                 .section .data&lt;br /&gt;
                 .section .text&lt;br /&gt;
&lt;br /&gt;
                 .globl _start&lt;br /&gt;
         _start:&lt;br /&gt;
                 movl $1, %eax # this is the linux kernel command&lt;br /&gt;
                 # number (system call) for exiting&lt;br /&gt;
                 # a program&lt;br /&gt;
                 movl $0, %ebx # this is the status number we will&lt;br /&gt;
                 # return to the operating system.&lt;br /&gt;
                 # Change this around and it will&lt;br /&gt;
                 # return different things to&lt;br /&gt;
                 # echo $?&lt;br /&gt;
                 int $0x80 # this wakes up the kernel to run&lt;br /&gt;
                 # the exit command&lt;br /&gt;
&lt;br /&gt;
     After running this program, you can get the exit code.&lt;br /&gt;
&lt;br /&gt;
            $ exit $?&lt;br /&gt;
            0&lt;br /&gt;
&lt;br /&gt;
     That is about all it does; but, get the book for more details. The&lt;br /&gt;
     book is free.&lt;br /&gt;
&lt;br /&gt;
          http://savannah.nongnu.org/download/pgubook/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 91:&lt;br /&gt;
&lt;br /&gt;
     Creating a sandbox for reiserfstune,debugreiserfs and ACL.  Also see TIP 4.&lt;br /&gt;
&lt;br /&gt;
     Assume you have a reisers files system created from a disk file, which&lt;br /&gt;
     means you have done something like the following:&lt;br /&gt;
&lt;br /&gt;
          # dd if=/dev/zero of=disk-rfs count=102400&lt;br /&gt;
          # losetup  /dev/loop4 ./disk-rfs&lt;br /&gt;
          # mkfs -t reiserfs /dev/loop4&lt;br /&gt;
          # mkdir /fs2&lt;br /&gt;
          # mount -o loop,acl ./disk-rfs /fs2&lt;br /&gt;
&lt;br /&gt;
     Now, you can run reiserfstune. But, first you will need to umount fs2&lt;br /&gt;
&lt;br /&gt;
          # umount /fs2&lt;br /&gt;
          # reiserfstune ./disk-rfs&lt;br /&gt;
&lt;br /&gt;
     Or you can run the debug command&lt;br /&gt;
&lt;br /&gt;
          # debugreiserfs -J ./disk-rfs&lt;br /&gt;
&lt;br /&gt;
     Now, suppose you run through a lot of the debug options on&lt;br /&gt;
     http://www.namesys.com/ and you destroy this file.&lt;br /&gt;
&lt;br /&gt;
     You can recreate the file and delete the loop device.&lt;br /&gt;
&lt;br /&gt;
          # dd if=/dev/zero of=disk-rfs count=102400&lt;br /&gt;
          # losetup -d /dev/loop4&lt;br /&gt;
          # mount -o loop,acl ./disk-rfs /fs2&lt;br /&gt;
&lt;br /&gt;
     Now, try working with some of the ACL options - you can only do this&lt;br /&gt;
     with the latest kernel and tools -- Fedora Core 2 will work.&lt;br /&gt;
&lt;br /&gt;
     Assume you have 3 users, donkey, chirico and bozo2. You can give&lt;br /&gt;
     everyone rights to this file system as follows:&lt;br /&gt;
&lt;br /&gt;
          # setfacl -R -m d:u:donkey:rwx,d:u:chirico:rwx,d:u:bozo2:rwx /fs2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 92:&lt;br /&gt;
&lt;br /&gt;
     SpamAssassin - Setup.&lt;br /&gt;
&lt;br /&gt;
     Step 1.&lt;br /&gt;
&lt;br /&gt;
           Installing the SpamAssassin CPAN utility. You will need to do this&lt;br /&gt;
           as root.&lt;br /&gt;
        &lt;br /&gt;
              $ su -&lt;br /&gt;
&lt;br /&gt;
           Once you have root privileges invoke cpan.&lt;br /&gt;
        &lt;br /&gt;
              # perl -MCPAN -e shell&lt;br /&gt;
&lt;br /&gt;
              cpan&amp;gt;&lt;br /&gt;
&lt;br /&gt;
           Now install with prerequisites policy set to ask.&lt;br /&gt;
        &lt;br /&gt;
              cpan&amp;gt; o conf prerequisites_policy ask&lt;br /&gt;
        &lt;br /&gt;
              cpan&amp;gt; install Mail::SpamAssassin&lt;br /&gt;
        &lt;br /&gt;
           You will get lots of output as the necessary modules are downloaded and&lt;br /&gt;
           compiled and installed.&lt;br /&gt;
&lt;br /&gt;
     Step 2.&lt;br /&gt;
&lt;br /&gt;
            Configuration.&lt;br /&gt;
&lt;br /&gt;
            Edit the following &amp;quot;/etc/mail/spamassassin/local.cf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            Here is a look at my file&lt;br /&gt;
&lt;br /&gt;
                $ cat /etc/mail/spamassassin/local.cf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                # This is the right place to customize your installation of SpamAssassin.&lt;br /&gt;
                #&lt;br /&gt;
                # See 'perldoc Mail::SpamAssassin::Conf' for details of what can be&lt;br /&gt;
                # tweaked.&lt;br /&gt;
                #&lt;br /&gt;
                ###########################################################################&lt;br /&gt;
                #&lt;br /&gt;
                # rewrite_subject 0&lt;br /&gt;
                # report_safe 1&lt;br /&gt;
                # trusted_networks 212.17.35.&lt;br /&gt;
                #&lt;br /&gt;
                &lt;br /&gt;
                # Below added from book&lt;br /&gt;
                # You may want to set this to 5, then, work your way down.&lt;br /&gt;
                # Currently I have this 3&lt;br /&gt;
                required_hits 3&lt;br /&gt;
                &lt;br /&gt;
                # This determines how spam is reported. Currently safe email is reported&lt;br /&gt;
                # in the message.&lt;br /&gt;
                report_safe 1&lt;br /&gt;
                &lt;br /&gt;
                # The will rewrite the tag of the spam message.&lt;br /&gt;
                rewrite_subject 1&lt;br /&gt;
                &lt;br /&gt;
                # By default, SpamAssassin will run RBL checks.  If your ISP already&lt;br /&gt;
                # does this, set this to 1.&lt;br /&gt;
                skip_rbl_checks 0&lt;br /&gt;
&lt;br /&gt;
     Step 3.&lt;br /&gt;
&lt;br /&gt;
            Update .procmail.&lt;br /&gt;
&lt;br /&gt;
            You should update the .procmail file as follows. Here is my /home/chirico/.procmail file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ cat /home/chirico/.procmailrc&lt;br /&gt;
&lt;br /&gt;
                PATH=/bin:/usr/bin:/usr/local/bin&lt;br /&gt;
                MAILDIR=/var/spool/mail&lt;br /&gt;
                DEFAULT=/var/spool/mail/chirico&lt;br /&gt;
                LOGFILE=/home/chirico/MailBAG&lt;br /&gt;
                MYHOME=/home/chirico&lt;br /&gt;
                #  Must have folder MailTRASH&lt;br /&gt;
                TRASH=/home/chirico/MailTRASH&lt;br /&gt;
                &lt;br /&gt;
                # Will get everything from this mail&lt;br /&gt;
                :0&lt;br /&gt;
                * ^From:.*sporkey@comcast.net&lt;br /&gt;
                        $DEFAULT&lt;br /&gt;
                &lt;br /&gt;
                # Spamassassin&lt;br /&gt;
                :0fw&lt;br /&gt;
                * &amp;lt;300000&lt;br /&gt;
                |/usr/local/bin/spamassassin&lt;br /&gt;
&lt;br /&gt;
      Reference:&lt;br /&gt;
        http://pm-doc.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 93:&lt;br /&gt;
&lt;br /&gt;
     Make Graphs: using dot and neato.&lt;br /&gt;
&lt;br /&gt;
       $ dot -Tpng dotfile -o myout.png&lt;br /&gt;
&lt;br /&gt;
     To see the output reference the following:&lt;br /&gt;
       http://souptonuts.sourceforge.net/code/myout.png&lt;br /&gt;
&lt;br /&gt;
     Where &amp;quot;dotfile&amp;quot; is the following:&lt;br /&gt;
&lt;br /&gt;
       $ cat dotfile&lt;br /&gt;
&lt;br /&gt;
       digraph g&lt;br /&gt;
       {&lt;br /&gt;
               node [shape = record];&lt;br /&gt;
&lt;br /&gt;
               node0 [ label =&amp;quot;&amp;lt;f0&amp;gt; stuff | &amp;lt;f1&amp;gt; J | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node1 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; E | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node4 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; C | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node6 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; I | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node2 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; U | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node5 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; N | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node9 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; Y | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node8 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; W | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node10 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; Z | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node7 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; A | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node3 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; G | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node0&amp;quot;:f0 -&amp;gt; &amp;quot;node1&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node0&amp;quot;:f2 -&amp;gt; &amp;quot;node2&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node1&amp;quot;:f0 -&amp;gt; &amp;quot;node4&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node1&amp;quot;:f2 -&amp;gt; &amp;quot;node6&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node4&amp;quot;:f0 -&amp;gt; &amp;quot;node7&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node4&amp;quot;:f2 -&amp;gt; &amp;quot;node3&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node2&amp;quot;:f0 -&amp;gt; &amp;quot;node5&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node2&amp;quot;:f2 -&amp;gt; &amp;quot;node9&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node9&amp;quot;:f0 -&amp;gt; &amp;quot;node8&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node9&amp;quot;:f2 -&amp;gt; &amp;quot;node10&amp;quot;:f1;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
     Checkout the following article:&lt;br /&gt;
        http://www.linuxjournal.com/article.php?sid=7275&lt;br /&gt;
&lt;br /&gt;
     To download this software&lt;br /&gt;
        http://www.graphviz.org/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 94:&lt;br /&gt;
&lt;br /&gt;
     Makefile: working with conditions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     First note that all the indentations of the file must be&lt;br /&gt;
     a single tab. There cannot be any spaces, or make will&lt;br /&gt;
     not run.&lt;br /&gt;
&lt;br /&gt;
       $ cat Makefile&lt;br /&gt;
&lt;br /&gt;
        # Compiler flags&lt;br /&gt;
        sqliteLIB := $(shell ls /usr/local/lib/libsqlite.so)&lt;br /&gt;
        sqlite3LIB := $(shell ls /usr/local/lib/libsqlite3.so)&lt;br /&gt;
        # all assumes sqlite and sqlite3 are installed&lt;br /&gt;
        #&lt;br /&gt;
&lt;br /&gt;
        test:&lt;br /&gt;
        ifeq (&amp;quot;$(sqlite3LIB)&amp;quot;,&amp;quot;/usr/local/lib/libsqlite3.so&amp;quot;)&lt;br /&gt;
             @echo -e &amp;quot;True -- we found the file&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
             @echo &amp;quot;False -- we did not find the file&amp;quot;&lt;br /&gt;
        endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     So, if I run make I will get the following output.&lt;br /&gt;
&lt;br /&gt;
       $ make&lt;br /&gt;
       True -- we found the file&lt;br /&gt;
&lt;br /&gt;
     This is because I have a file /usr/local/lib/libsqlite3.so on my system.&lt;br /&gt;
     Note how the assignment is made, with the shell command&lt;br /&gt;
&lt;br /&gt;
           sqlite3LIB := $(shell ls /usr/local/lib/libsqlite3.so)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 95:&lt;br /&gt;
&lt;br /&gt;
     Bash: Conditional Expressions&lt;br /&gt;
&lt;br /&gt;
          if [ -e /etc/ntp.conf ]&lt;br /&gt;
            then&lt;br /&gt;
              echo &amp;quot;You have the ntp config file&amp;quot;&lt;br /&gt;
            else&lt;br /&gt;
              echo &amp;quot;You do not have the ntp config file&amp;quot;&lt;br /&gt;
          fi&lt;br /&gt;
&lt;br /&gt;
       Now using an AND condition inside the [ ]. By the way, above, you&lt;br /&gt;
       can put the &amp;quot;then&amp;quot; on the same line as the if &amp;quot;if [ -e /etc/ntp.conf ]; then&amp;quot;&lt;br /&gt;
       as long as you use the &amp;quot;;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           if [ \( -e /etc/ntp.conf \) -a \( -e /etc/ntp/ntpservers \) ]&lt;br /&gt;
             then&lt;br /&gt;
               echo &amp;quot;You have ntp config and ntpservers&amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp.conf ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntp.conf &amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp/ntpservers ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntpservers &amp;quot;&lt;br /&gt;
             else&lt;br /&gt;
               echo &amp;quot; you have neither ntp.conf or ntpservers&amp;quot;&lt;br /&gt;
           fi&lt;br /&gt;
&lt;br /&gt;
        A few things to note above. Else if statement is written as &amp;quot;elif&amp;quot;, and when&lt;br /&gt;
        dealing with &amp;quot;(&amp;quot; you will need to insert &amp;quot;\(&amp;quot;. By the way &amp;quot;-o&amp;quot; can replace &amp;quot;-a&amp;quot;&lt;br /&gt;
        and the &amp;quot;-o&amp;quot; is for OR condition. AND can be done as follows too.&lt;br /&gt;
&lt;br /&gt;
           if [ -e /etc/ntp.conf ] &amp;amp;&amp;amp; [ -e /etc/ntp/ntpservers ]&lt;br /&gt;
             then&lt;br /&gt;
               echo &amp;quot;You have ntp config and ntpservers&amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp.conf ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntp.conf &amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp/ntpservers ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntpservers &amp;quot;&lt;br /&gt;
             else&lt;br /&gt;
               echo &amp;quot; you have neither ntp.conf or ntpservers&amp;quot;&lt;br /&gt;
           fi&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (files).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             -b file      True if file exists and is a block file&lt;br /&gt;
             -c file      True if file exists and is a character device file&lt;br /&gt;
             -d file      True if file exists and is a directory&lt;br /&gt;
             -e file      True if file exists&lt;br /&gt;
             -f file      True if file exists and is a regular file&lt;br /&gt;
             -g file      True if file exists and is set goup id&lt;br /&gt;
             -G file      True if owned by the effective group ID&lt;br /&gt;
&lt;br /&gt;
             -k file      True if &amp;quot;sticky&amp;quot; bit is set and file exists&lt;br /&gt;
             -L file      True if file exists and is a symbolic link&lt;br /&gt;
             -n string    True if string is non-null&lt;br /&gt;
&lt;br /&gt;
             -O file      Ture if file exists and is owned by the effective user ID&lt;br /&gt;
&lt;br /&gt;
             -p file      True if file is a named pipe (FIFO)&lt;br /&gt;
             -r file      True if file is readable&lt;br /&gt;
             -s file      True if file has size &amp;gt; 0&lt;br /&gt;
             -S file      True if file exists and is a socket&lt;br /&gt;
&lt;br /&gt;
             -t file      True if file is open and refers to a terminal.&lt;br /&gt;
             -u file      True if setuid bit is set&lt;br /&gt;
             -w file      True if file exists and is writeable&lt;br /&gt;
             -x file      True if file executable&lt;br /&gt;
             -x dir       True if directory can be searched&lt;br /&gt;
&lt;br /&gt;
             file1 -nt file2     True if file1 modification date newer than file2&lt;br /&gt;
             file1 -ot file2     True if file1 modification date older than file2&lt;br /&gt;
             file1 -ef file2     True if file1 and file2 have same inode&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (Integers).&lt;br /&gt;
&lt;br /&gt;
             -lt  Less than&lt;br /&gt;
             -le  Less than or equal&lt;br /&gt;
             -eq  Equal&lt;br /&gt;
             -ge  Greater than or equal&lt;br /&gt;
             -gt  Greater than&lt;br /&gt;
             -ne  Not equal&lt;br /&gt;
&lt;br /&gt;
          Example usage.&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
             {&lt;br /&gt;
               while read num value; do&lt;br /&gt;
                if [ $num -gt  2 ]; then&lt;br /&gt;
                  echo $value&lt;br /&gt;
                fi&lt;br /&gt;
               done&lt;br /&gt;
             } &amp;lt; somefile&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (Strings).&lt;br /&gt;
&lt;br /&gt;
             str1 = str2      str1 matches str2&lt;br /&gt;
             str1 != str2     str1 does not matches str2&lt;br /&gt;
             str1 &amp;lt; str2      str1 is less than str2&lt;br /&gt;
             str1 &amp;gt;  str2     str1 is greater than str2&lt;br /&gt;
             -n str1          str1 is not null (length greater than 0)&lt;br /&gt;
             -z str1          str1 is null (las length 0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 96:&lt;br /&gt;
&lt;br /&gt;
     CVS: Working with cvs&lt;br /&gt;
&lt;br /&gt;
      INITIAL REPOSITORY:&lt;br /&gt;
&lt;br /&gt;
       To create a repository, and this is normally done by the system admin. This&lt;br /&gt;
       is NOT creating a project to checkout, but the location where everything&lt;br /&gt;
       will be stored! The initial repository!&lt;br /&gt;
&lt;br /&gt;
             cvs -d repository_root_directory init&lt;br /&gt;
&lt;br /&gt;
       Or here is a specific example:&lt;br /&gt;
&lt;br /&gt;
             cvs -d /work/cvsREPOSITORY/   init&lt;br /&gt;
&lt;br /&gt;
       Creating a directory tree from scratch. For a new project, the easiest thing to&lt;br /&gt;
       do is probably to create an empty directory structure, like this:&lt;br /&gt;
&lt;br /&gt;
             $ mkdir sqlite_examples&lt;br /&gt;
             $ mkdir sqlite_examples/man&lt;br /&gt;
             $ mkdir sqlite_examples/testing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       After that, you use the import command to create the&lt;br /&gt;
       corresponding (empty) directory structure inside the repository:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             $ cd &amp;lt;directory&amp;gt;&lt;br /&gt;
             $ cvs -d repository_root_directory import  -m &amp;quot;Created directory structure&amp;quot; yoyodyne/dir yoyo start&lt;br /&gt;
&lt;br /&gt;
       Or, here is a specific example.&lt;br /&gt;
&lt;br /&gt;
             $  cd sqlite_examples&lt;br /&gt;
             $  cvs  -d /work/cvsREPOSITORY/ import -m 'test SQlite'  sqlite_examples sqlite_examples start&lt;br /&gt;
&lt;br /&gt;
       Now, you can delete the directory sqlite_examples, or go to another directory and type&lt;br /&gt;
       the following:&lt;br /&gt;
&lt;br /&gt;
             $ cvs -d /work/cvsREPOSITORY/ co sqlite_examples&lt;br /&gt;
&lt;br /&gt;
     COOL TOOLS:&lt;br /&gt;
&lt;br /&gt;
           1. cvsps&lt;br /&gt;
           2. cvsreport&lt;br /&gt;
&lt;br /&gt;
         cvsps which you can find at http://www.cobite.com/cvsps/cvsps-2.0rc1.tar.gz&lt;br /&gt;
&lt;br /&gt;
             $ cvsps -f README_sqlite_tutorial.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 97:&lt;br /&gt;
&lt;br /&gt;
     Common vi and vim commands&lt;br /&gt;
&lt;br /&gt;
           Command mode ESC&lt;br /&gt;
&lt;br /&gt;
                dd       delete&lt;br /&gt;
                u        undelete&lt;br /&gt;
                y        yank (copy to buffer)&lt;br /&gt;
                p/P      p before cursor/P after cursor&lt;br /&gt;
&lt;br /&gt;
                Ctl-g    show current line number&lt;br /&gt;
                shft-G   end of file&lt;br /&gt;
              n shft-G   move to line n&lt;br /&gt;
&lt;br /&gt;
               /stuff/   search&lt;br /&gt;
                  n   repeat in same direction&lt;br /&gt;
                  N   repeat in opposite direction&lt;br /&gt;
                  /return  repeat seach forward&lt;br /&gt;
                  ?return  repeat seach backward&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;dyy  Yank current line to buffer d&lt;br /&gt;
               &amp;quot;a7yy Yank next 7 lines to buffer a&lt;br /&gt;
                    or&lt;br /&gt;
               :1,7ya a  Yank [ya] lines 1,7 to buffer a&lt;br /&gt;
               :1,7ya b  Yank [ya] lines 1,7 to buffer b&lt;br /&gt;
&lt;br /&gt;
               :5 pu b   Put [pu] buffer b after line 5&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;dP   Put the content of buffer d before cursor&lt;br /&gt;
               &amp;quot;ap   Put the contents of buffer a after cursor&lt;br /&gt;
&lt;br /&gt;
               :1,4 w! file2  Write lines 1,4 to file2&lt;br /&gt;
               :1,3&lt;br /&gt;
&lt;br /&gt;
               :set nu     Display line numbers&lt;br /&gt;
               :set nonum  Turns off display&lt;br /&gt;
&lt;br /&gt;
               :e &amp;lt;filename&amp;gt; Edit a file in a new buffer&lt;br /&gt;
&lt;br /&gt;
            vim&lt;br /&gt;
               :split&lt;br /&gt;
               :split &amp;lt;filename&amp;gt;&lt;br /&gt;
               :sp &amp;lt;filename&amp;gt;&lt;br /&gt;
               :split new&lt;br /&gt;
&lt;br /&gt;
                   ctl-w   To move between windows&lt;br /&gt;
                   ctl-w+&lt;br /&gt;
                   ctl-w-  To change size&lt;br /&gt;
                   ctl+wv  Split windows vertically&lt;br /&gt;
                   ctl-wq  Close window&lt;br /&gt;
&lt;br /&gt;
               :only       To view only 1 window&lt;br /&gt;
&lt;br /&gt;
            vim dictionary - put the following command in ~/.vimrc&lt;br /&gt;
&lt;br /&gt;
                   set dictionary+=/usr/share/dict/words&lt;br /&gt;
                   set thesaurus+=/usr/share/dict/words&lt;br /&gt;
              &lt;br /&gt;
               Now, after you type a word &amp;lt;ctl-x&amp;gt;&amp;lt;ctl-k&amp;gt;&amp;lt;ctl-n&amp;gt; and to &lt;br /&gt;
               go back in the listing &amp;lt;ctl-p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                   butter&amp;lt;ctl-x&amp;gt;&amp;lt;ctl-k&amp;gt;&amp;lt;ctl-n&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 98:&lt;br /&gt;
&lt;br /&gt;
     Using apt-get&lt;br /&gt;
&lt;br /&gt;
          $ apt-get update&lt;br /&gt;
          $ apt-get -s install &amp;lt;pkage&amp;gt;    &amp;lt;---- if everything is ok, then, remove the s&lt;br /&gt;
&lt;br /&gt;
     Note you may want to use dpkg to purge if you have to do a reinstall.&lt;br /&gt;
&lt;br /&gt;
          $ dpkg --purge exim4-base&lt;br /&gt;
          $ dpkg --purge exim4-config&lt;br /&gt;
          $ apt-get install exim4&lt;br /&gt;
&lt;br /&gt;
          $ dpkg-reconfigure exim4-config&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 99:&lt;br /&gt;
&lt;br /&gt;
     Mounting a cdrom on openbsd and installing packages&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /cdrom&lt;br /&gt;
          $ mount /dev/cd0a /cdrom&lt;br /&gt;
          $ cd /cdrom&lt;br /&gt;
&lt;br /&gt;
     To add packages&lt;br /&gt;
&lt;br /&gt;
          $ pkg_add -v  &amp;lt;directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Mounting a cdrom on linux to a user's home sub-directory:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /home/chirico/cdrom&lt;br /&gt;
          $ mount /dev/cdrom /home/chirico/cdrom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 100:&lt;br /&gt;
&lt;br /&gt;
    Creating a boot floppy for knoppix cd:&lt;br /&gt;
&lt;br /&gt;
          $ dd if=/mnt/cdrom/KNOPPIX/boot.img of=/dev/fd0 bs=1440k&lt;br /&gt;
&lt;br /&gt;
    References:&lt;br /&gt;
        http://www.knoppix.net/docs/index.php/BootFloppyHowTo&lt;br /&gt;
&lt;br /&gt;
    For a lot of the knoppix how-to's&lt;br /&gt;
        http://www.knoppix.net/docs/index.php/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 101:&lt;br /&gt;
&lt;br /&gt;
    Diction and Style Tools for Linux  http://ftp.gnu.org/gnu/diction/&lt;br /&gt;
&lt;br /&gt;
        $ diction mytext|less&lt;br /&gt;
&lt;br /&gt;
    Or, this can be done interactively&lt;br /&gt;
&lt;br /&gt;
        $ diction&lt;br /&gt;
        This is more text to read and you can do with it&lt;br /&gt;
        what you want.&lt;br /&gt;
        (stdin):1: This is more text to read and you [can -&amp;gt; (do not confuse with &amp;quot;may&amp;quot;)] do with it what you want.&lt;br /&gt;
&lt;br /&gt;
    DESCRIPTION&lt;br /&gt;
       Diction finds all sentences in a document, that contain phrases from  a&lt;br /&gt;
       database  of  frequently  misused,  bad  or  wordy diction.  It further&lt;br /&gt;
       checks for double words.  If no files are given, the document  is  read&lt;br /&gt;
       from  standard input.  Each found phrase is enclosed in [ ] (brackets).&lt;br /&gt;
       Suggestions and advice, if any, are printed headed by a right arrow -&amp;gt;.&lt;br /&gt;
       A  sentence is a sequence of words, that starts with a capitalised word&lt;br /&gt;
       and ends with a full stop, double colon, question mark or  exclaimation&lt;br /&gt;
       mark.  A single letter followed by a dot is considered an abbreviation,&lt;br /&gt;
       so it does not terminate a sentence.   Various  multi-letter  abbrevia-&lt;br /&gt;
       tions are recognized, they do not terminate a sentence as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 102:&lt;br /&gt;
&lt;br /&gt;
    Using a mail alias.&lt;br /&gt;
&lt;br /&gt;
       Suppose all root mail on your system to go to one root account root@main.com&lt;br /&gt;
&lt;br /&gt;
       In the following file:&lt;br /&gt;
&lt;br /&gt;
             /etc/aliases&lt;br /&gt;
&lt;br /&gt;
       Add this line&lt;br /&gt;
&lt;br /&gt;
             root:    root@main.com&lt;br /&gt;
&lt;br /&gt;
       Next, run newaliases [/usr/bin/newaliases] as follows:&lt;br /&gt;
&lt;br /&gt;
             $ newaliases&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Special note: It's possible to send mail to more than one address. Suppose you want&lt;br /&gt;
                     mail going to root@main.com above, plus you want it going to user donkey&lt;br /&gt;
                     on the local system.&lt;br /&gt;
&lt;br /&gt;
             root:  root@main.com donkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 103:&lt;br /&gt;
&lt;br /&gt;
    Chrony - this service is similiar to ntp. It keeps accurate time&lt;br /&gt;
            on your computer against a very accurate clock in across&lt;br /&gt;
            a network with various time delays.&lt;br /&gt;
&lt;br /&gt;
    Reference: http://go.to/chrony&lt;br /&gt;
&lt;br /&gt;
        In the file &amp;quot;/etc/chrony/chrony.conf&amp;quot; add/replace the following&lt;br /&gt;
&lt;br /&gt;
             server 146.186.218.60&lt;br /&gt;
             server 128.118.25.3&lt;br /&gt;
             server 128.2.129.21&lt;br /&gt;
&lt;br /&gt;
        Next start the chrony service&lt;br /&gt;
&lt;br /&gt;
           $ /etc/init.d/chrony restart&lt;br /&gt;
&lt;br /&gt;
     Next verify that this is working. It may take 20 or 30 minutes to update&lt;br /&gt;
     the clock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Shell command:&lt;br /&gt;
       # chronyc&lt;br /&gt;
       chronyc&amp;gt; sourcestats&lt;br /&gt;
       210 Number of sources = 3&lt;br /&gt;
       Name/IP Address            NP  NR  Span  Frequency   Freq Skew   Std Dev&lt;br /&gt;
       ========================================================================&lt;br /&gt;
       b50.cede.psu.edu            2   0    64       0.000    2000.000  4000ms&lt;br /&gt;
       otc2.psu.edu                2   0    66       0.000    2000.000  4000ms&lt;br /&gt;
       FS3.ECE.CMU.EDU             2   0    64       0.000    2000.000  4000ms&lt;br /&gt;
       chronyc&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    It is probably best to let chrony do its work. However, if you want to&lt;br /&gt;
    set both the hardware and software clock, the following will work:&lt;br /&gt;
&lt;br /&gt;
      Sets the hardware clock&lt;br /&gt;
        # hwclock --set --date=&amp;quot;12/10/04 10:18:05&amp;quot;&lt;br /&gt;
      Sync the hardware clock to software&lt;br /&gt;
        # hwclock --hctosys&lt;br /&gt;
&lt;br /&gt;
    Normally the system keep accurate time with the software clock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 104:&lt;br /&gt;
&lt;br /&gt;
    NFS mount&lt;br /&gt;
&lt;br /&gt;
     SERVER (192.168.1.182)&lt;br /&gt;
&lt;br /&gt;
       Make sure nfs is running on the server&lt;br /&gt;
 &lt;br /&gt;
           $ /etc/init.d/nfs restart&lt;br /&gt;
&lt;br /&gt;
       At the server the contents of /etc/exports for&lt;br /&gt;
       allowing 2 computers (192.168.1.171 and 192.168.1.71)&lt;br /&gt;
       to access the home directory of this server. Note that&lt;br /&gt;
       read write (rw) access is allowed.&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/exports&lt;br /&gt;
         /home   192.168.1.171(rw)&lt;br /&gt;
         /home   192.168.1.71(rw)&lt;br /&gt;
&lt;br /&gt;
       Or, if you have a lot of clients on 192.168.1.* then consider&lt;br /&gt;
       the following:&lt;br /&gt;
&lt;br /&gt;
          /home 192.168.1.0/255.255.252.0(rw)&lt;br /&gt;
&lt;br /&gt;
       Next, still at the server, run the exportfs command&lt;br /&gt;
&lt;br /&gt;
          $ exportfs -rv&lt;br /&gt;
&lt;br /&gt;
       IPTABLES (lokkit). If you're using fedora with default lokkit firewall&lt;br /&gt;
                then you can put the following under &amp;quot;Other ports&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                  Other ports nfs:tcp nfs:udp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       If the above does not work or you are not using lokkit&lt;br /&gt;
        IPTABLES (values in /etc/sysconfig/iptables on SERVER )&lt;br /&gt;
&lt;br /&gt;
        # NFS Need to accept fragmented packets and may not have header&lt;br /&gt;
        #             so you will not know where they are coming from&lt;br /&gt;
        -A INPUT -f -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -m tcp -s 192.168.1.171 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -s 192.168.1.171 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -m udp -s 192.168.1.171 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -s 192.168.1.171 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        &lt;br /&gt;
        -A INPUT -f -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -m tcp -s 192.168.1.71 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -s 192.168.1.71 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -m udp -s 192.168.1.71 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -s 192.168.1.71 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        (Reference: http://nfs.sourceforge.net/nfs-howto/server.html)&lt;br /&gt;
                  and&lt;br /&gt;
        (Reference: http://nfs.sourceforge.net/nfs-howto/security.html)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     CLIENT1 (192.168.1.171)&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /home2&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/fstab&lt;br /&gt;
         192.168.1.182:/home          /home2     nfs     rw 0 0&lt;br /&gt;
&lt;br /&gt;
          $ mount -a -t nfs&lt;br /&gt;
&lt;br /&gt;
        Or to do a one time mounting by hand&lt;br /&gt;
&lt;br /&gt;
          $ mount -t nfs 192.168.1.182:/home  /home2&lt;br /&gt;
&lt;br /&gt;
        Now /home2 on the client will be /home on the server&lt;br /&gt;
&lt;br /&gt;
        Reference:&lt;br /&gt;
          http://nfs.sourceforge.net/nfs-howto/index.html&lt;br /&gt;
&lt;br /&gt;
     MONITOR NFS:&lt;br /&gt;
&lt;br /&gt;
        To monitor the client:&lt;br /&gt;
&lt;br /&gt;
          $ nfsstat -c&lt;br /&gt;
&lt;br /&gt;
           Also note you can &amp;quot;cat /proc/net/rpc/nfs&amp;quot; as well.&lt;br /&gt;
&lt;br /&gt;
       To monitor the server (note the -s instead of the -c).&lt;br /&gt;
&lt;br /&gt;
         $ nfsstat -s&lt;br /&gt;
&lt;br /&gt;
           Also note you can &amp;quot;cat /proc/net/rpc/nfsd&amp;quot; as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       The following &amp;quot;cat&amp;quot; command is done on the NFS server, and shows which&lt;br /&gt;
       clients are mounting. This does not go with examples above. By the way,&lt;br /&gt;
       &amp;quot;root_squash&amp;quot; is the default, and means that root access on the clients is&lt;br /&gt;
       denied. So, how does the client root get access to these filesystems? You have&lt;br /&gt;
       to &amp;quot;su - &amp;lt;someuser&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
              $ cat /proc/fs/nfs/exports&lt;br /&gt;
              # Version 1.1&lt;br /&gt;
              # Path Client(Flags) # IPs&lt;br /&gt;
              /home   192.168.1.102(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   squeezel.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   192.168.1.106(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   livingroom.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   10.8.0.1(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   closet.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
&lt;br /&gt;
     (Reference: http://www.vanemery.com/Linux/NFSv4/NFSv4-no-rpcsec.html#automount )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 105:&lt;br /&gt;
&lt;br /&gt;
      Ports used for Microsoft products&lt;br /&gt;
               http://www.microsoft.com/canada/smallbiz/sgc/articles/ref_net_ports_ms_prod.mspx?pf=true&lt;br /&gt;
          Firewalling?&lt;br /&gt;
               http://www.microsoft.com/technet/prodtechnol/windowsserver2003/library/ServerHelp/428c1bbf-2ceb-4f76-a1ef-0219982eca10.mspx&lt;br /&gt;
&lt;br /&gt;
      To find out common port mappings, take a look at &amp;quot;/etc/services&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 106:&lt;br /&gt;
&lt;br /&gt;
      Man pages: If man pages are formatting incorrectly with PuTTY, try editing&lt;br /&gt;
      the &amp;quot;/etc/man.config&amp;quot; file with the following changes:&lt;br /&gt;
&lt;br /&gt;
           NROFF /usr/bin/groff -Tlatin1 -mandoc&lt;br /&gt;
           NEQN /usr/bin/geqn -Tlatin1&lt;br /&gt;
&lt;br /&gt;
         (Reference TIP 7 for using man)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 107:&lt;br /&gt;
&lt;br /&gt;
      Valgrind: check for memory leaks in your programs. (http://valgrind.org/)&lt;br /&gt;
&lt;br /&gt;
       This is how you can run it on the program &amp;quot;a.out&amp;quot; for valgrind version 2.2.0&lt;br /&gt;
&lt;br /&gt;
         $ valgrind --logfile=valgrind.output   --tool=memcheck ./a.out&lt;br /&gt;
&lt;br /&gt;
       This is how you write the logfile &amp;quot;--log-file&amp;quot; for valgrind-3.0.1&lt;br /&gt;
&lt;br /&gt;
         $ valgrind  --log-file=valgrind --leak-check=yes --tool=memcheck ./a.out&lt;br /&gt;
&lt;br /&gt;
       With C++ programs with gcc 3.4 and later that use STL, export GLIBCXX_FORCE_NEW &lt;br /&gt;
       only when testing to disable memory caching. Remember to enable for production&lt;br /&gt;
       as this will have a performance penalty. Reference  http://valgrind.org/docs/FAQ/ &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 108:&lt;br /&gt;
&lt;br /&gt;
      Runlevel Configuring.&lt;br /&gt;
&lt;br /&gt;
       These two programs, run as root give you a ncurses GUI to what will&lt;br /&gt;
       run on your system on boot.&lt;br /&gt;
&lt;br /&gt;
            # ntsysv&lt;br /&gt;
&lt;br /&gt;
            # chkconfig&lt;br /&gt;
&lt;br /&gt;
       Note, you can also set these manually. For example, normally you will&lt;br /&gt;
       have files in &amp;quot;/etc/init.d/&amp;quot; that will take parameters like &amp;quot;start&amp;quot;,&amp;quot;stop&amp;quot;&lt;br /&gt;
       &amp;quot;restart&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       Take a look at &amp;quot;/etc/init.d/mysql&amp;quot; this file will start and stop the&lt;br /&gt;
       mysql daemon. So, how does know which run levels, and the order it gets&lt;br /&gt;
       loaded in the run level to other programs? By the K&amp;lt;number&amp;gt; and S&amp;lt;number&amp;gt;&lt;br /&gt;
       values.&lt;br /&gt;
&lt;br /&gt;
            $ ls /etc/rc3.d/*mysql&lt;br /&gt;
&lt;br /&gt;
                /etc/rc3.d/K85mysql&lt;br /&gt;
                /etc/rc3.d/S85mysql&lt;br /&gt;
&lt;br /&gt;
       So here on my system the start value is 85. Looking in /etc/rc3.d, which is&lt;br /&gt;
       run level 3, any program with a lower number S84something will get loaded&lt;br /&gt;
       before mysql.&lt;br /&gt;
&lt;br /&gt;
       I manually set the run level as follows for mysql.&lt;br /&gt;
&lt;br /&gt;
            # cd /etc/rc3.d&lt;br /&gt;
            # ln -s ../init.d/mysql S85mysql&lt;br /&gt;
            # ln -s ../init.d/mysql K85mysql&lt;br /&gt;
&lt;br /&gt;
            # cd /etc/rc5.d&lt;br /&gt;
            # ln -s ../init.d/mysql S85mysql&lt;br /&gt;
            # ln -s ../init.d/mysql K85mysql&lt;br /&gt;
&lt;br /&gt;
       Note that I could have chose other numbers as well. &amp;quot;ntsysv&amp;quot; gives&lt;br /&gt;
       you a graphical interface.&lt;br /&gt;
&lt;br /&gt;
       This is a way of doing this with &amp;quot;chkconfig&amp;quot; at the command prompt.&lt;br /&gt;
&lt;br /&gt;
            # chkconfig --list mysqld&lt;br /&gt;
            mysqld          0:off   1:off   2:off   3:on    4:off   5:on    6:off&lt;br /&gt;
&lt;br /&gt;
       Above you can see it's on. Here's how we would have turned this on with chkconfig.&lt;br /&gt;
&lt;br /&gt;
            # chkconfig --level 35 mysqld on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 109:&lt;br /&gt;
&lt;br /&gt;
       File Alteration Monitor - Gamin a FAM replacement&lt;br /&gt;
        http://www.gnome.org/~veillard/gamin/&lt;br /&gt;
        http://www.gnome.org/~veillard/gamin/sources/&lt;br /&gt;
       ******  EXAMPLE NOT COMPLETE *****&lt;br /&gt;
&lt;br /&gt;
       Working with fam  - file alteration monitor.  Mail uses this to signify&lt;br /&gt;
           a change in a file's status.&lt;br /&gt;
&lt;br /&gt;
        Below is the sample C program ftest.c which can be compiled as&lt;br /&gt;
        follows:&lt;br /&gt;
&lt;br /&gt;
              $ gcc -o ftest ftest.c  -lfam&lt;br /&gt;
&lt;br /&gt;
        You will need to work with this as root&lt;br /&gt;
&lt;br /&gt;
              #  ./ftest &amp;lt;somefile absolute path&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Reference:&lt;br /&gt;
            http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?db=man&amp;amp;fname=/usr/share/catman/p_man/cat3x/fam.z&lt;br /&gt;
            http://www.devchannel.org/devtoolschannel/04/05/13/2146252.shtml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 110:&lt;br /&gt;
&lt;br /&gt;
       glibc - this is the main library used by C, and the following&lt;br /&gt;
        link below gives you examples on everything from sockets,math,&lt;br /&gt;
        date and time functions, user environment, and much more.&lt;br /&gt;
&lt;br /&gt;
         http://www.gnu.org/software/libc/manual/html_mono/libc.html&lt;br /&gt;
&lt;br /&gt;
       How do you know which version of glibc you are running?&lt;br /&gt;
&lt;br /&gt;
          #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
          #include &amp;lt;gnu/libc-version.h&amp;gt;&lt;br /&gt;
          int main (void)&lt;br /&gt;
           {&lt;br /&gt;
             puts (gnu_get_libc_version ());&lt;br /&gt;
             return 0;&lt;br /&gt;
           }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 111:&lt;br /&gt;
&lt;br /&gt;
       nslookup and dig - query Internet name servers interactively.&lt;br /&gt;
&lt;br /&gt;
         $ nslookup&lt;br /&gt;
         &amp;gt;chirico.org&lt;br /&gt;
         Server:        68.80.0.6&lt;br /&gt;
         Address:       68.80.0.6#53&lt;br /&gt;
&lt;br /&gt;
         Name: chirico.org&lt;br /&gt;
         Address: 66.35.250.210&lt;br /&gt;
         &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      The nslookup command will query the dns server is &amp;quot;/etc/resolve.conf&amp;quot;&lt;br /&gt;
      However, you can force a certain dns with &amp;quot;- server&amp;quot;.  For example the&lt;br /&gt;
      command below goes to the server named dilbert&lt;br /&gt;
&lt;br /&gt;
         $ nslookup - dilbert&lt;br /&gt;
         &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      dig:&lt;br /&gt;
&lt;br /&gt;
      dig gives you more information. You should probably use dig instead&lt;br /&gt;
      of nslookup.&lt;br /&gt;
&lt;br /&gt;
      Below I am forcing the lookup from DNS 68.80.0.6 of the name chirico.org, and&lt;br /&gt;
      note that the query time is return too.&lt;br /&gt;
&lt;br /&gt;
         $ dig @68.80.0.6  +qr chirico.org&lt;br /&gt;
&lt;br /&gt;
         ; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.2.1 &amp;lt;&amp;lt;&amp;gt;&amp;gt; @68.80.0.6 +qr chirico.org&lt;br /&gt;
         ;; global options:  printcmd&lt;br /&gt;
         ;; Sending:&lt;br /&gt;
         ;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 55908&lt;br /&gt;
         ;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0&lt;br /&gt;
        &lt;br /&gt;
         ;; QUESTION SECTION:&lt;br /&gt;
         ;chirico.org.                   IN      A&lt;br /&gt;
        &lt;br /&gt;
         ;; Got answer:&lt;br /&gt;
         ;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 55908&lt;br /&gt;
         ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
        &lt;br /&gt;
         ;; QUESTION SECTION:&lt;br /&gt;
         ;chirico.org.                   IN      A&lt;br /&gt;
        &lt;br /&gt;
         ;; ANSWER SECTION:&lt;br /&gt;
         chirico.org.            5538    IN      A       66.35.250.210&lt;br /&gt;
        &lt;br /&gt;
         ;; AUTHORITY SECTION:&lt;br /&gt;
         chirico.org.            30599   IN      NS      ns78.worldnic.com.&lt;br /&gt;
         chirico.org.            30599   IN      NS      ns77.worldnic.com.&lt;br /&gt;
        &lt;br /&gt;
         ;; ADDITIONAL SECTION:&lt;br /&gt;
         ns78.worldnic.com.      16022   IN      A       216.168.225.218&lt;br /&gt;
         ns77.worldnic.com.      7       IN      A       216.168.228.41&lt;br /&gt;
        &lt;br /&gt;
         ;; Query time: 155 msec&lt;br /&gt;
         ;; SERVER: 68.80.0.6#53(68.80.0.6)&lt;br /&gt;
         ;; WHEN: Thu Dec 23 07:48:23 2004&lt;br /&gt;
         ;; MSG SIZE  rcvd: 127&lt;br /&gt;
&lt;br /&gt;
      So what if you wanted to know what name the IP address 66.35.250.210&lt;br /&gt;
      resolves to, when using dns 68.80.0.12.&lt;br /&gt;
&lt;br /&gt;
          $ dig @68.80.0.12 -x 66.35.250.210&lt;br /&gt;
          ...&lt;br /&gt;
          ;; ANSWER SECTION:&lt;br /&gt;
          210.250.35.66.in-addr.arpa. 3600 IN   CNAME   210.0/24.250.35.66.in-addr.arpa.&lt;br /&gt;
          210.0/24.250.35.66.in-addr.arpa. 3600 IN PTR  vhost.sourceforge.net.&lt;br /&gt;
&lt;br /&gt;
      Above you can see it resolved to &amp;quot;vhost.sourceforge.net&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      Reference ( http://www.tldp.org/HOWTO/DNS-HOWTO-5.html )&lt;br /&gt;
        Also see TIP 223.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 112:&lt;br /&gt;
&lt;br /&gt;
       Using GNU Autotools - so you can produce the familiar &amp;quot;./configure&amp;quot;  &amp;quot;make&amp;quot;  and &amp;quot;make install&amp;quot;&lt;br /&gt;
                             commands. There is also a &amp;quot;make dist&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                The program sqlite3api.cc and the rest of this code can be found at&lt;br /&gt;
                 http://prdownloads.sourceforge.net/cpearls/autotools.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         A &amp;quot;Makefile.am&amp;quot; is required:&lt;br /&gt;
&lt;br /&gt;
            bin_PROGRAMS = sprog&lt;br /&gt;
            sprog_SOURCES = sqlite3api.cc&lt;br /&gt;
            sprog_LDADD = @INCLUDES@ @SQLIBOBJS@&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         In addition, a &amp;quot;configure.in&amp;quot; file is required. Note, AC_CHECK_LIB will&lt;br /&gt;
         check the &amp;quot;libsqlite3.so&amp;quot; file for the &amp;quot;sqlite3_open&amp;quot; file. Note that&lt;br /&gt;
         &amp;quot;sqlite3&amp;quot;, is a shortcut for &amp;quot;libsqlite3&amp;quot; by convention. If this file&lt;br /&gt;
         is not found, AC_CHECK_FILE looks for &amp;quot;/usr/local/lib/libsqlite3.a&amp;quot;. If&lt;br /&gt;
         this is found, then, &amp;quot;-lsqlite3&amp;quot; is added to the LIBS environment variable.&lt;br /&gt;
         Also, &amp;quot;-I/usr/local/include&amp;quot; and &amp;quot;-L/usr/local/lib&amp;quot; will be added on the&lt;br /&gt;
         command line. This is common when some one does not have the library in&lt;br /&gt;
         the path.  (See TIP 49)&lt;br /&gt;
&lt;br /&gt;
            dnl Process this file with autoconf to produce a configure script.&lt;br /&gt;
            AC_INIT(sqlite3api.cc)&lt;br /&gt;
            AM_INIT_AUTOMAKE(sqliteprog, 1.0)&lt;br /&gt;
            AC_PROG_CXX&lt;br /&gt;
            CXXFLAGS='-Wall -W -O2 -s -pipe'&lt;br /&gt;
            AC_CHECK_LIB(sqlite3,sqlite3_open,[],found=no)&lt;br /&gt;
             if test &amp;quot;$found&amp;quot; = &amp;quot;no&amp;quot;; then&lt;br /&gt;
               AC_CHECK_FILE(/usr/local/lib/libsqlite3.a, found=yes)&lt;br /&gt;
               if test &amp;quot;$found&amp;quot; = &amp;quot;yes&amp;quot;; then&lt;br /&gt;
                 LIBS=&amp;quot;$LIBS -lsqlite3&amp;quot;&lt;br /&gt;
                 INCLUDES=&amp;quot;$INCLUDES -I/usr/local/include&amp;quot;&lt;br /&gt;
                 EXTRALIB='-L/usr/local/lib'&lt;br /&gt;
                else&lt;br /&gt;
                 echo &amp;quot;Are you SURE sqlite3 is installed?&amp;quot;&lt;br /&gt;
               fi&lt;br /&gt;
             fi&lt;br /&gt;
            SQLIBOBJS='-Wl,-R/usr/local/lib'&lt;br /&gt;
            AC_SUBST(INCLUDES)&lt;br /&gt;
            AC_SUBST(SQLIBOBJS)&lt;br /&gt;
            AC_SUBST(EXTRALIB)&lt;br /&gt;
            AC_OUTPUT(Makefile)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         To build the configure file, just run the following:&lt;br /&gt;
&lt;br /&gt;
             $ aclocal&lt;br /&gt;
             $ autoconf&lt;br /&gt;
             $ touch NEWS README AUTHORS ChangeLog&lt;br /&gt;
             $ automake --add-missing&lt;br /&gt;
&lt;br /&gt;
         Now if you want to make a tar.gz file &amp;quot;sqliteprog-1.0.tar.gz&amp;quot;, then&lt;br /&gt;
         all you have to run is the following:&lt;br /&gt;
&lt;br /&gt;
             $ make dist&lt;br /&gt;
&lt;br /&gt;
         Note: did you ever want to save all the output from a ./configure? Well, it&lt;br /&gt;
               is automatically saved in the &amp;quot;config.log&amp;quot; file. In fact, this file may&lt;br /&gt;
               contain a lot more than what you saw on the screen.&lt;br /&gt;
&lt;br /&gt;
               Also, you may need to rerun ./configure. But before you do, delete&lt;br /&gt;
               the &amp;quot;config.cache&amp;quot; file to get a clean build.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 113:&lt;br /&gt;
&lt;br /&gt;
       EMACS - common emacs commands.&lt;br /&gt;
&lt;br /&gt;
         M is the ESC&lt;br /&gt;
         C or c is the Ctl&lt;br /&gt;
&lt;br /&gt;
        Shell - when working in a shell. &amp;quot;M-x rename-uniquely&amp;quot; is good for split screen editing.&lt;br /&gt;
&lt;br /&gt;
          M-x rename-uniquely   Use this for multiple shells (renames buffer so it's not the same shell)&lt;br /&gt;
          C-c C-z               Send job in background (when working in a shell)&lt;br /&gt;
          C-c C-o               commit-kill-output (gets rid of a lot of shell output)&lt;br /&gt;
          C-c C-r               reposition at beginning of output&lt;br /&gt;
          C-c C-e               reposition at end of output&lt;br /&gt;
          M-x send-invisible    Hide passwords - use this before typing a password&lt;br /&gt;
&lt;br /&gt;
         Note: if the shell prompt does not show up correctly, then, you may want to creat a &amp;quot;.emacs_bash&amp;quot;&lt;br /&gt;
               file with the following contents:&lt;br /&gt;
&lt;br /&gt;
                          PS1=&amp;quot;emacs:\W \$ &amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Directories  (C-x d) give you a directory listing. You know all those annoying &amp;quot;~&amp;quot; and &amp;quot;#&amp;quot;&lt;br /&gt;
                     file that you get? You can easily delete these when in &amp;quot;dired&amp;quot; mode by hitting&lt;br /&gt;
                     &amp;quot;~&amp;quot;, then  &amp;quot;d&amp;quot; to flag it for delete. Then, hit &amp;quot;x&amp;quot; to and confirm deletion.&lt;br /&gt;
&lt;br /&gt;
                     These are other command that work on highlighted files in &amp;quot;dired&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
                          R   rename&lt;br /&gt;
                          v   view&lt;br /&gt;
                          Z   compress the file&lt;br /&gt;
                          +   create directory&lt;br /&gt;
&lt;br /&gt;
        Other common commands:&lt;br /&gt;
&lt;br /&gt;
          c-x l          list the line you are on, and how many lines in the document.&lt;br /&gt;
                         You will get something like: Page has 4881 lines (4440 + 442),&lt;br /&gt;
                         which means you are on the 4440 line.&lt;br /&gt;
&lt;br /&gt;
          c-x rm bookmark make&lt;br /&gt;
          c-x rb bookmark bounce&lt;br /&gt;
        &lt;br /&gt;
          c-x rb notes&lt;br /&gt;
          c-x rb emacs&lt;br /&gt;
        &lt;br /&gt;
          c-x / &amp;lt;r&amp;gt; (save position in register &amp;lt;r&amp;gt;)&lt;br /&gt;
          c-x j &amp;lt;r&amp;gt; (jump to position in register &amp;lt;r&amp;gt;)&lt;br /&gt;
          c-x r SPC 1 (mark current point in register 1)&lt;br /&gt;
          c-x r j 1 (jump to marked point in register 1)&lt;br /&gt;
          c-x r t &amp;lt;string&amp;gt;  (insert string into register)&lt;br /&gt;
        &lt;br /&gt;
          c-x r s 1 (save marked region in register 1)&lt;br /&gt;
          c-x r i 1 (insert marked region)&lt;br /&gt;
        &lt;br /&gt;
          c-x c-o (delete all blank lines, except one)&lt;br /&gt;
        &lt;br /&gt;
          c-x z (repeat the last command ... stop with an a)&lt;br /&gt;
          c-x zz (repeat the last command twice)&lt;br /&gt;
&lt;br /&gt;
          rectangle&lt;br /&gt;
          ---------&lt;br /&gt;
          C-SPC&lt;br /&gt;
          goto the next region&lt;br /&gt;
          C-x&lt;br /&gt;
          C-x&lt;br /&gt;
          then, C-x r r &amp;quot;name of register&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
          to insert the register&lt;br /&gt;
          C-x r i &amp;quot;name of register&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
          macros:&lt;br /&gt;
          -------&lt;br /&gt;
          c-x (    start macro&lt;br /&gt;
          c-x )    end macro&lt;br /&gt;
          c-x e    execute macro&lt;br /&gt;
        &lt;br /&gt;
          mail:&lt;br /&gt;
          -----&lt;br /&gt;
          c-x m   mail&lt;br /&gt;
          c-c c-s send&lt;br /&gt;
        &lt;br /&gt;
          C-x C-e&lt;br /&gt;
          (insert &amp;quot;\n\nExtra Line of text&amp;quot;)&lt;br /&gt;
        &lt;br /&gt;
          ;; chirico functions in .emacs&lt;br /&gt;
          ;; This creates an html template&lt;br /&gt;
          (defun my-html ()&lt;br /&gt;
          (interactive)&lt;br /&gt;
          (insert &amp;quot;&amp;lt;html&amp;gt;&lt;br /&gt;
          &amp;lt;head&amp;gt;&lt;br /&gt;
          &amp;lt;META HTTP-EQUIV=\&amp;quot;Pragma\&amp;quot; CONTENT=\&amp;quot;no-cache\&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;META HTTP-EQUIV=\&amp;quot;Expires\&amp;quot; CONTENT=\&amp;quot;-1\&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;/head&amp;gt;&lt;br /&gt;
          &amp;lt;body bgcolor=\&amp;quot;#ffffff\&amp;quot;&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
          &amp;lt;/body&amp;gt;&lt;br /&gt;
          &amp;lt;/html&amp;gt;&amp;quot;)&lt;br /&gt;
          )&lt;br /&gt;
&lt;br /&gt;
     Backspace issues when using &amp;quot;emacs -nw&amp;quot;? They putting the following in your &amp;quot;~/.emacs&amp;quot; file&lt;br /&gt;
&lt;br /&gt;
             (global-set-key &amp;quot;\C-d&amp;quot; 'backward-delete-char)&lt;br /&gt;
             (global-set-key &amp;quot;\C-h&amp;quot; 'backward-delete-char)&lt;br /&gt;
             (global-set-key (kbd &amp;quot;DEL&amp;quot;) 'delete-char)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 114:&lt;br /&gt;
&lt;br /&gt;
        ncftpget - an intelligent ftp client (http://www.ncftp.com/). Also&lt;br /&gt;
                   check your fedora or debian install. This package allows&lt;br /&gt;
                   you to easily download packages from ftp sites.&lt;br /&gt;
&lt;br /&gt;
          This is an example of connect to an ftp site, with a subdirectory, and&lt;br /&gt;
          downloading all in one command.&lt;br /&gt;
&lt;br /&gt;
           $ ncftpget ftp://ftp.gnu.org/pub/gnu/gcc/gcc-3.2.3/gcc-3.2.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
          Of if you want to get the fedora core 3 installs&lt;br /&gt;
&lt;br /&gt;
           $ ncftpget ftp://ftp.linux.ncsu.edu/pub/fedora/linux/core/3/i386/iso/FC3*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 115:&lt;br /&gt;
&lt;br /&gt;
        expr - evaluate expressions. You can use this on the command line&lt;br /&gt;
&lt;br /&gt;
           $ expr 6 + 4&lt;br /&gt;
           10&lt;br /&gt;
&lt;br /&gt;
         Note the spaces. Without spaces, you get the following:&lt;br /&gt;
&lt;br /&gt;
           $ expr 6+4&lt;br /&gt;
           6+4&lt;br /&gt;
&lt;br /&gt;
         If you're using &amp;quot;*&amp;quot;, you'll need a &amp;quot;\&amp;quot; before it&lt;br /&gt;
&lt;br /&gt;
           $ expr 10 \* 10&lt;br /&gt;
           100&lt;br /&gt;
&lt;br /&gt;
         This also works for variables&lt;br /&gt;
&lt;br /&gt;
           $ var1=34&lt;br /&gt;
           $ expr $var1 + 3&lt;br /&gt;
           37&lt;br /&gt;
&lt;br /&gt;
         or&lt;br /&gt;
&lt;br /&gt;
           $ var1=2&lt;br /&gt;
           $ var1=`expr $var1 \* 2`&lt;br /&gt;
           $ echo $var1&lt;br /&gt;
           4&lt;br /&gt;
&lt;br /&gt;
         see (TIP 25) you can get the cosine(.23)&lt;br /&gt;
&lt;br /&gt;
           $ var1=`echo &amp;quot;c(.23)&amp;quot;|bc -l`&lt;br /&gt;
           $ echo $var1&lt;br /&gt;
           .97366639500537483696&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         You can also do substrings:&lt;br /&gt;
&lt;br /&gt;
           $ expr substr &amp;quot;BigBear&amp;quot; 4 4&lt;br /&gt;
           Bear&lt;br /&gt;
&lt;br /&gt;
         And length of strings&lt;br /&gt;
&lt;br /&gt;
           $ mstr=&amp;quot;12345&amp;quot;&lt;br /&gt;
           $ expr length $mstr&lt;br /&gt;
           5&lt;br /&gt;
&lt;br /&gt;
         Regular expressions&lt;br /&gt;
&lt;br /&gt;
           $ expr &amp;quot;a3&amp;quot; : [a-z][1-9]&lt;br /&gt;
           2&lt;br /&gt;
&lt;br /&gt;
         Or you can get a bit fancy&lt;br /&gt;
&lt;br /&gt;
           $ myexpr=&amp;quot;[a-z][1-9]&amp;quot;&lt;br /&gt;
           $ echo $myexpr&lt;br /&gt;
           [a-z][1-9]&lt;br /&gt;
&lt;br /&gt;
           $ expr &amp;quot;a3&amp;quot; : $myexpr&lt;br /&gt;
           2&lt;br /&gt;
&lt;br /&gt;
         This may not be the best way to find out if it is Friday, but&lt;br /&gt;
         it seems to work. It's more of an exercise in xargs.&lt;br /&gt;
&lt;br /&gt;
           $ date&lt;br /&gt;
           Fri Dec 31 16:44:47 EST 2004&lt;br /&gt;
           $ date|xargs -i expr {} : &amp;quot;[Fri]&amp;quot;&lt;br /&gt;
           1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 116:&lt;br /&gt;
&lt;br /&gt;
        eval&lt;br /&gt;
&lt;br /&gt;
           $ mypipe=&amp;quot;|&amp;quot;&lt;br /&gt;
           $ eval ls $mypipe wc&lt;br /&gt;
           6       6     129&lt;br /&gt;
&lt;br /&gt;
        Did you catch that? The above statement is the same as&lt;br /&gt;
&lt;br /&gt;
           $ ls | wc&lt;br /&gt;
&lt;br /&gt;
        Where &amp;quot;|&amp;quot; is put into the variable $mypipe&lt;br /&gt;
&lt;br /&gt;
        (also see TIP 118)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 117:&lt;br /&gt;
&lt;br /&gt;
        lxr, glimpse, patchset - tools for reading the kernel source&lt;br /&gt;
&lt;br /&gt;
          This example puts some of the files in /home/src since my home&lt;br /&gt;
          partition is the largest. Plus, you do not want to over write&lt;br /&gt;
          the source in /usr/src/ If you want to put your files elsewhere&lt;br /&gt;
          just substitute /home/src for your desired directory.&lt;br /&gt;
&lt;br /&gt;
         patchset -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ export SRCDIR=/home/src&lt;br /&gt;
            $ cd $SRCDIR&lt;br /&gt;
            $ wget http://www.csn.ul.ie/~mel/projects/patchset/patchset-0.5.tar.gz&lt;br /&gt;
            $ export PATH=$PATH:$SRCDIR/patchset-0.5/bin&lt;br /&gt;
&lt;br /&gt;
          Now edit &amp;quot;/home/src/patchset-0.5/etc/patchset.conf&amp;quot; and set WWW_USER to&lt;br /&gt;
          whatever your website runs as&lt;br /&gt;
&lt;br /&gt;
                  export WWW_USER=nobody&lt;br /&gt;
&lt;br /&gt;
          Getting kernel source. The last step builds and asks a lot of questions. Enter&lt;br /&gt;
          yes to things that interest you, since this is what you will see in the source&lt;br /&gt;
          code. It is not going to build for booting. The &amp;quot;downlaod -p&amp;quot; is for downloading&lt;br /&gt;
          a patch.&lt;br /&gt;
&lt;br /&gt;
            $ download 2.6.10&lt;br /&gt;
            $ createset 2.6.10&lt;br /&gt;
            $ make-kernel -b 2.6.10&lt;br /&gt;
&lt;br /&gt;
        glimpse -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ mkdir -p /home/src/glimpse&lt;br /&gt;
            $ cd /home/src/glimpse&lt;br /&gt;
            $ wget http://webglimpse.net/trial/glimpse-latest.tar.gz&lt;br /&gt;
            $ tar -xzf glimpse-latest.tar.gz&lt;br /&gt;
            $ cd glimpse-4.18.0&lt;br /&gt;
            $ ./configure; make&lt;br /&gt;
            $ make install&lt;br /&gt;
&lt;br /&gt;
        lxr -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ make -p /home/src/lxr&lt;br /&gt;
            $ cd /home/src/lxr&lt;br /&gt;
            $ wget http://heanet.dl.sourceforge.net/sourceforge/lxr/lxr-0.3.1.tar.gz&lt;br /&gt;
            $ cd lxr-0.3&lt;br /&gt;
&lt;br /&gt;
          Edit &amp;quot;Makefile&amp;quot; and set PERLBIN to &amp;quot;/usr/bin/perl&amp;quot; or the where perl is&lt;br /&gt;
          on your system. Also set INSTALLPREFIX to &amp;quot;/var/www/lxr&amp;quot;.  Then, as root&lt;br /&gt;
          do the following:&lt;br /&gt;
&lt;br /&gt;
            $ make install&lt;br /&gt;
&lt;br /&gt;
         Apache changes&lt;br /&gt;
&lt;br /&gt;
          Next edit the apache httpd.conf. On my system it is&lt;br /&gt;
          &amp;quot;/usr/local/apache2/conf/httpd.conf&amp;quot;, but if you did a fedora install&lt;br /&gt;
          I think this file is located at &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             Alias  /lxr/ &amp;quot;/var/www/lxr/&amp;quot;&lt;br /&gt;
             &amp;lt;Directory &amp;quot;/var/www/lxr/&amp;quot;&amp;gt;&lt;br /&gt;
               Options ExecCGI Indexes Includes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride all&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
&lt;br /&gt;
              &amp;lt;Files ~ (search|source|ident|diff|find)&amp;gt;&lt;br /&gt;
                    SetHandler cgi-script&lt;br /&gt;
              &amp;lt;/Files&amp;gt;&lt;br /&gt;
             &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          lxr - continued &amp;quot;/var/www/lxr/http/lxr.conf&amp;quot; changes.  The following contains&lt;br /&gt;
                my lxr.conf with changes made to almost every variable. Make sure you use&lt;br /&gt;
                your website in place of 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
                 # Configuration file.&lt;br /&gt;
                &lt;br /&gt;
                 # Define typed variable &amp;quot;v&amp;quot;, read valueset from file.&lt;br /&gt;
                 variable: v, Version, [/var/www/lxr/source/versions], [/var/www/lxr/source/defversion]&lt;br /&gt;
                &lt;br /&gt;
                 # Define typed variable &amp;quot;a&amp;quot;.  First value is default.&lt;br /&gt;
                 variable: a, Architecture, (i386, alpha, m68k, mips, ppc, sparc, sparc64)&lt;br /&gt;
                &lt;br /&gt;
                 # Define the base url for the LXR files.&lt;br /&gt;
                 baseurl: http://192.168.1.71/lxr/http/&lt;br /&gt;
                &lt;br /&gt;
                 # These are the templates for the HTML heading, directory listing and&lt;br /&gt;
                 # footer, respectively.&lt;br /&gt;
                 htmlhead: /var/www/lxr/http/template-head&lt;br /&gt;
                 htmltail: /var/www/lxr/http/template-tail&lt;br /&gt;
                 htmldir:  /var/www/lxr/http/template-dir&lt;br /&gt;
                &lt;br /&gt;
                 # The source is here.&lt;br /&gt;
                 sourceroot: /var/www/lxr/source/$v/&lt;br /&gt;
                 srcrootname: Linux&lt;br /&gt;
                &lt;br /&gt;
                 # &amp;quot;#include &amp;lt;foo.h&amp;gt;&amp;quot; is mapped to this directory (in the LXR source&lt;br /&gt;
                 # tree)&lt;br /&gt;
                 incprefix: /include&lt;br /&gt;
                &lt;br /&gt;
                 # The database files go here.&lt;br /&gt;
                 dbdir: /var/www/lxr/source/$v/&lt;br /&gt;
                &lt;br /&gt;
                 # Glimpse can be found here.&lt;br /&gt;
                 glimpsebin: /usr/local/bin/glimpse&lt;br /&gt;
                &lt;br /&gt;
                 # The power of regexps.  This is pretty Linux-specific, but quite&lt;br /&gt;
                 # useful.  Tinker with it and see what it does.  (How's that for&lt;br /&gt;
                 # documentation?)&lt;br /&gt;
                 map: /include/asm[^\/]*/ /include/asm-$a/&lt;br /&gt;
                 map: /arch/[^\/]+/ /arch/$a/&lt;br /&gt;
&lt;br /&gt;
         Now you should be ready to run &amp;quot;make-lxr&amp;quot;. Make sure the path is setup to patchset,&lt;br /&gt;
         which is repeated here. The last step take awhile.&lt;br /&gt;
&lt;br /&gt;
            $ export SRCDIR=/home/src&lt;br /&gt;
            $ cd $SRCDIR&lt;br /&gt;
            $ export PATH=$PATH:$SRCDIR/patchset-0.5/bin&lt;br /&gt;
&lt;br /&gt;
            $  make-lxr 2.6.10&lt;br /&gt;
&lt;br /&gt;
         Now you need to index the source. Below the ./glimpse_* file will be put in&lt;br /&gt;
         root. Checkout the -H option if you do not want them here on a temporary&lt;br /&gt;
         bases of if you run out of room.&lt;br /&gt;
&lt;br /&gt;
            $ glimpseindex -o -t -w 5000 /var/www/lxr/source/2.6.10 &amp;gt;&amp;amp; .glimpse_out&lt;br /&gt;
&lt;br /&gt;
         Since the above put the files under /root/.glimpse_* they should be moved&lt;br /&gt;
&lt;br /&gt;
            $ mv /root/.glimps_* /var/www/lxr/source/2.6.10/.&lt;br /&gt;
            $ chown -R nobody.nobody ./.glimpse_*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 118:&lt;br /&gt;
&lt;br /&gt;
        exec - you can change standard output and input without starting a new&lt;br /&gt;
               process.&lt;br /&gt;
&lt;br /&gt;
          The exec redirect the output from ls and date to a file. Nothing&lt;br /&gt;
          is show on the terminal until &amp;quot;exec &amp;gt; /dev/tty&amp;quot; is performed&lt;br /&gt;
&lt;br /&gt;
            $ exec &amp;gt; mfile&lt;br /&gt;
            $ ls&lt;br /&gt;
            $ date&lt;br /&gt;
            $ exec &amp;gt; /dev/tty&lt;br /&gt;
&lt;br /&gt;
          This is an example of assigning file descriptor 3 to file &amp;quot;output3&amp;quot; for&lt;br /&gt;
          output, then, redirecting &amp;quot;ls&amp;quot; to this descriptor. Finally, file descriptor&lt;br /&gt;
          3 is used for input, and the contents are read into the cat command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
            $ exec 3&amp;gt;output3&lt;br /&gt;
            $ ls  &amp;gt;&amp;amp; 3&lt;br /&gt;
            $ exec 3&amp;lt;output3&lt;br /&gt;
            $ cat &amp;lt;&amp;amp;3&lt;br /&gt;
            ChangeLog&lt;br /&gt;
            CVS&lt;br /&gt;
            How_to_Linux_and_Open_Source.txt&lt;br /&gt;
            How_to_Linux_and_Open_Source.txt.~1.193.~&lt;br /&gt;
            mfile&lt;br /&gt;
            mfile2&lt;br /&gt;
            mfile3&lt;br /&gt;
            mftp&lt;br /&gt;
            output3&lt;br /&gt;
&lt;br /&gt;
        Could you redirect the output to 3 files and stderr?&lt;br /&gt;
&lt;br /&gt;
            $ exec 3&amp;gt;output3&lt;br /&gt;
            $ exec 4&amp;gt;output4&lt;br /&gt;
            $ exec 5&amp;gt;output5&lt;br /&gt;
&lt;br /&gt;
            $ ls &amp;gt;&amp;amp; 3 &amp;gt;&amp;amp; 4 &amp;gt;&amp;amp; 5 &amp;gt;&amp;amp; 2   // Nope, can't do this.&lt;br /&gt;
            output3  output4  output5&lt;br /&gt;
&lt;br /&gt;
         Instead, you should do the following:&lt;br /&gt;
&lt;br /&gt;
            $ ls | tee output3 | tee output4 |tee output5&lt;br /&gt;
&lt;br /&gt;
         Closing the &amp;quot;output&amp;quot; file descriptor&lt;br /&gt;
&lt;br /&gt;
            $ &amp;gt;&amp;amp;3-&lt;br /&gt;
&lt;br /&gt;
         Closing the &amp;quot;input&amp;quot; file descriptor&lt;br /&gt;
&lt;br /&gt;
            $ 3&amp;lt;&amp;amp;-&lt;br /&gt;
&lt;br /&gt;
         See what is still open on 0-10&lt;br /&gt;
&lt;br /&gt;
            $ lsof -a -p $$ -d 0-10&lt;br /&gt;
&lt;br /&gt;
         Recursion - the following counts to 5, then, quits.&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
            sleep 1&lt;br /&gt;
            declare -x n&lt;br /&gt;
            let n=${n:=0}+1&lt;br /&gt;
            [ $n -le 5 ] &amp;amp;&amp;amp; echo &amp;quot;$n&amp;quot; &amp;amp;&amp;amp;  exec $0&lt;br /&gt;
&lt;br /&gt;
         There are some real-life applications for this technique, as follows:&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
            declare -x N&lt;br /&gt;
            declare -x n&lt;br /&gt;
            N=${N:=$(od -vAn -N1 -tu4 &amp;lt; /dev/urandom)}&lt;br /&gt;
            let n=${n:=0}+1&lt;br /&gt;
            [ $(($n%2)) -eq 0 ] &amp;amp;&amp;amp; echo &amp;quot;She Loves Me!&amp;quot; || echo &amp;quot;She Loves Me NOT!&amp;quot;&lt;br /&gt;
            [ $n -lt $N ] &amp;amp;&amp;amp;  exec $0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 119:&lt;br /&gt;
&lt;br /&gt;
        runlevel - need to know the current runlevel?&lt;br /&gt;
&lt;br /&gt;
           $ who -r&lt;br /&gt;
           run-level 3  Dec 31 19:02                   last=S&lt;br /&gt;
&lt;br /&gt;
        Need to know the architecture?&lt;br /&gt;
&lt;br /&gt;
          $ arch&lt;br /&gt;
          i686&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 120:&lt;br /&gt;
&lt;br /&gt;
        at - executes commands at a specified time.&lt;br /&gt;
&lt;br /&gt;
         A few examples here. The 1970 program will run&lt;br /&gt;
         next Auguest 2 even though the year 1970 has long past.&lt;br /&gt;
&lt;br /&gt;
          $ at 6:30am Jan 12 &amp;lt; program&lt;br /&gt;
          $ at noon tomorrow &amp;lt; program&lt;br /&gt;
          $ at 1970 pm August 2 &amp;lt; program&lt;br /&gt;
&lt;br /&gt;
        This is an interactive way to use the command:&lt;br /&gt;
&lt;br /&gt;
          $ at now + 6 minutes&lt;br /&gt;
          warning: commands will be executed using (in order) a) $SHELL b) login shell c) /bin/sh&lt;br /&gt;
          at&amp;gt; ls&lt;br /&gt;
          at&amp;gt; date &amp;gt; /tmp/5min&lt;br /&gt;
          at&amp;gt; ^D&lt;br /&gt;
          job 3 at 2005-01-01 08:50&lt;br /&gt;
&lt;br /&gt;
        What jobs are in the queue?&lt;br /&gt;
&lt;br /&gt;
          $ atq&lt;br /&gt;
&lt;br /&gt;
        or&lt;br /&gt;
&lt;br /&gt;
          $ at -l&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 121:&lt;br /&gt;
&lt;br /&gt;
        Creating a Manpage&lt;br /&gt;
&lt;br /&gt;
         As root you can copy the following to /usr/local/man/man1/soup.1 which will&lt;br /&gt;
         give you a manpage for soup.&lt;br /&gt;
&lt;br /&gt;
              .\&amp;quot; Manpage for souptonuts.&lt;br /&gt;
              .\&amp;quot; Contact mchirico@users.sourceforge.com to correct errors or omissions.&lt;br /&gt;
              .TH man 1 &amp;quot;04 January 2005&amp;quot; &amp;quot;1.0&amp;quot; &amp;quot;souptonuts man page&amp;quot;&lt;br /&gt;
              .SH NAME&lt;br /&gt;
              soup \- man page for souptonuts&lt;br /&gt;
              .SH SYNOPSIS&lt;br /&gt;
              soup&lt;br /&gt;
              .SH DESCRIPTION&lt;br /&gt;
              souptonuts is a collection of linux and open&lt;br /&gt;
              source tips.&lt;br /&gt;
              off for golf.&lt;br /&gt;
              .SH OPTIONS&lt;br /&gt;
              The souptonuts does not take any options.&lt;br /&gt;
              .SH SEE ALSO&lt;br /&gt;
              doughnut(1), golf(8)&lt;br /&gt;
              .SH BUGS&lt;br /&gt;
              No known bugs at this time.&lt;br /&gt;
              .SH AUTHOR&lt;br /&gt;
              Mike Chirico (mchirico@comcast.net mchirico@users.sourceforge.net)&lt;br /&gt;
&lt;br /&gt;
         So, to view this man page&lt;br /&gt;
&lt;br /&gt;
            $ man soup&lt;br /&gt;
&lt;br /&gt;
         It's also possible to compress&lt;br /&gt;
&lt;br /&gt;
            $ gzip /usr/local/man/man1/soup.1&lt;br /&gt;
&lt;br /&gt;
         For plenty of examples look at the other man pages. Also the following&lt;br /&gt;
         is helpful. The last one is a tutorial &amp;quot;man 7 mdoc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            $ man manpath&lt;br /&gt;
            $ man groff&lt;br /&gt;
            $ man 7 mdoc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 122:&lt;br /&gt;
&lt;br /&gt;
        dmesg - print out boot messages, or what is in the kernel ring buffer.&lt;br /&gt;
&lt;br /&gt;
          If you missed the messages on boot-up, you can use dmesg to print them.&lt;br /&gt;
&lt;br /&gt;
            $ dmesg &amp;gt; boot.msg&lt;br /&gt;
&lt;br /&gt;
          Or to print, then, clear the ring&lt;br /&gt;
&lt;br /&gt;
            # dmesg -c &amp;gt; boot.msg&lt;br /&gt;
&lt;br /&gt;
          (also see TIP 20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 123:&lt;br /&gt;
&lt;br /&gt;
        gnus - emacs email nntp news reader (comcast as example with NO TLS or SSL)&lt;br /&gt;
&lt;br /&gt;
          First check that you can connect to the news group:&lt;br /&gt;
&lt;br /&gt;
                 $ telnet newsgroups.comcast.net 119&lt;br /&gt;
                 Trying 216.196.97.136...&lt;br /&gt;
                 Connected to newsgroups.comcast.net.&lt;br /&gt;
                 Escape character is '^]'.&lt;br /&gt;
                 200 News.GigaNews.Com&lt;br /&gt;
&lt;br /&gt;
          If you want to check for TLS or SSL see (TIP 54).&lt;br /&gt;
&lt;br /&gt;
          Here is a very simple configuration example without encryption. It&lt;br /&gt;
          appears that comcast does not support ssl or TLS.&lt;br /&gt;
&lt;br /&gt;
          In the &amp;quot;~/.emacs&amp;quot; file you would add the following to get comcast&lt;br /&gt;
          news groups&lt;br /&gt;
&lt;br /&gt;
             (setq gnus-select-method '(nntp &amp;quot;newsgroups.comcast.net&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
          Then, create an &amp;quot;~/.authinfo&amp;quot; file with the following settings using&lt;br /&gt;
          you own username and password.&lt;br /&gt;
&lt;br /&gt;
             machine newsgroups.comcast.net login borkey@comcast.net  password borkeypass0rd&lt;br /&gt;
&lt;br /&gt;
          Next create a &amp;quot;~/.newsrc&amp;quot; with your groups&lt;br /&gt;
&lt;br /&gt;
             news.announce.newusers:&lt;br /&gt;
             comp.lang.c++.moderated! 1-500&lt;br /&gt;
             comp.unix.programmer! 1-500&lt;br /&gt;
             comp.unix.shell! 1-500&lt;br /&gt;
             gnu.emacs.gnus! 1-500&lt;br /&gt;
&lt;br /&gt;
          Finally, create a &amp;quot;~/.gnus&amp;quot; with the following email settings for you&lt;br /&gt;
&lt;br /&gt;
             (setq user-mail-address &amp;quot;mchirico@comcast.net&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
             (defun my-message-mode-setup ()&lt;br /&gt;
               (setq fill-column 72)&lt;br /&gt;
               (turn-on-auto-fill))&lt;br /&gt;
               (add-hook 'message-mode-hook 'my-message-mode-setup)&lt;br /&gt;
&lt;br /&gt;
          To get into gnus&lt;br /&gt;
&lt;br /&gt;
              E-x gnus&lt;br /&gt;
&lt;br /&gt;
          The following are common gnus commands&lt;br /&gt;
&lt;br /&gt;
                RET  view the article under the cursor&lt;br /&gt;
&lt;br /&gt;
                A A (shift-a, shift a): List all newsgroups known&lt;br /&gt;
                                        to the server.&lt;br /&gt;
&lt;br /&gt;
                l (lower-case L)      : List only  subscribed groups&lt;br /&gt;
                                        with unread articles.&lt;br /&gt;
&lt;br /&gt;
                L                     : List all newsgroups in .newsrc file.&lt;br /&gt;
&lt;br /&gt;
                g                     : See if new articles have arrived.&lt;br /&gt;
&lt;br /&gt;
            Some commands for reading&lt;br /&gt;
&lt;br /&gt;
                n  next unread article&lt;br /&gt;
&lt;br /&gt;
                p  previous article&lt;br /&gt;
&lt;br /&gt;
                SPC  scroll down  moves to next unread&lt;br /&gt;
                     when at the bottom of the article&lt;br /&gt;
&lt;br /&gt;
                del  scroll up&lt;br /&gt;
&lt;br /&gt;
                F  follow-up to group on the article you are&lt;br /&gt;
                   reading now.&lt;br /&gt;
&lt;br /&gt;
                f  follow-up to group without citing the article&lt;br /&gt;
&lt;br /&gt;
                R  reply by mail and cite the article&lt;br /&gt;
&lt;br /&gt;
                r  reply by mail without citing the article&lt;br /&gt;
&lt;br /&gt;
                m  new mail&lt;br /&gt;
&lt;br /&gt;
                a  new posting&lt;br /&gt;
&lt;br /&gt;
                c  Catchup&lt;br /&gt;
&lt;br /&gt;
                C-u / t  Show only young headers&lt;br /&gt;
                         / t without C-u limits the summary&lt;br /&gt;
                         to old headers&lt;br /&gt;
&lt;br /&gt;
                T T  toggle threading&lt;br /&gt;
&lt;br /&gt;
                C-u g  Display raw article&lt;br /&gt;
                       hit g to return to normal view&lt;br /&gt;
&lt;br /&gt;
                t  Show all headers  it's a toggle&lt;br /&gt;
&lt;br /&gt;
                W w  Wordwrap the current article&lt;br /&gt;
&lt;br /&gt;
                W r  Decode ROT13  a toggle&lt;br /&gt;
&lt;br /&gt;
                ^  fetch parent of article&lt;br /&gt;
&lt;br /&gt;
                L  create a scorefile-entry based&lt;br /&gt;
                   on the current article (low score)&lt;br /&gt;
                   ? gives you information what each char means&lt;br /&gt;
&lt;br /&gt;
                I  like L but high score&lt;br /&gt;
&lt;br /&gt;
          Commands to send email&lt;br /&gt;
&lt;br /&gt;
            C-c C-c  send message&lt;br /&gt;
&lt;br /&gt;
            C-c C-d  save message as draft&lt;br /&gt;
&lt;br /&gt;
            C-c C-k  kill message&lt;br /&gt;
&lt;br /&gt;
            C-c C-m f  attach file&lt;br /&gt;
&lt;br /&gt;
            M-q  reformat paragraph&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 124:&lt;br /&gt;
&lt;br /&gt;
        Sending Email from telnet&lt;br /&gt;
&lt;br /&gt;
           Note, if you are on the computer you can sometime use the local loopback.&lt;br /&gt;
           In fact, sometimes you can only use the local loop back 127.0.0.1 in&lt;br /&gt;
           place of &amp;quot;bozo.company.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            1     [mchirico@soup Notes]$ telnet bozo.company.com 25&lt;br /&gt;
            2     Trying 192.168.0.204...&lt;br /&gt;
            3     Connected to bozo.company.com.&lt;br /&gt;
            4     Escape character is '^]'.&lt;br /&gt;
            5     220 bozo.company.com ESMTP Postfix (Postfix-20010228-pl03) (Mandrake Linux)&lt;br /&gt;
            6     HELO fakedomain.com&lt;br /&gt;
            7     HELO fakedomain.com         // server echo&lt;br /&gt;
            8     250 bozo.company.com&lt;br /&gt;
            9     MAIL FROM: test@fakedomain.com&lt;br /&gt;
           10     MAIL FROM: test@fakedomain.com   // server echo&lt;br /&gt;
           11     250 Ok&lt;br /&gt;
           12     RCPT TO: mchirico@someother.com&lt;br /&gt;
           13     RCPT TO: mchirico@someother.com   // server echo&lt;br /&gt;
           14     250 Ok&lt;br /&gt;
           15     DATA&lt;br /&gt;
           16     DATA    // echo&lt;br /&gt;
           17     354 Enter mail, end with &amp;quot;.&amp;quot; on a line by itself&lt;br /&gt;
           18     This is a test message&lt;br /&gt;
           19     This is a test message&lt;br /&gt;
           20     to send&lt;br /&gt;
           21     to send&lt;br /&gt;
           22     .&lt;br /&gt;
           23     250 2.0.0 j0B0uH3L018469 Message accepted for delivery&lt;br /&gt;
&lt;br /&gt;
          Above on line 6 you can type in any domain name. Line 7 is an echo. All&lt;br /&gt;
          echos are listed in the comment field.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 125:&lt;br /&gt;
&lt;br /&gt;
          IP forwarding, IP Masquerade&lt;br /&gt;
&lt;br /&gt;
             # echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
             # ipchains -F forward&lt;br /&gt;
             # ipchains -P forward DENY&lt;br /&gt;
             # ipchains -A forward -s 192.168.0.0/24 -j MASQ&lt;br /&gt;
             # ipchains -A forward -i eth1 -j MASQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          This assumes that your internal network is 192.168.0.0 on eth1, and the&lt;br /&gt;
          internet is connected to eth0.&lt;br /&gt;
&lt;br /&gt;
          (Also See TIP 182)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 126:&lt;br /&gt;
&lt;br /&gt;
         Setting KDE as the default desktop manager&lt;br /&gt;
&lt;br /&gt;
               Edit &amp;quot;/etc/sysconfig/desktop&amp;quot; to include the two lines:&lt;br /&gt;
&lt;br /&gt;
                 DESKTOP=&amp;quot;KDE&amp;quot;&lt;br /&gt;
                 DISPLAYMANAGER=&amp;quot;KDE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 127:&lt;br /&gt;
&lt;br /&gt;
        Have a file and you do not know whay type it is (tar, gz, ASCII, binary) ?&lt;br /&gt;
        Use the file command.  Below it is used on the file &amp;quot;mftp&amp;quot;&lt;br /&gt;
&lt;br /&gt;
               $ file mftp&lt;br /&gt;
               mftp: Bourne-Again shell script text executable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 128:&lt;br /&gt;
&lt;br /&gt;
        Software RAID: Two good references&lt;br /&gt;
&lt;br /&gt;
          http://www.tldp.org/HOWTO/Software-RAID-HOWTO-1.html&lt;br /&gt;
          http://lists.us.dell.com/pipermail/linux-poweredge/2003-July/014331.html&lt;br /&gt;
&lt;br /&gt;
        Note, you must setup grub for each RAID 1 device. Suppose you have&lt;br /&gt;
        2 SCSI drives (sda and sdb). By default grub is setup on sda; but, you&lt;br /&gt;
        need to enable it for sdb (/dev/hdb for ide) as follows:&lt;br /&gt;
&lt;br /&gt;
           grub&amp;gt;device (hd0) /dev/sdb&lt;br /&gt;
           grub&amp;gt;root (hd0,0)&lt;br /&gt;
           grub&amp;gt;setup (hd0)&lt;br /&gt;
&lt;br /&gt;
           Checking if &amp;quot;/boot/grub/stage1&amp;quot; exists... no&lt;br /&gt;
           Checking if &amp;quot;/grub/stage1&amp;quot; exists... yes&lt;br /&gt;
           Checking if &amp;quot;/grub/stage2&amp;quot; exists... yes&lt;br /&gt;
           Checking if &amp;quot;/grub/e2fs_stage1_5&amp;quot; exists.. yes&lt;br /&gt;
           Running &amp;quot;embed /grub/e2fs_stage1_5 (hd0)&amp;quot;... 16 sectors are embedded.&lt;br /&gt;
          succeeded&lt;br /&gt;
           Running &amp;quot;install /grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/grub/stage2 /grub/grub&lt;br /&gt;
         .conf&amp;quot;... succeeded.&lt;br /&gt;
         Done.&lt;br /&gt;
&lt;br /&gt;
          grub&amp;gt;&lt;br /&gt;
          grub&amp;gt;quit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Checking to see if everything is working:&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
        Checking the drives&lt;br /&gt;
&lt;br /&gt;
          $ sfdisk -d /dev/sdb&lt;br /&gt;
          $ sfdisk -d /dev/sda&lt;br /&gt;
&lt;br /&gt;
          $ fdisk -l /dev/sda  &amp;quot;This will give general information&amp;quot;&lt;br /&gt;
          $ fdisk -l           &amp;quot;General information for all drives&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Adding raid (assume you want to add the first drive &amp;quot;sda1&amp;quot;, or if it is the second&lt;br /&gt;
                    drive then substitute &amp;quot;sda2&amp;quot; below )&lt;br /&gt;
&lt;br /&gt;
          $ raidhotadd /dev/md0 /dev/sda1&lt;br /&gt;
          $ raidhotadd /dev/md1 /dev/sda2&lt;br /&gt;
          $ raidhotadd /dev/md2 /dev/sda3&lt;br /&gt;
&lt;br /&gt;
        This is an example of an cat /proc/mdstat that is working. Note that&lt;br /&gt;
        there is a listing for both sda1[0] and sdb1[1]&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
                Personalities : [raid1]&lt;br /&gt;
                read_ahead 1024 sectors&lt;br /&gt;
                Event: 12&lt;br /&gt;
                md0 : active raid1 sda1[0] sdb1[1]&lt;br /&gt;
                      104320 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md1 : active raid1 sda2[0] sdb2[1]&lt;br /&gt;
                      1044160 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md2 : active raid1 sda3[0] sdb3[1]&lt;br /&gt;
                      34411136 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        Compare that to this where md2 is missing sdb3&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
                Personalities : [raid1]&lt;br /&gt;
                read_ahead 1024 sectors&lt;br /&gt;
                Event: 9&lt;br /&gt;
                md0 : active raid1 sda1[0] sdb1[1]&lt;br /&gt;
                      104320 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md1 : active raid1 sda2[0] sdb2[1]&lt;br /&gt;
                      1044160 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md2 : active raid1 sdb3[1]        &amp;lt;---- HERE&lt;br /&gt;
                      34411136 blocks [2/1] [_U]&lt;br /&gt;
&lt;br /&gt;
                unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        If you are rebuilding an array, you can watch it by doing the following:&lt;br /&gt;
&lt;br /&gt;
           $ watch -n1 cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
        Need to know the raid setup?&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/raidtab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 129:&lt;br /&gt;
&lt;br /&gt;
        Resetting Redhat Linux Passwords using GRUB&lt;br /&gt;
&lt;br /&gt;
           1. Press 'e'&lt;br /&gt;
           2. Press 'e' again&lt;br /&gt;
           3. Append 'single' to the kernel version listing&lt;br /&gt;
&lt;br /&gt;
          See&lt;br /&gt;
             http://linuxgazette.net/107/tomar.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 130:&lt;br /&gt;
&lt;br /&gt;
        mtr - matt's traceroute. This is an advanced traceroute that keeps&lt;br /&gt;
              [http://www.bitwizard.nl/mtr/]&lt;br /&gt;
                  $ mtr www.yahoo.com&lt;br /&gt;
&lt;br /&gt;
                                              Matt's traceroute  [v0.52]&lt;br /&gt;
                     third-fl-71.localdomain                            Thu Jan 20 11:05:57 2005&lt;br /&gt;
                     Keys:  D - Display mode    R - Restart statistics    Q - Quit&lt;br /&gt;
                                                            Packets               Pings&lt;br /&gt;
                     Hostname                            %Loss  Rcv  Snt  Last Best  Avg  Worst&lt;br /&gt;
                      1. 192.168.1.1                        0%    3    3     0    0    0      1&lt;br /&gt;
                      2. ???&lt;br /&gt;
                      3. fe-2-6-rr01.willogrove5.pa.pa01    0%    3    3     8    7    7      8&lt;br /&gt;
                      4. srp-8-1-ar01.willowgrove1.pa.pa    0%    2    2     8    8    8      8&lt;br /&gt;
                      5. pos7-3-cr01.torresdale.pa.core.    0%    2    2     8    8    8      8&lt;br /&gt;
                      6. 12.119.53.53                       0%    2    2    12   12   12     13&lt;br /&gt;
                      7. tbr1-p012401.phlpa.ip.att.net      0%    2    2    12   12   13     13&lt;br /&gt;
                      8. tbr1-cl8.n54ny.ip.att.net          0%    2    2    13   13   13     13&lt;br /&gt;
                      9. ggr2-p310.n54ny.ip.att.net         0%    2    2    12   12   13     14&lt;br /&gt;
                     10. so-1-0-0.gar4.NewYork1.Level3.n    0%    2    2    14   14   37     61&lt;br /&gt;
                     11. ae-1-54.bbr2.NewYork1.Level3.ne    0%    2    2    13   12   13     13&lt;br /&gt;
                     12. ge-0-3-0.bbr2.Washington1.Level    0%    2    2    19   19   19     19&lt;br /&gt;
                     13. ge-1-1-51.car1.Washington1.Leve    0%    2    2    18   18   19     20&lt;br /&gt;
                     14. 4.79.228.6                         0%    2    2    21   19   20     21&lt;br /&gt;
                     15. UNKNOWN-216-109-120-201.yahoo.c    0%    2    2    21   20   20     21&lt;br /&gt;
                     16. w2.rc.vip.dcn.yahoo.com            0%    2    2    23   21   22     23&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 131:&lt;br /&gt;
&lt;br /&gt;
        chfn - change finger information&lt;br /&gt;
&lt;br /&gt;
            $ chfn&lt;br /&gt;
&lt;br /&gt;
          Next you are asked for a password and user information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 132:&lt;br /&gt;
&lt;br /&gt;
        chsh - change login shell&lt;br /&gt;
&lt;br /&gt;
          First, you may want to get a listing of all the possible&lt;br /&gt;
          shells.&lt;br /&gt;
&lt;br /&gt;
             $ chsh -l&lt;br /&gt;
&lt;br /&gt;
               /bin/sh&lt;br /&gt;
               /bin/bash&lt;br /&gt;
               /sbin/nologin&lt;br /&gt;
               /bin/ash&lt;br /&gt;
               /bin/bsh&lt;br /&gt;
               /bin/ksh&lt;br /&gt;
               /usr/bin/ksh&lt;br /&gt;
               /usr/bin/pdksh&lt;br /&gt;
               /bin/tcsh&lt;br /&gt;
               /bin/csh&lt;br /&gt;
               /bin/zsh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 133:&lt;br /&gt;
&lt;br /&gt;
        bash - working with binary, hex and base 3.&lt;br /&gt;
&lt;br /&gt;
         For the variable must be declare as an integer. Then&lt;br /&gt;
         specify the  &amp;lt;base&amp;gt;#&amp;lt;value&amp;gt;. The example below is 22 in&lt;br /&gt;
         base 3.&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n&lt;br /&gt;
              $ n=3#22&lt;br /&gt;
              $ echo $n&lt;br /&gt;
                8&lt;br /&gt;
&lt;br /&gt;
           Base 16 (hex)&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n2&lt;br /&gt;
              $ n2=16#a&lt;br /&gt;
              $ echo $n2&lt;br /&gt;
                10&lt;br /&gt;
&lt;br /&gt;
           Base 8 (octal)&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n3&lt;br /&gt;
              $ n3=8#11&lt;br /&gt;
              $ echo $n3&lt;br /&gt;
                9   Note 8+1=9&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 134:&lt;br /&gt;
&lt;br /&gt;
        monitoring IP traffic. Try iptraf http://iptraf.seul.org/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 135:&lt;br /&gt;
&lt;br /&gt;
        enscript - convert text files to PostScript&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 136:&lt;br /&gt;
&lt;br /&gt;
        dd and tar - blocking factor. How to determine the blocking factor, block size&lt;br /&gt;
                   so that tar and dd can work together.&lt;br /&gt;
&lt;br /&gt;
        Step 1: Create a large file on local disk, in a directory &amp;quot;1&amp;quot; that will eventually&lt;br /&gt;
                be written to tape. This will be created with dd as follows:&lt;br /&gt;
&lt;br /&gt;
                $ mkdir 1&lt;br /&gt;
                $ dd if=/dev/zero of=disk-image count=40960&lt;br /&gt;
                  40960+0 records in&lt;br /&gt;
                  40960+0 records out&lt;br /&gt;
&lt;br /&gt;
                $ cd ..&lt;br /&gt;
&lt;br /&gt;
        Step 2: tar the directory and contents to tape. First rewind the tape. These examples&lt;br /&gt;
                use /dev/nst0 as the location of the tape. Make sure to substitute your values&lt;br /&gt;
                if needed.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ tar --label=&amp;quot;Test 1&amp;quot; --create --blocking-factor=128 --file=/dev/nst0 1&lt;br /&gt;
&lt;br /&gt;
        Step 3: Read data from the tape using a block size of 128k. If you get an I/O error, which&lt;br /&gt;
                could happend if you used a different blocking factor above, then, you may need&lt;br /&gt;
                to increase the bs to 256, or 512 etc. as needed.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=/dev/nst0 bs=128k of=testblocksz count=1&lt;br /&gt;
                 0+1 records in&lt;br /&gt;
                 0+1 records out&lt;br /&gt;
&lt;br /&gt;
                $ ls -l testblocksz&lt;br /&gt;
                 -rw-r--r--    1 root     root        65536 Feb  9 10:41 testblocksz&lt;br /&gt;
&lt;br /&gt;
                $ ls -lh testblocksz&lt;br /&gt;
                 -rw-r--r--    1 root     root          64k Feb  9 10:41 testblocksz&lt;br /&gt;
&lt;br /&gt;
               Note above that the size 65536 is equal to 64k. That &amp;quot;h&amp;quot; switch in &amp;quot;ls&amp;quot; is for&lt;br /&gt;
               human readable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 4: tar uses a multiplier of 512*blocking-factor to get block size. Again&lt;br /&gt;
&lt;br /&gt;
                 512 * blocking-factor = block size used in dd command.&lt;br /&gt;
&lt;br /&gt;
              Putting in the values, we see that&lt;br /&gt;
&lt;br /&gt;
                 512 * 128 = 65536&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 5: So what does this tell you? You can now use these numbers to &amp;quot;dd&amp;quot; files&lt;br /&gt;
              to tape. But, first tar will be used to create the file locally.&lt;br /&gt;
&lt;br /&gt;
                $ tar --label=&amp;quot;Test 1&amp;quot; --create --blocking-factor=128 --file=test.tar 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 6: Send this to tape with the dd command. Remember 64k is equal to 65536.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=test.tar bs=64k of=/dev/nst0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 7: Now test that it can be read with tar command using blocking-factor=128.&lt;br /&gt;
             Note the &amp;quot;t&amp;quot; command in tar is for tell. It will not write data.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ tar -tvf /dev/nst0 --blocking-factor=128&lt;br /&gt;
                 V--------- 0/0               0 2005-02-09 10:38:20 Test 1--Volume Header--&lt;br /&gt;
                 drwxr-xr-x root/root         0 2005-02-09 10:34:10 1/&lt;br /&gt;
                 -rw-r--r-- root/root  20971520 2005-02-09 10:34:11 1/disk-image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 8: Reading tape data with dd. Most of the time a high &amp;quot;ibs&amp;quot; input block size&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=/dev/nst0 of=outfromdd.tar ibs=64k&lt;br /&gt;
                 321+0 records in&lt;br /&gt;
                 41088+0 records out&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 9: Verify that outfromdd.tar can be read by tar with blocking-factor=128&lt;br /&gt;
&lt;br /&gt;
                $ tar -tvf outfromdd.tar --blocking-factor=128&lt;br /&gt;
                 V--------- 0/0               0 2005-02-09 10:38:20 Test 1--Volume Header--&lt;br /&gt;
                 drwxr-xr-x root/root         0 2005-02-09 10:34:10 1/&lt;br /&gt;
                 -rw-r--r-- root/root  20971520 2005-02-09 10:34:11 1/disk-image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       PULLING FILES:  The dd command can be used to pull files.&lt;br /&gt;
&lt;br /&gt;
              ssh target_address dd if=remotefile | dd of=localfile&lt;br /&gt;
&lt;br /&gt;
           Or, a specific example of getting a file from a computer called hamlet.&lt;br /&gt;
&lt;br /&gt;
              $ ssh root@hamlet  dd if=/home/cvs/test | dd of=/home/storage/test&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        GOING BACKWARD AND FORWARD ON TAPE:&lt;br /&gt;
&lt;br /&gt;
             Go to end of data&lt;br /&gt;
              $ mt -f /dev/nst0  eod&lt;br /&gt;
&lt;br /&gt;
             Previous record&lt;br /&gt;
              $ mt -f /dev/nst0  bsfm 1&lt;br /&gt;
&lt;br /&gt;
             Forward record&lt;br /&gt;
              $ mt -f /dev/nst0  fsf 1&lt;br /&gt;
&lt;br /&gt;
             Rewind&lt;br /&gt;
              $ mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
             Tell&lt;br /&gt;
              $ mt -f /dev/nst0 tell&lt;br /&gt;
&lt;br /&gt;
         (Reference TIP 151 - for how to get around firewalls)&lt;br /&gt;
&lt;br /&gt;
         Below is a script that I use to backup computers via ssh. The&lt;br /&gt;
         tape drive is on &amp;quot;nis&amp;quot; and the extra space is on &amp;quot;hamlet&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                #!/bin/bash&lt;br /&gt;
                # Program to backup server remotely&lt;br /&gt;
                # Assume remote server is nis, you are on squeezel&lt;br /&gt;
                #&lt;br /&gt;
                # Recover from tape&lt;br /&gt;
                #&lt;br /&gt;
                #   dd if=/dev/nst0 of=test.tar.gz bs=64k&lt;br /&gt;
                #&lt;br /&gt;
                filename=&amp;quot;support1.$(date &amp;quot;+%m%d%y%H%M&amp;quot;).tar.gz&amp;quot;&lt;br /&gt;
                DIRTOBACKUP=/var/www&lt;br /&gt;
                #tar cvzf - $DIRTOBACKUP | ssh  root@nis  '(mt -f /dev/nst0 rewind; dd of=/dev/nst0 bs=64k )'&lt;br /&gt;
                tar cvzf - $DIRTOBACKUP | ssh  support1@hamlet &amp;quot;dd of=/home/support1/backups/${filename} &amp;quot;&lt;br /&gt;
&lt;br /&gt;
         Another example program, below, pushes the last &amp;quot;.tar.gz&amp;quot; file to tape:&lt;br /&gt;
&lt;br /&gt;
                #!/bin/bash&lt;br /&gt;
                # Program to push files to tape&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                # Notes on recovering from tape&lt;br /&gt;
                #&lt;br /&gt;
                #   dd if=/dev/nst0 of=test.tar.gz ibs=64k&lt;br /&gt;
                #    or&lt;br /&gt;
                #  $ ssh root@tapeserver &amp;quot;mt -f /dev/nst0 rewind&amp;quot;&lt;br /&gt;
                #  $ ssh root@tapeserver &amp;quot;dd if=/dev/nst0 ibs=64k&amp;quot;|dd of=cvs1.tar.gz&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                # First rewind tape&lt;br /&gt;
                ssh root@tapeserver 'mt -f /dev/nst0 rewind'&lt;br /&gt;
                #&lt;br /&gt;
                # Grab only the last file&lt;br /&gt;
                file=$(find /home/cvs  -iname 'cvs*.tar.gz'|sort|tail -n 1)&lt;br /&gt;
                dd if=${file}|ssh root@tapeserver 'dd of=/dev/nst0 bs=64k'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 137:&lt;br /&gt;
&lt;br /&gt;
        Apache - redirecting pages. All changes are in httpd.conf&lt;br /&gt;
&lt;br /&gt;
               RedirectMatch (.*)\.gif$ http://www.anotherserver.com$1.jpg&lt;br /&gt;
&lt;br /&gt;
               Redirect /service http://foo2.bar.com/service&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 138:&lt;br /&gt;
&lt;br /&gt;
        samba mounts via ssh - mounting a samba share through an ssh tunnel, going&lt;br /&gt;
               through an intermediate computer, that accepts ssh. We'll call this&lt;br /&gt;
               intermediate computer middle [65.219.4.23], and we want to get to&lt;br /&gt;
               destination [192.168.0.81]. The user will be mchirico.&lt;br /&gt;
&lt;br /&gt;
          STEP 1:&lt;br /&gt;
&lt;br /&gt;
               $ mkdir -p /samba/share&lt;br /&gt;
&lt;br /&gt;
          STEP 2:&lt;br /&gt;
&lt;br /&gt;
            This has to be done as root, since we are using a lower port.&lt;br /&gt;
&lt;br /&gt;
               $ ssh -N -L 139:192.168.0.81:139 mchirico@65.219.4.23&lt;br /&gt;
&lt;br /&gt;
          STEP 3:&lt;br /&gt;
&lt;br /&gt;
              umount /samba/sales&lt;br /&gt;
              /bin/mount -t smbfs -o  username=donkey,workgroup=donkeydomain,&lt;br /&gt;
                      password=passw0rk1,port=139,dmask=770,fmask=660,&lt;br /&gt;
                      netbiosname=homecpu //localhost/share /samba/share&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 139:&lt;br /&gt;
&lt;br /&gt;
        Music on Fedora Core -- How to play music on http://magnatune.com with &amp;quot;xmms&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           The following command will show the sound driver:&lt;br /&gt;
&lt;br /&gt;
              $ lspci|grep -i audio&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          STEP 1:&lt;br /&gt;
&lt;br /&gt;
                Unmute amixer with the following command:&lt;br /&gt;
&lt;br /&gt;
              $ amixer set Master 100% unmute&lt;br /&gt;
              $ amixer set PCM 100%  unmute&lt;br /&gt;
&lt;br /&gt;
                Note you can also get a graphical interface with &amp;quot;alsamixer&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              $ alsamixer&lt;br /&gt;
&lt;br /&gt;
                 h,F1   -- for help&lt;br /&gt;
                 Esc    -- exit&lt;br /&gt;
                 Tab    -- move to selections&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          STEP 2:&lt;br /&gt;
&lt;br /&gt;
                Test a sound file &amp;quot;*.au&amp;quot; with aplay. To quickly find files on your system use&lt;br /&gt;
                the &amp;quot;locate *.au&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
                  $ aplay /usr/lib/python2.3/test/audiotest.au&lt;br /&gt;
&lt;br /&gt;
          STEP 3:&lt;br /&gt;
&lt;br /&gt;
                Install &amp;quot;xmms-mp3-1.2.10-9.2.1.fc3.rf.i386.rpm&amp;quot; which does not come with Fedora because&lt;br /&gt;
                of GPL license restrictions.  The latest version of this package can be found&lt;br /&gt;
                at the following url:&lt;br /&gt;
&lt;br /&gt;
                  http://rpmseek.com/rpm-pl/xmms-mp3.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                  $ rpm -ivh xmms-mp3-1.2.10-9.2.1.fc3.rf.i386.rpm&lt;br /&gt;
&lt;br /&gt;
          STEP 4:&lt;br /&gt;
&lt;br /&gt;
                Go to magnatun &amp;quot;http://magnatune.com/&amp;quot;, select genre and make sure xmms&lt;br /&gt;
                is the default player.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 140:&lt;br /&gt;
&lt;br /&gt;
        Routing -- getting access to a network 1 hop away. You are currently on the 192 network&lt;br /&gt;
                   and you want access to the 172.21.0.0 network that has a computer straddling&lt;br /&gt;
                   the two, with /proc/sys/net/ipv4/ip_forward set to 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               $ route add -net 172.21.0.0 netmask 255.255.255.0 gw 192.168.0.204&lt;br /&gt;
&lt;br /&gt;
         To undo:&lt;br /&gt;
&lt;br /&gt;
               $ route del -net 172.21.0.0 netmask 255.255.255.0 gw 192.168.0.204&lt;br /&gt;
&lt;br /&gt;
         Now you can ping 172.21.0.21.&lt;br /&gt;
&lt;br /&gt;
         Does not work?&lt;br /&gt;
&lt;br /&gt;
         Go on to 192.168.0.204 and execute the following commands:&lt;br /&gt;
&lt;br /&gt;
               $ echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
               $ cat /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
               1&lt;br /&gt;
&lt;br /&gt;
         To Look at the the gateway, execute the following command.&lt;br /&gt;
&lt;br /&gt;
               $ netstat -r&lt;br /&gt;
&lt;br /&gt;
         References: &lt;br /&gt;
&lt;br /&gt;
               http://lartc.org/lartc.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 141:&lt;br /&gt;
&lt;br /&gt;
        RAM disk -- creating a filesystem in RAM.&lt;br /&gt;
&lt;br /&gt;
               $ mkfs -t ext3 -q /dev/ram1 4096&lt;br /&gt;
               $ mkdir -p /fsram&lt;br /&gt;
               $ mount /dev/ram1 /fsram -o defaults,rw&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 142:&lt;br /&gt;
&lt;br /&gt;
        Create a Live Linux CDROM  using  BusyBox and OpenSSH.&lt;br /&gt;
&lt;br /&gt;
            These steps are rather long. A complete tutorial is given at&lt;br /&gt;
            the following link:&lt;br /&gt;
             http://prdownloads.sourceforge.net/souptonuts/instructions_boot_system.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 143:&lt;br /&gt;
&lt;br /&gt;
      SystemImager (http://www.systemimager.org/) SystemImager is software that automates Linux installs,&lt;br /&gt;
                       software distribution, and production deployment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 144:&lt;br /&gt;
&lt;br /&gt;
      Mounted a filesystem in rescue mode, yet, you cannot read and write?  Remount.&lt;br /&gt;
&lt;br /&gt;
             $ mount -o remount /&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 145:&lt;br /&gt;
&lt;br /&gt;
      Nmap commands to check for Microsoft VPN connection.&lt;br /&gt;
&lt;br /&gt;
         $ nmap -sO -p 47 vpn1.someserver.com&lt;br /&gt;
         $ nmap -sS -p T:1723 vpn1.someserver.com&lt;br /&gt;
&lt;br /&gt;
      By the way, with nmap you can specify multiple ports. Below&lt;br /&gt;
      is an example of multiple ports; but, use the commands above&lt;br /&gt;
      for Microsoft VPN services.&lt;br /&gt;
&lt;br /&gt;
         $ nmap -sS -p T:1723-3000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 146:&lt;br /&gt;
&lt;br /&gt;
      Perl and ssh - monitoring systems. The output from ssh can be parsed. Below is&lt;br /&gt;
      a simple procedure to just to read the ssh ouput into perl.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #&lt;br /&gt;
          $pid = open $readme, &amp;quot;ssh root\@hamlet df -lh|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
          while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
           print $_&lt;br /&gt;
          }&lt;br /&gt;
          close $readme&lt;br /&gt;
&lt;br /&gt;
      But note, you probably want to do something more complex. Below is a more robust&lt;br /&gt;
      example that bypassed all the fortune, heading junk that you may encounter when&lt;br /&gt;
      logging in.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #&lt;br /&gt;
          $pid = open $readme, &amp;quot;ssh root\@hamlet df -lh 2&amp;gt;/dev/null|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
          while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
           print $_&lt;br /&gt;
          }&lt;br /&gt;
          close $readme&lt;br /&gt;
&lt;br /&gt;
      NO! you CANNOT do bidirectional communication with the open statement. Note the &amp;quot;|&amp;quot; before&lt;br /&gt;
      and after below, which cannot be done.&lt;br /&gt;
&lt;br /&gt;
          # Cannot do this!&lt;br /&gt;
          $pid = open $readme, &amp;quot;|ssh root\@hamlet df -lh 2&amp;gt;/dev/null|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
      Below is a simple Perl example working with arrays:&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          @ArrayOfArray = (&lt;br /&gt;
                   [ &amp;quot;ant&amp;quot;, &amp;quot;bee&amp;quot; ],&lt;br /&gt;
                   [ &amp;quot;mouse&amp;quot;, &amp;quot;mole&amp;quot;, &amp;quot;rat&amp;quot; ],&lt;br /&gt;
                   [ &amp;quot;duck&amp;quot;, &amp;quot;goose&amp;quot;, &amp;quot;flamingo&amp;quot; ],&lt;br /&gt;
                   [  &amp;quot;rose&amp;quot;,&amp;quot;carnation&amp;quot;,&amp;quot;sunflower&amp;quot;],&lt;br /&gt;
                  );&lt;br /&gt;
&lt;br /&gt;
          for $i ( 0 .. $#ArrayOfArray ) {&lt;br /&gt;
              for $j ( 0 .. $#{$ArrayOfArray[$i]} ) {&lt;br /&gt;
                  print &amp;quot;Element $i $j is $ArrayOfArray[$i][$j]\n&amp;quot;;&lt;br /&gt;
              }&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          # Or this is another way to list elements&lt;br /&gt;
          foreach( @ArrayOfArray ) {&lt;br /&gt;
             foreach $i (0..$#$_) {&lt;br /&gt;
                print &amp;quot;$_-&amp;gt;[$i] &amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
             print &amp;quot;\n&amp;quot;;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Below is an example of working with Hash of Arrays:&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #  ./program &amp;lt; /etc/passwd&lt;br /&gt;
          while(&amp;lt;&amp;gt;){&lt;br /&gt;
              next unless s/^(.*?):\s*//;&lt;br /&gt;
              $HoA{$1} = [ split(/:/) ];&lt;br /&gt;
          }&lt;br /&gt;
          for $i (keys %HoA ) {&lt;br /&gt;
              print &amp;quot;$i: @{ $HoA{$i} } \n&amp;quot;;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
      Example of regular expression. This is my most used regular expression - I like&lt;br /&gt;
      this sample. See the &amp;quot;www.unix.org.ua&amp;quot; link at the end of this tip.&lt;br /&gt;
&lt;br /&gt;
          &amp;quot;hot cross buns&amp;quot; =~ /cross/;&lt;br /&gt;
          print &amp;quot;Matched: &amp;lt;$`&amp;gt; $&amp;amp; &amp;lt;$'&amp;gt;\n&amp;quot;;    # Matched: &amp;lt;hot &amp;gt; cross &amp;lt; buns&amp;gt;&lt;br /&gt;
          print &amp;quot;Left:    &amp;lt;$`&amp;gt;\n&amp;quot;;            # Left:    &amp;lt;hot &amp;gt;&lt;br /&gt;
          print &amp;quot;Match:   &amp;lt;$&amp;amp;&amp;gt;\n&amp;quot;;            # Match:   &amp;lt;cross&amp;gt;&lt;br /&gt;
          print &amp;quot;Right:   &amp;lt;$'&amp;gt;\n&amp;quot;;            # Right:   &amp;lt; buns&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      If you're looking for Perl information, type &amp;quot;man perl&amp;quot;, which will show you how&lt;br /&gt;
      to get even more information. Or better yet, take a look at the following&lt;br /&gt;
      link:&lt;br /&gt;
&lt;br /&gt;
          http://www.unix.org.ua/orelly/perl/prog3/ch09_01.htm&lt;br /&gt;
               also&lt;br /&gt;
          http://www.stonehenge.com/merlyn/UnixReview/&lt;br /&gt;
&lt;br /&gt;
      For a quick example on using Perl with SQLite, see the following links:&lt;br /&gt;
&lt;br /&gt;
          http://prdownloads.sourceforge.net/souptonuts/README_sqlite_tutorial.html?download&lt;br /&gt;
            or&lt;br /&gt;
          http://freshmeat.net/articles/view/1428/&lt;br /&gt;
            or&lt;br /&gt;
          http://www.perl.com/pub/a/1999/09/refererents.html&lt;br /&gt;
&lt;br /&gt;
      Standard input for files. This example will read from stdin, or open a file if given as&lt;br /&gt;
      an argument, and convert all &amp;quot;&amp;lt;&amp;quot; to &amp;quot;&amp;amp;lt;&amp;quot; and &amp;quot;&amp;gt;&amp;quot; to &amp;quot;&amp;amp;gt;&amp;quot;, which can be handy when&lt;br /&gt;
      converting text files to html files. Note the &amp;quot;while(&amp;lt;&amp;gt;)&amp;quot; will take multiple file names&lt;br /&gt;
      on the command line.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          while(&amp;lt;&amp;gt;) {&lt;br /&gt;
             s/&amp;amp;amp;/&amp;amp;amp;amp;/g;&lt;br /&gt;
             s/&amp;amp;lt;/&amp;amp;amp;lt;/g;&lt;br /&gt;
             s/&amp;amp;gt;/&amp;amp;amp;gt;/g;&lt;br /&gt;
             s/&amp;lt;/&amp;amp;lt;/g;&lt;br /&gt;
             s/&amp;gt;/&amp;amp;gt;/g;&lt;br /&gt;
             print;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
      Perl Debugger is very useful for testing commands and works like an interpreter, just&lt;br /&gt;
      like python. So to get into the Perl Debugger execute the command below, &amp;quot;q&amp;quot; to quit.&lt;br /&gt;
&lt;br /&gt;
          $ perl -de 0&lt;br /&gt;
&lt;br /&gt;
      Reference TIP 170&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 147:&lt;br /&gt;
&lt;br /&gt;
      Shutdown&lt;br /&gt;
&lt;br /&gt;
          # shutdown 8:00 -- Shutdown at 8:00&lt;br /&gt;
&lt;br /&gt;
          # shutdown +13  -- Shutdown after 13min&lt;br /&gt;
&lt;br /&gt;
          # shutdown -r now  -- Shutdown now and restart&lt;br /&gt;
&lt;br /&gt;
          # shutdown -k +2  -- &amp;quot;The system is going DOWN to maintenance mode in 2 minutes!&amp;quot;&lt;br /&gt;
                              The above is only a warning.&lt;br /&gt;
&lt;br /&gt;
          # shutdown -h now   -- Shutdown now and halt&lt;br /&gt;
&lt;br /&gt;
          # shutdown -c    -- Cancel shutdown&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 148:&lt;br /&gt;
&lt;br /&gt;
      ac -  print statistics about users connect time&lt;br /&gt;
&lt;br /&gt;
          $ ac -p    -- print hour usage by user (individual)&lt;br /&gt;
          $ ac -dy   -- print daily usage&lt;br /&gt;
&lt;br /&gt;
       Options can also be combined&lt;br /&gt;
&lt;br /&gt;
          $ ac -dyp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 149:&lt;br /&gt;
&lt;br /&gt;
      Smart Monitoring Tools:&lt;br /&gt;
      Disk failing? Or want to know the temperature of your hard-drive?&lt;br /&gt;
&lt;br /&gt;
         http://smartmontools.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
      For a good, quick tutorial, see the Linux Journal article&lt;br /&gt;
        http://www.linuxjournal.com/article/6983&lt;br /&gt;
&lt;br /&gt;
      Below are some common commands:&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -i /dev/hda&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -Hc /dev/hda&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -A /dev/hda&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 150:&lt;br /&gt;
&lt;br /&gt;
      Monitor dhcp trafic - dhcpdump and tcpdump.&lt;br /&gt;
&lt;br /&gt;
      Download dhcpdump&lt;br /&gt;
&lt;br /&gt;
         $ wget  http://voxel.dl.sourceforge.net/sourceforge/mavetju/dhcpdump-1.5.tar.gz&lt;br /&gt;
         $ ./configure&lt;br /&gt;
         $ make &amp;amp;&amp;amp; make install&lt;br /&gt;
&lt;br /&gt;
     Once it's installed, you can monitor all dhcp traffic as follows, if done with root.&lt;br /&gt;
&lt;br /&gt;
         $ tcpdump -lenx -i eth0 -s 1500 port bootps or port bootpc| dhcpdump&lt;br /&gt;
&lt;br /&gt;
     The above assumes you are using eth0 (ethernet port 0).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 151:&lt;br /&gt;
&lt;br /&gt;
      Breaking Firewalls with ssh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      A sample .ssh/config file (note this must have chmod 600 rights)&lt;br /&gt;
&lt;br /&gt;
           ## Server1 ##&lt;br /&gt;
           Host 130.21.19.227&lt;br /&gt;
               LocalForward 20000 192.168.0.66:80&lt;br /&gt;
               LocalForward 22000 192.168.0.66:22&lt;br /&gt;
&lt;br /&gt;
      With the above &amp;quot;~/.ssh/config&amp;quot; file, after sshing into 130.21.19.227 it&lt;br /&gt;
      is then possible to ssh into nearby computers directly.&lt;br /&gt;
&lt;br /&gt;
         $ ssh -l mchirico 130.21.19.227&lt;br /&gt;
         $ scp -P 22000 authorized_keys* mchirico@localhost:.&lt;br /&gt;
         $ ssh -l mchirico localhost -p 22000&lt;br /&gt;
&lt;br /&gt;
      For the complete article reference the following link:&lt;br /&gt;
        http://souptonuts.sourceforge.net/sshtips.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 152:&lt;br /&gt;
&lt;br /&gt;
      Renaming files - suppose you want to rename all the &amp;quot;.htm&amp;quot; files to &amp;quot;.html&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          $ rename .htm .html *.htm&lt;br /&gt;
&lt;br /&gt;
      Or, suppose you files file1, file2, file3 ...&lt;br /&gt;
&lt;br /&gt;
          $ touch file1 file2 file3 file4 file5 file6&lt;br /&gt;
          $ rename file file. file*&lt;br /&gt;
&lt;br /&gt;
      The above command will give you &amp;quot;file.1&amp;quot;, &amp;quot;file.2&amp;quot; ... &amp;quot;file.6&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 153:&lt;br /&gt;
&lt;br /&gt;
      Renaming files with Perl - this is taken from &amp;quot;Programming Perl 3rd Edition&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          # rename - change filenames&lt;br /&gt;
          $op = shift;&lt;br /&gt;
          for (@ARGV) {&lt;br /&gt;
              $was = $_;&lt;br /&gt;
              eval $op;&lt;br /&gt;
              die if $@;&lt;br /&gt;
              # next line calls built-in function, not the script&lt;br /&gt;
              rename($was,$_) unless $was eq $_;&lt;br /&gt;
           }&lt;br /&gt;
&lt;br /&gt;
      The above Perl program can be used as follows:&lt;br /&gt;
&lt;br /&gt;
           $ rename 's/\.orig$//'    *.orig&lt;br /&gt;
           $ rename 'y/A-Z/a-z/ unless /^Make/' *&lt;br /&gt;
&lt;br /&gt;
      Also reference:&lt;br /&gt;
           http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 154:&lt;br /&gt;
&lt;br /&gt;
      R project (http://www.r-project.org)&lt;br /&gt;
&lt;br /&gt;
      To start R, just type &amp;quot;R&amp;quot; at the command prompt and &amp;quot;q()&amp;quot; to quit. Below&lt;br /&gt;
      2 is raised to powers 0 through 6 and thrown into an array.&lt;br /&gt;
&lt;br /&gt;
           $ R&lt;br /&gt;
           &amp;gt; N &amp;lt;- 2^(0:6)&lt;br /&gt;
           &amp;gt; N&lt;br /&gt;
           [1]  1  2  4  8 16 32 64&lt;br /&gt;
           &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      There is a summary summary() command.&lt;br /&gt;
&lt;br /&gt;
           &amp;gt; summary(N)&lt;br /&gt;
           Min. 1st Qu.  Median    Mean 3rd Qu.    Max.&lt;br /&gt;
           1.00    3.00    8.00   18.14   24.00   64.00&lt;br /&gt;
&lt;br /&gt;
      Note that the array begins as 1 and not 0&lt;br /&gt;
&lt;br /&gt;
           &amp;gt; N[1:3]&lt;br /&gt;
           [1] 1 2 4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 155:&lt;br /&gt;
&lt;br /&gt;
      ls - listing files by size, with the biggest file listed last&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           $ ls --sort=size -lhr&lt;br /&gt;
&lt;br /&gt;
      The above command sorts files by size, listing the contents in&lt;br /&gt;
      &amp;quot;h&amp;quot; human readable format in reverse order.&lt;br /&gt;
&lt;br /&gt;
      Note the options:  --sort={none,time,size,extension}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 156:&lt;br /&gt;
&lt;br /&gt;
     Perl - program to clean up old versions of files&lt;br /&gt;
&lt;br /&gt;
       #!/usr/bin/perl&lt;br /&gt;
       #   Copyright (c) GPL 2005 Mike Chirico&lt;br /&gt;
       # This program deletes old files from several directories&lt;br /&gt;
       # and within each directory there must be x number of copies&lt;br /&gt;
       # each y number of bytes&lt;br /&gt;
       #&lt;br /&gt;
&lt;br /&gt;
       sub delete_old_ones {&lt;br /&gt;
           $directory_and_file=$_[0];&lt;br /&gt;
           $save_count=$_[1];&lt;br /&gt;
           $bytes_in_file=$_[2];&lt;br /&gt;
         # Don't change setting here of '-lt'&lt;br /&gt;
           $pid = open $readme, &amp;quot;ls -lt $directory_and_file|&amp;quot; or die &amp;quot;Could not execute\n&amp;quot;;&lt;br /&gt;
           while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
               my @fields = split;&lt;br /&gt;
              # Make sure we have $save_count good ones with data&lt;br /&gt;
               if ($fields[4] &amp;gt; $bytes_in_file &amp;amp;&amp;amp; $save_count &amp;gt; 0) {&lt;br /&gt;
                   $save_count--;&lt;br /&gt;
                   print &amp;quot;Kept files: $fields[4] $fields[8]\n&amp;quot;;&lt;br /&gt;
               }&lt;br /&gt;
              # delete the old ones&lt;br /&gt;
              if ($save_count &amp;lt;= 0 )&lt;br /&gt;
              {&lt;br /&gt;
                  print &amp;quot;Deleted files: $fields[4] $fields[8]\n&amp;quot;;&lt;br /&gt;
                  unlink $fields[8];&lt;br /&gt;
              }&lt;br /&gt;
           }&lt;br /&gt;
           close $readme;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       @AofA = (&lt;br /&gt;
          [ &amp;quot;/home/cvs/backups/*.gz&amp;quot;, &amp;quot;6&amp;quot;,196621 ],&lt;br /&gt;
          [ &amp;quot;/home/mail/backups/*.gz&amp;quot;,&amp;quot;5&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/snort/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/server1/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/actserver/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/server2/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
                );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       foreach( @AofA ) {&lt;br /&gt;
           &amp;amp;delete_old_ones($_-&amp;gt;[0],$_-&amp;gt;[1],$_-&amp;gt;[2]);&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
     Reference TIP 170 and the following link:&lt;br /&gt;
       http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 157:&lt;br /&gt;
&lt;br /&gt;
     Graphics and Visualization Software that runs on Linux&lt;br /&gt;
        http://www.tldp.org/HOWTO/Scientific-Computing-with-GNU-Linux/graphvis.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 158:&lt;br /&gt;
&lt;br /&gt;
     Keeping files in sync going both ways. Unlike rsync, this is not a one way mirror&lt;br /&gt;
     option.&lt;br /&gt;
&lt;br /&gt;
     You will need ocaml installed first.&lt;br /&gt;
&lt;br /&gt;
       $ wget http://caml.inria.fr/pub/distrib/ocaml-3.08/ocaml-3.08.3.tar.gz&lt;br /&gt;
       $ tar -xzf ocaml-3.08.3.tar.gz&lt;br /&gt;
       $ cd ocaml-3.08.3&lt;br /&gt;
&lt;br /&gt;
       $ ./configure&lt;br /&gt;
       $ make world&lt;br /&gt;
       $ make opt&lt;br /&gt;
       $ make install&lt;br /&gt;
&lt;br /&gt;
     Next, get unison and put it in a different directory.&lt;br /&gt;
     [http://www.cis.upenn.edu/~bcpierce/unison/]&lt;br /&gt;
&lt;br /&gt;
       $ wget http://www.cis.upenn.edu/~bcpierce/unison/download/stable/latest/unison-2.10.2.tar.gz&lt;br /&gt;
       $ tar -xzf unison-2.10.2.tar.gz&lt;br /&gt;
       $ cd unison-2.10.2&lt;br /&gt;
       $ make UISTYLE=text&lt;br /&gt;
       $ su&lt;br /&gt;
       # cp unison /usr/local/bin/.&lt;br /&gt;
&lt;br /&gt;
     Note, you have to copy the file manually.&lt;br /&gt;
&lt;br /&gt;
     See the following article [http://www.linuxjournal.com/article/7712]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 159:&lt;br /&gt;
&lt;br /&gt;
     Dump ext2/ext3 filesystem information with &amp;quot;dumpe2fs&amp;quot;. Perform the mount command&lt;br /&gt;
     and query away.&lt;br /&gt;
&lt;br /&gt;
       $ dumpe2fs /dev/sda1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 160:&lt;br /&gt;
&lt;br /&gt;
     sysreport - a script that generates an HTML report on the system configuration. It&lt;br /&gt;
     gathers information about the hardware and is somewhat redhat specific. The utility&lt;br /&gt;
     should be run as root.&lt;br /&gt;
&lt;br /&gt;
       $ /usr/sbin/sysreport&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 161:&lt;br /&gt;
&lt;br /&gt;
     Key Bindings Using bind.  You can bind, say, ctl-t to a command.&lt;br /&gt;
&lt;br /&gt;
     Add the following to you &amp;quot;~/.inputrc&amp;quot; file, just as it is typed below with quotes.&lt;br /&gt;
&lt;br /&gt;
           &amp;quot;\C-t&amp;quot;: ls -l&lt;br /&gt;
&lt;br /&gt;
     Next, run the command&lt;br /&gt;
&lt;br /&gt;
           $ bind -f .inputrc&lt;br /&gt;
&lt;br /&gt;
     Or, you can do everything on the command line; however, it won't be there the next time&lt;br /&gt;
     you log in. Below is the way to do everything on the command line.&lt;br /&gt;
&lt;br /&gt;
           $ bind -x '&amp;quot;\C-t&amp;quot;:ls -l'&lt;br /&gt;
&lt;br /&gt;
     To unbind use the &amp;quot;-r&amp;quot; option. Single quotes are not needed.&lt;br /&gt;
&lt;br /&gt;
           $ bind -r &amp;quot;\C-t&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Getting a list of all bindings can be done as follows, and not this can be redirected&lt;br /&gt;
     to the &amp;quot;.inputrc&amp;quot; file for further editing.&lt;br /&gt;
&lt;br /&gt;
           $ bind -p &amp;gt; .inputrc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 162:&lt;br /&gt;
&lt;br /&gt;
     awk - common awk commands.&lt;br /&gt;
&lt;br /&gt;
     Find device names &amp;quot;sd&amp;quot; or with major number 4 and device name &amp;quot;tty&amp;quot;. Print the&lt;br /&gt;
     record number NR, plus the major number and minor number.&lt;br /&gt;
&lt;br /&gt;
          $ awk '$2 == &amp;quot;sd&amp;quot;||$1 == 4 &amp;amp;&amp;amp; $2 == &amp;quot;tty&amp;quot; { print NR,$1,$2}' /proc/devices&lt;br /&gt;
&lt;br /&gt;
     Find device name equal to &amp;quot;sound&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ awk '/sound/{print NR,$1,$2}' /proc/devices&lt;br /&gt;
&lt;br /&gt;
     Print the 5th record, first field, in file test&lt;br /&gt;
&lt;br /&gt;
          $ awk 'NR==5{print $1}' test&lt;br /&gt;
&lt;br /&gt;
     Print a record, skip 4 records, print a record etc from file1&lt;br /&gt;
&lt;br /&gt;
          $ awk '(NR-1) % 4 == 0 {print $1}' file1&lt;br /&gt;
&lt;br /&gt;
     Print all records except the last one from file1&lt;br /&gt;
&lt;br /&gt;
          $ tac file1|awk 'NR &amp;gt; 1 {print $0}'|tac&lt;br /&gt;
&lt;br /&gt;
     Print A,B,C ..Z on each line, cycling back to A if greater than 26 lines&lt;br /&gt;
&lt;br /&gt;
          $ awk '{ print substr(&amp;quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&amp;quot;,(NR-1)%26+1,1),$0}' file1&lt;br /&gt;
&lt;br /&gt;
     Number of bytes in a directory.&lt;br /&gt;
&lt;br /&gt;
          $ ls -l|awk 'BEGIN{ c=0}{ c+=$5} END{ print c}'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 163:&lt;br /&gt;
&lt;br /&gt;
     Configuring Remote Logging.  If you have several servers on 192.168.1.0, you can setup remote logging&lt;br /&gt;
     as follows.&lt;br /&gt;
&lt;br /&gt;
     MAIN LOG SERVER (192.168.1.81):&lt;br /&gt;
&lt;br /&gt;
        Firewall - allow UDP port 514 on the main server that will receive the logs.&lt;br /&gt;
&lt;br /&gt;
          $ iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 514 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        Edit &amp;quot;/etc/sysconfig/syslog&amp;quot; and add the &amp;quot;-r&amp;quot; option to SYSLOGD_OPTIONS as shown below.&lt;br /&gt;
&lt;br /&gt;
          SYSLOGD_OPTIONS=&amp;quot;-r -m -0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Note, the &amp;quot;-r&amp;quot; is to allow remote logging and  &amp;quot;-m 0&amp;quot; specifies that that the syslog process should&lt;br /&gt;
        not write regular timestamps.  I prefer to only write timestamps for the clients.&lt;br /&gt;
&lt;br /&gt;
        Next, restart the logging process&lt;br /&gt;
&lt;br /&gt;
          $ service syslog restart&lt;br /&gt;
&lt;br /&gt;
     CLIENT LOG SERVER:&lt;br /&gt;
&lt;br /&gt;
        Edit &amp;quot;/etc/syslog.conf&amp;quot; and add the ip address of the log server, or put in the hostname.&lt;br /&gt;
&lt;br /&gt;
            *.* @192.168.1.81&lt;br /&gt;
&lt;br /&gt;
        Next, restart the logging process&lt;br /&gt;
&lt;br /&gt;
          $ service syslog restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 164:&lt;br /&gt;
&lt;br /&gt;
     kudzu - hardware on your system. To probe the hardware on your system without doing&lt;br /&gt;
             anything, issue the following command.&lt;br /&gt;
&lt;br /&gt;
          $ kudzu -p&lt;br /&gt;
&lt;br /&gt;
      But wait, a lot of this information is already recorded in the following file&lt;br /&gt;
&lt;br /&gt;
            /etc/sysconfig/hwconf&lt;br /&gt;
&lt;br /&gt;
      You can also use lspci to list all PCI devices.&lt;br /&gt;
&lt;br /&gt;
          $ lspci&lt;br /&gt;
&lt;br /&gt;
      Also, take a look at the script /etc/sbin/sysreport, since this script has a lot of&lt;br /&gt;
      info gathering commands. You can pick and choose what you want, or run the complete&lt;br /&gt;
      report.&lt;br /&gt;
&lt;br /&gt;
      If you just want information on the NIC&lt;br /&gt;
&lt;br /&gt;
          $ ip link show eth0&lt;br /&gt;
          2: eth0: &amp;lt;BROADCAST,MULTICAST,UP&amp;gt; mtu 1500 qdisc pfifo_fast qlen 1000&lt;br /&gt;
          link/ether 00:11:11:8a:be:3f brd ff:ff:ff:ff:ff:ff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 165:&lt;br /&gt;
&lt;br /&gt;
     cfengine - a very power agent for monitoring and administrating both a single computer&lt;br /&gt;
              and or multiple computers. [ http://www.cfengine.org/ ]&lt;br /&gt;
&lt;br /&gt;
     The following is a quick example on downloading and installing cfengine.&lt;br /&gt;
&lt;br /&gt;
          $ ncftpget ftp://ftp.iu.hio.no/pub/cfengine/cfengine-2.1.15.tar.gz&lt;br /&gt;
          $ md5sum cfengine-2.1.15.tar.gz&lt;br /&gt;
          f03de82709f84c3d6d916b6e557321f9  cfengine-2.1.15.tar.gz&lt;br /&gt;
&lt;br /&gt;
          $ tar -xzf cfengine-2.1.15.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You need to have a current version of BerkeleyDB (http://downloads.sleepycat.com/db-4.3.28.tar.gz).&lt;br /&gt;
     Note that BerkeleyDB has a funny install. You cd to the &amp;quot;build_unix&amp;quot; directory, then,&lt;br /&gt;
&lt;br /&gt;
          Installing BerkeleyDB if needed:&lt;br /&gt;
                 $ wget http://downloads.sleepycat.com/db-4.3.28.tar.gz&lt;br /&gt;
                 $ tar -xzf db-4.3.28.tar.gz&lt;br /&gt;
                 $ cd db-4.3.28/build_unix/&lt;br /&gt;
                 $ ../dist/configure&lt;br /&gt;
                 make&lt;br /&gt;
                 make install&lt;br /&gt;
&lt;br /&gt;
     You also need a current version of OpenSSL. For instructions on how to install OpenSSL see&lt;br /&gt;
     (http://souptonuts.sourceforge.net/postfix_tutorial.html).&lt;br /&gt;
&lt;br /&gt;
     See (TIP 49) on putting &amp;quot;/usr/local/BerkeleyDB.4.3/lib&amp;quot; in the &amp;quot;/etc/ld.so.conf&amp;quot; file. Or&lt;br /&gt;
     once BerkeleyDB is installed, you can put the location on the command line as follows:&lt;br /&gt;
&lt;br /&gt;
     Configuring cfengine with direct reference to BerkeleyDB.4.3.  First cd to the cfengine source.&lt;br /&gt;
&lt;br /&gt;
          $ ./configure --with-berkeleydb=/usr/local/BerkeleyDB.4.3/lib&lt;br /&gt;
          $ make&lt;br /&gt;
          $ make install&lt;br /&gt;
&lt;br /&gt;
     Next create the following directories:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /var/cfengine/bin&lt;br /&gt;
          $ mkdir -p /var/cfengine/inputs&lt;br /&gt;
&lt;br /&gt;
     Copy needed files (cfagent, cfdoc, cfenvd, cfenvgraph, cfexecd, cfkey, cfrun, cfservd, cfshow):&lt;br /&gt;
&lt;br /&gt;
          $ cp /usr/local/sbin/cf* /var/cfengine/bin&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You'll also need to generate keys. As root, execute the following:&lt;br /&gt;
&lt;br /&gt;
          $ cfkey&lt;br /&gt;
&lt;br /&gt;
     The command above will write the public and private keys in&lt;br /&gt;
     &amp;quot;/var/cfengine/ppkeys&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You probably want (cfexecd, cfservd, and cfenvd) running on all servers. If you&lt;br /&gt;
     add the following to &amp;quot;/etc/rc.local&amp;quot; these daemons will start on reboot.&lt;br /&gt;
&lt;br /&gt;
           # Lines in /etc/rc.local&lt;br /&gt;
           /usr/local/sbin/cfexecd&lt;br /&gt;
           /usr/local/sbin/cfservd&lt;br /&gt;
           /usr/local/sbin/cfenvd&lt;br /&gt;
&lt;br /&gt;
     Also, make sure you run each command now as follows:&lt;br /&gt;
&lt;br /&gt;
          $ /usr/local/sbin/cfexecd&lt;br /&gt;
          $ /usr/local/sbin/cfservd&lt;br /&gt;
          $ /usr/local/sbin/cfenvd&lt;br /&gt;
&lt;br /&gt;
     Firewall settings must be adjusted to allows 5308 for tcp/udp. My local network&lt;br /&gt;
     is 192.168.1.0, so I'm opening it up for all my computers.&lt;br /&gt;
&lt;br /&gt;
          $ iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 5308 -j ACCEPT&lt;br /&gt;
          $ iptables -A INPUT -p tcp -s 192.168.1.0/24  --dport 5308 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
     A set of keys needs to be on the server and hosts. For example, my key on &amp;quot;tape.squeezel.com&amp;quot;&lt;br /&gt;
     should be copied over to the server &amp;quot;squeezel.squeezel.com&amp;quot; as follows:&lt;br /&gt;
&lt;br /&gt;
     This is done from tape.squeezel.com&lt;br /&gt;
&lt;br /&gt;
          $ scp /var/cfengine/ppkeys/localhost.pub  root@squeezel.squeezel.com:/var/cfengine/ppkeys/root-tape.squeezel.com.pub&lt;br /&gt;
          $ scp root@squeezel.squeezel.com:/var/cfengine/ppkeys/localhost.pub /var/cfengine/ppkeys/root-squeezel.squeezel.com.pub&lt;br /&gt;
&lt;br /&gt;
     Also, &amp;quot;/var/cfengine/inputs/cfrun.hosts&amp;quot; on the server &amp;quot;squeezel.squeezel.com&amp;quot; must contain&lt;br /&gt;
     all the computers that will get updated. This is &amp;quot;cfrun.hosts&amp;quot; on &amp;quot;squeezel.squeezel.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          closet.squeezel.com&lt;br /&gt;
          tape.squeezel.com&lt;br /&gt;
&lt;br /&gt;
     Once I'm done, from &amp;quot;tape.squeezel.com&amp;quot; I can run the following test:&lt;br /&gt;
&lt;br /&gt;
          $ cfrun squeezel.squeezel.com -v&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 166:&lt;br /&gt;
&lt;br /&gt;
     cfengine - a quick example. This example will be run as root. You create the file &amp;quot;cfagent.conf&amp;quot; in&lt;br /&gt;
     &amp;quot;/var/cfengine/inputs/&amp;quot;. The example below will checksum all the files in /home/chirico/deleteme/tripwire,&lt;br /&gt;
     it will also comment out the line &amp;quot;finger&amp;quot; in any file located in /tmp/testdir/stuff, also appending&lt;br /&gt;
     the command in this file &amp;quot; Edit change with cfengine&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          # /var/cfengine/inputs/cfagent.conf&lt;br /&gt;
          #&lt;br /&gt;
          # You run this with the following:&lt;br /&gt;
          #   cfagent -vK&lt;br /&gt;
        &lt;br /&gt;
          control:&lt;br /&gt;
                 actionsequence = ( files tidy editfiles )&lt;br /&gt;
                 ChecksumDatabase = ( /var/cfengine/cache.db )&lt;br /&gt;
                 # Below, true to update md5&lt;br /&gt;
                 ChecksumUpdates = ( true )&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
          files:&lt;br /&gt;
                 /home/chirico/deleteme/tripwire checksum=md5 recurse=inf&lt;br /&gt;
                 /home/chirico/deleteme/tripwire/moredata checksum=md5 recurse=inf&lt;br /&gt;
                 #/home/chirico/deleteme/tripwire/compress  recurse=inf include=*.txt acti on=compress&lt;br /&gt;
                   # If the database isn't secure, nothing is secure...&lt;br /&gt;
                 /var/cfengine/cache.db  mode=600 owner=root action=fixall&lt;br /&gt;
        &lt;br /&gt;
          tidy:&lt;br /&gt;
                 /home/chirico/deleteme/tripwire pattern=*~ recurse=inf age=0&lt;br /&gt;
                 # You must put an age. 0 runs now.&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
          editfiles:&lt;br /&gt;
        &lt;br /&gt;
                {  /tmp/testdir/stuff&lt;br /&gt;
&lt;br /&gt;
                   HashCommentLinesContaining &amp;quot;finger&amp;quot;&lt;br /&gt;
                   AppendIfNoSuchLine &amp;quot;# Edit Change with cfengine &amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     A few further notes on the above. The command &amp;quot;actionsequence = ( files tidy editfiles) tells the order&lt;br /&gt;
     of what to execute. The heading &amp;quot;tidy:&amp;quot; deletes files, and of course, &amp;quot;editfiles&amp;quot; does the editing of files.&lt;br /&gt;
&lt;br /&gt;
     To run the example, execute the following command. The  &amp;quot;-K&amp;quot; causes the lock file to be ignored.&lt;br /&gt;
&lt;br /&gt;
            $ cfagent -vK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 167:&lt;br /&gt;
&lt;br /&gt;
     Implementing Disk Quotas - a quick example that can easily be done on a live system for testing. There&lt;br /&gt;
     is no need to reboot, since you'll be creating a virtual filesystem.&lt;br /&gt;
&lt;br /&gt;
     Do the following as root. First create a mount point.&lt;br /&gt;
&lt;br /&gt;
            # mkdir -p /quota&lt;br /&gt;
&lt;br /&gt;
     Next, create 20M file. Since I have many of these files, I created a special directory &amp;quot;/usr/disk-img&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            # mkdir -p /usr/disk-img&lt;br /&gt;
            # dd if=/dev/zero of=/usr/disk-img/disk-quota.ext3 count=40960&lt;br /&gt;
&lt;br /&gt;
     The dd command above create a 20 MB file because, by default, dd uses a block size of 512 bytes. That makes&lt;br /&gt;
     the size: 40960*512=20971520.&lt;br /&gt;
&lt;br /&gt;
     Next, format this as an ext3 filesystem&lt;br /&gt;
&lt;br /&gt;
            # /sbin/mkfs -t ext3 -q /usr/disk-img/disk-quota.ext3 -F&lt;br /&gt;
&lt;br /&gt;
     Add the following line to &amp;quot;/etc/fstab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            /usr/disk-img/disk-quota.ext3    /quota ext3    rw,loop,usrquota,grpquota  0 0&lt;br /&gt;
&lt;br /&gt;
     Now, mount this filesystem&lt;br /&gt;
&lt;br /&gt;
            # mount /quota&lt;br /&gt;
&lt;br /&gt;
     Take a look at it:&lt;br /&gt;
&lt;br /&gt;
            # ls -l /quota&lt;br /&gt;
            lost+found&lt;br /&gt;
&lt;br /&gt;
     Now, run &amp;quot;quotacheck&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            # quotacheck -vug /quota&lt;br /&gt;
&lt;br /&gt;
     You'll get errors the first time this is run, because you have no quota files.&lt;br /&gt;
     But, run it a second time and you'll see something similiar to the following:&lt;br /&gt;
&lt;br /&gt;
            # quotacheck -vug /quota&lt;br /&gt;
            quotacheck: Scanning /dev/loop2 [/quota] done&lt;br /&gt;
            quotacheck: Checked 3 directories and 4 files&lt;br /&gt;
&lt;br /&gt;
     Now take a look at the files:&lt;br /&gt;
&lt;br /&gt;
            # ls -l /quota&lt;br /&gt;
            total 26&lt;br /&gt;
            -rw-------  1 root root  6144 Jun 14 12:23 aquota.group&lt;br /&gt;
            -rw-------  1 root root  6144 Jun 14 12:23 aquota.user&lt;br /&gt;
            drwx------  2 root root 12288 Jun 14 12:18 lost+found&lt;br /&gt;
&lt;br /&gt;
     Next use &amp;quot;edquota&amp;quot; to grant the user &amp;quot;chirico&amp;quot; a certain quota&lt;br /&gt;
&lt;br /&gt;
            # edquota -f /quota chirico&lt;br /&gt;
&lt;br /&gt;
     This will bring up a menu, and here I have edited so that user &amp;quot;chirico&amp;quot;&lt;br /&gt;
     has a soft limit of 120*512=61K, and a soft limit of 2 inodes and a hard limit of 5.&lt;br /&gt;
&lt;br /&gt;
             Disk quotas for user chirico (uid 500):&lt;br /&gt;
             Filesystem                   blocks       soft       hard     inodes     soft     hard&lt;br /&gt;
             /dev/loop2                        2        120        150         1        2         3&lt;br /&gt;
&lt;br /&gt;
     Next, turn quotas on with the following command:&lt;br /&gt;
&lt;br /&gt;
             $ quotaon /quota&lt;br /&gt;
&lt;br /&gt;
     If you need to turn off quotas, the command is &amp;quot;quotaoff -a&amp;quot; for all filesystems. You'll run into&lt;br /&gt;
     errors if you try to run quotacheck, say &amp;quot;quotacheck -avug&amp;quot; because this tries to unmount and mount&lt;br /&gt;
     the filesystem. You need to turn off quotas first &amp;quot;quotaoff /quota&amp;quot;. Note you only need to run&lt;br /&gt;
     quotacheck once, or when doing maintenance after a system crash.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      To get a report on the quote, runn &amp;quot;repquota&amp;quot; as follows:&lt;br /&gt;
&lt;br /&gt;
           $ repquota /quota&lt;br /&gt;
            *** Report for user quotas on device /dev/loop0&lt;br /&gt;
            Block grace time: 7days; Inode grace time: 7days&lt;br /&gt;
                                    Block limits                File limits&lt;br /&gt;
            User            used    soft    hard  grace    used  soft  hard  grace&lt;br /&gt;
            ----------------------------------------------------------------------&lt;br /&gt;
            root      --    1189       0       0              2     0     0&lt;br /&gt;
            chirico   -+      93       0       0              4     2     5  6days&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Note above that user &amp;quot;chirico&amp;quot; has used 4 on the file limits. This user has a hard&lt;br /&gt;
      limit of 5. So when this user tries to create 2 more files (bring this over the limit of 5)&lt;br /&gt;
      then he will get the following error as demonstrated below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           [chirico@squeezel chirico]$ touch one&lt;br /&gt;
           [chirico@squeezel chirico]$ touch two&lt;br /&gt;
           loop0: write failed, user file limit reached.&lt;br /&gt;
           touch: cannot touch `two': Disk quota exceeded&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Now, if repquota (run by root) is executed it shows the following:&lt;br /&gt;
&lt;br /&gt;
           $ repquota /quota&lt;br /&gt;
           *** Report for user quotas on device /dev/loop0&lt;br /&gt;
           Block grace time: 7days; Inode grace time: 7days&lt;br /&gt;
                                   Block limits                File limits&lt;br /&gt;
           User            used    soft    hard  grace    used  soft  hard  grace&lt;br /&gt;
           ----------------------------------------------------------------------&lt;br /&gt;
           root      --    1189       0       0              2     0     0&lt;br /&gt;
           chirico   -+      94       0       0              5     2     5  6days&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Note the &amp;quot;+&amp;quot; sign above. User &amp;quot;chirico&amp;quot; is above the File soft limits, and in this case&lt;br /&gt;
      above the hard limits.&lt;br /&gt;
&lt;br /&gt;
      To warn user by sending email to them, run &amp;quot;warnquota&amp;quot;, but you need check that&lt;br /&gt;
      &amp;quot;/etc/warnquota.conf&amp;quot; is setup correctly. For the example above, this file should&lt;br /&gt;
      look as follows:&lt;br /&gt;
&lt;br /&gt;
            $ cat /etc/quotatab&lt;br /&gt;
            #&lt;br /&gt;
            #  This is sample quotatab (/etc/quotatab)&lt;br /&gt;
            #  Here you can specify description of each device for user&lt;br /&gt;
            #&lt;br /&gt;
            #  Comments begin with hash in the beginning of the line&lt;br /&gt;
&lt;br /&gt;
            # Example of description&lt;br /&gt;
            /dev/loop0: This is loopback device&lt;br /&gt;
&lt;br /&gt;
      Just run the following as root:&lt;br /&gt;
&lt;br /&gt;
            $ warnquota&lt;br /&gt;
&lt;br /&gt;
      By the way, if you want to change the grace period, it can only be done on a filesystem&lt;br /&gt;
      basis. Not per user.&lt;br /&gt;
&lt;br /&gt;
            $  edquota -t&lt;br /&gt;
&lt;br /&gt;
      Users can run &amp;quot;quota&amp;quot; to see their usage as follows:&lt;br /&gt;
&lt;br /&gt;
            [chirico@squeezel ~]$ quota&lt;br /&gt;
            Disk quotas for user chirico (uid 500):&lt;br /&gt;
                 Filesystem  blocks   quota   limit   grace   files   quota   limit   grace&lt;br /&gt;
                 /dev/loop0      94       0       0               5      10      50&lt;br /&gt;
&lt;br /&gt;
      As you can see from above, I changed my inode limit to 50.&lt;br /&gt;
&lt;br /&gt;
      What about running this on the whole filesystem? Yes, below is an example where I'm running&lt;br /&gt;
      this on FC3, on the root of the filesystem &amp;quot;/&amp;quot;. This assumes that you have installed the&lt;br /&gt;
      quota package. Try doing &amp;quot;rpm -q quota&amp;quot; to see if this package is installed.&lt;br /&gt;
&lt;br /&gt;
        Step 1:&lt;br /&gt;
&lt;br /&gt;
           Check to make sure the quota software is installed. You can either do a &amp;quot;whereis quota&amp;quot;,&lt;br /&gt;
           or check for the rpm package.&lt;br /&gt;
&lt;br /&gt;
             $ whereis quota&lt;br /&gt;
             whereis quota&lt;br /&gt;
             quota: /usr/bin/quota /usr/share/man/man1/quota.1.gz&lt;br /&gt;
&lt;br /&gt;
           Checking for the rpm package.&lt;br /&gt;
&lt;br /&gt;
            $ rpm -q quota&lt;br /&gt;
            quota-3.12-5&lt;br /&gt;
&lt;br /&gt;
        Step 2:&lt;br /&gt;
&lt;br /&gt;
           Edit /etc/fstab and add usrquota and grpquota options for &amp;quot;/dev/VolGroup00/LogVol00&amp;quot;,&lt;br /&gt;
           which is shown on the first line below:&lt;br /&gt;
&lt;br /&gt;
             /dev/VolGroup00/LogVol00 /                      ext3    defaults,usrquota,grpquota        1 1&lt;br /&gt;
             LABEL=/boot             /boot                   ext3    defaults        1 2&lt;br /&gt;
             none                    /dev/pts                devpts  gid=5,mode=620  0 0&lt;br /&gt;
             none                    /dev/shm                tmpfs   defaults        0 0&lt;br /&gt;
             none                    /proc                   proc    defaults        0 0&lt;br /&gt;
             none                    /sys                    sysfs   defaults        0 0&lt;br /&gt;
             /dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0&lt;br /&gt;
&lt;br /&gt;
        Step 3:&lt;br /&gt;
&lt;br /&gt;
           Remount the filesystem as follows:&lt;br /&gt;
&lt;br /&gt;
             $ mount -o remount /&lt;br /&gt;
&lt;br /&gt;
        Step 4:&lt;br /&gt;
&lt;br /&gt;
           Run quotacheck with the &amp;quot;-m&amp;quot; option. Like the above statement, this will have to be run with&lt;br /&gt;
           root priviliges. This creates the quota database files, and it can take a long time if it is&lt;br /&gt;
           a large full filesystem.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             $ quotacheck -cugm /&lt;br /&gt;
&lt;br /&gt;
        Step 5:&lt;br /&gt;
&lt;br /&gt;
           This step is optional, but it's good to know if you need to recalculate quotas because of a&lt;br /&gt;
           system crash. It's demonstrated here, because at this point quota's have not been turned on.&lt;br /&gt;
           Again, note the &amp;quot;m&amp;quot; option below.&lt;br /&gt;
&lt;br /&gt;
             $ quotacheck -avumg&lt;br /&gt;
&lt;br /&gt;
        Step 6:&lt;br /&gt;
&lt;br /&gt;
           Set limits for specific users or groups using the &amp;quot;edquota&amp;quot; command. Shown below is the command&lt;br /&gt;
           to setup quotas for user &amp;quot;chirico&amp;quot;. Shown below this user has used 161560 blocks, he has a soft&lt;br /&gt;
           limit of 1161560 and a hard limit of 900000. He has used 3085 inodes and has a soft limit of 10000&lt;br /&gt;
           and a hard limit of 12000.&lt;br /&gt;
&lt;br /&gt;
             $ edquota -f / chirico&lt;br /&gt;
&lt;br /&gt;
             Disk quotas for user chirico (uid 500):&lt;br /&gt;
               Filesystem                   blocks       soft       hard     inodes     soft     hard&lt;br /&gt;
               /dev/mapper/VolGroup00-LogVol00     161560    1161560     900000       3085    10000    12000&lt;br /&gt;
&lt;br /&gt;
           You can put quotas on groups as well. The following is done as root. See (TIP 186 and TIP 6) for creating&lt;br /&gt;
           groups and adding users to groups.&lt;br /&gt;
&lt;br /&gt;
             $ edquota -g share&lt;br /&gt;
&lt;br /&gt;
           If you create a sharable directory for anyone in the group &amp;quot;share&amp;quot; (TIP 6), quota restrictions against&lt;br /&gt;
           group &amp;quot;share&amp;quot; will only apply to files added in the &amp;quot;/home/share&amp;quot; directory. When user &amp;quot;chirico&amp;quot; creates&lt;br /&gt;
           files in &amp;quot;/home/share&amp;quot; they also go against this user quota as well. However, when files are created in&lt;br /&gt;
           his home directory they do not go against the &amp;quot;share&amp;quot; group.&lt;br /&gt;
&lt;br /&gt;
           Note - if you get errors when trying to run &amp;quot;edquota -g share&amp;quot;, turn quotas off &amp;quot;quotaoff /&amp;quot; and&lt;br /&gt;
                  run &amp;quot;quotacheck -avugm&amp;quot;. Then, turn the quotas back on &amp;quot;quotaon /&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           You can see the status of the group quota with the following command:&lt;br /&gt;
&lt;br /&gt;
             $ quota -g share&lt;br /&gt;
&lt;br /&gt;
        Step 7:&lt;br /&gt;
&lt;br /&gt;
           Turn on quotas with the &amp;quot;qutoaon&amp;quot; command. This command needs to be done with root privileges.&lt;br /&gt;
&lt;br /&gt;
             $ quotaon /&lt;br /&gt;
&lt;br /&gt;
        Step 8:&lt;br /&gt;
&lt;br /&gt;
           Check &amp;quot;/etc/quotatab&amp;quot; file for the correct entries. Note that when you do the &amp;quot;mount&amp;quot; command&lt;br /&gt;
           the filesystem returned needs to match what is in the &amp;quot;quotatab&amp;quot; file. I have noticed that this&lt;br /&gt;
           is not the case by default.&lt;br /&gt;
&lt;br /&gt;
             $ mount&lt;br /&gt;
             /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw,usrquota,grpquota)&lt;br /&gt;
&lt;br /&gt;
           So the &amp;quot;/etc/quotatab&amp;quot; must contain the following line.&lt;br /&gt;
&lt;br /&gt;
             /dev/mapper/VolGroup00-LogVol00: This is the Volume group&lt;br /&gt;
&lt;br /&gt;
        Step 9:&lt;br /&gt;
&lt;br /&gt;
           Run &amp;quot;warnquota&amp;quot; as a check that the &amp;quot;/etc/quotatab&amp;quot; files is setup correctly.&lt;br /&gt;
&lt;br /&gt;
              $ warnquota&lt;br /&gt;
&lt;br /&gt;
        Step 10:&lt;br /&gt;
&lt;br /&gt;
           Setup a daily cron job for running &amp;quot;warnquota&amp;quot;. The following should be placed&lt;br /&gt;
           in &amp;quot;/etc/cron.daily&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              #!/bin/sh&lt;br /&gt;
              # Place this file in /etc/cron.daily&lt;br /&gt;
              # with rights 0755&lt;br /&gt;
              /usr/sbin/warnquota&lt;br /&gt;
              EXITVALUE=$?&lt;br /&gt;
              if [ $EXITVALUE != 0 ]; then&lt;br /&gt;
                 /usr/bin/logger -t warnquota &amp;quot;ALERT exited abnormally with [$EXITVALUE]&amp;quot;&lt;br /&gt;
              fi&lt;br /&gt;
              exit 0&lt;br /&gt;
&lt;br /&gt;
      References:&lt;br /&gt;
        http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/sysadmin-guide/ch-disk-quotas.html&lt;br /&gt;
        (TIP 6, TIP 186, and TIP 205)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 168:&lt;br /&gt;
&lt;br /&gt;
     rdist - remote file distribution client program. You can use this program in combination with&lt;br /&gt;
     ssh. This program does more than just copy files. Once a file has been copied, you can dictate&lt;br /&gt;
     other actions to be performed. Or you can hold off copying all together if the destination is&lt;br /&gt;
     running low on inodes, or disk space.&lt;br /&gt;
&lt;br /&gt;
     For the purpose of this example, all commands will been run on &amp;quot;squeezel.squeezel.com&amp;quot;, and the&lt;br /&gt;
     computers that will be updated are &amp;quot;tape.squeezel.com&amp;quot; and &amp;quot;closet.squeezel.com&amp;quot;. Obviously, you&lt;br /&gt;
     would substitute your computer names.&lt;br /&gt;
&lt;br /&gt;
     It helps to setup ssh keys on each computer first. Reference [http://souptonuts.sourceforge.net/sshtips.htm]&lt;br /&gt;
     and (TIP 12).&lt;br /&gt;
&lt;br /&gt;
     Step 1: Create the Configuration file myDistfile&lt;br /&gt;
&lt;br /&gt;
       Below is my sample &amp;quot;myDistfile&amp;quot;. This file will access hosts &amp;quot;tape.squeezel.com&amp;quot; using username chirico&lt;br /&gt;
       and &amp;quot;closet.squeezel.com&amp;quot; with the username running this command, and copy the&lt;br /&gt;
       files &amp;quot;/home/chirico/file1&amp;quot; and &amp;quot;/home/chirico/file2&amp;quot; to the these two servers creating the&lt;br /&gt;
       directory ~/tmpdir if it doesn't exist. Once these files are updated, a mail check (&amp;quot;sendmail -bv&amp;quot;)&lt;br /&gt;
       will be performed, and mail will be sent to &amp;quot;chirico@squeezel&amp;quot;. This happens twice, once for each file.&lt;br /&gt;
&lt;br /&gt;
       Note, the line &amp;quot;/home/chirico/file2 -&amp;gt; tape.squeezel.com&amp;quot; which moves the file &amp;quot;file2&amp;quot; to&lt;br /&gt;
       tape.squeezel.com renaming the file to &amp;quot;tapedest&amp;quot; in the directory &amp;quot;/home/chirico&amp;quot;. Once this file&lt;br /&gt;
       is copied, the rights are modified to &amp;quot;chmod +r&amp;quot;.  Likewise, &amp;quot;/home/chirico/file2 -&amp;gt; closet.squeezel.com&amp;quot;&lt;br /&gt;
       copies the file file2, which is renamed as closetdest.&lt;br /&gt;
&lt;br /&gt;
                 # Contents of myDistfile&lt;br /&gt;
                 HOSTS = ( chirico@tape.squeezel.com closet.squeezel.com )&lt;br /&gt;
&lt;br /&gt;
                 FILES = ( /home/chirico/file1 /home/chirico/file2 )&lt;br /&gt;
&lt;br /&gt;
                 ${FILES} -&amp;gt; ${HOSTS}&lt;br /&gt;
                    # Directory tmpdir will be created if it doesn't exist&lt;br /&gt;
                    install tmpdir ;&lt;br /&gt;
                    special /home/chirico/file1  &amp;quot;/usr/sbin/sendmail -bv mchirico@gmail.com&amp;quot;;&lt;br /&gt;
                    notify chirico@squeezel;&lt;br /&gt;
&lt;br /&gt;
                 /home/chirico/file2 -&amp;gt; tape.squeezel.com&lt;br /&gt;
                    install  /home/chirico/tapedest;&lt;br /&gt;
                    special  /home/chirico/tapedest &amp;quot;chmod +r /home/chirico/tapedest&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
                 /home/chirico/file2 -&amp;gt; closet.squeezel.com&lt;br /&gt;
                    install /home/chirico/closetdest;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 2: Command from squeezel.squeezel.com to run myDistfile above&lt;br /&gt;
&lt;br /&gt;
       Below is the command that will execute the contents in &amp;quot;myDistfile&amp;quot;. This command is run from the&lt;br /&gt;
       computer &amp;quot;squeezel.squeezel.com&amp;quot;. All output will go in the file &amp;quot;cmd1rdist.log&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ rdist -P /usr/local/bin/ssh -f ./myDistfile -l file=./cmd1rdist.log=all&lt;br /&gt;
&lt;br /&gt;
       Obviously you want a secure copy (using scp), so the -P option uses ssh as your secure&lt;br /&gt;
       transport mechanism.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 169:&lt;br /&gt;
&lt;br /&gt;
     Restricting root logins (/etc/securetty). ctl-alt-F4 will give you a prompt for tty3. Note&lt;br /&gt;
     that it is one number less. Take a look at the contents of &amp;quot;/etc/securetty&amp;quot;. To prevent&lt;br /&gt;
     root from logging in on this device, take out tty3 from this listing. Note, you can always&lt;br /&gt;
     login as another user, then, su to root.  Below is an example of the default&lt;br /&gt;
     &amp;quot;/etc/securetty&amp;quot; that allows root to login to everything.&lt;br /&gt;
&lt;br /&gt;
         [root@squeezel ~]# cat /etc/securetty&lt;br /&gt;
         console&lt;br /&gt;
         vc/1&lt;br /&gt;
         vc/2&lt;br /&gt;
         vc/3&lt;br /&gt;
         vc/4&lt;br /&gt;
         vc/5&lt;br /&gt;
         vc/6&lt;br /&gt;
         vc/7&lt;br /&gt;
         vc/8&lt;br /&gt;
         vc/9&lt;br /&gt;
         vc/10&lt;br /&gt;
         vc/11&lt;br /&gt;
         tty1&lt;br /&gt;
         tty2&lt;br /&gt;
         tty3&lt;br /&gt;
         tty4&lt;br /&gt;
         tty5&lt;br /&gt;
         tty6&lt;br /&gt;
         tty7&lt;br /&gt;
         tty8&lt;br /&gt;
         tty9&lt;br /&gt;
         tty10&lt;br /&gt;
         tty11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 170:&lt;br /&gt;
&lt;br /&gt;
     Perl map function. Try the following to get a quick take on this function,&lt;br /&gt;
     which increments each value in the array a;&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map {$_++} @a;&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot; } @a;&lt;br /&gt;
&lt;br /&gt;
     or&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     And you can easily make modifications, like reversing the order&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     Plus there is a grep() function that works on each element as well&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse grep{ $_ &amp;gt; 3} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     To get only odd numbers in reverse order:&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse grep{ !($_ % 2)} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference: http://www-128.ibm.com/developerworks/linux/library/l-road4.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 171:&lt;br /&gt;
&lt;br /&gt;
     Perl - subroutine call and shifting through variables. A simple and useful&lt;br /&gt;
     technique.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          sub test {&lt;br /&gt;
            local $mval;&lt;br /&gt;
            while( $mval = shift ) {&lt;br /&gt;
              print &amp;quot; $mval\n&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          test(&amp;quot;one&amp;quot;,&amp;quot;two&amp;quot;,&amp;quot;three&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 172:&lt;br /&gt;
&lt;br /&gt;
     Tcp wrappers - First &amp;quot;/etc/hosts.allow&amp;quot; is check, and if there is an entry in this file, no more&lt;br /&gt;
     checking it done.  If are no matches in &amp;quot;/etc/hosts.allow&amp;quot;, the &amp;quot;/etc/hosts.deny&amp;quot; file is checked&lt;br /&gt;
     and if a match is found, that service is blocked for that host.&lt;br /&gt;
&lt;br /&gt;
     Example &amp;quot;/etc/hosts.deny&amp;quot; file:&lt;br /&gt;
&lt;br /&gt;
         sshd: 192.168.1.171&lt;br /&gt;
&lt;br /&gt;
     The above file blocks access to computer 192.168.1.171. It's also possible to run commands when&lt;br /&gt;
     someone from this computer tries to ssh in. This example sends mail.&lt;br /&gt;
&lt;br /&gt;
         sshd: 192.168.1.171: spawn (echo -e &amp;quot;%d %h %H %u&amp;quot;| /bin/mail -s 'hosts.deny entry' root)&lt;br /&gt;
&lt;br /&gt;
     Of course, you can also run commands in the &amp;quot;/etc/hosts.allow&amp;quot; if you wanted mail sent for a successful&lt;br /&gt;
     login.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 173:&lt;br /&gt;
&lt;br /&gt;
     pgrep, pkill - look up or signal process based on name and other attributes.&lt;br /&gt;
&lt;br /&gt;
     To quick find all instances of ssh running, for user root, execute the following&lt;br /&gt;
     command:&lt;br /&gt;
&lt;br /&gt;
           $ pgrep -u root -l ssh&lt;br /&gt;
&lt;br /&gt;
     To kill a process, or send a signal use the &amp;quot;pkill&amp;quot; option. For example, to&lt;br /&gt;
     make syslog reread its configuration file:&lt;br /&gt;
&lt;br /&gt;
           $ pkill -HUP syslogd&lt;br /&gt;
&lt;br /&gt;
     Another command command is &amp;quot;pidof&amp;quot; that can tell you how many processes are running.&lt;br /&gt;
     This can be useful for detecting DOS attacks.&lt;br /&gt;
&lt;br /&gt;
           $ pidof sshd&lt;br /&gt;
           4783 4781 30008 30006 29888 29886 2246&lt;br /&gt;
&lt;br /&gt;
     Above there are 7 sshd's running. Reference &amp;quot;Tcpdump, Raw Socket and Libpap Tutorial&amp;quot;&lt;br /&gt;
     at [http://souptonuts.sourceforge.net/tcpdump_tutorial.html].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 174:&lt;br /&gt;
&lt;br /&gt;
     Password Cracking - tools to check your users passwords:&lt;br /&gt;
&lt;br /&gt;
      John The Ripper&lt;br /&gt;
        http://www.openwall.com/john/&lt;br /&gt;
&lt;br /&gt;
      Crack&lt;br /&gt;
        http://www.crypticide.com/users/alecm/&lt;br /&gt;
&lt;br /&gt;
      Slurpie&lt;br /&gt;
        http://www.ussrback.com/distributed.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 175:&lt;br /&gt;
&lt;br /&gt;
     Password Aging - setting the number of days a password is valid.&lt;br /&gt;
&lt;br /&gt;
         $ chage -M 90 &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 176:&lt;br /&gt;
&lt;br /&gt;
     Kernel Performance Tuning - /Documentation/sysctl/vm.txt documents kernel settings to&lt;br /&gt;
     improve performance. Below are some examples.&lt;br /&gt;
&lt;br /&gt;
       overcommit_memory:  0 -- default estimates the amount of memory for malloc&lt;br /&gt;
                           1 -- kernel pretends there is always enough memory until it runs out&lt;br /&gt;
                           3 -- never overcommit&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/overcommit_memory&lt;br /&gt;
          0&lt;br /&gt;
&lt;br /&gt;
       page-cluster:&lt;br /&gt;
            The Linux VM subsystem avoids excessive disk seeks by reading&lt;br /&gt;
            multiple pages on a page fault. The number of pages it reads&lt;br /&gt;
            is dependent on the amount of memory in your machine.&lt;br /&gt;
        &lt;br /&gt;
            The number of pages the kernel reads in at once is equal to&lt;br /&gt;
            2 ^ page-cluster. Values above 2 ^ 5 don't make much sense&lt;br /&gt;
            for swap because we only cluster swap data in 32-page groups.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/page-cluster&lt;br /&gt;
          3&lt;br /&gt;
&lt;br /&gt;
       min_free_kbytes:&lt;br /&gt;
            This is used to force the Linux VM to keep a minimum number&lt;br /&gt;
            of kilobytes free.  The VM uses this number to compute a pages_min&lt;br /&gt;
            value for each lowmem zone in the system.  Each lowmem zone gets&lt;br /&gt;
            a number of reserved free pages based proportionally on its size.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/min_free_kbytes&lt;br /&gt;
          3831&lt;br /&gt;
&lt;br /&gt;
       max_map_count:&lt;br /&gt;
            This file contains the maximum number of memory map areas a process&lt;br /&gt;
            may have. Memory map areas are used as a side-effect of calling&lt;br /&gt;
            malloc, directly by mmap and mprotect, and also when loading shared&lt;br /&gt;
            libraries.&lt;br /&gt;
&lt;br /&gt;
            While most applications need less than a thousand maps, certain&lt;br /&gt;
            programs, particularly malloc debuggers, may consume lots of them,&lt;br /&gt;
            e.g., up to one or two maps per allocation.&lt;br /&gt;
&lt;br /&gt;
            The default value is 65536.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/max_map_count&lt;br /&gt;
          65536&lt;br /&gt;
&lt;br /&gt;
        Also see http://people.redhat.com/alikins/system_tuning.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 177:&lt;br /&gt;
&lt;br /&gt;
     IO Scheduler - /Documentation/block/as-iosched.txt documents kernel settings for disk&lt;br /&gt;
     performance.&lt;br /&gt;
&lt;br /&gt;
     If you're not sure what partitions you have &amp;quot;$ cat /proc/partitions&amp;quot;. This example&lt;br /&gt;
     assumes hda, and you can see some of the kernel settings:&lt;br /&gt;
&lt;br /&gt;
          $ ls /sys/block/hda/queue/iosched&lt;br /&gt;
          back_seek_max  back_seek_penalty  clear_elapsed  fifo_batch_expire  fifo_expire_async&lt;br /&gt;
           fifo_expire_sync  find_best_crq  key_type  quantum  queued&lt;br /&gt;
&lt;br /&gt;
     References: http://lwn.net/Articles/102505/&lt;br /&gt;
                 http://bhhdoa.org.au/pipermail/ck/2004-September/000961.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 178:&lt;br /&gt;
&lt;br /&gt;
     iozone -- getting data on disk performance (http://www.iozone.org/). This is a very&lt;br /&gt;
     comprehensive package.&lt;br /&gt;
&lt;br /&gt;
           $ wget http://www.iozone.org/src/current/iozone3_242.tar&lt;br /&gt;
           $ tar -xf iozone3_242.tar&lt;br /&gt;
           $ cd iozone3_242/src/current&lt;br /&gt;
           $ make linux&lt;br /&gt;
&lt;br /&gt;
     At this point you should read the documentation. There is no &amp;quot;make install&amp;quot;. You&lt;br /&gt;
     copy it to each filesystem you want to run this program on. Below are some quick&lt;br /&gt;
     start commands.&lt;br /&gt;
&lt;br /&gt;
       Good comprehensive test.&lt;br /&gt;
&lt;br /&gt;
           $ iozone -a&lt;br /&gt;
&lt;br /&gt;
       I prefer this for small filesystems. It limits the record size to 10000 and does&lt;br /&gt;
       the output in operations per second (higher numbers mean faster drive).&lt;br /&gt;
&lt;br /&gt;
           $ ./iozone -a -s 10000 -O&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 179:&lt;br /&gt;
&lt;br /&gt;
     history - bash command to get a history of all commands typed. But, here is a way&lt;br /&gt;
     that you can get date and time listed as well.&lt;br /&gt;
&lt;br /&gt;
           $ HISTTIMEFORMAT=&amp;quot;%y/%m/%d %T &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Defining the environment variable above give you the date/time info when you&lt;br /&gt;
     execute history:&lt;br /&gt;
&lt;br /&gt;
           $ history&lt;br /&gt;
              ...&lt;br /&gt;
               175  05/06/30 12:51:46 grep '141.162.' mout &amp;gt; mout2&lt;br /&gt;
               176  05/06/30 12:51:48 e mout2&lt;br /&gt;
               177  05/06/30 12:56:59 ls&lt;br /&gt;
               178  05/06/30 12:57:02 ls&lt;br /&gt;
               179  05/06/30 12:57:39 ls&lt;br /&gt;
               180  05/06/30 12:57:49 ls -l&lt;br /&gt;
               181  05/06/30 13:01:10 history&lt;br /&gt;
               182  05/06/30 13:01:20 HISTTIMEFORMAT=&amp;quot;%y/%m/%d %T &amp;quot;&lt;br /&gt;
               183  05/06/30 13:01:23 history&lt;br /&gt;
              ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 180:&lt;br /&gt;
&lt;br /&gt;
     .config - Fedora Core getting the .config to rebuild the kernel. You can find&lt;br /&gt;
     this file, the &amp;quot;.config&amp;quot; file at the following location:&lt;br /&gt;
&lt;br /&gt;
          $ ls &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Or, to see the contents&lt;br /&gt;
&lt;br /&gt;
          $ cat &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     This can be important, if you're planning to build your own kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 181:&lt;br /&gt;
&lt;br /&gt;
     Listing control key settings.&lt;br /&gt;
&lt;br /&gt;
          $ stty -a&lt;br /&gt;
          speed 38400 baud; rows 0; columns 0; line = 0;&lt;br /&gt;
          intr = ^C; quit = ^\; erase = &amp;lt;undef&amp;gt;; kill = &amp;lt;undef&amp;gt;; eof = ^D; eol = &amp;lt;undef&amp;gt;; eol2 = &amp;lt;undef&amp;gt;; start = ^Q;&lt;br /&gt;
          stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;&lt;br /&gt;
          -parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts&lt;br /&gt;
          -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel&lt;br /&gt;
          opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0&lt;br /&gt;
          isig icanon iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 182:&lt;br /&gt;
&lt;br /&gt;
     iptables DNAT and SNAT. You have a webserver on 192.168.1.71. When people query this webserver, you want them&lt;br /&gt;
     to goto 192.168.1.81, with no indication that they are going to another web server. In fact, they always make&lt;br /&gt;
     their web hits to 192.168.1.71.&lt;br /&gt;
&lt;br /&gt;
     The following is the iptables commands:&lt;br /&gt;
&lt;br /&gt;
        $ echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
        $ iptables -t nat -A PREROUTING -d 192.168.1.71 -p tcp --dport 80 -j DNAT --to 192.168.1.81&lt;br /&gt;
        $ iptables -t nat -A POSTROUTING -d 192.168.1.81 -s 192.168.1.0/24 -p tcp --dport 80 -j SNAT --to 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
     Change 192.168.1.0/24 to whatever source you expect the web browser to come in on. Below is the tcpdump showing&lt;br /&gt;
     all traffic is relayed via 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
         [root@closet iptables]# tcpdump -nN port 80&lt;br /&gt;
&lt;br /&gt;
         17:34:58.790398 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: S 3620106373:3620106373(0) win 16384 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790465 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: S 3620106373:3620106373(0) win 16384 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790703 IP 192.168.1.81.80 &amp;gt; 192.168.1.71.1158: S 1973665156:1973665156(0) ack 3620106374 win 5840 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790720 IP 192.168.1.71.80 &amp;gt; 192.168.1.102.1158: S 1973665156:1973665156(0) ack 3620106374 win 5840 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790951 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: . ack 1 win 17520&lt;br /&gt;
         17:34:58.790965 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: . ack 1 win 17520&lt;br /&gt;
         17:34:58.791451 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: P 1:327(326) ack 1 win 17520&lt;br /&gt;
         17:34:58.791472 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: P 1:327(326) ack 1 win 17520&lt;br /&gt;
         17:34:58.791973 IP 192.168.1.81.80 &amp;gt; 192.168.1.71.1158: . ack 327 win 6432&lt;br /&gt;
&lt;br /&gt;
     Above the web client is on &amp;quot;192.168.1.102&amp;quot;. You can see that the 1st server &amp;quot;192.168.1.71&amp;quot; then goes out to&lt;br /&gt;
     the 2nd server &amp;quot;192.168.1.81&amp;quot; on the second line. The third line shows the 2nd server &amp;quot;192.168.1.81&amp;quot; responding to&lt;br /&gt;
     the 1st server, and the forth line passes this data back to the web client &amp;quot;192.168.1.102&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Note: You can save your current iptables setting with the following command:&lt;br /&gt;
&lt;br /&gt;
         $ iptables-save &amp;gt; iptables_store&lt;br /&gt;
&lt;br /&gt;
       The big advantage is that you can store the counters as well.&lt;br /&gt;
&lt;br /&gt;
         $ iptables-save -c &amp;gt; iptables_store_w_cnts&lt;br /&gt;
&lt;br /&gt;
       To restore the file, use the following:&lt;br /&gt;
&lt;br /&gt;
         $ iptables-restore -c &amp;lt; iptables_store_w_cnts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 183:&lt;br /&gt;
&lt;br /&gt;
     mailstats - display mail statistics. This file reads data from &amp;quot;/var/log/mail/statistics&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         [root@closet ~]# mailstats&lt;br /&gt;
         Statistics from Sat Jun 25 15:59:52 2005&lt;br /&gt;
          M   msgsfr  bytes_from   msgsto    bytes_to  msgsrej msgsdis msgsqur  Mailer&lt;br /&gt;
          4        1          2K        0          0K        0       0       0  esmtp&lt;br /&gt;
          9        0          0K        1          2K        0       0       0  local&lt;br /&gt;
         =====================================================================&lt;br /&gt;
          T        1          2K        1          2K        0       0       0&lt;br /&gt;
          C        1                    0                    0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 184:&lt;br /&gt;
&lt;br /&gt;
     Profiling C Applications - Assume you have the following program p1.c:&lt;br /&gt;
&lt;br /&gt;
         /* Program  p1.c */&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
         t1(int i)&lt;br /&gt;
         {&lt;br /&gt;
                 printf(&amp;quot;t1:%d\n&amp;quot;, i);&lt;br /&gt;
         }&lt;br /&gt;
        &lt;br /&gt;
         t2(int j)&lt;br /&gt;
         {&lt;br /&gt;
                 printf(&amp;quot;t2:%d\n&amp;quot;, j);&lt;br /&gt;
         }&lt;br /&gt;
        &lt;br /&gt;
         int main(void)&lt;br /&gt;
         {&lt;br /&gt;
                 int i, j;&lt;br /&gt;
        &lt;br /&gt;
                 for (i = 0; i &amp;lt; 5; ++i) {&lt;br /&gt;
                         t1(i);&lt;br /&gt;
                         for (j = 0; j &amp;lt; 2; ++j) {&lt;br /&gt;
                                 t2(j);&lt;br /&gt;
                         }&lt;br /&gt;
                 }&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
     Compile the program as follows:&lt;br /&gt;
&lt;br /&gt;
        $ gcc -pg -g -o p1 p1.c&lt;br /&gt;
        $ ./p1&lt;br /&gt;
        t1:0&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:1&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:2&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:3&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:4&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
&lt;br /&gt;
     Next, to get the profile graph.&lt;br /&gt;
&lt;br /&gt;
        $ gprof -p -b p1&lt;br /&gt;
        Flat profile:&lt;br /&gt;
        &lt;br /&gt;
        Each sample counts as 0.01 seconds.&lt;br /&gt;
         no time accumulated&lt;br /&gt;
        &lt;br /&gt;
          %   cumulative   self              self     total&lt;br /&gt;
         time   seconds   seconds    calls  Ts/call  Ts/call  name&lt;br /&gt;
          0.00      0.00     0.00       10     0.00     0.00  t2&lt;br /&gt;
          0.00      0.00     0.00        5     0.00     0.00  t1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Above note the 10 calls to t2 and 5 calls to t1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 185:&lt;br /&gt;
&lt;br /&gt;
     CDPATH - this is a bash variable like PATH that defines a search path&lt;br /&gt;
              for the cd command.&lt;br /&gt;
&lt;br /&gt;
     Suppose you have the following directory structure:&lt;br /&gt;
&lt;br /&gt;
             /home/chirico/stuff&lt;br /&gt;
                               |-- dirA&lt;br /&gt;
                               `-- dirB&lt;br /&gt;
&lt;br /&gt;
     Assume you define CDPATH as follows:&lt;br /&gt;
&lt;br /&gt;
             CDPATH=/home/chirico/stuff&lt;br /&gt;
&lt;br /&gt;
     Now, no matter what directory you are in if you use the cd command below&lt;br /&gt;
     you will automatically move to &amp;quot;/home/chirico/stuff/dirA&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             $ cd dirA&lt;br /&gt;
&lt;br /&gt;
     Note you could be in &amp;quot;/etc&amp;quot; and will move directly to &amp;quot;/home/chirico/stuff/dirA&amp;quot;.&lt;br /&gt;
     This command has the same format as PATH - multiple entries are separated by a colon.&lt;br /&gt;
     If the current directory contain a sub-directory dirA, then, it gets priority.&lt;br /&gt;
&lt;br /&gt;
     The following is part of my .bash_profile&lt;br /&gt;
&lt;br /&gt;
             CDPATH=/work/cpearls/src/posted_on_sf/:/work/souptonuts/documentation/:/home/chirico/deleteme/&lt;br /&gt;
             export PATH CVS_RSH EDITOR JAVA_HOME CDPATH&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 186:&lt;br /&gt;
&lt;br /&gt;
     Groups - add groups and users to groups. The following shows how to create the group &amp;quot;share&amp;quot;&lt;br /&gt;
              and add the user &amp;quot;chirico&amp;quot; to this group. The following should be done as root, and&lt;br /&gt;
              assumes the account &amp;quot;chirico&amp;quot; already exits.&lt;br /&gt;
&lt;br /&gt;
             $ groupadd share&lt;br /&gt;
             $ usermod -G share chirico&lt;br /&gt;
&lt;br /&gt;
     Note the change made to &amp;quot;/etc/group&amp;quot; below:&lt;br /&gt;
&lt;br /&gt;
             $ cat /etc/group|grep 'share'&lt;br /&gt;
             share:x:616:chirico&lt;br /&gt;
&lt;br /&gt;
     If the user chirico is currently logged in, he should run the following&lt;br /&gt;
     command to immediately have group &amp;quot;share&amp;quot; rights. Or, the next time he logs&lt;br /&gt;
     in he will have access to this group.&lt;br /&gt;
&lt;br /&gt;
             $ newgrp share&lt;br /&gt;
&lt;br /&gt;
     Reference the following (TIP 6, TIP 167).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 187:&lt;br /&gt;
&lt;br /&gt;
     oprofile - steps for running oprofile on Fedora.&lt;br /&gt;
&lt;br /&gt;
     Step 1:&lt;br /&gt;
&lt;br /&gt;
       Find out what version of the kernel you are running.&lt;br /&gt;
&lt;br /&gt;
           $ uname -a&lt;br /&gt;
           Linux closet.squeezel.com 2.6.12-1.1398_FC4 #1 Fri Jul 15 00:52:32 EDT 2005 i686 i686 i386 GNU/Linux&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 2:&lt;br /&gt;
&lt;br /&gt;
       Download the source in a chosen directory. Above, I'm running 2.6.12-1, but I'm going to go for 2.6.12.3, since&lt;br /&gt;
       it's a little later. You want the signed file as well.&lt;br /&gt;
&lt;br /&gt;
           $ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.12.3.tar.gz&lt;br /&gt;
           $ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.12.3.tar.gz.sign&lt;br /&gt;
&lt;br /&gt;
       Now, check the signature.&lt;br /&gt;
&lt;br /&gt;
           $ gpg --verify linux-2.6.12.3.tar.gz.sign linux-2.6.12.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 3:&lt;br /&gt;
&lt;br /&gt;
       Unpack the file.&lt;br /&gt;
&lt;br /&gt;
           $ tar -xzf linux-2.6.12.3.tar.gz&lt;br /&gt;
           $ cd cd linux-2.6.12.3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 4:&lt;br /&gt;
&lt;br /&gt;
       Copy the &amp;quot;.config&amp;quot; used to compile your previous kernel. You should find it&lt;br /&gt;
       in the following direcotry &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       Copy it to the linux-2.6.12.3 directory.&lt;br /&gt;
&lt;br /&gt;
           $ cp &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot; .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 5:&lt;br /&gt;
&lt;br /&gt;
       Run make as follows. It will ask for a few questions on &amp;quot;make oldconfig&amp;quot;. The&lt;br /&gt;
       make installs below will have to be done with root privileges.&lt;br /&gt;
&lt;br /&gt;
          $ make oldconfig&lt;br /&gt;
          $ make bzImage&lt;br /&gt;
          $ make modules&lt;br /&gt;
          $ make modules_install&lt;br /&gt;
          $ make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 6:&lt;br /&gt;
&lt;br /&gt;
       Edit the &amp;quot;/boot/grub/grub.conf&amp;quot; and set default = 0  as shown below in this&lt;br /&gt;
       file.&lt;br /&gt;
&lt;br /&gt;
            default=0&lt;br /&gt;
            timeout=5&lt;br /&gt;
            splashimage=(hd0,2)/grub/splash.xpm.gz&lt;br /&gt;
            hiddenmenu&lt;br /&gt;
            title Fedora Core (2.6.12.3)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.12.3 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.12.3.img&lt;br /&gt;
            title Fedora Core (2.6.12-1.1398_FC4)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.12-1.1398_FC4 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.12-1.1398_FC4.img&lt;br /&gt;
            title Fedora Core (2.6.11-1.1369_FC4)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.11-1.1369_FC4 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.11-1.1369_FC4.img&lt;br /&gt;
            title Other&lt;br /&gt;
                    rootnoverify (hd0,1)&lt;br /&gt;
                    chainloader +1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 7:&lt;br /&gt;
&lt;br /&gt;
       Shutdown with the restart option.&lt;br /&gt;
&lt;br /&gt;
           $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 8:&lt;br /&gt;
&lt;br /&gt;
       Run opcontrol. The commands below are done as root.  My kernel was compiled in the following&lt;br /&gt;
       directory &amp;quot;/home/kernel/linux-2.6.12.3/&amp;quot;, so I'll run opcontrol as follows:&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --vmlinux=/home/kernel/linux-2.6.12.3/vmlinux&lt;br /&gt;
&lt;br /&gt;
       Now start.&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --start&lt;br /&gt;
           Using 2.6+ OProfile kernel interface.&lt;br /&gt;
           Reading module info.&lt;br /&gt;
           Using log file /var/lib/oprofile/oprofiled.log&lt;br /&gt;
           Daemon started.&lt;br /&gt;
           Profiler running.&lt;br /&gt;
&lt;br /&gt;
       Shutdown opcontrol.&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --shutdown&lt;br /&gt;
&lt;br /&gt;
       Run report.&lt;br /&gt;
&lt;br /&gt;
           $ opreport&lt;br /&gt;
&lt;br /&gt;
           CPU: CPU with timer interrupt, speed 0 MHz (estimated)&lt;br /&gt;
           Profiling through timer interrupt&lt;br /&gt;
                     TIMER:0|&lt;br /&gt;
             samples|      %|&lt;br /&gt;
           ------------------&lt;br /&gt;
              156088 99.8746 vmlinux&lt;br /&gt;
                  60  0.0384 libc-2.3.5.so&lt;br /&gt;
                  30  0.0192 oprofiled&lt;br /&gt;
                  23  0.0147 libcrypto.so.0.9.7f&lt;br /&gt;
                  13  0.0083 bash&lt;br /&gt;
                  12  0.0077 screen&lt;br /&gt;
                  10  0.0064 sshd&lt;br /&gt;
                   9  0.0058 ssh&lt;br /&gt;
                   6  0.0038 ip_tables&lt;br /&gt;
                   6  0.0038 libncurses.so.5.4&lt;br /&gt;
                   5  0.0032 b44&lt;br /&gt;
                   5  0.0032 ext3&lt;br /&gt;
                   5  0.0032 ld-2.3.5.so&lt;br /&gt;
                   4  0.0026 ip_conntrack&lt;br /&gt;
                   4  0.0026 jbd&lt;br /&gt;
                   2  0.0013 grep&lt;br /&gt;
                   1 6.4e-04 libdns.so.20.0.2&lt;br /&gt;
                   1 6.4e-04 libisc.so.9.1.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Reference the following for more documentation:&lt;br /&gt;
             http://oprofile.sourceforge.net/doc/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 188:&lt;br /&gt;
&lt;br /&gt;
     cyrus-imapd with Postfix using sasldb for authentication. For this example&lt;br /&gt;
     the server is tape.squeezel.com and the user is chirico.&lt;br /&gt;
&lt;br /&gt;
        Step 1:&lt;br /&gt;
        &lt;br /&gt;
                   $ yum install cyrus-imapd&lt;br /&gt;
                   $ yum install cyrus-imapd-utils&lt;br /&gt;
        &lt;br /&gt;
            You need &amp;quot;cyrus-imapd-utils&amp;quot; for cyradm.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 2:&lt;br /&gt;
        &lt;br /&gt;
          Edit /etc/imapd.conf&lt;br /&gt;
        &lt;br /&gt;
               configdirectory: /var/lib/imap&lt;br /&gt;
               partition-default: /var/spool/imap&lt;br /&gt;
               admins: cyrus&lt;br /&gt;
               sievedir: /var/lib/imap/sieve&lt;br /&gt;
               sendmail: /usr/sbin/sendmail&lt;br /&gt;
               hashimapspool: true&lt;br /&gt;
               # Chirico Commented the below line&lt;br /&gt;
               # sasl_pwcheck_method: saslauthd&lt;br /&gt;
               # Because using sasldb&lt;br /&gt;
               sasl_pwcheck_method: auxprop&lt;br /&gt;
               sasl_auxprop_plugin: sasldb&lt;br /&gt;
               #  Chirico end change&lt;br /&gt;
               sasl_mech_list: PLAIN&lt;br /&gt;
               tls_cert_file: /usr/share/ssl/certs/cyrus-imapd.pem&lt;br /&gt;
               tls_key_file: /usr/share/ssl/certs/cyrus-imapd.pem&lt;br /&gt;
               tls_ca_file: /usr/share/ssl/certs/ca-bundle.crt&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 3:&lt;br /&gt;
        &lt;br /&gt;
           Create a user and password:&lt;br /&gt;
        &lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` cyrus&lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` chirico&lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` allmail&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
           This will automatically create the file /etc/sasldb2. But look&lt;br /&gt;
           at the default rights, assuming you ran saslpasswd2 as root:&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /etc/sasldb2&lt;br /&gt;
                 -rw-r-----  1 root root 12288 Jul 31 09:50 /etc/sasldb2&lt;br /&gt;
        &lt;br /&gt;
           We need to correct this in step 4.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 4:&lt;br /&gt;
        &lt;br /&gt;
                 $ chown root.mail /etc/sasldb2&lt;br /&gt;
                 $ ls -l /etc/sasldb2&lt;br /&gt;
                 -rw-r-----  1 root mail 12288 Jul 31 09:50 /etc/sasldb2&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 5:&lt;br /&gt;
        &lt;br /&gt;
            Update &amp;quot;/etc/postfix/main.cf&amp;quot;. Note in /etc/imapd.conf the configdirectory&lt;br /&gt;
            points to /var/lib/imap, and if I look at this directory I see the&lt;br /&gt;
            socket directory. However, after staring /etc/init.d/cyrus-imapd  there&lt;br /&gt;
            will be a socket file &amp;quot;/var/lib/imap/socket/lmtp&amp;quot;. (See step 6).&lt;br /&gt;
        &lt;br /&gt;
                  mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp&lt;br /&gt;
                  mailbox_transport = cyrus&lt;br /&gt;
        &lt;br /&gt;
            Restart postfix.&lt;br /&gt;
        &lt;br /&gt;
                  /etc/init.d/postfix restart&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 6:&lt;br /&gt;
&lt;br /&gt;
            Start cyrus-imapd and look for the socket file.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
                   $ /etc/init.d/cyrus-imapd restart&lt;br /&gt;
                   Shutting down cyrus-imapd:                                 [  OK  ]&lt;br /&gt;
                   Starting cyrus-imapd: preparing databases... done.         [  OK  ]&lt;br /&gt;
        &lt;br /&gt;
            Now you should see the lmtp file:&lt;br /&gt;
        &lt;br /&gt;
                   $ ls -l /var/lib/imap/socket/lmtp&lt;br /&gt;
                   srwxrwxrwx  1 root root 0 Jul 31 10:04 /var/lib/imap/socket/lmtp&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 7:&lt;br /&gt;
        &lt;br /&gt;
            Add users. Note, you may have to go back to step 3 to add them to /etc/sasldb2&lt;br /&gt;
            as well.&lt;br /&gt;
        &lt;br /&gt;
                   $ su - cyrus&lt;br /&gt;
                   $ cyradm tape.squeezel.com&lt;br /&gt;
                   tape.squeezel.com&amp;gt; cm user.chirico&lt;br /&gt;
                   tape.squeezel.com&amp;gt; quit&lt;br /&gt;
        &lt;br /&gt;
            Now got back as root, and check that everything was created correctly.&lt;br /&gt;
        &lt;br /&gt;
                   $ ls /var/spool/imap/c/user/&lt;br /&gt;
                   total 8&lt;br /&gt;
                   drwx------  2 cyrus mail 4096 Jul 31 10:21 chirico&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 8:&lt;br /&gt;
        &lt;br /&gt;
             Run a mail test. We'll do this as root to the chirico account.&lt;br /&gt;
        &lt;br /&gt;
                   $ mail -s 'First test'  chirico&lt;br /&gt;
                   first test&lt;br /&gt;
                   .&lt;br /&gt;
        &lt;br /&gt;
             Now, still as root check the maillog. Normally everything should work.&lt;br /&gt;
        &lt;br /&gt;
                  $ tail /var/log/maillog&lt;br /&gt;
        &lt;br /&gt;
             However, I got the following error below.&lt;br /&gt;
&lt;br /&gt;
                     Jul 31 10:29:03 tape postfix/cleanup[30124]: AE7CB1B34A4: message-id=&amp;lt;20050731142903.AE7CB1B34A4@tape.squeezel.com&amp;gt;&lt;br /&gt;
                     Jul 31 10:29:03 tape postfix/qmgr[30120]: AE7CB1B34A4: from=&amp;lt;root@tape.squeezel.com&amp;gt;, size=315, nrcpt=1 (queue active)&lt;br /&gt;
                     Jul 31 10:29:03 tape pipe[30128]: fatal: pipe_comand: execvp /cyrus/bin/deliver: No such file or directory&lt;br /&gt;
&lt;br /&gt;
             If you get a similiar error, you may need to adjust the settting in /etc/postfix/master.cf&lt;br /&gt;
        &lt;br /&gt;
                 # This is the problem in /etc/postfix/master.cf&lt;br /&gt;
                 cyrus     unix  -       n       n       -       -       pipe&lt;br /&gt;
                   user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}&lt;br /&gt;
        &lt;br /&gt;
             My deliver file is the following&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
                 -rwxr-xr-x  1 root root 846228 Apr  4 18:59 /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
        &lt;br /&gt;
             So I need to change my /etc/postfix/master.cf as follows:&lt;br /&gt;
        &lt;br /&gt;
                 # Fix because by deliver file is under  /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
                 cyrus     unix  -       n       n       -       -       pipe&lt;br /&gt;
                   user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -r ${sender} -m ${extension} ${user}&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
             If changes were needed, like I had to do, restart postfix&lt;br /&gt;
        &lt;br /&gt;
                 $ /etc/init.d/postfix restart&lt;br /&gt;
        &lt;br /&gt;
             Now, if everything works, you should start to see numbers in the spool directory like &amp;quot;1.&amp;quot; and&lt;br /&gt;
             &amp;quot;2.&amp;quot;.&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /var/spool/imap/c/user/chirico/&lt;br /&gt;
                 total 40&lt;br /&gt;
                 -rw-------  1 cyrus mail  545 Jul 31 10:44 1.&lt;br /&gt;
                 -rw-------  1 cyrus mail  547 Jul 31 10:45 2.&lt;br /&gt;
                 -rw-------  1 cyrus mail 1276 Jul 31 10:45 cyrus.cache&lt;br /&gt;
                 -rw-------  1 cyrus mail  153 Jul 31 10:21 cyrus.header&lt;br /&gt;
                 -rw-------  1 cyrus mail  196 Jul 31 10:45 cyrus.index&lt;br /&gt;
&lt;br /&gt;
        Step 9:&lt;br /&gt;
        &lt;br /&gt;
             Local firewall.&lt;br /&gt;
        &lt;br /&gt;
                 # imap&lt;br /&gt;
                iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 143 -j ACCEPT&lt;br /&gt;
                iptables -A INPUT -p tcp -s 192.168.1.0/24  --dport 143 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        Step 10:&lt;br /&gt;
        &lt;br /&gt;
             Configure cyrus-imapd to start for run-level 3 and 5.&lt;br /&gt;
&lt;br /&gt;
                 # chkconfig --level 35 cyrus-imapd on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       HINTS - &lt;br /&gt;
&lt;br /&gt;
        Something to watch out for:&lt;br /&gt;
&lt;br /&gt;
              Something to watch out for: If a user creates a .forward file in their shell account with the&lt;br /&gt;
              following entry, then, mail will not get mail relayed to cyrus.&lt;br /&gt;
&lt;br /&gt;
                  &amp;quot;|exec /usr/bin/procmail&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             The /etc/maillog will show something like this:&lt;br /&gt;
&lt;br /&gt;
                    to=&amp;lt;chirico@squeezel.squeezel.com&amp;gt;, orig_to=&amp;lt;chirico&amp;gt;, relay=local, delay=0,&lt;br /&gt;
                          status=sent (delivered to command: exec /usr/bin/procmail)&lt;br /&gt;
&lt;br /&gt;
             Remove the &amp;quot;.forward&amp;quot; file from their home directory and you'll get the following:&lt;br /&gt;
&lt;br /&gt;
                    to=&amp;lt;chirico@squeezel.squeezel.com&amp;gt;, relay=cyrus, delay=0,&lt;br /&gt;
                          status=sent (squeezel.squeezel.com)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              mutt with IMAP?  (See TIP 190)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 189:&lt;br /&gt;
&lt;br /&gt;
     expand - convert tabs to spaces in a file.&lt;br /&gt;
&lt;br /&gt;
             $ expand How_to_Linux_and_Open_Source.txt &amp;gt; notabs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 190:&lt;br /&gt;
&lt;br /&gt;
     mutt with imap - assume you have setup imap (see tip 188). Now how do you configure&lt;br /&gt;
                      your &amp;quot;.muttrc&amp;quot; file to automatically connect, securely to the IMAP server?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       &lt;br /&gt;
     Below is an example of my &amp;quot;.muttrc&amp;quot; file. For this example, assume my password is &amp;quot;S0m3paSSw0r9&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             $ cat .muttrc&lt;br /&gt;
             set spoolfile = &amp;quot;imaps://chirico:S0m3paSSw0r9@squeezel.squeezel.com/&lt;br /&gt;
             set imap_force_ssl=yes&lt;br /&gt;
             set certificate_file=~/.mutt/certificates/72d31154.0&lt;br /&gt;
&lt;br /&gt;
     Now, you want to copy the certificate as a &amp;quot;file.pem&amp;quot; and run &amp;quot;c_rehash&amp;quot; to convert this&lt;br /&gt;
     file to a number. See the article. See the following article on how to do this under the &lt;br /&gt;
     fetchmail section.&lt;br /&gt;
&lt;br /&gt;
          http://souptonuts.sourceforge.net/postfix_tutorial.html&lt;br /&gt;
&lt;br /&gt;
     This is a quick summary of creating this key.&lt;br /&gt;
&lt;br /&gt;
             $ openssl s_client -connect squeezel.squeezel.com:995 -showcerts &amp;gt; file.pem&lt;br /&gt;
             $ c_rehash ~/.mutt/certificates&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 191:&lt;br /&gt;
&lt;br /&gt;
     Apache - CGI scripts.  There are two ways to enable CGI scripts. The second method is the&lt;br /&gt;
              prefered method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           First way, the easy way. Look for the &amp;quot;http.conf&amp;quot; file. On Fedora Core, this file can be&lt;br /&gt;
           found under &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;. Edit this file as follows to make &lt;br /&gt;
           &amp;quot;http://squeezel.squeezel.com/chirico-cgi/&amp;quot; execute scripts.&lt;br /&gt;
&lt;br /&gt;
                     ScriptAlias /chirico-cgi/ &amp;quot;/home/chirico/cgi-bin/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           Second way, the better way. Instead of doing the above, make the following change in &lt;br /&gt;
           &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                     &amp;lt;Directory /home/chirico/cgi-bin&amp;gt;&lt;br /&gt;
                      Options +ExecCGI&lt;br /&gt;
                      SetHandler chirico-cgi&lt;br /&gt;
                     &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Running a test script. Now copy the following test script into the directory &amp;quot;/home/chirico/cgi-bin&amp;quot;&lt;br /&gt;
        and change the rights to execute for the user running this.&lt;br /&gt;
&lt;br /&gt;
                  #!/bin/sh&lt;br /&gt;
                  # Save as test.cgi&lt;br /&gt;
                  #  chown apache.apache test.cgi&lt;br /&gt;
                  #  chmod 700 test.cgi&lt;br /&gt;
                  echo &amp;quot;Content-Type: text/html&amp;quot;&lt;br /&gt;
                  echo&lt;br /&gt;
                  echo &amp;quot;Hello world from user &amp;lt;b&amp;gt;`whoami`&amp;lt;/b&amp;gt;! &amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 192:&lt;br /&gt;
&lt;br /&gt;
     Bash - using getopts for your bash scripts.&lt;br /&gt;
&lt;br /&gt;
                   #!/bin/bash&lt;br /&gt;
                   while getopts &amp;quot;ab:cd:&amp;quot; Option&lt;br /&gt;
                   # b and d take arguments&lt;br /&gt;
                   #&lt;br /&gt;
                   do&lt;br /&gt;
                     case $Option in&lt;br /&gt;
                       a) echo -e &amp;quot;a = $OPTIND&amp;quot;;;&lt;br /&gt;
                       b) echo -e &amp;quot;b = $OPTIND $OPTARG&amp;quot;;;&lt;br /&gt;
                       c) echo -e &amp;quot;c = $OPTIND&amp;quot;;;&lt;br /&gt;
                       d) echo -e &amp;quot;d = $OPTIND $OPTARG&amp;quot;;;&lt;br /&gt;
                    esac&lt;br /&gt;
                  done&lt;br /&gt;
                  shift $(($OPTIND - 1))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 193:&lt;br /&gt;
&lt;br /&gt;
     Sieve - creating sieve recipes with &amp;quot;sieveshell&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     The following sieve script put all jefferson.edu mail into the &lt;br /&gt;
     folder jefferson. This assumes that I have already created the IMP &lt;br /&gt;
     directory, or mail box (INBOX.jefferson), which can be done in mutt &lt;br /&gt;
     with the &amp;quot;C&amp;quot; command. Below is an example of finding &amp;quot;jefferson.edu&amp;quot;&lt;br /&gt;
     anywhere in the header. &lt;br /&gt;
&lt;br /&gt;
         # This is a file named jefferson.siv&lt;br /&gt;
         require [&amp;quot;fileinto&amp;quot;];&lt;br /&gt;
         if header :contains &amp;quot;Received&amp;quot; &amp;quot;from jefferson.edu&amp;quot; {&lt;br /&gt;
           fileinto &amp;quot;INBOX.jefferson&amp;quot;;&lt;br /&gt;
           stop;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
     Now, from the command propt execute &amp;quot;sieveshell&amp;quot; with the hostname of the&lt;br /&gt;
     imap server. My server is squeezel.squeezel.com, so I would execute the &lt;br /&gt;
     following:&lt;br /&gt;
&lt;br /&gt;
          $ sieveshell squeezel.squeezel.com&lt;br /&gt;
          connecting to squeezel.squeezel.com&lt;br /&gt;
          Please enter your password:****&lt;br /&gt;
          &amp;gt; put jefferson.siv&lt;br /&gt;
          &amp;gt; activate jefferson.siv&lt;br /&gt;
          &amp;gt; list&lt;br /&gt;
          jefferson.siv  &amp;lt;- active script&lt;br /&gt;
          &amp;gt; quit&lt;br /&gt;
&lt;br /&gt;
     Note the put brings in the script. And you need to activiate it.&lt;br /&gt;
&lt;br /&gt;
     You can activate a sieve script for any user on your system if you are&lt;br /&gt;
     root. This is an example of activating a script for user chirico. Assume&lt;br /&gt;
     below the root prompt is &amp;quot;#&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          # sieveshell -a chirico -u chirico squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
     You can also automate everything from a bash script. But note after&lt;br /&gt;
     the -e the commands, and not a file with the commands, follows within&lt;br /&gt;
     quotes. This is the script I use for my home system.&lt;br /&gt;
&lt;br /&gt;
         #!/bin/bash&lt;br /&gt;
         sieveshell -a chirico -u chirico -e 'deactivate&lt;br /&gt;
         delete chirico.siv&lt;br /&gt;
         put chirico.siv&lt;br /&gt;
         activate chirico.siv&lt;br /&gt;
         list&lt;br /&gt;
         '  squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     References:&lt;br /&gt;
         http://wiki.fastmail.fm/index.php/SieveRecipes&lt;br /&gt;
         http://www.cyrusoft.com/sieve/#documents&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 194:&lt;br /&gt;
&lt;br /&gt;
     emacs - editing files remotely with tramp. Tramp comes with the latest version of emacs.&lt;br /&gt;
             That means if you're using Fedora core 4, with emacs, you have tramp. This is &lt;br /&gt;
             ideal for editing files on remote computers that do not use emacs.&lt;br /&gt;
&lt;br /&gt;
             Edit the &amp;quot;.emacs&amp;quot; file and add the following line:&lt;br /&gt;
&lt;br /&gt;
                 (require 'tramp)&lt;br /&gt;
                 (setq tramp-default-method &amp;quot;scp&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
             Now, to edit a file on computer tape.squeezel.com (C-x, C-f) and&lt;br /&gt;
             enter the following in Find file:&lt;br /&gt;
&lt;br /&gt;
                 Find file:/chirico@tape.squeezel.com:test.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             References:&lt;br /&gt;
&lt;br /&gt;
                    http://savannah.gnu.org/projects/tramp/&lt;br /&gt;
&lt;br /&gt;
             &lt;br /&gt;
&lt;br /&gt;
TIP 195:&lt;br /&gt;
&lt;br /&gt;
     trusted X11 forwarding - running gnome and KDE both on one screen, at the same&lt;br /&gt;
             time securely. The following assumes gnome is running on the current&lt;br /&gt;
             computer and &amp;quot;closet.squeezel.com&amp;quot; has KDE&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y  closet.squeezel.com&lt;br /&gt;
              $ startkde&lt;br /&gt;
&lt;br /&gt;
          Or assume you want to run gnome on &amp;quot;closet.squeezel.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y  closet.squeezel.com&lt;br /&gt;
              $ gnome-session&lt;br /&gt;
&lt;br /&gt;
          By default Fedora Core allows ForwardX11 over ssh. Note you want to use&lt;br /&gt;
          the -Y option above and NOT -X. &lt;br /&gt;
&lt;br /&gt;
          Suppose you want a remote &amp;quot;gnome-session&amp;quot; on ctl-alt-F12. Below is an &lt;br /&gt;
          example of getting the remote computer closet.squeezel.com, and you&lt;br /&gt;
          can still have the above configuration.&lt;br /&gt;
&lt;br /&gt;
          First you must allow magic cookies for each server connection.&lt;br /&gt;
             &lt;br /&gt;
              $ MCOOKIE=$(mcookie)&lt;br /&gt;
              $ xauth add $(hostname)/unix:1 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
              $ xauth add localhost/unix:1 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
  &lt;br /&gt;
          Again, note that you have to add this for EACH connection. So if you wanted 2 as well&lt;br /&gt;
&lt;br /&gt;
              $ MCOOKIE=$(mcookie)&lt;br /&gt;
              $ xauth add $(hostname)/unix:2 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
              $ xauth add localhost/unix:2 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
&lt;br /&gt;
          On squeezel.squeezel.com create a new xterm. If :1 is take below&lt;br /&gt;
          try :2. The vt12 is for switching to ctl-alt-F12.&lt;br /&gt;
&lt;br /&gt;
              $ xinit -- :1 vt12&lt;br /&gt;
&lt;br /&gt;
          Note, if you do not add the above cookies, you will get the follow error:&lt;br /&gt;
         &lt;br /&gt;
               Xlib: connection to &amp;quot;:1.0&amp;quot; refused by server&lt;br /&gt;
               Xlib: No protocol specified&lt;br /&gt;
&lt;br /&gt;
          The screen may be hard to read. At this point ssh -Y to the remote computer.&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y closet.squeezel.com&lt;br /&gt;
              $ gnome-session&lt;br /&gt;
&lt;br /&gt;
          Yes, you will get errors about sound and some custom drivers is the remove &lt;br /&gt;
          computer has different hardware. After is loads, you can switch back and&lt;br /&gt;
          forth between session with (ctl-alt-F12)  and (ctl-alt-F7)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 196:&lt;br /&gt;
&lt;br /&gt;
     Suspend ssh session - you have just sshed into a computer &amp;quot;ssh -l user example.com&amp;quot;, and you&lt;br /&gt;
          want to get back to the terminal prompt of the computer you started with. Escapte, by &lt;br /&gt;
          default with ssh is &amp;quot;~&amp;quot;, so enter &amp;quot;~&amp;quot; followed by &amp;quot;ctl-z&amp;quot; to suspend.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 197:&lt;br /&gt;
&lt;br /&gt;
     Quick way to send a text file &lt;br /&gt;
&lt;br /&gt;
              $ sendmail -f mike.chirico@gmail.com mchirico@comcast.net &amp;lt; /etc/fstab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 198:&lt;br /&gt;
&lt;br /&gt;
     size - determining the size of the text segment, data segment, and &amp;quot;bss&amp;quot; or uninitialized data segment.&lt;br /&gt;
&lt;br /&gt;
              $ size /bin/sh /bin/bash&lt;br /&gt;
               text        data     bss     dec     hex filename&lt;br /&gt;
              586946      22444   18784  628174   995ce /bin/sh&lt;br /&gt;
              586946      22444   18784  628174   995ce /bin/bash&lt;br /&gt;
&lt;br /&gt;
          Note above that &amp;quot;/bin/sh&amp;quot; and &amp;quot;/bin/bash&amp;quot; have equal text,data and bss numbers. It's&lt;br /&gt;
          highly likely that these are the same programs.&lt;br /&gt;
&lt;br /&gt;
              $ ls -l /bin/sh&lt;br /&gt;
               lrwxrwxrwx  1 root root 4 Jan 14  2005 /bin/sh -&amp;gt; bash&lt;br /&gt;
&lt;br /&gt;
          Yep, it's the same program. Here's a further definition of each segment.&lt;br /&gt;
&lt;br /&gt;
              Text segment: The machine instructions that the CPU executes. This is usually&lt;br /&gt;
                            read only and sharable.&lt;br /&gt;
&lt;br /&gt;
              Data segment: Contains initialized variables in a program. You also know these&lt;br /&gt;
                            as declarations and definitions.&lt;br /&gt;
&lt;br /&gt;
                               int max = 200;&lt;br /&gt;
&lt;br /&gt;
              Uninitialized data segment: Think of this as a declaration only, or data that&lt;br /&gt;
                            is only initialized by the kernel to arithmetic 0 or null pointers&lt;br /&gt;
                            before program execution.&lt;br /&gt;
&lt;br /&gt;
                               char s[10];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 199:&lt;br /&gt;
&lt;br /&gt;
     Using the at command.&lt;br /&gt;
&lt;br /&gt;
       Below is a simple example if running the ls command at 11:42am that&lt;br /&gt;
       will send mail -m to the user that executed it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       We'll execute job1 defined as follows and set to be executable. &lt;br /&gt;
&lt;br /&gt;
           $ cat ./job1&lt;br /&gt;
           #!/bin/bash&lt;br /&gt;
           date &amp;gt;&amp;gt; /tmp/job1&lt;br /&gt;
&lt;br /&gt;
       The at command is listed below. For queue &amp;quot;-q&amp;quot; names you can only&lt;br /&gt;
       specify one letter. Here we're using x. The letter determines the&lt;br /&gt;
       priority with &amp;quot;a&amp;quot; the highest.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x  -f ./job1 -m  11:54am&lt;br /&gt;
           job 3 at 2005-10-04 11:54&lt;br /&gt;
&lt;br /&gt;
       Now, if you execute the atq command, you'll get the following.&lt;br /&gt;
&lt;br /&gt;
           $ atq&lt;br /&gt;
           3       2005-10-04 11:54 x chirico&lt;br /&gt;
&lt;br /&gt;
       It's also possible to execute jobs at the command line entering&lt;br /&gt;
       a ctl-d at the end of the input.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x  -m 12:08pm&lt;br /&gt;
           at&amp;gt; ls -l&lt;br /&gt;
           at&amp;gt; who&lt;br /&gt;
           at&amp;gt; date&lt;br /&gt;
           at&amp;gt; ^D&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Or for a job to execute 1 minute from now.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x -m `date -d '1 minute' +&amp;quot;%H:%M&amp;quot;`&lt;br /&gt;
           at&amp;gt; ls -l&lt;br /&gt;
           at&amp;gt; date&lt;br /&gt;
     &lt;br /&gt;
&lt;br /&gt;
     Important points: The atd daemon must be running. To check if&lt;br /&gt;
      it's running do the following:&lt;br /&gt;
&lt;br /&gt;
            $ /etc/init.d/atd status&lt;br /&gt;
&lt;br /&gt;
      Also, if there is an /etc/at.allow file, then only users in that&lt;br /&gt;
      file will be allowed to execute at.&lt;br /&gt;
&lt;br /&gt;
      If /etc/at.deny exists but is empty and there is no /etc/at.allow,&lt;br /&gt;
      then, everyone can execute the at command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 200:&lt;br /&gt;
&lt;br /&gt;
     lsusb - command will display all USB buses and all devices connected.&lt;br /&gt;
&lt;br /&gt;
        $ lsusb&lt;br /&gt;
        Bus 005 Device 003: ID 413c:2010 Dell Computer Corp.&lt;br /&gt;
        Bus 005 Device 002: ID 413c:1003 Dell Computer Corp.&lt;br /&gt;
        Bus 005 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 004 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 003 Device 003: ID 0fc5:1227 Delcom Engineering&lt;br /&gt;
        Bus 003 Device 002: ID 046d:c016 Logitech, Inc. Optical Mouse&lt;br /&gt;
        Bus 003 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 002 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 001 Device 001: ID 0000:0000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 201:&lt;br /&gt;
&lt;br /&gt;
     Memory fragmentation - if you suspect workload memory fragmentation issues&lt;br /&gt;
     and you want to monitor the current state of you system, then, consider&lt;br /&gt;
     looking at the output from /proc/buddyinfo on recent kernels.&lt;br /&gt;
&lt;br /&gt;
        $ cat /proc/buddyinfo&lt;br /&gt;
      Node 0, zone      DMA    541    218     42      2      0      0      0      1      1      1      0 &lt;br /&gt;
      Node 0, zone   Normal   2508   2614     52      1      5      5      0      1      1      1      0 &lt;br /&gt;
      Node 0, zone  HighMem      0      1      3      0      1      0      0      0      0      0      0 &lt;br /&gt;
&lt;br /&gt;
     The following definition is taken from  ./Documentation/filesystems/proc.txt in the &lt;br /&gt;
     Linux kernel source.&lt;br /&gt;
&lt;br /&gt;
       Each column represents the number of pages of a certain order which are&lt;br /&gt;
       available.  In this case, there are 0 chunks of 2^0*PAGE_SIZE available in&lt;br /&gt;
       ZONE_DMA, 4 chunks of 2^1*PAGE_SIZE in ZONE_DMA, 101 chunks of 2^4*PAGE_SIZE&lt;br /&gt;
       available in ZONE_NORMAL, etc...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 202:&lt;br /&gt;
&lt;br /&gt;
     arp - Linux ARP kernel moduel.  This command implements the Address Resolution Protocol.&lt;br /&gt;
&lt;br /&gt;
     This is an example of the command.&lt;br /&gt;
&lt;br /&gt;
        $ arp&lt;br /&gt;
        Address                  HWtype  HWaddress           Flags Mask            Iface&lt;br /&gt;
        tape.squeezel.com        ether   00:50:DA:60:5B:AD   C                     eth0&lt;br /&gt;
        squeezel.squeezel.com    ether   00:11:11:8A:BE:3F   C                     eth0&lt;br /&gt;
        gw.squeezel.com          ether   00:0F:66:47:15:73   C                     eth0&lt;br /&gt;
&lt;br /&gt;
       &lt;br /&gt;
TIP 203:&lt;br /&gt;
&lt;br /&gt;
     dbench - performance monitoring. &lt;br /&gt;
&lt;br /&gt;
     So, how does your system react when the load average is above 600. Have you even seen a &lt;br /&gt;
     computer with a load average of 600? Well, this could be your chance. &lt;br /&gt;
&lt;br /&gt;
         Reference: http://freshmeat.net/projects/dbench/&lt;br /&gt;
&lt;br /&gt;
     The following gives a load average of 10 on my system.&lt;br /&gt;
&lt;br /&gt;
        $ dbench 34&lt;br /&gt;
&lt;br /&gt;
     If you want a higher load, just increase the number.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 204:&lt;br /&gt;
&lt;br /&gt;
     /etc guide - a listing of common files in the /etc directory.&lt;br /&gt;
&lt;br /&gt;
        /etc/exports: this file is used to configure NFS.&lt;br /&gt;
&lt;br /&gt;
        /etc/ftpusers: the users on your system who are restricted from FTP login.&lt;br /&gt;
&lt;br /&gt;
        /etc/motd: message of the day, which users see after login.&lt;br /&gt;
&lt;br /&gt;
        /etc/named.conf: DNS config file.&lt;br /&gt;
&lt;br /&gt;
        /etc/profile: common user information.&lt;br /&gt;
&lt;br /&gt;
        /etc/inittab: this file contains runlevel start information.&lt;br /&gt;
&lt;br /&gt;
        /etc/services: the services and their respective ports.&lt;br /&gt;
&lt;br /&gt;
        /etc/shells: this contains the names of all shells installed on the system.&lt;br /&gt;
&lt;br /&gt;
        /etc/passwd: this file contains user information.&lt;br /&gt;
&lt;br /&gt;
        /etc/group: security group rights.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
TIP 205: &lt;br /&gt;
&lt;br /&gt;
     logger - is a bash command utility for writing to /var/log/messages or the&lt;br /&gt;
            other files defined in /etc/syslog.conf.&lt;br /&gt;
&lt;br /&gt;
            $ logger -t TEST more of a test here&lt;br /&gt;
&lt;br /&gt;
         This is what shows up in /var/log/messages&lt;br /&gt;
  &lt;br /&gt;
            Oct 28 07:15:50 squeezel TEST: more of a test here&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
TIP 206: &lt;br /&gt;
&lt;br /&gt;
     accton, lastcomm - accouting on and last command. This is &lt;br /&gt;
         a way to monitor users on your system. As root, you &lt;br /&gt;
         would implement this as follows:&lt;br /&gt;
&lt;br /&gt;
           $ accton -h&lt;br /&gt;
            Usage: accton [-hV] [file]&lt;br /&gt;
            [--help] [--version]&lt;br /&gt;
&lt;br /&gt;
            The system's default process accounting file is /var/account/pacct.&lt;br /&gt;
&lt;br /&gt;
         Note the default file location is /var/account/pacct so we'll turn&lt;br /&gt;
         it on system wide with the following command.&lt;br /&gt;
&lt;br /&gt;
           $ accton /var/account/pacct&lt;br /&gt;
&lt;br /&gt;
         Now take a look at this file. It will grow. To see command that&lt;br /&gt;
         are executed, use the lastcomm command.&lt;br /&gt;
&lt;br /&gt;
           $ lastcomm&lt;br /&gt;
&lt;br /&gt;
         The above command gives output for all users. To get the data&lt;br /&gt;
         for user &amp;quot;chirico&amp;quot; execute the following command:&lt;br /&gt;
&lt;br /&gt;
           $ lastcomm --user chirico&lt;br /&gt;
&lt;br /&gt;
         You can also get a summary of commands with sa.&lt;br /&gt;
&lt;br /&gt;
           [chirico@big ~]$ sa&lt;br /&gt;
           30       5.23re       0.00cp    10185k&lt;br /&gt;
           11       4.83re       0.00cp     8961k   ***other&lt;br /&gt;
            8       0.13re       0.00cp    19744k   nagios*&lt;br /&gt;
            4       0.00re       0.00cp     2542k   automount*&lt;br /&gt;
            3       0.00re       0.00cp      680k   sa&lt;br /&gt;
            2       0.13re       0.00cp    17424k   check_ping&lt;br /&gt;
            2       0.13re       0.00cp      978k   ping&lt;br /&gt;
&lt;br /&gt;
         To turn off accounting, execute accton without a filename.&lt;br /&gt;
&lt;br /&gt;
           $ accton&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 207:&lt;br /&gt;
&lt;br /&gt;
     CPU Temperature on a laptop. The following is the temperature&lt;br /&gt;
       of my Dell laptop. &lt;br /&gt;
&lt;br /&gt;
           $ cat /proc/acpi/thermal_zone/THM/temperature&lt;br /&gt;
           temperature:             58 C&lt;br /&gt;
&lt;br /&gt;
      &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 208:&lt;br /&gt;
&lt;br /&gt;
     script -f with mkfifo to allow another user to view what you type&lt;br /&gt;
          in real-time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Step 1.  Create a fifo (first in first out) file that the other&lt;br /&gt;
              user can view. For this example create the file /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
               [chirico@laptop ~]$ mkfifo /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
        Step 2.  Have the second user, voyeur user, cat this file. Output will block&lt;br /&gt;
              for them until you complete step 3. The other user, voyer,&lt;br /&gt;
              is executing the command below.&lt;br /&gt;
 &lt;br /&gt;
               [voyeur@laptop ~]$ cat /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
        Step 3.  The original user runs the following command.&lt;br /&gt;
&lt;br /&gt;
               [chirico@laptop ~]$ script -f  /tmp/scriptout&lt;br /&gt;
               Script started, file is /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
             Now anything typed, including a vi session, will be displayed to the&lt;br /&gt;
             voyeur user in step 2. &lt;br /&gt;
&lt;br /&gt;
        See TIP 46.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 209:&lt;br /&gt;
&lt;br /&gt;
     fsck forced on next reboot.  To do this, as root issue the following commands.&lt;br /&gt;
&lt;br /&gt;
            $ cd /&lt;br /&gt;
            $ touch forcefsck&lt;br /&gt;
&lt;br /&gt;
          Now reboot the system, and when it comes up fsck will be forced on the system.&lt;br /&gt;
&lt;br /&gt;
            $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 210:&lt;br /&gt;
&lt;br /&gt;
     /dev/random and /dev/urandom differ in their random generating properties. /dev/random&lt;br /&gt;
        only returns bytes when enough noise has been generated from the entropy pool. In&lt;br /&gt;
        contrast /dev/urandom will always return bytes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference: http://sourceforge.net/direct-dl/mchirico/cpearls/simple_but_common.tar.gz (rand.c)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 211:&lt;br /&gt;
&lt;br /&gt;
     Want to find out the speed of your NIC?  (Full Duplex or Half), then use ethtool.&lt;br /&gt;
&lt;br /&gt;
               [root@squeezel ~]# ethtool eth0&lt;br /&gt;
               Settings for eth0:&lt;br /&gt;
                       Supported ports: [ MII ]&lt;br /&gt;
                       Supported link modes:   10baseT/Half 10baseT/Full&lt;br /&gt;
                                               100baseT/Half 100baseT/Full&lt;br /&gt;
                                               1000baseT/Half 1000baseT/Full&lt;br /&gt;
                       Supports auto-negotiation: Yes&lt;br /&gt;
                       Advertised link modes:  10baseT/Half 10baseT/Full&lt;br /&gt;
                                               100baseT/Half 100baseT/Full&lt;br /&gt;
                                               1000baseT/Half 1000baseT/Full&lt;br /&gt;
                       Advertised auto-negotiation: Yes&lt;br /&gt;
                       Speed: 100Mb/s&lt;br /&gt;
                       Duplex: Full&lt;br /&gt;
                       Port: Twisted Pair&lt;br /&gt;
                       PHYAD: 1&lt;br /&gt;
                       Transceiver: internal&lt;br /&gt;
                       Auto-negotiation: on&lt;br /&gt;
                       Supports Wake-on: g&lt;br /&gt;
                       Wake-on: d&lt;br /&gt;
                       Current message level: 0x000000ff (255)&lt;br /&gt;
                       Link detected: yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 212:&lt;br /&gt;
&lt;br /&gt;
     rpm install hang? You might need to delete the lock state information. &lt;br /&gt;
&lt;br /&gt;
        $ nl /etc/rc.d/rc.sysinit | grep rpm&lt;br /&gt;
        720   rm -f /var/lib/rpm/__db* &amp;amp;&amp;gt; /dev/null&lt;br /&gt;
&lt;br /&gt;
     Note the command &lt;br /&gt;
&lt;br /&gt;
        $ rm -f /var/lib/rpm/__db*&lt;br /&gt;
&lt;br /&gt;
     Because sometimes you will run &amp;quot;rpm -ivh somerpm&amp;quot; and it will just sit&lt;br /&gt;
     there.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 213:&lt;br /&gt;
&lt;br /&gt;
     Apache - limit access to certain directories based on IP address in the&lt;br /&gt;
         httpd.conf file.&lt;br /&gt;
&lt;br /&gt;
          You can do this completely from /etc/httpd/conf/httpd.conf which&lt;br /&gt;
          are shown below for multiple IP addresses. Note that all 3 setting&lt;br /&gt;
          are the same.&lt;br /&gt;
&lt;br /&gt;
                10.0.0.0/255.0.0.0&lt;br /&gt;
                10.0.0.0/8&lt;br /&gt;
                10&lt;br /&gt;
&lt;br /&gt;
          However, the following is different&lt;br /&gt;
&lt;br /&gt;
                10.0.0.0/24   only allows 10.0.0.1 to 10.0.0.254&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Some complete settings in /etc/httpd/conf/httpd.conf &lt;br /&gt;
&lt;br /&gt;
             &amp;lt;Directory /var/www/html/chirico/&amp;gt;&lt;br /&gt;
                 Order allow,deny&lt;br /&gt;
                 Allow from 10.0.0.0/8      # All 10.&lt;br /&gt;
                 Allow from 192.168.0.0/16  # All 192.168&lt;br /&gt;
                 Allow from 127             # All 127.&lt;br /&gt;
             &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          Don't forget to reload httpd with the following command.&lt;br /&gt;
        &lt;br /&gt;
             $ /etc/init.d/httpd reload&lt;br /&gt;
&lt;br /&gt;
          &lt;br /&gt;
&lt;br /&gt;
TIP 214:&lt;br /&gt;
&lt;br /&gt;
     Open Files - determining how many files are currently open.&lt;br /&gt;
&lt;br /&gt;
             $ cat /proc/sys/fs/file-nr&lt;br /&gt;
             2030    263     104851&lt;br /&gt;
              |       |        \- maximum open file descriptors &lt;br /&gt;
              |       |         &lt;br /&gt;
              |       \- total free allocated file descriptors&lt;br /&gt;
              |&lt;br /&gt;
              (Total allocated file descriptors since boot)&lt;br /&gt;
&lt;br /&gt;
        Note the maximum number can be set or changed.&lt;br /&gt;
&lt;br /&gt;
              $ cat /proc/sys/fs/file-max&lt;br /&gt;
              104851&lt;br /&gt;
&lt;br /&gt;
        To change this&lt;br /&gt;
&lt;br /&gt;
              $ echo &amp;quot;804854&amp;quot; &amp;gt; /proc/sys/fs/file-max&lt;br /&gt;
 &lt;br /&gt;
        Note lsof | wc -l will report higher numbers because this includes&lt;br /&gt;
        open files that are not using file descriptors such as directories,&lt;br /&gt;
        memory mapped files, and executable text files.&lt;br /&gt;
&lt;br /&gt;
        (Reference http://www.netadmintools.com/art295.html&lt;br /&gt;
         and also see the man page for this: man 5 proc )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 215:&lt;br /&gt;
&lt;br /&gt;
     Ctrl-Alt-Del will cause an immediate reboot, without syncing dirty buffers by&lt;br /&gt;
     setting the value &amp;gt; 0 in /proc/sys/kernel/ctrl-alt-del.&lt;br /&gt;
&lt;br /&gt;
               $ echo 1 &amp;gt; /proc/sys/kernel/ctrl-alt-del&lt;br /&gt;
       &lt;br /&gt;
&lt;br /&gt;
        (Reference: man 5 proc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 216:&lt;br /&gt;
&lt;br /&gt;
     Redefining keys in X using xev and xmodmap.  The program xev, used in an X window &lt;br /&gt;
     terminal screen will display information on mouse movements, keys pressed and &lt;br /&gt;
     released.&lt;br /&gt;
&lt;br /&gt;
        $ xev&lt;br /&gt;
&lt;br /&gt;
     Now type shift-4 and you'll notice the event details below:&lt;br /&gt;
&lt;br /&gt;
        KeyPress event, serial 29, synthetic NO, window 0x3800001,&lt;br /&gt;
            root 0x60, subw 0x0, time 55307049, (418,242), root:(428,339),&lt;br /&gt;
            state 0x1, keycode 13 (keysym 0x24, dollar), same_screen YES,&lt;br /&gt;
            XLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
            XmbLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
            XFilterEvent returns: False&lt;br /&gt;
        &lt;br /&gt;
        KeyRelease event, serial 29, synthetic NO, window 0x3800001,&lt;br /&gt;
            root 0x60, subw 0x0, time 55307184, (418,242), root:(428,339),&lt;br /&gt;
            state 0x1, keycode 13 (keysym 0x24, dollar), same_screen YES,&lt;br /&gt;
            XLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
       &lt;br /&gt;
     So, if you want to redefine this key to say copyright, see (/usr/X11R6/include/X11/keysymdef.h)&lt;br /&gt;
     you would type the following.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 copyright'&lt;br /&gt;
&lt;br /&gt;
     To get the key back to the dollar, issue the following command.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 dollar'&lt;br /&gt;
&lt;br /&gt;
     By the way it's possible to define multiple key codes for a sigle key. You'll need&lt;br /&gt;
     to have a key defined as the Mode_switch. Perhaps you'd like to use the Windows key,&lt;br /&gt;
     or the key with the Microsoft logo on it, since you're using Linux. This key is&lt;br /&gt;
     keycode 115&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 115 = Mode_switch'&lt;br /&gt;
&lt;br /&gt;
     Now you could define 3 values to the shift-4. For this example use ld, Yen and dollar.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 dollar sterling yen'&lt;br /&gt;
&lt;br /&gt;
     So pressing the keys gives you the following:&lt;br /&gt;
&lt;br /&gt;
          shift-$          (dollar sign)&lt;br /&gt;
          Windows-$        (lb sign)&lt;br /&gt;
          Windows-shift-$  (Yen sign)&lt;br /&gt;
&lt;br /&gt;
     You could go crazy and redefine all you keys.&lt;br /&gt;
&lt;br /&gt;
     (Thanks to hisham for this tip).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 217:&lt;br /&gt;
&lt;br /&gt;
     Threads - which version of threads are you using?&lt;br /&gt;
&lt;br /&gt;
          $ getconf GNU_LIBPTHREAD_VERSION&lt;br /&gt;
          NPTL 2.3.90&lt;br /&gt;
&lt;br /&gt;
     For a history on threads used with gcc reference the following:&lt;br /&gt;
          &lt;br /&gt;
          http://en.wikipedia.org/wiki/NPTL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 218:&lt;br /&gt;
&lt;br /&gt;
     Screenshots using ImageMagick. &lt;br /&gt;
&lt;br /&gt;
        If you want the entire screen, execute the following:&lt;br /&gt;
&lt;br /&gt;
            $ import -window root screen.png&lt;br /&gt;
&lt;br /&gt;
        Or to crosshair select the region with your mouse, execute &lt;br /&gt;
        the following instead.&lt;br /&gt;
&lt;br /&gt;
            $ import screen.png&lt;br /&gt;
&lt;br /&gt;
        KDE has the ability to take screenshots with the command below.&lt;br /&gt;
&lt;br /&gt;
            $ ksnapshot&lt;br /&gt;
&lt;br /&gt;
        GNOME likewise has a command too.&lt;br /&gt;
&lt;br /&gt;
            $ gnome-panel-screenshot --delay 6&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Visting ImageMagick again, the xwininfo command give window information and the id can be&lt;br /&gt;
        used to capture images with the import command.&lt;br /&gt;
&lt;br /&gt;
            $ xwininfo&lt;br /&gt;
&lt;br /&gt;
          xwininfo: Please select the window about which you&lt;br /&gt;
          would like information by clicking the&lt;br /&gt;
          mouse in that window.&lt;br /&gt;
&lt;br /&gt;
          xwininfo: Window id: 0x1e00007 &amp;quot;chirico@squeezel:/work/svn/souptonuts - Shell - Konsole&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          Absolute upper-left X:  4&lt;br /&gt;
          Absolute upper-left Y:  21&lt;br /&gt;
          Relative upper-left X:  0&lt;br /&gt;
          Relative upper-left Y:  0&lt;br /&gt;
          Width: 880&lt;br /&gt;
          Height: 510&lt;br /&gt;
          Depth: 24&lt;br /&gt;
          Visual Class: TrueColor&lt;br /&gt;
          Border width: 0&lt;br /&gt;
          Class: InputOutput&lt;br /&gt;
          Colormap: 0x20 (installed)&lt;br /&gt;
          Bit Gravity State: NorthWestGravity&lt;br /&gt;
          Window Gravity State: NorthWestGravity&lt;br /&gt;
          Backing Store State: NotUseful&lt;br /&gt;
          Save Under State: no&lt;br /&gt;
          Map State: IsViewable&lt;br /&gt;
          Override Redirect State: no&lt;br /&gt;
          Corners:  +4+21  -396+21  -396-493  +4-493&lt;br /&gt;
          -geometry 880x510+0+0&lt;br /&gt;
&lt;br /&gt;
        Now use the import command with the Window id. My example is shown below.&lt;br /&gt;
&lt;br /&gt;
             $ import -window 0x1e00007  id.miff&lt;br /&gt;
&lt;br /&gt;
        And to quickly display this image that you just saved, use the display command.&lt;br /&gt;
&lt;br /&gt;
             $ display id.miff &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 219:&lt;br /&gt;
&lt;br /&gt;
     File Access over SSH using FUSE (Filesystem in USErspace). This is a very good way to &lt;br /&gt;
     mount a remote filesystem locally. It's  like a secure NFS mount, but you don't require &lt;br /&gt;
     admin privileges on the remote computer. You do need to have fuse-sshfs installed on &lt;br /&gt;
     the local computer that will perform the filesystem mount.&lt;br /&gt;
&lt;br /&gt;
     The following works with Fedora Core 5. Only the users added to the fuse group can mout &lt;br /&gt;
     external drives. Below the user chirico is being added to the group fuse.&lt;br /&gt;
&lt;br /&gt;
             $ yum install fuse-sshfs&lt;br /&gt;
             $ usermod -a -G fuse chirico&lt;br /&gt;
     &lt;br /&gt;
     You'll need to reboot.&lt;br /&gt;
&lt;br /&gt;
             $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
             &lt;br /&gt;
     Next I'm going to mount the remote filesystem v0.squeezel.com. This is done as user chirico&lt;br /&gt;
     on the local computer. I'm using root on the remote computer v0.squeezel.com because I&lt;br /&gt;
     want to mount the complete drive.&lt;br /&gt;
&lt;br /&gt;
             $ mkdir v0&lt;br /&gt;
             $ sshfs root@v0.squeezel.com:/  v0&lt;br /&gt;
             $ cd v0&lt;br /&gt;
             $ ls -l&lt;br /&gt;
               bin   dev  home  lost+found     media  mnt  opt   q     sbin     srv  tmp  var&lt;br /&gt;
               boot  etc  lib   master_backup  misc   net  proc  root  selinux  sys  usr&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
     Now to unmount the filesystem&lt;br /&gt;
&lt;br /&gt;
             $ fusermount -u /home/chirico/v0&lt;br /&gt;
&lt;br /&gt;
     Yes, you can mount the filesystem on boot. Below shows an example entry for /etc/fstab, but&lt;br /&gt;
     this only allows user on the current system to view what is is /mnt/v0. &lt;br /&gt;
&lt;br /&gt;
             sshfs#root@v0.squeezel.com:/var/log             /mnt/v0 fuse defaults    0 0&lt;br /&gt;
&lt;br /&gt;
     References:&lt;br /&gt;
        (http://fuse.sourceforge.net/sshfs.html)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 220:&lt;br /&gt;
&lt;br /&gt;
     OpenVPN - A full-featured SSL VPN solution. The following demonstrates&lt;br /&gt;
               a very simple OpenVPN setup between two Fedora Core 5 computers&lt;br /&gt;
               big.squeezel.com 192.168.1.12 and tape.squeezel.com 192.168.1.155&lt;br /&gt;
&lt;br /&gt;
               As root install the package on both computers.&lt;br /&gt;
&lt;br /&gt;
                  $ yum -y install openvpn&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Setup on big.squeezel.com 192.168.1.12&lt;br /&gt;
&lt;br /&gt;
                  $ iptables -A INPUT -p udp -s 192.168.1.155  --dport 1194 -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tun+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A FORWARD -i tap+ -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
             Note - make sure you have commented out the following line &lt;br /&gt;
                    in /etc/sysconfig/iptables&lt;br /&gt;
&lt;br /&gt;
                  # -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
&lt;br /&gt;
             Now from continuting with the commands that need to be executed on &lt;br /&gt;
             big.squeezel.com 192.168.1.12 do one of the following&lt;br /&gt;
           &lt;br /&gt;
                  $ openvpn --remote tape.squeezel.com  --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 --verb 9&lt;br /&gt;
&lt;br /&gt;
             The above statement gives lots of errors. Once it's working you may want&lt;br /&gt;
             the following statement without the --verb 9 option.&lt;br /&gt;
&lt;br /&gt;
                  $ openvpn --remote tape.squeezel.com  --dev tun1 --ifconfig 10.4.0.1 10.4.0.2&lt;br /&gt;
&lt;br /&gt;
             After you finish the setup commands for tape.squeezel.com immediately below, you'll be&lt;br /&gt;
             able to access tape.squeezel.com as 10.4.0.2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Setup on tape.squeezel.com 192.168.1.155&lt;br /&gt;
&lt;br /&gt;
                  $ iptables -A INPUT -p udp -s 192.168.1.12  --dport 1194 -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tun+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A FORWARD -i tap+ -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
             Note - again, make sure you have commented out the following line &lt;br /&gt;
                    in /etc/sysconfig/iptables&lt;br /&gt;
&lt;br /&gt;
                  # -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
&lt;br /&gt;
             The openvpn commands are tape.squeezel.com are reversed from what is shown&lt;br /&gt;
             above.&lt;br /&gt;
&lt;br /&gt;
                  $ openvpn --remote big.squeezel.com --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 --verb 9&lt;br /&gt;
&lt;br /&gt;
             Or&lt;br /&gt;
                  $ openvpn --remote big.squeezel.com --dev tun1 --ifconfig 10.4.0.2 10.4.0.1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             Now you can access all services and ports from big.squeezel.com on 10.4.0.1 for &lt;br /&gt;
             such services as MySQL, secure Web, imap, etc. A quick test is nmap as follows:&lt;br /&gt;
&lt;br /&gt;
                  $ nmap -A -T4 10.4.0.1&lt;br /&gt;
&lt;br /&gt;
                  Starting Nmap 4.03 ( http://www.insecure.org/nmap/ ) at 2006-05-20 13:54 EDT&lt;br /&gt;
                  Interesting ports on 10.4.0.1:&lt;br /&gt;
                  (The 1671 ports scanned but not shown below are in state: closed)&lt;br /&gt;
                  PORT     STATE SERVICE VERSION&lt;br /&gt;
                  22/tcp   open  ssh     OpenSSH 4.3 (protocol 2.0)&lt;br /&gt;
                  111/tcp  open  rpcbind  2 (rpc #100000)&lt;br /&gt;
                  3306/tcp open  mysql   MySQL (unauthorized)&lt;br /&gt;
&lt;br /&gt;
                  Nmap finished: 1 IP address (1 host up) scanned in 7.116 seconds&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 221:&lt;br /&gt;
&lt;br /&gt;
     openssl - Some common commands.&lt;br /&gt;
&lt;br /&gt;
             Finding the openssldir (Directory for OpenSSL files).&lt;br /&gt;
&lt;br /&gt;
                  $ openssl version -a|grep OPENSSLDIR&lt;br /&gt;
                  OPENSSLDIR: &amp;quot;/etc/pki/tls&amp;quot;&lt;br /&gt;
&lt;br /&gt;
             Connect to a secure SMTP server with STARTTLS, assuming the server name is&lt;br /&gt;
             squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
                  $ openssl s_client -connect squeezel.squeezel.com:25 -starttls&lt;br /&gt;
&lt;br /&gt;
         &lt;br /&gt;
&lt;br /&gt;
      Reference (http://www.madboa.com/geek/openssl/)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 222:&lt;br /&gt;
&lt;br /&gt;
     Bash functions. This is easy, and I find it very useful to create bash functions&lt;br /&gt;
     for repeated commands. For example, suppose you want to create a quick bash function&lt;br /&gt;
     to cd to /var/log, tail messages and tail secure. You can create this function as&lt;br /&gt;
     follows:&lt;br /&gt;
&lt;br /&gt;
                  [root@v5 log]# m()&lt;br /&gt;
                  m()&lt;br /&gt;
                  &amp;gt; { cd /var/log&lt;br /&gt;
                  { cd /var/log&lt;br /&gt;
                  &amp;gt; tail messages&lt;br /&gt;
                  tail messages&lt;br /&gt;
                  &amp;gt; tail secure&lt;br /&gt;
                  tail secure&lt;br /&gt;
                  &amp;gt; }&lt;br /&gt;
                  }&lt;br /&gt;
                  &lt;br /&gt;
     Above I'm typing m() then hitting return. Note the echo on the next line followed&lt;br /&gt;
     by the prompt &amp;gt;. I then enter {. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 223:&lt;br /&gt;
&lt;br /&gt;
     Stats on DNS Server. You can get stats on your DNS server. &lt;br /&gt;
&lt;br /&gt;
       The following works for BIND 9:&lt;br /&gt;
&lt;br /&gt;
                  $ rndc stats&lt;br /&gt;
&lt;br /&gt;
         On my system I see the output in &amp;quot;/var/named/chroot/var/named/data/named_stats.txt&amp;quot;, which&lt;br /&gt;
         if an FC4 system. By the way, if you're using BIND 8, the command is &amp;quot;ndc stats&amp;quot;, but that&lt;br /&gt;
         has a completely different format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Format of the output&lt;br /&gt;
&lt;br /&gt;
            +++ Statistics Dump +++ (1153791199)&lt;br /&gt;
            success 297621&lt;br /&gt;
            referral 32&lt;br /&gt;
            nxrrset 21953&lt;br /&gt;
            nxdomain 33742&lt;br /&gt;
            recursion 28243&lt;br /&gt;
            failure 54&lt;br /&gt;
            --- Statistics Dump --- (1153791199)&lt;br /&gt;
&lt;br /&gt;
      The number (1153791199) can be converted with the date command.&lt;br /&gt;
&lt;br /&gt;
                  $ date -d '1970-01-01 1153791199 sec'&lt;br /&gt;
                  Tue Jul 25 02:33:19 EDT 2006&lt;br /&gt;
&lt;br /&gt;
      That's 1153791199 seconds since 1970-01-01 UCT. Which is 4 hours fast,&lt;br /&gt;
      from EDT.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 224:&lt;br /&gt;
&lt;br /&gt;
     snmp - simple network monitoring protocol. The following steps setup snmp on Fedora Core 5.&lt;br /&gt;
&lt;br /&gt;
                  $ yum install net-snmp*&lt;br /&gt;
&lt;br /&gt;
         Next add the following line in &amp;quot;/etc/snmp/snmpd.conf&amp;quot; at the bottom.&lt;br /&gt;
&lt;br /&gt;
                  rocommunity pA33worD&lt;br /&gt;
&lt;br /&gt;
         Start the snmp service.&lt;br /&gt;
&lt;br /&gt;
                  $ /etc/init.d/snmpd restart&lt;br /&gt;
&lt;br /&gt;
         Once started, from the command prompt, it's possible to get stats on the computer.&lt;br /&gt;
&lt;br /&gt;
                  $ snmpwalk -v 1 -c pA33worD localhost system&lt;br /&gt;
         Or&lt;br /&gt;
                  $ snmpwalk -v 1 -c pA33worD localhost interface&lt;br /&gt;
&lt;br /&gt;
         Or&lt;br /&gt;
                  $ snmpgetnext -v 1 -c pA33worD localhost sysUpTime&lt;br /&gt;
                  DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (26452) 0:04:24.52&lt;br /&gt;
&lt;br /&gt;
         Note the Timeticks is in 100th of a second. So the computer above has been running&lt;br /&gt;
         for 264.52 seconds.&lt;br /&gt;
&lt;br /&gt;
         Reference( TIP 225 shows how to use MRTG for gathering snmp stats).&lt;br /&gt;
                  http://www.net-snmp.org/tutorial/tutorial-5/commands/snmpv3.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 225:&lt;br /&gt;
&lt;br /&gt;
     MRTG - Multi Router Traffic Grapher.  &lt;br /&gt;
&lt;br /&gt;
                  $ cfgmaker --output=/etc/mrtg/v5.squeezel.com \&lt;br /&gt;
                    ifref=ip --global &amp;quot;workdir:/var/www/html/mrtg/stats&amp;quot;\&lt;br /&gt;
                    pA33worD@v5.squeezel.com&lt;br /&gt;
&lt;br /&gt;
        Reference: http://www.chinalinuxpub.com/doc/www.siliconvalleyccie.com/linux-hn/mrtg.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 226:&lt;br /&gt;
&lt;br /&gt;
     Back Trace - This is a method of getting a back trace for all processes on the system.&lt;br /&gt;
                  it assumes the following: a. Kernel was build with CONFIG_MAGIC_SYS-REQ &lt;br /&gt;
                  enabled (which Fedora 5 kernels are) b. You can get direct access to the &lt;br /&gt;
                  monitor.&lt;br /&gt;
&lt;br /&gt;
             Step 1.&lt;br /&gt;
&lt;br /&gt;
                  Ctl-Alt-F1 (This brings you to the text console)&lt;br /&gt;
&lt;br /&gt;
             Step 2.&lt;br /&gt;
&lt;br /&gt;
                  Alt-ScrollLock &lt;br /&gt;
                  Ctl-ScrollLock&lt;br /&gt;
          &lt;br /&gt;
                  Note above that's Alt-ScrollLock followed by Ctl-ScrollLock. You should see&lt;br /&gt;
                  a lot of text on the screen. To fast to read, but don't worry the text will&lt;br /&gt;
                  be in /var/log/messages at the end.&lt;br /&gt;
&lt;br /&gt;
                  On my system the ScrollLock key is next to the NumLock key. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 227:&lt;br /&gt;
&lt;br /&gt;
     Ext3 Tuning - One advantage of Ext3 over Ext2 is directory indexing, which  imporves file&lt;br /&gt;
                  access in directories containing large files or when the directory contains&lt;br /&gt;
                  many files. Directory indexing improves performance by using hashed binary &lt;br /&gt;
                  trees. &lt;br /&gt;
&lt;br /&gt;
                  There are two ways to enable dir_index. First, find the device using the mount&lt;br /&gt;
                  command.&lt;br /&gt;
&lt;br /&gt;
                      $ mount&lt;br /&gt;
&lt;br /&gt;
                      /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)&lt;br /&gt;
                      proc on /proc type proc (rw)&lt;br /&gt;
                      sysfs on /sys type sysfs (rw)&lt;br /&gt;
                      devpts on /dev/pts type devpts (rw,gid=5,mode=620)&lt;br /&gt;
                      /dev/sda1 on /boot type ext3 (rw) &amp;lt;--- This is the one you want&lt;br /&gt;
                      tmpfs on /dev/shm type tmpfs (rw)&lt;br /&gt;
                      none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)&lt;br /&gt;
                      sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)&lt;br /&gt;
                      automount(pid2001) on /net type autofs (rw,fd=4,pgrp=2001,minproto=2,maxproto=4)                   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                  From the above command, the device used is /dev/sda1.  Using the tune2fs command,&lt;br /&gt;
                  directory indexing will only apply to directories created after running the &lt;br /&gt;
                  command below.               &lt;br /&gt;
&lt;br /&gt;
                       $ tune2fs -O dir_index /dev/sda1&lt;br /&gt;
&lt;br /&gt;
                  However, if you want it to apply to all directories, use the e2fsck command as  &lt;br /&gt;
                  shown below:&lt;br /&gt;
&lt;br /&gt;
                       $ e2fsck -D -f /dev/sda1&lt;br /&gt;
&lt;br /&gt;
                  You'll need to bypass the warning message.&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
     Reference: &amp;quot;Tuning Journaling File Systems: A small amount of effort an dtime can yield big&lt;br /&gt;
                results&amp;quot;,by Steve Best. Linux Magazine, September 10, 2006. This author as has&lt;br /&gt;
                a very good book titled: &amp;quot;Linux Debugging and Performance Tuning.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 228:&lt;br /&gt;
&lt;br /&gt;
     NIC bonding - binding two or more NICs to one IP address to improve performance. The following&lt;br /&gt;
                instructions were done on Fedora Core 5.&lt;br /&gt;
&lt;br /&gt;
         Step 1.&lt;br /&gt;
             &lt;br /&gt;
            Create the file ifcfg-bond0 with the IP address, netmask and gateway. Shown&lt;br /&gt;
            below is my file.&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-bond0&lt;br /&gt;
&lt;br /&gt;
                   DEVICE=bond0&lt;br /&gt;
                   IPADDR=192.168.1.12&lt;br /&gt;
                   NETMASK=255.255.255.0&lt;br /&gt;
                   GATEWAY=192.168.1.1&lt;br /&gt;
                   USERCTL=no&lt;br /&gt;
                   BOOTPROTO=none&lt;br /&gt;
                   ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
         Step 2.&lt;br /&gt;
&lt;br /&gt;
            Modify eth0, eth1 and eth2. Shown below are each one of my files. Note that&lt;br /&gt;
            you must comment out, or remove the ip address, netmask, gateway and hardware&lt;br /&gt;
            address from each one of these files, since settings should only come from&lt;br /&gt;
            the ifcfg-bond0 file above. I've chosen to comment out the lines, instead of &lt;br /&gt;
            removing, should I decide to unbond my NICS sometime in the future.&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth0&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:9D&lt;br /&gt;
                  #IPADDR=192.168.1.12&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  #GATEWAY=192.168.1.1&lt;br /&gt;
                  #USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  # Settings for Bond&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth1&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth1&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:C9&lt;br /&gt;
                  #IPADDR=192.168.1.13&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  #&lt;br /&gt;
                  # Settings for bonding&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth2&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth2&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:9D&lt;br /&gt;
                  #IPADDR=192.168.1.12&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  #GATEWAY=192.168.1.1&lt;br /&gt;
                  #USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
         Step 3.&lt;br /&gt;
&lt;br /&gt;
            Set the load parameters for bond0 bonding kernel module. Append the&lt;br /&gt;
            following lines to /etc/modprobe.conf &lt;br /&gt;
&lt;br /&gt;
                 # bonding commands &lt;br /&gt;
                 alias bond0 bonding&lt;br /&gt;
                 options bond0 mode=balance-alb miimon=100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Step 4.&lt;br /&gt;
&lt;br /&gt;
            Load the bond driver module from the command prompt.&lt;br /&gt;
&lt;br /&gt;
                 $ modprobe bonding&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Step 5.&lt;br /&gt;
&lt;br /&gt;
            Restart the network, or restart the computer. Note I restarted to computer,&lt;br /&gt;
            since my NICs above had MAC assignments.&lt;br /&gt;
&lt;br /&gt;
                 $ service network restart   # Or restart computer&lt;br /&gt;
&lt;br /&gt;
             Take a look at the proc settings. &lt;br /&gt;
&lt;br /&gt;
                 $ cat /proc/net/bonding/bond0 &lt;br /&gt;
                 Ethernet Channel Bonding Driver: v3.0.3 (March 23, 2006)&lt;br /&gt;
&lt;br /&gt;
                 Bonding Mode: adaptive load balancing&lt;br /&gt;
                 Primary Slave: None&lt;br /&gt;
                 Currently Active Slave: eth2&lt;br /&gt;
                 MII Status: up&lt;br /&gt;
                 MII Polling Interval (ms): 100&lt;br /&gt;
                 Up Delay (ms): 0&lt;br /&gt;
                 Down Delay (ms): 0&lt;br /&gt;
&lt;br /&gt;
                 Slave Interface: eth2&lt;br /&gt;
                 MII Status: up&lt;br /&gt;
                 Link Failure Count: 0&lt;br /&gt;
                 Permanent HW addr: 00:13:72:80:62:f0&lt;br /&gt;
            &lt;br /&gt;
     References:&lt;br /&gt;
&lt;br /&gt;
         http://www.cyberciti.biz/nixcraft/vivek/blogger/2006/04/linux-bond-or-team-multiple-network.php&lt;br /&gt;
          Good, well written article describing the steps above.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=24692&amp;amp;package_id=146474&lt;br /&gt;
          Documentation for bonding that can also be found in the kernel&lt;br /&gt;
          ./Documentation/networking/bonding.txt&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 229:&lt;br /&gt;
&lt;br /&gt;
     /etc/nsswitch.conf - System Databases and Name Service Switch configuration file. &lt;br /&gt;
&lt;br /&gt;
         This file determines lookup order of services. For example, to match a name&lt;br /&gt;
         to an IP address, an entry can be put into the /etc/hosts file. Or a DNS query&lt;br /&gt;
         can be made. What's the order?  Normally, it's the entry in the /etc/hosts file.&lt;br /&gt;
         because /etc/nsswitch.conf contains the following setting&lt;br /&gt;
        &lt;br /&gt;
            hosts:      files dns&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	 See man nsswitch.conf for more settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
THE FOLLOWING SECTIONS STARTS THE PROGRAMMING TIPS&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 1:&lt;br /&gt;
&lt;br /&gt;
     Simple open command that restarts the close if a signal&lt;br /&gt;
     occurs.  Also note, the POSIX standards committee decided&lt;br /&gt;
     all new functions would not use errno and would instead&lt;br /&gt;
     directly return the error number in the function.&lt;br /&gt;
&lt;br /&gt;
     A lot of functions return -1 on an error condition, then,&lt;br /&gt;
     set errno to the value of the error.  This will still work&lt;br /&gt;
     for all the well known functions; but, it's changing.&lt;br /&gt;
&lt;br /&gt;
     /* start of code open.c&lt;br /&gt;
        Compile gcc -o open open.c&lt;br /&gt;
&lt;br /&gt;
        Reference (Look for simple_but_common_x.x.x.tar.gz):&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79066&lt;br /&gt;
&lt;br /&gt;
                             */&lt;br /&gt;
     #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     #include &amp;lt;string.h&amp;gt;             /* for strerror(int errno) */&lt;br /&gt;
     #include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     #define BUFLEN 100&lt;br /&gt;
     extern int errno;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     int&lt;br /&gt;
     main (void)&lt;br /&gt;
     {&lt;br /&gt;
       int fp,error;&lt;br /&gt;
       char buf[BUFLEN+1];&lt;br /&gt;
&lt;br /&gt;
       if ((fp = open (&amp;quot;data&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1)&lt;br /&gt;
         {&lt;br /&gt;
           fprintf (stderr, &amp;quot;Can't open data: %s\n&amp;quot;, strerror (errno));&lt;br /&gt;
           return 1;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
       snprintf (buf, BUFLEN, &amp;quot;123&amp;quot;);&lt;br /&gt;
       write (fp, buf, strlen (buf));&lt;br /&gt;
&lt;br /&gt;
       // Restart close should a signal occur */&lt;br /&gt;
       while((( error = close (fp) ) == -1) &amp;amp;&amp;amp; (errno == EINTR));&lt;br /&gt;
       if(error == -1)&lt;br /&gt;
         perror(&amp;quot;Failed to close the file\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
       return 0;&lt;br /&gt;
      }&lt;br /&gt;
     /* end of open.c */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 2:&lt;br /&gt;
&lt;br /&gt;
     Example of setting the effective UID on a file&lt;br /&gt;
&lt;br /&gt;
     /*  start of code&lt;br /&gt;
       gcc uid_open.c -o uid_open&lt;br /&gt;
       su&lt;br /&gt;
       chown root.chirico uid_open&lt;br /&gt;
       chmod u+s uid_open&lt;br /&gt;
       exit&lt;br /&gt;
&lt;br /&gt;
       Now you can run this as chirico and write to the&lt;br /&gt;
       root directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     */&lt;br /&gt;
     #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;string.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     int main()&lt;br /&gt;
     {&lt;br /&gt;
             int fd;&lt;br /&gt;
&lt;br /&gt;
             if ((fd = open(&amp;quot;/root/datajunk&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1) {&lt;br /&gt;
                     fprintf(stderr, &amp;quot;Can't open file \n&amp;quot;);&lt;br /&gt;
                     return 1;&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
             write(fd, &amp;quot;0123456&amp;quot;, strlen(&amp;quot;0123456&amp;quot;));&lt;br /&gt;
             close(fd);&lt;br /&gt;
             return 0;&lt;br /&gt;
     }&lt;br /&gt;
&lt;br /&gt;
     /* end of code */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 3:&lt;br /&gt;
&lt;br /&gt;
     Writing a C http post.&lt;br /&gt;
&lt;br /&gt;
     For downloads reference:&lt;br /&gt;
      http://prdownloads.sourceforge.net/cpearls/spider.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 4:&lt;br /&gt;
&lt;br /&gt;
     Writing a 2.6.x Kernel Module:&lt;br /&gt;
&lt;br /&gt;
       Look for the latest version of &amp;quot;procreadwrite&amp;quot;.  This is a 2.6 kernel&lt;br /&gt;
       modules that demonstrates how to create /proc entires and write directly&lt;br /&gt;
       to user-land via tty.  It's updated to reflect replacement of &amp;quot;current-&amp;gt;tty&amp;quot;&lt;br /&gt;
       with &amp;quot;current-&amp;gt;signal-&amp;gt;tty&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79066&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 5:&lt;br /&gt;
&lt;br /&gt;
     Creating a filename with '\n'.  This goes with (TIP 71)&lt;br /&gt;
&lt;br /&gt;
         /**** topen.c ***********************************************************&lt;br /&gt;
           Filenames can be created with any character except the null character&lt;br /&gt;
           and a slash.&lt;br /&gt;
&lt;br /&gt;
           This example creates a file with returns '\n\n'&lt;br /&gt;
&lt;br /&gt;
           There's a way to remove a file by inode:&lt;br /&gt;
&lt;br /&gt;
               $ ls -libt *&lt;br /&gt;
&lt;br /&gt;
           And, once you know the inode&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec mv '{}' goodstuff \;&lt;br /&gt;
&lt;br /&gt;
           or&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec rm '{}' goodstuff \;&lt;br /&gt;
&lt;br /&gt;
           or&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec cat '{}' \;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Compile:&lt;br /&gt;
&lt;br /&gt;
             gcc -o topen -Wall -W -O2 -s -pipe  topen.c&lt;br /&gt;
&lt;br /&gt;
         Reference:&lt;br /&gt;
           http://prdownloads.sourceforge.net/cpearls/simple_but_common_0.0.14.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
         */&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         #include &amp;lt;string.h&amp;gt;             /* for strerror(int errno) */&lt;br /&gt;
         #include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         #define BUFLEN 100&lt;br /&gt;
         extern int errno;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         int&lt;br /&gt;
         main (void)&lt;br /&gt;
         {&lt;br /&gt;
           int fp,error;&lt;br /&gt;
           char buf[BUFLEN+1];&lt;br /&gt;
&lt;br /&gt;
           if ((fp = open (&amp;quot;\n\n\n\n\n\n\n\n\n&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1)&lt;br /&gt;
             {&lt;br /&gt;
               fprintf (stderr, &amp;quot;Can't open data: %s\n&amp;quot;, strerror (errno));&lt;br /&gt;
               return 1;&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
           snprintf (buf, BUFLEN, &amp;quot;123&amp;quot;);&lt;br /&gt;
           write (fp, buf, strlen (buf));&lt;br /&gt;
&lt;br /&gt;
           // Restart close should a signal occur */&lt;br /&gt;
           while((( error = close (fp) ) == -1) &amp;amp;&amp;amp; (errno == EINTR));&lt;br /&gt;
           if(error == -1)&lt;br /&gt;
             perror(&amp;quot;Failed to close the file\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
           return 0;&lt;br /&gt;
&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  **Note, if you want email notification after every 50 new tips have been&lt;br /&gt;
    added, then, click on the following link:&lt;br /&gt;
&lt;br /&gt;
     https://sourceforge.net/project/filemodule_monitor.php?filemodule_id=120838&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 6:&lt;br /&gt;
&lt;br /&gt;
     Working With The Lemon Parser Generator.&lt;br /&gt;
     http://prdownloads.sourceforge.net/souptonuts/lemon_examples.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 7:&lt;br /&gt;
&lt;br /&gt;
     copy command for std container output.&lt;br /&gt;
&lt;br /&gt;
        #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
        #include &amp;lt;list&amp;gt;&lt;br /&gt;
        #include &amp;lt;vector&amp;gt;&lt;br /&gt;
        #include &amp;lt;iterator&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        using namespace std;&lt;br /&gt;
        int main(void)&lt;br /&gt;
        {&lt;br /&gt;
          vector&amp;lt;int&amp;gt; v;&lt;br /&gt;
          list&amp;lt;int&amp;gt; l;&lt;br /&gt;
&lt;br /&gt;
          v.push_back(1);&lt;br /&gt;
          v.push_back(2);&lt;br /&gt;
          copy(v.begin(),v.end(),ostream_iterator&amp;lt;int&amp;gt;(cout,&amp;quot;\n&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          l.push_back(23);&lt;br /&gt;
          l.push_back(12);&lt;br /&gt;
          copy(l.begin(),l.end(),ostream_iterator&amp;lt;int&amp;gt;(cout,&amp;quot;\n&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 8:&lt;br /&gt;
&lt;br /&gt;
  /* Copyright (c) 2005 Mike Chirico mchirico@comcast.net mchirico@users.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Example of using virtual functions. Note the use of &amp;quot;initialization lists&amp;quot;&lt;br /&gt;
              for assinging the variable first and last.&lt;br /&gt;
&lt;br /&gt;
      Compile:&lt;br /&gt;
        g++ -o virtualfunc -Wall -W -O2 -s -pipe  virtual_function.cc&lt;br /&gt;
&lt;br /&gt;
      Download:&lt;br /&gt;
        http://prdownloads.sourceforge.net/cpearls/simple_but_common_cpp.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  */&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
  #include &amp;lt;string&amp;gt;&lt;br /&gt;
  #include &amp;lt;list&amp;gt;&lt;br /&gt;
  #include &amp;lt;algorithm&amp;gt;&lt;br /&gt;
  #include &amp;lt;iterator&amp;gt;&lt;br /&gt;
  #include &amp;lt;functional&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  using namespace std;&lt;br /&gt;
&lt;br /&gt;
  class Employee {&lt;br /&gt;
  string first,last;&lt;br /&gt;
  public:&lt;br /&gt;
    Employee(const string&amp;amp; fn=&amp;quot;John&amp;quot;,const  string&amp;amp; ln=&amp;quot;Smith&amp;quot;): first(fn),last(ln) {}&lt;br /&gt;
    virtual void print() const {&lt;br /&gt;
    cout &amp;lt;&amp;lt; &amp;quot;First name: &amp;quot; &amp;lt;&amp;lt; first &amp;lt;&amp;lt; &amp;quot;, Last name: &amp;quot; &amp;lt;&amp;lt; last &amp;lt;&amp;lt; endl;&lt;br /&gt;
    }&lt;br /&gt;
    virtual ~Employee() {}&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  class Manager : public Employee {&lt;br /&gt;
    int level;&lt;br /&gt;
    list&amp;lt;Employee*&amp;gt; subordinates;&lt;br /&gt;
  public:&lt;br /&gt;
    Manager(const string&amp;amp; fn=&amp;quot;Ivan&amp;quot;,const string&amp;amp; ln=&amp;quot;Stedwick&amp;quot;, int lvl=1): Employee(fn,ln), level(lvl) {}&lt;br /&gt;
    void print() {&lt;br /&gt;
      cout &amp;lt;&amp;lt; &amp;quot;Manager level: &amp;quot; &amp;lt;&amp;lt; level &amp;lt;&amp;lt; &amp;quot;  &amp;quot;;&lt;br /&gt;
      Employee::print();&lt;br /&gt;
      cout &amp;lt;&amp;lt; &amp;quot;Supervises:&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
      for_each(subordinates.begin(),subordinates.end(),mem_fun(&amp;amp;Employee::print));&lt;br /&gt;
      cout &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; endl;&lt;br /&gt;
    }&lt;br /&gt;
    void addstaff(Employee&amp;amp; staff){&lt;br /&gt;
      subordinates.push_front(&amp;amp;staff);&lt;br /&gt;
    }&lt;br /&gt;
    void addstaff(Employee* staff){&lt;br /&gt;
      subordinates.push_front(staff);&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   int main()&lt;br /&gt;
   {&lt;br /&gt;
     Employee p0(&amp;quot;Lisa&amp;quot;,&amp;quot;Payne&amp;quot;);&lt;br /&gt;
     Manager m0;&lt;br /&gt;
&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Zoe&amp;quot;,&amp;quot;Bear&amp;quot;)); /* uses void addstaff(Employee* staff) */&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Leah&amp;quot;,&amp;quot;Bopper&amp;quot;));&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Abby&amp;quot;,&amp;quot;Chicken&amp;quot;));&lt;br /&gt;
     m0.addstaff(p0);  /* void addstaff(Employee&amp;amp; staff)  needed for this one */&lt;br /&gt;
     m0.addstaff(new Employee());&lt;br /&gt;
     m0.print();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     return 0;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 9:&lt;br /&gt;
&lt;br /&gt;
   /*  Named Constructor Idiom.&lt;br /&gt;
       Reference: http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.6&lt;br /&gt;
&lt;br /&gt;
   */&lt;br /&gt;
   #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
   #include &amp;lt;cmath&amp;gt;&lt;br /&gt;
   using namespace std;&lt;br /&gt;
&lt;br /&gt;
   class Point {&lt;br /&gt;
&lt;br /&gt;
   public:&lt;br /&gt;
     static Point rectangular(float x, float y);&lt;br /&gt;
     static Point polar(float radius, float angle);&lt;br /&gt;
     float get_x() { return x_; }&lt;br /&gt;
     float get_y() { return y_; }&lt;br /&gt;
&lt;br /&gt;
   private:&lt;br /&gt;
     Point(float x, float y);&lt;br /&gt;
     float x_, y_;&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
   inline Point::Point(float x, float y)&lt;br /&gt;
     : x_(x), y_(y) {}&lt;br /&gt;
&lt;br /&gt;
   inline Point Point::rectangular(float x, float y)&lt;br /&gt;
   { return Point(x,y); }&lt;br /&gt;
&lt;br /&gt;
   inline Point Point::polar(float radius, float angle)&lt;br /&gt;
   { return Point(radius*cos(angle),radius*sin(angle)); }&lt;br /&gt;
&lt;br /&gt;
   int main(void)&lt;br /&gt;
   {&lt;br /&gt;
     Point p1 = Point::rectangular(5.7,1.2);&lt;br /&gt;
     Point p2 = Point::polar(5.7,1.2);&lt;br /&gt;
&lt;br /&gt;
     cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; p1.get_x() &amp;lt;&amp;lt; &amp;quot;, &amp;quot; &amp;lt;&amp;lt; p1.get_y() &amp;lt;&amp;lt; &amp;quot;)&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
     cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; p2.get_x() &amp;lt;&amp;lt; &amp;quot;, &amp;quot; &amp;lt;&amp;lt; p2.get_y() &amp;lt;&amp;lt; &amp;quot;)&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 10:&lt;br /&gt;
&lt;br /&gt;
   /* Copy_constructor_assignment.cc&lt;br /&gt;
      Copyright (c) 2004 GPL Mike Chirico, mchirico@comcast.net or mchirico@users.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
      Reference: &amp;quot;The C++ Programming Language&amp;quot;, 3rd ed, by Stroustrup&lt;br /&gt;
      pg. 246.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Download:&lt;br /&gt;
      http://prdownloads.sourceforge.net/cpearls/simple_but_common.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
   */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   class Name {&lt;br /&gt;
   public:&lt;br /&gt;
     char* s;&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   class Table {&lt;br /&gt;
     Name *p;&lt;br /&gt;
     size_t sz;&lt;br /&gt;
   public:&lt;br /&gt;
     Table(size_t s=15) {&lt;br /&gt;
               p = new Name[sz=s];&lt;br /&gt;
               for(size_t i=0; i&amp;lt; sz; ++i) p[i].s=&amp;quot;****&amp;quot;;&lt;br /&gt;
                          }&lt;br /&gt;
     Table(const Table &amp;amp;t);&lt;br /&gt;
     Table&amp;amp; operator=(const Table&amp;amp;);&lt;br /&gt;
     int prt();&lt;br /&gt;
     void asgn(char* ts,size_t index);&lt;br /&gt;
     ~Table(){ delete[] p; }&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Table&amp;amp; Table::operator=(const Table &amp;amp;t)&lt;br /&gt;
   {&lt;br /&gt;
     if( this != &amp;amp;t) {&lt;br /&gt;
       delete[] p;&lt;br /&gt;
       p = new Name[sz=t.sz];&lt;br /&gt;
       for(size_t i=0; i&amp;lt; t.sz; ++i) p[i]=t.p[i];&lt;br /&gt;
     }&lt;br /&gt;
     return *this;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   int Table::prt()&lt;br /&gt;
   {&lt;br /&gt;
     for(size_t i=0; i&amp;lt; sz; ++i) std::cout &amp;lt;&amp;lt; p[i].s &amp;lt;&amp;lt; &amp;quot; &amp;quot;;&lt;br /&gt;
     std::cout &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
     return 0;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   /*&lt;br /&gt;
     asgn will increase the array of strings, if needed&lt;br /&gt;
     to size index+1, and add the string ts to position&lt;br /&gt;
     index.&lt;br /&gt;
   */&lt;br /&gt;
   void Table::asgn(char* ts,size_t index)&lt;br /&gt;
   {&lt;br /&gt;
     if(index &amp;lt; sz ) {&lt;br /&gt;
        p[index].s=ts;&lt;br /&gt;
     }else if ( index &amp;gt;= sz ){&lt;br /&gt;
        Name *tp;&lt;br /&gt;
        tp=p;&lt;br /&gt;
&lt;br /&gt;
        p = new Name[index+1];&lt;br /&gt;
&lt;br /&gt;
        for(size_t i=0; i&amp;lt; sz; ++i) p[i].s=tp[i].s;&lt;br /&gt;
        delete [] tp;&lt;br /&gt;
        for(size_t i=sz; i &amp;lt; index; ++i)p[i].s=&amp;quot;****&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
        p[index].s=ts;&lt;br /&gt;
        sz=index+1;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   int main(void)&lt;br /&gt;
   {&lt;br /&gt;
&lt;br /&gt;
     Table t1;&lt;br /&gt;
     Table t2(5);&lt;br /&gt;
&lt;br /&gt;
     // this is bigger than initial sz&lt;br /&gt;
     t1.asgn(&amp;quot;myname&amp;quot;,20);&lt;br /&gt;
     t1.prt();&lt;br /&gt;
     t2.prt();&lt;br /&gt;
&lt;br /&gt;
     t1=t2;&lt;br /&gt;
&lt;br /&gt;
     t1.prt();&lt;br /&gt;
     t2.prt();&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REFERENCES:&lt;br /&gt;
&lt;br /&gt;
  (1)  http://www.tldp.org/LDP/abs/html/index.html&lt;br /&gt;
  (2)  http://www.shelldorado.com/&lt;br /&gt;
  (3)  http://www.faqs.org/ftp/usenet/news.answers/unix-faq/faq/part1&lt;br /&gt;
  (4)  http://www-106.ibm.com/developerworks/library/l-rpm1/&lt;br /&gt;
  (5)  http://www-136.ibm.com/developerworks/linux/&lt;br /&gt;
  (6)  http://www.gnu.org/manual/manual.html&lt;br /&gt;
  (7)  http://fedora.redhat.com/&lt;br /&gt;
  (8)  http://souptonuts.sourceforge.net/chirico/index.php&lt;br /&gt;
  (9)  http://www.faqs.org/faqs/&lt;br /&gt;
 (10)  http://www.faqs.org/docs/linux_network/&lt;br /&gt;
 (11)  http://www.tml.hut.fi/~viu/linux/sag/sag-0.6.2.html/index.html&lt;br /&gt;
 (12)  http://www.yolinux.com/TUTORIALS/LinuxTutorialSysAdmin.html&lt;br /&gt;
 (13)  http://sed.sourceforge.net/grabbag/scripts/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  SUMMARY:&lt;br /&gt;
   (1)(2)(3) Excellent resource for bash scripts.&lt;br /&gt;
   (4)       rpm resource&lt;br /&gt;
   (6)       GNU Manuals Online&lt;br /&gt;
   (7)       Fedora&lt;br /&gt;
   (8)       Authors Website&lt;br /&gt;
   (11)(12)  System Admin&lt;br /&gt;
   (13)      Excellent source of sed scripts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
HIGHLY RECOMMENDED BOOKS:&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX Network Programming, The Sockets Networking API&amp;quot;, Volume 1, Third Edition.&lt;br /&gt;
        W. Richard Stevens, Bill Fenner, Andrew M. Rudoff.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX Network Programming, Interprocess Communications&amp;quot;, Volume 2, Second Edition.&lt;br /&gt;
        W. Richard Stevens.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX SYSTEMS Programming, Communication, Concurrency, and Threads&amp;quot;, Kay A. Robbins,&lt;br /&gt;
        Steven Robbins&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming with POSIX Threads&amp;quot;, David R. Butenhof. Addison-Wesley&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;The C++ Programming Language&amp;quot; Third Edition. Bjarne Stroustrup. Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C Programming Language&amp;quot; (2nd Edition), Second Edition, Kernighan and Ritchie&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Advanced Linux Programming&amp;quot; by Mark Mitchell, Jeffrey Oldham, and Alex Samuel, of&lt;br /&gt;
        CodeSourcery LL. This book if free at the following resource:&lt;br /&gt;
        http://www.advancedlinuxprogramming.com/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Accelerated C++, Practical Programming by Example&amp;quot; Andrew Koenig, Barbara E. Moo.&lt;br /&gt;
        Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C: A Reference Manual&amp;quot;, Fifth Edition, Samuel P. Harbison, Guy L. Steele.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Standard Library: A Tutorial and Reference, The&amp;quot;, Nicolai M. Josuttis. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Templates: The Complete Guide&amp;quot;, David Vandevoorde, Nicolai M. Josuttis. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Exceptional C++: 47 Engineering Puzzles, Programming Problems, and Solutions&amp;quot;, Herb Sutter.&lt;br /&gt;
     Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;More Exceptional C++&amp;quot;, Herb Sutter.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Exceptional C++ Style: 40 New Engineering Puzzles, Programming Problems, and Solutions&amp;quot;,&lt;br /&gt;
       Herb Sutter. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;The Art of Computer Programming (TAOCP)&amp;quot;, Vol 1,Vol 2, Vol 3. Donald E. Knuth. Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming Perl, 3rd Edition&amp;quot;, Tom Christiansen, Jon Orwant, Larry Wall. O'Reilly.&lt;br /&gt;
       http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming from the Ground Up&amp;quot;, Jonathan Bartlett, Edited by Dominick Bruno, Jr.&lt;br /&gt;
       http://savannah.nongnu.org/download/pgubook/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Expert C Programming&amp;quot;, Peter van der Linden, Prentice Hall PTR.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Coding Standards 101 Rules, Guidelines, and Best Practices&amp;quot;, by Herb Sutter and&lt;br /&gt;
       Andrei Alexandrescu.  http://www.gotw.ca/publications/c++cs/bibliography.htm&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Linux Kernel Development: A practical guide to the design and implementation of&lt;br /&gt;
       the Linux kernel&amp;quot;, by Robert Love, Sams Publishing.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond&amp;quot;, by&lt;br /&gt;
       David Abrahams and Aleksey Gurtovoy. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
HIGHLY RECOMMENDED: PHILOSOPHICAL&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;Zen and the Art of Motorcycle Maintenance: An Inquiry into Values&amp;quot;, Robert Pirsig.&lt;br /&gt;
        http://www.virtualschool.edu/mon/Quality/PirsigZen/index.html&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;Lila: An Inquiry Into Morals&amp;quot;, Robert Pirsig.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RECOMMENDED BOOKS:&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Structure and Interpretation of Computer Programs&amp;quot;, Harold Abelson, Gerald Jay Sussman,&lt;br /&gt;
      Julie Sussman. This book is free:&lt;br /&gt;
        http://mitpress.mit.edu/sicp/full-text/book/book.html&lt;br /&gt;
              and&lt;br /&gt;
        http://www.gnu.org/software/mit-scheme/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RECOMMENDED HOTOS:&lt;br /&gt;
&lt;br /&gt;
    Linux Networking-HOWTO (Previously the Net-3 Howto)&lt;br /&gt;
     http://en.tldp.org/HOWTO/NET3-4-HOWTO.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CORRECTIONS:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following people made suggestions and corrections:&lt;br /&gt;
  - Jorge Fabregas &amp;lt;fabregasj@prtc.net&amp;gt; TIP 21&lt;br /&gt;
  - Malcolm Parsons &amp;lt;malcolm.parsons@gmail.com&amp;gt; TIP 44&lt;br /&gt;
  - Andreas Haunschmidt &amp;lt;Andreas.Haunschmidt@utanet.at&amp;gt; TIP 102, TIP 90&lt;br /&gt;
  - P@draigBrady.com (Following links )&lt;br /&gt;
  - Jacques.GARNIER-EXTERIEUR@EU.RHODIA.COM TIP 46&lt;br /&gt;
&lt;br /&gt;
                http://www.pixelbeat.org/cmdline.html&lt;br /&gt;
                http://www.pixelbeat.org/rotagator/linux.tips/rotagator.fortune&lt;br /&gt;
                http://www.pixelbeat.org/scripts/&lt;br /&gt;
&lt;br /&gt;
  - Tobias Nix &amp;lt;tobias.nix@gmail.com&amp;gt; TIP 12&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>C4tboCcdro</name></author>	</entry>

	<entry>
		<id>https://wiki.gacq.com/index.php?title=Linux_tips&amp;diff=2757</id>
		<title>Linux tips</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacq.com/index.php?title=Linux_tips&amp;diff=2757"/>
				<updated>2009-01-10T02:28:49Z</updated>
		
		<summary type="html">&lt;p&gt;C4tboCcdro: http://huruple.qsh.eu/20081227-sara-jay-xxx.htm&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://huruple.qsh.eu/20081227-sara-jay-xxx.htm sara jay xxx movie] [http://naceceli.qsh.eu/sitemap.html link] [http://huruple.qsh.eu/20090105-adc-video-patch.htm adc video patch panel] [http://tulilre.strefa.pl/2008-12-27-imovie-5-download.html imovie 5 download] [http://faquafav.is-the-boss.com/text-545.htm pinnacle studio 9.0 serial] &lt;br /&gt;
[http://mahohmie.qsh.eu/resource1805.htm spongebob tv movie character toy] [http://fademon.0lx.net/article-1434.htm put music videos on your psp for free] [http://acsitzar.0lx.net/news-joes-movies-2008-11-12.html joes movies] [http://caraines.qsh.eu/defanele.htm iran movie] [http://betheres.qsh.eu/comment-180.htm movie prime cut] &lt;br /&gt;
[http://caraines.qsh.eu/zelgolg.htm amc movie .com] [http://caraines.qsh.eu/zmexplnrb.htm ejaculate galleries.squirting video] [http://spfortne.qsh.eu/20081226-adult-alyssa.html adult alyssa milano movie] [http://lofaako.strefa.pl/sitemap.html map] [http://caraines.qsh.eu/caelttro.htm anne curtis video scandal download] &lt;br /&gt;
[http://zelgetgo.0lx.net/sitemap.htm url] [http://relquaca.is-the-boss.com/20090104-lanhound-serial.html lanhound serial number] [http://bukgetert.0lx.net/article-28.htm sitemap] [http://fispruil.qsh.eu/news1763.html she will be loved video cast maroon 5] [http://bukgetert.0lx.net/article-52.htm make a movie screen] &lt;br /&gt;
[http://lifokdron.0lx.net/1739.html michael thriller video] [http://huruple.qsh.eu/20090101-interracial-video.htm interracial video tgp] [http://relquaca.is-the-boss.com/20090103-password-stealer.html password stealer crack] [http://acsitzar.0lx.net/news-most-wanted-2008-11-17.html most wanted movie] [http://vihencbr.0lx.net/secure-video.html secure video chat] &lt;br /&gt;
[http://acsitzar.0lx.net/news-jethro-tull-videos-2008-11-19.html jethro tull videos] [http://bukgetert.0lx.net/sitemap.htm links] [http://lifokdron.0lx.net/504.html movie theater in virginia] [http://flheddin.qsh.eu/brfadron-453.html motivational military videos] [http://sematild.qsh.eu/resource322.htm real player video codecs] &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Mike Chirico (mchirico@users.sourceforge.net) or (mchirico@comcast.net)&lt;br /&gt;
Copyright (C) 2004 (GNU Free Documentation License)&lt;br /&gt;
Last Updated: Thu Dec 28 16:42:50 EST 2006&lt;br /&gt;
&lt;br /&gt;
The latest version of this document can be found at:&lt;br /&gt;
http://souptonuts.sourceforge.net/how_to_linux_and_open_source.htm&lt;br /&gt;
  or text version ( if you have trouble downloading the full document: over 140 pages )&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/How_to_Linux_and_Open_Source.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on Gmail with Postix and Fetchmail&lt;br /&gt;
http://souptonuts.sourceforge.net/postfix_tutorial.html&lt;br /&gt;
&lt;br /&gt;
For tips on using SQLite (over 25 pages)&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_sqlite_tutorial.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on MySQL reference:&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_mysql.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For a recommended reading list&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/Recommended_Reading.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on upgrading RedHat 9 or 8.0 to 2.6.x src kernel&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_26.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on Comcast Email with Home Linux Box&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_COMCAST_EMAIL.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  **Note, if you want email notification after every 50 new tips have been&lt;br /&gt;
    added, then, click on the following link:&lt;br /&gt;
     https://sourceforge.net/project/filemodule_monitor.php?filemodule_id=120838&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 1:&lt;br /&gt;
&lt;br /&gt;
     Is NTP Working?&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Test the current server):&lt;br /&gt;
&lt;br /&gt;
          Try issuing the following command:&lt;br /&gt;
&lt;br /&gt;
          $ ntpq -pn&lt;br /&gt;
&lt;br /&gt;
           remote refid st t when poll reach delay offset jitter&lt;br /&gt;
           ===================================================&lt;br /&gt;
           tock.usno.navy 0.0.0.0 16 u - 64 0 0.000 0.000 4000.00&lt;br /&gt;
&lt;br /&gt;
          The above is an example of a problem.&lt;br /&gt;
          Compare it to a working configuration.&lt;br /&gt;
&lt;br /&gt;
          $ ntpq -pn&lt;br /&gt;
&lt;br /&gt;
           remote refid st t when poll reach delay offset jitter&lt;br /&gt;
           ========================================================&lt;br /&gt;
           +128.4.40.12 128.4.40.10 2 u 107 128 377 25.642 3.350 1.012&lt;br /&gt;
           127.127.1.0 127.127.1.0 10 l 40 64 377 0.000 0.000 0.008&lt;br /&gt;
           +128.91.2.13 128.4.40.12 3 u 34 128 377 21.138 6.118 0.398&lt;br /&gt;
           *192.5.41.41 .USNO. 1 u 110 128 377 33.69 9.533 3.534&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Configure the /etc/ntp.conf):&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/ntp.conf&lt;br /&gt;
&lt;br /&gt;
            # My simple client-only ntp configuration.&lt;br /&gt;
            server timeserver1.upenn.edu&lt;br /&gt;
            # ping -a timeserver1.upenn.edu shows the IP address 128.91.2.13&lt;br /&gt;
            # which is used in the restrict below&lt;br /&gt;
            restrict 128.91.2.13&lt;br /&gt;
            server tock.usno.navy.mil&lt;br /&gt;
            restrict 192.5.41.41&lt;br /&gt;
            server 128.4.40.12&lt;br /&gt;
            restrict 128.4.40.12&lt;br /&gt;
            server 127.127.1.0 # local clock&lt;br /&gt;
            fudge 127.127.1.0 stratum 10&lt;br /&gt;
            driftfile /etc/ntp/drift&lt;br /&gt;
            restrict default ignore&lt;br /&gt;
            restrict 127.0.0.0 mask 255.0.0.0&lt;br /&gt;
            authenticate no&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Configure /etc/ntp/step-tickers):&lt;br /&gt;
&lt;br /&gt;
          The values for server above are placed in the &amp;quot;/etc/ntp/step-tickers&amp;quot; file&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/ntp/step-tickers&lt;br /&gt;
&lt;br /&gt;
              timeserver1.upenn.edu&lt;br /&gt;
              tock.usno.navy.mil&lt;br /&gt;
              128.4.40.12&lt;br /&gt;
&lt;br /&gt;
          The startup script /etc/rc.d/init.d/ntpd will grab the servers in this&lt;br /&gt;
          file and execute the ntpdate command as follows:&lt;br /&gt;
&lt;br /&gt;
             /usr/sbin/ntpdate -s -b -p 8 timeserver1.upenn.edu&lt;br /&gt;
&lt;br /&gt;
          Why? Because if the time is off ntpd will not start. The command above set the&lt;br /&gt;
          clock. If System Time deviates from true time by more than 1000 seconds, then,&lt;br /&gt;
          the ntpd daemon  will enter panic mode and exit.&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Restart the service and check):&lt;br /&gt;
&lt;br /&gt;
          Issue the restart command&lt;br /&gt;
&lt;br /&gt;
            /etc/init.d/ntpd restart&lt;br /&gt;
&lt;br /&gt;
          check the values for &amp;quot;ntpq -pn&amp;quot;,&lt;br /&gt;
          which should match step 1.&lt;br /&gt;
&lt;br /&gt;
             ntpq -pn&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE:&lt;br /&gt;
&lt;br /&gt;
          Time is always stored in the kernel as the number of seconds since&lt;br /&gt;
          midnight of the 1st of January 1970 UTC, regardless of whether the&lt;br /&gt;
          hardware clock is stored as UTC or not.  Conversions to local time&lt;br /&gt;
          are done at run-time. So, it's easy to get the time in different&lt;br /&gt;
          timezones for only the current session as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ export TZ=EST&lt;br /&gt;
              $ date&lt;br /&gt;
              Mon Aug  2 10:34:04 EST 2004&lt;br /&gt;
&lt;br /&gt;
              $ export TZ=NET&lt;br /&gt;
              $ date&lt;br /&gt;
              Mon Aug  2 15:34:18 NET 2004&lt;br /&gt;
&lt;br /&gt;
          The following are possible values for TZ:&lt;br /&gt;
&lt;br /&gt;
              Hours From Greenwich Mean Time (GMT) Value Description&lt;br /&gt;
              0 GMT Greenwich Mean Time&lt;br /&gt;
              +1 ECT European Central Time&lt;br /&gt;
              +2 EET European Eastern Time&lt;br /&gt;
              +2 ART&lt;br /&gt;
              +3 EAT Saudi Arabia&lt;br /&gt;
              +3.5 MET Iran&lt;br /&gt;
              +4 NET&lt;br /&gt;
              +5 PLT West Asia&lt;br /&gt;
              +5.5 IST India&lt;br /&gt;
              +6 BST Central Asia&lt;br /&gt;
              +7 VST Bangkok&lt;br /&gt;
              +8 CTT China&lt;br /&gt;
              +9 JST Japan&lt;br /&gt;
              +9.5 ACT Central Australia&lt;br /&gt;
              +10 AET Eastern Australia&lt;br /&gt;
              +11 SST Central Pacific&lt;br /&gt;
              +12 NST New Zealand&lt;br /&gt;
              -11 MIT Samoa&lt;br /&gt;
              -10 HST Hawaii&lt;br /&gt;
              -9 AST Alaska&lt;br /&gt;
              -8 PST Pacific Standard Time&lt;br /&gt;
              -7 PNT Arizona&lt;br /&gt;
              -7 MST Mountain Standard Time&lt;br /&gt;
              -6 CST Central Standard Time&lt;br /&gt;
              -5 EST Eastern Standard Time&lt;br /&gt;
              -5 IET Indiana East&lt;br /&gt;
              -4 PRT Atlantic Standard Time&lt;br /&gt;
              -3.5 CNT Newfoundland&lt;br /&gt;
              -3 AGT Eastern South America&lt;br /&gt;
              -3 BET Eastern South America&lt;br /&gt;
              -1 CAT Azores&lt;br /&gt;
&lt;br /&gt;
              DST timezone&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              0      BST for British Summer.&lt;br /&gt;
              +400   ADT for Atlantic Daylight.&lt;br /&gt;
              +500   EDT for Eastern Daylight.&lt;br /&gt;
              +600   CDT for Central Daylight.&lt;br /&gt;
              +700   MDT for Mountain Daylight.&lt;br /&gt;
              +800   PDT for Pacific Daylight.&lt;br /&gt;
              +900   YDT for Yukon Daylight.&lt;br /&gt;
              +1000  HDT for Hawaii Daylight.&lt;br /&gt;
              -100   MEST for Middle European Summer,&lt;br /&gt;
                         MESZ for Middle European Summer,&lt;br /&gt;
                         SST for Swedish Summer and FST for French Summer.&lt;br /&gt;
              -700   WADT for West Australian Daylight.&lt;br /&gt;
              -1000  EADT for Eastern Australian Daylight.&lt;br /&gt;
              -1200  NZDT for New Zealand Daylight.&lt;br /&gt;
&lt;br /&gt;
     The following is an example of setting the TZ environment variable&lt;br /&gt;
     for the timezone, only when timezone changes go into effect.&lt;br /&gt;
&lt;br /&gt;
               $ export TZ=EST+5EDT,M4.1.0/2,M10.5.0/2&lt;br /&gt;
&lt;br /&gt;
     Take a look at the last line &amp;quot;M10.5.0/2&amp;quot;. What does it mean? Here is the&lt;br /&gt;
     documentation&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Mm.w.d This  specifies  day  d (0 &amp;lt;= d &amp;lt;= 6) of week w (1 &amp;lt;= w &amp;lt;= 5) of&lt;br /&gt;
              month m (1 &amp;lt;= m &amp;lt;= 12).  Week 1 is the first week in which day d&lt;br /&gt;
              occurs and week 5 is the last week in which day d occurs.  Day 0&lt;br /&gt;
              is a Sunday.&lt;br /&gt;
&lt;br /&gt;
              The time fields specify when, in the local time  currently  in&lt;br /&gt;
              effect, the  change  to  the  other  time  occurs.   If omitted,&lt;br /&gt;
              the default is  02:00:00.&lt;br /&gt;
&lt;br /&gt;
      So this is what it means. M10 stands for October, the 5 is the fifth week&lt;br /&gt;
      that includes a Sunday (note 0 in M10.5.0/2 is Sunday). To see that it is&lt;br /&gt;
      the fifth week see the calendar below. The time change occurs a 2am in&lt;br /&gt;
      the morning.&lt;br /&gt;
&lt;br /&gt;
                                October&lt;br /&gt;
                         Su Mo Tu We Th Fr Sa&lt;br /&gt;
                                         1  2&lt;br /&gt;
                          3  4  5  6  7  8  9&lt;br /&gt;
                         10 11 12 13 14 15 16&lt;br /&gt;
                         17 18 19 20 21 22 23&lt;br /&gt;
                         24 25 26 27 28 29 30&lt;br /&gt;
                         31&lt;br /&gt;
&lt;br /&gt;
       Prove it. Take the following program sunrise, which can calcuates sunrise&lt;br /&gt;
       and sunset for an latitude and longitude. This program can be downloaded&lt;br /&gt;
       from the following location:&lt;br /&gt;
           http://sourceforge.net/direct-dl/mchirico/souptonuts/working_with_time.tar.gz&lt;br /&gt;
&lt;br /&gt;
       Below is a bash script that will run the program for the next 100 days.&lt;br /&gt;
&lt;br /&gt;
          #!/bin/bash&lt;br /&gt;
          #  program: next100days  Mike Chirico&lt;br /&gt;
          #  download:&lt;br /&gt;
          #  http://sourceforge.net/direct-dl/mchirico/souptonuts/working_with_time.tar.gz&lt;br /&gt;
          #&lt;br /&gt;
          #  This will calculate the sunrise and sunset for&lt;br /&gt;
          #  latitude     39.95  Note must convert to degrees&lt;br /&gt;
          #  longitude  75.15  Note must convert to degrees&lt;br /&gt;
          lat=39.95&lt;br /&gt;
          long=75.15&lt;br /&gt;
          for (( i=0; i &amp;lt;= 100; i++))&lt;br /&gt;
          do&lt;br /&gt;
            sunrise    `date -d &amp;quot;+$i day&amp;quot; &amp;quot;+%Y %m %d&amp;quot;` $lat $long&lt;br /&gt;
          done&lt;br /&gt;
&lt;br /&gt;
       Take a look at the following sample output.&lt;br /&gt;
&lt;br /&gt;
           $ export TZ=EST+5EDT,M4.1.0/2,M10.5.0/2&lt;br /&gt;
           $ ./next100days&lt;br /&gt;
&lt;br /&gt;
          Sunrise  08-24-2004  06:21:12   Sunset 08-24-2004  19:43:42&lt;br /&gt;
          Sunrise  08-25-2004  06:22:09   Sunset 08-25-2004  19:42:12&lt;br /&gt;
          Sunrise  08-26-2004  06:23:06   Sunset 08-26-2004  19:40:41&lt;br /&gt;
          Sunrise  08-27-2004  06:24:03   Sunset 08-27-2004  19:39:09&lt;br /&gt;
          Sunrise  08-28-2004  06:25:00   Sunset 08-28-2004  19:37:37&lt;br /&gt;
          Sunrise  08-29-2004  06:25:56   Sunset 08-29-2004  19:36:04&lt;br /&gt;
          Sunrise  08-30-2004  06:26:53   Sunset 08-30-2004  19:34:31&lt;br /&gt;
          Sunrise  08-31-2004  06:27:50   Sunset 08-31-2004  19:32:57&lt;br /&gt;
          Sunrise  09-01-2004  06:28:46   Sunset 09-01-2004  19:31:22&lt;br /&gt;
          Sunrise  09-02-2004  06:29:43   Sunset 09-02-2004  19:29:47&lt;br /&gt;
          ..[values omitted ]&lt;br /&gt;
          Sunrise  10-28-2004  07:25:31   Sunset 10-28-2004  18:02:34&lt;br /&gt;
          Sunrise  10-29-2004  07:26:38   Sunset 10-29-2004  18:01:19&lt;br /&gt;
          Sunrise  10-30-2004  07:27:46   Sunset 10-30-2004  18:00:06&lt;br /&gt;
          Sunrise  10-31-2004  06:28:53   Sunset 10-31-2004  16:58:54&lt;br /&gt;
          Sunrise  11-01-2004  06:30:01   Sunset 11-01-2004  16:57:44&lt;br /&gt;
          Sunrise  11-02-2004  06:31:10   Sunset 11-02-2004  16:56:35&lt;br /&gt;
&lt;br /&gt;
       Compare 10-30-2004 with 10-31-2004. Sunrise is an hour earlier because&lt;br /&gt;
       daylight saving time has ended, just as predicted.&lt;br /&gt;
&lt;br /&gt;
       There is an easier way to switch between timezones. Take a look at the&lt;br /&gt;
       directory zoneinfo as follows:&lt;br /&gt;
&lt;br /&gt;
            $ ls /usr/share/zoneinfo&lt;br /&gt;
&lt;br /&gt;
            Africa      Chile    Factory    Iceland      Mexico    posix       UCT&lt;br /&gt;
            America     CST6CDT  GB         Indian       Mideast   posixrules  Universal&lt;br /&gt;
            Antarctica  Cuba     GB-Eire    Iran         MST       PRC         US&lt;br /&gt;
            Arctic      EET      GMT        iso3166.tab  MST7MDT   PST8PDT     UTC&lt;br /&gt;
            Asia        Egypt    GMT0       Israel       Navajo    right       WET&lt;br /&gt;
            Atlantic    Eire     GMT-0      Jamaica      NZ        ROC         W-SU&lt;br /&gt;
            Australia   EST      GMT+0      Japan        NZ-CHAT   ROK         zone.tab&lt;br /&gt;
            Brazil      EST5EDT  Greenwich  Kwajalein    Pacific   Singapore   Zulu&lt;br /&gt;
            Canada      Etc      Hongkong   Libya        Poland    SystemV&lt;br /&gt;
            CET         Europe   HST        MET          Portugal  Turkey&lt;br /&gt;
&lt;br /&gt;
       TZ can be set to any one of these files. Some of these are directories and contain&lt;br /&gt;
       subdirectories, such as ./posix/America. This way you don not have to enter the&lt;br /&gt;
       timezone, offset, and range for dst, since it has already been calculated.&lt;br /&gt;
&lt;br /&gt;
           $ export TZ=:/usr/share/zoneinfo/posix/America/Aruba&lt;br /&gt;
           $ export TZ=:/usr/share/zoneinfo/Egypt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Reference:&lt;br /&gt;
          http://prdownloads.sourceforge.net/cpearls/date_calc.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
          Also see  (TIP 27).&lt;br /&gt;
          Also see  (TIP 103) using chrony which is very similiar to ntpd.&lt;br /&gt;
          Note time settings can usually be found in /etc/sysconfig/clock&lt;br /&gt;
         &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 2:&lt;br /&gt;
&lt;br /&gt;
     cpio works like tar, only better.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Create two directories with data ../dir1 an ../dir2)&lt;br /&gt;
&lt;br /&gt;
          mkdir -p ../dir1&lt;br /&gt;
          mkdir -p ../dir2&lt;br /&gt;
          cp /etc/*.conf ../dir1/.&lt;br /&gt;
          cp /etc/*.cnf ../dir2/.&lt;br /&gt;
&lt;br /&gt;
          Which will backup all your cnf and conf files.&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Piping the files to tar)&lt;br /&gt;
&lt;br /&gt;
          cpio works like tar but can take input&lt;br /&gt;
          from the &amp;quot;find&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar &amp;gt; test.tar&lt;br /&gt;
               or&lt;br /&gt;
           $ find ../dir1/ | cpio -o -H tar &amp;gt; test2.tar&lt;br /&gt;
&lt;br /&gt;
          Same command without the &amp;quot;&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar -F test.tar&lt;br /&gt;
              or&lt;br /&gt;
           $ find ../dir1/ | cpio -o -H tar -F test2.tar&lt;br /&gt;
&lt;br /&gt;
          Using append&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar -F test.tar&lt;br /&gt;
             or&lt;br /&gt;
           $ find ../dir2/ | cpio -o --format=tar --append -F test.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (List contents of the tar file)&lt;br /&gt;
&lt;br /&gt;
          $ cpio -it &amp;lt; test.tar&lt;br /&gt;
                or&lt;br /&gt;
          $ cpio -it -F test.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Extract the contents)&lt;br /&gt;
&lt;br /&gt;
          $ cpio -i -F test.tar&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 3:&lt;br /&gt;
&lt;br /&gt;
     Working with tar. The basics with encryption.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Using the tar command on the directory /stuff)&lt;br /&gt;
&lt;br /&gt;
          Suppose you have a directory /stuff&lt;br /&gt;
          To tar everything in stuff to create a &amp;quot;.tar&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
          $ tar -cvf stuff.tar stuff&lt;br /&gt;
&lt;br /&gt;
          Which will create &amp;quot;stuff.tar&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Using the tar command to create a &amp;quot;.tar.gz&amp;quot; of /stuff)&lt;br /&gt;
&lt;br /&gt;
          $ tar -czf stuff.tar.gz stuff&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (List the files in the archive)&lt;br /&gt;
&lt;br /&gt;
          $ tar -tzf stuff.tar.gz&lt;br /&gt;
               or&lt;br /&gt;
          $ tar -tf stuff.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (A way to list specific files)&lt;br /&gt;
&lt;br /&gt;
          Note, pipe the results to a file and edit&lt;br /&gt;
&lt;br /&gt;
           $ tar -tzf stuff.tar.gz &amp;gt; mout&lt;br /&gt;
&lt;br /&gt;
          Then, edit mout to only include the files you want&lt;br /&gt;
&lt;br /&gt;
           $ tar -T mout -xzf stuff.tar.gz&lt;br /&gt;
&lt;br /&gt;
          The above command will only get the files in mout.&lt;br /&gt;
          Of couse, if you want them all&lt;br /&gt;
&lt;br /&gt;
           $ tar -xzf stuff.tar.gz&lt;br /&gt;
&lt;br /&gt;
     STEP 5 (ENCRYPTION)&lt;br /&gt;
&lt;br /&gt;
           $ tar -zcvf - stuff|openssl des3 -salt -k secretpassword | dd of=stuff.des3&lt;br /&gt;
&lt;br /&gt;
          This will create stuff.des3...don't forget the password you&lt;br /&gt;
          put in place of  secretpassword. This can be done interactively as&lt;br /&gt;
          well.&lt;br /&gt;
&lt;br /&gt;
            $ dd if=stuff.des3 |openssl des3 -d -k secretpassword|tar zxf -&lt;br /&gt;
&lt;br /&gt;
     NOTE:  above there is a &amp;quot;-&amp;quot; at the end... this will&lt;br /&gt;
            extract everything.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 4:&lt;br /&gt;
&lt;br /&gt;
     Creating a Virtual File System and Mounting it with a Loopback Device.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Construct a 10MB file)&lt;br /&gt;
&lt;br /&gt;
           $ dd if=/dev/zero of=/tmp/disk-image count=20480&lt;br /&gt;
&lt;br /&gt;
          By default dd uses block of 512 so the size will be 20480*512&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Make an ext2 or ext3 file system) -- ext2 shown here.&lt;br /&gt;
&lt;br /&gt;
           $ mke2fs -q&lt;br /&gt;
&lt;br /&gt;
          or if you want ext3&lt;br /&gt;
&lt;br /&gt;
           $ mkfs -t ext3 -q /tmp/disk-image&lt;br /&gt;
&lt;br /&gt;
          yes, you can even use reiser, but you'll need to create a bigger&lt;br /&gt;
          disk image. Something like &amp;quot;dd if=/dev/zero of=/tmp/disk-image count=50480&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ mkfs -t reiserfs -q /tmp/disk-image&lt;br /&gt;
&lt;br /&gt;
          Hit yes for confirmation.  It only asks this because it's a file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Create a directory &amp;quot;virtual-fs&amp;quot; and mount. This has to be done as root)&lt;br /&gt;
&lt;br /&gt;
           $ mkdir /virtual-fs&lt;br /&gt;
           $ mount -o loop=/dev/loop0 /tmp/disk-image /virtual-fs&lt;br /&gt;
&lt;br /&gt;
         SPECIAL NOTE: if you mount a second device you will have to increase the&lt;br /&gt;
                       loop count: loop=/dev/loop1, loop=/dev/loop2, ... loop=/dev/loopn&lt;br /&gt;
&lt;br /&gt;
          Now it operates just like a disk. This virtual filesystem can be mounted&lt;br /&gt;
          when the system boots by adding the following to the &amp;quot;/etc/fstab&amp;quot; file. Then,&lt;br /&gt;
          to mount, just type &amp;quot;mount /virtual-fs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                 /tmp/disk-image /virtual-fs ext2               rw,loop=/dev/loop0 0 0&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (When done, umount it)&lt;br /&gt;
&lt;br /&gt;
           $ umount /virtual-fs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE: If you are using Fedora core 2, in the /etc/fstab you can take&lt;br /&gt;
              advantage of acl properties for this mount. Note the acl next to the&lt;br /&gt;
              rw entry. This is shown here with ext3.&lt;br /&gt;
&lt;br /&gt;
                 /tmp/disk-image     /virtual-fs ext3    rw,acl,loop=/dev/loop1 0 0&lt;br /&gt;
&lt;br /&gt;
              Also, if you are using Fedora core 2 and above, you can mount the file&lt;br /&gt;
              on a cryptoloop.&lt;br /&gt;
&lt;br /&gt;
                $ dd if=/dev/urandom of=disk-aes count=20480&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ modprobe loop&lt;br /&gt;
                $ modprobe cryptoloop&lt;br /&gt;
                $ modprobe aes&lt;br /&gt;
&lt;br /&gt;
                $ losetup -e aes /dev/loop0 disk-aes&lt;br /&gt;
                $ mkfs -t ext2 /dev/loop0&lt;br /&gt;
                $ mount -o loop,encryption=aes disk-aes &amp;lt;mount point&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              If you do not have Fedora core 2, then, you can build the kernel from source&lt;br /&gt;
              with some of the following options (not complete, yet)&lt;br /&gt;
               reference:&lt;br /&gt;
     http://cvs.sourceforge.net/viewcvs.py/cpearls/cpearls/src/posted_on_sf/acl/ehd.pdf?rev=1.1&amp;amp;view=log&lt;br /&gt;
&lt;br /&gt;
                      Cryptographic API Support (CONFIG_CRYPTO)&lt;br /&gt;
                      generic loop cryptographic (CONFIG_CRYPTOLOOP)&lt;br /&gt;
                      Cryptographic ciphers (CONFIG_CIPHERS)&lt;br /&gt;
                      Enable one or more  ciphers  (CONFIG CIPHER .*) such as AES.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     HELPFUL INFORMATION: It is possible to bind mount partitions, or associate the&lt;br /&gt;
                     mounted partition to a directory name.&lt;br /&gt;
&lt;br /&gt;
                  # mount --bind  /virtual-fs      /home/mchirico/vfs&lt;br /&gt;
&lt;br /&gt;
             Also, if you want to see what filesystems are currently mounted, &amp;quot;cat&amp;quot; the&lt;br /&gt;
             file &amp;quot;/etc/mtab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
                  $ cat /etc/mtab&lt;br /&gt;
&lt;br /&gt;
     Also see TIP 91.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 5:&lt;br /&gt;
&lt;br /&gt;
     Setting up 2 IP address on &amp;quot;One&amp;quot; NIC. This example is on ethernet.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (The settings for the initial IP address)&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
&lt;br /&gt;
            DEVICE=eth0&lt;br /&gt;
            BOOTPROTO=static&lt;br /&gt;
            BROADCAST=192.168.99.255&lt;br /&gt;
            IPADDR=192.168.1.155&lt;br /&gt;
            NETMASK=255.255.252.0&lt;br /&gt;
            NETWORK=192.168.1.0&lt;br /&gt;
            ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (2nd IP address: )&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/sysconfig/network-scripts/ifcfg-eth0:1&lt;br /&gt;
&lt;br /&gt;
            DEVICE=eth0:1&lt;br /&gt;
            BOOTPROTO=static&lt;br /&gt;
            BROADCAST=192.168.99.255&lt;br /&gt;
            IPADDR=192.168.1.182&lt;br /&gt;
            NETMASK=255.255.252.0&lt;br /&gt;
            NETWORK=192.168.1.0&lt;br /&gt;
            ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
     SUMMARY  Note, in STEP 1 the filename is &amp;quot;ifcfg-eth0&amp;quot;, whereas in&lt;br /&gt;
              STEP 2 it's &amp;quot;ifcfg-eth0:1&amp;quot; and also not the matching&lt;br /&gt;
              entries for &amp;quot;DEVICE=...&amp;quot;.  Also, obviously, the&lt;br /&gt;
              &amp;quot;IPADDR&amp;quot; is different as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 6:&lt;br /&gt;
&lt;br /&gt;
     Sharing Directories Among Several Users.&lt;br /&gt;
&lt;br /&gt;
     Several people are working on a project in &amp;quot;/home/share&amp;quot;&lt;br /&gt;
     and they need to create documents and programs so that&lt;br /&gt;
     others in the group can edit and execute these documents&lt;br /&gt;
     as needed. Also see (TIP 186) for adding existing users&lt;br /&gt;
     to groups.&lt;br /&gt;
&lt;br /&gt;
       $  /usr/sbin/groupadd share&lt;br /&gt;
       $  chown -R root.share /home/share&lt;br /&gt;
       $  /usr/bin/gpasswd -a &amp;lt;username&amp;gt; share&lt;br /&gt;
       $  chmod 2775 /home/share&lt;br /&gt;
&lt;br /&gt;
       $  ls -ld /home/share&lt;br /&gt;
             drwxrwsr-x    2 root     share        4096 Nov  8 16:19 /home/share&lt;br /&gt;
                   ^---------- Note the s bit, which was set with the chmod 2775&lt;br /&gt;
&lt;br /&gt;
       $  cat /etc/group&lt;br /&gt;
          ...&lt;br /&gt;
           share:x:502:chirico,donkey,zoe&lt;br /&gt;
          ...          ^------- users are added to this group.&lt;br /&gt;
&lt;br /&gt;
     The user may need to login again to get access. Or, if the user is currently&lt;br /&gt;
     logged in, they can run the following command:&lt;br /&gt;
&lt;br /&gt;
       $ su - &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Note, the above step is recommended over  &amp;quot;newgrp - share&amp;quot; since currently&lt;br /&gt;
     newgrp in FC2,FC3, and FC4 gets access to the group but the umask is not&lt;br /&gt;
     correctly formed.&lt;br /&gt;
&lt;br /&gt;
     As root you  can test their account.&lt;br /&gt;
&lt;br /&gt;
       $ su - &amp;lt;username&amp;gt;   &amp;quot;You need to '-' to pickup thier environment  '$ su - chirico' &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Note: SUID, SGID, Sticky bit. Only the left most octet is examined, and &amp;quot;chmod 755&amp;quot; is used&lt;br /&gt;
          as an example of the full command. But, anything else could be used as well. Normally&lt;br /&gt;
          you'd want executable permissions.&lt;br /&gt;
&lt;br /&gt;
        Octal digit  Binary value      Meaning                           Example usage&lt;br /&gt;
            0           000       all cleared                             $ chmod 0755 or chmod 755&lt;br /&gt;
            1           001       sticky                                  $ chmod 1755&lt;br /&gt;
            2           010       setgid                                  $ chmod 2755&lt;br /&gt;
            3           011       setgid, sticky                          $ chmod 3755&lt;br /&gt;
            4           100       setuid                                  $ chmod 4755&lt;br /&gt;
            5           101       setuid, sticky                          $ chmod 5755&lt;br /&gt;
            6           110       setuid, setgid                          $ chmod 6755&lt;br /&gt;
            7           111       setuid, setgid, sticky                  $ chmod 7755&lt;br /&gt;
&lt;br /&gt;
     A few examples applied to a directory below. In the first example all users in the group can&lt;br /&gt;
     add files to directory &amp;quot;dirA&amp;quot; and they can delete their own files. Users cannot delete other&lt;br /&gt;
     user's files.&lt;br /&gt;
&lt;br /&gt;
        Sticky bit:&lt;br /&gt;
           $ chmod 1770  dirA&lt;br /&gt;
&lt;br /&gt;
     Below files created within the directory have the group ID of the directory, rather than that&lt;br /&gt;
     of the default group setting for the user who created the file.&lt;br /&gt;
&lt;br /&gt;
        Set group ID bit:&lt;br /&gt;
           $ chmod 2755  dirB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 7:&lt;br /&gt;
&lt;br /&gt;
     Getting Infomation on Commands&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;info&amp;quot; is a great utility for getting information about the system.&lt;br /&gt;
     Here's a quick key on using &amp;quot;info&amp;quot; from the terminal prompt.&lt;br /&gt;
&lt;br /&gt;
       'q' exits.&lt;br /&gt;
       'u' moves up to the table of contents of the current section.&lt;br /&gt;
       'n' moves to the next chapter.&lt;br /&gt;
       'p' moves to the previous chapter.&lt;br /&gt;
       'space' goes into the selected section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The following is a good starting point:&lt;br /&gt;
&lt;br /&gt;
        $ info coreutils&lt;br /&gt;
&lt;br /&gt;
      Need to find out what a certain program does?&lt;br /&gt;
&lt;br /&gt;
        $ whatis  open&lt;br /&gt;
       open   (2)  - open and possibly create a file or device&lt;br /&gt;
       open   (3)  - perl pragma to set default PerlIO layers for input and output&lt;br /&gt;
       open   (3pm)  - perl pragma to set default PerlIO layers for input and output&lt;br /&gt;
       open   (n)  - Open a file-based or command pipeline channel&lt;br /&gt;
&lt;br /&gt;
      To get specific information about the open commmand&lt;br /&gt;
&lt;br /&gt;
        $ man 2 open&lt;br /&gt;
&lt;br /&gt;
       also try 'keyword' search, which is the same as the apropos command.&lt;br /&gt;
       For example, to find all the man pages on selinux, type the following:&lt;br /&gt;
&lt;br /&gt;
        $ man -k selinux&lt;br /&gt;
&lt;br /&gt;
       or the man full word search. Same as whatis command.&lt;br /&gt;
&lt;br /&gt;
        $ man -f &amp;lt;some string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       This is a hint once you are inside man.&lt;br /&gt;
&lt;br /&gt;
        space      moves forward one page&lt;br /&gt;
        b          moves backward&lt;br /&gt;
        y          scrolls up one line &amp;quot;yikes, I missed it!&amp;quot;&lt;br /&gt;
        g          goes to the beginning&lt;br /&gt;
        q          quits&lt;br /&gt;
        /&amp;lt;string&amp;gt;  search, repeat seach n&lt;br /&gt;
        m          mark, enter a letter like &amp;quot;a&amp;quot;, then, ' to go back&lt;br /&gt;
        '          enter a letter that is marked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       To get section numbers&lt;br /&gt;
&lt;br /&gt;
        $ man 8 ping&lt;br /&gt;
&lt;br /&gt;
       Note the numbers are used as follows&lt;br /&gt;
         (This is OpenBSD)&lt;br /&gt;
&lt;br /&gt;
         1  General Commands&lt;br /&gt;
         2  System Calls and Error Numbers&lt;br /&gt;
         3  C Libraries&lt;br /&gt;
         3p perl&lt;br /&gt;
         4  Devices and device drivers&lt;br /&gt;
         5  File Formats and config files&lt;br /&gt;
         6  Game instructions&lt;br /&gt;
         7  Miscellaneous information&lt;br /&gt;
         8  System maintenance&lt;br /&gt;
         9  Kernel internals&lt;br /&gt;
&lt;br /&gt;
       To find the man page directly, &amp;quot;ls&amp;quot; command:&lt;br /&gt;
&lt;br /&gt;
         $ whereis -m ls&lt;br /&gt;
         ls: /usr/share/man/man1/ls.1.gz /usr/share/man/man1/ls.1 /usr/share/man/man1p/ls.1p&lt;br /&gt;
&lt;br /&gt;
       To read this file directly, do the following:&lt;br /&gt;
&lt;br /&gt;
         $ man /usr/share/man/man1/ls.1.gz&lt;br /&gt;
&lt;br /&gt;
       If you want to know the manpath, execute manpath.&lt;br /&gt;
&lt;br /&gt;
         $ manpath&lt;br /&gt;
         /usr/share/man:/usr/X11R6/man:/usr/local/share/man:/usr/local/pgsql/man:/usr/man:/usr/local/man&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 8:&lt;br /&gt;
&lt;br /&gt;
     How to Put a &amp;quot;Running Job&amp;quot; in the Background.&lt;br /&gt;
&lt;br /&gt;
     You're running a job at the terminal prompt, and it's taking&lt;br /&gt;
     a very long time. You want to put the job in the backgroud.&lt;br /&gt;
&lt;br /&gt;
       &amp;quot;CTL - z&amp;quot; Temporarily suspends the job&lt;br /&gt;
       $ jobs     This will list all the jobs&lt;br /&gt;
       $ bg %jobnumber (bg %1)  To run in the background&lt;br /&gt;
       $ fg %jobnumber          To bring back in the foreground&lt;br /&gt;
&lt;br /&gt;
     Need to kill all jobs -- say you're using several suspended&lt;br /&gt;
     emacs sessions and you just want everything to exit.&lt;br /&gt;
&lt;br /&gt;
       $ kill -9  `jobs -p`&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;jobs -p&amp;quot; gives the process number of each job, and the&lt;br /&gt;
     kill -9 kills everything. Yes, sometimes &amp;quot;kill -9&amp;quot; is excessive&lt;br /&gt;
     and you should issue a &amp;quot;kill -15&amp;quot; that allows jobs to clean-up.&lt;br /&gt;
     However, for exacs session, I prefer &amp;quot;kill -9&amp;quot; and haven't had&lt;br /&gt;
     a problem.&lt;br /&gt;
&lt;br /&gt;
     Sometimes you need to list the process id along with job&lt;br /&gt;
     information. For instance, here's process id with the listing.&lt;br /&gt;
&lt;br /&gt;
       $ jobs -l&lt;br /&gt;
&lt;br /&gt;
     Note you can also renice a job, or give it lower priority.&lt;br /&gt;
&lt;br /&gt;
       $ nice -n +15 find . -ctime 2 -type f  -exec ls {} \; &amp;gt; last48hours&lt;br /&gt;
        ^z&lt;br /&gt;
       $  bg&lt;br /&gt;
&lt;br /&gt;
     So above that was a ctl-z to suppend. Then, bg to run it in&lt;br /&gt;
     the background. Now, if you want to change the priority lower&lt;br /&gt;
     you just renice it, once you know the process id.&lt;br /&gt;
&lt;br /&gt;
       $ jobs -pl&lt;br /&gt;
   [1]+ 29388 Running                 nice -n +15 find . -ctime 2 -exec ls -l {} \; &amp;gt;mout &amp;amp;&lt;br /&gt;
&lt;br /&gt;
       $ renice +30 -p 29388&lt;br /&gt;
        29388: old priority 15, new priority 19&lt;br /&gt;
&lt;br /&gt;
      19 was the lowest priority for this job. You cannot increase&lt;br /&gt;
      the priority unless you are root.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 9:&lt;br /&gt;
&lt;br /&gt;
     Need to Delete a File for Good -- not even GOD can recover.&lt;br /&gt;
&lt;br /&gt;
     You have a file &amp;quot;secret&amp;quot;.  The following makes it so no one&lt;br /&gt;
     can read it.  If the file was 12 bytes, it's now 4096 after it&lt;br /&gt;
     has been over written 100 times.  There's no way to recover this.&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z secret&lt;br /&gt;
&lt;br /&gt;
     Want to remove the file? Use the &amp;quot;u&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z -u test2&lt;br /&gt;
&lt;br /&gt;
     It can be applied to a device&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z -u /dev/fd0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       CAUTION: Note that shred relies on a very important assumption: that the file system  overwrites  data&lt;br /&gt;
       in  place.   This is the traditional way to do things, but many modern file system designs do not sat-&lt;br /&gt;
       isfy this assumption.  The following are examples of file systems on which shred is not effective,  or&lt;br /&gt;
       is not guaranteed to be effective in all file system modes:&lt;br /&gt;
&lt;br /&gt;
       * log-structured or journaled file systems, such as those supplied with&lt;br /&gt;
&lt;br /&gt;
              AIX and Solaris (and JFS, ReiserFS, XFS, Ext3, etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 52).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 10:&lt;br /&gt;
&lt;br /&gt;
     Who and What is doing What on Your System - finding open sockets,&lt;br /&gt;
     files etc.&lt;br /&gt;
&lt;br /&gt;
       $ lsof&lt;br /&gt;
          or as root&lt;br /&gt;
       $ watch lsof -i&lt;br /&gt;
&lt;br /&gt;
     To list all open Internet files, use:&lt;br /&gt;
&lt;br /&gt;
       $ lsof -i -U&lt;br /&gt;
&lt;br /&gt;
       (See TIP 118)&lt;br /&gt;
&lt;br /&gt;
     Also try fuser. Suppose you have a mounted file-system, and you need&lt;br /&gt;
     to umount it. To list the users on the file-system /work&lt;br /&gt;
&lt;br /&gt;
       $ fuser -u /work&lt;br /&gt;
&lt;br /&gt;
     To kill all processes accessing the file system /work  in  any way.&lt;br /&gt;
&lt;br /&gt;
       $ fuser -km /work&lt;br /&gt;
&lt;br /&gt;
     Or better yet, maybe you want to eject a cdrom on /mnt/cdrom&lt;br /&gt;
&lt;br /&gt;
       $ fuser -km /mnt/cdrom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     If you need IO load information about your system, you can execute&lt;br /&gt;
     iostat. But note, the very first iostat gives a snapshot since&lt;br /&gt;
     the last boot. You typically want the following command, which gives&lt;br /&gt;
     you 3 outputs every 5 seconds.&lt;br /&gt;
&lt;br /&gt;
       $ iostat -xtc 5 3&lt;br /&gt;
       Linux 2.6.12-1.1376_FC3smp (squeezel.squeezel.com) 	10/05/2005&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:04 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  0.97    0.06    1.94    0.62   96.41&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:09 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  0.60    0.00    1.70    0.00   97.70&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:14 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  1.00    0.00    1.60    0.00   97.39&lt;br /&gt;
&lt;br /&gt;
     vmstat reports memory statistics.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ vmstat&lt;br /&gt;
       $ ifconfig&lt;br /&gt;
       $ cat /proc/sys/vm/.. (entries under here)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      *NOTE: (TIP 77) shows sample usage of &amp;quot;ifconfig&amp;quot;. Also&lt;br /&gt;
       (TIP 84) shows sample output of &amp;quot;$ cat /proc/cpuinfo&amp;quot;. You can download iostat&lt;br /&gt;
       and other packages from (http://perso.wanadoo.fr/sebastien.godard/download_en.html).&lt;br /&gt;
       You also may want to look at iozone (TIP 178).&lt;br /&gt;
&lt;br /&gt;
     Also&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/meminfo&lt;br /&gt;
       $ cat /proc/stat&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/uptime&lt;br /&gt;
       1078623.55 1048008.34       First number is the number of seconds since boot.&lt;br /&gt;
                                   The second number is the number of idle seconds.&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/loadavg&lt;br /&gt;
       0.25 0.14 0.10 1/166 7778   This shows load at 1,5, and 15 minutes,&lt;br /&gt;
                                   a total of 1 current running process out&lt;br /&gt;
                                   from a total of 166. The 7778 is the last&lt;br /&gt;
                                   process id used.&lt;br /&gt;
                                   Ref: http://www.teamquest.com/resources/gunther/ldavg1.shtml&lt;br /&gt;
&lt;br /&gt;
     Or current process open file descriptors&lt;br /&gt;
&lt;br /&gt;
        $ ls -l /proc/self/fd/0&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lr-x------    1 chirico  chirico        64 Jun 29 13:17 3 -&amp;gt; /proc/26667/fd&lt;br /&gt;
&lt;br /&gt;
      So you could, $ echo &amp;quot;stuff&amp;quot; &amp;gt; /dev/pts/51, to get output. Note, tree is also&lt;br /&gt;
      helpful here:&lt;br /&gt;
&lt;br /&gt;
         $ tree /proc/self&lt;br /&gt;
&lt;br /&gt;
            /proc/self&lt;br /&gt;
            |-- auxv&lt;br /&gt;
            |-- cmdline&lt;br /&gt;
            |-- cwd -&amp;gt; /work/souptonuts/documentation/theBook&lt;br /&gt;
            |-- environ&lt;br /&gt;
            |-- exe -&amp;gt; /usr/bin/tree&lt;br /&gt;
            |-- fd&lt;br /&gt;
            |   |-- 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   |-- 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   |-- 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   `-- 3 -&amp;gt; /proc/26668/fd&lt;br /&gt;
            |-- maps&lt;br /&gt;
            |-- mem&lt;br /&gt;
            |-- mounts&lt;br /&gt;
            |-- root -&amp;gt; /&lt;br /&gt;
            |-- stat&lt;br /&gt;
            |-- statm&lt;br /&gt;
            |-- status&lt;br /&gt;
            |-- task&lt;br /&gt;
            |   `-- 26668&lt;br /&gt;
            |       |-- auxv&lt;br /&gt;
            |       |-- cmdline&lt;br /&gt;
            |       |-- cwd -&amp;gt; /work/souptonuts/documentation/theBook&lt;br /&gt;
            |       |-- environ&lt;br /&gt;
            |       |-- exe -&amp;gt; /usr/bin/tree&lt;br /&gt;
            |       |-- fd&lt;br /&gt;
            |       |   |-- 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   |-- 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   |-- 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   `-- 3 -&amp;gt; /proc/26668/task/26668/fd&lt;br /&gt;
            |       |-- maps&lt;br /&gt;
            |       |-- mem&lt;br /&gt;
            |       |-- mounts&lt;br /&gt;
            |       |-- root -&amp;gt; /&lt;br /&gt;
            |       |-- stat&lt;br /&gt;
            |       |-- statm&lt;br /&gt;
            |       |-- status&lt;br /&gt;
            |       `-- wchan&lt;br /&gt;
            `-- wchan&lt;br /&gt;
&lt;br /&gt;
            10 directories, 28 files&lt;br /&gt;
&lt;br /&gt;
     Need a listing of the system settings?&lt;br /&gt;
&lt;br /&gt;
       $ sysctl -a&lt;br /&gt;
&lt;br /&gt;
     Need IPC (Shared Memory Segments, Semaphore Arrays, Message Queue) status&lt;br /&gt;
     etc?&lt;br /&gt;
&lt;br /&gt;
       $ ipcs&lt;br /&gt;
       $ ipcs -l  &amp;quot;This gives limits&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Need to &amp;quot;watch&amp;quot; everything a user does?  The following watches donkey.&lt;br /&gt;
&lt;br /&gt;
       $ watch lsof -u donkey&lt;br /&gt;
&lt;br /&gt;
     Or, to see what in  going on in directory &amp;quot;/work/junk&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       $ watch lsof +D /work/junk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 11:&lt;br /&gt;
&lt;br /&gt;
     How to make a File &amp;quot;immutable&amp;quot; or &amp;quot;unalterable&amp;quot; -- it cannot be changed&lt;br /&gt;
     or deleted even by root. Note this works on (ext2/ext3) filesystems.&lt;br /&gt;
     And, yes, root can delete after it's changed back.&lt;br /&gt;
&lt;br /&gt;
     As root:&lt;br /&gt;
&lt;br /&gt;
       $ chattr +i filename&lt;br /&gt;
&lt;br /&gt;
     And to change it back:&lt;br /&gt;
&lt;br /&gt;
       $ chattr -i filename&lt;br /&gt;
&lt;br /&gt;
     List attributes&lt;br /&gt;
&lt;br /&gt;
       $ lsattr filename&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 12:&lt;br /&gt;
&lt;br /&gt;
     SSH - How to Generate the Key Pair.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     On the local server&lt;br /&gt;
&lt;br /&gt;
       $  ssh-keygen -t dsa -b 2048&lt;br /&gt;
&lt;br /&gt;
     This will create the two files:&lt;br /&gt;
&lt;br /&gt;
            .ssh/id_dsa (Private key)&lt;br /&gt;
            .ssh/id_dsa.pub  (Public key you can share)&lt;br /&gt;
&lt;br /&gt;
     Next insert &amp;quot;.ssh/id_dsa.pub&amp;quot; on the remote server&lt;br /&gt;
     in the file  &amp;quot;.ssh/authorized_keys&amp;quot; and &amp;quot;.ssh/authorized_keys2&amp;quot;&lt;br /&gt;
     and change the  permission of each file to (chmod 600). Plus, make&lt;br /&gt;
     sure the directory &amp;quot;.ssh&amp;quot; exists on the remote computer with 700 rights.&lt;br /&gt;
     Ok, assuming  192.168.1.155 is the remote server and &amp;quot;donkey&amp;quot; is the&lt;br /&gt;
     account on that remote server.&lt;br /&gt;
&lt;br /&gt;
       $ ssh donkey@192.168.1.155 &amp;quot;mkdir -p .ssh&amp;quot;&lt;br /&gt;
       $ ssh donkey@192.168.1.155 &amp;quot;chmod 700 .ssh&amp;quot;&lt;br /&gt;
       $ scp ./.ssh/id_dsa.pub  donkey@192.168.1.155:.ssh/newkey.pub&lt;br /&gt;
&lt;br /&gt;
     Now connect to that remote server &amp;quot;192.168.1.155&amp;quot; and add .ssh/newkey.pub&lt;br /&gt;
     to both &amp;quot;authorized_keys&amp;quot; and &amp;quot;authorized_keys2&amp;quot;.  When done, the permission&lt;br /&gt;
     on&lt;br /&gt;
       (This is on the remote server)&lt;br /&gt;
&lt;br /&gt;
        $chmod 600 .ssh/authorized_key*&lt;br /&gt;
&lt;br /&gt;
     Next, go back to the local server and issue the following:&lt;br /&gt;
&lt;br /&gt;
        $ ssh-agent $SHELL&lt;br /&gt;
        $ ssh-add&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;ssh-add&amp;quot; will allow you to enter the passphrase and it will&lt;br /&gt;
     save it for the current login session.&lt;br /&gt;
&lt;br /&gt;
     You don't have to enter a password when running &amp;quot;ssh-keygen&amp;quot; above. But,&lt;br /&gt;
     remember anyone with root access can &amp;quot;su - &amp;lt;username&amp;gt;&amp;quot; and then connect&lt;br /&gt;
     to your computers.  It's harder, however, not impossible, for root to do&lt;br /&gt;
     this if  you have a password.&lt;br /&gt;
&lt;br /&gt;
     (Reference TIP 151)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 13:&lt;br /&gt;
&lt;br /&gt;
     Securing the System: Don't allow root to login remotely.  Instead,&lt;br /&gt;
     the admin could login as another account, then, &amp;quot;su -&amp;quot;.  However,&lt;br /&gt;
     root can still login &amp;quot;from the local terminal&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     In the &amp;quot;/etc/ssh/sshd_config&amp;quot; file change the following lines:&lt;br /&gt;
&lt;br /&gt;
        Protocol 2&lt;br /&gt;
        PermitRootLogin no&lt;br /&gt;
        PermitEmptyPasswords no&lt;br /&gt;
&lt;br /&gt;
     Then, restart ssh&lt;br /&gt;
&lt;br /&gt;
        /etc/init.d/sshd restart&lt;br /&gt;
&lt;br /&gt;
     Why would you want to do this?  It's not possible for anyone to guess&lt;br /&gt;
     or keep trying the root account.  This is especially good for computers&lt;br /&gt;
     on the Internet. So, even if the &amp;quot;root&amp;quot; passwords is known, they can't&lt;br /&gt;
     get access to the system remotely.  Only from the terminal, which is locked&lt;br /&gt;
     in your computer room. However, if anyone has a account on the server,&lt;br /&gt;
     then, they can login under their  account then &amp;quot;su -&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Suppose you only want a limited number of users:  &amp;quot;mchirico&amp;quot; and &amp;quot;donkey&amp;quot;.&lt;br /&gt;
     Add the following line to &amp;quot;/etc/ssh/sshd_config&amp;quot;. Note, this allows access&lt;br /&gt;
     for chirico and donkey, but everyone else is denied.&lt;br /&gt;
&lt;br /&gt;
         #  Once you add AllowUsers - everyone else is denied.&lt;br /&gt;
         AllowUsers mchirico donkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 14:&lt;br /&gt;
&lt;br /&gt;
     Keep Logs Longer with Less Space.&lt;br /&gt;
&lt;br /&gt;
     Normally logs rotate monthly, over writing all the old data.  Here's a&lt;br /&gt;
     sample &amp;quot;/etc/logrotate.conf&amp;quot; that will keep 12 months of backup&lt;br /&gt;
     compressing the logfiles&lt;br /&gt;
&lt;br /&gt;
       $ cat /etc/logrotate.conf&lt;br /&gt;
&lt;br /&gt;
             # see &amp;quot;man logrotate&amp;quot; for details&lt;br /&gt;
             # rotate log files weekly&lt;br /&gt;
             #chirico changes to monthly&lt;br /&gt;
             monthly&lt;br /&gt;
&lt;br /&gt;
             # keep 4 weeks worth of backlogs&lt;br /&gt;
             # keep 12 months of backup&lt;br /&gt;
             rotate 12&lt;br /&gt;
&lt;br /&gt;
             # create new (empty) log files after rotating old ones&lt;br /&gt;
             create&lt;br /&gt;
&lt;br /&gt;
             # uncomment this if you want your log files compressed&lt;br /&gt;
             compress&lt;br /&gt;
&lt;br /&gt;
             # RPM packages drop log rotation information into this directory&lt;br /&gt;
             include /etc/logrotate.d&lt;br /&gt;
&lt;br /&gt;
             # no packages own wtmp -- we'll rotate them here&lt;br /&gt;
             /var/log/wtmp {&lt;br /&gt;
                 monthly&lt;br /&gt;
                 create 0664 root utmp&lt;br /&gt;
                 rotate 1&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
             # system-specific logs may be also be configured here.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Note: see tip 1. The clock should always be correctly set.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 15:&lt;br /&gt;
&lt;br /&gt;
     What Network Services are Running?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -atup&lt;br /&gt;
&lt;br /&gt;
     or&lt;br /&gt;
&lt;br /&gt;
          $ netstat -ap|grep LISTEN|less&lt;br /&gt;
&lt;br /&gt;
     This can be helpful to determine the services running.&lt;br /&gt;
&lt;br /&gt;
     Need stats on dropped UDP packets?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s -u&lt;br /&gt;
&lt;br /&gt;
     or TCP&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s -t&lt;br /&gt;
&lt;br /&gt;
     or summary of everything&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s&lt;br /&gt;
&lt;br /&gt;
     or looking for error rates on the interface?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -i&lt;br /&gt;
&lt;br /&gt;
     Listening interfaces?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -l&lt;br /&gt;
&lt;br /&gt;
     (Tip above provided by Amos Shapira)&lt;br /&gt;
&lt;br /&gt;
     Also see TIP 77.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 16:&lt;br /&gt;
&lt;br /&gt;
     Apache: Creating and Using an &amp;quot;.htaccess&amp;quot; File&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Below is a sample &amp;quot;.htaccess&amp;quot; file which goes in&lt;br /&gt;
     &amp;quot;/usr/local/apache/htdocs/chirico/alpha/.htaccess&amp;quot; for this&lt;br /&gt;
     example&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         AuthUserFile /usr/local/apache/htdocs/chirico/alpha/.htpasswd&lt;br /&gt;
         AuthGroupFile /dev/null&lt;br /&gt;
         AuthName &amp;quot;Your Name and regular password required&amp;quot;&lt;br /&gt;
         AuthType Basic&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;Limit GET POST&amp;gt;&lt;br /&gt;
         require valid-user&lt;br /&gt;
         &amp;lt;/Limit&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    In order for this to work /usr/local/apache/conf/httpd.conf must&lt;br /&gt;
    have the following line in it:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       #&lt;br /&gt;
       &amp;lt;Directory /usr/local/apache/htdocs/chirico/alpha&amp;gt;&lt;br /&gt;
           AllowOverride FileInfo AuthConfig Limit&lt;br /&gt;
           Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec&lt;br /&gt;
           &amp;lt;Limit GET POST OPTIONS PROPFIND&amp;gt;&lt;br /&gt;
               Order allow,deny&lt;br /&gt;
               Allow from all&lt;br /&gt;
           &amp;lt;/Limit&amp;gt;&lt;br /&gt;
           &amp;lt;LimitExcept GET POST OPTIONS PROPFIND&amp;gt;&lt;br /&gt;
               Order deny,allow&lt;br /&gt;
               Deny from all&lt;br /&gt;
           &amp;lt;/LimitExcept&amp;gt;&lt;br /&gt;
       &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Also, a password file must be created&lt;br /&gt;
&lt;br /&gt;
      $ /usr/local/apache/bin/htpasswd -c .htpasswd chirico&lt;br /&gt;
&lt;br /&gt;
    And enter the user names and passwords.&lt;br /&gt;
&lt;br /&gt;
    Next Reload Apache:&lt;br /&gt;
&lt;br /&gt;
      $ /etc/init.d/httpd reload&lt;br /&gt;
&lt;br /&gt;
    (Reference TIP 213 limit access to certain directories based on IP address).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 17:&lt;br /&gt;
&lt;br /&gt;
     Working with &amp;quot;mt&amp;quot; Commands: reading and writing to tape.&lt;br /&gt;
&lt;br /&gt;
     The following assumes the tape device is &amp;quot;/dev/st0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     STEP 1 ( rewind the tape)&lt;br /&gt;
&lt;br /&gt;
          # mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (check to see if you are at block 0)&lt;br /&gt;
&lt;br /&gt;
          # mt -f /dev/nst0 tell&lt;br /&gt;
            At block 0.&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Backup &amp;quot;tar compress&amp;quot;  directories &amp;quot;one&amp;quot;  and &amp;quot;two&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
          # tar -czf /dev/nst0 one two&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Check to see what block you are at)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
&lt;br /&gt;
       You should get something like block 2 at this point.&lt;br /&gt;
&lt;br /&gt;
     STEP 5 (Rewind the tape)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
     STEP 6 (List the files)&lt;br /&gt;
&lt;br /&gt;
           # tar -tzf /dev/nst0&lt;br /&gt;
              one/&lt;br /&gt;
              one/test&lt;br /&gt;
              two/&lt;br /&gt;
&lt;br /&gt;
     STEP 7 (Restore directory &amp;quot;one&amp;quot;  into directory &amp;quot;junk&amp;quot;).  Note, you&lt;br /&gt;
          have to first rewind the tape, since the last operation moved&lt;br /&gt;
          ahead 2 blocks. Check this with &amp;quot;mt -f /dev/nst0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           # cd junk&lt;br /&gt;
           # mt -f /dev/nst0 rewind&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
              At block 0.&lt;br /&gt;
           # tar -xzf /dev/nst0 one&lt;br /&gt;
&lt;br /&gt;
     STEP 8 (Next, take a look to see what block the tape is at)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
              At block 2.&lt;br /&gt;
&lt;br /&gt;
     STEP 9 (Now backup directories three  and four)&lt;br /&gt;
&lt;br /&gt;
           # tar -czf /dev/nst0 three four&lt;br /&gt;
&lt;br /&gt;
       After backing up the files, the tape should be past block 2.&lt;br /&gt;
       Check this.&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
             At block 4.&lt;br /&gt;
&lt;br /&gt;
          Currently the following exist:&lt;br /&gt;
&lt;br /&gt;
                At block 1:&lt;br /&gt;
                     one/&lt;br /&gt;
                    one/test&lt;br /&gt;
                    two/&lt;br /&gt;
&lt;br /&gt;
                At block 2:&lt;br /&gt;
                    three/&lt;br /&gt;
                    three/samplehere&lt;br /&gt;
                    four/&lt;br /&gt;
&lt;br /&gt;
                At block 4:&lt;br /&gt;
                    (* This is empty *)&lt;br /&gt;
&lt;br /&gt;
     A few notes. You can set the blocking factor and a label&lt;br /&gt;
     with tar. For example:&lt;br /&gt;
&lt;br /&gt;
      $ tar --label=&amp;quot;temp label&amp;quot; --create  --blocking-factor=128 --file=/dev/nst0 Notes&lt;br /&gt;
&lt;br /&gt;
     But note if you try to read it with the default, incorrect blocking&lt;br /&gt;
     factor, then, you will get the following error:&lt;br /&gt;
&lt;br /&gt;
        $ tar -t   --file=/dev/nst0&lt;br /&gt;
        tar: /dev/nst0: Cannot read: Cannot allocate memory&lt;br /&gt;
        tar: At beginning of tape, quitting now&lt;br /&gt;
        tar: Error is not recoverable: exiting now&lt;br /&gt;
&lt;br /&gt;
     However this is easily fixed with the correct blocking factor&lt;br /&gt;
&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ tar -t --blocking-factor=128 --file=/dev/nst0&lt;br /&gt;
         temp label&lt;br /&gt;
         Notes&lt;br /&gt;
&lt;br /&gt;
     Take advantage of the label command.&lt;br /&gt;
&lt;br /&gt;
         $ MYCOMMENTS=&amp;quot;Big_important_tape&amp;quot;&lt;br /&gt;
         $ tar --label=&amp;quot;$(date +%F)&amp;quot;+&amp;quot;${MYCOMMENTS}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Writing to tape on a remote 192.168.1.155 computer&lt;br /&gt;
&lt;br /&gt;
         $ tar cvzf - ./tmp | ssh -l chirico 192.168.1.155 '(mt -f /dev/nst0 rewind; dd of=/dev/st0 )'&lt;br /&gt;
&lt;br /&gt;
     Restoring the contents from tape on a remote computer&lt;br /&gt;
&lt;br /&gt;
         $ ssh -l chirico 192.168.1.155 '(mt -f /dev/nst0 rewind; dd if=/dev/st0  )'|tar xzf -&lt;br /&gt;
&lt;br /&gt;
     Getting data off of tape with dd command with odd blocking factor. Just set ibs very high&lt;br /&gt;
&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ tar --label=&amp;quot;Contenets of Notes&amp;quot; --create  --blocking-factor=128 --file=/dev/nst0 Notes&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ dd ibs=1048576 if=/dev/st0 of=notes.tar&lt;br /&gt;
&lt;br /&gt;
     The above will probably work with ibs=64k as well&lt;br /&gt;
&lt;br /&gt;
        (Also see TIP 136)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 18:&lt;br /&gt;
&lt;br /&gt;
     Encrypting Data to Tape using &amp;quot;tar&amp;quot; and &amp;quot;openssl&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     The following shows an example of writing the contents of &amp;quot;tapetest&amp;quot; to tape:&lt;br /&gt;
&lt;br /&gt;
        $ tar zcvf - tapetest|openssl des3 -salt  -k secretpassword | dd of=/dev/st0&lt;br /&gt;
&lt;br /&gt;
     Reading the data back:&lt;br /&gt;
&lt;br /&gt;
        $ dd if=/dev/st0|openssl des3 -d -k secretpassword|tar xzf -&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 19:&lt;br /&gt;
&lt;br /&gt;
     Mounting an ISO Image as a Filesystem -- this is great if you don't have the DVD&lt;br /&gt;
         hardware, but, need to get at the data.  The following show an example of&lt;br /&gt;
         mounting the Fedora core 2 as a file.&lt;br /&gt;
&lt;br /&gt;
         $ mkdir /iso0&lt;br /&gt;
         $ mount -o loop -t iso9660 /FC2-i386-DVD.iso  /iso0&lt;br /&gt;
&lt;br /&gt;
     Or to mount automatically at boot, add the following to &amp;quot;/etc/fstab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         /FC2-i386-DVD.iso /iso0     iso9660 rw,loop  0 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Reference: http://umn.dl.sourceforge.net/sourceforge/souptonuts/README_fedora.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 20:&lt;br /&gt;
&lt;br /&gt;
     Getting Information about the Hard drive and list all PCI devices.&lt;br /&gt;
&lt;br /&gt;
                $ hdparm /dev/hda&lt;br /&gt;
&lt;br /&gt;
                  /dev/hda:&lt;br /&gt;
                   multcount    = 16 (on)&lt;br /&gt;
                   IO_support   =  0 (default 16-bit)&lt;br /&gt;
                   unmaskirq    =  0 (off)&lt;br /&gt;
                   using_dma    =  1 (on)&lt;br /&gt;
                   keepsettings =  0 (off)&lt;br /&gt;
                   readonly     =  0 (off)&lt;br /&gt;
                   readahead    = 256 (on)&lt;br /&gt;
                   geometry     = 16383/255/63, sectors = 234375000, start = 0&lt;br /&gt;
&lt;br /&gt;
            or for SCSI&lt;br /&gt;
&lt;br /&gt;
                $ hdparm /dev/sda&lt;br /&gt;
&lt;br /&gt;
            Try it with the -i option for information&lt;br /&gt;
&lt;br /&gt;
                $ hdparm -i /dev/hda&lt;br /&gt;
&lt;br /&gt;
                /dev/hda:&lt;br /&gt;
&lt;br /&gt;
                Model=IC35L120AVV207-1, FwRev=V24OA66A, SerialNo=VNVD09G4CZ6E0T&lt;br /&gt;
                Config={ HardSect NotMFM HdSw&amp;gt;15uSec Fixed DTR&amp;gt;10Mbs }&lt;br /&gt;
                RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=52&lt;br /&gt;
                BuffType=DualPortCache, BuffSize=7965kB, MaxMultSect=16, MultSect=16&lt;br /&gt;
                CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=234375000&lt;br /&gt;
                IORDY=on/off, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}&lt;br /&gt;
                PIO modes:  pio0 pio1 pio2 pio3 pio4&lt;br /&gt;
                DMA modes:  mdma0 mdma1 mdma2&lt;br /&gt;
                UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5&lt;br /&gt;
                AdvancedPM=yes: disabled (255) WriteCache=enabled&lt;br /&gt;
                Drive conforms to: ATA/ATAPI-6 T13 1410D revision 3a:  2 3 4 5 6&lt;br /&gt;
&lt;br /&gt;
            How fast is your drive?&lt;br /&gt;
&lt;br /&gt;
                $ hdparm -tT /dev/hda&lt;br /&gt;
&lt;br /&gt;
                /dev/hda:&lt;br /&gt;
                Timing buffer-cache reads:   128 MB in  0.41 seconds =315.32 MB/sec&lt;br /&gt;
                Timing buffered disk reads:  64 MB in  1.19 seconds = 53.65 MB/sec&lt;br /&gt;
&lt;br /&gt;
            Need to find your device?&lt;br /&gt;
&lt;br /&gt;
                $ mount&lt;br /&gt;
                   or&lt;br /&gt;
                $ cat /proc/partitions&lt;br /&gt;
                   or&lt;br /&gt;
                $ dmesg | egrep '^(s|h)d'&lt;br /&gt;
&lt;br /&gt;
                   which for my system lists:&lt;br /&gt;
&lt;br /&gt;
                      hda: IC35L120AVV207-1, ATA DISK drive&lt;br /&gt;
                      hdc: Lite-On LTN486S 48x Max, ATAPI CD/DVD-ROM drive&lt;br /&gt;
                      hda: max request size: 1024KiB&lt;br /&gt;
                      hda: 234375000 sectors (120000 MB) w/7965KiB Cache, CHS=16383/255/63, UDMA(100)&lt;br /&gt;
&lt;br /&gt;
             By the way, if you want to turn on dma&lt;br /&gt;
&lt;br /&gt;
                 $ hdparm -d1 /dev/hda&lt;br /&gt;
                   setting using_dma to 1 (on)&lt;br /&gt;
                   using_dma    =  1 (on)&lt;br /&gt;
&lt;br /&gt;
         (Also see TIP 122 )&lt;br /&gt;
&lt;br /&gt;
     List all PCI devices&lt;br /&gt;
&lt;br /&gt;
                $ lspci -v&lt;br /&gt;
&lt;br /&gt;
          00:00.0 Host bridge: Intel Corp. 82845G/GL [Brookdale-G] Chipset Host Bridge (rev&lt;br /&gt;
                  Subsystem: Dell Computer Corporation: Unknown device 0160&lt;br /&gt;
                  Flags: bus master, fast devsel, latency 0&lt;br /&gt;
                  Memory at f0000000 (32-bit, prefetchable) [size=128M]&lt;br /&gt;
                  Capabilities: &amp;lt;available only to root&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              ... lots more ...&lt;br /&gt;
&lt;br /&gt;
           Note, there is also lspci -vv for even more information.&lt;br /&gt;
&lt;br /&gt;
          (Also see TIP 200)&lt;br /&gt;
&lt;br /&gt;
TIP 21:&lt;br /&gt;
&lt;br /&gt;
     Setting up &amp;quot;cron&amp;quot; Jobs.&lt;br /&gt;
&lt;br /&gt;
     If you want to use the emacs editor for editing cron jobs, then,&lt;br /&gt;
     set the following in your &amp;quot;/home/user/.bash_profile&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        EDITOR=emacs&lt;br /&gt;
&lt;br /&gt;
     Then, to edit cron jobs&lt;br /&gt;
&lt;br /&gt;
        $ crontab -e&lt;br /&gt;
&lt;br /&gt;
     You may want to put in the following header&lt;br /&gt;
&lt;br /&gt;
        #MINUTE(0-59) HOUR(0-23) DAYOFMONTH(1-31) MONTHOFYEAR(1-12) DAYOFWEEK(0-6) Note 0=Sun and 7=Sun&lt;br /&gt;
        #&lt;br /&gt;
        #14,15 10 * * 0   /usr/bin/somecommmand  &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     The sample &amp;quot;commented out command&amp;quot; will run at 10:14 and 10:15 every Sunday.  There will&lt;br /&gt;
     be no &amp;quot;mail&amp;quot; sent to the user because of the &amp;quot;&amp;gt;/dev/null 2&amp;gt;&amp;amp;1&amp;quot; entry.&lt;br /&gt;
&lt;br /&gt;
        $ crontab -l&lt;br /&gt;
&lt;br /&gt;
     The above will list all cron jobs. Or if you're root&lt;br /&gt;
&lt;br /&gt;
        $ crontab -l -u &amp;lt;username&amp;gt;&lt;br /&gt;
        $ crontab -e -u &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Reference &amp;quot;man 5 crontab&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
        The time and date fields are:&lt;br /&gt;
&lt;br /&gt;
                     field          allowed values&lt;br /&gt;
                     -----          --------------&lt;br /&gt;
                     minute         0-59&lt;br /&gt;
                     hour           0-23&lt;br /&gt;
                     day of month   1-31&lt;br /&gt;
                     month          1-12 (or names, see below)&lt;br /&gt;
                     day of week    0-7 (0 or 7 is Sun, or use names)&lt;br /&gt;
&lt;br /&gt;
              A field may be an asterisk (*), which always stands for ``first-last''.&lt;br /&gt;
&lt;br /&gt;
              Ranges of numbers are allowed.  Ranges are two numbers separated with a&lt;br /&gt;
              hyphen.   The  specified  range is inclusive.  For example, 8-11 for an&lt;br /&gt;
              ``hours'' entry specifies execution at hours 8, 9, 10 and 11.&lt;br /&gt;
&lt;br /&gt;
              Lists are allowed.  A list is a set of numbers (or ranges) separated by&lt;br /&gt;
              commas.  Examples: ``1,2,5,9'', ``0-4,8-12''.&lt;br /&gt;
&lt;br /&gt;
              Ranges can include &amp;quot;steps&amp;quot;, so &amp;quot;1-9/2&amp;quot; is the same as &amp;quot;1,3,5,7,9&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Note, you can run just every 5 minutes as follows:&lt;br /&gt;
&lt;br /&gt;
              */5 * * * * /etc/mrtg/domrtg  &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     To run jobs hourly,daily,weekly or monthly you can add shell scripts into the&lt;br /&gt;
     appropriate directory:&lt;br /&gt;
&lt;br /&gt;
             /etc/cron.hourly/&lt;br /&gt;
             /etc/cron.daily/&lt;br /&gt;
             /etc/cron.weekly/&lt;br /&gt;
             /etc/cron.monthly/&lt;br /&gt;
&lt;br /&gt;
     Note that the above are pre-configured schedules set in &amp;quot;/etc/crontab&amp;quot;, so&lt;br /&gt;
     if you want, you can change the schedule. Below is my /etc/crontab:&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/crontab&lt;br /&gt;
           SHELL=/bin/bash&lt;br /&gt;
           PATH=/sbin:/bin:/usr/sbin:/usr/bin&lt;br /&gt;
           MAILTO=root&lt;br /&gt;
           HOME=/&lt;br /&gt;
&lt;br /&gt;
           # run-parts&lt;br /&gt;
           01 * * * * root run-parts /etc/cron.hourly&lt;br /&gt;
           02 4 * * * root run-parts /etc/cron.daily&lt;br /&gt;
           22 4 * * 0 root run-parts /etc/cron.weekly&lt;br /&gt;
           42 4 1 * * root run-parts /etc/cron.monthly&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 22:&lt;br /&gt;
&lt;br /&gt;
     Keeping Files in Sync Between Servers.&lt;br /&gt;
&lt;br /&gt;
     The remote computer is &amp;quot;192.168.1.171&amp;quot; and has the account &amp;quot;donkey&amp;quot;.  You want&lt;br /&gt;
     to &amp;quot;keep in sync&amp;quot; the files under &amp;quot;/home/cu2000/Logs&amp;quot; on the remote computer&lt;br /&gt;
     with files on &amp;quot;/home/chirico/dev/MEDIA_Server&amp;quot; on the local computer.&lt;br /&gt;
&lt;br /&gt;
       $ rsync  -Lae ssh  donkey@192.168.1.171:/home/cu2000/Logs /home/chirico/dev/MEDIA_Server&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;rsync&amp;quot; is a convient command for keeping files in sync, and as shown here will work&lt;br /&gt;
     through ssh.  The -L option tells rsync to treat symbolic links like ordinary files.&lt;br /&gt;
&lt;br /&gt;
        Also see [http://www.rsnapshot.org/]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 23:&lt;br /&gt;
&lt;br /&gt;
     Looking up the Spelling of a Word.&lt;br /&gt;
&lt;br /&gt;
        $ look &amp;lt;partial spelling&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     so the following will list all words that&lt;br /&gt;
     start with stuff&lt;br /&gt;
&lt;br /&gt;
        $ look stuff&lt;br /&gt;
           stuff&lt;br /&gt;
           stuffage&lt;br /&gt;
           stuffata&lt;br /&gt;
           stuffed&lt;br /&gt;
           stuffender&lt;br /&gt;
           stuffer&lt;br /&gt;
           stuffers&lt;br /&gt;
           stuffgownsman&lt;br /&gt;
           stuffier&lt;br /&gt;
           stuffiest&lt;br /&gt;
           stuffily&lt;br /&gt;
           stuffiness&lt;br /&gt;
           stuffinesses&lt;br /&gt;
           stuffiness's&lt;br /&gt;
           stuffing&lt;br /&gt;
           stuffings&lt;br /&gt;
           stuffing's&lt;br /&gt;
           stuffless&lt;br /&gt;
           stuffs&lt;br /&gt;
           stuffy&lt;br /&gt;
&lt;br /&gt;
     It helps to have a large &amp;quot;linuxwords&amp;quot; dictionary.  You can download&lt;br /&gt;
     a much bigger dictionary from the following:&lt;br /&gt;
&lt;br /&gt;
              http://prdownloads.sourceforge.net/souptonuts/linuxwords.1.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
     Note: vim users can setup the .vimrc file with the following. Now when you type &lt;br /&gt;
       CTL-X CTL-T in insert mode, you'll get a thesaurus lookup.&lt;br /&gt;
&lt;br /&gt;
           set dictionary+=/usr/share/dict/words&lt;br /&gt;
           set thesaurus+=/usr/share/dict/words&lt;br /&gt;
&lt;br /&gt;
     Or, you can call aspell with the F6 command after putting the folling entry in your&lt;br /&gt;
     .vimrc file&lt;br /&gt;
&lt;br /&gt;
           :nmap &amp;lt;F6&amp;gt; :w&amp;lt;CR&amp;gt;:!aspell -e -c %&amp;lt;CR&amp;gt;:e&amp;lt;CR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Now, hit F6 when you're in vim, and you'll get a spell checker.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     There is also an X Windows dictionary that runs with the following command.&lt;br /&gt;
&lt;br /&gt;
           $ gnome-dictionary&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 24:&lt;br /&gt;
&lt;br /&gt;
     Find out if a Command is Aliased.&lt;br /&gt;
&lt;br /&gt;
         $ type -all &amp;lt;command&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Example:&lt;br /&gt;
&lt;br /&gt;
         $ type -all ls&lt;br /&gt;
            ls is aliased to `ls --color=tty'&lt;br /&gt;
            ls is /bin/ls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 25:&lt;br /&gt;
&lt;br /&gt;
     Create a Terminal Calculator&lt;br /&gt;
&lt;br /&gt;
      Put the following in your .bashrc file&lt;br /&gt;
&lt;br /&gt;
            function calc&lt;br /&gt;
            {&lt;br /&gt;
             echo &amp;quot;${1}&amp;quot;|bc -l;&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
      Or, run it at the shell prompt. Now&lt;br /&gt;
      &amp;quot;calc&amp;quot; from the shell will work as follows:&lt;br /&gt;
&lt;br /&gt;
            $ calc 3+45&lt;br /&gt;
               48&lt;br /&gt;
&lt;br /&gt;
      All functions  with a &amp;quot;(&amp;quot; or &amp;quot;)&amp;quot; must be enclosed&lt;br /&gt;
      in quotes.  For instance, to get the sin of .4&lt;br /&gt;
&lt;br /&gt;
            $ calc &amp;quot;s(.4)&amp;quot;&lt;br /&gt;
              .38941834230865049166&lt;br /&gt;
&lt;br /&gt;
          (See TIP 115 using the expr command)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 26:&lt;br /&gt;
&lt;br /&gt;
     Kill a User and All Their Current Processes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        #  This program will kill all processes from a&lt;br /&gt;
        #  user.  The user name is read from the command line.&lt;br /&gt;
        #&lt;br /&gt;
        #  This program also demonstrates reading a bash variable&lt;br /&gt;
        #  into an awk script.&lt;br /&gt;
        #&lt;br /&gt;
        #  Usage: kill9user &amp;lt;user&amp;gt;&lt;br /&gt;
        #&lt;br /&gt;
        kill -9 `ps aux|awk -v var=$1 '$1==var { print $2 }'`&lt;br /&gt;
&lt;br /&gt;
    or if you want want to create the above script the command&lt;br /&gt;
    below will kill the user &amp;quot;donkey&amp;quot; and all of his processes.&lt;br /&gt;
&lt;br /&gt;
        $ kill -9 `ps aux|awk -v var=&amp;quot;donkey&amp;quot; '$1==var { print $2 }'`&lt;br /&gt;
&lt;br /&gt;
    Check their cron jobs and &amp;quot;at&amp;quot; jobs, if you have a security issue.&lt;br /&gt;
&lt;br /&gt;
          $ crontab -u &amp;lt;user&amp;gt; -e&lt;br /&gt;
&lt;br /&gt;
    Lock the account:&lt;br /&gt;
&lt;br /&gt;
          $ passwd -l &amp;lt;user&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Remove all authorized_keys&lt;br /&gt;
&lt;br /&gt;
          $ rm /home/user/.shosts&lt;br /&gt;
          $ rm /home/user/.rhosts&lt;br /&gt;
          $ rm -rf /home/user/.ssh&lt;br /&gt;
          $ rm /home/user/.forward&lt;br /&gt;
&lt;br /&gt;
      or consider&lt;br /&gt;
&lt;br /&gt;
          $ mv /home/user  /home/safeuser&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Change the shell&lt;br /&gt;
&lt;br /&gt;
          $ chsh -s /bin/true &amp;lt;user&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Do an inventory&lt;br /&gt;
&lt;br /&gt;
          $ find / -user &amp;lt;user&amp;gt;  &amp;gt; list_of_user_files&lt;br /&gt;
&lt;br /&gt;
    NOTE: Also see (TIP 10).&lt;br /&gt;
&lt;br /&gt;
    To see all users, except the current user. Do not use the&lt;br /&gt;
    dash &amp;quot;ps -aux&amp;quot; is wrong but the following is correct:&lt;br /&gt;
&lt;br /&gt;
          $ ps aux| awk '!/'${USER}'/{printf(&amp;quot;%s \n&amp;quot;,$0)}'&lt;br /&gt;
&lt;br /&gt;
     or (ww = wide, wide output)&lt;br /&gt;
&lt;br /&gt;
          $ ps auwwx| awk '!/'${USER}'/{printf(&amp;quot;%s \n&amp;quot;,$0)}'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    The following codes may be useful:&lt;br /&gt;
&lt;br /&gt;
       D    Uninterruptible sleep (usually IO)&lt;br /&gt;
       R    Running or runnable (on run queue)&lt;br /&gt;
       S    Interruptible sleep (waiting for an event to complete)&lt;br /&gt;
       T    Stopped, either by a job control signal or because it is being traced.&lt;br /&gt;
       W    paging (not valid since the 2.6.xx kernel)&lt;br /&gt;
       X    dead (should never be seen)&lt;br /&gt;
       Z    Defunct (&amp;quot;zombie&amp;quot;) process, terminated but not reaped by its parent.&lt;br /&gt;
&lt;br /&gt;
    For BSD formats and when the stat keyword is used, additional&lt;br /&gt;
       characters may be displayed:&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;    high-priority (not nice to other users)&lt;br /&gt;
       N    low-priority (nice to other users)&lt;br /&gt;
       L    has pages locked into memory (for real-time and custom IO)&lt;br /&gt;
       s    is a session leader&lt;br /&gt;
       l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)&lt;br /&gt;
       +    is in the foreground process group&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Also see TIP 28. and TIP 89.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 27:&lt;br /&gt;
&lt;br /&gt;
     Format Dates for Logs and Files&lt;br /&gt;
&lt;br /&gt;
         $ date &amp;quot;+%m%d%y %A,%B %d %Y %X&amp;quot;&lt;br /&gt;
             061704 Thursday,June 17 2004 07:13:40 PM&lt;br /&gt;
&lt;br /&gt;
         $ date &amp;quot;+%m%d%Y&amp;quot;&lt;br /&gt;
             06172004&lt;br /&gt;
&lt;br /&gt;
         $ date -d '1 day ago' &amp;quot;+%m%d%Y&amp;quot;&lt;br /&gt;
             06162004&lt;br /&gt;
&lt;br /&gt;
         $ date -d '3 months 1 day  2 hour  15 minutes 2 seconds ago'&lt;br /&gt;
&lt;br /&gt;
      or to go into the future remove the &amp;quot;ago&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         $ date -d '3 months 1 day  2 hour  15 minutes 2 seconds '&lt;br /&gt;
&lt;br /&gt;
            Also the following works:&lt;br /&gt;
&lt;br /&gt;
                $ date -d '+2 year +1 month -1 week  +3 day -8 hour +2 min -5 seconds'&lt;br /&gt;
&lt;br /&gt;
      Quick question: If there are 100,000,000 stars in the visible sky, and you can&lt;br /&gt;
      count them, round the clock, at a rate of a star per second starting now, when&lt;br /&gt;
      would you finish counting?  Would you still be alive?&lt;br /&gt;
&lt;br /&gt;
                $ date -d '+100000000 seconds'&lt;br /&gt;
&lt;br /&gt;
      Sooner than you think!&lt;br /&gt;
&lt;br /&gt;
      This can be assigned to variables&lt;br /&gt;
&lt;br /&gt;
         $ mdate=`date -d '3 months 1 day  2 hour  15 minutes 2 seconds ' &amp;quot;+%m%d%Y_%A_%B_%D_%Y_%X&amp;quot;  `&lt;br /&gt;
         $ echo $mdate&lt;br /&gt;
             09182004_Saturday_September_09/18/04_2004_09:40:41 PM&lt;br /&gt;
             ^---- Easy to sort   ^-------^----- Easy to read&lt;br /&gt;
&lt;br /&gt;
      See TIP 28 below.&lt;br /&gt;
&lt;br /&gt;
      See TIP 87 when working with large delta time changes -40 years, or -200 years ago, or even&lt;br /&gt;
      1,000,000 days into the future.&lt;br /&gt;
&lt;br /&gt;
      Also see (TIP 1) for working with time zones.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 28:&lt;br /&gt;
&lt;br /&gt;
     Need Ascii Codes? For instance, for printing quotes:&lt;br /&gt;
&lt;br /&gt;
                         awk 'BEGIN { msg = &amp;quot;Don\047t Panic!&amp;quot;; printf &amp;quot;%s \n&amp;quot;,msg }'&lt;br /&gt;
              or&lt;br /&gt;
                         awk 'BEGIN { msg = &amp;quot;Don\x027t Panic!&amp;quot;; printf &amp;quot;%s \n&amp;quot;,msg }'&lt;br /&gt;
&lt;br /&gt;
     It's better to use \047, because certain characters that follow \x027 may cause problems.&lt;br /&gt;
&lt;br /&gt;
     For example, take a look at the following two lines. The first line prints a &amp;quot;}&amp;quot; caused&lt;br /&gt;
     by the extra D in \x027D. The the line immediately below does not work as expected.&lt;br /&gt;
&lt;br /&gt;
                      awk 'BEGIN {printf(&amp;quot;The D causes problems \x027D\n&amp;quot;)}'&lt;br /&gt;
&lt;br /&gt;
            However, the line below works fine:&lt;br /&gt;
&lt;br /&gt;
                      awk 'BEGIN {printf(&amp;quot;The D does not cause problems \047D\n&amp;quot;)}'&lt;br /&gt;
&lt;br /&gt;
     Or if you wanted to use the date command in &amp;quot;awk&amp;quot; to print date.time.nanosecond.timezone for&lt;br /&gt;
     each line of a file &amp;quot;test&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     The following date can be used in awk because the single quotes are enclosed within the&lt;br /&gt;
     double quotes.&lt;br /&gt;
&lt;br /&gt;
             date '+%m%d%Y.%H%M%S.%N%z'&lt;br /&gt;
&lt;br /&gt;
       $ awk 'BEGIN { &amp;quot;date '+%m%d%Y.%H%M%S.%N%z'&amp;quot; | getline MyDate  } { print MyDate,$0 }' &amp;lt; data&lt;br /&gt;
&lt;br /&gt;
     But it's also possible to replace  &amp;quot;+&amp;quot;  with  \x2B,  &amp;quot;%&amp;quot; with \x25, and &amp;quot;d&amp;quot; with \x64 as follows:&lt;br /&gt;
&lt;br /&gt;
       $ awk 'BEGIN { &amp;quot;date \x27\x2B\x25m\x25\x64\x25Y.\x25H\x25M\x25S.\x25N\x25z\x27&amp;quot; | getline MyDate  } { print MyDate,$0 }' &amp;lt; test&lt;br /&gt;
&lt;br /&gt;
             07062004.113820.346033000-0400 bob 71&lt;br /&gt;
             07062004.113820.346033000-0400 tom 43&lt;br /&gt;
             07062004.113820.346033000-0400 sal 34&lt;br /&gt;
             07062004.113820.346033000-0400 bob 89&lt;br /&gt;
             07062004.113820.346033000-0400 tom 66&lt;br /&gt;
             07062004.113820.346033000-0400 sal 99&lt;br /&gt;
&lt;br /&gt;
     For this example it's not needed because single quotes are used inside of double quotes; however, there may be times when&lt;br /&gt;
     hex replacement is easier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ man ascii&lt;br /&gt;
&lt;br /&gt;
        Oct   Dec   Hex   Char           Oct   Dec   Hex   Char&lt;br /&gt;
            -----------------------------------------------------------&lt;br /&gt;
            000   0     00    NUL '\0'       100   64    40    @&lt;br /&gt;
            001   1     01    SOH            101   65    41    A&lt;br /&gt;
            002   2     02    STX            102   66    42    B&lt;br /&gt;
            003   3     03    ETX            103   67    43    C&lt;br /&gt;
            004   4     04    EOT            104   68    44    D&lt;br /&gt;
            005   5     05    ENQ            105   69    45    E&lt;br /&gt;
            006   6     06    ACK            106   70    46    F&lt;br /&gt;
            007   7     07    BEL '\a'       107   71    47    G&lt;br /&gt;
            010   8     08    BS  '\b'       110   72    48    H&lt;br /&gt;
            011   9     09    HT  '\t'       111   73    49    I&lt;br /&gt;
            012   10    0A    LF  '\n'       112   74    4A    J&lt;br /&gt;
            013   11    0B    VT  '\v'       113   75    4B    K&lt;br /&gt;
            014   12    0C    FF  '\f'       114   76    4C    L&lt;br /&gt;
            015   13    0D    CR  '\r'       115   77    4D    M&lt;br /&gt;
            016   14    0E    SO             116   78    4E    N&lt;br /&gt;
            017   15    0F    SI             117   79    4F    O&lt;br /&gt;
            020   16    10    DLE            120   80    50    P&lt;br /&gt;
            021   17    11    DC1            121   81    51    Q&lt;br /&gt;
            022   18    12    DC2            122   82    52    R&lt;br /&gt;
            023   19    13    DC3            123   83    53    S&lt;br /&gt;
            024   20    14    DC4            124   84    54    T&lt;br /&gt;
            025   21    15    NAK            125   85    55    U&lt;br /&gt;
            026   22    16    SYN            126   86    56    V&lt;br /&gt;
            027   23    17    ETB            127   87    57    W&lt;br /&gt;
            030   24    18    CAN            130   88    58    X&lt;br /&gt;
            031   25    19    EM             131   89    59    Y&lt;br /&gt;
            032   26    1A    SUB            132   90    5A    Z&lt;br /&gt;
            033   27    1B    ESC            133   91    5B    [&lt;br /&gt;
            034   28    1C    FS             134   92    5C    \   '\\'&lt;br /&gt;
            035   29    1D    GS             135   93    5D    ]&lt;br /&gt;
            036   30    1E    RS             136   94    5E    ^&lt;br /&gt;
            037   31    1F    US             137   95    5F    _&lt;br /&gt;
            040   32    20    SPACE          140   96    60    `&lt;br /&gt;
            041   33    21    !              141   97    61    a&lt;br /&gt;
            042   34    22    &amp;quot;              142   98    62    b&lt;br /&gt;
            043   35    23    #              143   99    63    c&lt;br /&gt;
            044   36    24    $              144   100   64    d&lt;br /&gt;
            045   37    25    %              145   101   65    e&lt;br /&gt;
            046   38    26    &amp;amp;              146   102   66    f&lt;br /&gt;
            047   39    27    '              147   103   67    g&lt;br /&gt;
            050   40    28    (              150   104   68    h&lt;br /&gt;
            051   41    29    )              151   105   69    i&lt;br /&gt;
            052   42    2A    *              152   106   6A    j&lt;br /&gt;
            053   43    2B    +              153   107   6B    k&lt;br /&gt;
            054   44    2C    ,              154   108   6C    l&lt;br /&gt;
            055   45    2D    -              155   109   6D    m&lt;br /&gt;
            056   46    2E    .              156   110   6E    n&lt;br /&gt;
            057   47    2F    /              157   111   6F    o&lt;br /&gt;
            060   48    30    0              160   112   70    p&lt;br /&gt;
            061   49    31    1              161   113   71    q&lt;br /&gt;
            062   50    32    2              162   114   72    r&lt;br /&gt;
            063   51    33    3              163   115   73    s&lt;br /&gt;
            064   52    34    4              164   116   74    t&lt;br /&gt;
            065   53    35    5              165   117   75    u&lt;br /&gt;
            066   54    36    6              166   118   76    v&lt;br /&gt;
            067   55    37    7              167   119   77    w&lt;br /&gt;
            070   56    38    8              170   120   78    x&lt;br /&gt;
            071   57    39    9              171   121   79    y&lt;br /&gt;
            072   58    3A    :              172   122   7A    z&lt;br /&gt;
            073   59    3B    ;              173   123   7B    {&lt;br /&gt;
            074   60    3C    &amp;lt;              174   124   7C    |&lt;br /&gt;
            075   61    3D    =              175   125   7D    }&lt;br /&gt;
            076   62    3E    &amp;gt;              176   126   7E    ~&lt;br /&gt;
            077   63    3F    ?              177   127   7F    DEL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 29:&lt;br /&gt;
&lt;br /&gt;
     Need a WWW Browser for the Terminal Session? Try lynx or elinks.&lt;br /&gt;
&lt;br /&gt;
         $ lynx&lt;br /&gt;
&lt;br /&gt;
     Or to read all these tips, with the latest updates&lt;br /&gt;
&lt;br /&gt;
      $ lynx http://umn.dl.sourceforge.net/sourceforge/souptonuts/How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Or, better yet elinks.&lt;br /&gt;
&lt;br /&gt;
         $ elinks http://somepage.&lt;br /&gt;
&lt;br /&gt;
     You can get elinks at the following site:&lt;br /&gt;
&lt;br /&gt;
             http://elinks.or.cz/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 30:&lt;br /&gt;
&lt;br /&gt;
    screen - screen manager with VT100/ANSI terminal emulation&lt;br /&gt;
&lt;br /&gt;
         This is an excellent utility. But if you work a lot in Emacs,&lt;br /&gt;
         then, you should place the following in your ~./.bashrc&lt;br /&gt;
&lt;br /&gt;
             alias s='screen -e^Pa -D -R'&lt;br /&gt;
&lt;br /&gt;
         After loging in again (or source .bashrc) ,&lt;br /&gt;
         type the following to load &amp;quot;screen&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
             $ s&lt;br /&gt;
&lt;br /&gt;
         If you're using the not using the alias command above, substitute&lt;br /&gt;
         CTL-a for CTL-p below. :&lt;br /&gt;
&lt;br /&gt;
             CTL-p CTL-C       To get a new session&lt;br /&gt;
             CTL-p  &amp;quot;           To list sessions, and arrow keys to move&lt;br /&gt;
             CTL-p SHFT-A      To name sessions&lt;br /&gt;
             CTL-p S            To split screens&lt;br /&gt;
             CLT-p Q            To unsplit screens&lt;br /&gt;
             CLT-p TAB          To switch between screens&lt;br /&gt;
             CLT-p :resize n    To resize screen to n rows, on split screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Screen is very powerful.  Should you become disconneced, you can&lt;br /&gt;
         still resume work after loggin in.&lt;br /&gt;
&lt;br /&gt;
             $ man screen&lt;br /&gt;
&lt;br /&gt;
         The above command will give you more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 31:&lt;br /&gt;
&lt;br /&gt;
     Need to Find the Factors of a Number?&lt;br /&gt;
&lt;br /&gt;
           $ factor 2345678992&lt;br /&gt;
                2345678992: 2 2 2 2 6581 22277&lt;br /&gt;
&lt;br /&gt;
     It's a quick way to find out if a number is prime&lt;br /&gt;
&lt;br /&gt;
           $ factor 7867&lt;br /&gt;
                7867: 7867&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 32:&lt;br /&gt;
&lt;br /&gt;
     Less is More -- piping to less to scroll backword and forward&lt;br /&gt;
&lt;br /&gt;
      For large &amp;quot;ls&amp;quot; listings try the followin, then, use the arrow key&lt;br /&gt;
      to move up and down the list.&lt;br /&gt;
&lt;br /&gt;
           $ ls /some_large_dir/ | less&lt;br /&gt;
&lt;br /&gt;
                 or&lt;br /&gt;
&lt;br /&gt;
           $ cat some_large_file | less&lt;br /&gt;
&lt;br /&gt;
                 or&lt;br /&gt;
&lt;br /&gt;
           $ less some_large_file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 33:&lt;br /&gt;
&lt;br /&gt;
     C &amp;quot;indent&amp;quot; Settings for Kernel Development&lt;br /&gt;
&lt;br /&gt;
           $ indent -kr -i8  program.c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 34:&lt;br /&gt;
&lt;br /&gt;
     FTP auto-login.  &amp;quot;ftp&amp;quot; to a site and have the password stored.&lt;br /&gt;
&lt;br /&gt;
     For instance, here's a sample &amp;quot;.net&amp;quot; file in a user's home&lt;br /&gt;
     directory for uploading to sourceforge. Note, sourceforge will&lt;br /&gt;
     take any password, so m@temp.com is used here for login &amp;quot;anonymous&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ cat ~/.netrc&lt;br /&gt;
               machine upload.sourceforge.net login anonymous password m@temp.com&lt;br /&gt;
               default login anonymous password user@site&lt;br /&gt;
&lt;br /&gt;
     It might be a good idea to change the rights on this file&lt;br /&gt;
&lt;br /&gt;
           $ chmod 0400 ~/.netrc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         #!/bin/bash&lt;br /&gt;
         #&lt;br /&gt;
         #  Sample ftp automated script to download&lt;br /&gt;
         #  file to ${dwnld}&lt;br /&gt;
         #&lt;br /&gt;
         dwnld=&amp;quot;/work/faq/unix-faq&amp;quot;&lt;br /&gt;
         cd ${dwnld}&lt;br /&gt;
         ftp &amp;lt;&amp;lt; FTPSTRING&lt;br /&gt;
         prompt off&lt;br /&gt;
         open rtfm.mit.edu&lt;br /&gt;
         cd /pub/usenet-by-group/news.answers/unix-faq/faq&lt;br /&gt;
         mget contents&lt;br /&gt;
         mget diff&lt;br /&gt;
         mget part*&lt;br /&gt;
         bye&lt;br /&gt;
         FTPSTRING&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      (Also see TIP 114 for ncftpget, which is a very powerful restarting&lt;br /&gt;
                            ftp program)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 35:&lt;br /&gt;
&lt;br /&gt;
     Bash Brace Expansion&lt;br /&gt;
&lt;br /&gt;
           $ echo f{ee,ie,oe,um}&lt;br /&gt;
                fee fie foe fum&lt;br /&gt;
&lt;br /&gt;
     This works with almost any command&lt;br /&gt;
&lt;br /&gt;
           $ mkdir -p /work/junk/{one,two,three,four}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 36:&lt;br /&gt;
&lt;br /&gt;
     Getting a List of Users on the System&lt;br /&gt;
&lt;br /&gt;
           $ cut -d: -f1 /etc/passwd | sort&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 37:&lt;br /&gt;
&lt;br /&gt;
     Editing a Bash Command&lt;br /&gt;
&lt;br /&gt;
      Try typing a long command say, then, type &amp;quot;fc&amp;quot; for an easy way&lt;br /&gt;
      to edit the command.&lt;br /&gt;
&lt;br /&gt;
           $ find /etc -iname '*.cnf' -exec grep -H 'log' {} \;&lt;br /&gt;
           $ fc&lt;br /&gt;
&lt;br /&gt;
      &amp;quot;fc&amp;quot; will bring the last command typed into an editor, &amp;quot;emacs&amp;quot; if&lt;br /&gt;
      that's the default editor. Type &amp;quot;fc -l&amp;quot; to list last few commands.&lt;br /&gt;
&lt;br /&gt;
      To seach for a command, try typing &amp;quot;CTL-r&amp;quot; at the shell prompt for&lt;br /&gt;
      searching. &amp;quot;CTL-t&amp;quot; to transpose, say &amp;quot;sl&amp;quot; was typed by you want &amp;quot;ls&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Hints when using &amp;quot;fc: in emacs:&lt;br /&gt;
&lt;br /&gt;
           ESC-b     move one word backward&lt;br /&gt;
           ESC-f     move one word forward&lt;br /&gt;
           ESC-DEL   kill one word backward&lt;br /&gt;
           CTL-k     kill point to end&lt;br /&gt;
           CTL-y     un-yank killed region at point&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 38:&lt;br /&gt;
&lt;br /&gt;
     Moving around Directories.&lt;br /&gt;
&lt;br /&gt;
     Change to the home directory:&lt;br /&gt;
          $ cd ~&lt;br /&gt;
            or&lt;br /&gt;
          $ cd&lt;br /&gt;
&lt;br /&gt;
     To go back to the last directory&lt;br /&gt;
          $ cd -&lt;br /&gt;
&lt;br /&gt;
     Instead of &amp;quot;cd&amp;quot; to a directory try &amp;quot;pushd&amp;quot; and look&lt;br /&gt;
     at the heading...you can see a list of directories.&lt;br /&gt;
&lt;br /&gt;
          $ pushd /etc&lt;br /&gt;
          $ pushd /usr/local&lt;br /&gt;
&lt;br /&gt;
      Then, to get back &amp;quot;popd&amp;quot; or &amp;quot;popd 1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      To list all the directories pushed on the stack&lt;br /&gt;
      use the &amp;quot;dirs -v&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
          $ dirs -v&lt;br /&gt;
           0  /usr/local&lt;br /&gt;
           1  /etc&lt;br /&gt;
           2  /work/souptonuts/documentation/theBook&lt;br /&gt;
&lt;br /&gt;
      Now, if you &amp;quot;pushd +1&amp;quot; you will be moved to &amp;quot;/etc&amp;quot;, since&lt;br /&gt;
      is number &amp;quot;1&amp;quot; on the stack, and this directory will become&lt;br /&gt;
      &amp;quot;0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ pwd&lt;br /&gt;
           /usr/local&lt;br /&gt;
          $ pushd +1&lt;br /&gt;
          $ pwd&lt;br /&gt;
           /etc&lt;br /&gt;
&lt;br /&gt;
          $ dirs -v&lt;br /&gt;
           0  /etc&lt;br /&gt;
           1  /work/souptonuts/documentation/theBook&lt;br /&gt;
           2  /usr/local&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 39:&lt;br /&gt;
&lt;br /&gt;
     Need an Underscore after a Variable?&lt;br /&gt;
&lt;br /&gt;
       Enclose the variable in &amp;quot;{}&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $echo ${UID}_&lt;br /&gt;
&lt;br /&gt;
       Compare to&lt;br /&gt;
&lt;br /&gt;
          $echo $UID_&lt;br /&gt;
&lt;br /&gt;
       Also try the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ m=&amp;quot;my stuff here&amp;quot;&lt;br /&gt;
                $ echo -e ${m// /'\n'}&lt;br /&gt;
                        my&lt;br /&gt;
                        stuff&lt;br /&gt;
                        here&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 40:&lt;br /&gt;
&lt;br /&gt;
     Bash Variable Offset and String Operators&lt;br /&gt;
&lt;br /&gt;
        $ r=&amp;quot;this is stuff&amp;quot;&lt;br /&gt;
        $ echo ${r:3}&lt;br /&gt;
        $ echo ${r:5:2}&lt;br /&gt;
&lt;br /&gt;
      Note, ${varname:offset:length}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         ${varname:?message}  If varname exist and isn't null return value, else,&lt;br /&gt;
                              print var and message.&lt;br /&gt;
&lt;br /&gt;
           $ r=&amp;quot;new stuff&amp;quot;&lt;br /&gt;
           $ echo ${r:? &amp;quot;that's r for you&amp;quot;}&lt;br /&gt;
               new stuff&lt;br /&gt;
           $ unset r&lt;br /&gt;
           $ echo ${r:? &amp;quot;that's r for you&amp;quot;}&lt;br /&gt;
               bash: r:  that's r for you&lt;br /&gt;
&lt;br /&gt;
         ${varname:+word}    If varname exist and not null return word. Else, return null.&lt;br /&gt;
&lt;br /&gt;
         ${varname:-word}    If varname exist and not null return value. Else, return word.&lt;br /&gt;
&lt;br /&gt;
      Working with arrays in bash - bash arrays.&lt;br /&gt;
&lt;br /&gt;
           $ unset p&lt;br /&gt;
           $ p=(one two three)&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[@]}&amp;quot;&lt;br /&gt;
           one two three&lt;br /&gt;
&lt;br /&gt;
      or&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[*]}&amp;quot;&lt;br /&gt;
           one two three&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${#p[@]}&amp;quot;&lt;br /&gt;
           3&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[0]}&amp;quot;&lt;br /&gt;
           one&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[1]}&amp;quot;&lt;br /&gt;
           two&lt;br /&gt;
&lt;br /&gt;
            Also see (TIP 95)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 41:&lt;br /&gt;
&lt;br /&gt;
     Loops in Bash&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The command below loops through directories listed in $PATH.&lt;br /&gt;
&lt;br /&gt;
          $ path=$PATH:&lt;br /&gt;
          $ while [ $path ]; do echo &amp;quot; ${path%%:*} &amp;quot;; path=${path#*:}; done&lt;br /&gt;
&lt;br /&gt;
       The command below will also loop through directories in your path.&lt;br /&gt;
&lt;br /&gt;
          $IFS=:&lt;br /&gt;
          $ for dir in $PATH&lt;br /&gt;
          &amp;gt; do&lt;br /&gt;
          &amp;gt; ls -ld $dir&lt;br /&gt;
          &amp;gt; done&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Jun 10 20:16 /usr/local/bin&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Jun 13 23:12 /bin&lt;br /&gt;
              drwxr-xr-x    3 root     root        40960 Jun 12 08:00 /usr/bin&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Feb 14 03:12 /usr/X11R6/bin&lt;br /&gt;
              drwxrwxr-x    2 chirico  chirico      4096 Jun  6 13:06 /home/chirico/bin&lt;br /&gt;
&lt;br /&gt;
     Other ways of doing loops:&lt;br /&gt;
&lt;br /&gt;
        for (( i=1; i &amp;lt;= 20; i++))&lt;br /&gt;
                do&lt;br /&gt;
                        echo -n &amp;quot;$i &amp;quot;&lt;br /&gt;
                done&lt;br /&gt;
&lt;br /&gt;
     Note, to do it all on one line, do the following:&lt;br /&gt;
&lt;br /&gt;
        $ for (( i=1; i &amp;lt;= 20; i++)); do echo -n &amp;quot;$i&amp;quot;; done&lt;br /&gt;
&lt;br /&gt;
     Below, is an example of declaring i an integer so that you do not&lt;br /&gt;
     have to preface with let.&lt;br /&gt;
&lt;br /&gt;
          $ declare -i i&lt;br /&gt;
          $ i=5;&lt;br /&gt;
          $ while (( $i &amp;gt; 1 )); do&lt;br /&gt;
          &amp;gt; i=i-1&lt;br /&gt;
          &amp;gt; echo $i&lt;br /&gt;
          &amp;gt; done&lt;br /&gt;
          4&lt;br /&gt;
          3&lt;br /&gt;
          2&lt;br /&gt;
&lt;br /&gt;
     You can also use &amp;quot;while [ $i -gt 1 ]; do&amp;quot;  in place of &amp;quot;while (( $i &amp;gt; 1 )); do&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     To get a listing of all declared values&lt;br /&gt;
&lt;br /&gt;
          $ declare -i&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Try putting a few words in the file &amp;quot;test&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         $ while read filename; do echo  &amp;quot;- $filename &amp;quot;; done &amp;lt; test |nl -w1&lt;br /&gt;
&lt;br /&gt;
     Or, using an array&lt;br /&gt;
&lt;br /&gt;
                declare -a Array&lt;br /&gt;
                Array[0]=&amp;quot;zero&amp;quot;&lt;br /&gt;
                Array[1]=&amp;quot;one&amp;quot;&lt;br /&gt;
                Array[2]=&amp;quot;two&amp;quot;&lt;br /&gt;
                for i in `seq ${#Array[@]}`&lt;br /&gt;
                do&lt;br /&gt;
                  echo $Array[$i-1]&lt;br /&gt;
                done&lt;br /&gt;
&lt;br /&gt;
         Also see (TIP 95 and TIP 133).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 42:&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;diff&amp;quot; and &amp;quot;patch&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
        You have created a program &amp;quot;prog.c&amp;quot;, saved as this name and also copied&lt;br /&gt;
        to  &amp;quot;prog.c.old&amp;quot;. You post &amp;quot;prog.c&amp;quot; to users.  Next, you make changes&lt;br /&gt;
        to prog.c&lt;br /&gt;
&lt;br /&gt;
          $ diff -c prog.c.old prog.c &amp;gt; prog.patch&lt;br /&gt;
&lt;br /&gt;
        Now, users can get the latest updates by running.&lt;br /&gt;
&lt;br /&gt;
          $ patch &amp;lt; prog.patch&lt;br /&gt;
&lt;br /&gt;
        By the way, you can make backups of your data easily.&lt;br /&gt;
&lt;br /&gt;
          $ cp /etc/fstab{,.bak}&lt;br /&gt;
&lt;br /&gt;
        Now, you do your edits to &amp;quot;/etc/fstab&amp;quot; and if you need&lt;br /&gt;
        to go back to the original, you can find it at&lt;br /&gt;
        &amp;quot;/etc/fstab.bak&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 43:&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;cat&amp;quot; the Contents of Files Listed in a File, in That Order.&lt;br /&gt;
&lt;br /&gt;
       SETUP (Assume you have the following)&lt;br /&gt;
&lt;br /&gt;
              $ cat file_of_files&lt;br /&gt;
                  file1&lt;br /&gt;
                  file2&lt;br /&gt;
&lt;br /&gt;
              $ cat file1&lt;br /&gt;
                  This is the data in file1&lt;br /&gt;
&lt;br /&gt;
              $ cat file 2&lt;br /&gt;
                  This is the data in file2&lt;br /&gt;
&lt;br /&gt;
       So there are 3 files here &amp;quot;file_of_files&amp;quot; which contains the name of&lt;br /&gt;
       other files.  In this case &amp;quot;file1&amp;quot; and &amp;quot;file2&amp;quot;. And the contents of&lt;br /&gt;
       &amp;quot;file1&amp;quot; and &amp;quot;file2&amp;quot; is shown above.&lt;br /&gt;
&lt;br /&gt;
               $ cat file_of_files|xargs cat&lt;br /&gt;
                    This is the data in  file1&lt;br /&gt;
                    This is the data in  file2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 44:&lt;br /&gt;
&lt;br /&gt;
     Columns and Rows -- getting anything you want.&lt;br /&gt;
&lt;br /&gt;
     Assume you have the following file.&lt;br /&gt;
&lt;br /&gt;
        $ cat data&lt;br /&gt;
           1 2 3&lt;br /&gt;
           4 5&lt;br /&gt;
           6 7 8 9 10&lt;br /&gt;
           11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
     How to you get everything in  2 columns?&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l2&lt;br /&gt;
           1 2&lt;br /&gt;
           3 4&lt;br /&gt;
           5 6&lt;br /&gt;
           7 8&lt;br /&gt;
           9 10&lt;br /&gt;
           11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
    Three columns?&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l3&lt;br /&gt;
           1 2 3&lt;br /&gt;
           4 5 6&lt;br /&gt;
           7 8 9&lt;br /&gt;
           10 11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
    What's the row sum of the &amp;quot;three columns?&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
           6&lt;br /&gt;
           15&lt;br /&gt;
           24&lt;br /&gt;
           33&lt;br /&gt;
           27&lt;br /&gt;
&lt;br /&gt;
    or&lt;br /&gt;
&lt;br /&gt;
        $ tr ' ' '\n' &amp;lt; data |xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
&lt;br /&gt;
    NOTE &amp;quot;Steven Heiner's rule&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
             cat one_file | program&lt;br /&gt;
&lt;br /&gt;
           can always be rewritten as&lt;br /&gt;
&lt;br /&gt;
             program &amp;lt; one_file&lt;br /&gt;
&lt;br /&gt;
   Note: thanks to Steven Heiner (http://www.shelldorado.com/) the above can be&lt;br /&gt;
       shortened as follows:&lt;br /&gt;
&lt;br /&gt;
               $ tr ' ' '\n' &amp;lt; data|xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
&lt;br /&gt;
          Need to &amp;quot;tr&amp;quot; from the stdin?&lt;br /&gt;
&lt;br /&gt;
               $ tr &amp;quot;xy&amp;quot; &amp;quot;yx&amp;quot;| ... | ...&lt;br /&gt;
&lt;br /&gt;
       But there is a the &amp;quot;Stephane CHAZELAS&amp;quot; condition here&lt;br /&gt;
&lt;br /&gt;
         &amp;quot;Note that tr, sed, and awk mail fail on files containing '\0'&lt;br /&gt;
          sed and awk have unspecified behaviors if the input&lt;br /&gt;
          doesn't end in a '\n' (or to sum up, cat works for&lt;br /&gt;
          binary and text files, text utilities such as sed or awk&lt;br /&gt;
          work only for text files).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 45:&lt;br /&gt;
&lt;br /&gt;
     Auto Directory Spelling Corrections.&lt;br /&gt;
&lt;br /&gt;
      To turn this on:&lt;br /&gt;
&lt;br /&gt;
           $ shopt -s cdspell&lt;br /&gt;
&lt;br /&gt;
      Now mispell a directory in the cd command.&lt;br /&gt;
&lt;br /&gt;
           $ cd /usk/local&lt;br /&gt;
                   ^-------- still gets you to --&lt;br /&gt;
                                                |&lt;br /&gt;
                                            /usr/local&lt;br /&gt;
&lt;br /&gt;
      What other options can you set? The following will list&lt;br /&gt;
      all the options:&lt;br /&gt;
&lt;br /&gt;
           $ shopt -p&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 46:&lt;br /&gt;
&lt;br /&gt;
     Record Eveything Printed on Your Terminal Screen.&lt;br /&gt;
&lt;br /&gt;
            $ script -a &amp;lt;filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Now start doing stuff and &amp;quot;everything&amp;quot; is appended to &amp;lt;filename&amp;gt;.&lt;br /&gt;
     For example&lt;br /&gt;
&lt;br /&gt;
            $ script installation&lt;br /&gt;
&lt;br /&gt;
            $ (command)&lt;br /&gt;
&lt;br /&gt;
            $ (result)&lt;br /&gt;
&lt;br /&gt;
            $ ...&lt;br /&gt;
&lt;br /&gt;
            $ ...&lt;br /&gt;
&lt;br /&gt;
            $ (command)&lt;br /&gt;
&lt;br /&gt;
            $ (result)&lt;br /&gt;
&lt;br /&gt;
            $ exit&lt;br /&gt;
&lt;br /&gt;
     The whole session log is in the installation file that you can later&lt;br /&gt;
     read and/or cleanup and add to a documentation.&lt;br /&gt;
&lt;br /&gt;
     This command can also be used to redirect the contents to another user,&lt;br /&gt;
     but you must be root to do this.&lt;br /&gt;
&lt;br /&gt;
     Step 1 - find out what pts they are using.&lt;br /&gt;
&lt;br /&gt;
            $ w&lt;br /&gt;
&lt;br /&gt;
     Step 2 - Run script on that pts. After running this command below&lt;br /&gt;
              everything you type will appear on their screen.&lt;br /&gt;
&lt;br /&gt;
            $ script /dev/pts/4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Thanks to Jacques.GARNIER-EXTERIEUR@EU.RHODIA.COM for his contribution&lt;br /&gt;
     to this tip.&lt;br /&gt;
&lt;br /&gt;
     Also reference TIP 208.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 47:&lt;br /&gt;
&lt;br /&gt;
     Monitor all Network Traffic Except Your Current ssh Connection.&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX -s 1500 port not 22&lt;br /&gt;
&lt;br /&gt;
       Or to filter out port 123 as well getting the full length of the packet&lt;br /&gt;
       (-s 0), use the following:&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX -s 0 port not 22  and port not 123&lt;br /&gt;
&lt;br /&gt;
       Or to filter only a certain host say 81.169.158.205&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX  port not 22 and host 81.169.158.205&lt;br /&gt;
&lt;br /&gt;
     Just want ip addresses and a little bit of data, then,&lt;br /&gt;
     use this. The &amp;quot;-c 20&amp;quot; is to stop after 20 packets.&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN  -s 1500 port not 22 -c 20&lt;br /&gt;
&lt;br /&gt;
     If you're looking for sign of DOS attacks, the following show just the SYN&lt;br /&gt;
     packets on all interfaces:&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump 'tcp[13] &amp;amp; 2 == 2'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 48:&lt;br /&gt;
&lt;br /&gt;
     Where are the GNU Reference Manuals?&lt;br /&gt;
&lt;br /&gt;
           http://www.gnu.org/manual/manual.html&lt;br /&gt;
&lt;br /&gt;
     Also worth a look the &amp;quot;Linux Documentation Project&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           http://en.tldp.org/&lt;br /&gt;
&lt;br /&gt;
     and Red Hat manuals&lt;br /&gt;
&lt;br /&gt;
           http://www.redhat.com/docs/manuals/enterprise/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 49:&lt;br /&gt;
&lt;br /&gt;
     Setting or Changing the Library Path.&lt;br /&gt;
&lt;br /&gt;
     The following contains the settings to be added or deleted&lt;br /&gt;
&lt;br /&gt;
           /etc/ld.so.conf&lt;br /&gt;
&lt;br /&gt;
     After this file is edited, you must run the following:&lt;br /&gt;
&lt;br /&gt;
           $ ldconfig&lt;br /&gt;
&lt;br /&gt;
     See &amp;quot;man ldconfig&amp;quot; for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 50:&lt;br /&gt;
&lt;br /&gt;
     Working with Libraries in C&lt;br /&gt;
&lt;br /&gt;
     Assume the following 3 programs:&lt;br /&gt;
&lt;br /&gt;
      $ cat ./src/test.c&lt;br /&gt;
&lt;br /&gt;
         int test(int t)&lt;br /&gt;
         {&lt;br /&gt;
           printf(&amp;quot;%d\n&amp;quot;,t);&lt;br /&gt;
           return t;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      $ cat ./src/prog1.c&lt;br /&gt;
&lt;br /&gt;
         /*&lt;br /&gt;
          program: prog1.c&lt;br /&gt;
          dependences: test.c&lt;br /&gt;
&lt;br /&gt;
          compiling this program:&lt;br /&gt;
          gcc -o prog test.c prog1.c&lt;br /&gt;
&lt;br /&gt;
          Note the libpersonal include&lt;br /&gt;
          should be remove if NOT using the&lt;br /&gt;
          library&lt;br /&gt;
         */&lt;br /&gt;
&lt;br /&gt;
         #include &amp;lt;libpersonal.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         int&lt;br /&gt;
         main(int argc, char **argv)&lt;br /&gt;
         {&lt;br /&gt;
           test(45);&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
      $ cat ./include/libpersonal.h&lt;br /&gt;
&lt;br /&gt;
         extern int test(int);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Prog1.c needs the test function in  test.c&lt;br /&gt;
     To compile, so that both programs work together, do the following:&lt;br /&gt;
&lt;br /&gt;
          $ cd src&lt;br /&gt;
          $ gcc -o prog test.c prog1.c -I../include&lt;br /&gt;
&lt;br /&gt;
     However, if you want to create your own static library, then, run the following:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p ../lib&lt;br /&gt;
          $ gcc -c test.c  -o ../lib/test.o&lt;br /&gt;
          $ cd ../lib&lt;br /&gt;
          $ ar r libpersonal.a test.o&lt;br /&gt;
          $ ranlib libpersonal.a&lt;br /&gt;
&lt;br /&gt;
     or, the ar and ranlib command can be combined as follows:&lt;br /&gt;
&lt;br /&gt;
          $ ar rs libpersonal.a test.o&lt;br /&gt;
&lt;br /&gt;
     To compile the program with the static library:&lt;br /&gt;
&lt;br /&gt;
          $ cd ../src&lt;br /&gt;
          $ gcc -I../include -L../lib -o prog1 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     The -I../include  tells  gcc to look in the ../include directory for&lt;br /&gt;
     libpersonal.h. and -L../lib, tells gcc to look for the&lt;br /&gt;
     &amp;quot;libpersonal.a&amp;quot; library.&lt;br /&gt;
&lt;br /&gt;
           $ cd ..&lt;br /&gt;
           $ tree src lib include&lt;br /&gt;
           src&lt;br /&gt;
           |-- prog&lt;br /&gt;
           |-- prog1&lt;br /&gt;
           |-- prog1.c&lt;br /&gt;
           `-- test.c&lt;br /&gt;
           lib&lt;br /&gt;
           |-- libpersonal.a&lt;br /&gt;
           `-- test.o&lt;br /&gt;
           include&lt;br /&gt;
           `-- libpersonal.h&lt;br /&gt;
&lt;br /&gt;
     This was a STATIC library. Often times you will want to use a SHARED&lt;br /&gt;
     or dynamic library.&lt;br /&gt;
&lt;br /&gt;
     SHARED LIBRARY:&lt;br /&gt;
&lt;br /&gt;
     You must recompile test.c with -fpic option.&lt;br /&gt;
&lt;br /&gt;
          $ cd ../lib&lt;br /&gt;
          $ gcc -c -fpic ../src/test.c -o test.o&lt;br /&gt;
&lt;br /&gt;
     Next create the libpersonal.so file.&lt;br /&gt;
&lt;br /&gt;
          $ gcc -shared -o libpersonal.so test.o&lt;br /&gt;
&lt;br /&gt;
     Now, compile the source prog1.c as follows:&lt;br /&gt;
&lt;br /&gt;
          $ cd ../src&lt;br /&gt;
          $ gcc -Wl,-R../lib -L../lib -I../include -o prog2 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
     This should work fine. But, take a look at prog2 using the ldd command.&lt;br /&gt;
&lt;br /&gt;
          $ ldd prog2&lt;br /&gt;
&lt;br /&gt;
        libpersonal.so =&amp;gt; ../lib/libpersonal.so (0x40017000)&lt;br /&gt;
        libc.so.6 =&amp;gt; /lib/tls/libc.so.6 (0x42000000)&lt;br /&gt;
        /lib/ld-linux.so.2 =&amp;gt; /lib/ld-linux.so.2 (0x40000000)&lt;br /&gt;
&lt;br /&gt;
     If you move the program prog2 to a different location, it will not run.&lt;br /&gt;
     Instead you will get the following error:&lt;br /&gt;
&lt;br /&gt;
           prog2: error while loading shared libraries: libpersonal.so:&lt;br /&gt;
                     cannot open shared object file: No such file or directory&lt;br /&gt;
&lt;br /&gt;
     To fix this, you should specify the direct path to the library. And in my&lt;br /&gt;
     case it is rather long&lt;br /&gt;
&lt;br /&gt;
      $  gcc -Wl,-R/work/souptonuts/documentation/theBook/lib -L../lib -I../include -o prog2 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE: The -R must always follow the -Wl.  (-Wl,-R&amp;lt;directory&amp;gt;) They always go together&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 51:&lt;br /&gt;
&lt;br /&gt;
     Actively Monitor a File and Send Email when Expression Occurs.&lt;br /&gt;
&lt;br /&gt;
     This is a way to monitor &amp;quot;/var/log/messages&amp;quot; or any file for certain changes.&lt;br /&gt;
     The example below actively monitors &amp;quot;stuff&amp;quot; for the work &amp;quot;now&amp;quot; and as soon as&lt;br /&gt;
     &amp;quot;now&amp;quot; is added to the file, the contents of msg are sent to the user&lt;br /&gt;
     mikechirico@hotmail.com&lt;br /&gt;
&lt;br /&gt;
          $ tail -f stuff | \&lt;br /&gt;
              awk ' /now/ { system(&amp;quot;mail -s \&amp;quot;This is working\&amp;quot;  mikechirico@hotmail.com &amp;lt; msg&amp;quot;) }'&lt;br /&gt;
&lt;br /&gt;
     Or, you can run a program, say get headings on slashdot from the program &amp;quot;getslash.php&amp;quot; which&lt;br /&gt;
     runs on  &amp;quot;192.168.1.155&amp;quot; with account &amp;quot;chirico&amp;quot;. Assuming you have ssh keys setup, then, the following&lt;br /&gt;
     will send mail from the output:&lt;br /&gt;
&lt;br /&gt;
          $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;|mail -s &amp;quot;Slash cron Headlines&amp;quot;  mchirico@comcast.net&lt;br /&gt;
&lt;br /&gt;
     See (TIP 80) for scraping the headings on slash dot and how to get a copy of &amp;quot;getslash.php&amp;quot;.  If you still&lt;br /&gt;
     want to use awk:&lt;br /&gt;
&lt;br /&gt;
           $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;| \&lt;br /&gt;
                      awk '{ print $0 | &amp;quot;mail -s \x27 Slash Topics \x27 mchirico@comcast.net &amp;quot;}'&lt;br /&gt;
&lt;br /&gt;
     Note the &amp;quot;\x27&amp;quot; is a quote.  Maybe you only want articles dealing with &amp;quot;Linux&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
           $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;| \&lt;br /&gt;
                      awk '/Linux/{ print $0 | &amp;quot;mail -s \x27 Slash Topics \x27 mchirico@comcast.net &amp;quot;}'&lt;br /&gt;
&lt;br /&gt;
     For $60, you can get a numeric display from &amp;quot;delcom engineering&amp;quot; that you can send messages and&lt;br /&gt;
     data to.  I get weather information off the internet and send it to this device.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/projects/delcom/&lt;br /&gt;
&lt;br /&gt;
     (Reference TIP 151 for ssh tips)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 52:&lt;br /&gt;
&lt;br /&gt;
     Need to Keep Secrets? Encrypt it.&lt;br /&gt;
&lt;br /&gt;
      To Encrypt:&lt;br /&gt;
&lt;br /&gt;
            $ openssl des3 -salt -in file.txt -out file.des3&lt;br /&gt;
&lt;br /&gt;
      The above will prompt for a password, or you can put it in&lt;br /&gt;
      with a -k option, assuming you're on a trusted server.&lt;br /&gt;
&lt;br /&gt;
      To Decrypt&lt;br /&gt;
&lt;br /&gt;
            $  openssl des3 -d -salt -in file.des3 -out file.txt -k mypassword&lt;br /&gt;
&lt;br /&gt;
      Need to encrypt what you type? Enter the following, then start typing&lt;br /&gt;
      and  ^D to end.&lt;br /&gt;
&lt;br /&gt;
            $ openssl des3 -salt -out stuff.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 53:&lt;br /&gt;
&lt;br /&gt;
     Check that a File has Not Been Tampered With: Use Cryptographic Hashing Function.&lt;br /&gt;
&lt;br /&gt;
     The md5sum is popular but dated&lt;br /&gt;
&lt;br /&gt;
              $ md5sum file&lt;br /&gt;
&lt;br /&gt;
     Instead, use one of the following;&lt;br /&gt;
&lt;br /&gt;
              $ openssl dgst -sha1 -c file&lt;br /&gt;
&lt;br /&gt;
              $ openssl dgst -ripemd160 -c  file&lt;br /&gt;
&lt;br /&gt;
     All calls give a fixed length string or &amp;quot;message digest&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 54:&lt;br /&gt;
&lt;br /&gt;
     Need to View Information About a Secure Web Server? A SSL/TLS test.&lt;br /&gt;
&lt;br /&gt;
           $ openssl s_client -connect www.sourceforge.net:443&lt;br /&gt;
&lt;br /&gt;
     Above will give a long listing of certificates.&lt;br /&gt;
&lt;br /&gt;
     Note, it is also possible to get certificate information about a mail server&lt;br /&gt;
&lt;br /&gt;
           $ openssl s_client -connect mail.comcast.net:995 -showcerts&lt;br /&gt;
&lt;br /&gt;
     When you do the above command you get two certificates. If you copy&lt;br /&gt;
     past both certificates by taking the following contents include the&lt;br /&gt;
     begin and end show below:&lt;br /&gt;
&lt;br /&gt;
                 -----BEGIN CERTIFICATE-----&lt;br /&gt;
                 ....&lt;br /&gt;
                 -----END CERTIFICATE-----&lt;br /&gt;
&lt;br /&gt;
     Then create files &amp;quot;comcast0.pem&amp;quot; and &amp;quot;comcast1.pem&amp;quot; out of these certificaties and&lt;br /&gt;
     put them in a directory &amp;quot;/home/donkey/.certs&amp;quot;, then, with the openssl src package, in&lt;br /&gt;
     the &amp;quot;./tools/c_rehash&amp;quot; run&lt;br /&gt;
&lt;br /&gt;
            $ c_rehash .certs&lt;br /&gt;
            Doing .certs&lt;br /&gt;
            comcast0.pem =&amp;gt; 72f90dc0.0&lt;br /&gt;
            comcast1.pem =&amp;gt; f73e89fd.0&lt;br /&gt;
&lt;br /&gt;
     Now it's possible to have fetchmail work with these certs.&lt;br /&gt;
&lt;br /&gt;
       #&lt;br /&gt;
       #&lt;br /&gt;
       # Sample .fetchmailrc file for Comcast&lt;br /&gt;
       #&lt;br /&gt;
       # Check mail every 90 seconds&lt;br /&gt;
       set daemon 90&lt;br /&gt;
       set syslog&lt;br /&gt;
       set postmaster donkey&lt;br /&gt;
       #set bouncemail&lt;br /&gt;
       #&lt;br /&gt;
       # Comcast email is zdonkey but computer account is  just donkey&lt;br /&gt;
       #&lt;br /&gt;
       poll mail.comcast.net with proto POP3 and options no dns&lt;br /&gt;
              user 'zdonkey' with pass &amp;quot;somethin35&amp;quot;  is 'donkey' here options ssl sslcertck sslcertpath '/home/donkey/.certs'&lt;br /&gt;
              smtphost comcast.net&lt;br /&gt;
       # currently not used&lt;br /&gt;
       mda '/usr/bin/procmail -d %T'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     REFERENCE: http://www.openssl.org/&lt;br /&gt;
                http://www.catb.org/~esr/fetchmail/fetchmail-6.2.5.tar.gz&lt;br /&gt;
                http://www.madboa.com/geek/openssl/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 55:&lt;br /&gt;
&lt;br /&gt;
     cp --parents. What does this option do?&lt;br /&gt;
&lt;br /&gt;
     Assume you have the following directory structure&lt;br /&gt;
&lt;br /&gt;
            .&lt;br /&gt;
            |-- a&lt;br /&gt;
            |   `-- b&lt;br /&gt;
            |       `-- c&lt;br /&gt;
            |           `-- d&lt;br /&gt;
            |               |-- file1&lt;br /&gt;
            |               `-- file2&lt;br /&gt;
            `-- newdir&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Issue the following command:&lt;br /&gt;
&lt;br /&gt;
         $ cp --parents ./a/b/c/d/* ./newdir/&lt;br /&gt;
&lt;br /&gt;
     Now you have the following:&lt;br /&gt;
&lt;br /&gt;
            .&lt;br /&gt;
            |-- a&lt;br /&gt;
            |   `-- b&lt;br /&gt;
            |       `-- c&lt;br /&gt;
            |           `-- d&lt;br /&gt;
            |               |-- file1&lt;br /&gt;
            |               `-- file2&lt;br /&gt;
            `-- newdir&lt;br /&gt;
                `-- a&lt;br /&gt;
                    `-- b&lt;br /&gt;
                        `-- c&lt;br /&gt;
                            `-- d&lt;br /&gt;
                                |-- file1&lt;br /&gt;
                                `-- file2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 56:&lt;br /&gt;
&lt;br /&gt;
     Quickly Locating files.&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;locate&amp;quot; command quickly searches the indexed database for files.  It just&lt;br /&gt;
     gives the name of the files; but, if you need more information use it as follows&lt;br /&gt;
&lt;br /&gt;
         $ locate document|xargs ls -l&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;locate&amp;quot; database may only get updated every 24 hours.  For more recent finds,&lt;br /&gt;
     use the &amp;quot;find&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 57:&lt;br /&gt;
&lt;br /&gt;
     Using the &amp;quot;find&amp;quot; Command.&lt;br /&gt;
&lt;br /&gt;
     List only directories, max 2 nodes down that have &amp;quot;net&amp;quot; in the name&lt;br /&gt;
&lt;br /&gt;
       $ find /proc -type d -maxdepth 2 -iname '*net*'&lt;br /&gt;
&lt;br /&gt;
     Find all *.c and *.h files starting from the current &amp;quot;.&amp;quot; position.&lt;br /&gt;
&lt;br /&gt;
       $ find . \( -iname '*.c'  -o -iname '*.h' \) -print&lt;br /&gt;
&lt;br /&gt;
     Find all, but skip what's in &amp;quot;/CVS&amp;quot; and &amp;quot;/junk&amp;quot;. Start from &amp;quot;/work&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ find /work \( -iregex '.*/CVS'  -o -iregex '.*/junk' \)  -prune -o -print&lt;br /&gt;
&lt;br /&gt;
     Note -regex and -iregex work on the directory as well, which means&lt;br /&gt;
     you must consider the &amp;quot;./&amp;quot; that comes before all listings.&lt;br /&gt;
&lt;br /&gt;
     Here is another example. Find all files except what is under the CVS, including&lt;br /&gt;
     CVS listings. Also exclude &amp;quot;#&amp;quot; and &amp;quot;~&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       $ find . -regex '.*' ! \( -regex '.*CVS.*'  -o -regex '.*[#|~].*' \)&lt;br /&gt;
&lt;br /&gt;
     Find a *.c file, then run grep on it looking for &amp;quot;stdio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       $ find . -iname '*.c' -exec grep -H 'stdio.h' {} \;&lt;br /&gt;
         sample output --&amp;gt;  ./prog1.c:#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
                            ./test.c:#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Looking for the disk-hog on the whole system?&lt;br /&gt;
&lt;br /&gt;
       $ find /  -size +10000k 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
     Looking for files changed in the last 24 hours? Make sure you add the&lt;br /&gt;
     minus sign &amp;quot;-1&amp;quot;, otherwise, you will only find files changed exactly&lt;br /&gt;
     24 hours from now. With the &amp;quot;-1&amp;quot; you get files changed from now to 24&lt;br /&gt;
     hours.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ find  . -ctime -1  -printf &amp;quot;%a %f\n&amp;quot;&lt;br /&gt;
       Wed Oct  6 12:51:56 2004 .&lt;br /&gt;
       Wed Oct  6 12:35:16 2004 How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
     Or if you just want files.&lt;br /&gt;
&lt;br /&gt;
       $ find . -type f -ctime -1  -printf &amp;quot;%a %f\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Details on file status change in the last 48 hours, current directory. Also note &amp;quot;-atime -2&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
       $ find . -ctime -2 -type f -exec ls -l {} \;&lt;br /&gt;
&lt;br /&gt;
             NOTE: if you don't use -type f, you make get &amp;quot;.&amp;quot; returned, which&lt;br /&gt;
             when run through ls &amp;quot;ls .&amp;quot; may list more than what you want.&lt;br /&gt;
&lt;br /&gt;
             Also you may only want the current directory&lt;br /&gt;
&lt;br /&gt;
       $ find . -ctime -2 -type f -maxdepth 1 -exec ls -l {} \;&lt;br /&gt;
&lt;br /&gt;
     To find files modified within the last 5 to 10 minutes&lt;br /&gt;
&lt;br /&gt;
       $ find . -mmin +5 -mmin -10 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     For more example &amp;quot;find&amp;quot; commands, reference the following looking&lt;br /&gt;
     for the latest version of &amp;quot;bashscripts.x.x.x.tar.gz&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79320&amp;amp;package_id=80711&lt;br /&gt;
&lt;br /&gt;
     See &amp;quot;TIP 71&amp;quot; for examples of find using the inode feature. &amp;quot; $ find . -inum &amp;lt;inode&amp;gt; -exec rm -- '{}' \; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     If you don't want error messages, or need to redirect error messages &amp;quot;&amp;gt; /dev/null 2&amp;gt;&amp;amp;1&amp;quot;, or see&lt;br /&gt;
     &amp;quot;TIP 81&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 58:&lt;br /&gt;
&lt;br /&gt;
     Using the &amp;quot;rm&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
     How do you remove a file that has the name &amp;quot;-&amp;quot;.  For instance, if you run the command&lt;br /&gt;
     &amp;quot;$ cat &amp;gt; - &amp;quot; and type some text followed by ^d, how does the &amp;quot;-&amp;quot; file get deleted?&lt;br /&gt;
&lt;br /&gt;
        $ rm -- -&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;--&amp;quot; nullifies any rm options.&lt;br /&gt;
&lt;br /&gt;
     How do you delete the directory &amp;quot;one&amp;quot;, all it's sub-directories, and any data?&lt;br /&gt;
&lt;br /&gt;
        $ rm -rf ./one&lt;br /&gt;
&lt;br /&gt;
     Note, to selectively delete stuff on a directory, use the find command &amp;quot;TIP 57&amp;quot;.&lt;br /&gt;
     To delete by inode, see &amp;quot;TIP 71&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 59:&lt;br /&gt;
&lt;br /&gt;
     Giving ownership.&lt;br /&gt;
&lt;br /&gt;
     How do you give the user &amp;quot;donkey&amp;quot; ownership to all directories and files under&lt;br /&gt;
     &amp;quot;./fordonkey&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          $ chown -R donkey ./fordonkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 60:&lt;br /&gt;
&lt;br /&gt;
     Only Permit root login -- give others a message when they try to login.&lt;br /&gt;
&lt;br /&gt;
     Create the file &amp;quot;/etc/nologin&amp;quot; with &amp;quot;nologin&amp;quot; containing the contents&lt;br /&gt;
     of the message.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 61:&lt;br /&gt;
&lt;br /&gt;
     Limits: file size, open files, pipe size, stack size, max memory size&lt;br /&gt;
             cpu time, plus others.&lt;br /&gt;
&lt;br /&gt;
     To get a listing of current limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -a&lt;br /&gt;
             core file size        (blocks, -c) 0&lt;br /&gt;
             data seg size         (kbytes, -d) unlimited&lt;br /&gt;
             file size             (blocks, -f) unlimited&lt;br /&gt;
             max locked memory     (kbytes, -l) unlimited&lt;br /&gt;
             max memory size       (kbytes, -m) unlimited&lt;br /&gt;
             open files                    (-n) 1024&lt;br /&gt;
             pipe size          (512 bytes, -p) 8&lt;br /&gt;
             stack size            (kbytes, -s) 8192&lt;br /&gt;
             cpu time             (seconds, -t) unlimited&lt;br /&gt;
             max user processes            (-u) 8179&lt;br /&gt;
             virtual memory        (kbytes, -v) unlimited&lt;br /&gt;
&lt;br /&gt;
     Note as a user you can decrease your limits in the current&lt;br /&gt;
     shell session; but, you cannot increase.  This can be ideal&lt;br /&gt;
     for testing programs.  But, first you may want to create&lt;br /&gt;
     another shell &amp;quot;sh&amp;quot; so that you can &amp;quot;go back to where started&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -f 10&lt;br /&gt;
&lt;br /&gt;
     Now try&lt;br /&gt;
&lt;br /&gt;
          $ yes &amp;gt;&amp;gt; out&lt;br /&gt;
             File size limit exceeded&lt;br /&gt;
&lt;br /&gt;
     To set limits on users, make changes to &amp;quot;/etc/security/limits.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           bozo   - maxlogins 1&lt;br /&gt;
&lt;br /&gt;
     Will keep bozo from loging in more than once.&lt;br /&gt;
&lt;br /&gt;
     To list hard limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -Ha&lt;br /&gt;
&lt;br /&gt;
     To list soft limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -Sa&lt;br /&gt;
&lt;br /&gt;
     To restrict user access by time, day make changes to&lt;br /&gt;
             &amp;quot;/etc/security/time.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Also take a look at &amp;quot;/etc/profile&amp;quot; to see what other changes&lt;br /&gt;
     can be made, plus take a look under &amp;quot;/etc/security/*.conf&amp;quot; for&lt;br /&gt;
     other configuration files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 62:&lt;br /&gt;
&lt;br /&gt;
     Stupid &amp;quot;cat&amp;quot; Tricks.&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 43).&lt;br /&gt;
&lt;br /&gt;
     If you have multiple blank lines, squeeze these lines down to one,&lt;br /&gt;
     then, try the following:&lt;br /&gt;
&lt;br /&gt;
          $ cat -s &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to number the lines?&lt;br /&gt;
&lt;br /&gt;
          $ cat -n &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to show tabs?&lt;br /&gt;
&lt;br /&gt;
          $ cat -t &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Need to mark end of lines by &amp;quot;$&amp;quot;? The following was suggested by  (Amos Shapira)&lt;br /&gt;
&lt;br /&gt;
          $ cat -e &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to see all the ctl characters?&lt;br /&gt;
&lt;br /&gt;
          /* ctlgen.c&lt;br /&gt;
            Program to generate ctl characters.&lt;br /&gt;
&lt;br /&gt;
            Compile:&lt;br /&gt;
&lt;br /&gt;
               gcc -o ctlgen ctlgen.c&lt;br /&gt;
&lt;br /&gt;
            Run:&lt;br /&gt;
&lt;br /&gt;
               ./ctlgen &amp;gt; mout&lt;br /&gt;
&lt;br /&gt;
            Now see the characters:&lt;br /&gt;
&lt;br /&gt;
               cat -v mout&lt;br /&gt;
&lt;br /&gt;
            Here's a sample output:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               $ cat -v mout|tail&lt;br /&gt;
                   test M-v&lt;br /&gt;
                   test M-w&lt;br /&gt;
                   test M-x&lt;br /&gt;
                   test M-y&lt;br /&gt;
                   test M-z&lt;br /&gt;
                   test M-{&lt;br /&gt;
                   test M-|&lt;br /&gt;
                   test M-}&lt;br /&gt;
                   test M-~&lt;br /&gt;
                   test M-^?&lt;br /&gt;
&lt;br /&gt;
          */&lt;br /&gt;
          #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
          #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
          int main()&lt;br /&gt;
          {&lt;br /&gt;
            int i;&lt;br /&gt;
&lt;br /&gt;
            for(i=0; i &amp;lt; 256; ++i)&lt;br /&gt;
              printf(&amp;quot;test %c \n&amp;quot;,i);&lt;br /&gt;
&lt;br /&gt;
            return 0;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 63:&lt;br /&gt;
&lt;br /&gt;
     Guard against SYN attacks and &amp;quot;ping&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     As root do the following:&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/tcp_syncookies&lt;br /&gt;
&lt;br /&gt;
     Want to disable &amp;quot;ping&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_all&lt;br /&gt;
&lt;br /&gt;
     Disable broadcast/multicast &amp;quot;ping&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts&lt;br /&gt;
&lt;br /&gt;
     And to enable again:&lt;br /&gt;
&lt;br /&gt;
          echo 0 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_all&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 64:&lt;br /&gt;
&lt;br /&gt;
     Make changes to .bash_profile and need to update the current session?&lt;br /&gt;
&lt;br /&gt;
       $ source .bash_profile&lt;br /&gt;
&lt;br /&gt;
     With the above command, the user does not have to logout.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 65:&lt;br /&gt;
&lt;br /&gt;
     What are the Special Shell Variables?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        $#   The number of arguments.&lt;br /&gt;
        $@   All arguments, as separate words.&lt;br /&gt;
        $*   All arguments, as one word.&lt;br /&gt;
        $$   ID of the current process.&lt;br /&gt;
        $?   Exit status of the last command.&lt;br /&gt;
        $0,$1,..$9,${10},${11}...${N}    Positional parameters. After &amp;quot;9&amp;quot; you must use the ${k} syntax.&lt;br /&gt;
&lt;br /&gt;
     Note that 0 is true. For example if you execute the following, which is true you get zero.&lt;br /&gt;
&lt;br /&gt;
         $  [[ -f /etc/passwd ]]&lt;br /&gt;
         $  echo $?&lt;br /&gt;
         0&lt;br /&gt;
     And the following is false, which returns a 1.&lt;br /&gt;
&lt;br /&gt;
         $  [[ -f /etc/passwdjabberwisnohere ]]&lt;br /&gt;
         $  echo $?&lt;br /&gt;
         1&lt;br /&gt;
&lt;br /&gt;
     So true=0 and false=1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Sample program &amp;quot;mdo&amp;quot;  to show the difference between &amp;quot;$@&amp;quot; and &amp;quot;$*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        function myarg&lt;br /&gt;
        {&lt;br /&gt;
            echo &amp;quot;$# in myarg function&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
        echo -e &amp;quot;$# parameters on the cmd line\n&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;calling: myarg \&amp;quot;\$@\&amp;quot; and myarg \&amp;quot;\$*\&amp;quot;\n&amp;quot;&lt;br /&gt;
        myarg &amp;quot;$@&amp;quot;&lt;br /&gt;
        myarg &amp;quot;$*&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;\ncalling: myarg \$@ and myarg \$* without quotes\n&amp;quot;&lt;br /&gt;
        myarg $@&lt;br /&gt;
        myarg $*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The result of running &amp;quot;./mdo one two&amp;quot;. Note that when quoted, myarg &amp;quot;$*&amp;quot;,&lt;br /&gt;
      returns 1 ... all parameters are smushed together as one word.&lt;br /&gt;
&lt;br /&gt;
            [chirico@third-fl-71 theBook]$ ./mdo one two&lt;br /&gt;
            2 parameters on the cmd line&lt;br /&gt;
&lt;br /&gt;
            calling: myarg &amp;quot;$@&amp;quot; and myarg &amp;quot;$*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
            1 in myarg function&lt;br /&gt;
&lt;br /&gt;
            calling: myarg $@ and myarg $* without quotes&lt;br /&gt;
&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
&lt;br /&gt;
      Example program &amp;quot;mdo2&amp;quot; shows how the input separator can be changed.&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        IFS=|&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=,&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=\;&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=$1&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            [chirico@third-fl-71 theBook]$ ./mdo2 one two three four five&lt;br /&gt;
            one two three four five&lt;br /&gt;
&lt;br /&gt;
            one,two,three,four,five&lt;br /&gt;
&lt;br /&gt;
            one;two;three;four;five&lt;br /&gt;
&lt;br /&gt;
            oneotwoothreeofourofive&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 66:&lt;br /&gt;
&lt;br /&gt;
     Replace all &amp;quot;x&amp;quot; with &amp;quot;y&amp;quot; and all &amp;quot;y&amp;quot; with &amp;quot;x&amp;quot; in file data.&lt;br /&gt;
&lt;br /&gt;
        $ cata data&lt;br /&gt;
          x y&lt;br /&gt;
          y x&lt;br /&gt;
&lt;br /&gt;
        $ tr &amp;quot;xy&amp;quot;  &amp;quot;yx&amp;quot; &amp;lt; data&lt;br /&gt;
          y x&lt;br /&gt;
          x y&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 67:&lt;br /&gt;
&lt;br /&gt;
     On a Linux 2.6.x Kernel, how do you directly measure disk activity,&lt;br /&gt;
     and where is this information documented?&lt;br /&gt;
&lt;br /&gt;
          o The information is documented in the kernel source&lt;br /&gt;
               ./Documentation/iostats.txt&lt;br /&gt;
&lt;br /&gt;
          o The new way of getting this info in 2.6.x is&lt;br /&gt;
              $ cat /sys/block/hda/stat&lt;br /&gt;
            151121 5694 1932358 796675 37867 76770 916994 8353762 0 800672 9150437&lt;br /&gt;
&lt;br /&gt;
             Field  1 -- # of reads issued&lt;br /&gt;
                 This is the total number of reads completed successfully.&lt;br /&gt;
             Field  2 -- # of reads merged, field 6 -- # of writes merged&lt;br /&gt;
                 Reads and writes which are adjacent to each other may be merged for&lt;br /&gt;
                 efficiency.  Thus two 4K reads may become one 8K read before it is&lt;br /&gt;
                 ultimately handed to the disk, and so it will be counted (and queued)&lt;br /&gt;
                 as only one I/O.  This field lets you know how often this was done.&lt;br /&gt;
             Field  3 -- # of sectors read&lt;br /&gt;
                 This is the total number of sectors read successfully.&lt;br /&gt;
             Field  4 -- # of milliseconds spent reading&lt;br /&gt;
                 This is the total number of milliseconds spent by all reads (as&lt;br /&gt;
                 measured from __make_request() to end_that_request_last()).&lt;br /&gt;
             Field  5 -- # of writes completed&lt;br /&gt;
                 This is the total number of writes completed successfully.&lt;br /&gt;
             Field  7 -- # of sectors written&lt;br /&gt;
                 This is the total number of sectors written successfully.&lt;br /&gt;
             Field  8 -- # of milliseconds spent writing&lt;br /&gt;
                 This is the total number of milliseconds spent by all writes (as&lt;br /&gt;
                 measured from __make_request() to end_that_request_last()).&lt;br /&gt;
             Field  9 -- # of I/Os currently in progress&lt;br /&gt;
                 The only field that should go to zero. Incremented as requests are&lt;br /&gt;
                 given to appropriate request_queue_t and decremented as they finish.&lt;br /&gt;
             Field 10 -- # of milliseconds spent doing I/Os&lt;br /&gt;
                 This field is increases so long as field 9 is nonzero.&lt;br /&gt;
             Field 11 -- weighted # of milliseconds spent doing I/Os&lt;br /&gt;
                 This field is incremented at each I/O start, I/O completion, I/O&lt;br /&gt;
                 merge, or read of these stats by the number of I/Os in progress&lt;br /&gt;
                 (field 9) times the number of milliseconds spent doing I/O since the&lt;br /&gt;
                 last update of this field.  This can provide an easy measure of both&lt;br /&gt;
                 I/O completion time and the backlog that may be accumulating.&lt;br /&gt;
&lt;br /&gt;
       Note, this is device specific.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 68:&lt;br /&gt;
&lt;br /&gt;
     Passing Outbound Mail, plus Masquerading User and Hostname.&lt;br /&gt;
&lt;br /&gt;
     Here's a specific example:&lt;br /&gt;
&lt;br /&gt;
         How does one send and receive Comcast email from a home Linux box,&lt;br /&gt;
         which uses Comcast as the ISP, if the local account on the Linux&lt;br /&gt;
         box is different from the Comcast email.  For instance, the&lt;br /&gt;
         account on the Linux box is &amp;quot;chirico@third-fl-71&amp;quot; and the Comcast&lt;br /&gt;
         email account is &amp;quot;mchirico@comcast.net&amp;quot;.  Note both the hostname and&lt;br /&gt;
         username are different.&lt;br /&gt;
&lt;br /&gt;
         So, the user &amp;quot;chirico&amp;quot; using &amp;quot;mutt&amp;quot;, &amp;quot;elm&amp;quot; or any email program would&lt;br /&gt;
         like to send out email to say &amp;quot;donkey@comcast.net&amp;quot;; yet, donkey would&lt;br /&gt;
         see the email from &amp;quot;mchirico@comcast.net&amp;quot; and not &amp;quot;chirico@third-fl-71&amp;quot;&lt;br /&gt;
         but chirico@third-fl-71 would get the replies.&lt;br /&gt;
&lt;br /&gt;
         For a full description of how to solve this problem, including related&lt;br /&gt;
         &amp;quot;sendmail.mc&amp;quot;, &amp;quot;site.config.m4&amp;quot;, &amp;quot;genericstable&amp;quot;, &amp;quot;genericsdomain&amp;quot;,&lt;br /&gt;
         &amp;quot;.procmailrc&amp;quot;, and &amp;quot;.forward&amp;quot; files,  reference the following:&lt;br /&gt;
&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/README_COMCAST_EMAIL.txt?download&lt;br /&gt;
&lt;br /&gt;
         Included in the above link are instructions for building sendmail with&lt;br /&gt;
         &amp;quot;SASL&amp;quot; and &amp;quot;STARTTLS&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 69:&lt;br /&gt;
&lt;br /&gt;
     How do you remove just the last 2 lines from a file and save the result?&lt;br /&gt;
&lt;br /&gt;
         $ sed  '$d' file | sed '$d' &amp;gt; savefile&lt;br /&gt;
&lt;br /&gt;
     Or, as Amos Shapira pointed out, it's much easier with the head command.&lt;br /&gt;
&lt;br /&gt;
         $ head -2 file&lt;br /&gt;
&lt;br /&gt;
      And, of course, removing just the last line&lt;br /&gt;
&lt;br /&gt;
         $ sed '$d' file &amp;gt; savefile&lt;br /&gt;
&lt;br /&gt;
         (See REFERENCES (13))&lt;br /&gt;
&lt;br /&gt;
     How do you remove extra spaces at the end of a line?&lt;br /&gt;
&lt;br /&gt;
         $ sed 's/[ ]*$//g'&lt;br /&gt;
&lt;br /&gt;
     How do you remove blank lines, or lines with just spaces and tabs,&lt;br /&gt;
     saving the origional file as file.backup?&lt;br /&gt;
&lt;br /&gt;
         $ perl -pi.backup -e &amp;quot;s/^(\s)*\n//&amp;quot;  file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 70:&lt;br /&gt;
&lt;br /&gt;
     Generating Random Numbers.&lt;br /&gt;
&lt;br /&gt;
         $ od -vAn -N4 -tu4 &amp;lt; /dev/urandom&lt;br /&gt;
             3905158199&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 71:&lt;br /&gt;
&lt;br /&gt;
     Deleting a File by it's Inode Value.&lt;br /&gt;
&lt;br /&gt;
       See (PROGRAMMING TIP 5) for creating the file, or&lt;br /&gt;
&lt;br /&gt;
       $ cat &amp;gt; '\n\n\n\n\n\n\n'&lt;br /&gt;
         type some text&lt;br /&gt;
         ^D&lt;br /&gt;
&lt;br /&gt;
     To list the inode and display the characters.&lt;br /&gt;
&lt;br /&gt;
       $ ls -libt *&lt;br /&gt;
&lt;br /&gt;
     To remove by inode. Note the &amp;quot;--&amp;quot; option.  This&lt;br /&gt;
     will keep any special characters in the file from being&lt;br /&gt;
     interpreted at &amp;quot;rm&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
       $ find . -inum &amp;lt;inode&amp;gt; -exec rm -- '{}' \;&lt;br /&gt;
&lt;br /&gt;
     Or to check contents&lt;br /&gt;
&lt;br /&gt;
       $ find . -inum &amp;lt;inode&amp;gt; -exec cat '{}' \;&lt;br /&gt;
&lt;br /&gt;
     Reference:&lt;br /&gt;
         http://www.faqs.org/ftp/usenet/news.answers/unix-faq/faq/part2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 72:&lt;br /&gt;
&lt;br /&gt;
     Sending Attachments Using Mutt -- On the Command Line.&lt;br /&gt;
&lt;br /&gt;
        $ mutt -s &amp;quot;See Attachment&amp;quot; -a file.doc user@domain.net &amp;lt; message.txt&lt;br /&gt;
&lt;br /&gt;
          or just the message:&lt;br /&gt;
&lt;br /&gt;
        $ echo | mutt -a sample.tar.gz user@domain.net&lt;br /&gt;
&lt;br /&gt;
      Reference:&lt;br /&gt;
          http://www.shelldorado.com/articles/mailattachments.html&lt;br /&gt;
&lt;br /&gt;
        Also see (TIP 51).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 73:&lt;br /&gt;
&lt;br /&gt;
     Want to find out what functions a program calls?&lt;br /&gt;
&lt;br /&gt;
         $ strace &amp;lt;program&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Try this with &amp;quot;topen.c&amp;quot; (see PROGRAMMING TIP 5)&lt;br /&gt;
&lt;br /&gt;
         $ strace  ./topen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 74:&lt;br /&gt;
&lt;br /&gt;
     RPM Usage Summary.&lt;br /&gt;
&lt;br /&gt;
     Install. Full filename is needed.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -ivh Fedora/RPMS/postgresql-libs-7.4.2-1.i386.rpm&lt;br /&gt;
&lt;br /&gt;
     To view list of files installed with a particular package.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -ql postgresql-libs&lt;br /&gt;
                /usr/lib/libecpg.so.4&lt;br /&gt;
                /usr/lib/libecpg.so.4.1&lt;br /&gt;
                /usr/lib/libecpg_compat.so.1&lt;br /&gt;
                /usr/lib/libecpg_compat.so.1.1&lt;br /&gt;
                /usr/lib/libpgtypes.so.1&lt;br /&gt;
                ...&lt;br /&gt;
&lt;br /&gt;
     Or, to get the file listing from a package that is not installed use the&lt;br /&gt;
     &amp;quot;-p&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -pql /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/CHANGES&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/LICENSE&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/README&lt;br /&gt;
               /usr/share/man/man3/pcap.3.gz&lt;br /&gt;
&lt;br /&gt;
     For dependencies listing, use the &amp;quot;R&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qpR /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /sbin/ldconfig&lt;br /&gt;
               /sbin/ldconfig&lt;br /&gt;
               kernel &amp;gt;= 2.2.0&lt;br /&gt;
               libc.so.6&lt;br /&gt;
               libc.so.6(GLIBC_2.0)&lt;br /&gt;
               libc.so.6(GLIBC_2.1)&lt;br /&gt;
               libc.so.6(GLIBC_2.1.3)&lt;br /&gt;
               libc.so.6(GLIBC_2.3)&lt;br /&gt;
               openssl&lt;br /&gt;
               rpmlib(CompressedFileNames) &amp;lt;= 3.0.4-1&lt;br /&gt;
               rpmlib(PayloadFilesHavePrefix) &amp;lt;= 4.0-1&lt;br /&gt;
&lt;br /&gt;
     To check the integrity, use the &amp;quot;-K&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -K /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm: (sha1) dsa sha1 md5 gpg OK&lt;br /&gt;
&lt;br /&gt;
     To list all packages installed.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qa&lt;br /&gt;
&lt;br /&gt;
     To find out which file a package belongs to.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qf /usr/lib/libecpg.so.4.1&lt;br /&gt;
&lt;br /&gt;
     To uninstall a package&lt;br /&gt;
&lt;br /&gt;
         $ rpm -e&lt;br /&gt;
&lt;br /&gt;
     For building rpm packages reference the following:&lt;br /&gt;
       http://www-106.ibm.com/developerworks/library/l-rpm1/&lt;br /&gt;
&lt;br /&gt;
     To verify md5 sum so that you know it downloaded ok&lt;br /&gt;
&lt;br /&gt;
         $ rpm -K  *.rpm&lt;br /&gt;
&lt;br /&gt;
     The following is a good reference:&lt;br /&gt;
        http://www.rpm.org/max-rpm/s1-rpm-install-additional-options.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 75:&lt;br /&gt;
&lt;br /&gt;
     Listing Output from a Bash Script.&lt;br /&gt;
&lt;br /&gt;
     Add &amp;quot;set -x&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          #!/bin/bash&lt;br /&gt;
          set -x&lt;br /&gt;
          ls&lt;br /&gt;
          date&lt;br /&gt;
&lt;br /&gt;
     Will list the files and output as follows:&lt;br /&gt;
&lt;br /&gt;
           + ls&lt;br /&gt;
           ChangeLog  CVS  data  test&lt;br /&gt;
           + date&lt;br /&gt;
           Thu Jul  1 20:41:04 EDT 2004&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 76:&lt;br /&gt;
&lt;br /&gt;
     Using wget.&lt;br /&gt;
&lt;br /&gt;
     Grap a webpage and pipe it to less. For example suppose you wanted to pipe the&lt;br /&gt;
     contents of all these tips, directly from the web.&lt;br /&gt;
&lt;br /&gt;
      $ wget -O - http://sourceforge.net/direct-dl/mchirico/souptonuts/How_to_Linux_and_Open_Source.txt|less&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 77:&lt;br /&gt;
&lt;br /&gt;
     Finding IP address and MAC address.&lt;br /&gt;
&lt;br /&gt;
       $ /sbin/ifconfig&lt;br /&gt;
&lt;br /&gt;
     Note the following output &amp;quot;eth0&amp;quot; and &amp;quot;eth0:1&amp;quot; which means&lt;br /&gt;
     two IP addresses are tied to 1 NIC (Network Interface Card).&lt;br /&gt;
&lt;br /&gt;
             eth0      Link encap:Ethernet  HWaddr 00:50:DA:60:5B:AD&lt;br /&gt;
                       inet addr:192.168.1.155  Bcast:192.168.99.255  Mask:255.255.252.0&lt;br /&gt;
                       UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
                       RX packets:982757 errors:116 dropped:0 overruns:0 frame:116&lt;br /&gt;
                       TX packets:439297 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:1000&lt;br /&gt;
                       RX bytes:693529078 (661.4 Mb)  TX bytes:78400296 (74.7 Mb)&lt;br /&gt;
                       Interrupt:10 Base address:0xa800&lt;br /&gt;
&lt;br /&gt;
             eth0:1    Link encap:Ethernet  HWaddr 00:50:DA:60:5B:AD&lt;br /&gt;
                       inet addr:192.168.1.182  Bcast:192.168.3.255  Mask:255.255.252.0&lt;br /&gt;
                       UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
                       RX packets:982757 errors:116 dropped:0 overruns:0 frame:116&lt;br /&gt;
                       TX packets:439299 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:1000&lt;br /&gt;
                       RX bytes:693529078 (661.4 Mb)  TX bytes:78400636 (74.7 Mb)&lt;br /&gt;
                       Interrupt:10 Base address:0xa800&lt;br /&gt;
&lt;br /&gt;
             lo        Link encap:Local Loopback&lt;br /&gt;
                       inet addr:127.0.0.1  Mask:255.0.0.0&lt;br /&gt;
                       UP LOOPBACK RUNNING  MTU:16436  Metric:1&lt;br /&gt;
                       RX packets:785 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
                       TX packets:785 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:0&lt;br /&gt;
                       RX bytes:2372833 (2.2 Mb)  TX bytes:2372833 (2.2 Mb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 78:&lt;br /&gt;
&lt;br /&gt;
     DOS to UNIX and UNIX to DOS.&lt;br /&gt;
&lt;br /&gt;
        $ dos2unix file.txt&lt;br /&gt;
&lt;br /&gt;
     And to go the other way from UNIX to DOS&lt;br /&gt;
&lt;br /&gt;
        $ unix2dos unixfile&lt;br /&gt;
&lt;br /&gt;
     See the man page, since there are MAC options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     NOTE: If you're working file DOS files, you'll probably want to use&lt;br /&gt;
           &amp;quot;zip&amp;quot; instead of &amp;quot;gzip&amp;quot; so users on Windows can unzip them.&lt;br /&gt;
&lt;br /&gt;
              $ zip test.zip test.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 79:&lt;br /&gt;
&lt;br /&gt;
     Need to Run Interactive Commands? Try &amp;quot;expect&amp;quot;.&lt;br /&gt;
       http://expect.nist.gov/expect.tar.gz&lt;br /&gt;
&lt;br /&gt;
     This simple example waits for the input &amp;quot;hi&amp;quot;, in some form before&lt;br /&gt;
     returning, immediately, &amp;quot;hello there!&amp;quot;. Otherwise, it will wait for&lt;br /&gt;
     60 seconds, then, return &amp;quot;hello there!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/expect&lt;br /&gt;
          set timeout 60&lt;br /&gt;
          expect &amp;quot;hi\n&amp;quot;&lt;br /&gt;
          send &amp;quot;hello there!\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference:&lt;br /&gt;
        http://www.oreilly.com/catalog/expect/chapter/ch03.html&lt;br /&gt;
&lt;br /&gt;
        http://www.cotse.com/dlf/man/expect/bulletproof1.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 80:&lt;br /&gt;
&lt;br /&gt;
     Using PHP as a Command Line Scripting Language.&lt;br /&gt;
&lt;br /&gt;
     The following will grab the complete file from slashdot.&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/php -q&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;?php&lt;br /&gt;
         $fileName = &amp;quot;http://slashdot.org/slashdot.xml&amp;quot;;&lt;br /&gt;
         $rss = file($fileName) or die (&amp;quot;Cannot open file $fileName\n&amp;quot;);&lt;br /&gt;
         for ($index=0; $index &amp;lt; count($rss); $index++)&lt;br /&gt;
              {&lt;br /&gt;
              echo $rss[$index];&lt;br /&gt;
              }&lt;br /&gt;
         ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       Note, if you want an example that parses the XML of&lt;br /&gt;
       slashdot, then, download the following:&lt;br /&gt;
&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/php_scripts.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 81:&lt;br /&gt;
&lt;br /&gt;
     Discarding all output -- including stderr messages.&lt;br /&gt;
&lt;br /&gt;
         $ ls  &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     Or sending all output to a file&lt;br /&gt;
&lt;br /&gt;
         $ someprog &amp;gt; /tmp/file 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     Sometimes, find displays a lot of errors when searching through&lt;br /&gt;
     directories that the user doesn't have access to. To discard&lt;br /&gt;
     error messages &amp;quot;stderr&amp;quot;, which is normally file descripter &amp;quot;2&amp;quot;&lt;br /&gt;
     work the following:&lt;br /&gt;
&lt;br /&gt;
         $ find / -iname 'stuff' 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
          or to pipe results elsewhere&lt;br /&gt;
&lt;br /&gt;
         $ find / -iname 'stuff' &amp;gt; /tmp/results_of_find  2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 118).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 82:&lt;br /&gt;
&lt;br /&gt;
     Using MIX.  D. Knuth's  assembly language/machine-code instruction set used in&lt;br /&gt;
     his books to illustrate his algorithms.&lt;br /&gt;
&lt;br /&gt;
     Download the source:&lt;br /&gt;
&lt;br /&gt;
       http://sourceforge.net/project/showfiles.php?group_id=13897&lt;br /&gt;
&lt;br /&gt;
       $ ./configure&lt;br /&gt;
       $ make&lt;br /&gt;
       $ make install&lt;br /&gt;
&lt;br /&gt;
     Documentation can be found at the following link. The link on&lt;br /&gt;
     sourceforge is not correct, but, the one below works.&lt;br /&gt;
&lt;br /&gt;
       http://www.gnu.org/software/mdk/manual/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 83:&lt;br /&gt;
&lt;br /&gt;
     Gnuplot [ http://sourceforge.net/projects/gnuplot/ ].&lt;br /&gt;
&lt;br /&gt;
     This software is ideal for printing graphs.&lt;br /&gt;
&lt;br /&gt;
         gnuplot&amp;gt; set term png&lt;br /&gt;
         gnuplot&amp;gt; set output 'testcos.png'&lt;br /&gt;
         gnuplot&amp;gt; plot cos(x)*sin(x)&lt;br /&gt;
         gnuplot&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
     Or the following command can be put into &amp;quot;file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            $ cat &amp;gt; file&lt;br /&gt;
            set term png&lt;br /&gt;
            set output 'testcos.png'&lt;br /&gt;
            plot cos(x)*sin(x)&lt;br /&gt;
            exit&lt;br /&gt;
            ^D&lt;br /&gt;
&lt;br /&gt;
     Then, run as follows:&lt;br /&gt;
&lt;br /&gt;
            $ gnuplot file&lt;br /&gt;
&lt;br /&gt;
     Or, suppose you have the following file &amp;quot;/home/chirico/data&amp;quot;. Comments&lt;br /&gt;
     with &amp;quot;#&amp;quot; are not read by gnuplot.&lt;br /&gt;
&lt;br /&gt;
            # File /home/chirico/data&lt;br /&gt;
            #&lt;br /&gt;
            2005-07-26  1    2.3    3&lt;br /&gt;
            2005-07-27  2    3.4    5&lt;br /&gt;
            2005-07-28  3    4    6.6&lt;br /&gt;
            2005-07-29  4    6    2.5&lt;br /&gt;
&lt;br /&gt;
     And you have the following new &amp;quot;file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            set term png&lt;br /&gt;
            set xdata time&lt;br /&gt;
            set timefmt &amp;quot;%Y-%m-%d &amp;quot;&lt;br /&gt;
            set format x &amp;quot;%Y/%m/%d&amp;quot;&lt;br /&gt;
            set output '/var/www/html/chirico/gnuplot/data.png'&lt;br /&gt;
            plot '/home/chirico/data' using 1:2 w linespoints  title '1st col', \&lt;br /&gt;
             '/home/chirico/data' using 1:3 w linespoints  title '2nd col', \&lt;br /&gt;
             '/home/chirico/data' using 1:4 w linespoints  title '3rd col'&lt;br /&gt;
            exit&lt;br /&gt;
&lt;br /&gt;
     You can now get a graph of this data running the following:&lt;br /&gt;
&lt;br /&gt;
            $ gnuplot file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 84:&lt;br /&gt;
&lt;br /&gt;
     CPU Information - speed, processor, cache.&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/cpuinfo&lt;br /&gt;
&lt;br /&gt;
               processor       : 0&lt;br /&gt;
               vendor_id       : GenuineIntel&lt;br /&gt;
               cpu family      : 15&lt;br /&gt;
               model           : 2&lt;br /&gt;
               model name      : Intel(R) Pentium(R) 4 CPU 2.20GHz&lt;br /&gt;
               stepping        : 9&lt;br /&gt;
               cpu MHz         : 2193.221&lt;br /&gt;
               cache size      : 512 KB&lt;br /&gt;
               fdiv_bug        : no&lt;br /&gt;
               hlt_bug         : no&lt;br /&gt;
               f00f_bug        : no&lt;br /&gt;
               coma_bug        : no&lt;br /&gt;
               fpu             : yes&lt;br /&gt;
               fpu_exception   : yes&lt;br /&gt;
               cpuid level     : 2&lt;br /&gt;
               wp              : yes&lt;br /&gt;
               flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr&lt;br /&gt;
               bogomips        : 4325.37&lt;br /&gt;
&lt;br /&gt;
      &amp;quot;bogomips&amp;quot; is a rough but good way to quickly compare two computer speeds. True it's a&lt;br /&gt;
      bogus reading; but, a &amp;quot;good enough&amp;quot; for government work calculation.  See (TIP 10) for&lt;br /&gt;
      &amp;quot;vmstat&amp;quot; and &amp;quot;iostat&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 85:&lt;br /&gt;
&lt;br /&gt;
     POVRAY - Making Animated GIFs&lt;br /&gt;
&lt;br /&gt;
     To see this in action, reference:&lt;br /&gt;
      http://souptonuts.sourceforge.net/povray/orbit.pov.html&lt;br /&gt;
&lt;br /&gt;
     These are the basic command to create:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        $ povray orbit.ini -Iorbit.pov&lt;br /&gt;
        $ convert -delay 20 *.ppm orbit.gif&lt;br /&gt;
&lt;br /&gt;
     By the way, convert is a program from imagemagick, and it can&lt;br /&gt;
     be downloaded from ( http://www.imagemagick.org ).&lt;br /&gt;
&lt;br /&gt;
    The following is &amp;quot;orbit.pov&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          #include &amp;quot;colors.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;finish.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;metals.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;textures.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;stones.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;skies.inc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          camera {&lt;br /&gt;
            location &amp;lt; 2, 3, -8 &amp;gt;&lt;br /&gt;
            look_at  &amp;lt; 0, 0, 0 &amp;gt;&lt;br /&gt;
            focal_point &amp;lt;0, 0, 0&amp;gt;&lt;br /&gt;
            blur_samples 20&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          light_source {&lt;br /&gt;
                  &amp;lt; 0, 10, 0&amp;gt;&lt;br /&gt;
                  color White&lt;br /&gt;
                  area_light &amp;lt;2,0,0&amp;gt;,&amp;lt;0,0,2&amp;gt;, 2, 2&lt;br /&gt;
                  adaptive 1&lt;br /&gt;
                  fade_distance 8&lt;br /&gt;
                  fade_power 1&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          sky_sphere {&lt;br /&gt;
            S_Cloud3&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          plane { &amp;lt;0, 1, 0&amp;gt;, -1&lt;br /&gt;
                  texture {&lt;br /&gt;
                          pigment {&lt;br /&gt;
                                  checker color Blue, color White&lt;br /&gt;
                          }&lt;br /&gt;
                          finish {Phong_Glossy}&lt;br /&gt;
                  }&lt;br /&gt;
          }&lt;br /&gt;
          #declare ball0=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;0.5, 0.5, 0&amp;gt;, 1&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Yellow}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          #declare ball1=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;3, 2, 0&amp;gt;, 0.5&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Blue}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          #declare ball2=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;3, 1, 0&amp;gt;, 1&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Green}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          object {ball0 rotate 360*clock*y}&lt;br /&gt;
          object {ball1 rotate 720*clock*y}&lt;br /&gt;
          object {ball2 rotate 360*(1 - clock)*y}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    And, &amp;quot;orbit.ini&amp;quot; follows:&lt;br /&gt;
&lt;br /&gt;
          Output_File_Type=P&lt;br /&gt;
&lt;br /&gt;
          Width=320&lt;br /&gt;
          Height=240&lt;br /&gt;
&lt;br /&gt;
          Initial_Frame=1&lt;br /&gt;
          Final_Frame=10&lt;br /&gt;
          Antialias=true&lt;br /&gt;
&lt;br /&gt;
          Subset_Start_Frame=1&lt;br /&gt;
          Subset_End_Frame=10&lt;br /&gt;
&lt;br /&gt;
          Cyclic_Animation=on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 86:&lt;br /&gt;
&lt;br /&gt;
     GPG --  GnuPG&lt;br /&gt;
&lt;br /&gt;
        Reference: http://www.gnupg.org/documentation/faqs.html&lt;br /&gt;
                   http://codesorcery.net/mutt/mutt-gnupg-howto&lt;br /&gt;
                   http://www.gnupg.org/(en)/download/index.html&lt;br /&gt;
                   (SCRIPT 4) on following link:&lt;br /&gt;
                   http://prdownloads.sourceforge.net/souptonuts/README_common_script_commands.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Generage key:&lt;br /&gt;
&lt;br /&gt;
        $ gpg --gen-key&lt;br /&gt;
&lt;br /&gt;
     Generate public key ID and fingerprint&lt;br /&gt;
&lt;br /&gt;
        $ gpg --fingerprint&lt;br /&gt;
&lt;br /&gt;
     Get a list of keys:&lt;br /&gt;
&lt;br /&gt;
        $ gpg --list-keys&lt;br /&gt;
&lt;br /&gt;
          pub  1024D/A11C1499 2004-07-15 Mike Chirico &amp;lt;mchirico@comcast.net&amp;gt;&lt;br /&gt;
          sub  1024g/E1A3C2B3 2004-07-15&lt;br /&gt;
&lt;br /&gt;
     Encrypt&lt;br /&gt;
&lt;br /&gt;
        $ gpg -r Mike  --encrypt sample.txt&lt;br /&gt;
&lt;br /&gt;
       This will produce &amp;quot;sample.txt.asc&amp;quot;, which is a binary file.  Note, I can use &amp;quot;Mike&amp;quot; because that's the&lt;br /&gt;
       name on the list of keys. Again, it will be a binary file.&lt;br /&gt;
&lt;br /&gt;
     Encrypt using &amp;quot;ASCII-armored text&amp;quot;  (--armor), which is probably what you want when sending &amp;quot;in&amp;quot; the body of an&lt;br /&gt;
     email, or some document.&lt;br /&gt;
&lt;br /&gt;
        $ gpg  -r Mike  --encrypt --armor sample.txt&lt;br /&gt;
            or&lt;br /&gt;
        $ gpg -r Mike -e -a sample.txt&lt;br /&gt;
            or&lt;br /&gt;
        $ gpg --output somefile.asc --armor -r Mike  --encrypt --armor sample.txt&lt;br /&gt;
&lt;br /&gt;
     The above 3 statements will still produce &amp;quot;sample.txt.asc&amp;quot;, but look at it, or &amp;quot;$ cat sample.txt.asc&amp;quot; without &lt;br /&gt;
     fear, since there are no binary characters. Yes, you could even compile a program &amp;quot;$ g++ -o test test.c&amp;quot; , then,&lt;br /&gt;
     &amp;quot;$ gpg --output test.asc  -r Mike --encrypt --armor test&amp;quot;. However, when decrypting make sure to pipe&lt;br /&gt;
     the results.&lt;br /&gt;
&lt;br /&gt;
            $ gpg --decrypt test.asc &amp;gt; test&lt;br /&gt;
&lt;br /&gt;
     Export &amp;quot;public&amp;quot; key:&lt;br /&gt;
&lt;br /&gt;
           $ gpg --armor --export Mike &amp;gt; m1.asc&lt;br /&gt;
&lt;br /&gt;
     Signing the file &amp;quot;message.txt&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
           $ gpg --clearsign message.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Sending the key to the &amp;quot;key-server&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        First, list the keys.&lt;br /&gt;
&lt;br /&gt;
                $ gpg --list-keys&lt;br /&gt;
                    /home/chirico/.gnupg/pubring.gpg&lt;br /&gt;
                                 v------------------ Use this with &amp;quot;0x&amp;quot; in front -------&lt;br /&gt;
                  pub  1024D/A11C1499 2004-07-15 Mike Chirico  &amp;lt;mchirico@comcast.net&amp;gt;   |&lt;br /&gt;
                  sub  1024g/E1A3C2B3 2004-07-15                                        |&lt;br /&gt;
                                                                                        |&lt;br /&gt;
                                   v----------------------------------------------------&lt;br /&gt;
                $ gpg --send-keys 0xA11C1499&lt;br /&gt;
&lt;br /&gt;
             The above sends it to the keyserver defined in &amp;quot;/home/chirico/.gnupg/gpg.conf&amp;quot;.  Other key servers:&lt;br /&gt;
&lt;br /&gt;
                            wwwkeys.pgp.net&lt;br /&gt;
                            search.keyserver.net&lt;br /&gt;
                            pgp.ai.mit.edu&lt;br /&gt;
&lt;br /&gt;
             When you go to your user-group meetings, you need to bring 2 forms of ID, and&lt;br /&gt;
             list your Key fingerprint. Shown below is the command for getting this fingerprint.&lt;br /&gt;
&lt;br /&gt;
                $ gpg --fingerprint mchirico@comcast.net&lt;br /&gt;
                 pub   1024D/A11C1499 2004-07-15&lt;br /&gt;
                 Key fingerprint = 9D7F C80D BB7B 4BAB CCA4  1BE9 9056 5BEC A11C 1499&lt;br /&gt;
                 uid   Mike Chirico (http://souptonuts.sourceforge.net/chirico/index.php) &amp;lt;mchirico@comcast.net&amp;gt;&lt;br /&gt;
                 sub   1024g/E1A3C2B3 2004-07-15&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Receving keys:&lt;br /&gt;
&lt;br /&gt;
        The following will retrieve my mchirico@comcast.net key&lt;br /&gt;
&lt;br /&gt;
               $ gpg --recv-keys 0xA11C1499&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Special Note: If you get the following error &amp;quot;GPG: Warning: Using Insecure Memory&amp;quot; , then,&lt;br /&gt;
                   &amp;quot; chmod 4755 /path/to/gpg&amp;quot;  to setuid(root) permissioins on the gpg binary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     NOTE: If using mutt, just before sending with the &amp;quot;y&amp;quot; option, hit &amp;quot;p&amp;quot; to sign or encrypt.&lt;br /&gt;
&lt;br /&gt;
     It's possible to create a gpg/pgp email from the command line. For a tutorial on this,&lt;br /&gt;
     reference (SCRIPT 4) at the following link:&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/README_common_script_commands.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 87:&lt;br /&gt;
&lt;br /&gt;
     Working with Dates: Steffen Beyer has developed a Perl and C module for working with dates&lt;br /&gt;
&lt;br /&gt;
     This softare can be downloaded from the following location:&lt;br /&gt;
        http://www.engelschall.com/u/sb/download/pkg/Date-Calc-5.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
         $ wget http://www.engelschall.com/u/sb/download/pkg/Date-Calc-5.3.tar.gz&lt;br /&gt;
         $ tar -xzvf Date-Calc-5.3.tar.gz&lt;br /&gt;
         $ cd Date-Calc-5.3&lt;br /&gt;
         $ cp ./examples/cal.c .&lt;br /&gt;
         $ gcc cal.c DateCalc.c -o mcal&lt;br /&gt;
&lt;br /&gt;
     The file cal.c contains sample function calls from DateCalc.c.  Note, &amp;quot;DateCalc.c&amp;quot;&lt;br /&gt;
     is just a list of functions and includes for &amp;quot;DateCalc.h&amp;quot; and &amp;quot;ToolBox.h&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Or, and this may be easier, just download the following:&lt;br /&gt;
         http://prdownloads.sourceforge.net/cpearls/date_calc.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
     The above link contains a few examples.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 88:&lt;br /&gt;
&lt;br /&gt;
     Color patterns for mutt.&lt;br /&gt;
&lt;br /&gt;
     The colors can be changed in the /home/user/.muttrc file. The first field begins with&lt;br /&gt;
     color, the second field is the foreground color, and the third field is the background&lt;br /&gt;
     color, or default.&lt;br /&gt;
&lt;br /&gt;
     An example .muttrc for colors:&lt;br /&gt;
&lt;br /&gt;
       # color patterns for mutt&lt;br /&gt;
       color normal     white          black # normal text&lt;br /&gt;
       color indicator  black          yellow  # actual message&lt;br /&gt;
       color tree       brightmagenta  default # thread arrows&lt;br /&gt;
       color status     brightyellow         default # status line&lt;br /&gt;
       color error      brightred      default # errors&lt;br /&gt;
       color message    magenta        default # info messages&lt;br /&gt;
       color signature  magenta        default # signature&lt;br /&gt;
       color attachment brightyellow   red     # MIME attachments&lt;br /&gt;
       color search     brightyellow   red     # search matches&lt;br /&gt;
       color tilde      brightmagenta  default # ~ at bottom of msg&lt;br /&gt;
       color markers    red            default # + at beginning of wrapped lines&lt;br /&gt;
       color hdrdefault cyan           default # default header lines&lt;br /&gt;
       color bold       red            default # hiliting bold patterns in body&lt;br /&gt;
       color underline  green          default # hiliting underlined patterns in body&lt;br /&gt;
       color quoted     cyan           default # quoted text&lt;br /&gt;
       color quoted1    magenta        default&lt;br /&gt;
       color quoted2    red            default&lt;br /&gt;
       color quoted3    green          default&lt;br /&gt;
       color quoted4    magenta           default&lt;br /&gt;
       color quoted5    cyan           default&lt;br /&gt;
       color quoted6    magenta        default&lt;br /&gt;
       color quoted7    red            default&lt;br /&gt;
       color quoted8    green          default&lt;br /&gt;
       color quoted9    cyan           default&lt;br /&gt;
       color body   cyan  default  &amp;quot;((ftp|http|https)://|news:)[^ &amp;gt;)\&amp;quot;\t]+&amp;quot;&lt;br /&gt;
       color body   cyan  default  &amp;quot;[-a-z_0-9.+]+@[-a-z_0-9.]+&amp;quot;&lt;br /&gt;
       color body   red   default  &amp;quot;(^| )\\*[-a-z0-9*]+\\*[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color body   green default  &amp;quot;(^| )_[-a-z0-9_]+_[,.?]?[\n]&amp;quot;&lt;br /&gt;
       color body   red   default  &amp;quot;(^| )\\*[-a-z0-9*]+\\*[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color body   green default  &amp;quot;(^| )_[-a-z0-9_]+_[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color index  cyan  default  ~F         # Flagged&lt;br /&gt;
       color index  red   default  ~N         # New&lt;br /&gt;
       color index  magenta    default  ~T         # Tagged&lt;br /&gt;
       color index  cyan       default  ~D         # Deleted&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 190)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 89:&lt;br /&gt;
&lt;br /&gt;
     ps command in detail&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Here are the possible codes when using state &amp;quot;$ ps -e -o state,cmd&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             PROCESS STATE CODES&lt;br /&gt;
                  D   uninterruptible sleep (usually IO)&lt;br /&gt;
                  R   runnable (on run queue)&lt;br /&gt;
                  S   sleeping&lt;br /&gt;
                  T   traced or stopped&lt;br /&gt;
                  Z   a defunct (&amp;quot;zombie&amp;quot;) process&lt;br /&gt;
&lt;br /&gt;
                  &amp;lt;    high-priority (not nice to other users)&lt;br /&gt;
                  N    low-priority (nice to other users)&lt;br /&gt;
                  L    has pages locked into memory (for real-time and custom IO)&lt;br /&gt;
                  s    is a session leader&lt;br /&gt;
                  l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)&lt;br /&gt;
                  +    is in the foreground process group&lt;br /&gt;
&lt;br /&gt;
    For instance:&lt;br /&gt;
&lt;br /&gt;
     Note that the -o is for user defined, and -e is for select&lt;br /&gt;
     all process.&lt;br /&gt;
&lt;br /&gt;
       $ ps -e -o pid,state,start,time,etime,cmd&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
             9946 S 15:40:45 00:00:00    02:23:29 /bin/bash -i&lt;br /&gt;
             9985 T 15:41:24 00:00:01    02:22:50 emacs mout2&lt;br /&gt;
            10003 T 15:43:59 00:00:00    02:20:15 emacs NOTES&lt;br /&gt;
            10320 T 17:38:42 00:00:00       25:32 emacs stuff.c&lt;br /&gt;
         ...&lt;br /&gt;
&lt;br /&gt;
     You may want to command below, without the -e, which will give the&lt;br /&gt;
     process only under the current terminal.&lt;br /&gt;
&lt;br /&gt;
       $ ps -o pid,state,start,time,etime,cmd&lt;br /&gt;
&lt;br /&gt;
     Want to find what 's impacting your load?&lt;br /&gt;
&lt;br /&gt;
       $ ps -e -o %cpu,pid,state,start,time,etime,%cpu,%mem,cmd|sort -rn|less&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ ps aux&lt;br /&gt;
&lt;br /&gt;
            USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND&lt;br /&gt;
            root         1  0.0  0.0  1380  480 ?        S    Aug04   0:00 init [3]&lt;br /&gt;
            root         2  0.0  0.0     0    0 ?        SWN  Aug04   0:00 [ksoftirqd/0]&lt;br /&gt;
            root         3  0.0  0.0     0    0 ?        SW&amp;lt;  Aug04   0:00 [events/0]&lt;br /&gt;
            root         4  0.0  0.0     0    0 ?        SW&amp;lt;  Aug04   0:00 [khelper]&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     Or, if you want to see the environment add the -e option&lt;br /&gt;
&lt;br /&gt;
       $ ps aeux&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
            chirico   2735  0.0  0.1  4400 1492 pts/0    S    Aug04   0:00 -bash USER=chirico LOGNAME=chirico HOME=/home/chirico PATH=/usr/&lt;br /&gt;
            chirico   2771  0.0  0.0  4328  924 pts/0    S    Aug04   0:00 screen -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm S&lt;br /&gt;
            chirico   2772  0.0  0.6  9476 6352 ?        S    Aug04   0:54 SCREEN -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm S&lt;br /&gt;
            chirico   2773  0.0  0.1  4432 1548 pts/1    S    Aug04   0:10 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            chirico   2797  0.0  0.1  4416 1496 pts/2    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            root      2821  0.0  0.0  4100  952 pts/2    S    Aug04   0:00 su -&lt;br /&gt;
            root      2822  0.0  0.1  4384 1480 pts/2    S    Aug04   0:00 -bash&lt;br /&gt;
            chirico   2862  0.0  0.1  4428 1524 pts/3    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            sporkey   2946  0.0  0.2  6836 2960 ?        S    Aug04   0:15 fetchmail&lt;br /&gt;
            chirico   2952  0.0  0.1  4436 1552 pts/5    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            chirico   3880  0.0  0.1  4416 1496 pts/6    S    Aug05   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            root      3904  0.0  0.0  4100  956 pts/6    S    Aug05   0:00 su - donkey&lt;br /&gt;
            donkey    3905  0.0  0.1  4336 1452 pts/6    S    Aug05   0:00 -bash&lt;br /&gt;
            donkey    3938  0.0  0.2  6732 2856 ?        S    Aug05   0:14 fetchmail&lt;br /&gt;
            chirico   3944  0.0  0.1  4416 1496 pts/7    S    Aug05   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     There is also a -f &amp;quot;forrest&amp;quot; option. Also note below &amp;quot; -bash&amp;quot; is the start of a login shell.&lt;br /&gt;
&lt;br /&gt;
      $ ps aeuxwwf &lt;br /&gt;
     &lt;br /&gt;
     The ww option above gives a wide format with all variables. Use the above command if you plan&lt;br /&gt;
     to parse through a Perl script. Otherwise, it may be easier to do a quick read using the command&lt;br /&gt;
     below, without &amp;quot;ww&amp;quot;.    &lt;br /&gt;
&lt;br /&gt;
      $ ps aeuxf&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
            root      2339  0.0  0.1  3512 1444 ?        S    Dec01   0:00 /usr/sbin/sshd&lt;br /&gt;
            root     25651  0.0  0.1  6764 1980 ?        S    Dec23   0:00  \_ /usr/sbin/sshd&lt;br /&gt;
            chirico  25653  0.0  0.2  6840 2236 ?        S    Dec23   0:14      \_ /usr/sbin/sshd&lt;br /&gt;
            chirico  25654  0.0  0.1  4364 1440 pts/4    S    Dec23   0:00          \_ -bash USER=chirico LOGNAME=chirico HOME=/home/chirico&lt;br /&gt;
            chirico  25690  0.0  0.0  4328  920 pts/4    S    Dec23   0:00              \_ screen -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm&lt;br /&gt;
            root      2355  0.0  0.0  2068  904 ?        S    Dec01   0:00 xinetd -stayalive -pidfile /var/run/xinetd.pid&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     It is also possible to list the process by command line. For example, the following command will only list the emacs&lt;br /&gt;
     processes.&lt;br /&gt;
&lt;br /&gt;
      $ ps -fC emacs&lt;br /&gt;
       UID        PID  PPID  C STIME TTY          TIME CMD&lt;br /&gt;
       chirico   5049  5020  0 May11 pts/13   00:00:00 emacs -nw Notes&lt;br /&gt;
       chirico  12368  5104  0 May12 pts/18   00:00:00 emacs -nw dnotify.c&lt;br /&gt;
       chirico  19792 18028  0 May13 pts/20   00:00:00 emacs -nw hello.c&lt;br /&gt;
       chirico  14034 27367  0 18:52 pts/8    00:00:00 emacs -nw How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
     You may also want to consider using top in batch mode. Here the &amp;quot;-n 1&amp;quot; means refresh once,&lt;br /&gt;
     and the &amp;quot;b&amp;quot; is for batch. The &amp;quot;fmt -s&amp;quot; is to put it in a more readable format.&lt;br /&gt;
&lt;br /&gt;
       $ top -n 1 b |fmt  -s &amp;gt;&amp;gt;statfile&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 90:&lt;br /&gt;
&lt;br /&gt;
     Learning Assembly.&lt;br /&gt;
&lt;br /&gt;
     Once you have written the source, assuming the file is &amp;quot;exit.s&amp;quot;, it can be compiled as follows:&lt;br /&gt;
&lt;br /&gt;
            $ as exit.s -o exit.o&lt;br /&gt;
            $ ld exit.o -o exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Here is the program:&lt;br /&gt;
&lt;br /&gt;
         #&lt;br /&gt;
         #INPUT:  none&lt;br /&gt;
         #&lt;br /&gt;
         #OUTPUT:         returns a status code. This can be viewed&lt;br /&gt;
         # by typing&lt;br /&gt;
         #&lt;br /&gt;
         # echo $?&lt;br /&gt;
         #&lt;br /&gt;
         # after running the program&lt;br /&gt;
         #&lt;br /&gt;
         #VARIABLES:&lt;br /&gt;
         # %eax holds the system call number&lt;br /&gt;
         # (this is always the case)&lt;br /&gt;
         #&lt;br /&gt;
         # %ebx holds the return status&lt;br /&gt;
         #&lt;br /&gt;
                 .section .data&lt;br /&gt;
                 .section .text&lt;br /&gt;
&lt;br /&gt;
                 .globl _start&lt;br /&gt;
         _start:&lt;br /&gt;
                 movl $1, %eax # this is the linux kernel command&lt;br /&gt;
                 # number (system call) for exiting&lt;br /&gt;
                 # a program&lt;br /&gt;
                 movl $0, %ebx # this is the status number we will&lt;br /&gt;
                 # return to the operating system.&lt;br /&gt;
                 # Change this around and it will&lt;br /&gt;
                 # return different things to&lt;br /&gt;
                 # echo $?&lt;br /&gt;
                 int $0x80 # this wakes up the kernel to run&lt;br /&gt;
                 # the exit command&lt;br /&gt;
&lt;br /&gt;
     After running this program, you can get the exit code.&lt;br /&gt;
&lt;br /&gt;
            $ exit $?&lt;br /&gt;
            0&lt;br /&gt;
&lt;br /&gt;
     That is about all it does; but, get the book for more details. The&lt;br /&gt;
     book is free.&lt;br /&gt;
&lt;br /&gt;
          http://savannah.nongnu.org/download/pgubook/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 91:&lt;br /&gt;
&lt;br /&gt;
     Creating a sandbox for reiserfstune,debugreiserfs and ACL.  Also see TIP 4.&lt;br /&gt;
&lt;br /&gt;
     Assume you have a reisers files system created from a disk file, which&lt;br /&gt;
     means you have done something like the following:&lt;br /&gt;
&lt;br /&gt;
          # dd if=/dev/zero of=disk-rfs count=102400&lt;br /&gt;
          # losetup  /dev/loop4 ./disk-rfs&lt;br /&gt;
          # mkfs -t reiserfs /dev/loop4&lt;br /&gt;
          # mkdir /fs2&lt;br /&gt;
          # mount -o loop,acl ./disk-rfs /fs2&lt;br /&gt;
&lt;br /&gt;
     Now, you can run reiserfstune. But, first you will need to umount fs2&lt;br /&gt;
&lt;br /&gt;
          # umount /fs2&lt;br /&gt;
          # reiserfstune ./disk-rfs&lt;br /&gt;
&lt;br /&gt;
     Or you can run the debug command&lt;br /&gt;
&lt;br /&gt;
          # debugreiserfs -J ./disk-rfs&lt;br /&gt;
&lt;br /&gt;
     Now, suppose you run through a lot of the debug options on&lt;br /&gt;
     http://www.namesys.com/ and you destroy this file.&lt;br /&gt;
&lt;br /&gt;
     You can recreate the file and delete the loop device.&lt;br /&gt;
&lt;br /&gt;
          # dd if=/dev/zero of=disk-rfs count=102400&lt;br /&gt;
          # losetup -d /dev/loop4&lt;br /&gt;
          # mount -o loop,acl ./disk-rfs /fs2&lt;br /&gt;
&lt;br /&gt;
     Now, try working with some of the ACL options - you can only do this&lt;br /&gt;
     with the latest kernel and tools -- Fedora Core 2 will work.&lt;br /&gt;
&lt;br /&gt;
     Assume you have 3 users, donkey, chirico and bozo2. You can give&lt;br /&gt;
     everyone rights to this file system as follows:&lt;br /&gt;
&lt;br /&gt;
          # setfacl -R -m d:u:donkey:rwx,d:u:chirico:rwx,d:u:bozo2:rwx /fs2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 92:&lt;br /&gt;
&lt;br /&gt;
     SpamAssassin - Setup.&lt;br /&gt;
&lt;br /&gt;
     Step 1.&lt;br /&gt;
&lt;br /&gt;
           Installing the SpamAssassin CPAN utility. You will need to do this&lt;br /&gt;
           as root.&lt;br /&gt;
        &lt;br /&gt;
              $ su -&lt;br /&gt;
&lt;br /&gt;
           Once you have root privileges invoke cpan.&lt;br /&gt;
        &lt;br /&gt;
              # perl -MCPAN -e shell&lt;br /&gt;
&lt;br /&gt;
              cpan&amp;gt;&lt;br /&gt;
&lt;br /&gt;
           Now install with prerequisites policy set to ask.&lt;br /&gt;
        &lt;br /&gt;
              cpan&amp;gt; o conf prerequisites_policy ask&lt;br /&gt;
        &lt;br /&gt;
              cpan&amp;gt; install Mail::SpamAssassin&lt;br /&gt;
        &lt;br /&gt;
           You will get lots of output as the necessary modules are downloaded and&lt;br /&gt;
           compiled and installed.&lt;br /&gt;
&lt;br /&gt;
     Step 2.&lt;br /&gt;
&lt;br /&gt;
            Configuration.&lt;br /&gt;
&lt;br /&gt;
            Edit the following &amp;quot;/etc/mail/spamassassin/local.cf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            Here is a look at my file&lt;br /&gt;
&lt;br /&gt;
                $ cat /etc/mail/spamassassin/local.cf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                # This is the right place to customize your installation of SpamAssassin.&lt;br /&gt;
                #&lt;br /&gt;
                # See 'perldoc Mail::SpamAssassin::Conf' for details of what can be&lt;br /&gt;
                # tweaked.&lt;br /&gt;
                #&lt;br /&gt;
                ###########################################################################&lt;br /&gt;
                #&lt;br /&gt;
                # rewrite_subject 0&lt;br /&gt;
                # report_safe 1&lt;br /&gt;
                # trusted_networks 212.17.35.&lt;br /&gt;
                #&lt;br /&gt;
                &lt;br /&gt;
                # Below added from book&lt;br /&gt;
                # You may want to set this to 5, then, work your way down.&lt;br /&gt;
                # Currently I have this 3&lt;br /&gt;
                required_hits 3&lt;br /&gt;
                &lt;br /&gt;
                # This determines how spam is reported. Currently safe email is reported&lt;br /&gt;
                # in the message.&lt;br /&gt;
                report_safe 1&lt;br /&gt;
                &lt;br /&gt;
                # The will rewrite the tag of the spam message.&lt;br /&gt;
                rewrite_subject 1&lt;br /&gt;
                &lt;br /&gt;
                # By default, SpamAssassin will run RBL checks.  If your ISP already&lt;br /&gt;
                # does this, set this to 1.&lt;br /&gt;
                skip_rbl_checks 0&lt;br /&gt;
&lt;br /&gt;
     Step 3.&lt;br /&gt;
&lt;br /&gt;
            Update .procmail.&lt;br /&gt;
&lt;br /&gt;
            You should update the .procmail file as follows. Here is my /home/chirico/.procmail file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ cat /home/chirico/.procmailrc&lt;br /&gt;
&lt;br /&gt;
                PATH=/bin:/usr/bin:/usr/local/bin&lt;br /&gt;
                MAILDIR=/var/spool/mail&lt;br /&gt;
                DEFAULT=/var/spool/mail/chirico&lt;br /&gt;
                LOGFILE=/home/chirico/MailBAG&lt;br /&gt;
                MYHOME=/home/chirico&lt;br /&gt;
                #  Must have folder MailTRASH&lt;br /&gt;
                TRASH=/home/chirico/MailTRASH&lt;br /&gt;
                &lt;br /&gt;
                # Will get everything from this mail&lt;br /&gt;
                :0&lt;br /&gt;
                * ^From:.*sporkey@comcast.net&lt;br /&gt;
                        $DEFAULT&lt;br /&gt;
                &lt;br /&gt;
                # Spamassassin&lt;br /&gt;
                :0fw&lt;br /&gt;
                * &amp;lt;300000&lt;br /&gt;
                |/usr/local/bin/spamassassin&lt;br /&gt;
&lt;br /&gt;
      Reference:&lt;br /&gt;
        http://pm-doc.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 93:&lt;br /&gt;
&lt;br /&gt;
     Make Graphs: using dot and neato.&lt;br /&gt;
&lt;br /&gt;
       $ dot -Tpng dotfile -o myout.png&lt;br /&gt;
&lt;br /&gt;
     To see the output reference the following:&lt;br /&gt;
       http://souptonuts.sourceforge.net/code/myout.png&lt;br /&gt;
&lt;br /&gt;
     Where &amp;quot;dotfile&amp;quot; is the following:&lt;br /&gt;
&lt;br /&gt;
       $ cat dotfile&lt;br /&gt;
&lt;br /&gt;
       digraph g&lt;br /&gt;
       {&lt;br /&gt;
               node [shape = record];&lt;br /&gt;
&lt;br /&gt;
               node0 [ label =&amp;quot;&amp;lt;f0&amp;gt; stuff | &amp;lt;f1&amp;gt; J | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node1 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; E | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node4 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; C | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node6 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; I | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node2 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; U | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node5 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; N | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node9 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; Y | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node8 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; W | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node10 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; Z | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node7 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; A | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node3 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; G | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node0&amp;quot;:f0 -&amp;gt; &amp;quot;node1&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node0&amp;quot;:f2 -&amp;gt; &amp;quot;node2&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node1&amp;quot;:f0 -&amp;gt; &amp;quot;node4&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node1&amp;quot;:f2 -&amp;gt; &amp;quot;node6&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node4&amp;quot;:f0 -&amp;gt; &amp;quot;node7&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node4&amp;quot;:f2 -&amp;gt; &amp;quot;node3&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node2&amp;quot;:f0 -&amp;gt; &amp;quot;node5&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node2&amp;quot;:f2 -&amp;gt; &amp;quot;node9&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node9&amp;quot;:f0 -&amp;gt; &amp;quot;node8&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node9&amp;quot;:f2 -&amp;gt; &amp;quot;node10&amp;quot;:f1;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
     Checkout the following article:&lt;br /&gt;
        http://www.linuxjournal.com/article.php?sid=7275&lt;br /&gt;
&lt;br /&gt;
     To download this software&lt;br /&gt;
        http://www.graphviz.org/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 94:&lt;br /&gt;
&lt;br /&gt;
     Makefile: working with conditions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     First note that all the indentations of the file must be&lt;br /&gt;
     a single tab. There cannot be any spaces, or make will&lt;br /&gt;
     not run.&lt;br /&gt;
&lt;br /&gt;
       $ cat Makefile&lt;br /&gt;
&lt;br /&gt;
        # Compiler flags&lt;br /&gt;
        sqliteLIB := $(shell ls /usr/local/lib/libsqlite.so)&lt;br /&gt;
        sqlite3LIB := $(shell ls /usr/local/lib/libsqlite3.so)&lt;br /&gt;
        # all assumes sqlite and sqlite3 are installed&lt;br /&gt;
        #&lt;br /&gt;
&lt;br /&gt;
        test:&lt;br /&gt;
        ifeq (&amp;quot;$(sqlite3LIB)&amp;quot;,&amp;quot;/usr/local/lib/libsqlite3.so&amp;quot;)&lt;br /&gt;
             @echo -e &amp;quot;True -- we found the file&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
             @echo &amp;quot;False -- we did not find the file&amp;quot;&lt;br /&gt;
        endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     So, if I run make I will get the following output.&lt;br /&gt;
&lt;br /&gt;
       $ make&lt;br /&gt;
       True -- we found the file&lt;br /&gt;
&lt;br /&gt;
     This is because I have a file /usr/local/lib/libsqlite3.so on my system.&lt;br /&gt;
     Note how the assignment is made, with the shell command&lt;br /&gt;
&lt;br /&gt;
           sqlite3LIB := $(shell ls /usr/local/lib/libsqlite3.so)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 95:&lt;br /&gt;
&lt;br /&gt;
     Bash: Conditional Expressions&lt;br /&gt;
&lt;br /&gt;
          if [ -e /etc/ntp.conf ]&lt;br /&gt;
            then&lt;br /&gt;
              echo &amp;quot;You have the ntp config file&amp;quot;&lt;br /&gt;
            else&lt;br /&gt;
              echo &amp;quot;You do not have the ntp config file&amp;quot;&lt;br /&gt;
          fi&lt;br /&gt;
&lt;br /&gt;
       Now using an AND condition inside the [ ]. By the way, above, you&lt;br /&gt;
       can put the &amp;quot;then&amp;quot; on the same line as the if &amp;quot;if [ -e /etc/ntp.conf ]; then&amp;quot;&lt;br /&gt;
       as long as you use the &amp;quot;;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           if [ \( -e /etc/ntp.conf \) -a \( -e /etc/ntp/ntpservers \) ]&lt;br /&gt;
             then&lt;br /&gt;
               echo &amp;quot;You have ntp config and ntpservers&amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp.conf ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntp.conf &amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp/ntpservers ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntpservers &amp;quot;&lt;br /&gt;
             else&lt;br /&gt;
               echo &amp;quot; you have neither ntp.conf or ntpservers&amp;quot;&lt;br /&gt;
           fi&lt;br /&gt;
&lt;br /&gt;
        A few things to note above. Else if statement is written as &amp;quot;elif&amp;quot;, and when&lt;br /&gt;
        dealing with &amp;quot;(&amp;quot; you will need to insert &amp;quot;\(&amp;quot;. By the way &amp;quot;-o&amp;quot; can replace &amp;quot;-a&amp;quot;&lt;br /&gt;
        and the &amp;quot;-o&amp;quot; is for OR condition. AND can be done as follows too.&lt;br /&gt;
&lt;br /&gt;
           if [ -e /etc/ntp.conf ] &amp;amp;&amp;amp; [ -e /etc/ntp/ntpservers ]&lt;br /&gt;
             then&lt;br /&gt;
               echo &amp;quot;You have ntp config and ntpservers&amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp.conf ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntp.conf &amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp/ntpservers ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntpservers &amp;quot;&lt;br /&gt;
             else&lt;br /&gt;
               echo &amp;quot; you have neither ntp.conf or ntpservers&amp;quot;&lt;br /&gt;
           fi&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (files).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             -b file      True if file exists and is a block file&lt;br /&gt;
             -c file      True if file exists and is a character device file&lt;br /&gt;
             -d file      True if file exists and is a directory&lt;br /&gt;
             -e file      True if file exists&lt;br /&gt;
             -f file      True if file exists and is a regular file&lt;br /&gt;
             -g file      True if file exists and is set goup id&lt;br /&gt;
             -G file      True if owned by the effective group ID&lt;br /&gt;
&lt;br /&gt;
             -k file      True if &amp;quot;sticky&amp;quot; bit is set and file exists&lt;br /&gt;
             -L file      True if file exists and is a symbolic link&lt;br /&gt;
             -n string    True if string is non-null&lt;br /&gt;
&lt;br /&gt;
             -O file      Ture if file exists and is owned by the effective user ID&lt;br /&gt;
&lt;br /&gt;
             -p file      True if file is a named pipe (FIFO)&lt;br /&gt;
             -r file      True if file is readable&lt;br /&gt;
             -s file      True if file has size &amp;gt; 0&lt;br /&gt;
             -S file      True if file exists and is a socket&lt;br /&gt;
&lt;br /&gt;
             -t file      True if file is open and refers to a terminal.&lt;br /&gt;
             -u file      True if setuid bit is set&lt;br /&gt;
             -w file      True if file exists and is writeable&lt;br /&gt;
             -x file      True if file executable&lt;br /&gt;
             -x dir       True if directory can be searched&lt;br /&gt;
&lt;br /&gt;
             file1 -nt file2     True if file1 modification date newer than file2&lt;br /&gt;
             file1 -ot file2     True if file1 modification date older than file2&lt;br /&gt;
             file1 -ef file2     True if file1 and file2 have same inode&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (Integers).&lt;br /&gt;
&lt;br /&gt;
             -lt  Less than&lt;br /&gt;
             -le  Less than or equal&lt;br /&gt;
             -eq  Equal&lt;br /&gt;
             -ge  Greater than or equal&lt;br /&gt;
             -gt  Greater than&lt;br /&gt;
             -ne  Not equal&lt;br /&gt;
&lt;br /&gt;
          Example usage.&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
             {&lt;br /&gt;
               while read num value; do&lt;br /&gt;
                if [ $num -gt  2 ]; then&lt;br /&gt;
                  echo $value&lt;br /&gt;
                fi&lt;br /&gt;
               done&lt;br /&gt;
             } &amp;lt; somefile&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (Strings).&lt;br /&gt;
&lt;br /&gt;
             str1 = str2      str1 matches str2&lt;br /&gt;
             str1 != str2     str1 does not matches str2&lt;br /&gt;
             str1 &amp;lt; str2      str1 is less than str2&lt;br /&gt;
             str1 &amp;gt;  str2     str1 is greater than str2&lt;br /&gt;
             -n str1          str1 is not null (length greater than 0)&lt;br /&gt;
             -z str1          str1 is null (las length 0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 96:&lt;br /&gt;
&lt;br /&gt;
     CVS: Working with cvs&lt;br /&gt;
&lt;br /&gt;
      INITIAL REPOSITORY:&lt;br /&gt;
&lt;br /&gt;
       To create a repository, and this is normally done by the system admin. This&lt;br /&gt;
       is NOT creating a project to checkout, but the location where everything&lt;br /&gt;
       will be stored! The initial repository!&lt;br /&gt;
&lt;br /&gt;
             cvs -d repository_root_directory init&lt;br /&gt;
&lt;br /&gt;
       Or here is a specific example:&lt;br /&gt;
&lt;br /&gt;
             cvs -d /work/cvsREPOSITORY/   init&lt;br /&gt;
&lt;br /&gt;
       Creating a directory tree from scratch. For a new project, the easiest thing to&lt;br /&gt;
       do is probably to create an empty directory structure, like this:&lt;br /&gt;
&lt;br /&gt;
             $ mkdir sqlite_examples&lt;br /&gt;
             $ mkdir sqlite_examples/man&lt;br /&gt;
             $ mkdir sqlite_examples/testing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       After that, you use the import command to create the&lt;br /&gt;
       corresponding (empty) directory structure inside the repository:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             $ cd &amp;lt;directory&amp;gt;&lt;br /&gt;
             $ cvs -d repository_root_directory import  -m &amp;quot;Created directory structure&amp;quot; yoyodyne/dir yoyo start&lt;br /&gt;
&lt;br /&gt;
       Or, here is a specific example.&lt;br /&gt;
&lt;br /&gt;
             $  cd sqlite_examples&lt;br /&gt;
             $  cvs  -d /work/cvsREPOSITORY/ import -m 'test SQlite'  sqlite_examples sqlite_examples start&lt;br /&gt;
&lt;br /&gt;
       Now, you can delete the directory sqlite_examples, or go to another directory and type&lt;br /&gt;
       the following:&lt;br /&gt;
&lt;br /&gt;
             $ cvs -d /work/cvsREPOSITORY/ co sqlite_examples&lt;br /&gt;
&lt;br /&gt;
     COOL TOOLS:&lt;br /&gt;
&lt;br /&gt;
           1. cvsps&lt;br /&gt;
           2. cvsreport&lt;br /&gt;
&lt;br /&gt;
         cvsps which you can find at http://www.cobite.com/cvsps/cvsps-2.0rc1.tar.gz&lt;br /&gt;
&lt;br /&gt;
             $ cvsps -f README_sqlite_tutorial.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 97:&lt;br /&gt;
&lt;br /&gt;
     Common vi and vim commands&lt;br /&gt;
&lt;br /&gt;
           Command mode ESC&lt;br /&gt;
&lt;br /&gt;
                dd       delete&lt;br /&gt;
                u        undelete&lt;br /&gt;
                y        yank (copy to buffer)&lt;br /&gt;
                p/P      p before cursor/P after cursor&lt;br /&gt;
&lt;br /&gt;
                Ctl-g    show current line number&lt;br /&gt;
                shft-G   end of file&lt;br /&gt;
              n shft-G   move to line n&lt;br /&gt;
&lt;br /&gt;
               /stuff/   search&lt;br /&gt;
                  n   repeat in same direction&lt;br /&gt;
                  N   repeat in opposite direction&lt;br /&gt;
                  /return  repeat seach forward&lt;br /&gt;
                  ?return  repeat seach backward&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;dyy  Yank current line to buffer d&lt;br /&gt;
               &amp;quot;a7yy Yank next 7 lines to buffer a&lt;br /&gt;
                    or&lt;br /&gt;
               :1,7ya a  Yank [ya] lines 1,7 to buffer a&lt;br /&gt;
               :1,7ya b  Yank [ya] lines 1,7 to buffer b&lt;br /&gt;
&lt;br /&gt;
               :5 pu b   Put [pu] buffer b after line 5&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;dP   Put the content of buffer d before cursor&lt;br /&gt;
               &amp;quot;ap   Put the contents of buffer a after cursor&lt;br /&gt;
&lt;br /&gt;
               :1,4 w! file2  Write lines 1,4 to file2&lt;br /&gt;
               :1,3&lt;br /&gt;
&lt;br /&gt;
               :set nu     Display line numbers&lt;br /&gt;
               :set nonum  Turns off display&lt;br /&gt;
&lt;br /&gt;
               :e &amp;lt;filename&amp;gt; Edit a file in a new buffer&lt;br /&gt;
&lt;br /&gt;
            vim&lt;br /&gt;
               :split&lt;br /&gt;
               :split &amp;lt;filename&amp;gt;&lt;br /&gt;
               :sp &amp;lt;filename&amp;gt;&lt;br /&gt;
               :split new&lt;br /&gt;
&lt;br /&gt;
                   ctl-w   To move between windows&lt;br /&gt;
                   ctl-w+&lt;br /&gt;
                   ctl-w-  To change size&lt;br /&gt;
                   ctl+wv  Split windows vertically&lt;br /&gt;
                   ctl-wq  Close window&lt;br /&gt;
&lt;br /&gt;
               :only       To view only 1 window&lt;br /&gt;
&lt;br /&gt;
            vim dictionary - put the following command in ~/.vimrc&lt;br /&gt;
&lt;br /&gt;
                   set dictionary+=/usr/share/dict/words&lt;br /&gt;
                   set thesaurus+=/usr/share/dict/words&lt;br /&gt;
              &lt;br /&gt;
               Now, after you type a word &amp;lt;ctl-x&amp;gt;&amp;lt;ctl-k&amp;gt;&amp;lt;ctl-n&amp;gt; and to &lt;br /&gt;
               go back in the listing &amp;lt;ctl-p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                   butter&amp;lt;ctl-x&amp;gt;&amp;lt;ctl-k&amp;gt;&amp;lt;ctl-n&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 98:&lt;br /&gt;
&lt;br /&gt;
     Using apt-get&lt;br /&gt;
&lt;br /&gt;
          $ apt-get update&lt;br /&gt;
          $ apt-get -s install &amp;lt;pkage&amp;gt;    &amp;lt;---- if everything is ok, then, remove the s&lt;br /&gt;
&lt;br /&gt;
     Note you may want to use dpkg to purge if you have to do a reinstall.&lt;br /&gt;
&lt;br /&gt;
          $ dpkg --purge exim4-base&lt;br /&gt;
          $ dpkg --purge exim4-config&lt;br /&gt;
          $ apt-get install exim4&lt;br /&gt;
&lt;br /&gt;
          $ dpkg-reconfigure exim4-config&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 99:&lt;br /&gt;
&lt;br /&gt;
     Mounting a cdrom on openbsd and installing packages&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /cdrom&lt;br /&gt;
          $ mount /dev/cd0a /cdrom&lt;br /&gt;
          $ cd /cdrom&lt;br /&gt;
&lt;br /&gt;
     To add packages&lt;br /&gt;
&lt;br /&gt;
          $ pkg_add -v  &amp;lt;directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Mounting a cdrom on linux to a user's home sub-directory:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /home/chirico/cdrom&lt;br /&gt;
          $ mount /dev/cdrom /home/chirico/cdrom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 100:&lt;br /&gt;
&lt;br /&gt;
    Creating a boot floppy for knoppix cd:&lt;br /&gt;
&lt;br /&gt;
          $ dd if=/mnt/cdrom/KNOPPIX/boot.img of=/dev/fd0 bs=1440k&lt;br /&gt;
&lt;br /&gt;
    References:&lt;br /&gt;
        http://www.knoppix.net/docs/index.php/BootFloppyHowTo&lt;br /&gt;
&lt;br /&gt;
    For a lot of the knoppix how-to's&lt;br /&gt;
        http://www.knoppix.net/docs/index.php/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 101:&lt;br /&gt;
&lt;br /&gt;
    Diction and Style Tools for Linux  http://ftp.gnu.org/gnu/diction/&lt;br /&gt;
&lt;br /&gt;
        $ diction mytext|less&lt;br /&gt;
&lt;br /&gt;
    Or, this can be done interactively&lt;br /&gt;
&lt;br /&gt;
        $ diction&lt;br /&gt;
        This is more text to read and you can do with it&lt;br /&gt;
        what you want.&lt;br /&gt;
        (stdin):1: This is more text to read and you [can -&amp;gt; (do not confuse with &amp;quot;may&amp;quot;)] do with it what you want.&lt;br /&gt;
&lt;br /&gt;
    DESCRIPTION&lt;br /&gt;
       Diction finds all sentences in a document, that contain phrases from  a&lt;br /&gt;
       database  of  frequently  misused,  bad  or  wordy diction.  It further&lt;br /&gt;
       checks for double words.  If no files are given, the document  is  read&lt;br /&gt;
       from  standard input.  Each found phrase is enclosed in [ ] (brackets).&lt;br /&gt;
       Suggestions and advice, if any, are printed headed by a right arrow -&amp;gt;.&lt;br /&gt;
       A  sentence is a sequence of words, that starts with a capitalised word&lt;br /&gt;
       and ends with a full stop, double colon, question mark or  exclaimation&lt;br /&gt;
       mark.  A single letter followed by a dot is considered an abbreviation,&lt;br /&gt;
       so it does not terminate a sentence.   Various  multi-letter  abbrevia-&lt;br /&gt;
       tions are recognized, they do not terminate a sentence as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 102:&lt;br /&gt;
&lt;br /&gt;
    Using a mail alias.&lt;br /&gt;
&lt;br /&gt;
       Suppose all root mail on your system to go to one root account root@main.com&lt;br /&gt;
&lt;br /&gt;
       In the following file:&lt;br /&gt;
&lt;br /&gt;
             /etc/aliases&lt;br /&gt;
&lt;br /&gt;
       Add this line&lt;br /&gt;
&lt;br /&gt;
             root:    root@main.com&lt;br /&gt;
&lt;br /&gt;
       Next, run newaliases [/usr/bin/newaliases] as follows:&lt;br /&gt;
&lt;br /&gt;
             $ newaliases&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Special note: It's possible to send mail to more than one address. Suppose you want&lt;br /&gt;
                     mail going to root@main.com above, plus you want it going to user donkey&lt;br /&gt;
                     on the local system.&lt;br /&gt;
&lt;br /&gt;
             root:  root@main.com donkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 103:&lt;br /&gt;
&lt;br /&gt;
    Chrony - this service is similiar to ntp. It keeps accurate time&lt;br /&gt;
            on your computer against a very accurate clock in across&lt;br /&gt;
            a network with various time delays.&lt;br /&gt;
&lt;br /&gt;
    Reference: http://go.to/chrony&lt;br /&gt;
&lt;br /&gt;
        In the file &amp;quot;/etc/chrony/chrony.conf&amp;quot; add/replace the following&lt;br /&gt;
&lt;br /&gt;
             server 146.186.218.60&lt;br /&gt;
             server 128.118.25.3&lt;br /&gt;
             server 128.2.129.21&lt;br /&gt;
&lt;br /&gt;
        Next start the chrony service&lt;br /&gt;
&lt;br /&gt;
           $ /etc/init.d/chrony restart&lt;br /&gt;
&lt;br /&gt;
     Next verify that this is working. It may take 20 or 30 minutes to update&lt;br /&gt;
     the clock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Shell command:&lt;br /&gt;
       # chronyc&lt;br /&gt;
       chronyc&amp;gt; sourcestats&lt;br /&gt;
       210 Number of sources = 3&lt;br /&gt;
       Name/IP Address            NP  NR  Span  Frequency   Freq Skew   Std Dev&lt;br /&gt;
       ========================================================================&lt;br /&gt;
       b50.cede.psu.edu            2   0    64       0.000    2000.000  4000ms&lt;br /&gt;
       otc2.psu.edu                2   0    66       0.000    2000.000  4000ms&lt;br /&gt;
       FS3.ECE.CMU.EDU             2   0    64       0.000    2000.000  4000ms&lt;br /&gt;
       chronyc&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    It is probably best to let chrony do its work. However, if you want to&lt;br /&gt;
    set both the hardware and software clock, the following will work:&lt;br /&gt;
&lt;br /&gt;
      Sets the hardware clock&lt;br /&gt;
        # hwclock --set --date=&amp;quot;12/10/04 10:18:05&amp;quot;&lt;br /&gt;
      Sync the hardware clock to software&lt;br /&gt;
        # hwclock --hctosys&lt;br /&gt;
&lt;br /&gt;
    Normally the system keep accurate time with the software clock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 104:&lt;br /&gt;
&lt;br /&gt;
    NFS mount&lt;br /&gt;
&lt;br /&gt;
     SERVER (192.168.1.182)&lt;br /&gt;
&lt;br /&gt;
       Make sure nfs is running on the server&lt;br /&gt;
 &lt;br /&gt;
           $ /etc/init.d/nfs restart&lt;br /&gt;
&lt;br /&gt;
       At the server the contents of /etc/exports for&lt;br /&gt;
       allowing 2 computers (192.168.1.171 and 192.168.1.71)&lt;br /&gt;
       to access the home directory of this server. Note that&lt;br /&gt;
       read write (rw) access is allowed.&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/exports&lt;br /&gt;
         /home   192.168.1.171(rw)&lt;br /&gt;
         /home   192.168.1.71(rw)&lt;br /&gt;
&lt;br /&gt;
       Or, if you have a lot of clients on 192.168.1.* then consider&lt;br /&gt;
       the following:&lt;br /&gt;
&lt;br /&gt;
          /home 192.168.1.0/255.255.252.0(rw)&lt;br /&gt;
&lt;br /&gt;
       Next, still at the server, run the exportfs command&lt;br /&gt;
&lt;br /&gt;
          $ exportfs -rv&lt;br /&gt;
&lt;br /&gt;
       IPTABLES (lokkit). If you're using fedora with default lokkit firewall&lt;br /&gt;
                then you can put the following under &amp;quot;Other ports&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                  Other ports nfs:tcp nfs:udp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       If the above does not work or you are not using lokkit&lt;br /&gt;
        IPTABLES (values in /etc/sysconfig/iptables on SERVER )&lt;br /&gt;
&lt;br /&gt;
        # NFS Need to accept fragmented packets and may not have header&lt;br /&gt;
        #             so you will not know where they are coming from&lt;br /&gt;
        -A INPUT -f -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -m tcp -s 192.168.1.171 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -s 192.168.1.171 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -m udp -s 192.168.1.171 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -s 192.168.1.171 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        &lt;br /&gt;
        -A INPUT -f -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -m tcp -s 192.168.1.71 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -s 192.168.1.71 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -m udp -s 192.168.1.71 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -s 192.168.1.71 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        (Reference: http://nfs.sourceforge.net/nfs-howto/server.html)&lt;br /&gt;
                  and&lt;br /&gt;
        (Reference: http://nfs.sourceforge.net/nfs-howto/security.html)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     CLIENT1 (192.168.1.171)&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /home2&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/fstab&lt;br /&gt;
         192.168.1.182:/home          /home2     nfs     rw 0 0&lt;br /&gt;
&lt;br /&gt;
          $ mount -a -t nfs&lt;br /&gt;
&lt;br /&gt;
        Or to do a one time mounting by hand&lt;br /&gt;
&lt;br /&gt;
          $ mount -t nfs 192.168.1.182:/home  /home2&lt;br /&gt;
&lt;br /&gt;
        Now /home2 on the client will be /home on the server&lt;br /&gt;
&lt;br /&gt;
        Reference:&lt;br /&gt;
          http://nfs.sourceforge.net/nfs-howto/index.html&lt;br /&gt;
&lt;br /&gt;
     MONITOR NFS:&lt;br /&gt;
&lt;br /&gt;
        To monitor the client:&lt;br /&gt;
&lt;br /&gt;
          $ nfsstat -c&lt;br /&gt;
&lt;br /&gt;
           Also note you can &amp;quot;cat /proc/net/rpc/nfs&amp;quot; as well.&lt;br /&gt;
&lt;br /&gt;
       To monitor the server (note the -s instead of the -c).&lt;br /&gt;
&lt;br /&gt;
         $ nfsstat -s&lt;br /&gt;
&lt;br /&gt;
           Also note you can &amp;quot;cat /proc/net/rpc/nfsd&amp;quot; as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       The following &amp;quot;cat&amp;quot; command is done on the NFS server, and shows which&lt;br /&gt;
       clients are mounting. This does not go with examples above. By the way,&lt;br /&gt;
       &amp;quot;root_squash&amp;quot; is the default, and means that root access on the clients is&lt;br /&gt;
       denied. So, how does the client root get access to these filesystems? You have&lt;br /&gt;
       to &amp;quot;su - &amp;lt;someuser&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
              $ cat /proc/fs/nfs/exports&lt;br /&gt;
              # Version 1.1&lt;br /&gt;
              # Path Client(Flags) # IPs&lt;br /&gt;
              /home   192.168.1.102(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   squeezel.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   192.168.1.106(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   livingroom.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   10.8.0.1(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   closet.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
&lt;br /&gt;
     (Reference: http://www.vanemery.com/Linux/NFSv4/NFSv4-no-rpcsec.html#automount )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 105:&lt;br /&gt;
&lt;br /&gt;
      Ports used for Microsoft products&lt;br /&gt;
               http://www.microsoft.com/canada/smallbiz/sgc/articles/ref_net_ports_ms_prod.mspx?pf=true&lt;br /&gt;
          Firewalling?&lt;br /&gt;
               http://www.microsoft.com/technet/prodtechnol/windowsserver2003/library/ServerHelp/428c1bbf-2ceb-4f76-a1ef-0219982eca10.mspx&lt;br /&gt;
&lt;br /&gt;
      To find out common port mappings, take a look at &amp;quot;/etc/services&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 106:&lt;br /&gt;
&lt;br /&gt;
      Man pages: If man pages are formatting incorrectly with PuTTY, try editing&lt;br /&gt;
      the &amp;quot;/etc/man.config&amp;quot; file with the following changes:&lt;br /&gt;
&lt;br /&gt;
           NROFF /usr/bin/groff -Tlatin1 -mandoc&lt;br /&gt;
           NEQN /usr/bin/geqn -Tlatin1&lt;br /&gt;
&lt;br /&gt;
         (Reference TIP 7 for using man)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 107:&lt;br /&gt;
&lt;br /&gt;
      Valgrind: check for memory leaks in your programs. (http://valgrind.org/)&lt;br /&gt;
&lt;br /&gt;
       This is how you can run it on the program &amp;quot;a.out&amp;quot; for valgrind version 2.2.0&lt;br /&gt;
&lt;br /&gt;
         $ valgrind --logfile=valgrind.output   --tool=memcheck ./a.out&lt;br /&gt;
&lt;br /&gt;
       This is how you write the logfile &amp;quot;--log-file&amp;quot; for valgrind-3.0.1&lt;br /&gt;
&lt;br /&gt;
         $ valgrind  --log-file=valgrind --leak-check=yes --tool=memcheck ./a.out&lt;br /&gt;
&lt;br /&gt;
       With C++ programs with gcc 3.4 and later that use STL, export GLIBCXX_FORCE_NEW &lt;br /&gt;
       only when testing to disable memory caching. Remember to enable for production&lt;br /&gt;
       as this will have a performance penalty. Reference  http://valgrind.org/docs/FAQ/ &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 108:&lt;br /&gt;
&lt;br /&gt;
      Runlevel Configuring.&lt;br /&gt;
&lt;br /&gt;
       These two programs, run as root give you a ncurses GUI to what will&lt;br /&gt;
       run on your system on boot.&lt;br /&gt;
&lt;br /&gt;
            # ntsysv&lt;br /&gt;
&lt;br /&gt;
            # chkconfig&lt;br /&gt;
&lt;br /&gt;
       Note, you can also set these manually. For example, normally you will&lt;br /&gt;
       have files in &amp;quot;/etc/init.d/&amp;quot; that will take parameters like &amp;quot;start&amp;quot;,&amp;quot;stop&amp;quot;&lt;br /&gt;
       &amp;quot;restart&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       Take a look at &amp;quot;/etc/init.d/mysql&amp;quot; this file will start and stop the&lt;br /&gt;
       mysql daemon. So, how does know which run levels, and the order it gets&lt;br /&gt;
       loaded in the run level to other programs? By the K&amp;lt;number&amp;gt; and S&amp;lt;number&amp;gt;&lt;br /&gt;
       values.&lt;br /&gt;
&lt;br /&gt;
            $ ls /etc/rc3.d/*mysql&lt;br /&gt;
&lt;br /&gt;
                /etc/rc3.d/K85mysql&lt;br /&gt;
                /etc/rc3.d/S85mysql&lt;br /&gt;
&lt;br /&gt;
       So here on my system the start value is 85. Looking in /etc/rc3.d, which is&lt;br /&gt;
       run level 3, any program with a lower number S84something will get loaded&lt;br /&gt;
       before mysql.&lt;br /&gt;
&lt;br /&gt;
       I manually set the run level as follows for mysql.&lt;br /&gt;
&lt;br /&gt;
            # cd /etc/rc3.d&lt;br /&gt;
            # ln -s ../init.d/mysql S85mysql&lt;br /&gt;
            # ln -s ../init.d/mysql K85mysql&lt;br /&gt;
&lt;br /&gt;
            # cd /etc/rc5.d&lt;br /&gt;
            # ln -s ../init.d/mysql S85mysql&lt;br /&gt;
            # ln -s ../init.d/mysql K85mysql&lt;br /&gt;
&lt;br /&gt;
       Note that I could have chose other numbers as well. &amp;quot;ntsysv&amp;quot; gives&lt;br /&gt;
       you a graphical interface.&lt;br /&gt;
&lt;br /&gt;
       This is a way of doing this with &amp;quot;chkconfig&amp;quot; at the command prompt.&lt;br /&gt;
&lt;br /&gt;
            # chkconfig --list mysqld&lt;br /&gt;
            mysqld          0:off   1:off   2:off   3:on    4:off   5:on    6:off&lt;br /&gt;
&lt;br /&gt;
       Above you can see it's on. Here's how we would have turned this on with chkconfig.&lt;br /&gt;
&lt;br /&gt;
            # chkconfig --level 35 mysqld on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 109:&lt;br /&gt;
&lt;br /&gt;
       File Alteration Monitor - Gamin a FAM replacement&lt;br /&gt;
        http://www.gnome.org/~veillard/gamin/&lt;br /&gt;
        http://www.gnome.org/~veillard/gamin/sources/&lt;br /&gt;
       ******  EXAMPLE NOT COMPLETE *****&lt;br /&gt;
&lt;br /&gt;
       Working with fam  - file alteration monitor.  Mail uses this to signify&lt;br /&gt;
           a change in a file's status.&lt;br /&gt;
&lt;br /&gt;
        Below is the sample C program ftest.c which can be compiled as&lt;br /&gt;
        follows:&lt;br /&gt;
&lt;br /&gt;
              $ gcc -o ftest ftest.c  -lfam&lt;br /&gt;
&lt;br /&gt;
        You will need to work with this as root&lt;br /&gt;
&lt;br /&gt;
              #  ./ftest &amp;lt;somefile absolute path&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Reference:&lt;br /&gt;
            http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?db=man&amp;amp;fname=/usr/share/catman/p_man/cat3x/fam.z&lt;br /&gt;
            http://www.devchannel.org/devtoolschannel/04/05/13/2146252.shtml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 110:&lt;br /&gt;
&lt;br /&gt;
       glibc - this is the main library used by C, and the following&lt;br /&gt;
        link below gives you examples on everything from sockets,math,&lt;br /&gt;
        date and time functions, user environment, and much more.&lt;br /&gt;
&lt;br /&gt;
         http://www.gnu.org/software/libc/manual/html_mono/libc.html&lt;br /&gt;
&lt;br /&gt;
       How do you know which version of glibc you are running?&lt;br /&gt;
&lt;br /&gt;
          #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
          #include &amp;lt;gnu/libc-version.h&amp;gt;&lt;br /&gt;
          int main (void)&lt;br /&gt;
           {&lt;br /&gt;
             puts (gnu_get_libc_version ());&lt;br /&gt;
             return 0;&lt;br /&gt;
           }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 111:&lt;br /&gt;
&lt;br /&gt;
       nslookup and dig - query Internet name servers interactively.&lt;br /&gt;
&lt;br /&gt;
         $ nslookup&lt;br /&gt;
         &amp;gt;chirico.org&lt;br /&gt;
         Server:        68.80.0.6&lt;br /&gt;
         Address:       68.80.0.6#53&lt;br /&gt;
&lt;br /&gt;
         Name: chirico.org&lt;br /&gt;
         Address: 66.35.250.210&lt;br /&gt;
         &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      The nslookup command will query the dns server is &amp;quot;/etc/resolve.conf&amp;quot;&lt;br /&gt;
      However, you can force a certain dns with &amp;quot;- server&amp;quot;.  For example the&lt;br /&gt;
      command below goes to the server named dilbert&lt;br /&gt;
&lt;br /&gt;
         $ nslookup - dilbert&lt;br /&gt;
         &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      dig:&lt;br /&gt;
&lt;br /&gt;
      dig gives you more information. You should probably use dig instead&lt;br /&gt;
      of nslookup.&lt;br /&gt;
&lt;br /&gt;
      Below I am forcing the lookup from DNS 68.80.0.6 of the name chirico.org, and&lt;br /&gt;
      note that the query time is return too.&lt;br /&gt;
&lt;br /&gt;
         $ dig @68.80.0.6  +qr chirico.org&lt;br /&gt;
&lt;br /&gt;
         ; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.2.1 &amp;lt;&amp;lt;&amp;gt;&amp;gt; @68.80.0.6 +qr chirico.org&lt;br /&gt;
         ;; global options:  printcmd&lt;br /&gt;
         ;; Sending:&lt;br /&gt;
         ;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 55908&lt;br /&gt;
         ;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0&lt;br /&gt;
        &lt;br /&gt;
         ;; QUESTION SECTION:&lt;br /&gt;
         ;chirico.org.                   IN      A&lt;br /&gt;
        &lt;br /&gt;
         ;; Got answer:&lt;br /&gt;
         ;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 55908&lt;br /&gt;
         ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
        &lt;br /&gt;
         ;; QUESTION SECTION:&lt;br /&gt;
         ;chirico.org.                   IN      A&lt;br /&gt;
        &lt;br /&gt;
         ;; ANSWER SECTION:&lt;br /&gt;
         chirico.org.            5538    IN      A       66.35.250.210&lt;br /&gt;
        &lt;br /&gt;
         ;; AUTHORITY SECTION:&lt;br /&gt;
         chirico.org.            30599   IN      NS      ns78.worldnic.com.&lt;br /&gt;
         chirico.org.            30599   IN      NS      ns77.worldnic.com.&lt;br /&gt;
        &lt;br /&gt;
         ;; ADDITIONAL SECTION:&lt;br /&gt;
         ns78.worldnic.com.      16022   IN      A       216.168.225.218&lt;br /&gt;
         ns77.worldnic.com.      7       IN      A       216.168.228.41&lt;br /&gt;
        &lt;br /&gt;
         ;; Query time: 155 msec&lt;br /&gt;
         ;; SERVER: 68.80.0.6#53(68.80.0.6)&lt;br /&gt;
         ;; WHEN: Thu Dec 23 07:48:23 2004&lt;br /&gt;
         ;; MSG SIZE  rcvd: 127&lt;br /&gt;
&lt;br /&gt;
      So what if you wanted to know what name the IP address 66.35.250.210&lt;br /&gt;
      resolves to, when using dns 68.80.0.12.&lt;br /&gt;
&lt;br /&gt;
          $ dig @68.80.0.12 -x 66.35.250.210&lt;br /&gt;
          ...&lt;br /&gt;
          ;; ANSWER SECTION:&lt;br /&gt;
          210.250.35.66.in-addr.arpa. 3600 IN   CNAME   210.0/24.250.35.66.in-addr.arpa.&lt;br /&gt;
          210.0/24.250.35.66.in-addr.arpa. 3600 IN PTR  vhost.sourceforge.net.&lt;br /&gt;
&lt;br /&gt;
      Above you can see it resolved to &amp;quot;vhost.sourceforge.net&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      Reference ( http://www.tldp.org/HOWTO/DNS-HOWTO-5.html )&lt;br /&gt;
        Also see TIP 223.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 112:&lt;br /&gt;
&lt;br /&gt;
       Using GNU Autotools - so you can produce the familiar &amp;quot;./configure&amp;quot;  &amp;quot;make&amp;quot;  and &amp;quot;make install&amp;quot;&lt;br /&gt;
                             commands. There is also a &amp;quot;make dist&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                The program sqlite3api.cc and the rest of this code can be found at&lt;br /&gt;
                 http://prdownloads.sourceforge.net/cpearls/autotools.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         A &amp;quot;Makefile.am&amp;quot; is required:&lt;br /&gt;
&lt;br /&gt;
            bin_PROGRAMS = sprog&lt;br /&gt;
            sprog_SOURCES = sqlite3api.cc&lt;br /&gt;
            sprog_LDADD = @INCLUDES@ @SQLIBOBJS@&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         In addition, a &amp;quot;configure.in&amp;quot; file is required. Note, AC_CHECK_LIB will&lt;br /&gt;
         check the &amp;quot;libsqlite3.so&amp;quot; file for the &amp;quot;sqlite3_open&amp;quot; file. Note that&lt;br /&gt;
         &amp;quot;sqlite3&amp;quot;, is a shortcut for &amp;quot;libsqlite3&amp;quot; by convention. If this file&lt;br /&gt;
         is not found, AC_CHECK_FILE looks for &amp;quot;/usr/local/lib/libsqlite3.a&amp;quot;. If&lt;br /&gt;
         this is found, then, &amp;quot;-lsqlite3&amp;quot; is added to the LIBS environment variable.&lt;br /&gt;
         Also, &amp;quot;-I/usr/local/include&amp;quot; and &amp;quot;-L/usr/local/lib&amp;quot; will be added on the&lt;br /&gt;
         command line. This is common when some one does not have the library in&lt;br /&gt;
         the path.  (See TIP 49)&lt;br /&gt;
&lt;br /&gt;
            dnl Process this file with autoconf to produce a configure script.&lt;br /&gt;
            AC_INIT(sqlite3api.cc)&lt;br /&gt;
            AM_INIT_AUTOMAKE(sqliteprog, 1.0)&lt;br /&gt;
            AC_PROG_CXX&lt;br /&gt;
            CXXFLAGS='-Wall -W -O2 -s -pipe'&lt;br /&gt;
            AC_CHECK_LIB(sqlite3,sqlite3_open,[],found=no)&lt;br /&gt;
             if test &amp;quot;$found&amp;quot; = &amp;quot;no&amp;quot;; then&lt;br /&gt;
               AC_CHECK_FILE(/usr/local/lib/libsqlite3.a, found=yes)&lt;br /&gt;
               if test &amp;quot;$found&amp;quot; = &amp;quot;yes&amp;quot;; then&lt;br /&gt;
                 LIBS=&amp;quot;$LIBS -lsqlite3&amp;quot;&lt;br /&gt;
                 INCLUDES=&amp;quot;$INCLUDES -I/usr/local/include&amp;quot;&lt;br /&gt;
                 EXTRALIB='-L/usr/local/lib'&lt;br /&gt;
                else&lt;br /&gt;
                 echo &amp;quot;Are you SURE sqlite3 is installed?&amp;quot;&lt;br /&gt;
               fi&lt;br /&gt;
             fi&lt;br /&gt;
            SQLIBOBJS='-Wl,-R/usr/local/lib'&lt;br /&gt;
            AC_SUBST(INCLUDES)&lt;br /&gt;
            AC_SUBST(SQLIBOBJS)&lt;br /&gt;
            AC_SUBST(EXTRALIB)&lt;br /&gt;
            AC_OUTPUT(Makefile)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         To build the configure file, just run the following:&lt;br /&gt;
&lt;br /&gt;
             $ aclocal&lt;br /&gt;
             $ autoconf&lt;br /&gt;
             $ touch NEWS README AUTHORS ChangeLog&lt;br /&gt;
             $ automake --add-missing&lt;br /&gt;
&lt;br /&gt;
         Now if you want to make a tar.gz file &amp;quot;sqliteprog-1.0.tar.gz&amp;quot;, then&lt;br /&gt;
         all you have to run is the following:&lt;br /&gt;
&lt;br /&gt;
             $ make dist&lt;br /&gt;
&lt;br /&gt;
         Note: did you ever want to save all the output from a ./configure? Well, it&lt;br /&gt;
               is automatically saved in the &amp;quot;config.log&amp;quot; file. In fact, this file may&lt;br /&gt;
               contain a lot more than what you saw on the screen.&lt;br /&gt;
&lt;br /&gt;
               Also, you may need to rerun ./configure. But before you do, delete&lt;br /&gt;
               the &amp;quot;config.cache&amp;quot; file to get a clean build.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 113:&lt;br /&gt;
&lt;br /&gt;
       EMACS - common emacs commands.&lt;br /&gt;
&lt;br /&gt;
         M is the ESC&lt;br /&gt;
         C or c is the Ctl&lt;br /&gt;
&lt;br /&gt;
        Shell - when working in a shell. &amp;quot;M-x rename-uniquely&amp;quot; is good for split screen editing.&lt;br /&gt;
&lt;br /&gt;
          M-x rename-uniquely   Use this for multiple shells (renames buffer so it's not the same shell)&lt;br /&gt;
          C-c C-z               Send job in background (when working in a shell)&lt;br /&gt;
          C-c C-o               commit-kill-output (gets rid of a lot of shell output)&lt;br /&gt;
          C-c C-r               reposition at beginning of output&lt;br /&gt;
          C-c C-e               reposition at end of output&lt;br /&gt;
          M-x send-invisible    Hide passwords - use this before typing a password&lt;br /&gt;
&lt;br /&gt;
         Note: if the shell prompt does not show up correctly, then, you may want to creat a &amp;quot;.emacs_bash&amp;quot;&lt;br /&gt;
               file with the following contents:&lt;br /&gt;
&lt;br /&gt;
                          PS1=&amp;quot;emacs:\W \$ &amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Directories  (C-x d) give you a directory listing. You know all those annoying &amp;quot;~&amp;quot; and &amp;quot;#&amp;quot;&lt;br /&gt;
                     file that you get? You can easily delete these when in &amp;quot;dired&amp;quot; mode by hitting&lt;br /&gt;
                     &amp;quot;~&amp;quot;, then  &amp;quot;d&amp;quot; to flag it for delete. Then, hit &amp;quot;x&amp;quot; to and confirm deletion.&lt;br /&gt;
&lt;br /&gt;
                     These are other command that work on highlighted files in &amp;quot;dired&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
                          R   rename&lt;br /&gt;
                          v   view&lt;br /&gt;
                          Z   compress the file&lt;br /&gt;
                          +   create directory&lt;br /&gt;
&lt;br /&gt;
        Other common commands:&lt;br /&gt;
&lt;br /&gt;
          c-x l          list the line you are on, and how many lines in the document.&lt;br /&gt;
                         You will get something like: Page has 4881 lines (4440 + 442),&lt;br /&gt;
                         which means you are on the 4440 line.&lt;br /&gt;
&lt;br /&gt;
          c-x rm bookmark make&lt;br /&gt;
          c-x rb bookmark bounce&lt;br /&gt;
        &lt;br /&gt;
          c-x rb notes&lt;br /&gt;
          c-x rb emacs&lt;br /&gt;
        &lt;br /&gt;
          c-x / &amp;lt;r&amp;gt; (save position in register &amp;lt;r&amp;gt;)&lt;br /&gt;
          c-x j &amp;lt;r&amp;gt; (jump to position in register &amp;lt;r&amp;gt;)&lt;br /&gt;
          c-x r SPC 1 (mark current point in register 1)&lt;br /&gt;
          c-x r j 1 (jump to marked point in register 1)&lt;br /&gt;
          c-x r t &amp;lt;string&amp;gt;  (insert string into register)&lt;br /&gt;
        &lt;br /&gt;
          c-x r s 1 (save marked region in register 1)&lt;br /&gt;
          c-x r i 1 (insert marked region)&lt;br /&gt;
        &lt;br /&gt;
          c-x c-o (delete all blank lines, except one)&lt;br /&gt;
        &lt;br /&gt;
          c-x z (repeat the last command ... stop with an a)&lt;br /&gt;
          c-x zz (repeat the last command twice)&lt;br /&gt;
&lt;br /&gt;
          rectangle&lt;br /&gt;
          ---------&lt;br /&gt;
          C-SPC&lt;br /&gt;
          goto the next region&lt;br /&gt;
          C-x&lt;br /&gt;
          C-x&lt;br /&gt;
          then, C-x r r &amp;quot;name of register&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
          to insert the register&lt;br /&gt;
          C-x r i &amp;quot;name of register&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
          macros:&lt;br /&gt;
          -------&lt;br /&gt;
          c-x (    start macro&lt;br /&gt;
          c-x )    end macro&lt;br /&gt;
          c-x e    execute macro&lt;br /&gt;
        &lt;br /&gt;
          mail:&lt;br /&gt;
          -----&lt;br /&gt;
          c-x m   mail&lt;br /&gt;
          c-c c-s send&lt;br /&gt;
        &lt;br /&gt;
          C-x C-e&lt;br /&gt;
          (insert &amp;quot;\n\nExtra Line of text&amp;quot;)&lt;br /&gt;
        &lt;br /&gt;
          ;; chirico functions in .emacs&lt;br /&gt;
          ;; This creates an html template&lt;br /&gt;
          (defun my-html ()&lt;br /&gt;
          (interactive)&lt;br /&gt;
          (insert &amp;quot;&amp;lt;html&amp;gt;&lt;br /&gt;
          &amp;lt;head&amp;gt;&lt;br /&gt;
          &amp;lt;META HTTP-EQUIV=\&amp;quot;Pragma\&amp;quot; CONTENT=\&amp;quot;no-cache\&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;META HTTP-EQUIV=\&amp;quot;Expires\&amp;quot; CONTENT=\&amp;quot;-1\&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;/head&amp;gt;&lt;br /&gt;
          &amp;lt;body bgcolor=\&amp;quot;#ffffff\&amp;quot;&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
          &amp;lt;/body&amp;gt;&lt;br /&gt;
          &amp;lt;/html&amp;gt;&amp;quot;)&lt;br /&gt;
          )&lt;br /&gt;
&lt;br /&gt;
     Backspace issues when using &amp;quot;emacs -nw&amp;quot;? They putting the following in your &amp;quot;~/.emacs&amp;quot; file&lt;br /&gt;
&lt;br /&gt;
             (global-set-key &amp;quot;\C-d&amp;quot; 'backward-delete-char)&lt;br /&gt;
             (global-set-key &amp;quot;\C-h&amp;quot; 'backward-delete-char)&lt;br /&gt;
             (global-set-key (kbd &amp;quot;DEL&amp;quot;) 'delete-char)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 114:&lt;br /&gt;
&lt;br /&gt;
        ncftpget - an intelligent ftp client (http://www.ncftp.com/). Also&lt;br /&gt;
                   check your fedora or debian install. This package allows&lt;br /&gt;
                   you to easily download packages from ftp sites.&lt;br /&gt;
&lt;br /&gt;
          This is an example of connect to an ftp site, with a subdirectory, and&lt;br /&gt;
          downloading all in one command.&lt;br /&gt;
&lt;br /&gt;
           $ ncftpget ftp://ftp.gnu.org/pub/gnu/gcc/gcc-3.2.3/gcc-3.2.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
          Of if you want to get the fedora core 3 installs&lt;br /&gt;
&lt;br /&gt;
           $ ncftpget ftp://ftp.linux.ncsu.edu/pub/fedora/linux/core/3/i386/iso/FC3*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 115:&lt;br /&gt;
&lt;br /&gt;
        expr - evaluate expressions. You can use this on the command line&lt;br /&gt;
&lt;br /&gt;
           $ expr 6 + 4&lt;br /&gt;
           10&lt;br /&gt;
&lt;br /&gt;
         Note the spaces. Without spaces, you get the following:&lt;br /&gt;
&lt;br /&gt;
           $ expr 6+4&lt;br /&gt;
           6+4&lt;br /&gt;
&lt;br /&gt;
         If you're using &amp;quot;*&amp;quot;, you'll need a &amp;quot;\&amp;quot; before it&lt;br /&gt;
&lt;br /&gt;
           $ expr 10 \* 10&lt;br /&gt;
           100&lt;br /&gt;
&lt;br /&gt;
         This also works for variables&lt;br /&gt;
&lt;br /&gt;
           $ var1=34&lt;br /&gt;
           $ expr $var1 + 3&lt;br /&gt;
           37&lt;br /&gt;
&lt;br /&gt;
         or&lt;br /&gt;
&lt;br /&gt;
           $ var1=2&lt;br /&gt;
           $ var1=`expr $var1 \* 2`&lt;br /&gt;
           $ echo $var1&lt;br /&gt;
           4&lt;br /&gt;
&lt;br /&gt;
         see (TIP 25) you can get the cosine(.23)&lt;br /&gt;
&lt;br /&gt;
           $ var1=`echo &amp;quot;c(.23)&amp;quot;|bc -l`&lt;br /&gt;
           $ echo $var1&lt;br /&gt;
           .97366639500537483696&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         You can also do substrings:&lt;br /&gt;
&lt;br /&gt;
           $ expr substr &amp;quot;BigBear&amp;quot; 4 4&lt;br /&gt;
           Bear&lt;br /&gt;
&lt;br /&gt;
         And length of strings&lt;br /&gt;
&lt;br /&gt;
           $ mstr=&amp;quot;12345&amp;quot;&lt;br /&gt;
           $ expr length $mstr&lt;br /&gt;
           5&lt;br /&gt;
&lt;br /&gt;
         Regular expressions&lt;br /&gt;
&lt;br /&gt;
           $ expr &amp;quot;a3&amp;quot; : [a-z][1-9]&lt;br /&gt;
           2&lt;br /&gt;
&lt;br /&gt;
         Or you can get a bit fancy&lt;br /&gt;
&lt;br /&gt;
           $ myexpr=&amp;quot;[a-z][1-9]&amp;quot;&lt;br /&gt;
           $ echo $myexpr&lt;br /&gt;
           [a-z][1-9]&lt;br /&gt;
&lt;br /&gt;
           $ expr &amp;quot;a3&amp;quot; : $myexpr&lt;br /&gt;
           2&lt;br /&gt;
&lt;br /&gt;
         This may not be the best way to find out if it is Friday, but&lt;br /&gt;
         it seems to work. It's more of an exercise in xargs.&lt;br /&gt;
&lt;br /&gt;
           $ date&lt;br /&gt;
           Fri Dec 31 16:44:47 EST 2004&lt;br /&gt;
           $ date|xargs -i expr {} : &amp;quot;[Fri]&amp;quot;&lt;br /&gt;
           1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 116:&lt;br /&gt;
&lt;br /&gt;
        eval&lt;br /&gt;
&lt;br /&gt;
           $ mypipe=&amp;quot;|&amp;quot;&lt;br /&gt;
           $ eval ls $mypipe wc&lt;br /&gt;
           6       6     129&lt;br /&gt;
&lt;br /&gt;
        Did you catch that? The above statement is the same as&lt;br /&gt;
&lt;br /&gt;
           $ ls | wc&lt;br /&gt;
&lt;br /&gt;
        Where &amp;quot;|&amp;quot; is put into the variable $mypipe&lt;br /&gt;
&lt;br /&gt;
        (also see TIP 118)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 117:&lt;br /&gt;
&lt;br /&gt;
        lxr, glimpse, patchset - tools for reading the kernel source&lt;br /&gt;
&lt;br /&gt;
          This example puts some of the files in /home/src since my home&lt;br /&gt;
          partition is the largest. Plus, you do not want to over write&lt;br /&gt;
          the source in /usr/src/ If you want to put your files elsewhere&lt;br /&gt;
          just substitute /home/src for your desired directory.&lt;br /&gt;
&lt;br /&gt;
         patchset -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ export SRCDIR=/home/src&lt;br /&gt;
            $ cd $SRCDIR&lt;br /&gt;
            $ wget http://www.csn.ul.ie/~mel/projects/patchset/patchset-0.5.tar.gz&lt;br /&gt;
            $ export PATH=$PATH:$SRCDIR/patchset-0.5/bin&lt;br /&gt;
&lt;br /&gt;
          Now edit &amp;quot;/home/src/patchset-0.5/etc/patchset.conf&amp;quot; and set WWW_USER to&lt;br /&gt;
          whatever your website runs as&lt;br /&gt;
&lt;br /&gt;
                  export WWW_USER=nobody&lt;br /&gt;
&lt;br /&gt;
          Getting kernel source. The last step builds and asks a lot of questions. Enter&lt;br /&gt;
          yes to things that interest you, since this is what you will see in the source&lt;br /&gt;
          code. It is not going to build for booting. The &amp;quot;downlaod -p&amp;quot; is for downloading&lt;br /&gt;
          a patch.&lt;br /&gt;
&lt;br /&gt;
            $ download 2.6.10&lt;br /&gt;
            $ createset 2.6.10&lt;br /&gt;
            $ make-kernel -b 2.6.10&lt;br /&gt;
&lt;br /&gt;
        glimpse -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ mkdir -p /home/src/glimpse&lt;br /&gt;
            $ cd /home/src/glimpse&lt;br /&gt;
            $ wget http://webglimpse.net/trial/glimpse-latest.tar.gz&lt;br /&gt;
            $ tar -xzf glimpse-latest.tar.gz&lt;br /&gt;
            $ cd glimpse-4.18.0&lt;br /&gt;
            $ ./configure; make&lt;br /&gt;
            $ make install&lt;br /&gt;
&lt;br /&gt;
        lxr -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ make -p /home/src/lxr&lt;br /&gt;
            $ cd /home/src/lxr&lt;br /&gt;
            $ wget http://heanet.dl.sourceforge.net/sourceforge/lxr/lxr-0.3.1.tar.gz&lt;br /&gt;
            $ cd lxr-0.3&lt;br /&gt;
&lt;br /&gt;
          Edit &amp;quot;Makefile&amp;quot; and set PERLBIN to &amp;quot;/usr/bin/perl&amp;quot; or the where perl is&lt;br /&gt;
          on your system. Also set INSTALLPREFIX to &amp;quot;/var/www/lxr&amp;quot;.  Then, as root&lt;br /&gt;
          do the following:&lt;br /&gt;
&lt;br /&gt;
            $ make install&lt;br /&gt;
&lt;br /&gt;
         Apache changes&lt;br /&gt;
&lt;br /&gt;
          Next edit the apache httpd.conf. On my system it is&lt;br /&gt;
          &amp;quot;/usr/local/apache2/conf/httpd.conf&amp;quot;, but if you did a fedora install&lt;br /&gt;
          I think this file is located at &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             Alias  /lxr/ &amp;quot;/var/www/lxr/&amp;quot;&lt;br /&gt;
             &amp;lt;Directory &amp;quot;/var/www/lxr/&amp;quot;&amp;gt;&lt;br /&gt;
               Options ExecCGI Indexes Includes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride all&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
&lt;br /&gt;
              &amp;lt;Files ~ (search|source|ident|diff|find)&amp;gt;&lt;br /&gt;
                    SetHandler cgi-script&lt;br /&gt;
              &amp;lt;/Files&amp;gt;&lt;br /&gt;
             &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          lxr - continued &amp;quot;/var/www/lxr/http/lxr.conf&amp;quot; changes.  The following contains&lt;br /&gt;
                my lxr.conf with changes made to almost every variable. Make sure you use&lt;br /&gt;
                your website in place of 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
                 # Configuration file.&lt;br /&gt;
                &lt;br /&gt;
                 # Define typed variable &amp;quot;v&amp;quot;, read valueset from file.&lt;br /&gt;
                 variable: v, Version, [/var/www/lxr/source/versions], [/var/www/lxr/source/defversion]&lt;br /&gt;
                &lt;br /&gt;
                 # Define typed variable &amp;quot;a&amp;quot;.  First value is default.&lt;br /&gt;
                 variable: a, Architecture, (i386, alpha, m68k, mips, ppc, sparc, sparc64)&lt;br /&gt;
                &lt;br /&gt;
                 # Define the base url for the LXR files.&lt;br /&gt;
                 baseurl: http://192.168.1.71/lxr/http/&lt;br /&gt;
                &lt;br /&gt;
                 # These are the templates for the HTML heading, directory listing and&lt;br /&gt;
                 # footer, respectively.&lt;br /&gt;
                 htmlhead: /var/www/lxr/http/template-head&lt;br /&gt;
                 htmltail: /var/www/lxr/http/template-tail&lt;br /&gt;
                 htmldir:  /var/www/lxr/http/template-dir&lt;br /&gt;
                &lt;br /&gt;
                 # The source is here.&lt;br /&gt;
                 sourceroot: /var/www/lxr/source/$v/&lt;br /&gt;
                 srcrootname: Linux&lt;br /&gt;
                &lt;br /&gt;
                 # &amp;quot;#include &amp;lt;foo.h&amp;gt;&amp;quot; is mapped to this directory (in the LXR source&lt;br /&gt;
                 # tree)&lt;br /&gt;
                 incprefix: /include&lt;br /&gt;
                &lt;br /&gt;
                 # The database files go here.&lt;br /&gt;
                 dbdir: /var/www/lxr/source/$v/&lt;br /&gt;
                &lt;br /&gt;
                 # Glimpse can be found here.&lt;br /&gt;
                 glimpsebin: /usr/local/bin/glimpse&lt;br /&gt;
                &lt;br /&gt;
                 # The power of regexps.  This is pretty Linux-specific, but quite&lt;br /&gt;
                 # useful.  Tinker with it and see what it does.  (How's that for&lt;br /&gt;
                 # documentation?)&lt;br /&gt;
                 map: /include/asm[^\/]*/ /include/asm-$a/&lt;br /&gt;
                 map: /arch/[^\/]+/ /arch/$a/&lt;br /&gt;
&lt;br /&gt;
         Now you should be ready to run &amp;quot;make-lxr&amp;quot;. Make sure the path is setup to patchset,&lt;br /&gt;
         which is repeated here. The last step take awhile.&lt;br /&gt;
&lt;br /&gt;
            $ export SRCDIR=/home/src&lt;br /&gt;
            $ cd $SRCDIR&lt;br /&gt;
            $ export PATH=$PATH:$SRCDIR/patchset-0.5/bin&lt;br /&gt;
&lt;br /&gt;
            $  make-lxr 2.6.10&lt;br /&gt;
&lt;br /&gt;
         Now you need to index the source. Below the ./glimpse_* file will be put in&lt;br /&gt;
         root. Checkout the -H option if you do not want them here on a temporary&lt;br /&gt;
         bases of if you run out of room.&lt;br /&gt;
&lt;br /&gt;
            $ glimpseindex -o -t -w 5000 /var/www/lxr/source/2.6.10 &amp;gt;&amp;amp; .glimpse_out&lt;br /&gt;
&lt;br /&gt;
         Since the above put the files under /root/.glimpse_* they should be moved&lt;br /&gt;
&lt;br /&gt;
            $ mv /root/.glimps_* /var/www/lxr/source/2.6.10/.&lt;br /&gt;
            $ chown -R nobody.nobody ./.glimpse_*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 118:&lt;br /&gt;
&lt;br /&gt;
        exec - you can change standard output and input without starting a new&lt;br /&gt;
               process.&lt;br /&gt;
&lt;br /&gt;
          The exec redirect the output from ls and date to a file. Nothing&lt;br /&gt;
          is show on the terminal until &amp;quot;exec &amp;gt; /dev/tty&amp;quot; is performed&lt;br /&gt;
&lt;br /&gt;
            $ exec &amp;gt; mfile&lt;br /&gt;
            $ ls&lt;br /&gt;
            $ date&lt;br /&gt;
            $ exec &amp;gt; /dev/tty&lt;br /&gt;
&lt;br /&gt;
          This is an example of assigning file descriptor 3 to file &amp;quot;output3&amp;quot; for&lt;br /&gt;
          output, then, redirecting &amp;quot;ls&amp;quot; to this descriptor. Finally, file descriptor&lt;br /&gt;
          3 is used for input, and the contents are read into the cat command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
            $ exec 3&amp;gt;output3&lt;br /&gt;
            $ ls  &amp;gt;&amp;amp; 3&lt;br /&gt;
            $ exec 3&amp;lt;output3&lt;br /&gt;
            $ cat &amp;lt;&amp;amp;3&lt;br /&gt;
            ChangeLog&lt;br /&gt;
            CVS&lt;br /&gt;
            How_to_Linux_and_Open_Source.txt&lt;br /&gt;
            How_to_Linux_and_Open_Source.txt.~1.193.~&lt;br /&gt;
            mfile&lt;br /&gt;
            mfile2&lt;br /&gt;
            mfile3&lt;br /&gt;
            mftp&lt;br /&gt;
            output3&lt;br /&gt;
&lt;br /&gt;
        Could you redirect the output to 3 files and stderr?&lt;br /&gt;
&lt;br /&gt;
            $ exec 3&amp;gt;output3&lt;br /&gt;
            $ exec 4&amp;gt;output4&lt;br /&gt;
            $ exec 5&amp;gt;output5&lt;br /&gt;
&lt;br /&gt;
            $ ls &amp;gt;&amp;amp; 3 &amp;gt;&amp;amp; 4 &amp;gt;&amp;amp; 5 &amp;gt;&amp;amp; 2   // Nope, can't do this.&lt;br /&gt;
            output3  output4  output5&lt;br /&gt;
&lt;br /&gt;
         Instead, you should do the following:&lt;br /&gt;
&lt;br /&gt;
            $ ls | tee output3 | tee output4 |tee output5&lt;br /&gt;
&lt;br /&gt;
         Closing the &amp;quot;output&amp;quot; file descriptor&lt;br /&gt;
&lt;br /&gt;
            $ &amp;gt;&amp;amp;3-&lt;br /&gt;
&lt;br /&gt;
         Closing the &amp;quot;input&amp;quot; file descriptor&lt;br /&gt;
&lt;br /&gt;
            $ 3&amp;lt;&amp;amp;-&lt;br /&gt;
&lt;br /&gt;
         See what is still open on 0-10&lt;br /&gt;
&lt;br /&gt;
            $ lsof -a -p $$ -d 0-10&lt;br /&gt;
&lt;br /&gt;
         Recursion - the following counts to 5, then, quits.&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
            sleep 1&lt;br /&gt;
            declare -x n&lt;br /&gt;
            let n=${n:=0}+1&lt;br /&gt;
            [ $n -le 5 ] &amp;amp;&amp;amp; echo &amp;quot;$n&amp;quot; &amp;amp;&amp;amp;  exec $0&lt;br /&gt;
&lt;br /&gt;
         There are some real-life applications for this technique, as follows:&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
            declare -x N&lt;br /&gt;
            declare -x n&lt;br /&gt;
            N=${N:=$(od -vAn -N1 -tu4 &amp;lt; /dev/urandom)}&lt;br /&gt;
            let n=${n:=0}+1&lt;br /&gt;
            [ $(($n%2)) -eq 0 ] &amp;amp;&amp;amp; echo &amp;quot;She Loves Me!&amp;quot; || echo &amp;quot;She Loves Me NOT!&amp;quot;&lt;br /&gt;
            [ $n -lt $N ] &amp;amp;&amp;amp;  exec $0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 119:&lt;br /&gt;
&lt;br /&gt;
        runlevel - need to know the current runlevel?&lt;br /&gt;
&lt;br /&gt;
           $ who -r&lt;br /&gt;
           run-level 3  Dec 31 19:02                   last=S&lt;br /&gt;
&lt;br /&gt;
        Need to know the architecture?&lt;br /&gt;
&lt;br /&gt;
          $ arch&lt;br /&gt;
          i686&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 120:&lt;br /&gt;
&lt;br /&gt;
        at - executes commands at a specified time.&lt;br /&gt;
&lt;br /&gt;
         A few examples here. The 1970 program will run&lt;br /&gt;
         next Auguest 2 even though the year 1970 has long past.&lt;br /&gt;
&lt;br /&gt;
          $ at 6:30am Jan 12 &amp;lt; program&lt;br /&gt;
          $ at noon tomorrow &amp;lt; program&lt;br /&gt;
          $ at 1970 pm August 2 &amp;lt; program&lt;br /&gt;
&lt;br /&gt;
        This is an interactive way to use the command:&lt;br /&gt;
&lt;br /&gt;
          $ at now + 6 minutes&lt;br /&gt;
          warning: commands will be executed using (in order) a) $SHELL b) login shell c) /bin/sh&lt;br /&gt;
          at&amp;gt; ls&lt;br /&gt;
          at&amp;gt; date &amp;gt; /tmp/5min&lt;br /&gt;
          at&amp;gt; ^D&lt;br /&gt;
          job 3 at 2005-01-01 08:50&lt;br /&gt;
&lt;br /&gt;
        What jobs are in the queue?&lt;br /&gt;
&lt;br /&gt;
          $ atq&lt;br /&gt;
&lt;br /&gt;
        or&lt;br /&gt;
&lt;br /&gt;
          $ at -l&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 121:&lt;br /&gt;
&lt;br /&gt;
        Creating a Manpage&lt;br /&gt;
&lt;br /&gt;
         As root you can copy the following to /usr/local/man/man1/soup.1 which will&lt;br /&gt;
         give you a manpage for soup.&lt;br /&gt;
&lt;br /&gt;
              .\&amp;quot; Manpage for souptonuts.&lt;br /&gt;
              .\&amp;quot; Contact mchirico@users.sourceforge.com to correct errors or omissions.&lt;br /&gt;
              .TH man 1 &amp;quot;04 January 2005&amp;quot; &amp;quot;1.0&amp;quot; &amp;quot;souptonuts man page&amp;quot;&lt;br /&gt;
              .SH NAME&lt;br /&gt;
              soup \- man page for souptonuts&lt;br /&gt;
              .SH SYNOPSIS&lt;br /&gt;
              soup&lt;br /&gt;
              .SH DESCRIPTION&lt;br /&gt;
              souptonuts is a collection of linux and open&lt;br /&gt;
              source tips.&lt;br /&gt;
              off for golf.&lt;br /&gt;
              .SH OPTIONS&lt;br /&gt;
              The souptonuts does not take any options.&lt;br /&gt;
              .SH SEE ALSO&lt;br /&gt;
              doughnut(1), golf(8)&lt;br /&gt;
              .SH BUGS&lt;br /&gt;
              No known bugs at this time.&lt;br /&gt;
              .SH AUTHOR&lt;br /&gt;
              Mike Chirico (mchirico@comcast.net mchirico@users.sourceforge.net)&lt;br /&gt;
&lt;br /&gt;
         So, to view this man page&lt;br /&gt;
&lt;br /&gt;
            $ man soup&lt;br /&gt;
&lt;br /&gt;
         It's also possible to compress&lt;br /&gt;
&lt;br /&gt;
            $ gzip /usr/local/man/man1/soup.1&lt;br /&gt;
&lt;br /&gt;
         For plenty of examples look at the other man pages. Also the following&lt;br /&gt;
         is helpful. The last one is a tutorial &amp;quot;man 7 mdoc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            $ man manpath&lt;br /&gt;
            $ man groff&lt;br /&gt;
            $ man 7 mdoc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 122:&lt;br /&gt;
&lt;br /&gt;
        dmesg - print out boot messages, or what is in the kernel ring buffer.&lt;br /&gt;
&lt;br /&gt;
          If you missed the messages on boot-up, you can use dmesg to print them.&lt;br /&gt;
&lt;br /&gt;
            $ dmesg &amp;gt; boot.msg&lt;br /&gt;
&lt;br /&gt;
          Or to print, then, clear the ring&lt;br /&gt;
&lt;br /&gt;
            # dmesg -c &amp;gt; boot.msg&lt;br /&gt;
&lt;br /&gt;
          (also see TIP 20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 123:&lt;br /&gt;
&lt;br /&gt;
        gnus - emacs email nntp news reader (comcast as example with NO TLS or SSL)&lt;br /&gt;
&lt;br /&gt;
          First check that you can connect to the news group:&lt;br /&gt;
&lt;br /&gt;
                 $ telnet newsgroups.comcast.net 119&lt;br /&gt;
                 Trying 216.196.97.136...&lt;br /&gt;
                 Connected to newsgroups.comcast.net.&lt;br /&gt;
                 Escape character is '^]'.&lt;br /&gt;
                 200 News.GigaNews.Com&lt;br /&gt;
&lt;br /&gt;
          If you want to check for TLS or SSL see (TIP 54).&lt;br /&gt;
&lt;br /&gt;
          Here is a very simple configuration example without encryption. It&lt;br /&gt;
          appears that comcast does not support ssl or TLS.&lt;br /&gt;
&lt;br /&gt;
          In the &amp;quot;~/.emacs&amp;quot; file you would add the following to get comcast&lt;br /&gt;
          news groups&lt;br /&gt;
&lt;br /&gt;
             (setq gnus-select-method '(nntp &amp;quot;newsgroups.comcast.net&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
          Then, create an &amp;quot;~/.authinfo&amp;quot; file with the following settings using&lt;br /&gt;
          you own username and password.&lt;br /&gt;
&lt;br /&gt;
             machine newsgroups.comcast.net login borkey@comcast.net  password borkeypass0rd&lt;br /&gt;
&lt;br /&gt;
          Next create a &amp;quot;~/.newsrc&amp;quot; with your groups&lt;br /&gt;
&lt;br /&gt;
             news.announce.newusers:&lt;br /&gt;
             comp.lang.c++.moderated! 1-500&lt;br /&gt;
             comp.unix.programmer! 1-500&lt;br /&gt;
             comp.unix.shell! 1-500&lt;br /&gt;
             gnu.emacs.gnus! 1-500&lt;br /&gt;
&lt;br /&gt;
          Finally, create a &amp;quot;~/.gnus&amp;quot; with the following email settings for you&lt;br /&gt;
&lt;br /&gt;
             (setq user-mail-address &amp;quot;mchirico@comcast.net&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
             (defun my-message-mode-setup ()&lt;br /&gt;
               (setq fill-column 72)&lt;br /&gt;
               (turn-on-auto-fill))&lt;br /&gt;
               (add-hook 'message-mode-hook 'my-message-mode-setup)&lt;br /&gt;
&lt;br /&gt;
          To get into gnus&lt;br /&gt;
&lt;br /&gt;
              E-x gnus&lt;br /&gt;
&lt;br /&gt;
          The following are common gnus commands&lt;br /&gt;
&lt;br /&gt;
                RET  view the article under the cursor&lt;br /&gt;
&lt;br /&gt;
                A A (shift-a, shift a): List all newsgroups known&lt;br /&gt;
                                        to the server.&lt;br /&gt;
&lt;br /&gt;
                l (lower-case L)      : List only  subscribed groups&lt;br /&gt;
                                        with unread articles.&lt;br /&gt;
&lt;br /&gt;
                L                     : List all newsgroups in .newsrc file.&lt;br /&gt;
&lt;br /&gt;
                g                     : See if new articles have arrived.&lt;br /&gt;
&lt;br /&gt;
            Some commands for reading&lt;br /&gt;
&lt;br /&gt;
                n  next unread article&lt;br /&gt;
&lt;br /&gt;
                p  previous article&lt;br /&gt;
&lt;br /&gt;
                SPC  scroll down  moves to next unread&lt;br /&gt;
                     when at the bottom of the article&lt;br /&gt;
&lt;br /&gt;
                del  scroll up&lt;br /&gt;
&lt;br /&gt;
                F  follow-up to group on the article you are&lt;br /&gt;
                   reading now.&lt;br /&gt;
&lt;br /&gt;
                f  follow-up to group without citing the article&lt;br /&gt;
&lt;br /&gt;
                R  reply by mail and cite the article&lt;br /&gt;
&lt;br /&gt;
                r  reply by mail without citing the article&lt;br /&gt;
&lt;br /&gt;
                m  new mail&lt;br /&gt;
&lt;br /&gt;
                a  new posting&lt;br /&gt;
&lt;br /&gt;
                c  Catchup&lt;br /&gt;
&lt;br /&gt;
                C-u / t  Show only young headers&lt;br /&gt;
                         / t without C-u limits the summary&lt;br /&gt;
                         to old headers&lt;br /&gt;
&lt;br /&gt;
                T T  toggle threading&lt;br /&gt;
&lt;br /&gt;
                C-u g  Display raw article&lt;br /&gt;
                       hit g to return to normal view&lt;br /&gt;
&lt;br /&gt;
                t  Show all headers  it's a toggle&lt;br /&gt;
&lt;br /&gt;
                W w  Wordwrap the current article&lt;br /&gt;
&lt;br /&gt;
                W r  Decode ROT13  a toggle&lt;br /&gt;
&lt;br /&gt;
                ^  fetch parent of article&lt;br /&gt;
&lt;br /&gt;
                L  create a scorefile-entry based&lt;br /&gt;
                   on the current article (low score)&lt;br /&gt;
                   ? gives you information what each char means&lt;br /&gt;
&lt;br /&gt;
                I  like L but high score&lt;br /&gt;
&lt;br /&gt;
          Commands to send email&lt;br /&gt;
&lt;br /&gt;
            C-c C-c  send message&lt;br /&gt;
&lt;br /&gt;
            C-c C-d  save message as draft&lt;br /&gt;
&lt;br /&gt;
            C-c C-k  kill message&lt;br /&gt;
&lt;br /&gt;
            C-c C-m f  attach file&lt;br /&gt;
&lt;br /&gt;
            M-q  reformat paragraph&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 124:&lt;br /&gt;
&lt;br /&gt;
        Sending Email from telnet&lt;br /&gt;
&lt;br /&gt;
           Note, if you are on the computer you can sometime use the local loopback.&lt;br /&gt;
           In fact, sometimes you can only use the local loop back 127.0.0.1 in&lt;br /&gt;
           place of &amp;quot;bozo.company.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            1     [mchirico@soup Notes]$ telnet bozo.company.com 25&lt;br /&gt;
            2     Trying 192.168.0.204...&lt;br /&gt;
            3     Connected to bozo.company.com.&lt;br /&gt;
            4     Escape character is '^]'.&lt;br /&gt;
            5     220 bozo.company.com ESMTP Postfix (Postfix-20010228-pl03) (Mandrake Linux)&lt;br /&gt;
            6     HELO fakedomain.com&lt;br /&gt;
            7     HELO fakedomain.com         // server echo&lt;br /&gt;
            8     250 bozo.company.com&lt;br /&gt;
            9     MAIL FROM: test@fakedomain.com&lt;br /&gt;
           10     MAIL FROM: test@fakedomain.com   // server echo&lt;br /&gt;
           11     250 Ok&lt;br /&gt;
           12     RCPT TO: mchirico@someother.com&lt;br /&gt;
           13     RCPT TO: mchirico@someother.com   // server echo&lt;br /&gt;
           14     250 Ok&lt;br /&gt;
           15     DATA&lt;br /&gt;
           16     DATA    // echo&lt;br /&gt;
           17     354 Enter mail, end with &amp;quot;.&amp;quot; on a line by itself&lt;br /&gt;
           18     This is a test message&lt;br /&gt;
           19     This is a test message&lt;br /&gt;
           20     to send&lt;br /&gt;
           21     to send&lt;br /&gt;
           22     .&lt;br /&gt;
           23     250 2.0.0 j0B0uH3L018469 Message accepted for delivery&lt;br /&gt;
&lt;br /&gt;
          Above on line 6 you can type in any domain name. Line 7 is an echo. All&lt;br /&gt;
          echos are listed in the comment field.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 125:&lt;br /&gt;
&lt;br /&gt;
          IP forwarding, IP Masquerade&lt;br /&gt;
&lt;br /&gt;
             # echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
             # ipchains -F forward&lt;br /&gt;
             # ipchains -P forward DENY&lt;br /&gt;
             # ipchains -A forward -s 192.168.0.0/24 -j MASQ&lt;br /&gt;
             # ipchains -A forward -i eth1 -j MASQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          This assumes that your internal network is 192.168.0.0 on eth1, and the&lt;br /&gt;
          internet is connected to eth0.&lt;br /&gt;
&lt;br /&gt;
          (Also See TIP 182)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 126:&lt;br /&gt;
&lt;br /&gt;
         Setting KDE as the default desktop manager&lt;br /&gt;
&lt;br /&gt;
               Edit &amp;quot;/etc/sysconfig/desktop&amp;quot; to include the two lines:&lt;br /&gt;
&lt;br /&gt;
                 DESKTOP=&amp;quot;KDE&amp;quot;&lt;br /&gt;
                 DISPLAYMANAGER=&amp;quot;KDE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 127:&lt;br /&gt;
&lt;br /&gt;
        Have a file and you do not know whay type it is (tar, gz, ASCII, binary) ?&lt;br /&gt;
        Use the file command.  Below it is used on the file &amp;quot;mftp&amp;quot;&lt;br /&gt;
&lt;br /&gt;
               $ file mftp&lt;br /&gt;
               mftp: Bourne-Again shell script text executable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 128:&lt;br /&gt;
&lt;br /&gt;
        Software RAID: Two good references&lt;br /&gt;
&lt;br /&gt;
          http://www.tldp.org/HOWTO/Software-RAID-HOWTO-1.html&lt;br /&gt;
          http://lists.us.dell.com/pipermail/linux-poweredge/2003-July/014331.html&lt;br /&gt;
&lt;br /&gt;
        Note, you must setup grub for each RAID 1 device. Suppose you have&lt;br /&gt;
        2 SCSI drives (sda and sdb). By default grub is setup on sda; but, you&lt;br /&gt;
        need to enable it for sdb (/dev/hdb for ide) as follows:&lt;br /&gt;
&lt;br /&gt;
           grub&amp;gt;device (hd0) /dev/sdb&lt;br /&gt;
           grub&amp;gt;root (hd0,0)&lt;br /&gt;
           grub&amp;gt;setup (hd0)&lt;br /&gt;
&lt;br /&gt;
           Checking if &amp;quot;/boot/grub/stage1&amp;quot; exists... no&lt;br /&gt;
           Checking if &amp;quot;/grub/stage1&amp;quot; exists... yes&lt;br /&gt;
           Checking if &amp;quot;/grub/stage2&amp;quot; exists... yes&lt;br /&gt;
           Checking if &amp;quot;/grub/e2fs_stage1_5&amp;quot; exists.. yes&lt;br /&gt;
           Running &amp;quot;embed /grub/e2fs_stage1_5 (hd0)&amp;quot;... 16 sectors are embedded.&lt;br /&gt;
          succeeded&lt;br /&gt;
           Running &amp;quot;install /grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/grub/stage2 /grub/grub&lt;br /&gt;
         .conf&amp;quot;... succeeded.&lt;br /&gt;
         Done.&lt;br /&gt;
&lt;br /&gt;
          grub&amp;gt;&lt;br /&gt;
          grub&amp;gt;quit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Checking to see if everything is working:&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
        Checking the drives&lt;br /&gt;
&lt;br /&gt;
          $ sfdisk -d /dev/sdb&lt;br /&gt;
          $ sfdisk -d /dev/sda&lt;br /&gt;
&lt;br /&gt;
          $ fdisk -l /dev/sda  &amp;quot;This will give general information&amp;quot;&lt;br /&gt;
          $ fdisk -l           &amp;quot;General information for all drives&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Adding raid (assume you want to add the first drive &amp;quot;sda1&amp;quot;, or if it is the second&lt;br /&gt;
                    drive then substitute &amp;quot;sda2&amp;quot; below )&lt;br /&gt;
&lt;br /&gt;
          $ raidhotadd /dev/md0 /dev/sda1&lt;br /&gt;
          $ raidhotadd /dev/md1 /dev/sda2&lt;br /&gt;
          $ raidhotadd /dev/md2 /dev/sda3&lt;br /&gt;
&lt;br /&gt;
        This is an example of an cat /proc/mdstat that is working. Note that&lt;br /&gt;
        there is a listing for both sda1[0] and sdb1[1]&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
                Personalities : [raid1]&lt;br /&gt;
                read_ahead 1024 sectors&lt;br /&gt;
                Event: 12&lt;br /&gt;
                md0 : active raid1 sda1[0] sdb1[1]&lt;br /&gt;
                      104320 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md1 : active raid1 sda2[0] sdb2[1]&lt;br /&gt;
                      1044160 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md2 : active raid1 sda3[0] sdb3[1]&lt;br /&gt;
                      34411136 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        Compare that to this where md2 is missing sdb3&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
                Personalities : [raid1]&lt;br /&gt;
                read_ahead 1024 sectors&lt;br /&gt;
                Event: 9&lt;br /&gt;
                md0 : active raid1 sda1[0] sdb1[1]&lt;br /&gt;
                      104320 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md1 : active raid1 sda2[0] sdb2[1]&lt;br /&gt;
                      1044160 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md2 : active raid1 sdb3[1]        &amp;lt;---- HERE&lt;br /&gt;
                      34411136 blocks [2/1] [_U]&lt;br /&gt;
&lt;br /&gt;
                unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        If you are rebuilding an array, you can watch it by doing the following:&lt;br /&gt;
&lt;br /&gt;
           $ watch -n1 cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
        Need to know the raid setup?&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/raidtab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 129:&lt;br /&gt;
&lt;br /&gt;
        Resetting Redhat Linux Passwords using GRUB&lt;br /&gt;
&lt;br /&gt;
           1. Press 'e'&lt;br /&gt;
           2. Press 'e' again&lt;br /&gt;
           3. Append 'single' to the kernel version listing&lt;br /&gt;
&lt;br /&gt;
          See&lt;br /&gt;
             http://linuxgazette.net/107/tomar.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 130:&lt;br /&gt;
&lt;br /&gt;
        mtr - matt's traceroute. This is an advanced traceroute that keeps&lt;br /&gt;
              [http://www.bitwizard.nl/mtr/]&lt;br /&gt;
                  $ mtr www.yahoo.com&lt;br /&gt;
&lt;br /&gt;
                                              Matt's traceroute  [v0.52]&lt;br /&gt;
                     third-fl-71.localdomain                            Thu Jan 20 11:05:57 2005&lt;br /&gt;
                     Keys:  D - Display mode    R - Restart statistics    Q - Quit&lt;br /&gt;
                                                            Packets               Pings&lt;br /&gt;
                     Hostname                            %Loss  Rcv  Snt  Last Best  Avg  Worst&lt;br /&gt;
                      1. 192.168.1.1                        0%    3    3     0    0    0      1&lt;br /&gt;
                      2. ???&lt;br /&gt;
                      3. fe-2-6-rr01.willogrove5.pa.pa01    0%    3    3     8    7    7      8&lt;br /&gt;
                      4. srp-8-1-ar01.willowgrove1.pa.pa    0%    2    2     8    8    8      8&lt;br /&gt;
                      5. pos7-3-cr01.torresdale.pa.core.    0%    2    2     8    8    8      8&lt;br /&gt;
                      6. 12.119.53.53                       0%    2    2    12   12   12     13&lt;br /&gt;
                      7. tbr1-p012401.phlpa.ip.att.net      0%    2    2    12   12   13     13&lt;br /&gt;
                      8. tbr1-cl8.n54ny.ip.att.net          0%    2    2    13   13   13     13&lt;br /&gt;
                      9. ggr2-p310.n54ny.ip.att.net         0%    2    2    12   12   13     14&lt;br /&gt;
                     10. so-1-0-0.gar4.NewYork1.Level3.n    0%    2    2    14   14   37     61&lt;br /&gt;
                     11. ae-1-54.bbr2.NewYork1.Level3.ne    0%    2    2    13   12   13     13&lt;br /&gt;
                     12. ge-0-3-0.bbr2.Washington1.Level    0%    2    2    19   19   19     19&lt;br /&gt;
                     13. ge-1-1-51.car1.Washington1.Leve    0%    2    2    18   18   19     20&lt;br /&gt;
                     14. 4.79.228.6                         0%    2    2    21   19   20     21&lt;br /&gt;
                     15. UNKNOWN-216-109-120-201.yahoo.c    0%    2    2    21   20   20     21&lt;br /&gt;
                     16. w2.rc.vip.dcn.yahoo.com            0%    2    2    23   21   22     23&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 131:&lt;br /&gt;
&lt;br /&gt;
        chfn - change finger information&lt;br /&gt;
&lt;br /&gt;
            $ chfn&lt;br /&gt;
&lt;br /&gt;
          Next you are asked for a password and user information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 132:&lt;br /&gt;
&lt;br /&gt;
        chsh - change login shell&lt;br /&gt;
&lt;br /&gt;
          First, you may want to get a listing of all the possible&lt;br /&gt;
          shells.&lt;br /&gt;
&lt;br /&gt;
             $ chsh -l&lt;br /&gt;
&lt;br /&gt;
               /bin/sh&lt;br /&gt;
               /bin/bash&lt;br /&gt;
               /sbin/nologin&lt;br /&gt;
               /bin/ash&lt;br /&gt;
               /bin/bsh&lt;br /&gt;
               /bin/ksh&lt;br /&gt;
               /usr/bin/ksh&lt;br /&gt;
               /usr/bin/pdksh&lt;br /&gt;
               /bin/tcsh&lt;br /&gt;
               /bin/csh&lt;br /&gt;
               /bin/zsh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 133:&lt;br /&gt;
&lt;br /&gt;
        bash - working with binary, hex and base 3.&lt;br /&gt;
&lt;br /&gt;
         For the variable must be declare as an integer. Then&lt;br /&gt;
         specify the  &amp;lt;base&amp;gt;#&amp;lt;value&amp;gt;. The example below is 22 in&lt;br /&gt;
         base 3.&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n&lt;br /&gt;
              $ n=3#22&lt;br /&gt;
              $ echo $n&lt;br /&gt;
                8&lt;br /&gt;
&lt;br /&gt;
           Base 16 (hex)&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n2&lt;br /&gt;
              $ n2=16#a&lt;br /&gt;
              $ echo $n2&lt;br /&gt;
                10&lt;br /&gt;
&lt;br /&gt;
           Base 8 (octal)&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n3&lt;br /&gt;
              $ n3=8#11&lt;br /&gt;
              $ echo $n3&lt;br /&gt;
                9   Note 8+1=9&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 134:&lt;br /&gt;
&lt;br /&gt;
        monitoring IP traffic. Try iptraf http://iptraf.seul.org/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 135:&lt;br /&gt;
&lt;br /&gt;
        enscript - convert text files to PostScript&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 136:&lt;br /&gt;
&lt;br /&gt;
        dd and tar - blocking factor. How to determine the blocking factor, block size&lt;br /&gt;
                   so that tar and dd can work together.&lt;br /&gt;
&lt;br /&gt;
        Step 1: Create a large file on local disk, in a directory &amp;quot;1&amp;quot; that will eventually&lt;br /&gt;
                be written to tape. This will be created with dd as follows:&lt;br /&gt;
&lt;br /&gt;
                $ mkdir 1&lt;br /&gt;
                $ dd if=/dev/zero of=disk-image count=40960&lt;br /&gt;
                  40960+0 records in&lt;br /&gt;
                  40960+0 records out&lt;br /&gt;
&lt;br /&gt;
                $ cd ..&lt;br /&gt;
&lt;br /&gt;
        Step 2: tar the directory and contents to tape. First rewind the tape. These examples&lt;br /&gt;
                use /dev/nst0 as the location of the tape. Make sure to substitute your values&lt;br /&gt;
                if needed.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ tar --label=&amp;quot;Test 1&amp;quot; --create --blocking-factor=128 --file=/dev/nst0 1&lt;br /&gt;
&lt;br /&gt;
        Step 3: Read data from the tape using a block size of 128k. If you get an I/O error, which&lt;br /&gt;
                could happend if you used a different blocking factor above, then, you may need&lt;br /&gt;
                to increase the bs to 256, or 512 etc. as needed.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=/dev/nst0 bs=128k of=testblocksz count=1&lt;br /&gt;
                 0+1 records in&lt;br /&gt;
                 0+1 records out&lt;br /&gt;
&lt;br /&gt;
                $ ls -l testblocksz&lt;br /&gt;
                 -rw-r--r--    1 root     root        65536 Feb  9 10:41 testblocksz&lt;br /&gt;
&lt;br /&gt;
                $ ls -lh testblocksz&lt;br /&gt;
                 -rw-r--r--    1 root     root          64k Feb  9 10:41 testblocksz&lt;br /&gt;
&lt;br /&gt;
               Note above that the size 65536 is equal to 64k. That &amp;quot;h&amp;quot; switch in &amp;quot;ls&amp;quot; is for&lt;br /&gt;
               human readable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 4: tar uses a multiplier of 512*blocking-factor to get block size. Again&lt;br /&gt;
&lt;br /&gt;
                 512 * blocking-factor = block size used in dd command.&lt;br /&gt;
&lt;br /&gt;
              Putting in the values, we see that&lt;br /&gt;
&lt;br /&gt;
                 512 * 128 = 65536&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 5: So what does this tell you? You can now use these numbers to &amp;quot;dd&amp;quot; files&lt;br /&gt;
              to tape. But, first tar will be used to create the file locally.&lt;br /&gt;
&lt;br /&gt;
                $ tar --label=&amp;quot;Test 1&amp;quot; --create --blocking-factor=128 --file=test.tar 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 6: Send this to tape with the dd command. Remember 64k is equal to 65536.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=test.tar bs=64k of=/dev/nst0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 7: Now test that it can be read with tar command using blocking-factor=128.&lt;br /&gt;
             Note the &amp;quot;t&amp;quot; command in tar is for tell. It will not write data.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ tar -tvf /dev/nst0 --blocking-factor=128&lt;br /&gt;
                 V--------- 0/0               0 2005-02-09 10:38:20 Test 1--Volume Header--&lt;br /&gt;
                 drwxr-xr-x root/root         0 2005-02-09 10:34:10 1/&lt;br /&gt;
                 -rw-r--r-- root/root  20971520 2005-02-09 10:34:11 1/disk-image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 8: Reading tape data with dd. Most of the time a high &amp;quot;ibs&amp;quot; input block size&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=/dev/nst0 of=outfromdd.tar ibs=64k&lt;br /&gt;
                 321+0 records in&lt;br /&gt;
                 41088+0 records out&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 9: Verify that outfromdd.tar can be read by tar with blocking-factor=128&lt;br /&gt;
&lt;br /&gt;
                $ tar -tvf outfromdd.tar --blocking-factor=128&lt;br /&gt;
                 V--------- 0/0               0 2005-02-09 10:38:20 Test 1--Volume Header--&lt;br /&gt;
                 drwxr-xr-x root/root         0 2005-02-09 10:34:10 1/&lt;br /&gt;
                 -rw-r--r-- root/root  20971520 2005-02-09 10:34:11 1/disk-image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       PULLING FILES:  The dd command can be used to pull files.&lt;br /&gt;
&lt;br /&gt;
              ssh target_address dd if=remotefile | dd of=localfile&lt;br /&gt;
&lt;br /&gt;
           Or, a specific example of getting a file from a computer called hamlet.&lt;br /&gt;
&lt;br /&gt;
              $ ssh root@hamlet  dd if=/home/cvs/test | dd of=/home/storage/test&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        GOING BACKWARD AND FORWARD ON TAPE:&lt;br /&gt;
&lt;br /&gt;
             Go to end of data&lt;br /&gt;
              $ mt -f /dev/nst0  eod&lt;br /&gt;
&lt;br /&gt;
             Previous record&lt;br /&gt;
              $ mt -f /dev/nst0  bsfm 1&lt;br /&gt;
&lt;br /&gt;
             Forward record&lt;br /&gt;
              $ mt -f /dev/nst0  fsf 1&lt;br /&gt;
&lt;br /&gt;
             Rewind&lt;br /&gt;
              $ mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
             Tell&lt;br /&gt;
              $ mt -f /dev/nst0 tell&lt;br /&gt;
&lt;br /&gt;
         (Reference TIP 151 - for how to get around firewalls)&lt;br /&gt;
&lt;br /&gt;
         Below is a script that I use to backup computers via ssh. The&lt;br /&gt;
         tape drive is on &amp;quot;nis&amp;quot; and the extra space is on &amp;quot;hamlet&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                #!/bin/bash&lt;br /&gt;
                # Program to backup server remotely&lt;br /&gt;
                # Assume remote server is nis, you are on squeezel&lt;br /&gt;
                #&lt;br /&gt;
                # Recover from tape&lt;br /&gt;
                #&lt;br /&gt;
                #   dd if=/dev/nst0 of=test.tar.gz bs=64k&lt;br /&gt;
                #&lt;br /&gt;
                filename=&amp;quot;support1.$(date &amp;quot;+%m%d%y%H%M&amp;quot;).tar.gz&amp;quot;&lt;br /&gt;
                DIRTOBACKUP=/var/www&lt;br /&gt;
                #tar cvzf - $DIRTOBACKUP | ssh  root@nis  '(mt -f /dev/nst0 rewind; dd of=/dev/nst0 bs=64k )'&lt;br /&gt;
                tar cvzf - $DIRTOBACKUP | ssh  support1@hamlet &amp;quot;dd of=/home/support1/backups/${filename} &amp;quot;&lt;br /&gt;
&lt;br /&gt;
         Another example program, below, pushes the last &amp;quot;.tar.gz&amp;quot; file to tape:&lt;br /&gt;
&lt;br /&gt;
                #!/bin/bash&lt;br /&gt;
                # Program to push files to tape&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                # Notes on recovering from tape&lt;br /&gt;
                #&lt;br /&gt;
                #   dd if=/dev/nst0 of=test.tar.gz ibs=64k&lt;br /&gt;
                #    or&lt;br /&gt;
                #  $ ssh root@tapeserver &amp;quot;mt -f /dev/nst0 rewind&amp;quot;&lt;br /&gt;
                #  $ ssh root@tapeserver &amp;quot;dd if=/dev/nst0 ibs=64k&amp;quot;|dd of=cvs1.tar.gz&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                # First rewind tape&lt;br /&gt;
                ssh root@tapeserver 'mt -f /dev/nst0 rewind'&lt;br /&gt;
                #&lt;br /&gt;
                # Grab only the last file&lt;br /&gt;
                file=$(find /home/cvs  -iname 'cvs*.tar.gz'|sort|tail -n 1)&lt;br /&gt;
                dd if=${file}|ssh root@tapeserver 'dd of=/dev/nst0 bs=64k'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 137:&lt;br /&gt;
&lt;br /&gt;
        Apache - redirecting pages. All changes are in httpd.conf&lt;br /&gt;
&lt;br /&gt;
               RedirectMatch (.*)\.gif$ http://www.anotherserver.com$1.jpg&lt;br /&gt;
&lt;br /&gt;
               Redirect /service http://foo2.bar.com/service&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 138:&lt;br /&gt;
&lt;br /&gt;
        samba mounts via ssh - mounting a samba share through an ssh tunnel, going&lt;br /&gt;
               through an intermediate computer, that accepts ssh. We'll call this&lt;br /&gt;
               intermediate computer middle [65.219.4.23], and we want to get to&lt;br /&gt;
               destination [192.168.0.81]. The user will be mchirico.&lt;br /&gt;
&lt;br /&gt;
          STEP 1:&lt;br /&gt;
&lt;br /&gt;
               $ mkdir -p /samba/share&lt;br /&gt;
&lt;br /&gt;
          STEP 2:&lt;br /&gt;
&lt;br /&gt;
            This has to be done as root, since we are using a lower port.&lt;br /&gt;
&lt;br /&gt;
               $ ssh -N -L 139:192.168.0.81:139 mchirico@65.219.4.23&lt;br /&gt;
&lt;br /&gt;
          STEP 3:&lt;br /&gt;
&lt;br /&gt;
              umount /samba/sales&lt;br /&gt;
              /bin/mount -t smbfs -o  username=donkey,workgroup=donkeydomain,&lt;br /&gt;
                      password=passw0rk1,port=139,dmask=770,fmask=660,&lt;br /&gt;
                      netbiosname=homecpu //localhost/share /samba/share&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 139:&lt;br /&gt;
&lt;br /&gt;
        Music on Fedora Core -- How to play music on http://magnatune.com with &amp;quot;xmms&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           The following command will show the sound driver:&lt;br /&gt;
&lt;br /&gt;
              $ lspci|grep -i audio&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          STEP 1:&lt;br /&gt;
&lt;br /&gt;
                Unmute amixer with the following command:&lt;br /&gt;
&lt;br /&gt;
              $ amixer set Master 100% unmute&lt;br /&gt;
              $ amixer set PCM 100%  unmute&lt;br /&gt;
&lt;br /&gt;
                Note you can also get a graphical interface with &amp;quot;alsamixer&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              $ alsamixer&lt;br /&gt;
&lt;br /&gt;
                 h,F1   -- for help&lt;br /&gt;
                 Esc    -- exit&lt;br /&gt;
                 Tab    -- move to selections&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          STEP 2:&lt;br /&gt;
&lt;br /&gt;
                Test a sound file &amp;quot;*.au&amp;quot; with aplay. To quickly find files on your system use&lt;br /&gt;
                the &amp;quot;locate *.au&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
                  $ aplay /usr/lib/python2.3/test/audiotest.au&lt;br /&gt;
&lt;br /&gt;
          STEP 3:&lt;br /&gt;
&lt;br /&gt;
                Install &amp;quot;xmms-mp3-1.2.10-9.2.1.fc3.rf.i386.rpm&amp;quot; which does not come with Fedora because&lt;br /&gt;
                of GPL license restrictions.  The latest version of this package can be found&lt;br /&gt;
                at the following url:&lt;br /&gt;
&lt;br /&gt;
                  http://rpmseek.com/rpm-pl/xmms-mp3.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                  $ rpm -ivh xmms-mp3-1.2.10-9.2.1.fc3.rf.i386.rpm&lt;br /&gt;
&lt;br /&gt;
          STEP 4:&lt;br /&gt;
&lt;br /&gt;
                Go to magnatun &amp;quot;http://magnatune.com/&amp;quot;, select genre and make sure xmms&lt;br /&gt;
                is the default player.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 140:&lt;br /&gt;
&lt;br /&gt;
        Routing -- getting access to a network 1 hop away. You are currently on the 192 network&lt;br /&gt;
                   and you want access to the 172.21.0.0 network that has a computer straddling&lt;br /&gt;
                   the two, with /proc/sys/net/ipv4/ip_forward set to 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               $ route add -net 172.21.0.0 netmask 255.255.255.0 gw 192.168.0.204&lt;br /&gt;
&lt;br /&gt;
         To undo:&lt;br /&gt;
&lt;br /&gt;
               $ route del -net 172.21.0.0 netmask 255.255.255.0 gw 192.168.0.204&lt;br /&gt;
&lt;br /&gt;
         Now you can ping 172.21.0.21.&lt;br /&gt;
&lt;br /&gt;
         Does not work?&lt;br /&gt;
&lt;br /&gt;
         Go on to 192.168.0.204 and execute the following commands:&lt;br /&gt;
&lt;br /&gt;
               $ echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
               $ cat /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
               1&lt;br /&gt;
&lt;br /&gt;
         To Look at the the gateway, execute the following command.&lt;br /&gt;
&lt;br /&gt;
               $ netstat -r&lt;br /&gt;
&lt;br /&gt;
         References: &lt;br /&gt;
&lt;br /&gt;
               http://lartc.org/lartc.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 141:&lt;br /&gt;
&lt;br /&gt;
        RAM disk -- creating a filesystem in RAM.&lt;br /&gt;
&lt;br /&gt;
               $ mkfs -t ext3 -q /dev/ram1 4096&lt;br /&gt;
               $ mkdir -p /fsram&lt;br /&gt;
               $ mount /dev/ram1 /fsram -o defaults,rw&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 142:&lt;br /&gt;
&lt;br /&gt;
        Create a Live Linux CDROM  using  BusyBox and OpenSSH.&lt;br /&gt;
&lt;br /&gt;
            These steps are rather long. A complete tutorial is given at&lt;br /&gt;
            the following link:&lt;br /&gt;
             http://prdownloads.sourceforge.net/souptonuts/instructions_boot_system.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 143:&lt;br /&gt;
&lt;br /&gt;
      SystemImager (http://www.systemimager.org/) SystemImager is software that automates Linux installs,&lt;br /&gt;
                       software distribution, and production deployment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 144:&lt;br /&gt;
&lt;br /&gt;
      Mounted a filesystem in rescue mode, yet, you cannot read and write?  Remount.&lt;br /&gt;
&lt;br /&gt;
             $ mount -o remount /&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 145:&lt;br /&gt;
&lt;br /&gt;
      Nmap commands to check for Microsoft VPN connection.&lt;br /&gt;
&lt;br /&gt;
         $ nmap -sO -p 47 vpn1.someserver.com&lt;br /&gt;
         $ nmap -sS -p T:1723 vpn1.someserver.com&lt;br /&gt;
&lt;br /&gt;
      By the way, with nmap you can specify multiple ports. Below&lt;br /&gt;
      is an example of multiple ports; but, use the commands above&lt;br /&gt;
      for Microsoft VPN services.&lt;br /&gt;
&lt;br /&gt;
         $ nmap -sS -p T:1723-3000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 146:&lt;br /&gt;
&lt;br /&gt;
      Perl and ssh - monitoring systems. The output from ssh can be parsed. Below is&lt;br /&gt;
      a simple procedure to just to read the ssh ouput into perl.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #&lt;br /&gt;
          $pid = open $readme, &amp;quot;ssh root\@hamlet df -lh|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
          while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
           print $_&lt;br /&gt;
          }&lt;br /&gt;
          close $readme&lt;br /&gt;
&lt;br /&gt;
      But note, you probably want to do something more complex. Below is a more robust&lt;br /&gt;
      example that bypassed all the fortune, heading junk that you may encounter when&lt;br /&gt;
      logging in.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #&lt;br /&gt;
          $pid = open $readme, &amp;quot;ssh root\@hamlet df -lh 2&amp;gt;/dev/null|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
          while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
           print $_&lt;br /&gt;
          }&lt;br /&gt;
          close $readme&lt;br /&gt;
&lt;br /&gt;
      NO! you CANNOT do bidirectional communication with the open statement. Note the &amp;quot;|&amp;quot; before&lt;br /&gt;
      and after below, which cannot be done.&lt;br /&gt;
&lt;br /&gt;
          # Cannot do this!&lt;br /&gt;
          $pid = open $readme, &amp;quot;|ssh root\@hamlet df -lh 2&amp;gt;/dev/null|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
      Below is a simple Perl example working with arrays:&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          @ArrayOfArray = (&lt;br /&gt;
                   [ &amp;quot;ant&amp;quot;, &amp;quot;bee&amp;quot; ],&lt;br /&gt;
                   [ &amp;quot;mouse&amp;quot;, &amp;quot;mole&amp;quot;, &amp;quot;rat&amp;quot; ],&lt;br /&gt;
                   [ &amp;quot;duck&amp;quot;, &amp;quot;goose&amp;quot;, &amp;quot;flamingo&amp;quot; ],&lt;br /&gt;
                   [  &amp;quot;rose&amp;quot;,&amp;quot;carnation&amp;quot;,&amp;quot;sunflower&amp;quot;],&lt;br /&gt;
                  );&lt;br /&gt;
&lt;br /&gt;
          for $i ( 0 .. $#ArrayOfArray ) {&lt;br /&gt;
              for $j ( 0 .. $#{$ArrayOfArray[$i]} ) {&lt;br /&gt;
                  print &amp;quot;Element $i $j is $ArrayOfArray[$i][$j]\n&amp;quot;;&lt;br /&gt;
              }&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          # Or this is another way to list elements&lt;br /&gt;
          foreach( @ArrayOfArray ) {&lt;br /&gt;
             foreach $i (0..$#$_) {&lt;br /&gt;
                print &amp;quot;$_-&amp;gt;[$i] &amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
             print &amp;quot;\n&amp;quot;;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Below is an example of working with Hash of Arrays:&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #  ./program &amp;lt; /etc/passwd&lt;br /&gt;
          while(&amp;lt;&amp;gt;){&lt;br /&gt;
              next unless s/^(.*?):\s*//;&lt;br /&gt;
              $HoA{$1} = [ split(/:/) ];&lt;br /&gt;
          }&lt;br /&gt;
          for $i (keys %HoA ) {&lt;br /&gt;
              print &amp;quot;$i: @{ $HoA{$i} } \n&amp;quot;;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
      Example of regular expression. This is my most used regular expression - I like&lt;br /&gt;
      this sample. See the &amp;quot;www.unix.org.ua&amp;quot; link at the end of this tip.&lt;br /&gt;
&lt;br /&gt;
          &amp;quot;hot cross buns&amp;quot; =~ /cross/;&lt;br /&gt;
          print &amp;quot;Matched: &amp;lt;$`&amp;gt; $&amp;amp; &amp;lt;$'&amp;gt;\n&amp;quot;;    # Matched: &amp;lt;hot &amp;gt; cross &amp;lt; buns&amp;gt;&lt;br /&gt;
          print &amp;quot;Left:    &amp;lt;$`&amp;gt;\n&amp;quot;;            # Left:    &amp;lt;hot &amp;gt;&lt;br /&gt;
          print &amp;quot;Match:   &amp;lt;$&amp;amp;&amp;gt;\n&amp;quot;;            # Match:   &amp;lt;cross&amp;gt;&lt;br /&gt;
          print &amp;quot;Right:   &amp;lt;$'&amp;gt;\n&amp;quot;;            # Right:   &amp;lt; buns&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      If you're looking for Perl information, type &amp;quot;man perl&amp;quot;, which will show you how&lt;br /&gt;
      to get even more information. Or better yet, take a look at the following&lt;br /&gt;
      link:&lt;br /&gt;
&lt;br /&gt;
          http://www.unix.org.ua/orelly/perl/prog3/ch09_01.htm&lt;br /&gt;
               also&lt;br /&gt;
          http://www.stonehenge.com/merlyn/UnixReview/&lt;br /&gt;
&lt;br /&gt;
      For a quick example on using Perl with SQLite, see the following links:&lt;br /&gt;
&lt;br /&gt;
          http://prdownloads.sourceforge.net/souptonuts/README_sqlite_tutorial.html?download&lt;br /&gt;
            or&lt;br /&gt;
          http://freshmeat.net/articles/view/1428/&lt;br /&gt;
            or&lt;br /&gt;
          http://www.perl.com/pub/a/1999/09/refererents.html&lt;br /&gt;
&lt;br /&gt;
      Standard input for files. This example will read from stdin, or open a file if given as&lt;br /&gt;
      an argument, and convert all &amp;quot;&amp;lt;&amp;quot; to &amp;quot;&amp;amp;lt;&amp;quot; and &amp;quot;&amp;gt;&amp;quot; to &amp;quot;&amp;amp;gt;&amp;quot;, which can be handy when&lt;br /&gt;
      converting text files to html files. Note the &amp;quot;while(&amp;lt;&amp;gt;)&amp;quot; will take multiple file names&lt;br /&gt;
      on the command line.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          while(&amp;lt;&amp;gt;) {&lt;br /&gt;
             s/&amp;amp;amp;/&amp;amp;amp;amp;/g;&lt;br /&gt;
             s/&amp;amp;lt;/&amp;amp;amp;lt;/g;&lt;br /&gt;
             s/&amp;amp;gt;/&amp;amp;amp;gt;/g;&lt;br /&gt;
             s/&amp;lt;/&amp;amp;lt;/g;&lt;br /&gt;
             s/&amp;gt;/&amp;amp;gt;/g;&lt;br /&gt;
             print;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
      Perl Debugger is very useful for testing commands and works like an interpreter, just&lt;br /&gt;
      like python. So to get into the Perl Debugger execute the command below, &amp;quot;q&amp;quot; to quit.&lt;br /&gt;
&lt;br /&gt;
          $ perl -de 0&lt;br /&gt;
&lt;br /&gt;
      Reference TIP 170&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 147:&lt;br /&gt;
&lt;br /&gt;
      Shutdown&lt;br /&gt;
&lt;br /&gt;
          # shutdown 8:00 -- Shutdown at 8:00&lt;br /&gt;
&lt;br /&gt;
          # shutdown +13  -- Shutdown after 13min&lt;br /&gt;
&lt;br /&gt;
          # shutdown -r now  -- Shutdown now and restart&lt;br /&gt;
&lt;br /&gt;
          # shutdown -k +2  -- &amp;quot;The system is going DOWN to maintenance mode in 2 minutes!&amp;quot;&lt;br /&gt;
                              The above is only a warning.&lt;br /&gt;
&lt;br /&gt;
          # shutdown -h now   -- Shutdown now and halt&lt;br /&gt;
&lt;br /&gt;
          # shutdown -c    -- Cancel shutdown&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 148:&lt;br /&gt;
&lt;br /&gt;
      ac -  print statistics about users connect time&lt;br /&gt;
&lt;br /&gt;
          $ ac -p    -- print hour usage by user (individual)&lt;br /&gt;
          $ ac -dy   -- print daily usage&lt;br /&gt;
&lt;br /&gt;
       Options can also be combined&lt;br /&gt;
&lt;br /&gt;
          $ ac -dyp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 149:&lt;br /&gt;
&lt;br /&gt;
      Smart Monitoring Tools:&lt;br /&gt;
      Disk failing? Or want to know the temperature of your hard-drive?&lt;br /&gt;
&lt;br /&gt;
         http://smartmontools.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
      For a good, quick tutorial, see the Linux Journal article&lt;br /&gt;
        http://www.linuxjournal.com/article/6983&lt;br /&gt;
&lt;br /&gt;
      Below are some common commands:&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -i /dev/hda&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -Hc /dev/hda&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -A /dev/hda&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 150:&lt;br /&gt;
&lt;br /&gt;
      Monitor dhcp trafic - dhcpdump and tcpdump.&lt;br /&gt;
&lt;br /&gt;
      Download dhcpdump&lt;br /&gt;
&lt;br /&gt;
         $ wget  http://voxel.dl.sourceforge.net/sourceforge/mavetju/dhcpdump-1.5.tar.gz&lt;br /&gt;
         $ ./configure&lt;br /&gt;
         $ make &amp;amp;&amp;amp; make install&lt;br /&gt;
&lt;br /&gt;
     Once it's installed, you can monitor all dhcp traffic as follows, if done with root.&lt;br /&gt;
&lt;br /&gt;
         $ tcpdump -lenx -i eth0 -s 1500 port bootps or port bootpc| dhcpdump&lt;br /&gt;
&lt;br /&gt;
     The above assumes you are using eth0 (ethernet port 0).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 151:&lt;br /&gt;
&lt;br /&gt;
      Breaking Firewalls with ssh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      A sample .ssh/config file (note this must have chmod 600 rights)&lt;br /&gt;
&lt;br /&gt;
           ## Server1 ##&lt;br /&gt;
           Host 130.21.19.227&lt;br /&gt;
               LocalForward 20000 192.168.0.66:80&lt;br /&gt;
               LocalForward 22000 192.168.0.66:22&lt;br /&gt;
&lt;br /&gt;
      With the above &amp;quot;~/.ssh/config&amp;quot; file, after sshing into 130.21.19.227 it&lt;br /&gt;
      is then possible to ssh into nearby computers directly.&lt;br /&gt;
&lt;br /&gt;
         $ ssh -l mchirico 130.21.19.227&lt;br /&gt;
         $ scp -P 22000 authorized_keys* mchirico@localhost:.&lt;br /&gt;
         $ ssh -l mchirico localhost -p 22000&lt;br /&gt;
&lt;br /&gt;
      For the complete article reference the following link:&lt;br /&gt;
        http://souptonuts.sourceforge.net/sshtips.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 152:&lt;br /&gt;
&lt;br /&gt;
      Renaming files - suppose you want to rename all the &amp;quot;.htm&amp;quot; files to &amp;quot;.html&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          $ rename .htm .html *.htm&lt;br /&gt;
&lt;br /&gt;
      Or, suppose you files file1, file2, file3 ...&lt;br /&gt;
&lt;br /&gt;
          $ touch file1 file2 file3 file4 file5 file6&lt;br /&gt;
          $ rename file file. file*&lt;br /&gt;
&lt;br /&gt;
      The above command will give you &amp;quot;file.1&amp;quot;, &amp;quot;file.2&amp;quot; ... &amp;quot;file.6&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 153:&lt;br /&gt;
&lt;br /&gt;
      Renaming files with Perl - this is taken from &amp;quot;Programming Perl 3rd Edition&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          # rename - change filenames&lt;br /&gt;
          $op = shift;&lt;br /&gt;
          for (@ARGV) {&lt;br /&gt;
              $was = $_;&lt;br /&gt;
              eval $op;&lt;br /&gt;
              die if $@;&lt;br /&gt;
              # next line calls built-in function, not the script&lt;br /&gt;
              rename($was,$_) unless $was eq $_;&lt;br /&gt;
           }&lt;br /&gt;
&lt;br /&gt;
      The above Perl program can be used as follows:&lt;br /&gt;
&lt;br /&gt;
           $ rename 's/\.orig$//'    *.orig&lt;br /&gt;
           $ rename 'y/A-Z/a-z/ unless /^Make/' *&lt;br /&gt;
&lt;br /&gt;
      Also reference:&lt;br /&gt;
           http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 154:&lt;br /&gt;
&lt;br /&gt;
      R project (http://www.r-project.org)&lt;br /&gt;
&lt;br /&gt;
      To start R, just type &amp;quot;R&amp;quot; at the command prompt and &amp;quot;q()&amp;quot; to quit. Below&lt;br /&gt;
      2 is raised to powers 0 through 6 and thrown into an array.&lt;br /&gt;
&lt;br /&gt;
           $ R&lt;br /&gt;
           &amp;gt; N &amp;lt;- 2^(0:6)&lt;br /&gt;
           &amp;gt; N&lt;br /&gt;
           [1]  1  2  4  8 16 32 64&lt;br /&gt;
           &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      There is a summary summary() command.&lt;br /&gt;
&lt;br /&gt;
           &amp;gt; summary(N)&lt;br /&gt;
           Min. 1st Qu.  Median    Mean 3rd Qu.    Max.&lt;br /&gt;
           1.00    3.00    8.00   18.14   24.00   64.00&lt;br /&gt;
&lt;br /&gt;
      Note that the array begins as 1 and not 0&lt;br /&gt;
&lt;br /&gt;
           &amp;gt; N[1:3]&lt;br /&gt;
           [1] 1 2 4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 155:&lt;br /&gt;
&lt;br /&gt;
      ls - listing files by size, with the biggest file listed last&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           $ ls --sort=size -lhr&lt;br /&gt;
&lt;br /&gt;
      The above command sorts files by size, listing the contents in&lt;br /&gt;
      &amp;quot;h&amp;quot; human readable format in reverse order.&lt;br /&gt;
&lt;br /&gt;
      Note the options:  --sort={none,time,size,extension}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 156:&lt;br /&gt;
&lt;br /&gt;
     Perl - program to clean up old versions of files&lt;br /&gt;
&lt;br /&gt;
       #!/usr/bin/perl&lt;br /&gt;
       #   Copyright (c) GPL 2005 Mike Chirico&lt;br /&gt;
       # This program deletes old files from several directories&lt;br /&gt;
       # and within each directory there must be x number of copies&lt;br /&gt;
       # each y number of bytes&lt;br /&gt;
       #&lt;br /&gt;
&lt;br /&gt;
       sub delete_old_ones {&lt;br /&gt;
           $directory_and_file=$_[0];&lt;br /&gt;
           $save_count=$_[1];&lt;br /&gt;
           $bytes_in_file=$_[2];&lt;br /&gt;
         # Don't change setting here of '-lt'&lt;br /&gt;
           $pid = open $readme, &amp;quot;ls -lt $directory_and_file|&amp;quot; or die &amp;quot;Could not execute\n&amp;quot;;&lt;br /&gt;
           while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
               my @fields = split;&lt;br /&gt;
              # Make sure we have $save_count good ones with data&lt;br /&gt;
               if ($fields[4] &amp;gt; $bytes_in_file &amp;amp;&amp;amp; $save_count &amp;gt; 0) {&lt;br /&gt;
                   $save_count--;&lt;br /&gt;
                   print &amp;quot;Kept files: $fields[4] $fields[8]\n&amp;quot;;&lt;br /&gt;
               }&lt;br /&gt;
              # delete the old ones&lt;br /&gt;
              if ($save_count &amp;lt;= 0 )&lt;br /&gt;
              {&lt;br /&gt;
                  print &amp;quot;Deleted files: $fields[4] $fields[8]\n&amp;quot;;&lt;br /&gt;
                  unlink $fields[8];&lt;br /&gt;
              }&lt;br /&gt;
           }&lt;br /&gt;
           close $readme;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       @AofA = (&lt;br /&gt;
          [ &amp;quot;/home/cvs/backups/*.gz&amp;quot;, &amp;quot;6&amp;quot;,196621 ],&lt;br /&gt;
          [ &amp;quot;/home/mail/backups/*.gz&amp;quot;,&amp;quot;5&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/snort/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/server1/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/actserver/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/server2/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
                );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       foreach( @AofA ) {&lt;br /&gt;
           &amp;amp;delete_old_ones($_-&amp;gt;[0],$_-&amp;gt;[1],$_-&amp;gt;[2]);&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
     Reference TIP 170 and the following link:&lt;br /&gt;
       http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 157:&lt;br /&gt;
&lt;br /&gt;
     Graphics and Visualization Software that runs on Linux&lt;br /&gt;
        http://www.tldp.org/HOWTO/Scientific-Computing-with-GNU-Linux/graphvis.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 158:&lt;br /&gt;
&lt;br /&gt;
     Keeping files in sync going both ways. Unlike rsync, this is not a one way mirror&lt;br /&gt;
     option.&lt;br /&gt;
&lt;br /&gt;
     You will need ocaml installed first.&lt;br /&gt;
&lt;br /&gt;
       $ wget http://caml.inria.fr/pub/distrib/ocaml-3.08/ocaml-3.08.3.tar.gz&lt;br /&gt;
       $ tar -xzf ocaml-3.08.3.tar.gz&lt;br /&gt;
       $ cd ocaml-3.08.3&lt;br /&gt;
&lt;br /&gt;
       $ ./configure&lt;br /&gt;
       $ make world&lt;br /&gt;
       $ make opt&lt;br /&gt;
       $ make install&lt;br /&gt;
&lt;br /&gt;
     Next, get unison and put it in a different directory.&lt;br /&gt;
     [http://www.cis.upenn.edu/~bcpierce/unison/]&lt;br /&gt;
&lt;br /&gt;
       $ wget http://www.cis.upenn.edu/~bcpierce/unison/download/stable/latest/unison-2.10.2.tar.gz&lt;br /&gt;
       $ tar -xzf unison-2.10.2.tar.gz&lt;br /&gt;
       $ cd unison-2.10.2&lt;br /&gt;
       $ make UISTYLE=text&lt;br /&gt;
       $ su&lt;br /&gt;
       # cp unison /usr/local/bin/.&lt;br /&gt;
&lt;br /&gt;
     Note, you have to copy the file manually.&lt;br /&gt;
&lt;br /&gt;
     See the following article [http://www.linuxjournal.com/article/7712]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 159:&lt;br /&gt;
&lt;br /&gt;
     Dump ext2/ext3 filesystem information with &amp;quot;dumpe2fs&amp;quot;. Perform the mount command&lt;br /&gt;
     and query away.&lt;br /&gt;
&lt;br /&gt;
       $ dumpe2fs /dev/sda1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 160:&lt;br /&gt;
&lt;br /&gt;
     sysreport - a script that generates an HTML report on the system configuration. It&lt;br /&gt;
     gathers information about the hardware and is somewhat redhat specific. The utility&lt;br /&gt;
     should be run as root.&lt;br /&gt;
&lt;br /&gt;
       $ /usr/sbin/sysreport&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 161:&lt;br /&gt;
&lt;br /&gt;
     Key Bindings Using bind.  You can bind, say, ctl-t to a command.&lt;br /&gt;
&lt;br /&gt;
     Add the following to you &amp;quot;~/.inputrc&amp;quot; file, just as it is typed below with quotes.&lt;br /&gt;
&lt;br /&gt;
           &amp;quot;\C-t&amp;quot;: ls -l&lt;br /&gt;
&lt;br /&gt;
     Next, run the command&lt;br /&gt;
&lt;br /&gt;
           $ bind -f .inputrc&lt;br /&gt;
&lt;br /&gt;
     Or, you can do everything on the command line; however, it won't be there the next time&lt;br /&gt;
     you log in. Below is the way to do everything on the command line.&lt;br /&gt;
&lt;br /&gt;
           $ bind -x '&amp;quot;\C-t&amp;quot;:ls -l'&lt;br /&gt;
&lt;br /&gt;
     To unbind use the &amp;quot;-r&amp;quot; option. Single quotes are not needed.&lt;br /&gt;
&lt;br /&gt;
           $ bind -r &amp;quot;\C-t&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Getting a list of all bindings can be done as follows, and not this can be redirected&lt;br /&gt;
     to the &amp;quot;.inputrc&amp;quot; file for further editing.&lt;br /&gt;
&lt;br /&gt;
           $ bind -p &amp;gt; .inputrc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 162:&lt;br /&gt;
&lt;br /&gt;
     awk - common awk commands.&lt;br /&gt;
&lt;br /&gt;
     Find device names &amp;quot;sd&amp;quot; or with major number 4 and device name &amp;quot;tty&amp;quot;. Print the&lt;br /&gt;
     record number NR, plus the major number and minor number.&lt;br /&gt;
&lt;br /&gt;
          $ awk '$2 == &amp;quot;sd&amp;quot;||$1 == 4 &amp;amp;&amp;amp; $2 == &amp;quot;tty&amp;quot; { print NR,$1,$2}' /proc/devices&lt;br /&gt;
&lt;br /&gt;
     Find device name equal to &amp;quot;sound&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ awk '/sound/{print NR,$1,$2}' /proc/devices&lt;br /&gt;
&lt;br /&gt;
     Print the 5th record, first field, in file test&lt;br /&gt;
&lt;br /&gt;
          $ awk 'NR==5{print $1}' test&lt;br /&gt;
&lt;br /&gt;
     Print a record, skip 4 records, print a record etc from file1&lt;br /&gt;
&lt;br /&gt;
          $ awk '(NR-1) % 4 == 0 {print $1}' file1&lt;br /&gt;
&lt;br /&gt;
     Print all records except the last one from file1&lt;br /&gt;
&lt;br /&gt;
          $ tac file1|awk 'NR &amp;gt; 1 {print $0}'|tac&lt;br /&gt;
&lt;br /&gt;
     Print A,B,C ..Z on each line, cycling back to A if greater than 26 lines&lt;br /&gt;
&lt;br /&gt;
          $ awk '{ print substr(&amp;quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&amp;quot;,(NR-1)%26+1,1),$0}' file1&lt;br /&gt;
&lt;br /&gt;
     Number of bytes in a directory.&lt;br /&gt;
&lt;br /&gt;
          $ ls -l|awk 'BEGIN{ c=0}{ c+=$5} END{ print c}'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 163:&lt;br /&gt;
&lt;br /&gt;
     Configuring Remote Logging.  If you have several servers on 192.168.1.0, you can setup remote logging&lt;br /&gt;
     as follows.&lt;br /&gt;
&lt;br /&gt;
     MAIN LOG SERVER (192.168.1.81):&lt;br /&gt;
&lt;br /&gt;
        Firewall - allow UDP port 514 on the main server that will receive the logs.&lt;br /&gt;
&lt;br /&gt;
          $ iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 514 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        Edit &amp;quot;/etc/sysconfig/syslog&amp;quot; and add the &amp;quot;-r&amp;quot; option to SYSLOGD_OPTIONS as shown below.&lt;br /&gt;
&lt;br /&gt;
          SYSLOGD_OPTIONS=&amp;quot;-r -m -0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Note, the &amp;quot;-r&amp;quot; is to allow remote logging and  &amp;quot;-m 0&amp;quot; specifies that that the syslog process should&lt;br /&gt;
        not write regular timestamps.  I prefer to only write timestamps for the clients.&lt;br /&gt;
&lt;br /&gt;
        Next, restart the logging process&lt;br /&gt;
&lt;br /&gt;
          $ service syslog restart&lt;br /&gt;
&lt;br /&gt;
     CLIENT LOG SERVER:&lt;br /&gt;
&lt;br /&gt;
        Edit &amp;quot;/etc/syslog.conf&amp;quot; and add the ip address of the log server, or put in the hostname.&lt;br /&gt;
&lt;br /&gt;
            *.* @192.168.1.81&lt;br /&gt;
&lt;br /&gt;
        Next, restart the logging process&lt;br /&gt;
&lt;br /&gt;
          $ service syslog restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 164:&lt;br /&gt;
&lt;br /&gt;
     kudzu - hardware on your system. To probe the hardware on your system without doing&lt;br /&gt;
             anything, issue the following command.&lt;br /&gt;
&lt;br /&gt;
          $ kudzu -p&lt;br /&gt;
&lt;br /&gt;
      But wait, a lot of this information is already recorded in the following file&lt;br /&gt;
&lt;br /&gt;
            /etc/sysconfig/hwconf&lt;br /&gt;
&lt;br /&gt;
      You can also use lspci to list all PCI devices.&lt;br /&gt;
&lt;br /&gt;
          $ lspci&lt;br /&gt;
&lt;br /&gt;
      Also, take a look at the script /etc/sbin/sysreport, since this script has a lot of&lt;br /&gt;
      info gathering commands. You can pick and choose what you want, or run the complete&lt;br /&gt;
      report.&lt;br /&gt;
&lt;br /&gt;
      If you just want information on the NIC&lt;br /&gt;
&lt;br /&gt;
          $ ip link show eth0&lt;br /&gt;
          2: eth0: &amp;lt;BROADCAST,MULTICAST,UP&amp;gt; mtu 1500 qdisc pfifo_fast qlen 1000&lt;br /&gt;
          link/ether 00:11:11:8a:be:3f brd ff:ff:ff:ff:ff:ff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 165:&lt;br /&gt;
&lt;br /&gt;
     cfengine - a very power agent for monitoring and administrating both a single computer&lt;br /&gt;
              and or multiple computers. [ http://www.cfengine.org/ ]&lt;br /&gt;
&lt;br /&gt;
     The following is a quick example on downloading and installing cfengine.&lt;br /&gt;
&lt;br /&gt;
          $ ncftpget ftp://ftp.iu.hio.no/pub/cfengine/cfengine-2.1.15.tar.gz&lt;br /&gt;
          $ md5sum cfengine-2.1.15.tar.gz&lt;br /&gt;
          f03de82709f84c3d6d916b6e557321f9  cfengine-2.1.15.tar.gz&lt;br /&gt;
&lt;br /&gt;
          $ tar -xzf cfengine-2.1.15.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You need to have a current version of BerkeleyDB (http://downloads.sleepycat.com/db-4.3.28.tar.gz).&lt;br /&gt;
     Note that BerkeleyDB has a funny install. You cd to the &amp;quot;build_unix&amp;quot; directory, then,&lt;br /&gt;
&lt;br /&gt;
          Installing BerkeleyDB if needed:&lt;br /&gt;
                 $ wget http://downloads.sleepycat.com/db-4.3.28.tar.gz&lt;br /&gt;
                 $ tar -xzf db-4.3.28.tar.gz&lt;br /&gt;
                 $ cd db-4.3.28/build_unix/&lt;br /&gt;
                 $ ../dist/configure&lt;br /&gt;
                 make&lt;br /&gt;
                 make install&lt;br /&gt;
&lt;br /&gt;
     You also need a current version of OpenSSL. For instructions on how to install OpenSSL see&lt;br /&gt;
     (http://souptonuts.sourceforge.net/postfix_tutorial.html).&lt;br /&gt;
&lt;br /&gt;
     See (TIP 49) on putting &amp;quot;/usr/local/BerkeleyDB.4.3/lib&amp;quot; in the &amp;quot;/etc/ld.so.conf&amp;quot; file. Or&lt;br /&gt;
     once BerkeleyDB is installed, you can put the location on the command line as follows:&lt;br /&gt;
&lt;br /&gt;
     Configuring cfengine with direct reference to BerkeleyDB.4.3.  First cd to the cfengine source.&lt;br /&gt;
&lt;br /&gt;
          $ ./configure --with-berkeleydb=/usr/local/BerkeleyDB.4.3/lib&lt;br /&gt;
          $ make&lt;br /&gt;
          $ make install&lt;br /&gt;
&lt;br /&gt;
     Next create the following directories:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /var/cfengine/bin&lt;br /&gt;
          $ mkdir -p /var/cfengine/inputs&lt;br /&gt;
&lt;br /&gt;
     Copy needed files (cfagent, cfdoc, cfenvd, cfenvgraph, cfexecd, cfkey, cfrun, cfservd, cfshow):&lt;br /&gt;
&lt;br /&gt;
          $ cp /usr/local/sbin/cf* /var/cfengine/bin&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You'll also need to generate keys. As root, execute the following:&lt;br /&gt;
&lt;br /&gt;
          $ cfkey&lt;br /&gt;
&lt;br /&gt;
     The command above will write the public and private keys in&lt;br /&gt;
     &amp;quot;/var/cfengine/ppkeys&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You probably want (cfexecd, cfservd, and cfenvd) running on all servers. If you&lt;br /&gt;
     add the following to &amp;quot;/etc/rc.local&amp;quot; these daemons will start on reboot.&lt;br /&gt;
&lt;br /&gt;
           # Lines in /etc/rc.local&lt;br /&gt;
           /usr/local/sbin/cfexecd&lt;br /&gt;
           /usr/local/sbin/cfservd&lt;br /&gt;
           /usr/local/sbin/cfenvd&lt;br /&gt;
&lt;br /&gt;
     Also, make sure you run each command now as follows:&lt;br /&gt;
&lt;br /&gt;
          $ /usr/local/sbin/cfexecd&lt;br /&gt;
          $ /usr/local/sbin/cfservd&lt;br /&gt;
          $ /usr/local/sbin/cfenvd&lt;br /&gt;
&lt;br /&gt;
     Firewall settings must be adjusted to allows 5308 for tcp/udp. My local network&lt;br /&gt;
     is 192.168.1.0, so I'm opening it up for all my computers.&lt;br /&gt;
&lt;br /&gt;
          $ iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 5308 -j ACCEPT&lt;br /&gt;
          $ iptables -A INPUT -p tcp -s 192.168.1.0/24  --dport 5308 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
     A set of keys needs to be on the server and hosts. For example, my key on &amp;quot;tape.squeezel.com&amp;quot;&lt;br /&gt;
     should be copied over to the server &amp;quot;squeezel.squeezel.com&amp;quot; as follows:&lt;br /&gt;
&lt;br /&gt;
     This is done from tape.squeezel.com&lt;br /&gt;
&lt;br /&gt;
          $ scp /var/cfengine/ppkeys/localhost.pub  root@squeezel.squeezel.com:/var/cfengine/ppkeys/root-tape.squeezel.com.pub&lt;br /&gt;
          $ scp root@squeezel.squeezel.com:/var/cfengine/ppkeys/localhost.pub /var/cfengine/ppkeys/root-squeezel.squeezel.com.pub&lt;br /&gt;
&lt;br /&gt;
     Also, &amp;quot;/var/cfengine/inputs/cfrun.hosts&amp;quot; on the server &amp;quot;squeezel.squeezel.com&amp;quot; must contain&lt;br /&gt;
     all the computers that will get updated. This is &amp;quot;cfrun.hosts&amp;quot; on &amp;quot;squeezel.squeezel.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          closet.squeezel.com&lt;br /&gt;
          tape.squeezel.com&lt;br /&gt;
&lt;br /&gt;
     Once I'm done, from &amp;quot;tape.squeezel.com&amp;quot; I can run the following test:&lt;br /&gt;
&lt;br /&gt;
          $ cfrun squeezel.squeezel.com -v&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 166:&lt;br /&gt;
&lt;br /&gt;
     cfengine - a quick example. This example will be run as root. You create the file &amp;quot;cfagent.conf&amp;quot; in&lt;br /&gt;
     &amp;quot;/var/cfengine/inputs/&amp;quot;. The example below will checksum all the files in /home/chirico/deleteme/tripwire,&lt;br /&gt;
     it will also comment out the line &amp;quot;finger&amp;quot; in any file located in /tmp/testdir/stuff, also appending&lt;br /&gt;
     the command in this file &amp;quot; Edit change with cfengine&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          # /var/cfengine/inputs/cfagent.conf&lt;br /&gt;
          #&lt;br /&gt;
          # You run this with the following:&lt;br /&gt;
          #   cfagent -vK&lt;br /&gt;
        &lt;br /&gt;
          control:&lt;br /&gt;
                 actionsequence = ( files tidy editfiles )&lt;br /&gt;
                 ChecksumDatabase = ( /var/cfengine/cache.db )&lt;br /&gt;
                 # Below, true to update md5&lt;br /&gt;
                 ChecksumUpdates = ( true )&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
          files:&lt;br /&gt;
                 /home/chirico/deleteme/tripwire checksum=md5 recurse=inf&lt;br /&gt;
                 /home/chirico/deleteme/tripwire/moredata checksum=md5 recurse=inf&lt;br /&gt;
                 #/home/chirico/deleteme/tripwire/compress  recurse=inf include=*.txt acti on=compress&lt;br /&gt;
                   # If the database isn't secure, nothing is secure...&lt;br /&gt;
                 /var/cfengine/cache.db  mode=600 owner=root action=fixall&lt;br /&gt;
        &lt;br /&gt;
          tidy:&lt;br /&gt;
                 /home/chirico/deleteme/tripwire pattern=*~ recurse=inf age=0&lt;br /&gt;
                 # You must put an age. 0 runs now.&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
          editfiles:&lt;br /&gt;
        &lt;br /&gt;
                {  /tmp/testdir/stuff&lt;br /&gt;
&lt;br /&gt;
                   HashCommentLinesContaining &amp;quot;finger&amp;quot;&lt;br /&gt;
                   AppendIfNoSuchLine &amp;quot;# Edit Change with cfengine &amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     A few further notes on the above. The command &amp;quot;actionsequence = ( files tidy editfiles) tells the order&lt;br /&gt;
     of what to execute. The heading &amp;quot;tidy:&amp;quot; deletes files, and of course, &amp;quot;editfiles&amp;quot; does the editing of files.&lt;br /&gt;
&lt;br /&gt;
     To run the example, execute the following command. The  &amp;quot;-K&amp;quot; causes the lock file to be ignored.&lt;br /&gt;
&lt;br /&gt;
            $ cfagent -vK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 167:&lt;br /&gt;
&lt;br /&gt;
     Implementing Disk Quotas - a quick example that can easily be done on a live system for testing. There&lt;br /&gt;
     is no need to reboot, since you'll be creating a virtual filesystem.&lt;br /&gt;
&lt;br /&gt;
     Do the following as root. First create a mount point.&lt;br /&gt;
&lt;br /&gt;
            # mkdir -p /quota&lt;br /&gt;
&lt;br /&gt;
     Next, create 20M file. Since I have many of these files, I created a special directory &amp;quot;/usr/disk-img&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            # mkdir -p /usr/disk-img&lt;br /&gt;
            # dd if=/dev/zero of=/usr/disk-img/disk-quota.ext3 count=40960&lt;br /&gt;
&lt;br /&gt;
     The dd command above create a 20 MB file because, by default, dd uses a block size of 512 bytes. That makes&lt;br /&gt;
     the size: 40960*512=20971520.&lt;br /&gt;
&lt;br /&gt;
     Next, format this as an ext3 filesystem&lt;br /&gt;
&lt;br /&gt;
            # /sbin/mkfs -t ext3 -q /usr/disk-img/disk-quota.ext3 -F&lt;br /&gt;
&lt;br /&gt;
     Add the following line to &amp;quot;/etc/fstab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            /usr/disk-img/disk-quota.ext3    /quota ext3    rw,loop,usrquota,grpquota  0 0&lt;br /&gt;
&lt;br /&gt;
     Now, mount this filesystem&lt;br /&gt;
&lt;br /&gt;
            # mount /quota&lt;br /&gt;
&lt;br /&gt;
     Take a look at it:&lt;br /&gt;
&lt;br /&gt;
            # ls -l /quota&lt;br /&gt;
            lost+found&lt;br /&gt;
&lt;br /&gt;
     Now, run &amp;quot;quotacheck&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            # quotacheck -vug /quota&lt;br /&gt;
&lt;br /&gt;
     You'll get errors the first time this is run, because you have no quota files.&lt;br /&gt;
     But, run it a second time and you'll see something similiar to the following:&lt;br /&gt;
&lt;br /&gt;
            # quotacheck -vug /quota&lt;br /&gt;
            quotacheck: Scanning /dev/loop2 [/quota] done&lt;br /&gt;
            quotacheck: Checked 3 directories and 4 files&lt;br /&gt;
&lt;br /&gt;
     Now take a look at the files:&lt;br /&gt;
&lt;br /&gt;
            # ls -l /quota&lt;br /&gt;
            total 26&lt;br /&gt;
            -rw-------  1 root root  6144 Jun 14 12:23 aquota.group&lt;br /&gt;
            -rw-------  1 root root  6144 Jun 14 12:23 aquota.user&lt;br /&gt;
            drwx------  2 root root 12288 Jun 14 12:18 lost+found&lt;br /&gt;
&lt;br /&gt;
     Next use &amp;quot;edquota&amp;quot; to grant the user &amp;quot;chirico&amp;quot; a certain quota&lt;br /&gt;
&lt;br /&gt;
            # edquota -f /quota chirico&lt;br /&gt;
&lt;br /&gt;
     This will bring up a menu, and here I have edited so that user &amp;quot;chirico&amp;quot;&lt;br /&gt;
     has a soft limit of 120*512=61K, and a soft limit of 2 inodes and a hard limit of 5.&lt;br /&gt;
&lt;br /&gt;
             Disk quotas for user chirico (uid 500):&lt;br /&gt;
             Filesystem                   blocks       soft       hard     inodes     soft     hard&lt;br /&gt;
             /dev/loop2                        2        120        150         1        2         3&lt;br /&gt;
&lt;br /&gt;
     Next, turn quotas on with the following command:&lt;br /&gt;
&lt;br /&gt;
             $ quotaon /quota&lt;br /&gt;
&lt;br /&gt;
     If you need to turn off quotas, the command is &amp;quot;quotaoff -a&amp;quot; for all filesystems. You'll run into&lt;br /&gt;
     errors if you try to run quotacheck, say &amp;quot;quotacheck -avug&amp;quot; because this tries to unmount and mount&lt;br /&gt;
     the filesystem. You need to turn off quotas first &amp;quot;quotaoff /quota&amp;quot;. Note you only need to run&lt;br /&gt;
     quotacheck once, or when doing maintenance after a system crash.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      To get a report on the quote, runn &amp;quot;repquota&amp;quot; as follows:&lt;br /&gt;
&lt;br /&gt;
           $ repquota /quota&lt;br /&gt;
            *** Report for user quotas on device /dev/loop0&lt;br /&gt;
            Block grace time: 7days; Inode grace time: 7days&lt;br /&gt;
                                    Block limits                File limits&lt;br /&gt;
            User            used    soft    hard  grace    used  soft  hard  grace&lt;br /&gt;
            ----------------------------------------------------------------------&lt;br /&gt;
            root      --    1189       0       0              2     0     0&lt;br /&gt;
            chirico   -+      93       0       0              4     2     5  6days&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Note above that user &amp;quot;chirico&amp;quot; has used 4 on the file limits. This user has a hard&lt;br /&gt;
      limit of 5. So when this user tries to create 2 more files (bring this over the limit of 5)&lt;br /&gt;
      then he will get the following error as demonstrated below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           [chirico@squeezel chirico]$ touch one&lt;br /&gt;
           [chirico@squeezel chirico]$ touch two&lt;br /&gt;
           loop0: write failed, user file limit reached.&lt;br /&gt;
           touch: cannot touch `two': Disk quota exceeded&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Now, if repquota (run by root) is executed it shows the following:&lt;br /&gt;
&lt;br /&gt;
           $ repquota /quota&lt;br /&gt;
           *** Report for user quotas on device /dev/loop0&lt;br /&gt;
           Block grace time: 7days; Inode grace time: 7days&lt;br /&gt;
                                   Block limits                File limits&lt;br /&gt;
           User            used    soft    hard  grace    used  soft  hard  grace&lt;br /&gt;
           ----------------------------------------------------------------------&lt;br /&gt;
           root      --    1189       0       0              2     0     0&lt;br /&gt;
           chirico   -+      94       0       0              5     2     5  6days&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Note the &amp;quot;+&amp;quot; sign above. User &amp;quot;chirico&amp;quot; is above the File soft limits, and in this case&lt;br /&gt;
      above the hard limits.&lt;br /&gt;
&lt;br /&gt;
      To warn user by sending email to them, run &amp;quot;warnquota&amp;quot;, but you need check that&lt;br /&gt;
      &amp;quot;/etc/warnquota.conf&amp;quot; is setup correctly. For the example above, this file should&lt;br /&gt;
      look as follows:&lt;br /&gt;
&lt;br /&gt;
            $ cat /etc/quotatab&lt;br /&gt;
            #&lt;br /&gt;
            #  This is sample quotatab (/etc/quotatab)&lt;br /&gt;
            #  Here you can specify description of each device for user&lt;br /&gt;
            #&lt;br /&gt;
            #  Comments begin with hash in the beginning of the line&lt;br /&gt;
&lt;br /&gt;
            # Example of description&lt;br /&gt;
            /dev/loop0: This is loopback device&lt;br /&gt;
&lt;br /&gt;
      Just run the following as root:&lt;br /&gt;
&lt;br /&gt;
            $ warnquota&lt;br /&gt;
&lt;br /&gt;
      By the way, if you want to change the grace period, it can only be done on a filesystem&lt;br /&gt;
      basis. Not per user.&lt;br /&gt;
&lt;br /&gt;
            $  edquota -t&lt;br /&gt;
&lt;br /&gt;
      Users can run &amp;quot;quota&amp;quot; to see their usage as follows:&lt;br /&gt;
&lt;br /&gt;
            [chirico@squeezel ~]$ quota&lt;br /&gt;
            Disk quotas for user chirico (uid 500):&lt;br /&gt;
                 Filesystem  blocks   quota   limit   grace   files   quota   limit   grace&lt;br /&gt;
                 /dev/loop0      94       0       0               5      10      50&lt;br /&gt;
&lt;br /&gt;
      As you can see from above, I changed my inode limit to 50.&lt;br /&gt;
&lt;br /&gt;
      What about running this on the whole filesystem? Yes, below is an example where I'm running&lt;br /&gt;
      this on FC3, on the root of the filesystem &amp;quot;/&amp;quot;. This assumes that you have installed the&lt;br /&gt;
      quota package. Try doing &amp;quot;rpm -q quota&amp;quot; to see if this package is installed.&lt;br /&gt;
&lt;br /&gt;
        Step 1:&lt;br /&gt;
&lt;br /&gt;
           Check to make sure the quota software is installed. You can either do a &amp;quot;whereis quota&amp;quot;,&lt;br /&gt;
           or check for the rpm package.&lt;br /&gt;
&lt;br /&gt;
             $ whereis quota&lt;br /&gt;
             whereis quota&lt;br /&gt;
             quota: /usr/bin/quota /usr/share/man/man1/quota.1.gz&lt;br /&gt;
&lt;br /&gt;
           Checking for the rpm package.&lt;br /&gt;
&lt;br /&gt;
            $ rpm -q quota&lt;br /&gt;
            quota-3.12-5&lt;br /&gt;
&lt;br /&gt;
        Step 2:&lt;br /&gt;
&lt;br /&gt;
           Edit /etc/fstab and add usrquota and grpquota options for &amp;quot;/dev/VolGroup00/LogVol00&amp;quot;,&lt;br /&gt;
           which is shown on the first line below:&lt;br /&gt;
&lt;br /&gt;
             /dev/VolGroup00/LogVol00 /                      ext3    defaults,usrquota,grpquota        1 1&lt;br /&gt;
             LABEL=/boot             /boot                   ext3    defaults        1 2&lt;br /&gt;
             none                    /dev/pts                devpts  gid=5,mode=620  0 0&lt;br /&gt;
             none                    /dev/shm                tmpfs   defaults        0 0&lt;br /&gt;
             none                    /proc                   proc    defaults        0 0&lt;br /&gt;
             none                    /sys                    sysfs   defaults        0 0&lt;br /&gt;
             /dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0&lt;br /&gt;
&lt;br /&gt;
        Step 3:&lt;br /&gt;
&lt;br /&gt;
           Remount the filesystem as follows:&lt;br /&gt;
&lt;br /&gt;
             $ mount -o remount /&lt;br /&gt;
&lt;br /&gt;
        Step 4:&lt;br /&gt;
&lt;br /&gt;
           Run quotacheck with the &amp;quot;-m&amp;quot; option. Like the above statement, this will have to be run with&lt;br /&gt;
           root priviliges. This creates the quota database files, and it can take a long time if it is&lt;br /&gt;
           a large full filesystem.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             $ quotacheck -cugm /&lt;br /&gt;
&lt;br /&gt;
        Step 5:&lt;br /&gt;
&lt;br /&gt;
           This step is optional, but it's good to know if you need to recalculate quotas because of a&lt;br /&gt;
           system crash. It's demonstrated here, because at this point quota's have not been turned on.&lt;br /&gt;
           Again, note the &amp;quot;m&amp;quot; option below.&lt;br /&gt;
&lt;br /&gt;
             $ quotacheck -avumg&lt;br /&gt;
&lt;br /&gt;
        Step 6:&lt;br /&gt;
&lt;br /&gt;
           Set limits for specific users or groups using the &amp;quot;edquota&amp;quot; command. Shown below is the command&lt;br /&gt;
           to setup quotas for user &amp;quot;chirico&amp;quot;. Shown below this user has used 161560 blocks, he has a soft&lt;br /&gt;
           limit of 1161560 and a hard limit of 900000. He has used 3085 inodes and has a soft limit of 10000&lt;br /&gt;
           and a hard limit of 12000.&lt;br /&gt;
&lt;br /&gt;
             $ edquota -f / chirico&lt;br /&gt;
&lt;br /&gt;
             Disk quotas for user chirico (uid 500):&lt;br /&gt;
               Filesystem                   blocks       soft       hard     inodes     soft     hard&lt;br /&gt;
               /dev/mapper/VolGroup00-LogVol00     161560    1161560     900000       3085    10000    12000&lt;br /&gt;
&lt;br /&gt;
           You can put quotas on groups as well. The following is done as root. See (TIP 186 and TIP 6) for creating&lt;br /&gt;
           groups and adding users to groups.&lt;br /&gt;
&lt;br /&gt;
             $ edquota -g share&lt;br /&gt;
&lt;br /&gt;
           If you create a sharable directory for anyone in the group &amp;quot;share&amp;quot; (TIP 6), quota restrictions against&lt;br /&gt;
           group &amp;quot;share&amp;quot; will only apply to files added in the &amp;quot;/home/share&amp;quot; directory. When user &amp;quot;chirico&amp;quot; creates&lt;br /&gt;
           files in &amp;quot;/home/share&amp;quot; they also go against this user quota as well. However, when files are created in&lt;br /&gt;
           his home directory they do not go against the &amp;quot;share&amp;quot; group.&lt;br /&gt;
&lt;br /&gt;
           Note - if you get errors when trying to run &amp;quot;edquota -g share&amp;quot;, turn quotas off &amp;quot;quotaoff /&amp;quot; and&lt;br /&gt;
                  run &amp;quot;quotacheck -avugm&amp;quot;. Then, turn the quotas back on &amp;quot;quotaon /&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           You can see the status of the group quota with the following command:&lt;br /&gt;
&lt;br /&gt;
             $ quota -g share&lt;br /&gt;
&lt;br /&gt;
        Step 7:&lt;br /&gt;
&lt;br /&gt;
           Turn on quotas with the &amp;quot;qutoaon&amp;quot; command. This command needs to be done with root privileges.&lt;br /&gt;
&lt;br /&gt;
             $ quotaon /&lt;br /&gt;
&lt;br /&gt;
        Step 8:&lt;br /&gt;
&lt;br /&gt;
           Check &amp;quot;/etc/quotatab&amp;quot; file for the correct entries. Note that when you do the &amp;quot;mount&amp;quot; command&lt;br /&gt;
           the filesystem returned needs to match what is in the &amp;quot;quotatab&amp;quot; file. I have noticed that this&lt;br /&gt;
           is not the case by default.&lt;br /&gt;
&lt;br /&gt;
             $ mount&lt;br /&gt;
             /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw,usrquota,grpquota)&lt;br /&gt;
&lt;br /&gt;
           So the &amp;quot;/etc/quotatab&amp;quot; must contain the following line.&lt;br /&gt;
&lt;br /&gt;
             /dev/mapper/VolGroup00-LogVol00: This is the Volume group&lt;br /&gt;
&lt;br /&gt;
        Step 9:&lt;br /&gt;
&lt;br /&gt;
           Run &amp;quot;warnquota&amp;quot; as a check that the &amp;quot;/etc/quotatab&amp;quot; files is setup correctly.&lt;br /&gt;
&lt;br /&gt;
              $ warnquota&lt;br /&gt;
&lt;br /&gt;
        Step 10:&lt;br /&gt;
&lt;br /&gt;
           Setup a daily cron job for running &amp;quot;warnquota&amp;quot;. The following should be placed&lt;br /&gt;
           in &amp;quot;/etc/cron.daily&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              #!/bin/sh&lt;br /&gt;
              # Place this file in /etc/cron.daily&lt;br /&gt;
              # with rights 0755&lt;br /&gt;
              /usr/sbin/warnquota&lt;br /&gt;
              EXITVALUE=$?&lt;br /&gt;
              if [ $EXITVALUE != 0 ]; then&lt;br /&gt;
                 /usr/bin/logger -t warnquota &amp;quot;ALERT exited abnormally with [$EXITVALUE]&amp;quot;&lt;br /&gt;
              fi&lt;br /&gt;
              exit 0&lt;br /&gt;
&lt;br /&gt;
      References:&lt;br /&gt;
        http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/sysadmin-guide/ch-disk-quotas.html&lt;br /&gt;
        (TIP 6, TIP 186, and TIP 205)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 168:&lt;br /&gt;
&lt;br /&gt;
     rdist - remote file distribution client program. You can use this program in combination with&lt;br /&gt;
     ssh. This program does more than just copy files. Once a file has been copied, you can dictate&lt;br /&gt;
     other actions to be performed. Or you can hold off copying all together if the destination is&lt;br /&gt;
     running low on inodes, or disk space.&lt;br /&gt;
&lt;br /&gt;
     For the purpose of this example, all commands will been run on &amp;quot;squeezel.squeezel.com&amp;quot;, and the&lt;br /&gt;
     computers that will be updated are &amp;quot;tape.squeezel.com&amp;quot; and &amp;quot;closet.squeezel.com&amp;quot;. Obviously, you&lt;br /&gt;
     would substitute your computer names.&lt;br /&gt;
&lt;br /&gt;
     It helps to setup ssh keys on each computer first. Reference [http://souptonuts.sourceforge.net/sshtips.htm]&lt;br /&gt;
     and (TIP 12).&lt;br /&gt;
&lt;br /&gt;
     Step 1: Create the Configuration file myDistfile&lt;br /&gt;
&lt;br /&gt;
       Below is my sample &amp;quot;myDistfile&amp;quot;. This file will access hosts &amp;quot;tape.squeezel.com&amp;quot; using username chirico&lt;br /&gt;
       and &amp;quot;closet.squeezel.com&amp;quot; with the username running this command, and copy the&lt;br /&gt;
       files &amp;quot;/home/chirico/file1&amp;quot; and &amp;quot;/home/chirico/file2&amp;quot; to the these two servers creating the&lt;br /&gt;
       directory ~/tmpdir if it doesn't exist. Once these files are updated, a mail check (&amp;quot;sendmail -bv&amp;quot;)&lt;br /&gt;
       will be performed, and mail will be sent to &amp;quot;chirico@squeezel&amp;quot;. This happens twice, once for each file.&lt;br /&gt;
&lt;br /&gt;
       Note, the line &amp;quot;/home/chirico/file2 -&amp;gt; tape.squeezel.com&amp;quot; which moves the file &amp;quot;file2&amp;quot; to&lt;br /&gt;
       tape.squeezel.com renaming the file to &amp;quot;tapedest&amp;quot; in the directory &amp;quot;/home/chirico&amp;quot;. Once this file&lt;br /&gt;
       is copied, the rights are modified to &amp;quot;chmod +r&amp;quot;.  Likewise, &amp;quot;/home/chirico/file2 -&amp;gt; closet.squeezel.com&amp;quot;&lt;br /&gt;
       copies the file file2, which is renamed as closetdest.&lt;br /&gt;
&lt;br /&gt;
                 # Contents of myDistfile&lt;br /&gt;
                 HOSTS = ( chirico@tape.squeezel.com closet.squeezel.com )&lt;br /&gt;
&lt;br /&gt;
                 FILES = ( /home/chirico/file1 /home/chirico/file2 )&lt;br /&gt;
&lt;br /&gt;
                 ${FILES} -&amp;gt; ${HOSTS}&lt;br /&gt;
                    # Directory tmpdir will be created if it doesn't exist&lt;br /&gt;
                    install tmpdir ;&lt;br /&gt;
                    special /home/chirico/file1  &amp;quot;/usr/sbin/sendmail -bv mchirico@gmail.com&amp;quot;;&lt;br /&gt;
                    notify chirico@squeezel;&lt;br /&gt;
&lt;br /&gt;
                 /home/chirico/file2 -&amp;gt; tape.squeezel.com&lt;br /&gt;
                    install  /home/chirico/tapedest;&lt;br /&gt;
                    special  /home/chirico/tapedest &amp;quot;chmod +r /home/chirico/tapedest&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
                 /home/chirico/file2 -&amp;gt; closet.squeezel.com&lt;br /&gt;
                    install /home/chirico/closetdest;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 2: Command from squeezel.squeezel.com to run myDistfile above&lt;br /&gt;
&lt;br /&gt;
       Below is the command that will execute the contents in &amp;quot;myDistfile&amp;quot;. This command is run from the&lt;br /&gt;
       computer &amp;quot;squeezel.squeezel.com&amp;quot;. All output will go in the file &amp;quot;cmd1rdist.log&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ rdist -P /usr/local/bin/ssh -f ./myDistfile -l file=./cmd1rdist.log=all&lt;br /&gt;
&lt;br /&gt;
       Obviously you want a secure copy (using scp), so the -P option uses ssh as your secure&lt;br /&gt;
       transport mechanism.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 169:&lt;br /&gt;
&lt;br /&gt;
     Restricting root logins (/etc/securetty). ctl-alt-F4 will give you a prompt for tty3. Note&lt;br /&gt;
     that it is one number less. Take a look at the contents of &amp;quot;/etc/securetty&amp;quot;. To prevent&lt;br /&gt;
     root from logging in on this device, take out tty3 from this listing. Note, you can always&lt;br /&gt;
     login as another user, then, su to root.  Below is an example of the default&lt;br /&gt;
     &amp;quot;/etc/securetty&amp;quot; that allows root to login to everything.&lt;br /&gt;
&lt;br /&gt;
         [root@squeezel ~]# cat /etc/securetty&lt;br /&gt;
         console&lt;br /&gt;
         vc/1&lt;br /&gt;
         vc/2&lt;br /&gt;
         vc/3&lt;br /&gt;
         vc/4&lt;br /&gt;
         vc/5&lt;br /&gt;
         vc/6&lt;br /&gt;
         vc/7&lt;br /&gt;
         vc/8&lt;br /&gt;
         vc/9&lt;br /&gt;
         vc/10&lt;br /&gt;
         vc/11&lt;br /&gt;
         tty1&lt;br /&gt;
         tty2&lt;br /&gt;
         tty3&lt;br /&gt;
         tty4&lt;br /&gt;
         tty5&lt;br /&gt;
         tty6&lt;br /&gt;
         tty7&lt;br /&gt;
         tty8&lt;br /&gt;
         tty9&lt;br /&gt;
         tty10&lt;br /&gt;
         tty11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 170:&lt;br /&gt;
&lt;br /&gt;
     Perl map function. Try the following to get a quick take on this function,&lt;br /&gt;
     which increments each value in the array a;&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map {$_++} @a;&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot; } @a;&lt;br /&gt;
&lt;br /&gt;
     or&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     And you can easily make modifications, like reversing the order&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     Plus there is a grep() function that works on each element as well&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse grep{ $_ &amp;gt; 3} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     To get only odd numbers in reverse order:&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse grep{ !($_ % 2)} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference: http://www-128.ibm.com/developerworks/linux/library/l-road4.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 171:&lt;br /&gt;
&lt;br /&gt;
     Perl - subroutine call and shifting through variables. A simple and useful&lt;br /&gt;
     technique.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          sub test {&lt;br /&gt;
            local $mval;&lt;br /&gt;
            while( $mval = shift ) {&lt;br /&gt;
              print &amp;quot; $mval\n&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          test(&amp;quot;one&amp;quot;,&amp;quot;two&amp;quot;,&amp;quot;three&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 172:&lt;br /&gt;
&lt;br /&gt;
     Tcp wrappers - First &amp;quot;/etc/hosts.allow&amp;quot; is check, and if there is an entry in this file, no more&lt;br /&gt;
     checking it done.  If are no matches in &amp;quot;/etc/hosts.allow&amp;quot;, the &amp;quot;/etc/hosts.deny&amp;quot; file is checked&lt;br /&gt;
     and if a match is found, that service is blocked for that host.&lt;br /&gt;
&lt;br /&gt;
     Example &amp;quot;/etc/hosts.deny&amp;quot; file:&lt;br /&gt;
&lt;br /&gt;
         sshd: 192.168.1.171&lt;br /&gt;
&lt;br /&gt;
     The above file blocks access to computer 192.168.1.171. It's also possible to run commands when&lt;br /&gt;
     someone from this computer tries to ssh in. This example sends mail.&lt;br /&gt;
&lt;br /&gt;
         sshd: 192.168.1.171: spawn (echo -e &amp;quot;%d %h %H %u&amp;quot;| /bin/mail -s 'hosts.deny entry' root)&lt;br /&gt;
&lt;br /&gt;
     Of course, you can also run commands in the &amp;quot;/etc/hosts.allow&amp;quot; if you wanted mail sent for a successful&lt;br /&gt;
     login.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 173:&lt;br /&gt;
&lt;br /&gt;
     pgrep, pkill - look up or signal process based on name and other attributes.&lt;br /&gt;
&lt;br /&gt;
     To quick find all instances of ssh running, for user root, execute the following&lt;br /&gt;
     command:&lt;br /&gt;
&lt;br /&gt;
           $ pgrep -u root -l ssh&lt;br /&gt;
&lt;br /&gt;
     To kill a process, or send a signal use the &amp;quot;pkill&amp;quot; option. For example, to&lt;br /&gt;
     make syslog reread its configuration file:&lt;br /&gt;
&lt;br /&gt;
           $ pkill -HUP syslogd&lt;br /&gt;
&lt;br /&gt;
     Another command command is &amp;quot;pidof&amp;quot; that can tell you how many processes are running.&lt;br /&gt;
     This can be useful for detecting DOS attacks.&lt;br /&gt;
&lt;br /&gt;
           $ pidof sshd&lt;br /&gt;
           4783 4781 30008 30006 29888 29886 2246&lt;br /&gt;
&lt;br /&gt;
     Above there are 7 sshd's running. Reference &amp;quot;Tcpdump, Raw Socket and Libpap Tutorial&amp;quot;&lt;br /&gt;
     at [http://souptonuts.sourceforge.net/tcpdump_tutorial.html].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 174:&lt;br /&gt;
&lt;br /&gt;
     Password Cracking - tools to check your users passwords:&lt;br /&gt;
&lt;br /&gt;
      John The Ripper&lt;br /&gt;
        http://www.openwall.com/john/&lt;br /&gt;
&lt;br /&gt;
      Crack&lt;br /&gt;
        http://www.crypticide.com/users/alecm/&lt;br /&gt;
&lt;br /&gt;
      Slurpie&lt;br /&gt;
        http://www.ussrback.com/distributed.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 175:&lt;br /&gt;
&lt;br /&gt;
     Password Aging - setting the number of days a password is valid.&lt;br /&gt;
&lt;br /&gt;
         $ chage -M 90 &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 176:&lt;br /&gt;
&lt;br /&gt;
     Kernel Performance Tuning - /Documentation/sysctl/vm.txt documents kernel settings to&lt;br /&gt;
     improve performance. Below are some examples.&lt;br /&gt;
&lt;br /&gt;
       overcommit_memory:  0 -- default estimates the amount of memory for malloc&lt;br /&gt;
                           1 -- kernel pretends there is always enough memory until it runs out&lt;br /&gt;
                           3 -- never overcommit&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/overcommit_memory&lt;br /&gt;
          0&lt;br /&gt;
&lt;br /&gt;
       page-cluster:&lt;br /&gt;
            The Linux VM subsystem avoids excessive disk seeks by reading&lt;br /&gt;
            multiple pages on a page fault. The number of pages it reads&lt;br /&gt;
            is dependent on the amount of memory in your machine.&lt;br /&gt;
        &lt;br /&gt;
            The number of pages the kernel reads in at once is equal to&lt;br /&gt;
            2 ^ page-cluster. Values above 2 ^ 5 don't make much sense&lt;br /&gt;
            for swap because we only cluster swap data in 32-page groups.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/page-cluster&lt;br /&gt;
          3&lt;br /&gt;
&lt;br /&gt;
       min_free_kbytes:&lt;br /&gt;
            This is used to force the Linux VM to keep a minimum number&lt;br /&gt;
            of kilobytes free.  The VM uses this number to compute a pages_min&lt;br /&gt;
            value for each lowmem zone in the system.  Each lowmem zone gets&lt;br /&gt;
            a number of reserved free pages based proportionally on its size.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/min_free_kbytes&lt;br /&gt;
          3831&lt;br /&gt;
&lt;br /&gt;
       max_map_count:&lt;br /&gt;
            This file contains the maximum number of memory map areas a process&lt;br /&gt;
            may have. Memory map areas are used as a side-effect of calling&lt;br /&gt;
            malloc, directly by mmap and mprotect, and also when loading shared&lt;br /&gt;
            libraries.&lt;br /&gt;
&lt;br /&gt;
            While most applications need less than a thousand maps, certain&lt;br /&gt;
            programs, particularly malloc debuggers, may consume lots of them,&lt;br /&gt;
            e.g., up to one or two maps per allocation.&lt;br /&gt;
&lt;br /&gt;
            The default value is 65536.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/max_map_count&lt;br /&gt;
          65536&lt;br /&gt;
&lt;br /&gt;
        Also see http://people.redhat.com/alikins/system_tuning.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 177:&lt;br /&gt;
&lt;br /&gt;
     IO Scheduler - /Documentation/block/as-iosched.txt documents kernel settings for disk&lt;br /&gt;
     performance.&lt;br /&gt;
&lt;br /&gt;
     If you're not sure what partitions you have &amp;quot;$ cat /proc/partitions&amp;quot;. This example&lt;br /&gt;
     assumes hda, and you can see some of the kernel settings:&lt;br /&gt;
&lt;br /&gt;
          $ ls /sys/block/hda/queue/iosched&lt;br /&gt;
          back_seek_max  back_seek_penalty  clear_elapsed  fifo_batch_expire  fifo_expire_async&lt;br /&gt;
           fifo_expire_sync  find_best_crq  key_type  quantum  queued&lt;br /&gt;
&lt;br /&gt;
     References: http://lwn.net/Articles/102505/&lt;br /&gt;
                 http://bhhdoa.org.au/pipermail/ck/2004-September/000961.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 178:&lt;br /&gt;
&lt;br /&gt;
     iozone -- getting data on disk performance (http://www.iozone.org/). This is a very&lt;br /&gt;
     comprehensive package.&lt;br /&gt;
&lt;br /&gt;
           $ wget http://www.iozone.org/src/current/iozone3_242.tar&lt;br /&gt;
           $ tar -xf iozone3_242.tar&lt;br /&gt;
           $ cd iozone3_242/src/current&lt;br /&gt;
           $ make linux&lt;br /&gt;
&lt;br /&gt;
     At this point you should read the documentation. There is no &amp;quot;make install&amp;quot;. You&lt;br /&gt;
     copy it to each filesystem you want to run this program on. Below are some quick&lt;br /&gt;
     start commands.&lt;br /&gt;
&lt;br /&gt;
       Good comprehensive test.&lt;br /&gt;
&lt;br /&gt;
           $ iozone -a&lt;br /&gt;
&lt;br /&gt;
       I prefer this for small filesystems. It limits the record size to 10000 and does&lt;br /&gt;
       the output in operations per second (higher numbers mean faster drive).&lt;br /&gt;
&lt;br /&gt;
           $ ./iozone -a -s 10000 -O&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 179:&lt;br /&gt;
&lt;br /&gt;
     history - bash command to get a history of all commands typed. But, here is a way&lt;br /&gt;
     that you can get date and time listed as well.&lt;br /&gt;
&lt;br /&gt;
           $ HISTTIMEFORMAT=&amp;quot;%y/%m/%d %T &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Defining the environment variable above give you the date/time info when you&lt;br /&gt;
     execute history:&lt;br /&gt;
&lt;br /&gt;
           $ history&lt;br /&gt;
              ...&lt;br /&gt;
               175  05/06/30 12:51:46 grep '141.162.' mout &amp;gt; mout2&lt;br /&gt;
               176  05/06/30 12:51:48 e mout2&lt;br /&gt;
               177  05/06/30 12:56:59 ls&lt;br /&gt;
               178  05/06/30 12:57:02 ls&lt;br /&gt;
               179  05/06/30 12:57:39 ls&lt;br /&gt;
               180  05/06/30 12:57:49 ls -l&lt;br /&gt;
               181  05/06/30 13:01:10 history&lt;br /&gt;
               182  05/06/30 13:01:20 HISTTIMEFORMAT=&amp;quot;%y/%m/%d %T &amp;quot;&lt;br /&gt;
               183  05/06/30 13:01:23 history&lt;br /&gt;
              ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 180:&lt;br /&gt;
&lt;br /&gt;
     .config - Fedora Core getting the .config to rebuild the kernel. You can find&lt;br /&gt;
     this file, the &amp;quot;.config&amp;quot; file at the following location:&lt;br /&gt;
&lt;br /&gt;
          $ ls &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Or, to see the contents&lt;br /&gt;
&lt;br /&gt;
          $ cat &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     This can be important, if you're planning to build your own kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 181:&lt;br /&gt;
&lt;br /&gt;
     Listing control key settings.&lt;br /&gt;
&lt;br /&gt;
          $ stty -a&lt;br /&gt;
          speed 38400 baud; rows 0; columns 0; line = 0;&lt;br /&gt;
          intr = ^C; quit = ^\; erase = &amp;lt;undef&amp;gt;; kill = &amp;lt;undef&amp;gt;; eof = ^D; eol = &amp;lt;undef&amp;gt;; eol2 = &amp;lt;undef&amp;gt;; start = ^Q;&lt;br /&gt;
          stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;&lt;br /&gt;
          -parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts&lt;br /&gt;
          -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel&lt;br /&gt;
          opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0&lt;br /&gt;
          isig icanon iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 182:&lt;br /&gt;
&lt;br /&gt;
     iptables DNAT and SNAT. You have a webserver on 192.168.1.71. When people query this webserver, you want them&lt;br /&gt;
     to goto 192.168.1.81, with no indication that they are going to another web server. In fact, they always make&lt;br /&gt;
     their web hits to 192.168.1.71.&lt;br /&gt;
&lt;br /&gt;
     The following is the iptables commands:&lt;br /&gt;
&lt;br /&gt;
        $ echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
        $ iptables -t nat -A PREROUTING -d 192.168.1.71 -p tcp --dport 80 -j DNAT --to 192.168.1.81&lt;br /&gt;
        $ iptables -t nat -A POSTROUTING -d 192.168.1.81 -s 192.168.1.0/24 -p tcp --dport 80 -j SNAT --to 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
     Change 192.168.1.0/24 to whatever source you expect the web browser to come in on. Below is the tcpdump showing&lt;br /&gt;
     all traffic is relayed via 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
         [root@closet iptables]# tcpdump -nN port 80&lt;br /&gt;
&lt;br /&gt;
         17:34:58.790398 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: S 3620106373:3620106373(0) win 16384 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790465 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: S 3620106373:3620106373(0) win 16384 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790703 IP 192.168.1.81.80 &amp;gt; 192.168.1.71.1158: S 1973665156:1973665156(0) ack 3620106374 win 5840 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790720 IP 192.168.1.71.80 &amp;gt; 192.168.1.102.1158: S 1973665156:1973665156(0) ack 3620106374 win 5840 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790951 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: . ack 1 win 17520&lt;br /&gt;
         17:34:58.790965 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: . ack 1 win 17520&lt;br /&gt;
         17:34:58.791451 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: P 1:327(326) ack 1 win 17520&lt;br /&gt;
         17:34:58.791472 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: P 1:327(326) ack 1 win 17520&lt;br /&gt;
         17:34:58.791973 IP 192.168.1.81.80 &amp;gt; 192.168.1.71.1158: . ack 327 win 6432&lt;br /&gt;
&lt;br /&gt;
     Above the web client is on &amp;quot;192.168.1.102&amp;quot;. You can see that the 1st server &amp;quot;192.168.1.71&amp;quot; then goes out to&lt;br /&gt;
     the 2nd server &amp;quot;192.168.1.81&amp;quot; on the second line. The third line shows the 2nd server &amp;quot;192.168.1.81&amp;quot; responding to&lt;br /&gt;
     the 1st server, and the forth line passes this data back to the web client &amp;quot;192.168.1.102&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Note: You can save your current iptables setting with the following command:&lt;br /&gt;
&lt;br /&gt;
         $ iptables-save &amp;gt; iptables_store&lt;br /&gt;
&lt;br /&gt;
       The big advantage is that you can store the counters as well.&lt;br /&gt;
&lt;br /&gt;
         $ iptables-save -c &amp;gt; iptables_store_w_cnts&lt;br /&gt;
&lt;br /&gt;
       To restore the file, use the following:&lt;br /&gt;
&lt;br /&gt;
         $ iptables-restore -c &amp;lt; iptables_store_w_cnts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 183:&lt;br /&gt;
&lt;br /&gt;
     mailstats - display mail statistics. This file reads data from &amp;quot;/var/log/mail/statistics&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         [root@closet ~]# mailstats&lt;br /&gt;
         Statistics from Sat Jun 25 15:59:52 2005&lt;br /&gt;
          M   msgsfr  bytes_from   msgsto    bytes_to  msgsrej msgsdis msgsqur  Mailer&lt;br /&gt;
          4        1          2K        0          0K        0       0       0  esmtp&lt;br /&gt;
          9        0          0K        1          2K        0       0       0  local&lt;br /&gt;
         =====================================================================&lt;br /&gt;
          T        1          2K        1          2K        0       0       0&lt;br /&gt;
          C        1                    0                    0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 184:&lt;br /&gt;
&lt;br /&gt;
     Profiling C Applications - Assume you have the following program p1.c:&lt;br /&gt;
&lt;br /&gt;
         /* Program  p1.c */&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
         t1(int i)&lt;br /&gt;
         {&lt;br /&gt;
                 printf(&amp;quot;t1:%d\n&amp;quot;, i);&lt;br /&gt;
         }&lt;br /&gt;
        &lt;br /&gt;
         t2(int j)&lt;br /&gt;
         {&lt;br /&gt;
                 printf(&amp;quot;t2:%d\n&amp;quot;, j);&lt;br /&gt;
         }&lt;br /&gt;
        &lt;br /&gt;
         int main(void)&lt;br /&gt;
         {&lt;br /&gt;
                 int i, j;&lt;br /&gt;
        &lt;br /&gt;
                 for (i = 0; i &amp;lt; 5; ++i) {&lt;br /&gt;
                         t1(i);&lt;br /&gt;
                         for (j = 0; j &amp;lt; 2; ++j) {&lt;br /&gt;
                                 t2(j);&lt;br /&gt;
                         }&lt;br /&gt;
                 }&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
     Compile the program as follows:&lt;br /&gt;
&lt;br /&gt;
        $ gcc -pg -g -o p1 p1.c&lt;br /&gt;
        $ ./p1&lt;br /&gt;
        t1:0&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:1&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:2&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:3&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:4&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
&lt;br /&gt;
     Next, to get the profile graph.&lt;br /&gt;
&lt;br /&gt;
        $ gprof -p -b p1&lt;br /&gt;
        Flat profile:&lt;br /&gt;
        &lt;br /&gt;
        Each sample counts as 0.01 seconds.&lt;br /&gt;
         no time accumulated&lt;br /&gt;
        &lt;br /&gt;
          %   cumulative   self              self     total&lt;br /&gt;
         time   seconds   seconds    calls  Ts/call  Ts/call  name&lt;br /&gt;
          0.00      0.00     0.00       10     0.00     0.00  t2&lt;br /&gt;
          0.00      0.00     0.00        5     0.00     0.00  t1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Above note the 10 calls to t2 and 5 calls to t1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 185:&lt;br /&gt;
&lt;br /&gt;
     CDPATH - this is a bash variable like PATH that defines a search path&lt;br /&gt;
              for the cd command.&lt;br /&gt;
&lt;br /&gt;
     Suppose you have the following directory structure:&lt;br /&gt;
&lt;br /&gt;
             /home/chirico/stuff&lt;br /&gt;
                               |-- dirA&lt;br /&gt;
                               `-- dirB&lt;br /&gt;
&lt;br /&gt;
     Assume you define CDPATH as follows:&lt;br /&gt;
&lt;br /&gt;
             CDPATH=/home/chirico/stuff&lt;br /&gt;
&lt;br /&gt;
     Now, no matter what directory you are in if you use the cd command below&lt;br /&gt;
     you will automatically move to &amp;quot;/home/chirico/stuff/dirA&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             $ cd dirA&lt;br /&gt;
&lt;br /&gt;
     Note you could be in &amp;quot;/etc&amp;quot; and will move directly to &amp;quot;/home/chirico/stuff/dirA&amp;quot;.&lt;br /&gt;
     This command has the same format as PATH - multiple entries are separated by a colon.&lt;br /&gt;
     If the current directory contain a sub-directory dirA, then, it gets priority.&lt;br /&gt;
&lt;br /&gt;
     The following is part of my .bash_profile&lt;br /&gt;
&lt;br /&gt;
             CDPATH=/work/cpearls/src/posted_on_sf/:/work/souptonuts/documentation/:/home/chirico/deleteme/&lt;br /&gt;
             export PATH CVS_RSH EDITOR JAVA_HOME CDPATH&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 186:&lt;br /&gt;
&lt;br /&gt;
     Groups - add groups and users to groups. The following shows how to create the group &amp;quot;share&amp;quot;&lt;br /&gt;
              and add the user &amp;quot;chirico&amp;quot; to this group. The following should be done as root, and&lt;br /&gt;
              assumes the account &amp;quot;chirico&amp;quot; already exits.&lt;br /&gt;
&lt;br /&gt;
             $ groupadd share&lt;br /&gt;
             $ usermod -G share chirico&lt;br /&gt;
&lt;br /&gt;
     Note the change made to &amp;quot;/etc/group&amp;quot; below:&lt;br /&gt;
&lt;br /&gt;
             $ cat /etc/group|grep 'share'&lt;br /&gt;
             share:x:616:chirico&lt;br /&gt;
&lt;br /&gt;
     If the user chirico is currently logged in, he should run the following&lt;br /&gt;
     command to immediately have group &amp;quot;share&amp;quot; rights. Or, the next time he logs&lt;br /&gt;
     in he will have access to this group.&lt;br /&gt;
&lt;br /&gt;
             $ newgrp share&lt;br /&gt;
&lt;br /&gt;
     Reference the following (TIP 6, TIP 167).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 187:&lt;br /&gt;
&lt;br /&gt;
     oprofile - steps for running oprofile on Fedora.&lt;br /&gt;
&lt;br /&gt;
     Step 1:&lt;br /&gt;
&lt;br /&gt;
       Find out what version of the kernel you are running.&lt;br /&gt;
&lt;br /&gt;
           $ uname -a&lt;br /&gt;
           Linux closet.squeezel.com 2.6.12-1.1398_FC4 #1 Fri Jul 15 00:52:32 EDT 2005 i686 i686 i386 GNU/Linux&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 2:&lt;br /&gt;
&lt;br /&gt;
       Download the source in a chosen directory. Above, I'm running 2.6.12-1, but I'm going to go for 2.6.12.3, since&lt;br /&gt;
       it's a little later. You want the signed file as well.&lt;br /&gt;
&lt;br /&gt;
           $ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.12.3.tar.gz&lt;br /&gt;
           $ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.12.3.tar.gz.sign&lt;br /&gt;
&lt;br /&gt;
       Now, check the signature.&lt;br /&gt;
&lt;br /&gt;
           $ gpg --verify linux-2.6.12.3.tar.gz.sign linux-2.6.12.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 3:&lt;br /&gt;
&lt;br /&gt;
       Unpack the file.&lt;br /&gt;
&lt;br /&gt;
           $ tar -xzf linux-2.6.12.3.tar.gz&lt;br /&gt;
           $ cd cd linux-2.6.12.3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 4:&lt;br /&gt;
&lt;br /&gt;
       Copy the &amp;quot;.config&amp;quot; used to compile your previous kernel. You should find it&lt;br /&gt;
       in the following direcotry &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       Copy it to the linux-2.6.12.3 directory.&lt;br /&gt;
&lt;br /&gt;
           $ cp &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot; .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 5:&lt;br /&gt;
&lt;br /&gt;
       Run make as follows. It will ask for a few questions on &amp;quot;make oldconfig&amp;quot;. The&lt;br /&gt;
       make installs below will have to be done with root privileges.&lt;br /&gt;
&lt;br /&gt;
          $ make oldconfig&lt;br /&gt;
          $ make bzImage&lt;br /&gt;
          $ make modules&lt;br /&gt;
          $ make modules_install&lt;br /&gt;
          $ make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 6:&lt;br /&gt;
&lt;br /&gt;
       Edit the &amp;quot;/boot/grub/grub.conf&amp;quot; and set default = 0  as shown below in this&lt;br /&gt;
       file.&lt;br /&gt;
&lt;br /&gt;
            default=0&lt;br /&gt;
            timeout=5&lt;br /&gt;
            splashimage=(hd0,2)/grub/splash.xpm.gz&lt;br /&gt;
            hiddenmenu&lt;br /&gt;
            title Fedora Core (2.6.12.3)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.12.3 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.12.3.img&lt;br /&gt;
            title Fedora Core (2.6.12-1.1398_FC4)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.12-1.1398_FC4 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.12-1.1398_FC4.img&lt;br /&gt;
            title Fedora Core (2.6.11-1.1369_FC4)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.11-1.1369_FC4 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.11-1.1369_FC4.img&lt;br /&gt;
            title Other&lt;br /&gt;
                    rootnoverify (hd0,1)&lt;br /&gt;
                    chainloader +1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 7:&lt;br /&gt;
&lt;br /&gt;
       Shutdown with the restart option.&lt;br /&gt;
&lt;br /&gt;
           $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 8:&lt;br /&gt;
&lt;br /&gt;
       Run opcontrol. The commands below are done as root.  My kernel was compiled in the following&lt;br /&gt;
       directory &amp;quot;/home/kernel/linux-2.6.12.3/&amp;quot;, so I'll run opcontrol as follows:&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --vmlinux=/home/kernel/linux-2.6.12.3/vmlinux&lt;br /&gt;
&lt;br /&gt;
       Now start.&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --start&lt;br /&gt;
           Using 2.6+ OProfile kernel interface.&lt;br /&gt;
           Reading module info.&lt;br /&gt;
           Using log file /var/lib/oprofile/oprofiled.log&lt;br /&gt;
           Daemon started.&lt;br /&gt;
           Profiler running.&lt;br /&gt;
&lt;br /&gt;
       Shutdown opcontrol.&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --shutdown&lt;br /&gt;
&lt;br /&gt;
       Run report.&lt;br /&gt;
&lt;br /&gt;
           $ opreport&lt;br /&gt;
&lt;br /&gt;
           CPU: CPU with timer interrupt, speed 0 MHz (estimated)&lt;br /&gt;
           Profiling through timer interrupt&lt;br /&gt;
                     TIMER:0|&lt;br /&gt;
             samples|      %|&lt;br /&gt;
           ------------------&lt;br /&gt;
              156088 99.8746 vmlinux&lt;br /&gt;
                  60  0.0384 libc-2.3.5.so&lt;br /&gt;
                  30  0.0192 oprofiled&lt;br /&gt;
                  23  0.0147 libcrypto.so.0.9.7f&lt;br /&gt;
                  13  0.0083 bash&lt;br /&gt;
                  12  0.0077 screen&lt;br /&gt;
                  10  0.0064 sshd&lt;br /&gt;
                   9  0.0058 ssh&lt;br /&gt;
                   6  0.0038 ip_tables&lt;br /&gt;
                   6  0.0038 libncurses.so.5.4&lt;br /&gt;
                   5  0.0032 b44&lt;br /&gt;
                   5  0.0032 ext3&lt;br /&gt;
                   5  0.0032 ld-2.3.5.so&lt;br /&gt;
                   4  0.0026 ip_conntrack&lt;br /&gt;
                   4  0.0026 jbd&lt;br /&gt;
                   2  0.0013 grep&lt;br /&gt;
                   1 6.4e-04 libdns.so.20.0.2&lt;br /&gt;
                   1 6.4e-04 libisc.so.9.1.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Reference the following for more documentation:&lt;br /&gt;
             http://oprofile.sourceforge.net/doc/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 188:&lt;br /&gt;
&lt;br /&gt;
     cyrus-imapd with Postfix using sasldb for authentication. For this example&lt;br /&gt;
     the server is tape.squeezel.com and the user is chirico.&lt;br /&gt;
&lt;br /&gt;
        Step 1:&lt;br /&gt;
        &lt;br /&gt;
                   $ yum install cyrus-imapd&lt;br /&gt;
                   $ yum install cyrus-imapd-utils&lt;br /&gt;
        &lt;br /&gt;
            You need &amp;quot;cyrus-imapd-utils&amp;quot; for cyradm.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 2:&lt;br /&gt;
        &lt;br /&gt;
          Edit /etc/imapd.conf&lt;br /&gt;
        &lt;br /&gt;
               configdirectory: /var/lib/imap&lt;br /&gt;
               partition-default: /var/spool/imap&lt;br /&gt;
               admins: cyrus&lt;br /&gt;
               sievedir: /var/lib/imap/sieve&lt;br /&gt;
               sendmail: /usr/sbin/sendmail&lt;br /&gt;
               hashimapspool: true&lt;br /&gt;
               # Chirico Commented the below line&lt;br /&gt;
               # sasl_pwcheck_method: saslauthd&lt;br /&gt;
               # Because using sasldb&lt;br /&gt;
               sasl_pwcheck_method: auxprop&lt;br /&gt;
               sasl_auxprop_plugin: sasldb&lt;br /&gt;
               #  Chirico end change&lt;br /&gt;
               sasl_mech_list: PLAIN&lt;br /&gt;
               tls_cert_file: /usr/share/ssl/certs/cyrus-imapd.pem&lt;br /&gt;
               tls_key_file: /usr/share/ssl/certs/cyrus-imapd.pem&lt;br /&gt;
               tls_ca_file: /usr/share/ssl/certs/ca-bundle.crt&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 3:&lt;br /&gt;
        &lt;br /&gt;
           Create a user and password:&lt;br /&gt;
        &lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` cyrus&lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` chirico&lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` allmail&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
           This will automatically create the file /etc/sasldb2. But look&lt;br /&gt;
           at the default rights, assuming you ran saslpasswd2 as root:&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /etc/sasldb2&lt;br /&gt;
                 -rw-r-----  1 root root 12288 Jul 31 09:50 /etc/sasldb2&lt;br /&gt;
        &lt;br /&gt;
           We need to correct this in step 4.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 4:&lt;br /&gt;
        &lt;br /&gt;
                 $ chown root.mail /etc/sasldb2&lt;br /&gt;
                 $ ls -l /etc/sasldb2&lt;br /&gt;
                 -rw-r-----  1 root mail 12288 Jul 31 09:50 /etc/sasldb2&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 5:&lt;br /&gt;
        &lt;br /&gt;
            Update &amp;quot;/etc/postfix/main.cf&amp;quot;. Note in /etc/imapd.conf the configdirectory&lt;br /&gt;
            points to /var/lib/imap, and if I look at this directory I see the&lt;br /&gt;
            socket directory. However, after staring /etc/init.d/cyrus-imapd  there&lt;br /&gt;
            will be a socket file &amp;quot;/var/lib/imap/socket/lmtp&amp;quot;. (See step 6).&lt;br /&gt;
        &lt;br /&gt;
                  mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp&lt;br /&gt;
                  mailbox_transport = cyrus&lt;br /&gt;
        &lt;br /&gt;
            Restart postfix.&lt;br /&gt;
        &lt;br /&gt;
                  /etc/init.d/postfix restart&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 6:&lt;br /&gt;
&lt;br /&gt;
            Start cyrus-imapd and look for the socket file.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
                   $ /etc/init.d/cyrus-imapd restart&lt;br /&gt;
                   Shutting down cyrus-imapd:                                 [  OK  ]&lt;br /&gt;
                   Starting cyrus-imapd: preparing databases... done.         [  OK  ]&lt;br /&gt;
        &lt;br /&gt;
            Now you should see the lmtp file:&lt;br /&gt;
        &lt;br /&gt;
                   $ ls -l /var/lib/imap/socket/lmtp&lt;br /&gt;
                   srwxrwxrwx  1 root root 0 Jul 31 10:04 /var/lib/imap/socket/lmtp&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 7:&lt;br /&gt;
        &lt;br /&gt;
            Add users. Note, you may have to go back to step 3 to add them to /etc/sasldb2&lt;br /&gt;
            as well.&lt;br /&gt;
        &lt;br /&gt;
                   $ su - cyrus&lt;br /&gt;
                   $ cyradm tape.squeezel.com&lt;br /&gt;
                   tape.squeezel.com&amp;gt; cm user.chirico&lt;br /&gt;
                   tape.squeezel.com&amp;gt; quit&lt;br /&gt;
        &lt;br /&gt;
            Now got back as root, and check that everything was created correctly.&lt;br /&gt;
        &lt;br /&gt;
                   $ ls /var/spool/imap/c/user/&lt;br /&gt;
                   total 8&lt;br /&gt;
                   drwx------  2 cyrus mail 4096 Jul 31 10:21 chirico&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 8:&lt;br /&gt;
        &lt;br /&gt;
             Run a mail test. We'll do this as root to the chirico account.&lt;br /&gt;
        &lt;br /&gt;
                   $ mail -s 'First test'  chirico&lt;br /&gt;
                   first test&lt;br /&gt;
                   .&lt;br /&gt;
        &lt;br /&gt;
             Now, still as root check the maillog. Normally everything should work.&lt;br /&gt;
        &lt;br /&gt;
                  $ tail /var/log/maillog&lt;br /&gt;
        &lt;br /&gt;
             However, I got the following error below.&lt;br /&gt;
&lt;br /&gt;
                     Jul 31 10:29:03 tape postfix/cleanup[30124]: AE7CB1B34A4: message-id=&amp;lt;20050731142903.AE7CB1B34A4@tape.squeezel.com&amp;gt;&lt;br /&gt;
                     Jul 31 10:29:03 tape postfix/qmgr[30120]: AE7CB1B34A4: from=&amp;lt;root@tape.squeezel.com&amp;gt;, size=315, nrcpt=1 (queue active)&lt;br /&gt;
                     Jul 31 10:29:03 tape pipe[30128]: fatal: pipe_comand: execvp /cyrus/bin/deliver: No such file or directory&lt;br /&gt;
&lt;br /&gt;
             If you get a similiar error, you may need to adjust the settting in /etc/postfix/master.cf&lt;br /&gt;
        &lt;br /&gt;
                 # This is the problem in /etc/postfix/master.cf&lt;br /&gt;
                 cyrus     unix  -       n       n       -       -       pipe&lt;br /&gt;
                   user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}&lt;br /&gt;
        &lt;br /&gt;
             My deliver file is the following&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
                 -rwxr-xr-x  1 root root 846228 Apr  4 18:59 /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
        &lt;br /&gt;
             So I need to change my /etc/postfix/master.cf as follows:&lt;br /&gt;
        &lt;br /&gt;
                 # Fix because by deliver file is under  /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
                 cyrus     unix  -       n       n       -       -       pipe&lt;br /&gt;
                   user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -r ${sender} -m ${extension} ${user}&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
             If changes were needed, like I had to do, restart postfix&lt;br /&gt;
        &lt;br /&gt;
                 $ /etc/init.d/postfix restart&lt;br /&gt;
        &lt;br /&gt;
             Now, if everything works, you should start to see numbers in the spool directory like &amp;quot;1.&amp;quot; and&lt;br /&gt;
             &amp;quot;2.&amp;quot;.&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /var/spool/imap/c/user/chirico/&lt;br /&gt;
                 total 40&lt;br /&gt;
                 -rw-------  1 cyrus mail  545 Jul 31 10:44 1.&lt;br /&gt;
                 -rw-------  1 cyrus mail  547 Jul 31 10:45 2.&lt;br /&gt;
                 -rw-------  1 cyrus mail 1276 Jul 31 10:45 cyrus.cache&lt;br /&gt;
                 -rw-------  1 cyrus mail  153 Jul 31 10:21 cyrus.header&lt;br /&gt;
                 -rw-------  1 cyrus mail  196 Jul 31 10:45 cyrus.index&lt;br /&gt;
&lt;br /&gt;
        Step 9:&lt;br /&gt;
        &lt;br /&gt;
             Local firewall.&lt;br /&gt;
        &lt;br /&gt;
                 # imap&lt;br /&gt;
                iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 143 -j ACCEPT&lt;br /&gt;
                iptables -A INPUT -p tcp -s 192.168.1.0/24  --dport 143 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        Step 10:&lt;br /&gt;
        &lt;br /&gt;
             Configure cyrus-imapd to start for run-level 3 and 5.&lt;br /&gt;
&lt;br /&gt;
                 # chkconfig --level 35 cyrus-imapd on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       HINTS - &lt;br /&gt;
&lt;br /&gt;
        Something to watch out for:&lt;br /&gt;
&lt;br /&gt;
              Something to watch out for: If a user creates a .forward file in their shell account with the&lt;br /&gt;
              following entry, then, mail will not get mail relayed to cyrus.&lt;br /&gt;
&lt;br /&gt;
                  &amp;quot;|exec /usr/bin/procmail&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             The /etc/maillog will show something like this:&lt;br /&gt;
&lt;br /&gt;
                    to=&amp;lt;chirico@squeezel.squeezel.com&amp;gt;, orig_to=&amp;lt;chirico&amp;gt;, relay=local, delay=0,&lt;br /&gt;
                          status=sent (delivered to command: exec /usr/bin/procmail)&lt;br /&gt;
&lt;br /&gt;
             Remove the &amp;quot;.forward&amp;quot; file from their home directory and you'll get the following:&lt;br /&gt;
&lt;br /&gt;
                    to=&amp;lt;chirico@squeezel.squeezel.com&amp;gt;, relay=cyrus, delay=0,&lt;br /&gt;
                          status=sent (squeezel.squeezel.com)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              mutt with IMAP?  (See TIP 190)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 189:&lt;br /&gt;
&lt;br /&gt;
     expand - convert tabs to spaces in a file.&lt;br /&gt;
&lt;br /&gt;
             $ expand How_to_Linux_and_Open_Source.txt &amp;gt; notabs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 190:&lt;br /&gt;
&lt;br /&gt;
     mutt with imap - assume you have setup imap (see tip 188). Now how do you configure&lt;br /&gt;
                      your &amp;quot;.muttrc&amp;quot; file to automatically connect, securely to the IMAP server?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       &lt;br /&gt;
     Below is an example of my &amp;quot;.muttrc&amp;quot; file. For this example, assume my password is &amp;quot;S0m3paSSw0r9&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             $ cat .muttrc&lt;br /&gt;
             set spoolfile = &amp;quot;imaps://chirico:S0m3paSSw0r9@squeezel.squeezel.com/&lt;br /&gt;
             set imap_force_ssl=yes&lt;br /&gt;
             set certificate_file=~/.mutt/certificates/72d31154.0&lt;br /&gt;
&lt;br /&gt;
     Now, you want to copy the certificate as a &amp;quot;file.pem&amp;quot; and run &amp;quot;c_rehash&amp;quot; to convert this&lt;br /&gt;
     file to a number. See the article. See the following article on how to do this under the &lt;br /&gt;
     fetchmail section.&lt;br /&gt;
&lt;br /&gt;
          http://souptonuts.sourceforge.net/postfix_tutorial.html&lt;br /&gt;
&lt;br /&gt;
     This is a quick summary of creating this key.&lt;br /&gt;
&lt;br /&gt;
             $ openssl s_client -connect squeezel.squeezel.com:995 -showcerts &amp;gt; file.pem&lt;br /&gt;
             $ c_rehash ~/.mutt/certificates&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 191:&lt;br /&gt;
&lt;br /&gt;
     Apache - CGI scripts.  There are two ways to enable CGI scripts. The second method is the&lt;br /&gt;
              prefered method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           First way, the easy way. Look for the &amp;quot;http.conf&amp;quot; file. On Fedora Core, this file can be&lt;br /&gt;
           found under &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;. Edit this file as follows to make &lt;br /&gt;
           &amp;quot;http://squeezel.squeezel.com/chirico-cgi/&amp;quot; execute scripts.&lt;br /&gt;
&lt;br /&gt;
                     ScriptAlias /chirico-cgi/ &amp;quot;/home/chirico/cgi-bin/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           Second way, the better way. Instead of doing the above, make the following change in &lt;br /&gt;
           &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                     &amp;lt;Directory /home/chirico/cgi-bin&amp;gt;&lt;br /&gt;
                      Options +ExecCGI&lt;br /&gt;
                      SetHandler chirico-cgi&lt;br /&gt;
                     &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Running a test script. Now copy the following test script into the directory &amp;quot;/home/chirico/cgi-bin&amp;quot;&lt;br /&gt;
        and change the rights to execute for the user running this.&lt;br /&gt;
&lt;br /&gt;
                  #!/bin/sh&lt;br /&gt;
                  # Save as test.cgi&lt;br /&gt;
                  #  chown apache.apache test.cgi&lt;br /&gt;
                  #  chmod 700 test.cgi&lt;br /&gt;
                  echo &amp;quot;Content-Type: text/html&amp;quot;&lt;br /&gt;
                  echo&lt;br /&gt;
                  echo &amp;quot;Hello world from user &amp;lt;b&amp;gt;`whoami`&amp;lt;/b&amp;gt;! &amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 192:&lt;br /&gt;
&lt;br /&gt;
     Bash - using getopts for your bash scripts.&lt;br /&gt;
&lt;br /&gt;
                   #!/bin/bash&lt;br /&gt;
                   while getopts &amp;quot;ab:cd:&amp;quot; Option&lt;br /&gt;
                   # b and d take arguments&lt;br /&gt;
                   #&lt;br /&gt;
                   do&lt;br /&gt;
                     case $Option in&lt;br /&gt;
                       a) echo -e &amp;quot;a = $OPTIND&amp;quot;;;&lt;br /&gt;
                       b) echo -e &amp;quot;b = $OPTIND $OPTARG&amp;quot;;;&lt;br /&gt;
                       c) echo -e &amp;quot;c = $OPTIND&amp;quot;;;&lt;br /&gt;
                       d) echo -e &amp;quot;d = $OPTIND $OPTARG&amp;quot;;;&lt;br /&gt;
                    esac&lt;br /&gt;
                  done&lt;br /&gt;
                  shift $(($OPTIND - 1))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 193:&lt;br /&gt;
&lt;br /&gt;
     Sieve - creating sieve recipes with &amp;quot;sieveshell&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     The following sieve script put all jefferson.edu mail into the &lt;br /&gt;
     folder jefferson. This assumes that I have already created the IMP &lt;br /&gt;
     directory, or mail box (INBOX.jefferson), which can be done in mutt &lt;br /&gt;
     with the &amp;quot;C&amp;quot; command. Below is an example of finding &amp;quot;jefferson.edu&amp;quot;&lt;br /&gt;
     anywhere in the header. &lt;br /&gt;
&lt;br /&gt;
         # This is a file named jefferson.siv&lt;br /&gt;
         require [&amp;quot;fileinto&amp;quot;];&lt;br /&gt;
         if header :contains &amp;quot;Received&amp;quot; &amp;quot;from jefferson.edu&amp;quot; {&lt;br /&gt;
           fileinto &amp;quot;INBOX.jefferson&amp;quot;;&lt;br /&gt;
           stop;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
     Now, from the command propt execute &amp;quot;sieveshell&amp;quot; with the hostname of the&lt;br /&gt;
     imap server. My server is squeezel.squeezel.com, so I would execute the &lt;br /&gt;
     following:&lt;br /&gt;
&lt;br /&gt;
          $ sieveshell squeezel.squeezel.com&lt;br /&gt;
          connecting to squeezel.squeezel.com&lt;br /&gt;
          Please enter your password:****&lt;br /&gt;
          &amp;gt; put jefferson.siv&lt;br /&gt;
          &amp;gt; activate jefferson.siv&lt;br /&gt;
          &amp;gt; list&lt;br /&gt;
          jefferson.siv  &amp;lt;- active script&lt;br /&gt;
          &amp;gt; quit&lt;br /&gt;
&lt;br /&gt;
     Note the put brings in the script. And you need to activiate it.&lt;br /&gt;
&lt;br /&gt;
     You can activate a sieve script for any user on your system if you are&lt;br /&gt;
     root. This is an example of activating a script for user chirico. Assume&lt;br /&gt;
     below the root prompt is &amp;quot;#&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          # sieveshell -a chirico -u chirico squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
     You can also automate everything from a bash script. But note after&lt;br /&gt;
     the -e the commands, and not a file with the commands, follows within&lt;br /&gt;
     quotes. This is the script I use for my home system.&lt;br /&gt;
&lt;br /&gt;
         #!/bin/bash&lt;br /&gt;
         sieveshell -a chirico -u chirico -e 'deactivate&lt;br /&gt;
         delete chirico.siv&lt;br /&gt;
         put chirico.siv&lt;br /&gt;
         activate chirico.siv&lt;br /&gt;
         list&lt;br /&gt;
         '  squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     References:&lt;br /&gt;
         http://wiki.fastmail.fm/index.php/SieveRecipes&lt;br /&gt;
         http://www.cyrusoft.com/sieve/#documents&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 194:&lt;br /&gt;
&lt;br /&gt;
     emacs - editing files remotely with tramp. Tramp comes with the latest version of emacs.&lt;br /&gt;
             That means if you're using Fedora core 4, with emacs, you have tramp. This is &lt;br /&gt;
             ideal for editing files on remote computers that do not use emacs.&lt;br /&gt;
&lt;br /&gt;
             Edit the &amp;quot;.emacs&amp;quot; file and add the following line:&lt;br /&gt;
&lt;br /&gt;
                 (require 'tramp)&lt;br /&gt;
                 (setq tramp-default-method &amp;quot;scp&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
             Now, to edit a file on computer tape.squeezel.com (C-x, C-f) and&lt;br /&gt;
             enter the following in Find file:&lt;br /&gt;
&lt;br /&gt;
                 Find file:/chirico@tape.squeezel.com:test.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             References:&lt;br /&gt;
&lt;br /&gt;
                    http://savannah.gnu.org/projects/tramp/&lt;br /&gt;
&lt;br /&gt;
             &lt;br /&gt;
&lt;br /&gt;
TIP 195:&lt;br /&gt;
&lt;br /&gt;
     trusted X11 forwarding - running gnome and KDE both on one screen, at the same&lt;br /&gt;
             time securely. The following assumes gnome is running on the current&lt;br /&gt;
             computer and &amp;quot;closet.squeezel.com&amp;quot; has KDE&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y  closet.squeezel.com&lt;br /&gt;
              $ startkde&lt;br /&gt;
&lt;br /&gt;
          Or assume you want to run gnome on &amp;quot;closet.squeezel.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y  closet.squeezel.com&lt;br /&gt;
              $ gnome-session&lt;br /&gt;
&lt;br /&gt;
          By default Fedora Core allows ForwardX11 over ssh. Note you want to use&lt;br /&gt;
          the -Y option above and NOT -X. &lt;br /&gt;
&lt;br /&gt;
          Suppose you want a remote &amp;quot;gnome-session&amp;quot; on ctl-alt-F12. Below is an &lt;br /&gt;
          example of getting the remote computer closet.squeezel.com, and you&lt;br /&gt;
          can still have the above configuration.&lt;br /&gt;
&lt;br /&gt;
          First you must allow magic cookies for each server connection.&lt;br /&gt;
             &lt;br /&gt;
              $ MCOOKIE=$(mcookie)&lt;br /&gt;
              $ xauth add $(hostname)/unix:1 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
              $ xauth add localhost/unix:1 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
  &lt;br /&gt;
          Again, note that you have to add this for EACH connection. So if you wanted 2 as well&lt;br /&gt;
&lt;br /&gt;
              $ MCOOKIE=$(mcookie)&lt;br /&gt;
              $ xauth add $(hostname)/unix:2 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
              $ xauth add localhost/unix:2 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
&lt;br /&gt;
          On squeezel.squeezel.com create a new xterm. If :1 is take below&lt;br /&gt;
          try :2. The vt12 is for switching to ctl-alt-F12.&lt;br /&gt;
&lt;br /&gt;
              $ xinit -- :1 vt12&lt;br /&gt;
&lt;br /&gt;
          Note, if you do not add the above cookies, you will get the follow error:&lt;br /&gt;
         &lt;br /&gt;
               Xlib: connection to &amp;quot;:1.0&amp;quot; refused by server&lt;br /&gt;
               Xlib: No protocol specified&lt;br /&gt;
&lt;br /&gt;
          The screen may be hard to read. At this point ssh -Y to the remote computer.&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y closet.squeezel.com&lt;br /&gt;
              $ gnome-session&lt;br /&gt;
&lt;br /&gt;
          Yes, you will get errors about sound and some custom drivers is the remove &lt;br /&gt;
          computer has different hardware. After is loads, you can switch back and&lt;br /&gt;
          forth between session with (ctl-alt-F12)  and (ctl-alt-F7)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 196:&lt;br /&gt;
&lt;br /&gt;
     Suspend ssh session - you have just sshed into a computer &amp;quot;ssh -l user example.com&amp;quot;, and you&lt;br /&gt;
          want to get back to the terminal prompt of the computer you started with. Escapte, by &lt;br /&gt;
          default with ssh is &amp;quot;~&amp;quot;, so enter &amp;quot;~&amp;quot; followed by &amp;quot;ctl-z&amp;quot; to suspend.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 197:&lt;br /&gt;
&lt;br /&gt;
     Quick way to send a text file &lt;br /&gt;
&lt;br /&gt;
              $ sendmail -f mike.chirico@gmail.com mchirico@comcast.net &amp;lt; /etc/fstab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 198:&lt;br /&gt;
&lt;br /&gt;
     size - determining the size of the text segment, data segment, and &amp;quot;bss&amp;quot; or uninitialized data segment.&lt;br /&gt;
&lt;br /&gt;
              $ size /bin/sh /bin/bash&lt;br /&gt;
               text        data     bss     dec     hex filename&lt;br /&gt;
              586946      22444   18784  628174   995ce /bin/sh&lt;br /&gt;
              586946      22444   18784  628174   995ce /bin/bash&lt;br /&gt;
&lt;br /&gt;
          Note above that &amp;quot;/bin/sh&amp;quot; and &amp;quot;/bin/bash&amp;quot; have equal text,data and bss numbers. It's&lt;br /&gt;
          highly likely that these are the same programs.&lt;br /&gt;
&lt;br /&gt;
              $ ls -l /bin/sh&lt;br /&gt;
               lrwxrwxrwx  1 root root 4 Jan 14  2005 /bin/sh -&amp;gt; bash&lt;br /&gt;
&lt;br /&gt;
          Yep, it's the same program. Here's a further definition of each segment.&lt;br /&gt;
&lt;br /&gt;
              Text segment: The machine instructions that the CPU executes. This is usually&lt;br /&gt;
                            read only and sharable.&lt;br /&gt;
&lt;br /&gt;
              Data segment: Contains initialized variables in a program. You also know these&lt;br /&gt;
                            as declarations and definitions.&lt;br /&gt;
&lt;br /&gt;
                               int max = 200;&lt;br /&gt;
&lt;br /&gt;
              Uninitialized data segment: Think of this as a declaration only, or data that&lt;br /&gt;
                            is only initialized by the kernel to arithmetic 0 or null pointers&lt;br /&gt;
                            before program execution.&lt;br /&gt;
&lt;br /&gt;
                               char s[10];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 199:&lt;br /&gt;
&lt;br /&gt;
     Using the at command.&lt;br /&gt;
&lt;br /&gt;
       Below is a simple example if running the ls command at 11:42am that&lt;br /&gt;
       will send mail -m to the user that executed it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       We'll execute job1 defined as follows and set to be executable. &lt;br /&gt;
&lt;br /&gt;
           $ cat ./job1&lt;br /&gt;
           #!/bin/bash&lt;br /&gt;
           date &amp;gt;&amp;gt; /tmp/job1&lt;br /&gt;
&lt;br /&gt;
       The at command is listed below. For queue &amp;quot;-q&amp;quot; names you can only&lt;br /&gt;
       specify one letter. Here we're using x. The letter determines the&lt;br /&gt;
       priority with &amp;quot;a&amp;quot; the highest.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x  -f ./job1 -m  11:54am&lt;br /&gt;
           job 3 at 2005-10-04 11:54&lt;br /&gt;
&lt;br /&gt;
       Now, if you execute the atq command, you'll get the following.&lt;br /&gt;
&lt;br /&gt;
           $ atq&lt;br /&gt;
           3       2005-10-04 11:54 x chirico&lt;br /&gt;
&lt;br /&gt;
       It's also possible to execute jobs at the command line entering&lt;br /&gt;
       a ctl-d at the end of the input.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x  -m 12:08pm&lt;br /&gt;
           at&amp;gt; ls -l&lt;br /&gt;
           at&amp;gt; who&lt;br /&gt;
           at&amp;gt; date&lt;br /&gt;
           at&amp;gt; ^D&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Or for a job to execute 1 minute from now.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x -m `date -d '1 minute' +&amp;quot;%H:%M&amp;quot;`&lt;br /&gt;
           at&amp;gt; ls -l&lt;br /&gt;
           at&amp;gt; date&lt;br /&gt;
     &lt;br /&gt;
&lt;br /&gt;
     Important points: The atd daemon must be running. To check if&lt;br /&gt;
      it's running do the following:&lt;br /&gt;
&lt;br /&gt;
            $ /etc/init.d/atd status&lt;br /&gt;
&lt;br /&gt;
      Also, if there is an /etc/at.allow file, then only users in that&lt;br /&gt;
      file will be allowed to execute at.&lt;br /&gt;
&lt;br /&gt;
      If /etc/at.deny exists but is empty and there is no /etc/at.allow,&lt;br /&gt;
      then, everyone can execute the at command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 200:&lt;br /&gt;
&lt;br /&gt;
     lsusb - command will display all USB buses and all devices connected.&lt;br /&gt;
&lt;br /&gt;
        $ lsusb&lt;br /&gt;
        Bus 005 Device 003: ID 413c:2010 Dell Computer Corp.&lt;br /&gt;
        Bus 005 Device 002: ID 413c:1003 Dell Computer Corp.&lt;br /&gt;
        Bus 005 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 004 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 003 Device 003: ID 0fc5:1227 Delcom Engineering&lt;br /&gt;
        Bus 003 Device 002: ID 046d:c016 Logitech, Inc. Optical Mouse&lt;br /&gt;
        Bus 003 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 002 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 001 Device 001: ID 0000:0000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 201:&lt;br /&gt;
&lt;br /&gt;
     Memory fragmentation - if you suspect workload memory fragmentation issues&lt;br /&gt;
     and you want to monitor the current state of you system, then, consider&lt;br /&gt;
     looking at the output from /proc/buddyinfo on recent kernels.&lt;br /&gt;
&lt;br /&gt;
        $ cat /proc/buddyinfo&lt;br /&gt;
      Node 0, zone      DMA    541    218     42      2      0      0      0      1      1      1      0 &lt;br /&gt;
      Node 0, zone   Normal   2508   2614     52      1      5      5      0      1      1      1      0 &lt;br /&gt;
      Node 0, zone  HighMem      0      1      3      0      1      0      0      0      0      0      0 &lt;br /&gt;
&lt;br /&gt;
     The following definition is taken from  ./Documentation/filesystems/proc.txt in the &lt;br /&gt;
     Linux kernel source.&lt;br /&gt;
&lt;br /&gt;
       Each column represents the number of pages of a certain order which are&lt;br /&gt;
       available.  In this case, there are 0 chunks of 2^0*PAGE_SIZE available in&lt;br /&gt;
       ZONE_DMA, 4 chunks of 2^1*PAGE_SIZE in ZONE_DMA, 101 chunks of 2^4*PAGE_SIZE&lt;br /&gt;
       available in ZONE_NORMAL, etc...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 202:&lt;br /&gt;
&lt;br /&gt;
     arp - Linux ARP kernel moduel.  This command implements the Address Resolution Protocol.&lt;br /&gt;
&lt;br /&gt;
     This is an example of the command.&lt;br /&gt;
&lt;br /&gt;
        $ arp&lt;br /&gt;
        Address                  HWtype  HWaddress           Flags Mask            Iface&lt;br /&gt;
        tape.squeezel.com        ether   00:50:DA:60:5B:AD   C                     eth0&lt;br /&gt;
        squeezel.squeezel.com    ether   00:11:11:8A:BE:3F   C                     eth0&lt;br /&gt;
        gw.squeezel.com          ether   00:0F:66:47:15:73   C                     eth0&lt;br /&gt;
&lt;br /&gt;
       &lt;br /&gt;
TIP 203:&lt;br /&gt;
&lt;br /&gt;
     dbench - performance monitoring. &lt;br /&gt;
&lt;br /&gt;
     So, how does your system react when the load average is above 600. Have you even seen a &lt;br /&gt;
     computer with a load average of 600? Well, this could be your chance. &lt;br /&gt;
&lt;br /&gt;
         Reference: http://freshmeat.net/projects/dbench/&lt;br /&gt;
&lt;br /&gt;
     The following gives a load average of 10 on my system.&lt;br /&gt;
&lt;br /&gt;
        $ dbench 34&lt;br /&gt;
&lt;br /&gt;
     If you want a higher load, just increase the number.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 204:&lt;br /&gt;
&lt;br /&gt;
     /etc guide - a listing of common files in the /etc directory.&lt;br /&gt;
&lt;br /&gt;
        /etc/exports: this file is used to configure NFS.&lt;br /&gt;
&lt;br /&gt;
        /etc/ftpusers: the users on your system who are restricted from FTP login.&lt;br /&gt;
&lt;br /&gt;
        /etc/motd: message of the day, which users see after login.&lt;br /&gt;
&lt;br /&gt;
        /etc/named.conf: DNS config file.&lt;br /&gt;
&lt;br /&gt;
        /etc/profile: common user information.&lt;br /&gt;
&lt;br /&gt;
        /etc/inittab: this file contains runlevel start information.&lt;br /&gt;
&lt;br /&gt;
        /etc/services: the services and their respective ports.&lt;br /&gt;
&lt;br /&gt;
        /etc/shells: this contains the names of all shells installed on the system.&lt;br /&gt;
&lt;br /&gt;
        /etc/passwd: this file contains user information.&lt;br /&gt;
&lt;br /&gt;
        /etc/group: security group rights.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
TIP 205: &lt;br /&gt;
&lt;br /&gt;
     logger - is a bash command utility for writing to /var/log/messages or the&lt;br /&gt;
            other files defined in /etc/syslog.conf.&lt;br /&gt;
&lt;br /&gt;
            $ logger -t TEST more of a test here&lt;br /&gt;
&lt;br /&gt;
         This is what shows up in /var/log/messages&lt;br /&gt;
  &lt;br /&gt;
            Oct 28 07:15:50 squeezel TEST: more of a test here&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
TIP 206: &lt;br /&gt;
&lt;br /&gt;
     accton, lastcomm - accouting on and last command. This is &lt;br /&gt;
         a way to monitor users on your system. As root, you &lt;br /&gt;
         would implement this as follows:&lt;br /&gt;
&lt;br /&gt;
           $ accton -h&lt;br /&gt;
            Usage: accton [-hV] [file]&lt;br /&gt;
            [--help] [--version]&lt;br /&gt;
&lt;br /&gt;
            The system's default process accounting file is /var/account/pacct.&lt;br /&gt;
&lt;br /&gt;
         Note the default file location is /var/account/pacct so we'll turn&lt;br /&gt;
         it on system wide with the following command.&lt;br /&gt;
&lt;br /&gt;
           $ accton /var/account/pacct&lt;br /&gt;
&lt;br /&gt;
         Now take a look at this file. It will grow. To see command that&lt;br /&gt;
         are executed, use the lastcomm command.&lt;br /&gt;
&lt;br /&gt;
           $ lastcomm&lt;br /&gt;
&lt;br /&gt;
         The above command gives output for all users. To get the data&lt;br /&gt;
         for user &amp;quot;chirico&amp;quot; execute the following command:&lt;br /&gt;
&lt;br /&gt;
           $ lastcomm --user chirico&lt;br /&gt;
&lt;br /&gt;
         You can also get a summary of commands with sa.&lt;br /&gt;
&lt;br /&gt;
           [chirico@big ~]$ sa&lt;br /&gt;
           30       5.23re       0.00cp    10185k&lt;br /&gt;
           11       4.83re       0.00cp     8961k   ***other&lt;br /&gt;
            8       0.13re       0.00cp    19744k   nagios*&lt;br /&gt;
            4       0.00re       0.00cp     2542k   automount*&lt;br /&gt;
            3       0.00re       0.00cp      680k   sa&lt;br /&gt;
            2       0.13re       0.00cp    17424k   check_ping&lt;br /&gt;
            2       0.13re       0.00cp      978k   ping&lt;br /&gt;
&lt;br /&gt;
         To turn off accounting, execute accton without a filename.&lt;br /&gt;
&lt;br /&gt;
           $ accton&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 207:&lt;br /&gt;
&lt;br /&gt;
     CPU Temperature on a laptop. The following is the temperature&lt;br /&gt;
       of my Dell laptop. &lt;br /&gt;
&lt;br /&gt;
           $ cat /proc/acpi/thermal_zone/THM/temperature&lt;br /&gt;
           temperature:             58 C&lt;br /&gt;
&lt;br /&gt;
      &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 208:&lt;br /&gt;
&lt;br /&gt;
     script -f with mkfifo to allow another user to view what you type&lt;br /&gt;
          in real-time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Step 1.  Create a fifo (first in first out) file that the other&lt;br /&gt;
              user can view. For this example create the file /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
               [chirico@laptop ~]$ mkfifo /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
        Step 2.  Have the second user, voyeur user, cat this file. Output will block&lt;br /&gt;
              for them until you complete step 3. The other user, voyer,&lt;br /&gt;
              is executing the command below.&lt;br /&gt;
 &lt;br /&gt;
               [voyeur@laptop ~]$ cat /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
        Step 3.  The original user runs the following command.&lt;br /&gt;
&lt;br /&gt;
               [chirico@laptop ~]$ script -f  /tmp/scriptout&lt;br /&gt;
               Script started, file is /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
             Now anything typed, including a vi session, will be displayed to the&lt;br /&gt;
             voyeur user in step 2. &lt;br /&gt;
&lt;br /&gt;
        See TIP 46.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 209:&lt;br /&gt;
&lt;br /&gt;
     fsck forced on next reboot.  To do this, as root issue the following commands.&lt;br /&gt;
&lt;br /&gt;
            $ cd /&lt;br /&gt;
            $ touch forcefsck&lt;br /&gt;
&lt;br /&gt;
          Now reboot the system, and when it comes up fsck will be forced on the system.&lt;br /&gt;
&lt;br /&gt;
            $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 210:&lt;br /&gt;
&lt;br /&gt;
     /dev/random and /dev/urandom differ in their random generating properties. /dev/random&lt;br /&gt;
        only returns bytes when enough noise has been generated from the entropy pool. In&lt;br /&gt;
        contrast /dev/urandom will always return bytes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference: http://sourceforge.net/direct-dl/mchirico/cpearls/simple_but_common.tar.gz (rand.c)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 211:&lt;br /&gt;
&lt;br /&gt;
     Want to find out the speed of your NIC?  (Full Duplex or Half), then use ethtool.&lt;br /&gt;
&lt;br /&gt;
               [root@squeezel ~]# ethtool eth0&lt;br /&gt;
               Settings for eth0:&lt;br /&gt;
                       Supported ports: [ MII ]&lt;br /&gt;
                       Supported link modes:   10baseT/Half 10baseT/Full&lt;br /&gt;
                                               100baseT/Half 100baseT/Full&lt;br /&gt;
                                               1000baseT/Half 1000baseT/Full&lt;br /&gt;
                       Supports auto-negotiation: Yes&lt;br /&gt;
                       Advertised link modes:  10baseT/Half 10baseT/Full&lt;br /&gt;
                                               100baseT/Half 100baseT/Full&lt;br /&gt;
                                               1000baseT/Half 1000baseT/Full&lt;br /&gt;
                       Advertised auto-negotiation: Yes&lt;br /&gt;
                       Speed: 100Mb/s&lt;br /&gt;
                       Duplex: Full&lt;br /&gt;
                       Port: Twisted Pair&lt;br /&gt;
                       PHYAD: 1&lt;br /&gt;
                       Transceiver: internal&lt;br /&gt;
                       Auto-negotiation: on&lt;br /&gt;
                       Supports Wake-on: g&lt;br /&gt;
                       Wake-on: d&lt;br /&gt;
                       Current message level: 0x000000ff (255)&lt;br /&gt;
                       Link detected: yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 212:&lt;br /&gt;
&lt;br /&gt;
     rpm install hang? You might need to delete the lock state information. &lt;br /&gt;
&lt;br /&gt;
        $ nl /etc/rc.d/rc.sysinit | grep rpm&lt;br /&gt;
        720   rm -f /var/lib/rpm/__db* &amp;amp;&amp;gt; /dev/null&lt;br /&gt;
&lt;br /&gt;
     Note the command &lt;br /&gt;
&lt;br /&gt;
        $ rm -f /var/lib/rpm/__db*&lt;br /&gt;
&lt;br /&gt;
     Because sometimes you will run &amp;quot;rpm -ivh somerpm&amp;quot; and it will just sit&lt;br /&gt;
     there.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 213:&lt;br /&gt;
&lt;br /&gt;
     Apache - limit access to certain directories based on IP address in the&lt;br /&gt;
         httpd.conf file.&lt;br /&gt;
&lt;br /&gt;
          You can do this completely from /etc/httpd/conf/httpd.conf which&lt;br /&gt;
          are shown below for multiple IP addresses. Note that all 3 setting&lt;br /&gt;
          are the same.&lt;br /&gt;
&lt;br /&gt;
                10.0.0.0/255.0.0.0&lt;br /&gt;
                10.0.0.0/8&lt;br /&gt;
                10&lt;br /&gt;
&lt;br /&gt;
          However, the following is different&lt;br /&gt;
&lt;br /&gt;
                10.0.0.0/24   only allows 10.0.0.1 to 10.0.0.254&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Some complete settings in /etc/httpd/conf/httpd.conf &lt;br /&gt;
&lt;br /&gt;
             &amp;lt;Directory /var/www/html/chirico/&amp;gt;&lt;br /&gt;
                 Order allow,deny&lt;br /&gt;
                 Allow from 10.0.0.0/8      # All 10.&lt;br /&gt;
                 Allow from 192.168.0.0/16  # All 192.168&lt;br /&gt;
                 Allow from 127             # All 127.&lt;br /&gt;
             &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          Don't forget to reload httpd with the following command.&lt;br /&gt;
        &lt;br /&gt;
             $ /etc/init.d/httpd reload&lt;br /&gt;
&lt;br /&gt;
          &lt;br /&gt;
&lt;br /&gt;
TIP 214:&lt;br /&gt;
&lt;br /&gt;
     Open Files - determining how many files are currently open.&lt;br /&gt;
&lt;br /&gt;
             $ cat /proc/sys/fs/file-nr&lt;br /&gt;
             2030    263     104851&lt;br /&gt;
              |       |        \- maximum open file descriptors &lt;br /&gt;
              |       |         &lt;br /&gt;
              |       \- total free allocated file descriptors&lt;br /&gt;
              |&lt;br /&gt;
              (Total allocated file descriptors since boot)&lt;br /&gt;
&lt;br /&gt;
        Note the maximum number can be set or changed.&lt;br /&gt;
&lt;br /&gt;
              $ cat /proc/sys/fs/file-max&lt;br /&gt;
              104851&lt;br /&gt;
&lt;br /&gt;
        To change this&lt;br /&gt;
&lt;br /&gt;
              $ echo &amp;quot;804854&amp;quot; &amp;gt; /proc/sys/fs/file-max&lt;br /&gt;
 &lt;br /&gt;
        Note lsof | wc -l will report higher numbers because this includes&lt;br /&gt;
        open files that are not using file descriptors such as directories,&lt;br /&gt;
        memory mapped files, and executable text files.&lt;br /&gt;
&lt;br /&gt;
        (Reference http://www.netadmintools.com/art295.html&lt;br /&gt;
         and also see the man page for this: man 5 proc )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 215:&lt;br /&gt;
&lt;br /&gt;
     Ctrl-Alt-Del will cause an immediate reboot, without syncing dirty buffers by&lt;br /&gt;
     setting the value &amp;gt; 0 in /proc/sys/kernel/ctrl-alt-del.&lt;br /&gt;
&lt;br /&gt;
               $ echo 1 &amp;gt; /proc/sys/kernel/ctrl-alt-del&lt;br /&gt;
       &lt;br /&gt;
&lt;br /&gt;
        (Reference: man 5 proc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 216:&lt;br /&gt;
&lt;br /&gt;
     Redefining keys in X using xev and xmodmap.  The program xev, used in an X window &lt;br /&gt;
     terminal screen will display information on mouse movements, keys pressed and &lt;br /&gt;
     released.&lt;br /&gt;
&lt;br /&gt;
        $ xev&lt;br /&gt;
&lt;br /&gt;
     Now type shift-4 and you'll notice the event details below:&lt;br /&gt;
&lt;br /&gt;
        KeyPress event, serial 29, synthetic NO, window 0x3800001,&lt;br /&gt;
            root 0x60, subw 0x0, time 55307049, (418,242), root:(428,339),&lt;br /&gt;
            state 0x1, keycode 13 (keysym 0x24, dollar), same_screen YES,&lt;br /&gt;
            XLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
            XmbLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
            XFilterEvent returns: False&lt;br /&gt;
        &lt;br /&gt;
        KeyRelease event, serial 29, synthetic NO, window 0x3800001,&lt;br /&gt;
            root 0x60, subw 0x0, time 55307184, (418,242), root:(428,339),&lt;br /&gt;
            state 0x1, keycode 13 (keysym 0x24, dollar), same_screen YES,&lt;br /&gt;
            XLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
       &lt;br /&gt;
     So, if you want to redefine this key to say copyright, see (/usr/X11R6/include/X11/keysymdef.h)&lt;br /&gt;
     you would type the following.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 copyright'&lt;br /&gt;
&lt;br /&gt;
     To get the key back to the dollar, issue the following command.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 dollar'&lt;br /&gt;
&lt;br /&gt;
     By the way it's possible to define multiple key codes for a sigle key. You'll need&lt;br /&gt;
     to have a key defined as the Mode_switch. Perhaps you'd like to use the Windows key,&lt;br /&gt;
     or the key with the Microsoft logo on it, since you're using Linux. This key is&lt;br /&gt;
     keycode 115&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 115 = Mode_switch'&lt;br /&gt;
&lt;br /&gt;
     Now you could define 3 values to the shift-4. For this example use ld, Yen and dollar.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 dollar sterling yen'&lt;br /&gt;
&lt;br /&gt;
     So pressing the keys gives you the following:&lt;br /&gt;
&lt;br /&gt;
          shift-$          (dollar sign)&lt;br /&gt;
          Windows-$        (lb sign)&lt;br /&gt;
          Windows-shift-$  (Yen sign)&lt;br /&gt;
&lt;br /&gt;
     You could go crazy and redefine all you keys.&lt;br /&gt;
&lt;br /&gt;
     (Thanks to hisham for this tip).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 217:&lt;br /&gt;
&lt;br /&gt;
     Threads - which version of threads are you using?&lt;br /&gt;
&lt;br /&gt;
          $ getconf GNU_LIBPTHREAD_VERSION&lt;br /&gt;
          NPTL 2.3.90&lt;br /&gt;
&lt;br /&gt;
     For a history on threads used with gcc reference the following:&lt;br /&gt;
          &lt;br /&gt;
          http://en.wikipedia.org/wiki/NPTL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 218:&lt;br /&gt;
&lt;br /&gt;
     Screenshots using ImageMagick. &lt;br /&gt;
&lt;br /&gt;
        If you want the entire screen, execute the following:&lt;br /&gt;
&lt;br /&gt;
            $ import -window root screen.png&lt;br /&gt;
&lt;br /&gt;
        Or to crosshair select the region with your mouse, execute &lt;br /&gt;
        the following instead.&lt;br /&gt;
&lt;br /&gt;
            $ import screen.png&lt;br /&gt;
&lt;br /&gt;
        KDE has the ability to take screenshots with the command below.&lt;br /&gt;
&lt;br /&gt;
            $ ksnapshot&lt;br /&gt;
&lt;br /&gt;
        GNOME likewise has a command too.&lt;br /&gt;
&lt;br /&gt;
            $ gnome-panel-screenshot --delay 6&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Visting ImageMagick again, the xwininfo command give window information and the id can be&lt;br /&gt;
        used to capture images with the import command.&lt;br /&gt;
&lt;br /&gt;
            $ xwininfo&lt;br /&gt;
&lt;br /&gt;
          xwininfo: Please select the window about which you&lt;br /&gt;
          would like information by clicking the&lt;br /&gt;
          mouse in that window.&lt;br /&gt;
&lt;br /&gt;
          xwininfo: Window id: 0x1e00007 &amp;quot;chirico@squeezel:/work/svn/souptonuts - Shell - Konsole&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          Absolute upper-left X:  4&lt;br /&gt;
          Absolute upper-left Y:  21&lt;br /&gt;
          Relative upper-left X:  0&lt;br /&gt;
          Relative upper-left Y:  0&lt;br /&gt;
          Width: 880&lt;br /&gt;
          Height: 510&lt;br /&gt;
          Depth: 24&lt;br /&gt;
          Visual Class: TrueColor&lt;br /&gt;
          Border width: 0&lt;br /&gt;
          Class: InputOutput&lt;br /&gt;
          Colormap: 0x20 (installed)&lt;br /&gt;
          Bit Gravity State: NorthWestGravity&lt;br /&gt;
          Window Gravity State: NorthWestGravity&lt;br /&gt;
          Backing Store State: NotUseful&lt;br /&gt;
          Save Under State: no&lt;br /&gt;
          Map State: IsViewable&lt;br /&gt;
          Override Redirect State: no&lt;br /&gt;
          Corners:  +4+21  -396+21  -396-493  +4-493&lt;br /&gt;
          -geometry 880x510+0+0&lt;br /&gt;
&lt;br /&gt;
        Now use the import command with the Window id. My example is shown below.&lt;br /&gt;
&lt;br /&gt;
             $ import -window 0x1e00007  id.miff&lt;br /&gt;
&lt;br /&gt;
        And to quickly display this image that you just saved, use the display command.&lt;br /&gt;
&lt;br /&gt;
             $ display id.miff &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 219:&lt;br /&gt;
&lt;br /&gt;
     File Access over SSH using FUSE (Filesystem in USErspace). This is a very good way to &lt;br /&gt;
     mount a remote filesystem locally. It's  like a secure NFS mount, but you don't require &lt;br /&gt;
     admin privileges on the remote computer. You do need to have fuse-sshfs installed on &lt;br /&gt;
     the local computer that will perform the filesystem mount.&lt;br /&gt;
&lt;br /&gt;
     The following works with Fedora Core 5. Only the users added to the fuse group can mout &lt;br /&gt;
     external drives. Below the user chirico is being added to the group fuse.&lt;br /&gt;
&lt;br /&gt;
             $ yum install fuse-sshfs&lt;br /&gt;
             $ usermod -a -G fuse chirico&lt;br /&gt;
     &lt;br /&gt;
     You'll need to reboot.&lt;br /&gt;
&lt;br /&gt;
             $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
             &lt;br /&gt;
     Next I'm going to mount the remote filesystem v0.squeezel.com. This is done as user chirico&lt;br /&gt;
     on the local computer. I'm using root on the remote computer v0.squeezel.com because I&lt;br /&gt;
     want to mount the complete drive.&lt;br /&gt;
&lt;br /&gt;
             $ mkdir v0&lt;br /&gt;
             $ sshfs root@v0.squeezel.com:/  v0&lt;br /&gt;
             $ cd v0&lt;br /&gt;
             $ ls -l&lt;br /&gt;
               bin   dev  home  lost+found     media  mnt  opt   q     sbin     srv  tmp  var&lt;br /&gt;
               boot  etc  lib   master_backup  misc   net  proc  root  selinux  sys  usr&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
     Now to unmount the filesystem&lt;br /&gt;
&lt;br /&gt;
             $ fusermount -u /home/chirico/v0&lt;br /&gt;
&lt;br /&gt;
     Yes, you can mount the filesystem on boot. Below shows an example entry for /etc/fstab, but&lt;br /&gt;
     this only allows user on the current system to view what is is /mnt/v0. &lt;br /&gt;
&lt;br /&gt;
             sshfs#root@v0.squeezel.com:/var/log             /mnt/v0 fuse defaults    0 0&lt;br /&gt;
&lt;br /&gt;
     References:&lt;br /&gt;
        (http://fuse.sourceforge.net/sshfs.html)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 220:&lt;br /&gt;
&lt;br /&gt;
     OpenVPN - A full-featured SSL VPN solution. The following demonstrates&lt;br /&gt;
               a very simple OpenVPN setup between two Fedora Core 5 computers&lt;br /&gt;
               big.squeezel.com 192.168.1.12 and tape.squeezel.com 192.168.1.155&lt;br /&gt;
&lt;br /&gt;
               As root install the package on both computers.&lt;br /&gt;
&lt;br /&gt;
                  $ yum -y install openvpn&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Setup on big.squeezel.com 192.168.1.12&lt;br /&gt;
&lt;br /&gt;
                  $ iptables -A INPUT -p udp -s 192.168.1.155  --dport 1194 -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tun+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A FORWARD -i tap+ -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
             Note - make sure you have commented out the following line &lt;br /&gt;
                    in /etc/sysconfig/iptables&lt;br /&gt;
&lt;br /&gt;
                  # -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
&lt;br /&gt;
             Now from continuting with the commands that need to be executed on &lt;br /&gt;
             big.squeezel.com 192.168.1.12 do one of the following&lt;br /&gt;
           &lt;br /&gt;
                  $ openvpn --remote tape.squeezel.com  --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 --verb 9&lt;br /&gt;
&lt;br /&gt;
             The above statement gives lots of errors. Once it's working you may want&lt;br /&gt;
             the following statement without the --verb 9 option.&lt;br /&gt;
&lt;br /&gt;
                  $ openvpn --remote tape.squeezel.com  --dev tun1 --ifconfig 10.4.0.1 10.4.0.2&lt;br /&gt;
&lt;br /&gt;
             After you finish the setup commands for tape.squeezel.com immediately below, you'll be&lt;br /&gt;
             able to access tape.squeezel.com as 10.4.0.2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Setup on tape.squeezel.com 192.168.1.155&lt;br /&gt;
&lt;br /&gt;
                  $ iptables -A INPUT -p udp -s 192.168.1.12  --dport 1194 -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tun+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A FORWARD -i tap+ -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
             Note - again, make sure you have commented out the following line &lt;br /&gt;
                    in /etc/sysconfig/iptables&lt;br /&gt;
&lt;br /&gt;
                  # -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
&lt;br /&gt;
             The openvpn commands are tape.squeezel.com are reversed from what is shown&lt;br /&gt;
             above.&lt;br /&gt;
&lt;br /&gt;
                  $ openvpn --remote big.squeezel.com --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 --verb 9&lt;br /&gt;
&lt;br /&gt;
             Or&lt;br /&gt;
                  $ openvpn --remote big.squeezel.com --dev tun1 --ifconfig 10.4.0.2 10.4.0.1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             Now you can access all services and ports from big.squeezel.com on 10.4.0.1 for &lt;br /&gt;
             such services as MySQL, secure Web, imap, etc. A quick test is nmap as follows:&lt;br /&gt;
&lt;br /&gt;
                  $ nmap -A -T4 10.4.0.1&lt;br /&gt;
&lt;br /&gt;
                  Starting Nmap 4.03 ( http://www.insecure.org/nmap/ ) at 2006-05-20 13:54 EDT&lt;br /&gt;
                  Interesting ports on 10.4.0.1:&lt;br /&gt;
                  (The 1671 ports scanned but not shown below are in state: closed)&lt;br /&gt;
                  PORT     STATE SERVICE VERSION&lt;br /&gt;
                  22/tcp   open  ssh     OpenSSH 4.3 (protocol 2.0)&lt;br /&gt;
                  111/tcp  open  rpcbind  2 (rpc #100000)&lt;br /&gt;
                  3306/tcp open  mysql   MySQL (unauthorized)&lt;br /&gt;
&lt;br /&gt;
                  Nmap finished: 1 IP address (1 host up) scanned in 7.116 seconds&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 221:&lt;br /&gt;
&lt;br /&gt;
     openssl - Some common commands.&lt;br /&gt;
&lt;br /&gt;
             Finding the openssldir (Directory for OpenSSL files).&lt;br /&gt;
&lt;br /&gt;
                  $ openssl version -a|grep OPENSSLDIR&lt;br /&gt;
                  OPENSSLDIR: &amp;quot;/etc/pki/tls&amp;quot;&lt;br /&gt;
&lt;br /&gt;
             Connect to a secure SMTP server with STARTTLS, assuming the server name is&lt;br /&gt;
             squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
                  $ openssl s_client -connect squeezel.squeezel.com:25 -starttls&lt;br /&gt;
&lt;br /&gt;
         &lt;br /&gt;
&lt;br /&gt;
      Reference (http://www.madboa.com/geek/openssl/)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 222:&lt;br /&gt;
&lt;br /&gt;
     Bash functions. This is easy, and I find it very useful to create bash functions&lt;br /&gt;
     for repeated commands. For example, suppose you want to create a quick bash function&lt;br /&gt;
     to cd to /var/log, tail messages and tail secure. You can create this function as&lt;br /&gt;
     follows:&lt;br /&gt;
&lt;br /&gt;
                  [root@v5 log]# m()&lt;br /&gt;
                  m()&lt;br /&gt;
                  &amp;gt; { cd /var/log&lt;br /&gt;
                  { cd /var/log&lt;br /&gt;
                  &amp;gt; tail messages&lt;br /&gt;
                  tail messages&lt;br /&gt;
                  &amp;gt; tail secure&lt;br /&gt;
                  tail secure&lt;br /&gt;
                  &amp;gt; }&lt;br /&gt;
                  }&lt;br /&gt;
                  &lt;br /&gt;
     Above I'm typing m() then hitting return. Note the echo on the next line followed&lt;br /&gt;
     by the prompt &amp;gt;. I then enter {. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 223:&lt;br /&gt;
&lt;br /&gt;
     Stats on DNS Server. You can get stats on your DNS server. &lt;br /&gt;
&lt;br /&gt;
       The following works for BIND 9:&lt;br /&gt;
&lt;br /&gt;
                  $ rndc stats&lt;br /&gt;
&lt;br /&gt;
         On my system I see the output in &amp;quot;/var/named/chroot/var/named/data/named_stats.txt&amp;quot;, which&lt;br /&gt;
         if an FC4 system. By the way, if you're using BIND 8, the command is &amp;quot;ndc stats&amp;quot;, but that&lt;br /&gt;
         has a completely different format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Format of the output&lt;br /&gt;
&lt;br /&gt;
            +++ Statistics Dump +++ (1153791199)&lt;br /&gt;
            success 297621&lt;br /&gt;
            referral 32&lt;br /&gt;
            nxrrset 21953&lt;br /&gt;
            nxdomain 33742&lt;br /&gt;
            recursion 28243&lt;br /&gt;
            failure 54&lt;br /&gt;
            --- Statistics Dump --- (1153791199)&lt;br /&gt;
&lt;br /&gt;
      The number (1153791199) can be converted with the date command.&lt;br /&gt;
&lt;br /&gt;
                  $ date -d '1970-01-01 1153791199 sec'&lt;br /&gt;
                  Tue Jul 25 02:33:19 EDT 2006&lt;br /&gt;
&lt;br /&gt;
      That's 1153791199 seconds since 1970-01-01 UCT. Which is 4 hours fast,&lt;br /&gt;
      from EDT.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 224:&lt;br /&gt;
&lt;br /&gt;
     snmp - simple network monitoring protocol. The following steps setup snmp on Fedora Core 5.&lt;br /&gt;
&lt;br /&gt;
                  $ yum install net-snmp*&lt;br /&gt;
&lt;br /&gt;
         Next add the following line in &amp;quot;/etc/snmp/snmpd.conf&amp;quot; at the bottom.&lt;br /&gt;
&lt;br /&gt;
                  rocommunity pA33worD&lt;br /&gt;
&lt;br /&gt;
         Start the snmp service.&lt;br /&gt;
&lt;br /&gt;
                  $ /etc/init.d/snmpd restart&lt;br /&gt;
&lt;br /&gt;
         Once started, from the command prompt, it's possible to get stats on the computer.&lt;br /&gt;
&lt;br /&gt;
                  $ snmpwalk -v 1 -c pA33worD localhost system&lt;br /&gt;
         Or&lt;br /&gt;
                  $ snmpwalk -v 1 -c pA33worD localhost interface&lt;br /&gt;
&lt;br /&gt;
         Or&lt;br /&gt;
                  $ snmpgetnext -v 1 -c pA33worD localhost sysUpTime&lt;br /&gt;
                  DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (26452) 0:04:24.52&lt;br /&gt;
&lt;br /&gt;
         Note the Timeticks is in 100th of a second. So the computer above has been running&lt;br /&gt;
         for 264.52 seconds.&lt;br /&gt;
&lt;br /&gt;
         Reference( TIP 225 shows how to use MRTG for gathering snmp stats).&lt;br /&gt;
                  http://www.net-snmp.org/tutorial/tutorial-5/commands/snmpv3.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 225:&lt;br /&gt;
&lt;br /&gt;
     MRTG - Multi Router Traffic Grapher.  &lt;br /&gt;
&lt;br /&gt;
                  $ cfgmaker --output=/etc/mrtg/v5.squeezel.com \&lt;br /&gt;
                    ifref=ip --global &amp;quot;workdir:/var/www/html/mrtg/stats&amp;quot;\&lt;br /&gt;
                    pA33worD@v5.squeezel.com&lt;br /&gt;
&lt;br /&gt;
        Reference: http://www.chinalinuxpub.com/doc/www.siliconvalleyccie.com/linux-hn/mrtg.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 226:&lt;br /&gt;
&lt;br /&gt;
     Back Trace - This is a method of getting a back trace for all processes on the system.&lt;br /&gt;
                  it assumes the following: a. Kernel was build with CONFIG_MAGIC_SYS-REQ &lt;br /&gt;
                  enabled (which Fedora 5 kernels are) b. You can get direct access to the &lt;br /&gt;
                  monitor.&lt;br /&gt;
&lt;br /&gt;
             Step 1.&lt;br /&gt;
&lt;br /&gt;
                  Ctl-Alt-F1 (This brings you to the text console)&lt;br /&gt;
&lt;br /&gt;
             Step 2.&lt;br /&gt;
&lt;br /&gt;
                  Alt-ScrollLock &lt;br /&gt;
                  Ctl-ScrollLock&lt;br /&gt;
          &lt;br /&gt;
                  Note above that's Alt-ScrollLock followed by Ctl-ScrollLock. You should see&lt;br /&gt;
                  a lot of text on the screen. To fast to read, but don't worry the text will&lt;br /&gt;
                  be in /var/log/messages at the end.&lt;br /&gt;
&lt;br /&gt;
                  On my system the ScrollLock key is next to the NumLock key. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 227:&lt;br /&gt;
&lt;br /&gt;
     Ext3 Tuning - One advantage of Ext3 over Ext2 is directory indexing, which  imporves file&lt;br /&gt;
                  access in directories containing large files or when the directory contains&lt;br /&gt;
                  many files. Directory indexing improves performance by using hashed binary &lt;br /&gt;
                  trees. &lt;br /&gt;
&lt;br /&gt;
                  There are two ways to enable dir_index. First, find the device using the mount&lt;br /&gt;
                  command.&lt;br /&gt;
&lt;br /&gt;
                      $ mount&lt;br /&gt;
&lt;br /&gt;
                      /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)&lt;br /&gt;
                      proc on /proc type proc (rw)&lt;br /&gt;
                      sysfs on /sys type sysfs (rw)&lt;br /&gt;
                      devpts on /dev/pts type devpts (rw,gid=5,mode=620)&lt;br /&gt;
                      /dev/sda1 on /boot type ext3 (rw) &amp;lt;--- This is the one you want&lt;br /&gt;
                      tmpfs on /dev/shm type tmpfs (rw)&lt;br /&gt;
                      none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)&lt;br /&gt;
                      sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)&lt;br /&gt;
                      automount(pid2001) on /net type autofs (rw,fd=4,pgrp=2001,minproto=2,maxproto=4)                   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                  From the above command, the device used is /dev/sda1.  Using the tune2fs command,&lt;br /&gt;
                  directory indexing will only apply to directories created after running the &lt;br /&gt;
                  command below.               &lt;br /&gt;
&lt;br /&gt;
                       $ tune2fs -O dir_index /dev/sda1&lt;br /&gt;
&lt;br /&gt;
                  However, if you want it to apply to all directories, use the e2fsck command as  &lt;br /&gt;
                  shown below:&lt;br /&gt;
&lt;br /&gt;
                       $ e2fsck -D -f /dev/sda1&lt;br /&gt;
&lt;br /&gt;
                  You'll need to bypass the warning message.&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
     Reference: &amp;quot;Tuning Journaling File Systems: A small amount of effort an dtime can yield big&lt;br /&gt;
                results&amp;quot;,by Steve Best. Linux Magazine, September 10, 2006. This author as has&lt;br /&gt;
                a very good book titled: &amp;quot;Linux Debugging and Performance Tuning.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 228:&lt;br /&gt;
&lt;br /&gt;
     NIC bonding - binding two or more NICs to one IP address to improve performance. The following&lt;br /&gt;
                instructions were done on Fedora Core 5.&lt;br /&gt;
&lt;br /&gt;
         Step 1.&lt;br /&gt;
             &lt;br /&gt;
            Create the file ifcfg-bond0 with the IP address, netmask and gateway. Shown&lt;br /&gt;
            below is my file.&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-bond0&lt;br /&gt;
&lt;br /&gt;
                   DEVICE=bond0&lt;br /&gt;
                   IPADDR=192.168.1.12&lt;br /&gt;
                   NETMASK=255.255.255.0&lt;br /&gt;
                   GATEWAY=192.168.1.1&lt;br /&gt;
                   USERCTL=no&lt;br /&gt;
                   BOOTPROTO=none&lt;br /&gt;
                   ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
         Step 2.&lt;br /&gt;
&lt;br /&gt;
            Modify eth0, eth1 and eth2. Shown below are each one of my files. Note that&lt;br /&gt;
            you must comment out, or remove the ip address, netmask, gateway and hardware&lt;br /&gt;
            address from each one of these files, since settings should only come from&lt;br /&gt;
            the ifcfg-bond0 file above. I've chosen to comment out the lines, instead of &lt;br /&gt;
            removing, should I decide to unbond my NICS sometime in the future.&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth0&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:9D&lt;br /&gt;
                  #IPADDR=192.168.1.12&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  #GATEWAY=192.168.1.1&lt;br /&gt;
                  #USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  # Settings for Bond&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth1&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth1&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:C9&lt;br /&gt;
                  #IPADDR=192.168.1.13&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  #&lt;br /&gt;
                  # Settings for bonding&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth2&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth2&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:9D&lt;br /&gt;
                  #IPADDR=192.168.1.12&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  #GATEWAY=192.168.1.1&lt;br /&gt;
                  #USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
         Step 3.&lt;br /&gt;
&lt;br /&gt;
            Set the load parameters for bond0 bonding kernel module. Append the&lt;br /&gt;
            following lines to /etc/modprobe.conf &lt;br /&gt;
&lt;br /&gt;
                 # bonding commands &lt;br /&gt;
                 alias bond0 bonding&lt;br /&gt;
                 options bond0 mode=balance-alb miimon=100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Step 4.&lt;br /&gt;
&lt;br /&gt;
            Load the bond driver module from the command prompt.&lt;br /&gt;
&lt;br /&gt;
                 $ modprobe bonding&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Step 5.&lt;br /&gt;
&lt;br /&gt;
            Restart the network, or restart the computer. Note I restarted to computer,&lt;br /&gt;
            since my NICs above had MAC assignments.&lt;br /&gt;
&lt;br /&gt;
                 $ service network restart   # Or restart computer&lt;br /&gt;
&lt;br /&gt;
             Take a look at the proc settings. &lt;br /&gt;
&lt;br /&gt;
                 $ cat /proc/net/bonding/bond0 &lt;br /&gt;
                 Ethernet Channel Bonding Driver: v3.0.3 (March 23, 2006)&lt;br /&gt;
&lt;br /&gt;
                 Bonding Mode: adaptive load balancing&lt;br /&gt;
                 Primary Slave: None&lt;br /&gt;
                 Currently Active Slave: eth2&lt;br /&gt;
                 MII Status: up&lt;br /&gt;
                 MII Polling Interval (ms): 100&lt;br /&gt;
                 Up Delay (ms): 0&lt;br /&gt;
                 Down Delay (ms): 0&lt;br /&gt;
&lt;br /&gt;
                 Slave Interface: eth2&lt;br /&gt;
                 MII Status: up&lt;br /&gt;
                 Link Failure Count: 0&lt;br /&gt;
                 Permanent HW addr: 00:13:72:80:62:f0&lt;br /&gt;
            &lt;br /&gt;
     References:&lt;br /&gt;
&lt;br /&gt;
         http://www.cyberciti.biz/nixcraft/vivek/blogger/2006/04/linux-bond-or-team-multiple-network.php&lt;br /&gt;
          Good, well written article describing the steps above.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=24692&amp;amp;package_id=146474&lt;br /&gt;
          Documentation for bonding that can also be found in the kernel&lt;br /&gt;
          ./Documentation/networking/bonding.txt&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 229:&lt;br /&gt;
&lt;br /&gt;
     /etc/nsswitch.conf - System Databases and Name Service Switch configuration file. &lt;br /&gt;
&lt;br /&gt;
         This file determines lookup order of services. For example, to match a name&lt;br /&gt;
         to an IP address, an entry can be put into the /etc/hosts file. Or a DNS query&lt;br /&gt;
         can be made. What's the order?  Normally, it's the entry in the /etc/hosts file.&lt;br /&gt;
         because /etc/nsswitch.conf contains the following setting&lt;br /&gt;
        &lt;br /&gt;
            hosts:      files dns&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	 See man nsswitch.conf for more settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
THE FOLLOWING SECTIONS STARTS THE PROGRAMMING TIPS&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 1:&lt;br /&gt;
&lt;br /&gt;
     Simple open command that restarts the close if a signal&lt;br /&gt;
     occurs.  Also note, the POSIX standards committee decided&lt;br /&gt;
     all new functions would not use errno and would instead&lt;br /&gt;
     directly return the error number in the function.&lt;br /&gt;
&lt;br /&gt;
     A lot of functions return -1 on an error condition, then,&lt;br /&gt;
     set errno to the value of the error.  This will still work&lt;br /&gt;
     for all the well known functions; but, it's changing.&lt;br /&gt;
&lt;br /&gt;
     /* start of code open.c&lt;br /&gt;
        Compile gcc -o open open.c&lt;br /&gt;
&lt;br /&gt;
        Reference (Look for simple_but_common_x.x.x.tar.gz):&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79066&lt;br /&gt;
&lt;br /&gt;
                             */&lt;br /&gt;
     #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     #include &amp;lt;string.h&amp;gt;             /* for strerror(int errno) */&lt;br /&gt;
     #include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     #define BUFLEN 100&lt;br /&gt;
     extern int errno;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     int&lt;br /&gt;
     main (void)&lt;br /&gt;
     {&lt;br /&gt;
       int fp,error;&lt;br /&gt;
       char buf[BUFLEN+1];&lt;br /&gt;
&lt;br /&gt;
       if ((fp = open (&amp;quot;data&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1)&lt;br /&gt;
         {&lt;br /&gt;
           fprintf (stderr, &amp;quot;Can't open data: %s\n&amp;quot;, strerror (errno));&lt;br /&gt;
           return 1;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
       snprintf (buf, BUFLEN, &amp;quot;123&amp;quot;);&lt;br /&gt;
       write (fp, buf, strlen (buf));&lt;br /&gt;
&lt;br /&gt;
       // Restart close should a signal occur */&lt;br /&gt;
       while((( error = close (fp) ) == -1) &amp;amp;&amp;amp; (errno == EINTR));&lt;br /&gt;
       if(error == -1)&lt;br /&gt;
         perror(&amp;quot;Failed to close the file\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
       return 0;&lt;br /&gt;
      }&lt;br /&gt;
     /* end of open.c */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 2:&lt;br /&gt;
&lt;br /&gt;
     Example of setting the effective UID on a file&lt;br /&gt;
&lt;br /&gt;
     /*  start of code&lt;br /&gt;
       gcc uid_open.c -o uid_open&lt;br /&gt;
       su&lt;br /&gt;
       chown root.chirico uid_open&lt;br /&gt;
       chmod u+s uid_open&lt;br /&gt;
       exit&lt;br /&gt;
&lt;br /&gt;
       Now you can run this as chirico and write to the&lt;br /&gt;
       root directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     */&lt;br /&gt;
     #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;string.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     int main()&lt;br /&gt;
     {&lt;br /&gt;
             int fd;&lt;br /&gt;
&lt;br /&gt;
             if ((fd = open(&amp;quot;/root/datajunk&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1) {&lt;br /&gt;
                     fprintf(stderr, &amp;quot;Can't open file \n&amp;quot;);&lt;br /&gt;
                     return 1;&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
             write(fd, &amp;quot;0123456&amp;quot;, strlen(&amp;quot;0123456&amp;quot;));&lt;br /&gt;
             close(fd);&lt;br /&gt;
             return 0;&lt;br /&gt;
     }&lt;br /&gt;
&lt;br /&gt;
     /* end of code */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 3:&lt;br /&gt;
&lt;br /&gt;
     Writing a C http post.&lt;br /&gt;
&lt;br /&gt;
     For downloads reference:&lt;br /&gt;
      http://prdownloads.sourceforge.net/cpearls/spider.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 4:&lt;br /&gt;
&lt;br /&gt;
     Writing a 2.6.x Kernel Module:&lt;br /&gt;
&lt;br /&gt;
       Look for the latest version of &amp;quot;procreadwrite&amp;quot;.  This is a 2.6 kernel&lt;br /&gt;
       modules that demonstrates how to create /proc entires and write directly&lt;br /&gt;
       to user-land via tty.  It's updated to reflect replacement of &amp;quot;current-&amp;gt;tty&amp;quot;&lt;br /&gt;
       with &amp;quot;current-&amp;gt;signal-&amp;gt;tty&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79066&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 5:&lt;br /&gt;
&lt;br /&gt;
     Creating a filename with '\n'.  This goes with (TIP 71)&lt;br /&gt;
&lt;br /&gt;
         /**** topen.c ***********************************************************&lt;br /&gt;
           Filenames can be created with any character except the null character&lt;br /&gt;
           and a slash.&lt;br /&gt;
&lt;br /&gt;
           This example creates a file with returns '\n\n'&lt;br /&gt;
&lt;br /&gt;
           There's a way to remove a file by inode:&lt;br /&gt;
&lt;br /&gt;
               $ ls -libt *&lt;br /&gt;
&lt;br /&gt;
           And, once you know the inode&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec mv '{}' goodstuff \;&lt;br /&gt;
&lt;br /&gt;
           or&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec rm '{}' goodstuff \;&lt;br /&gt;
&lt;br /&gt;
           or&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec cat '{}' \;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Compile:&lt;br /&gt;
&lt;br /&gt;
             gcc -o topen -Wall -W -O2 -s -pipe  topen.c&lt;br /&gt;
&lt;br /&gt;
         Reference:&lt;br /&gt;
           http://prdownloads.sourceforge.net/cpearls/simple_but_common_0.0.14.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
         */&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         #include &amp;lt;string.h&amp;gt;             /* for strerror(int errno) */&lt;br /&gt;
         #include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         #define BUFLEN 100&lt;br /&gt;
         extern int errno;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         int&lt;br /&gt;
         main (void)&lt;br /&gt;
         {&lt;br /&gt;
           int fp,error;&lt;br /&gt;
           char buf[BUFLEN+1];&lt;br /&gt;
&lt;br /&gt;
           if ((fp = open (&amp;quot;\n\n\n\n\n\n\n\n\n&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1)&lt;br /&gt;
             {&lt;br /&gt;
               fprintf (stderr, &amp;quot;Can't open data: %s\n&amp;quot;, strerror (errno));&lt;br /&gt;
               return 1;&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
           snprintf (buf, BUFLEN, &amp;quot;123&amp;quot;);&lt;br /&gt;
           write (fp, buf, strlen (buf));&lt;br /&gt;
&lt;br /&gt;
           // Restart close should a signal occur */&lt;br /&gt;
           while((( error = close (fp) ) == -1) &amp;amp;&amp;amp; (errno == EINTR));&lt;br /&gt;
           if(error == -1)&lt;br /&gt;
             perror(&amp;quot;Failed to close the file\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
           return 0;&lt;br /&gt;
&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  **Note, if you want email notification after every 50 new tips have been&lt;br /&gt;
    added, then, click on the following link:&lt;br /&gt;
&lt;br /&gt;
     https://sourceforge.net/project/filemodule_monitor.php?filemodule_id=120838&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 6:&lt;br /&gt;
&lt;br /&gt;
     Working With The Lemon Parser Generator.&lt;br /&gt;
     http://prdownloads.sourceforge.net/souptonuts/lemon_examples.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 7:&lt;br /&gt;
&lt;br /&gt;
     copy command for std container output.&lt;br /&gt;
&lt;br /&gt;
        #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
        #include &amp;lt;list&amp;gt;&lt;br /&gt;
        #include &amp;lt;vector&amp;gt;&lt;br /&gt;
        #include &amp;lt;iterator&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        using namespace std;&lt;br /&gt;
        int main(void)&lt;br /&gt;
        {&lt;br /&gt;
          vector&amp;lt;int&amp;gt; v;&lt;br /&gt;
          list&amp;lt;int&amp;gt; l;&lt;br /&gt;
&lt;br /&gt;
          v.push_back(1);&lt;br /&gt;
          v.push_back(2);&lt;br /&gt;
          copy(v.begin(),v.end(),ostream_iterator&amp;lt;int&amp;gt;(cout,&amp;quot;\n&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          l.push_back(23);&lt;br /&gt;
          l.push_back(12);&lt;br /&gt;
          copy(l.begin(),l.end(),ostream_iterator&amp;lt;int&amp;gt;(cout,&amp;quot;\n&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 8:&lt;br /&gt;
&lt;br /&gt;
  /* Copyright (c) 2005 Mike Chirico mchirico@comcast.net mchirico@users.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Example of using virtual functions. Note the use of &amp;quot;initialization lists&amp;quot;&lt;br /&gt;
              for assinging the variable first and last.&lt;br /&gt;
&lt;br /&gt;
      Compile:&lt;br /&gt;
        g++ -o virtualfunc -Wall -W -O2 -s -pipe  virtual_function.cc&lt;br /&gt;
&lt;br /&gt;
      Download:&lt;br /&gt;
        http://prdownloads.sourceforge.net/cpearls/simple_but_common_cpp.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  */&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
  #include &amp;lt;string&amp;gt;&lt;br /&gt;
  #include &amp;lt;list&amp;gt;&lt;br /&gt;
  #include &amp;lt;algorithm&amp;gt;&lt;br /&gt;
  #include &amp;lt;iterator&amp;gt;&lt;br /&gt;
  #include &amp;lt;functional&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  using namespace std;&lt;br /&gt;
&lt;br /&gt;
  class Employee {&lt;br /&gt;
  string first,last;&lt;br /&gt;
  public:&lt;br /&gt;
    Employee(const string&amp;amp; fn=&amp;quot;John&amp;quot;,const  string&amp;amp; ln=&amp;quot;Smith&amp;quot;): first(fn),last(ln) {}&lt;br /&gt;
    virtual void print() const {&lt;br /&gt;
    cout &amp;lt;&amp;lt; &amp;quot;First name: &amp;quot; &amp;lt;&amp;lt; first &amp;lt;&amp;lt; &amp;quot;, Last name: &amp;quot; &amp;lt;&amp;lt; last &amp;lt;&amp;lt; endl;&lt;br /&gt;
    }&lt;br /&gt;
    virtual ~Employee() {}&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  class Manager : public Employee {&lt;br /&gt;
    int level;&lt;br /&gt;
    list&amp;lt;Employee*&amp;gt; subordinates;&lt;br /&gt;
  public:&lt;br /&gt;
    Manager(const string&amp;amp; fn=&amp;quot;Ivan&amp;quot;,const string&amp;amp; ln=&amp;quot;Stedwick&amp;quot;, int lvl=1): Employee(fn,ln), level(lvl) {}&lt;br /&gt;
    void print() {&lt;br /&gt;
      cout &amp;lt;&amp;lt; &amp;quot;Manager level: &amp;quot; &amp;lt;&amp;lt; level &amp;lt;&amp;lt; &amp;quot;  &amp;quot;;&lt;br /&gt;
      Employee::print();&lt;br /&gt;
      cout &amp;lt;&amp;lt; &amp;quot;Supervises:&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
      for_each(subordinates.begin(),subordinates.end(),mem_fun(&amp;amp;Employee::print));&lt;br /&gt;
      cout &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; endl;&lt;br /&gt;
    }&lt;br /&gt;
    void addstaff(Employee&amp;amp; staff){&lt;br /&gt;
      subordinates.push_front(&amp;amp;staff);&lt;br /&gt;
    }&lt;br /&gt;
    void addstaff(Employee* staff){&lt;br /&gt;
      subordinates.push_front(staff);&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   int main()&lt;br /&gt;
   {&lt;br /&gt;
     Employee p0(&amp;quot;Lisa&amp;quot;,&amp;quot;Payne&amp;quot;);&lt;br /&gt;
     Manager m0;&lt;br /&gt;
&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Zoe&amp;quot;,&amp;quot;Bear&amp;quot;)); /* uses void addstaff(Employee* staff) */&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Leah&amp;quot;,&amp;quot;Bopper&amp;quot;));&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Abby&amp;quot;,&amp;quot;Chicken&amp;quot;));&lt;br /&gt;
     m0.addstaff(p0);  /* void addstaff(Employee&amp;amp; staff)  needed for this one */&lt;br /&gt;
     m0.addstaff(new Employee());&lt;br /&gt;
     m0.print();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     return 0;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 9:&lt;br /&gt;
&lt;br /&gt;
   /*  Named Constructor Idiom.&lt;br /&gt;
       Reference: http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.6&lt;br /&gt;
&lt;br /&gt;
   */&lt;br /&gt;
   #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
   #include &amp;lt;cmath&amp;gt;&lt;br /&gt;
   using namespace std;&lt;br /&gt;
&lt;br /&gt;
   class Point {&lt;br /&gt;
&lt;br /&gt;
   public:&lt;br /&gt;
     static Point rectangular(float x, float y);&lt;br /&gt;
     static Point polar(float radius, float angle);&lt;br /&gt;
     float get_x() { return x_; }&lt;br /&gt;
     float get_y() { return y_; }&lt;br /&gt;
&lt;br /&gt;
   private:&lt;br /&gt;
     Point(float x, float y);&lt;br /&gt;
     float x_, y_;&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
   inline Point::Point(float x, float y)&lt;br /&gt;
     : x_(x), y_(y) {}&lt;br /&gt;
&lt;br /&gt;
   inline Point Point::rectangular(float x, float y)&lt;br /&gt;
   { return Point(x,y); }&lt;br /&gt;
&lt;br /&gt;
   inline Point Point::polar(float radius, float angle)&lt;br /&gt;
   { return Point(radius*cos(angle),radius*sin(angle)); }&lt;br /&gt;
&lt;br /&gt;
   int main(void)&lt;br /&gt;
   {&lt;br /&gt;
     Point p1 = Point::rectangular(5.7,1.2);&lt;br /&gt;
     Point p2 = Point::polar(5.7,1.2);&lt;br /&gt;
&lt;br /&gt;
     cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; p1.get_x() &amp;lt;&amp;lt; &amp;quot;, &amp;quot; &amp;lt;&amp;lt; p1.get_y() &amp;lt;&amp;lt; &amp;quot;)&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
     cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; p2.get_x() &amp;lt;&amp;lt; &amp;quot;, &amp;quot; &amp;lt;&amp;lt; p2.get_y() &amp;lt;&amp;lt; &amp;quot;)&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 10:&lt;br /&gt;
&lt;br /&gt;
   /* Copy_constructor_assignment.cc&lt;br /&gt;
      Copyright (c) 2004 GPL Mike Chirico, mchirico@comcast.net or mchirico@users.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
      Reference: &amp;quot;The C++ Programming Language&amp;quot;, 3rd ed, by Stroustrup&lt;br /&gt;
      pg. 246.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Download:&lt;br /&gt;
      http://prdownloads.sourceforge.net/cpearls/simple_but_common.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
   */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   class Name {&lt;br /&gt;
   public:&lt;br /&gt;
     char* s;&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   class Table {&lt;br /&gt;
     Name *p;&lt;br /&gt;
     size_t sz;&lt;br /&gt;
   public:&lt;br /&gt;
     Table(size_t s=15) {&lt;br /&gt;
               p = new Name[sz=s];&lt;br /&gt;
               for(size_t i=0; i&amp;lt; sz; ++i) p[i].s=&amp;quot;****&amp;quot;;&lt;br /&gt;
                          }&lt;br /&gt;
     Table(const Table &amp;amp;t);&lt;br /&gt;
     Table&amp;amp; operator=(const Table&amp;amp;);&lt;br /&gt;
     int prt();&lt;br /&gt;
     void asgn(char* ts,size_t index);&lt;br /&gt;
     ~Table(){ delete[] p; }&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Table&amp;amp; Table::operator=(const Table &amp;amp;t)&lt;br /&gt;
   {&lt;br /&gt;
     if( this != &amp;amp;t) {&lt;br /&gt;
       delete[] p;&lt;br /&gt;
       p = new Name[sz=t.sz];&lt;br /&gt;
       for(size_t i=0; i&amp;lt; t.sz; ++i) p[i]=t.p[i];&lt;br /&gt;
     }&lt;br /&gt;
     return *this;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   int Table::prt()&lt;br /&gt;
   {&lt;br /&gt;
     for(size_t i=0; i&amp;lt; sz; ++i) std::cout &amp;lt;&amp;lt; p[i].s &amp;lt;&amp;lt; &amp;quot; &amp;quot;;&lt;br /&gt;
     std::cout &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
     return 0;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   /*&lt;br /&gt;
     asgn will increase the array of strings, if needed&lt;br /&gt;
     to size index+1, and add the string ts to position&lt;br /&gt;
     index.&lt;br /&gt;
   */&lt;br /&gt;
   void Table::asgn(char* ts,size_t index)&lt;br /&gt;
   {&lt;br /&gt;
     if(index &amp;lt; sz ) {&lt;br /&gt;
        p[index].s=ts;&lt;br /&gt;
     }else if ( index &amp;gt;= sz ){&lt;br /&gt;
        Name *tp;&lt;br /&gt;
        tp=p;&lt;br /&gt;
&lt;br /&gt;
        p = new Name[index+1];&lt;br /&gt;
&lt;br /&gt;
        for(size_t i=0; i&amp;lt; sz; ++i) p[i].s=tp[i].s;&lt;br /&gt;
        delete [] tp;&lt;br /&gt;
        for(size_t i=sz; i &amp;lt; index; ++i)p[i].s=&amp;quot;****&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
        p[index].s=ts;&lt;br /&gt;
        sz=index+1;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   int main(void)&lt;br /&gt;
   {&lt;br /&gt;
&lt;br /&gt;
     Table t1;&lt;br /&gt;
     Table t2(5);&lt;br /&gt;
&lt;br /&gt;
     // this is bigger than initial sz&lt;br /&gt;
     t1.asgn(&amp;quot;myname&amp;quot;,20);&lt;br /&gt;
     t1.prt();&lt;br /&gt;
     t2.prt();&lt;br /&gt;
&lt;br /&gt;
     t1=t2;&lt;br /&gt;
&lt;br /&gt;
     t1.prt();&lt;br /&gt;
     t2.prt();&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REFERENCES:&lt;br /&gt;
&lt;br /&gt;
  (1)  http://www.tldp.org/LDP/abs/html/index.html&lt;br /&gt;
  (2)  http://www.shelldorado.com/&lt;br /&gt;
  (3)  http://www.faqs.org/ftp/usenet/news.answers/unix-faq/faq/part1&lt;br /&gt;
  (4)  http://www-106.ibm.com/developerworks/library/l-rpm1/&lt;br /&gt;
  (5)  http://www-136.ibm.com/developerworks/linux/&lt;br /&gt;
  (6)  http://www.gnu.org/manual/manual.html&lt;br /&gt;
  (7)  http://fedora.redhat.com/&lt;br /&gt;
  (8)  http://souptonuts.sourceforge.net/chirico/index.php&lt;br /&gt;
  (9)  http://www.faqs.org/faqs/&lt;br /&gt;
 (10)  http://www.faqs.org/docs/linux_network/&lt;br /&gt;
 (11)  http://www.tml.hut.fi/~viu/linux/sag/sag-0.6.2.html/index.html&lt;br /&gt;
 (12)  http://www.yolinux.com/TUTORIALS/LinuxTutorialSysAdmin.html&lt;br /&gt;
 (13)  http://sed.sourceforge.net/grabbag/scripts/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  SUMMARY:&lt;br /&gt;
   (1)(2)(3) Excellent resource for bash scripts.&lt;br /&gt;
   (4)       rpm resource&lt;br /&gt;
   (6)       GNU Manuals Online&lt;br /&gt;
   (7)       Fedora&lt;br /&gt;
   (8)       Authors Website&lt;br /&gt;
   (11)(12)  System Admin&lt;br /&gt;
   (13)      Excellent source of sed scripts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
HIGHLY RECOMMENDED BOOKS:&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX Network Programming, The Sockets Networking API&amp;quot;, Volume 1, Third Edition.&lt;br /&gt;
        W. Richard Stevens, Bill Fenner, Andrew M. Rudoff.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX Network Programming, Interprocess Communications&amp;quot;, Volume 2, Second Edition.&lt;br /&gt;
        W. Richard Stevens.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX SYSTEMS Programming, Communication, Concurrency, and Threads&amp;quot;, Kay A. Robbins,&lt;br /&gt;
        Steven Robbins&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming with POSIX Threads&amp;quot;, David R. Butenhof. Addison-Wesley&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;The C++ Programming Language&amp;quot; Third Edition. Bjarne Stroustrup. Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C Programming Language&amp;quot; (2nd Edition), Second Edition, Kernighan and Ritchie&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Advanced Linux Programming&amp;quot; by Mark Mitchell, Jeffrey Oldham, and Alex Samuel, of&lt;br /&gt;
        CodeSourcery LL. This book if free at the following resource:&lt;br /&gt;
        http://www.advancedlinuxprogramming.com/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Accelerated C++, Practical Programming by Example&amp;quot; Andrew Koenig, Barbara E. Moo.&lt;br /&gt;
        Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C: A Reference Manual&amp;quot;, Fifth Edition, Samuel P. Harbison, Guy L. Steele.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Standard Library: A Tutorial and Reference, The&amp;quot;, Nicolai M. Josuttis. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Templates: The Complete Guide&amp;quot;, David Vandevoorde, Nicolai M. Josuttis. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Exceptional C++: 47 Engineering Puzzles, Programming Problems, and Solutions&amp;quot;, Herb Sutter.&lt;br /&gt;
     Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;More Exceptional C++&amp;quot;, Herb Sutter.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Exceptional C++ Style: 40 New Engineering Puzzles, Programming Problems, and Solutions&amp;quot;,&lt;br /&gt;
       Herb Sutter. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;The Art of Computer Programming (TAOCP)&amp;quot;, Vol 1,Vol 2, Vol 3. Donald E. Knuth. Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming Perl, 3rd Edition&amp;quot;, Tom Christiansen, Jon Orwant, Larry Wall. O'Reilly.&lt;br /&gt;
       http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming from the Ground Up&amp;quot;, Jonathan Bartlett, Edited by Dominick Bruno, Jr.&lt;br /&gt;
       http://savannah.nongnu.org/download/pgubook/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Expert C Programming&amp;quot;, Peter van der Linden, Prentice Hall PTR.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Coding Standards 101 Rules, Guidelines, and Best Practices&amp;quot;, by Herb Sutter and&lt;br /&gt;
       Andrei Alexandrescu.  http://www.gotw.ca/publications/c++cs/bibliography.htm&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Linux Kernel Development: A practical guide to the design and implementation of&lt;br /&gt;
       the Linux kernel&amp;quot;, by Robert Love, Sams Publishing.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond&amp;quot;, by&lt;br /&gt;
       David Abrahams and Aleksey Gurtovoy. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
HIGHLY RECOMMENDED: PHILOSOPHICAL&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;Zen and the Art of Motorcycle Maintenance: An Inquiry into Values&amp;quot;, Robert Pirsig.&lt;br /&gt;
        http://www.virtualschool.edu/mon/Quality/PirsigZen/index.html&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;Lila: An Inquiry Into Morals&amp;quot;, Robert Pirsig.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RECOMMENDED BOOKS:&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Structure and Interpretation of Computer Programs&amp;quot;, Harold Abelson, Gerald Jay Sussman,&lt;br /&gt;
      Julie Sussman. This book is free:&lt;br /&gt;
        http://mitpress.mit.edu/sicp/full-text/book/book.html&lt;br /&gt;
              and&lt;br /&gt;
        http://www.gnu.org/software/mit-scheme/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RECOMMENDED HOTOS:&lt;br /&gt;
&lt;br /&gt;
    Linux Networking-HOWTO (Previously the Net-3 Howto)&lt;br /&gt;
     http://en.tldp.org/HOWTO/NET3-4-HOWTO.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CORRECTIONS:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following people made suggestions and corrections:&lt;br /&gt;
  - Jorge Fabregas &amp;lt;fabregasj@prtc.net&amp;gt; TIP 21&lt;br /&gt;
  - Malcolm Parsons &amp;lt;malcolm.parsons@gmail.com&amp;gt; TIP 44&lt;br /&gt;
  - Andreas Haunschmidt &amp;lt;Andreas.Haunschmidt@utanet.at&amp;gt; TIP 102, TIP 90&lt;br /&gt;
  - P@draigBrady.com (Following links )&lt;br /&gt;
  - Jacques.GARNIER-EXTERIEUR@EU.RHODIA.COM TIP 46&lt;br /&gt;
&lt;br /&gt;
                http://www.pixelbeat.org/cmdline.html&lt;br /&gt;
                http://www.pixelbeat.org/rotagator/linux.tips/rotagator.fortune&lt;br /&gt;
                http://www.pixelbeat.org/scripts/&lt;br /&gt;
&lt;br /&gt;
  - Tobias Nix &amp;lt;tobias.nix@gmail.com&amp;gt; TIP 12&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>C4tboCcdro</name></author>	</entry>

	<entry>
		<id>https://wiki.gacq.com/index.php?title=Linux_tips&amp;diff=2753</id>
		<title>Linux tips</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacq.com/index.php?title=Linux_tips&amp;diff=2753"/>
				<updated>2009-01-09T20:54:10Z</updated>
		
		<summary type="html">&lt;p&gt;C4tboCcdro: http://mahohmie.qsh.eu/resource1805.htm&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://mahohmie.qsh.eu/resource1805.htm spongebob tv movie character toy] [http://fademon.0lx.net/article-1434.htm put music videos on your psp for free] [http://acsitzar.0lx.net/news-joes-movies-2008-11-12.html joes movies] [http://caraines.qsh.eu/defanele.htm iran movie] [http://betheres.qsh.eu/comment-180.htm movie prime cut] &lt;br /&gt;
[http://caraines.qsh.eu/zelgolg.htm amc movie .com] [http://caraines.qsh.eu/zmexplnrb.htm ejaculate galleries.squirting video] [http://spfortne.qsh.eu/20081226-adult-alyssa.html adult alyssa milano movie] [http://lofaako.strefa.pl/sitemap.html map] [http://caraines.qsh.eu/caelttro.htm anne curtis video scandal download] &lt;br /&gt;
[http://zelgetgo.0lx.net/sitemap.htm url] [http://relquaca.is-the-boss.com/20090104-lanhound-serial.html lanhound serial number] [http://bukgetert.0lx.net/article-28.htm sitemap] [http://fispruil.qsh.eu/news1763.html she will be loved video cast maroon 5] [http://bukgetert.0lx.net/article-52.htm make a movie screen] &lt;br /&gt;
[http://lifokdron.0lx.net/1739.html michael thriller video] [http://huruple.qsh.eu/20090101-interracial-video.htm interracial video tgp] [http://relquaca.is-the-boss.com/20090103-password-stealer.html password stealer crack] [http://acsitzar.0lx.net/news-most-wanted-2008-11-17.html most wanted movie] [http://vihencbr.0lx.net/secure-video.html secure video chat] &lt;br /&gt;
[http://acsitzar.0lx.net/news-jethro-tull-videos-2008-11-19.html jethro tull videos] [http://bukgetert.0lx.net/sitemap.htm links] [http://lifokdron.0lx.net/504.html movie theater in virginia] [http://flheddin.qsh.eu/brfadron-453.html motivational military videos] [http://sematild.qsh.eu/resource322.htm real player video codecs] &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Mike Chirico (mchirico@users.sourceforge.net) or (mchirico@comcast.net)&lt;br /&gt;
Copyright (C) 2004 (GNU Free Documentation License)&lt;br /&gt;
Last Updated: Thu Dec 28 16:42:50 EST 2006&lt;br /&gt;
&lt;br /&gt;
The latest version of this document can be found at:&lt;br /&gt;
http://souptonuts.sourceforge.net/how_to_linux_and_open_source.htm&lt;br /&gt;
  or text version ( if you have trouble downloading the full document: over 140 pages )&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/How_to_Linux_and_Open_Source.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on Gmail with Postix and Fetchmail&lt;br /&gt;
http://souptonuts.sourceforge.net/postfix_tutorial.html&lt;br /&gt;
&lt;br /&gt;
For tips on using SQLite (over 25 pages)&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_sqlite_tutorial.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on MySQL reference:&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_mysql.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For a recommended reading list&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/Recommended_Reading.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on upgrading RedHat 9 or 8.0 to 2.6.x src kernel&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_26.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on Comcast Email with Home Linux Box&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_COMCAST_EMAIL.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  **Note, if you want email notification after every 50 new tips have been&lt;br /&gt;
    added, then, click on the following link:&lt;br /&gt;
     https://sourceforge.net/project/filemodule_monitor.php?filemodule_id=120838&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 1:&lt;br /&gt;
&lt;br /&gt;
     Is NTP Working?&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Test the current server):&lt;br /&gt;
&lt;br /&gt;
          Try issuing the following command:&lt;br /&gt;
&lt;br /&gt;
          $ ntpq -pn&lt;br /&gt;
&lt;br /&gt;
           remote refid st t when poll reach delay offset jitter&lt;br /&gt;
           ===================================================&lt;br /&gt;
           tock.usno.navy 0.0.0.0 16 u - 64 0 0.000 0.000 4000.00&lt;br /&gt;
&lt;br /&gt;
          The above is an example of a problem.&lt;br /&gt;
          Compare it to a working configuration.&lt;br /&gt;
&lt;br /&gt;
          $ ntpq -pn&lt;br /&gt;
&lt;br /&gt;
           remote refid st t when poll reach delay offset jitter&lt;br /&gt;
           ========================================================&lt;br /&gt;
           +128.4.40.12 128.4.40.10 2 u 107 128 377 25.642 3.350 1.012&lt;br /&gt;
           127.127.1.0 127.127.1.0 10 l 40 64 377 0.000 0.000 0.008&lt;br /&gt;
           +128.91.2.13 128.4.40.12 3 u 34 128 377 21.138 6.118 0.398&lt;br /&gt;
           *192.5.41.41 .USNO. 1 u 110 128 377 33.69 9.533 3.534&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Configure the /etc/ntp.conf):&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/ntp.conf&lt;br /&gt;
&lt;br /&gt;
            # My simple client-only ntp configuration.&lt;br /&gt;
            server timeserver1.upenn.edu&lt;br /&gt;
            # ping -a timeserver1.upenn.edu shows the IP address 128.91.2.13&lt;br /&gt;
            # which is used in the restrict below&lt;br /&gt;
            restrict 128.91.2.13&lt;br /&gt;
            server tock.usno.navy.mil&lt;br /&gt;
            restrict 192.5.41.41&lt;br /&gt;
            server 128.4.40.12&lt;br /&gt;
            restrict 128.4.40.12&lt;br /&gt;
            server 127.127.1.0 # local clock&lt;br /&gt;
            fudge 127.127.1.0 stratum 10&lt;br /&gt;
            driftfile /etc/ntp/drift&lt;br /&gt;
            restrict default ignore&lt;br /&gt;
            restrict 127.0.0.0 mask 255.0.0.0&lt;br /&gt;
            authenticate no&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Configure /etc/ntp/step-tickers):&lt;br /&gt;
&lt;br /&gt;
          The values for server above are placed in the &amp;quot;/etc/ntp/step-tickers&amp;quot; file&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/ntp/step-tickers&lt;br /&gt;
&lt;br /&gt;
              timeserver1.upenn.edu&lt;br /&gt;
              tock.usno.navy.mil&lt;br /&gt;
              128.4.40.12&lt;br /&gt;
&lt;br /&gt;
          The startup script /etc/rc.d/init.d/ntpd will grab the servers in this&lt;br /&gt;
          file and execute the ntpdate command as follows:&lt;br /&gt;
&lt;br /&gt;
             /usr/sbin/ntpdate -s -b -p 8 timeserver1.upenn.edu&lt;br /&gt;
&lt;br /&gt;
          Why? Because if the time is off ntpd will not start. The command above set the&lt;br /&gt;
          clock. If System Time deviates from true time by more than 1000 seconds, then,&lt;br /&gt;
          the ntpd daemon  will enter panic mode and exit.&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Restart the service and check):&lt;br /&gt;
&lt;br /&gt;
          Issue the restart command&lt;br /&gt;
&lt;br /&gt;
            /etc/init.d/ntpd restart&lt;br /&gt;
&lt;br /&gt;
          check the values for &amp;quot;ntpq -pn&amp;quot;,&lt;br /&gt;
          which should match step 1.&lt;br /&gt;
&lt;br /&gt;
             ntpq -pn&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE:&lt;br /&gt;
&lt;br /&gt;
          Time is always stored in the kernel as the number of seconds since&lt;br /&gt;
          midnight of the 1st of January 1970 UTC, regardless of whether the&lt;br /&gt;
          hardware clock is stored as UTC or not.  Conversions to local time&lt;br /&gt;
          are done at run-time. So, it's easy to get the time in different&lt;br /&gt;
          timezones for only the current session as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ export TZ=EST&lt;br /&gt;
              $ date&lt;br /&gt;
              Mon Aug  2 10:34:04 EST 2004&lt;br /&gt;
&lt;br /&gt;
              $ export TZ=NET&lt;br /&gt;
              $ date&lt;br /&gt;
              Mon Aug  2 15:34:18 NET 2004&lt;br /&gt;
&lt;br /&gt;
          The following are possible values for TZ:&lt;br /&gt;
&lt;br /&gt;
              Hours From Greenwich Mean Time (GMT) Value Description&lt;br /&gt;
              0 GMT Greenwich Mean Time&lt;br /&gt;
              +1 ECT European Central Time&lt;br /&gt;
              +2 EET European Eastern Time&lt;br /&gt;
              +2 ART&lt;br /&gt;
              +3 EAT Saudi Arabia&lt;br /&gt;
              +3.5 MET Iran&lt;br /&gt;
              +4 NET&lt;br /&gt;
              +5 PLT West Asia&lt;br /&gt;
              +5.5 IST India&lt;br /&gt;
              +6 BST Central Asia&lt;br /&gt;
              +7 VST Bangkok&lt;br /&gt;
              +8 CTT China&lt;br /&gt;
              +9 JST Japan&lt;br /&gt;
              +9.5 ACT Central Australia&lt;br /&gt;
              +10 AET Eastern Australia&lt;br /&gt;
              +11 SST Central Pacific&lt;br /&gt;
              +12 NST New Zealand&lt;br /&gt;
              -11 MIT Samoa&lt;br /&gt;
              -10 HST Hawaii&lt;br /&gt;
              -9 AST Alaska&lt;br /&gt;
              -8 PST Pacific Standard Time&lt;br /&gt;
              -7 PNT Arizona&lt;br /&gt;
              -7 MST Mountain Standard Time&lt;br /&gt;
              -6 CST Central Standard Time&lt;br /&gt;
              -5 EST Eastern Standard Time&lt;br /&gt;
              -5 IET Indiana East&lt;br /&gt;
              -4 PRT Atlantic Standard Time&lt;br /&gt;
              -3.5 CNT Newfoundland&lt;br /&gt;
              -3 AGT Eastern South America&lt;br /&gt;
              -3 BET Eastern South America&lt;br /&gt;
              -1 CAT Azores&lt;br /&gt;
&lt;br /&gt;
              DST timezone&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              0      BST for British Summer.&lt;br /&gt;
              +400   ADT for Atlantic Daylight.&lt;br /&gt;
              +500   EDT for Eastern Daylight.&lt;br /&gt;
              +600   CDT for Central Daylight.&lt;br /&gt;
              +700   MDT for Mountain Daylight.&lt;br /&gt;
              +800   PDT for Pacific Daylight.&lt;br /&gt;
              +900   YDT for Yukon Daylight.&lt;br /&gt;
              +1000  HDT for Hawaii Daylight.&lt;br /&gt;
              -100   MEST for Middle European Summer,&lt;br /&gt;
                         MESZ for Middle European Summer,&lt;br /&gt;
                         SST for Swedish Summer and FST for French Summer.&lt;br /&gt;
              -700   WADT for West Australian Daylight.&lt;br /&gt;
              -1000  EADT for Eastern Australian Daylight.&lt;br /&gt;
              -1200  NZDT for New Zealand Daylight.&lt;br /&gt;
&lt;br /&gt;
     The following is an example of setting the TZ environment variable&lt;br /&gt;
     for the timezone, only when timezone changes go into effect.&lt;br /&gt;
&lt;br /&gt;
               $ export TZ=EST+5EDT,M4.1.0/2,M10.5.0/2&lt;br /&gt;
&lt;br /&gt;
     Take a look at the last line &amp;quot;M10.5.0/2&amp;quot;. What does it mean? Here is the&lt;br /&gt;
     documentation&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Mm.w.d This  specifies  day  d (0 &amp;lt;= d &amp;lt;= 6) of week w (1 &amp;lt;= w &amp;lt;= 5) of&lt;br /&gt;
              month m (1 &amp;lt;= m &amp;lt;= 12).  Week 1 is the first week in which day d&lt;br /&gt;
              occurs and week 5 is the last week in which day d occurs.  Day 0&lt;br /&gt;
              is a Sunday.&lt;br /&gt;
&lt;br /&gt;
              The time fields specify when, in the local time  currently  in&lt;br /&gt;
              effect, the  change  to  the  other  time  occurs.   If omitted,&lt;br /&gt;
              the default is  02:00:00.&lt;br /&gt;
&lt;br /&gt;
      So this is what it means. M10 stands for October, the 5 is the fifth week&lt;br /&gt;
      that includes a Sunday (note 0 in M10.5.0/2 is Sunday). To see that it is&lt;br /&gt;
      the fifth week see the calendar below. The time change occurs a 2am in&lt;br /&gt;
      the morning.&lt;br /&gt;
&lt;br /&gt;
                                October&lt;br /&gt;
                         Su Mo Tu We Th Fr Sa&lt;br /&gt;
                                         1  2&lt;br /&gt;
                          3  4  5  6  7  8  9&lt;br /&gt;
                         10 11 12 13 14 15 16&lt;br /&gt;
                         17 18 19 20 21 22 23&lt;br /&gt;
                         24 25 26 27 28 29 30&lt;br /&gt;
                         31&lt;br /&gt;
&lt;br /&gt;
       Prove it. Take the following program sunrise, which can calcuates sunrise&lt;br /&gt;
       and sunset for an latitude and longitude. This program can be downloaded&lt;br /&gt;
       from the following location:&lt;br /&gt;
           http://sourceforge.net/direct-dl/mchirico/souptonuts/working_with_time.tar.gz&lt;br /&gt;
&lt;br /&gt;
       Below is a bash script that will run the program for the next 100 days.&lt;br /&gt;
&lt;br /&gt;
          #!/bin/bash&lt;br /&gt;
          #  program: next100days  Mike Chirico&lt;br /&gt;
          #  download:&lt;br /&gt;
          #  http://sourceforge.net/direct-dl/mchirico/souptonuts/working_with_time.tar.gz&lt;br /&gt;
          #&lt;br /&gt;
          #  This will calculate the sunrise and sunset for&lt;br /&gt;
          #  latitude     39.95  Note must convert to degrees&lt;br /&gt;
          #  longitude  75.15  Note must convert to degrees&lt;br /&gt;
          lat=39.95&lt;br /&gt;
          long=75.15&lt;br /&gt;
          for (( i=0; i &amp;lt;= 100; i++))&lt;br /&gt;
          do&lt;br /&gt;
            sunrise    `date -d &amp;quot;+$i day&amp;quot; &amp;quot;+%Y %m %d&amp;quot;` $lat $long&lt;br /&gt;
          done&lt;br /&gt;
&lt;br /&gt;
       Take a look at the following sample output.&lt;br /&gt;
&lt;br /&gt;
           $ export TZ=EST+5EDT,M4.1.0/2,M10.5.0/2&lt;br /&gt;
           $ ./next100days&lt;br /&gt;
&lt;br /&gt;
          Sunrise  08-24-2004  06:21:12   Sunset 08-24-2004  19:43:42&lt;br /&gt;
          Sunrise  08-25-2004  06:22:09   Sunset 08-25-2004  19:42:12&lt;br /&gt;
          Sunrise  08-26-2004  06:23:06   Sunset 08-26-2004  19:40:41&lt;br /&gt;
          Sunrise  08-27-2004  06:24:03   Sunset 08-27-2004  19:39:09&lt;br /&gt;
          Sunrise  08-28-2004  06:25:00   Sunset 08-28-2004  19:37:37&lt;br /&gt;
          Sunrise  08-29-2004  06:25:56   Sunset 08-29-2004  19:36:04&lt;br /&gt;
          Sunrise  08-30-2004  06:26:53   Sunset 08-30-2004  19:34:31&lt;br /&gt;
          Sunrise  08-31-2004  06:27:50   Sunset 08-31-2004  19:32:57&lt;br /&gt;
          Sunrise  09-01-2004  06:28:46   Sunset 09-01-2004  19:31:22&lt;br /&gt;
          Sunrise  09-02-2004  06:29:43   Sunset 09-02-2004  19:29:47&lt;br /&gt;
          ..[values omitted ]&lt;br /&gt;
          Sunrise  10-28-2004  07:25:31   Sunset 10-28-2004  18:02:34&lt;br /&gt;
          Sunrise  10-29-2004  07:26:38   Sunset 10-29-2004  18:01:19&lt;br /&gt;
          Sunrise  10-30-2004  07:27:46   Sunset 10-30-2004  18:00:06&lt;br /&gt;
          Sunrise  10-31-2004  06:28:53   Sunset 10-31-2004  16:58:54&lt;br /&gt;
          Sunrise  11-01-2004  06:30:01   Sunset 11-01-2004  16:57:44&lt;br /&gt;
          Sunrise  11-02-2004  06:31:10   Sunset 11-02-2004  16:56:35&lt;br /&gt;
&lt;br /&gt;
       Compare 10-30-2004 with 10-31-2004. Sunrise is an hour earlier because&lt;br /&gt;
       daylight saving time has ended, just as predicted.&lt;br /&gt;
&lt;br /&gt;
       There is an easier way to switch between timezones. Take a look at the&lt;br /&gt;
       directory zoneinfo as follows:&lt;br /&gt;
&lt;br /&gt;
            $ ls /usr/share/zoneinfo&lt;br /&gt;
&lt;br /&gt;
            Africa      Chile    Factory    Iceland      Mexico    posix       UCT&lt;br /&gt;
            America     CST6CDT  GB         Indian       Mideast   posixrules  Universal&lt;br /&gt;
            Antarctica  Cuba     GB-Eire    Iran         MST       PRC         US&lt;br /&gt;
            Arctic      EET      GMT        iso3166.tab  MST7MDT   PST8PDT     UTC&lt;br /&gt;
            Asia        Egypt    GMT0       Israel       Navajo    right       WET&lt;br /&gt;
            Atlantic    Eire     GMT-0      Jamaica      NZ        ROC         W-SU&lt;br /&gt;
            Australia   EST      GMT+0      Japan        NZ-CHAT   ROK         zone.tab&lt;br /&gt;
            Brazil      EST5EDT  Greenwich  Kwajalein    Pacific   Singapore   Zulu&lt;br /&gt;
            Canada      Etc      Hongkong   Libya        Poland    SystemV&lt;br /&gt;
            CET         Europe   HST        MET          Portugal  Turkey&lt;br /&gt;
&lt;br /&gt;
       TZ can be set to any one of these files. Some of these are directories and contain&lt;br /&gt;
       subdirectories, such as ./posix/America. This way you don not have to enter the&lt;br /&gt;
       timezone, offset, and range for dst, since it has already been calculated.&lt;br /&gt;
&lt;br /&gt;
           $ export TZ=:/usr/share/zoneinfo/posix/America/Aruba&lt;br /&gt;
           $ export TZ=:/usr/share/zoneinfo/Egypt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Reference:&lt;br /&gt;
          http://prdownloads.sourceforge.net/cpearls/date_calc.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
          Also see  (TIP 27).&lt;br /&gt;
          Also see  (TIP 103) using chrony which is very similiar to ntpd.&lt;br /&gt;
          Note time settings can usually be found in /etc/sysconfig/clock&lt;br /&gt;
         &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 2:&lt;br /&gt;
&lt;br /&gt;
     cpio works like tar, only better.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Create two directories with data ../dir1 an ../dir2)&lt;br /&gt;
&lt;br /&gt;
          mkdir -p ../dir1&lt;br /&gt;
          mkdir -p ../dir2&lt;br /&gt;
          cp /etc/*.conf ../dir1/.&lt;br /&gt;
          cp /etc/*.cnf ../dir2/.&lt;br /&gt;
&lt;br /&gt;
          Which will backup all your cnf and conf files.&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Piping the files to tar)&lt;br /&gt;
&lt;br /&gt;
          cpio works like tar but can take input&lt;br /&gt;
          from the &amp;quot;find&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar &amp;gt; test.tar&lt;br /&gt;
               or&lt;br /&gt;
           $ find ../dir1/ | cpio -o -H tar &amp;gt; test2.tar&lt;br /&gt;
&lt;br /&gt;
          Same command without the &amp;quot;&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar -F test.tar&lt;br /&gt;
              or&lt;br /&gt;
           $ find ../dir1/ | cpio -o -H tar -F test2.tar&lt;br /&gt;
&lt;br /&gt;
          Using append&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar -F test.tar&lt;br /&gt;
             or&lt;br /&gt;
           $ find ../dir2/ | cpio -o --format=tar --append -F test.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (List contents of the tar file)&lt;br /&gt;
&lt;br /&gt;
          $ cpio -it &amp;lt; test.tar&lt;br /&gt;
                or&lt;br /&gt;
          $ cpio -it -F test.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Extract the contents)&lt;br /&gt;
&lt;br /&gt;
          $ cpio -i -F test.tar&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 3:&lt;br /&gt;
&lt;br /&gt;
     Working with tar. The basics with encryption.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Using the tar command on the directory /stuff)&lt;br /&gt;
&lt;br /&gt;
          Suppose you have a directory /stuff&lt;br /&gt;
          To tar everything in stuff to create a &amp;quot;.tar&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
          $ tar -cvf stuff.tar stuff&lt;br /&gt;
&lt;br /&gt;
          Which will create &amp;quot;stuff.tar&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Using the tar command to create a &amp;quot;.tar.gz&amp;quot; of /stuff)&lt;br /&gt;
&lt;br /&gt;
          $ tar -czf stuff.tar.gz stuff&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (List the files in the archive)&lt;br /&gt;
&lt;br /&gt;
          $ tar -tzf stuff.tar.gz&lt;br /&gt;
               or&lt;br /&gt;
          $ tar -tf stuff.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (A way to list specific files)&lt;br /&gt;
&lt;br /&gt;
          Note, pipe the results to a file and edit&lt;br /&gt;
&lt;br /&gt;
           $ tar -tzf stuff.tar.gz &amp;gt; mout&lt;br /&gt;
&lt;br /&gt;
          Then, edit mout to only include the files you want&lt;br /&gt;
&lt;br /&gt;
           $ tar -T mout -xzf stuff.tar.gz&lt;br /&gt;
&lt;br /&gt;
          The above command will only get the files in mout.&lt;br /&gt;
          Of couse, if you want them all&lt;br /&gt;
&lt;br /&gt;
           $ tar -xzf stuff.tar.gz&lt;br /&gt;
&lt;br /&gt;
     STEP 5 (ENCRYPTION)&lt;br /&gt;
&lt;br /&gt;
           $ tar -zcvf - stuff|openssl des3 -salt -k secretpassword | dd of=stuff.des3&lt;br /&gt;
&lt;br /&gt;
          This will create stuff.des3...don't forget the password you&lt;br /&gt;
          put in place of  secretpassword. This can be done interactively as&lt;br /&gt;
          well.&lt;br /&gt;
&lt;br /&gt;
            $ dd if=stuff.des3 |openssl des3 -d -k secretpassword|tar zxf -&lt;br /&gt;
&lt;br /&gt;
     NOTE:  above there is a &amp;quot;-&amp;quot; at the end... this will&lt;br /&gt;
            extract everything.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 4:&lt;br /&gt;
&lt;br /&gt;
     Creating a Virtual File System and Mounting it with a Loopback Device.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Construct a 10MB file)&lt;br /&gt;
&lt;br /&gt;
           $ dd if=/dev/zero of=/tmp/disk-image count=20480&lt;br /&gt;
&lt;br /&gt;
          By default dd uses block of 512 so the size will be 20480*512&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Make an ext2 or ext3 file system) -- ext2 shown here.&lt;br /&gt;
&lt;br /&gt;
           $ mke2fs -q&lt;br /&gt;
&lt;br /&gt;
          or if you want ext3&lt;br /&gt;
&lt;br /&gt;
           $ mkfs -t ext3 -q /tmp/disk-image&lt;br /&gt;
&lt;br /&gt;
          yes, you can even use reiser, but you'll need to create a bigger&lt;br /&gt;
          disk image. Something like &amp;quot;dd if=/dev/zero of=/tmp/disk-image count=50480&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ mkfs -t reiserfs -q /tmp/disk-image&lt;br /&gt;
&lt;br /&gt;
          Hit yes for confirmation.  It only asks this because it's a file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Create a directory &amp;quot;virtual-fs&amp;quot; and mount. This has to be done as root)&lt;br /&gt;
&lt;br /&gt;
           $ mkdir /virtual-fs&lt;br /&gt;
           $ mount -o loop=/dev/loop0 /tmp/disk-image /virtual-fs&lt;br /&gt;
&lt;br /&gt;
         SPECIAL NOTE: if you mount a second device you will have to increase the&lt;br /&gt;
                       loop count: loop=/dev/loop1, loop=/dev/loop2, ... loop=/dev/loopn&lt;br /&gt;
&lt;br /&gt;
          Now it operates just like a disk. This virtual filesystem can be mounted&lt;br /&gt;
          when the system boots by adding the following to the &amp;quot;/etc/fstab&amp;quot; file. Then,&lt;br /&gt;
          to mount, just type &amp;quot;mount /virtual-fs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                 /tmp/disk-image /virtual-fs ext2               rw,loop=/dev/loop0 0 0&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (When done, umount it)&lt;br /&gt;
&lt;br /&gt;
           $ umount /virtual-fs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE: If you are using Fedora core 2, in the /etc/fstab you can take&lt;br /&gt;
              advantage of acl properties for this mount. Note the acl next to the&lt;br /&gt;
              rw entry. This is shown here with ext3.&lt;br /&gt;
&lt;br /&gt;
                 /tmp/disk-image     /virtual-fs ext3    rw,acl,loop=/dev/loop1 0 0&lt;br /&gt;
&lt;br /&gt;
              Also, if you are using Fedora core 2 and above, you can mount the file&lt;br /&gt;
              on a cryptoloop.&lt;br /&gt;
&lt;br /&gt;
                $ dd if=/dev/urandom of=disk-aes count=20480&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ modprobe loop&lt;br /&gt;
                $ modprobe cryptoloop&lt;br /&gt;
                $ modprobe aes&lt;br /&gt;
&lt;br /&gt;
                $ losetup -e aes /dev/loop0 disk-aes&lt;br /&gt;
                $ mkfs -t ext2 /dev/loop0&lt;br /&gt;
                $ mount -o loop,encryption=aes disk-aes &amp;lt;mount point&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              If you do not have Fedora core 2, then, you can build the kernel from source&lt;br /&gt;
              with some of the following options (not complete, yet)&lt;br /&gt;
               reference:&lt;br /&gt;
     http://cvs.sourceforge.net/viewcvs.py/cpearls/cpearls/src/posted_on_sf/acl/ehd.pdf?rev=1.1&amp;amp;view=log&lt;br /&gt;
&lt;br /&gt;
                      Cryptographic API Support (CONFIG_CRYPTO)&lt;br /&gt;
                      generic loop cryptographic (CONFIG_CRYPTOLOOP)&lt;br /&gt;
                      Cryptographic ciphers (CONFIG_CIPHERS)&lt;br /&gt;
                      Enable one or more  ciphers  (CONFIG CIPHER .*) such as AES.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     HELPFUL INFORMATION: It is possible to bind mount partitions, or associate the&lt;br /&gt;
                     mounted partition to a directory name.&lt;br /&gt;
&lt;br /&gt;
                  # mount --bind  /virtual-fs      /home/mchirico/vfs&lt;br /&gt;
&lt;br /&gt;
             Also, if you want to see what filesystems are currently mounted, &amp;quot;cat&amp;quot; the&lt;br /&gt;
             file &amp;quot;/etc/mtab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
                  $ cat /etc/mtab&lt;br /&gt;
&lt;br /&gt;
     Also see TIP 91.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 5:&lt;br /&gt;
&lt;br /&gt;
     Setting up 2 IP address on &amp;quot;One&amp;quot; NIC. This example is on ethernet.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (The settings for the initial IP address)&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
&lt;br /&gt;
            DEVICE=eth0&lt;br /&gt;
            BOOTPROTO=static&lt;br /&gt;
            BROADCAST=192.168.99.255&lt;br /&gt;
            IPADDR=192.168.1.155&lt;br /&gt;
            NETMASK=255.255.252.0&lt;br /&gt;
            NETWORK=192.168.1.0&lt;br /&gt;
            ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (2nd IP address: )&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/sysconfig/network-scripts/ifcfg-eth0:1&lt;br /&gt;
&lt;br /&gt;
            DEVICE=eth0:1&lt;br /&gt;
            BOOTPROTO=static&lt;br /&gt;
            BROADCAST=192.168.99.255&lt;br /&gt;
            IPADDR=192.168.1.182&lt;br /&gt;
            NETMASK=255.255.252.0&lt;br /&gt;
            NETWORK=192.168.1.0&lt;br /&gt;
            ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
     SUMMARY  Note, in STEP 1 the filename is &amp;quot;ifcfg-eth0&amp;quot;, whereas in&lt;br /&gt;
              STEP 2 it's &amp;quot;ifcfg-eth0:1&amp;quot; and also not the matching&lt;br /&gt;
              entries for &amp;quot;DEVICE=...&amp;quot;.  Also, obviously, the&lt;br /&gt;
              &amp;quot;IPADDR&amp;quot; is different as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 6:&lt;br /&gt;
&lt;br /&gt;
     Sharing Directories Among Several Users.&lt;br /&gt;
&lt;br /&gt;
     Several people are working on a project in &amp;quot;/home/share&amp;quot;&lt;br /&gt;
     and they need to create documents and programs so that&lt;br /&gt;
     others in the group can edit and execute these documents&lt;br /&gt;
     as needed. Also see (TIP 186) for adding existing users&lt;br /&gt;
     to groups.&lt;br /&gt;
&lt;br /&gt;
       $  /usr/sbin/groupadd share&lt;br /&gt;
       $  chown -R root.share /home/share&lt;br /&gt;
       $  /usr/bin/gpasswd -a &amp;lt;username&amp;gt; share&lt;br /&gt;
       $  chmod 2775 /home/share&lt;br /&gt;
&lt;br /&gt;
       $  ls -ld /home/share&lt;br /&gt;
             drwxrwsr-x    2 root     share        4096 Nov  8 16:19 /home/share&lt;br /&gt;
                   ^---------- Note the s bit, which was set with the chmod 2775&lt;br /&gt;
&lt;br /&gt;
       $  cat /etc/group&lt;br /&gt;
          ...&lt;br /&gt;
           share:x:502:chirico,donkey,zoe&lt;br /&gt;
          ...          ^------- users are added to this group.&lt;br /&gt;
&lt;br /&gt;
     The user may need to login again to get access. Or, if the user is currently&lt;br /&gt;
     logged in, they can run the following command:&lt;br /&gt;
&lt;br /&gt;
       $ su - &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Note, the above step is recommended over  &amp;quot;newgrp - share&amp;quot; since currently&lt;br /&gt;
     newgrp in FC2,FC3, and FC4 gets access to the group but the umask is not&lt;br /&gt;
     correctly formed.&lt;br /&gt;
&lt;br /&gt;
     As root you  can test their account.&lt;br /&gt;
&lt;br /&gt;
       $ su - &amp;lt;username&amp;gt;   &amp;quot;You need to '-' to pickup thier environment  '$ su - chirico' &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Note: SUID, SGID, Sticky bit. Only the left most octet is examined, and &amp;quot;chmod 755&amp;quot; is used&lt;br /&gt;
          as an example of the full command. But, anything else could be used as well. Normally&lt;br /&gt;
          you'd want executable permissions.&lt;br /&gt;
&lt;br /&gt;
        Octal digit  Binary value      Meaning                           Example usage&lt;br /&gt;
            0           000       all cleared                             $ chmod 0755 or chmod 755&lt;br /&gt;
            1           001       sticky                                  $ chmod 1755&lt;br /&gt;
            2           010       setgid                                  $ chmod 2755&lt;br /&gt;
            3           011       setgid, sticky                          $ chmod 3755&lt;br /&gt;
            4           100       setuid                                  $ chmod 4755&lt;br /&gt;
            5           101       setuid, sticky                          $ chmod 5755&lt;br /&gt;
            6           110       setuid, setgid                          $ chmod 6755&lt;br /&gt;
            7           111       setuid, setgid, sticky                  $ chmod 7755&lt;br /&gt;
&lt;br /&gt;
     A few examples applied to a directory below. In the first example all users in the group can&lt;br /&gt;
     add files to directory &amp;quot;dirA&amp;quot; and they can delete their own files. Users cannot delete other&lt;br /&gt;
     user's files.&lt;br /&gt;
&lt;br /&gt;
        Sticky bit:&lt;br /&gt;
           $ chmod 1770  dirA&lt;br /&gt;
&lt;br /&gt;
     Below files created within the directory have the group ID of the directory, rather than that&lt;br /&gt;
     of the default group setting for the user who created the file.&lt;br /&gt;
&lt;br /&gt;
        Set group ID bit:&lt;br /&gt;
           $ chmod 2755  dirB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 7:&lt;br /&gt;
&lt;br /&gt;
     Getting Infomation on Commands&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;info&amp;quot; is a great utility for getting information about the system.&lt;br /&gt;
     Here's a quick key on using &amp;quot;info&amp;quot; from the terminal prompt.&lt;br /&gt;
&lt;br /&gt;
       'q' exits.&lt;br /&gt;
       'u' moves up to the table of contents of the current section.&lt;br /&gt;
       'n' moves to the next chapter.&lt;br /&gt;
       'p' moves to the previous chapter.&lt;br /&gt;
       'space' goes into the selected section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The following is a good starting point:&lt;br /&gt;
&lt;br /&gt;
        $ info coreutils&lt;br /&gt;
&lt;br /&gt;
      Need to find out what a certain program does?&lt;br /&gt;
&lt;br /&gt;
        $ whatis  open&lt;br /&gt;
       open   (2)  - open and possibly create a file or device&lt;br /&gt;
       open   (3)  - perl pragma to set default PerlIO layers for input and output&lt;br /&gt;
       open   (3pm)  - perl pragma to set default PerlIO layers for input and output&lt;br /&gt;
       open   (n)  - Open a file-based or command pipeline channel&lt;br /&gt;
&lt;br /&gt;
      To get specific information about the open commmand&lt;br /&gt;
&lt;br /&gt;
        $ man 2 open&lt;br /&gt;
&lt;br /&gt;
       also try 'keyword' search, which is the same as the apropos command.&lt;br /&gt;
       For example, to find all the man pages on selinux, type the following:&lt;br /&gt;
&lt;br /&gt;
        $ man -k selinux&lt;br /&gt;
&lt;br /&gt;
       or the man full word search. Same as whatis command.&lt;br /&gt;
&lt;br /&gt;
        $ man -f &amp;lt;some string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       This is a hint once you are inside man.&lt;br /&gt;
&lt;br /&gt;
        space      moves forward one page&lt;br /&gt;
        b          moves backward&lt;br /&gt;
        y          scrolls up one line &amp;quot;yikes, I missed it!&amp;quot;&lt;br /&gt;
        g          goes to the beginning&lt;br /&gt;
        q          quits&lt;br /&gt;
        /&amp;lt;string&amp;gt;  search, repeat seach n&lt;br /&gt;
        m          mark, enter a letter like &amp;quot;a&amp;quot;, then, ' to go back&lt;br /&gt;
        '          enter a letter that is marked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       To get section numbers&lt;br /&gt;
&lt;br /&gt;
        $ man 8 ping&lt;br /&gt;
&lt;br /&gt;
       Note the numbers are used as follows&lt;br /&gt;
         (This is OpenBSD)&lt;br /&gt;
&lt;br /&gt;
         1  General Commands&lt;br /&gt;
         2  System Calls and Error Numbers&lt;br /&gt;
         3  C Libraries&lt;br /&gt;
         3p perl&lt;br /&gt;
         4  Devices and device drivers&lt;br /&gt;
         5  File Formats and config files&lt;br /&gt;
         6  Game instructions&lt;br /&gt;
         7  Miscellaneous information&lt;br /&gt;
         8  System maintenance&lt;br /&gt;
         9  Kernel internals&lt;br /&gt;
&lt;br /&gt;
       To find the man page directly, &amp;quot;ls&amp;quot; command:&lt;br /&gt;
&lt;br /&gt;
         $ whereis -m ls&lt;br /&gt;
         ls: /usr/share/man/man1/ls.1.gz /usr/share/man/man1/ls.1 /usr/share/man/man1p/ls.1p&lt;br /&gt;
&lt;br /&gt;
       To read this file directly, do the following:&lt;br /&gt;
&lt;br /&gt;
         $ man /usr/share/man/man1/ls.1.gz&lt;br /&gt;
&lt;br /&gt;
       If you want to know the manpath, execute manpath.&lt;br /&gt;
&lt;br /&gt;
         $ manpath&lt;br /&gt;
         /usr/share/man:/usr/X11R6/man:/usr/local/share/man:/usr/local/pgsql/man:/usr/man:/usr/local/man&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 8:&lt;br /&gt;
&lt;br /&gt;
     How to Put a &amp;quot;Running Job&amp;quot; in the Background.&lt;br /&gt;
&lt;br /&gt;
     You're running a job at the terminal prompt, and it's taking&lt;br /&gt;
     a very long time. You want to put the job in the backgroud.&lt;br /&gt;
&lt;br /&gt;
       &amp;quot;CTL - z&amp;quot; Temporarily suspends the job&lt;br /&gt;
       $ jobs     This will list all the jobs&lt;br /&gt;
       $ bg %jobnumber (bg %1)  To run in the background&lt;br /&gt;
       $ fg %jobnumber          To bring back in the foreground&lt;br /&gt;
&lt;br /&gt;
     Need to kill all jobs -- say you're using several suspended&lt;br /&gt;
     emacs sessions and you just want everything to exit.&lt;br /&gt;
&lt;br /&gt;
       $ kill -9  `jobs -p`&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;jobs -p&amp;quot; gives the process number of each job, and the&lt;br /&gt;
     kill -9 kills everything. Yes, sometimes &amp;quot;kill -9&amp;quot; is excessive&lt;br /&gt;
     and you should issue a &amp;quot;kill -15&amp;quot; that allows jobs to clean-up.&lt;br /&gt;
     However, for exacs session, I prefer &amp;quot;kill -9&amp;quot; and haven't had&lt;br /&gt;
     a problem.&lt;br /&gt;
&lt;br /&gt;
     Sometimes you need to list the process id along with job&lt;br /&gt;
     information. For instance, here's process id with the listing.&lt;br /&gt;
&lt;br /&gt;
       $ jobs -l&lt;br /&gt;
&lt;br /&gt;
     Note you can also renice a job, or give it lower priority.&lt;br /&gt;
&lt;br /&gt;
       $ nice -n +15 find . -ctime 2 -type f  -exec ls {} \; &amp;gt; last48hours&lt;br /&gt;
        ^z&lt;br /&gt;
       $  bg&lt;br /&gt;
&lt;br /&gt;
     So above that was a ctl-z to suppend. Then, bg to run it in&lt;br /&gt;
     the background. Now, if you want to change the priority lower&lt;br /&gt;
     you just renice it, once you know the process id.&lt;br /&gt;
&lt;br /&gt;
       $ jobs -pl&lt;br /&gt;
   [1]+ 29388 Running                 nice -n +15 find . -ctime 2 -exec ls -l {} \; &amp;gt;mout &amp;amp;&lt;br /&gt;
&lt;br /&gt;
       $ renice +30 -p 29388&lt;br /&gt;
        29388: old priority 15, new priority 19&lt;br /&gt;
&lt;br /&gt;
      19 was the lowest priority for this job. You cannot increase&lt;br /&gt;
      the priority unless you are root.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 9:&lt;br /&gt;
&lt;br /&gt;
     Need to Delete a File for Good -- not even GOD can recover.&lt;br /&gt;
&lt;br /&gt;
     You have a file &amp;quot;secret&amp;quot;.  The following makes it so no one&lt;br /&gt;
     can read it.  If the file was 12 bytes, it's now 4096 after it&lt;br /&gt;
     has been over written 100 times.  There's no way to recover this.&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z secret&lt;br /&gt;
&lt;br /&gt;
     Want to remove the file? Use the &amp;quot;u&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z -u test2&lt;br /&gt;
&lt;br /&gt;
     It can be applied to a device&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z -u /dev/fd0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       CAUTION: Note that shred relies on a very important assumption: that the file system  overwrites  data&lt;br /&gt;
       in  place.   This is the traditional way to do things, but many modern file system designs do not sat-&lt;br /&gt;
       isfy this assumption.  The following are examples of file systems on which shred is not effective,  or&lt;br /&gt;
       is not guaranteed to be effective in all file system modes:&lt;br /&gt;
&lt;br /&gt;
       * log-structured or journaled file systems, such as those supplied with&lt;br /&gt;
&lt;br /&gt;
              AIX and Solaris (and JFS, ReiserFS, XFS, Ext3, etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 52).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 10:&lt;br /&gt;
&lt;br /&gt;
     Who and What is doing What on Your System - finding open sockets,&lt;br /&gt;
     files etc.&lt;br /&gt;
&lt;br /&gt;
       $ lsof&lt;br /&gt;
          or as root&lt;br /&gt;
       $ watch lsof -i&lt;br /&gt;
&lt;br /&gt;
     To list all open Internet files, use:&lt;br /&gt;
&lt;br /&gt;
       $ lsof -i -U&lt;br /&gt;
&lt;br /&gt;
       (See TIP 118)&lt;br /&gt;
&lt;br /&gt;
     Also try fuser. Suppose you have a mounted file-system, and you need&lt;br /&gt;
     to umount it. To list the users on the file-system /work&lt;br /&gt;
&lt;br /&gt;
       $ fuser -u /work&lt;br /&gt;
&lt;br /&gt;
     To kill all processes accessing the file system /work  in  any way.&lt;br /&gt;
&lt;br /&gt;
       $ fuser -km /work&lt;br /&gt;
&lt;br /&gt;
     Or better yet, maybe you want to eject a cdrom on /mnt/cdrom&lt;br /&gt;
&lt;br /&gt;
       $ fuser -km /mnt/cdrom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     If you need IO load information about your system, you can execute&lt;br /&gt;
     iostat. But note, the very first iostat gives a snapshot since&lt;br /&gt;
     the last boot. You typically want the following command, which gives&lt;br /&gt;
     you 3 outputs every 5 seconds.&lt;br /&gt;
&lt;br /&gt;
       $ iostat -xtc 5 3&lt;br /&gt;
       Linux 2.6.12-1.1376_FC3smp (squeezel.squeezel.com) 	10/05/2005&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:04 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  0.97    0.06    1.94    0.62   96.41&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:09 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  0.60    0.00    1.70    0.00   97.70&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:14 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  1.00    0.00    1.60    0.00   97.39&lt;br /&gt;
&lt;br /&gt;
     vmstat reports memory statistics.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ vmstat&lt;br /&gt;
       $ ifconfig&lt;br /&gt;
       $ cat /proc/sys/vm/.. (entries under here)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      *NOTE: (TIP 77) shows sample usage of &amp;quot;ifconfig&amp;quot;. Also&lt;br /&gt;
       (TIP 84) shows sample output of &amp;quot;$ cat /proc/cpuinfo&amp;quot;. You can download iostat&lt;br /&gt;
       and other packages from (http://perso.wanadoo.fr/sebastien.godard/download_en.html).&lt;br /&gt;
       You also may want to look at iozone (TIP 178).&lt;br /&gt;
&lt;br /&gt;
     Also&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/meminfo&lt;br /&gt;
       $ cat /proc/stat&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/uptime&lt;br /&gt;
       1078623.55 1048008.34       First number is the number of seconds since boot.&lt;br /&gt;
                                   The second number is the number of idle seconds.&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/loadavg&lt;br /&gt;
       0.25 0.14 0.10 1/166 7778   This shows load at 1,5, and 15 minutes,&lt;br /&gt;
                                   a total of 1 current running process out&lt;br /&gt;
                                   from a total of 166. The 7778 is the last&lt;br /&gt;
                                   process id used.&lt;br /&gt;
                                   Ref: http://www.teamquest.com/resources/gunther/ldavg1.shtml&lt;br /&gt;
&lt;br /&gt;
     Or current process open file descriptors&lt;br /&gt;
&lt;br /&gt;
        $ ls -l /proc/self/fd/0&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lr-x------    1 chirico  chirico        64 Jun 29 13:17 3 -&amp;gt; /proc/26667/fd&lt;br /&gt;
&lt;br /&gt;
      So you could, $ echo &amp;quot;stuff&amp;quot; &amp;gt; /dev/pts/51, to get output. Note, tree is also&lt;br /&gt;
      helpful here:&lt;br /&gt;
&lt;br /&gt;
         $ tree /proc/self&lt;br /&gt;
&lt;br /&gt;
            /proc/self&lt;br /&gt;
            |-- auxv&lt;br /&gt;
            |-- cmdline&lt;br /&gt;
            |-- cwd -&amp;gt; /work/souptonuts/documentation/theBook&lt;br /&gt;
            |-- environ&lt;br /&gt;
            |-- exe -&amp;gt; /usr/bin/tree&lt;br /&gt;
            |-- fd&lt;br /&gt;
            |   |-- 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   |-- 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   |-- 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   `-- 3 -&amp;gt; /proc/26668/fd&lt;br /&gt;
            |-- maps&lt;br /&gt;
            |-- mem&lt;br /&gt;
            |-- mounts&lt;br /&gt;
            |-- root -&amp;gt; /&lt;br /&gt;
            |-- stat&lt;br /&gt;
            |-- statm&lt;br /&gt;
            |-- status&lt;br /&gt;
            |-- task&lt;br /&gt;
            |   `-- 26668&lt;br /&gt;
            |       |-- auxv&lt;br /&gt;
            |       |-- cmdline&lt;br /&gt;
            |       |-- cwd -&amp;gt; /work/souptonuts/documentation/theBook&lt;br /&gt;
            |       |-- environ&lt;br /&gt;
            |       |-- exe -&amp;gt; /usr/bin/tree&lt;br /&gt;
            |       |-- fd&lt;br /&gt;
            |       |   |-- 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   |-- 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   |-- 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   `-- 3 -&amp;gt; /proc/26668/task/26668/fd&lt;br /&gt;
            |       |-- maps&lt;br /&gt;
            |       |-- mem&lt;br /&gt;
            |       |-- mounts&lt;br /&gt;
            |       |-- root -&amp;gt; /&lt;br /&gt;
            |       |-- stat&lt;br /&gt;
            |       |-- statm&lt;br /&gt;
            |       |-- status&lt;br /&gt;
            |       `-- wchan&lt;br /&gt;
            `-- wchan&lt;br /&gt;
&lt;br /&gt;
            10 directories, 28 files&lt;br /&gt;
&lt;br /&gt;
     Need a listing of the system settings?&lt;br /&gt;
&lt;br /&gt;
       $ sysctl -a&lt;br /&gt;
&lt;br /&gt;
     Need IPC (Shared Memory Segments, Semaphore Arrays, Message Queue) status&lt;br /&gt;
     etc?&lt;br /&gt;
&lt;br /&gt;
       $ ipcs&lt;br /&gt;
       $ ipcs -l  &amp;quot;This gives limits&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Need to &amp;quot;watch&amp;quot; everything a user does?  The following watches donkey.&lt;br /&gt;
&lt;br /&gt;
       $ watch lsof -u donkey&lt;br /&gt;
&lt;br /&gt;
     Or, to see what in  going on in directory &amp;quot;/work/junk&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       $ watch lsof +D /work/junk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 11:&lt;br /&gt;
&lt;br /&gt;
     How to make a File &amp;quot;immutable&amp;quot; or &amp;quot;unalterable&amp;quot; -- it cannot be changed&lt;br /&gt;
     or deleted even by root. Note this works on (ext2/ext3) filesystems.&lt;br /&gt;
     And, yes, root can delete after it's changed back.&lt;br /&gt;
&lt;br /&gt;
     As root:&lt;br /&gt;
&lt;br /&gt;
       $ chattr +i filename&lt;br /&gt;
&lt;br /&gt;
     And to change it back:&lt;br /&gt;
&lt;br /&gt;
       $ chattr -i filename&lt;br /&gt;
&lt;br /&gt;
     List attributes&lt;br /&gt;
&lt;br /&gt;
       $ lsattr filename&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 12:&lt;br /&gt;
&lt;br /&gt;
     SSH - How to Generate the Key Pair.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     On the local server&lt;br /&gt;
&lt;br /&gt;
       $  ssh-keygen -t dsa -b 2048&lt;br /&gt;
&lt;br /&gt;
     This will create the two files:&lt;br /&gt;
&lt;br /&gt;
            .ssh/id_dsa (Private key)&lt;br /&gt;
            .ssh/id_dsa.pub  (Public key you can share)&lt;br /&gt;
&lt;br /&gt;
     Next insert &amp;quot;.ssh/id_dsa.pub&amp;quot; on the remote server&lt;br /&gt;
     in the file  &amp;quot;.ssh/authorized_keys&amp;quot; and &amp;quot;.ssh/authorized_keys2&amp;quot;&lt;br /&gt;
     and change the  permission of each file to (chmod 600). Plus, make&lt;br /&gt;
     sure the directory &amp;quot;.ssh&amp;quot; exists on the remote computer with 700 rights.&lt;br /&gt;
     Ok, assuming  192.168.1.155 is the remote server and &amp;quot;donkey&amp;quot; is the&lt;br /&gt;
     account on that remote server.&lt;br /&gt;
&lt;br /&gt;
       $ ssh donkey@192.168.1.155 &amp;quot;mkdir -p .ssh&amp;quot;&lt;br /&gt;
       $ ssh donkey@192.168.1.155 &amp;quot;chmod 700 .ssh&amp;quot;&lt;br /&gt;
       $ scp ./.ssh/id_dsa.pub  donkey@192.168.1.155:.ssh/newkey.pub&lt;br /&gt;
&lt;br /&gt;
     Now connect to that remote server &amp;quot;192.168.1.155&amp;quot; and add .ssh/newkey.pub&lt;br /&gt;
     to both &amp;quot;authorized_keys&amp;quot; and &amp;quot;authorized_keys2&amp;quot;.  When done, the permission&lt;br /&gt;
     on&lt;br /&gt;
       (This is on the remote server)&lt;br /&gt;
&lt;br /&gt;
        $chmod 600 .ssh/authorized_key*&lt;br /&gt;
&lt;br /&gt;
     Next, go back to the local server and issue the following:&lt;br /&gt;
&lt;br /&gt;
        $ ssh-agent $SHELL&lt;br /&gt;
        $ ssh-add&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;ssh-add&amp;quot; will allow you to enter the passphrase and it will&lt;br /&gt;
     save it for the current login session.&lt;br /&gt;
&lt;br /&gt;
     You don't have to enter a password when running &amp;quot;ssh-keygen&amp;quot; above. But,&lt;br /&gt;
     remember anyone with root access can &amp;quot;su - &amp;lt;username&amp;gt;&amp;quot; and then connect&lt;br /&gt;
     to your computers.  It's harder, however, not impossible, for root to do&lt;br /&gt;
     this if  you have a password.&lt;br /&gt;
&lt;br /&gt;
     (Reference TIP 151)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 13:&lt;br /&gt;
&lt;br /&gt;
     Securing the System: Don't allow root to login remotely.  Instead,&lt;br /&gt;
     the admin could login as another account, then, &amp;quot;su -&amp;quot;.  However,&lt;br /&gt;
     root can still login &amp;quot;from the local terminal&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     In the &amp;quot;/etc/ssh/sshd_config&amp;quot; file change the following lines:&lt;br /&gt;
&lt;br /&gt;
        Protocol 2&lt;br /&gt;
        PermitRootLogin no&lt;br /&gt;
        PermitEmptyPasswords no&lt;br /&gt;
&lt;br /&gt;
     Then, restart ssh&lt;br /&gt;
&lt;br /&gt;
        /etc/init.d/sshd restart&lt;br /&gt;
&lt;br /&gt;
     Why would you want to do this?  It's not possible for anyone to guess&lt;br /&gt;
     or keep trying the root account.  This is especially good for computers&lt;br /&gt;
     on the Internet. So, even if the &amp;quot;root&amp;quot; passwords is known, they can't&lt;br /&gt;
     get access to the system remotely.  Only from the terminal, which is locked&lt;br /&gt;
     in your computer room. However, if anyone has a account on the server,&lt;br /&gt;
     then, they can login under their  account then &amp;quot;su -&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Suppose you only want a limited number of users:  &amp;quot;mchirico&amp;quot; and &amp;quot;donkey&amp;quot;.&lt;br /&gt;
     Add the following line to &amp;quot;/etc/ssh/sshd_config&amp;quot;. Note, this allows access&lt;br /&gt;
     for chirico and donkey, but everyone else is denied.&lt;br /&gt;
&lt;br /&gt;
         #  Once you add AllowUsers - everyone else is denied.&lt;br /&gt;
         AllowUsers mchirico donkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 14:&lt;br /&gt;
&lt;br /&gt;
     Keep Logs Longer with Less Space.&lt;br /&gt;
&lt;br /&gt;
     Normally logs rotate monthly, over writing all the old data.  Here's a&lt;br /&gt;
     sample &amp;quot;/etc/logrotate.conf&amp;quot; that will keep 12 months of backup&lt;br /&gt;
     compressing the logfiles&lt;br /&gt;
&lt;br /&gt;
       $ cat /etc/logrotate.conf&lt;br /&gt;
&lt;br /&gt;
             # see &amp;quot;man logrotate&amp;quot; for details&lt;br /&gt;
             # rotate log files weekly&lt;br /&gt;
             #chirico changes to monthly&lt;br /&gt;
             monthly&lt;br /&gt;
&lt;br /&gt;
             # keep 4 weeks worth of backlogs&lt;br /&gt;
             # keep 12 months of backup&lt;br /&gt;
             rotate 12&lt;br /&gt;
&lt;br /&gt;
             # create new (empty) log files after rotating old ones&lt;br /&gt;
             create&lt;br /&gt;
&lt;br /&gt;
             # uncomment this if you want your log files compressed&lt;br /&gt;
             compress&lt;br /&gt;
&lt;br /&gt;
             # RPM packages drop log rotation information into this directory&lt;br /&gt;
             include /etc/logrotate.d&lt;br /&gt;
&lt;br /&gt;
             # no packages own wtmp -- we'll rotate them here&lt;br /&gt;
             /var/log/wtmp {&lt;br /&gt;
                 monthly&lt;br /&gt;
                 create 0664 root utmp&lt;br /&gt;
                 rotate 1&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
             # system-specific logs may be also be configured here.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Note: see tip 1. The clock should always be correctly set.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 15:&lt;br /&gt;
&lt;br /&gt;
     What Network Services are Running?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -atup&lt;br /&gt;
&lt;br /&gt;
     or&lt;br /&gt;
&lt;br /&gt;
          $ netstat -ap|grep LISTEN|less&lt;br /&gt;
&lt;br /&gt;
     This can be helpful to determine the services running.&lt;br /&gt;
&lt;br /&gt;
     Need stats on dropped UDP packets?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s -u&lt;br /&gt;
&lt;br /&gt;
     or TCP&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s -t&lt;br /&gt;
&lt;br /&gt;
     or summary of everything&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s&lt;br /&gt;
&lt;br /&gt;
     or looking for error rates on the interface?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -i&lt;br /&gt;
&lt;br /&gt;
     Listening interfaces?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -l&lt;br /&gt;
&lt;br /&gt;
     (Tip above provided by Amos Shapira)&lt;br /&gt;
&lt;br /&gt;
     Also see TIP 77.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 16:&lt;br /&gt;
&lt;br /&gt;
     Apache: Creating and Using an &amp;quot;.htaccess&amp;quot; File&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Below is a sample &amp;quot;.htaccess&amp;quot; file which goes in&lt;br /&gt;
     &amp;quot;/usr/local/apache/htdocs/chirico/alpha/.htaccess&amp;quot; for this&lt;br /&gt;
     example&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         AuthUserFile /usr/local/apache/htdocs/chirico/alpha/.htpasswd&lt;br /&gt;
         AuthGroupFile /dev/null&lt;br /&gt;
         AuthName &amp;quot;Your Name and regular password required&amp;quot;&lt;br /&gt;
         AuthType Basic&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;Limit GET POST&amp;gt;&lt;br /&gt;
         require valid-user&lt;br /&gt;
         &amp;lt;/Limit&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    In order for this to work /usr/local/apache/conf/httpd.conf must&lt;br /&gt;
    have the following line in it:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       #&lt;br /&gt;
       &amp;lt;Directory /usr/local/apache/htdocs/chirico/alpha&amp;gt;&lt;br /&gt;
           AllowOverride FileInfo AuthConfig Limit&lt;br /&gt;
           Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec&lt;br /&gt;
           &amp;lt;Limit GET POST OPTIONS PROPFIND&amp;gt;&lt;br /&gt;
               Order allow,deny&lt;br /&gt;
               Allow from all&lt;br /&gt;
           &amp;lt;/Limit&amp;gt;&lt;br /&gt;
           &amp;lt;LimitExcept GET POST OPTIONS PROPFIND&amp;gt;&lt;br /&gt;
               Order deny,allow&lt;br /&gt;
               Deny from all&lt;br /&gt;
           &amp;lt;/LimitExcept&amp;gt;&lt;br /&gt;
       &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Also, a password file must be created&lt;br /&gt;
&lt;br /&gt;
      $ /usr/local/apache/bin/htpasswd -c .htpasswd chirico&lt;br /&gt;
&lt;br /&gt;
    And enter the user names and passwords.&lt;br /&gt;
&lt;br /&gt;
    Next Reload Apache:&lt;br /&gt;
&lt;br /&gt;
      $ /etc/init.d/httpd reload&lt;br /&gt;
&lt;br /&gt;
    (Reference TIP 213 limit access to certain directories based on IP address).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 17:&lt;br /&gt;
&lt;br /&gt;
     Working with &amp;quot;mt&amp;quot; Commands: reading and writing to tape.&lt;br /&gt;
&lt;br /&gt;
     The following assumes the tape device is &amp;quot;/dev/st0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     STEP 1 ( rewind the tape)&lt;br /&gt;
&lt;br /&gt;
          # mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (check to see if you are at block 0)&lt;br /&gt;
&lt;br /&gt;
          # mt -f /dev/nst0 tell&lt;br /&gt;
            At block 0.&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Backup &amp;quot;tar compress&amp;quot;  directories &amp;quot;one&amp;quot;  and &amp;quot;two&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
          # tar -czf /dev/nst0 one two&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Check to see what block you are at)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
&lt;br /&gt;
       You should get something like block 2 at this point.&lt;br /&gt;
&lt;br /&gt;
     STEP 5 (Rewind the tape)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
     STEP 6 (List the files)&lt;br /&gt;
&lt;br /&gt;
           # tar -tzf /dev/nst0&lt;br /&gt;
              one/&lt;br /&gt;
              one/test&lt;br /&gt;
              two/&lt;br /&gt;
&lt;br /&gt;
     STEP 7 (Restore directory &amp;quot;one&amp;quot;  into directory &amp;quot;junk&amp;quot;).  Note, you&lt;br /&gt;
          have to first rewind the tape, since the last operation moved&lt;br /&gt;
          ahead 2 blocks. Check this with &amp;quot;mt -f /dev/nst0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           # cd junk&lt;br /&gt;
           # mt -f /dev/nst0 rewind&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
              At block 0.&lt;br /&gt;
           # tar -xzf /dev/nst0 one&lt;br /&gt;
&lt;br /&gt;
     STEP 8 (Next, take a look to see what block the tape is at)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
              At block 2.&lt;br /&gt;
&lt;br /&gt;
     STEP 9 (Now backup directories three  and four)&lt;br /&gt;
&lt;br /&gt;
           # tar -czf /dev/nst0 three four&lt;br /&gt;
&lt;br /&gt;
       After backing up the files, the tape should be past block 2.&lt;br /&gt;
       Check this.&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
             At block 4.&lt;br /&gt;
&lt;br /&gt;
          Currently the following exist:&lt;br /&gt;
&lt;br /&gt;
                At block 1:&lt;br /&gt;
                     one/&lt;br /&gt;
                    one/test&lt;br /&gt;
                    two/&lt;br /&gt;
&lt;br /&gt;
                At block 2:&lt;br /&gt;
                    three/&lt;br /&gt;
                    three/samplehere&lt;br /&gt;
                    four/&lt;br /&gt;
&lt;br /&gt;
                At block 4:&lt;br /&gt;
                    (* This is empty *)&lt;br /&gt;
&lt;br /&gt;
     A few notes. You can set the blocking factor and a label&lt;br /&gt;
     with tar. For example:&lt;br /&gt;
&lt;br /&gt;
      $ tar --label=&amp;quot;temp label&amp;quot; --create  --blocking-factor=128 --file=/dev/nst0 Notes&lt;br /&gt;
&lt;br /&gt;
     But note if you try to read it with the default, incorrect blocking&lt;br /&gt;
     factor, then, you will get the following error:&lt;br /&gt;
&lt;br /&gt;
        $ tar -t   --file=/dev/nst0&lt;br /&gt;
        tar: /dev/nst0: Cannot read: Cannot allocate memory&lt;br /&gt;
        tar: At beginning of tape, quitting now&lt;br /&gt;
        tar: Error is not recoverable: exiting now&lt;br /&gt;
&lt;br /&gt;
     However this is easily fixed with the correct blocking factor&lt;br /&gt;
&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ tar -t --blocking-factor=128 --file=/dev/nst0&lt;br /&gt;
         temp label&lt;br /&gt;
         Notes&lt;br /&gt;
&lt;br /&gt;
     Take advantage of the label command.&lt;br /&gt;
&lt;br /&gt;
         $ MYCOMMENTS=&amp;quot;Big_important_tape&amp;quot;&lt;br /&gt;
         $ tar --label=&amp;quot;$(date +%F)&amp;quot;+&amp;quot;${MYCOMMENTS}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Writing to tape on a remote 192.168.1.155 computer&lt;br /&gt;
&lt;br /&gt;
         $ tar cvzf - ./tmp | ssh -l chirico 192.168.1.155 '(mt -f /dev/nst0 rewind; dd of=/dev/st0 )'&lt;br /&gt;
&lt;br /&gt;
     Restoring the contents from tape on a remote computer&lt;br /&gt;
&lt;br /&gt;
         $ ssh -l chirico 192.168.1.155 '(mt -f /dev/nst0 rewind; dd if=/dev/st0  )'|tar xzf -&lt;br /&gt;
&lt;br /&gt;
     Getting data off of tape with dd command with odd blocking factor. Just set ibs very high&lt;br /&gt;
&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ tar --label=&amp;quot;Contenets of Notes&amp;quot; --create  --blocking-factor=128 --file=/dev/nst0 Notes&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ dd ibs=1048576 if=/dev/st0 of=notes.tar&lt;br /&gt;
&lt;br /&gt;
     The above will probably work with ibs=64k as well&lt;br /&gt;
&lt;br /&gt;
        (Also see TIP 136)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 18:&lt;br /&gt;
&lt;br /&gt;
     Encrypting Data to Tape using &amp;quot;tar&amp;quot; and &amp;quot;openssl&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     The following shows an example of writing the contents of &amp;quot;tapetest&amp;quot; to tape:&lt;br /&gt;
&lt;br /&gt;
        $ tar zcvf - tapetest|openssl des3 -salt  -k secretpassword | dd of=/dev/st0&lt;br /&gt;
&lt;br /&gt;
     Reading the data back:&lt;br /&gt;
&lt;br /&gt;
        $ dd if=/dev/st0|openssl des3 -d -k secretpassword|tar xzf -&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 19:&lt;br /&gt;
&lt;br /&gt;
     Mounting an ISO Image as a Filesystem -- this is great if you don't have the DVD&lt;br /&gt;
         hardware, but, need to get at the data.  The following show an example of&lt;br /&gt;
         mounting the Fedora core 2 as a file.&lt;br /&gt;
&lt;br /&gt;
         $ mkdir /iso0&lt;br /&gt;
         $ mount -o loop -t iso9660 /FC2-i386-DVD.iso  /iso0&lt;br /&gt;
&lt;br /&gt;
     Or to mount automatically at boot, add the following to &amp;quot;/etc/fstab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         /FC2-i386-DVD.iso /iso0     iso9660 rw,loop  0 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Reference: http://umn.dl.sourceforge.net/sourceforge/souptonuts/README_fedora.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 20:&lt;br /&gt;
&lt;br /&gt;
     Getting Information about the Hard drive and list all PCI devices.&lt;br /&gt;
&lt;br /&gt;
                $ hdparm /dev/hda&lt;br /&gt;
&lt;br /&gt;
                  /dev/hda:&lt;br /&gt;
                   multcount    = 16 (on)&lt;br /&gt;
                   IO_support   =  0 (default 16-bit)&lt;br /&gt;
                   unmaskirq    =  0 (off)&lt;br /&gt;
                   using_dma    =  1 (on)&lt;br /&gt;
                   keepsettings =  0 (off)&lt;br /&gt;
                   readonly     =  0 (off)&lt;br /&gt;
                   readahead    = 256 (on)&lt;br /&gt;
                   geometry     = 16383/255/63, sectors = 234375000, start = 0&lt;br /&gt;
&lt;br /&gt;
            or for SCSI&lt;br /&gt;
&lt;br /&gt;
                $ hdparm /dev/sda&lt;br /&gt;
&lt;br /&gt;
            Try it with the -i option for information&lt;br /&gt;
&lt;br /&gt;
                $ hdparm -i /dev/hda&lt;br /&gt;
&lt;br /&gt;
                /dev/hda:&lt;br /&gt;
&lt;br /&gt;
                Model=IC35L120AVV207-1, FwRev=V24OA66A, SerialNo=VNVD09G4CZ6E0T&lt;br /&gt;
                Config={ HardSect NotMFM HdSw&amp;gt;15uSec Fixed DTR&amp;gt;10Mbs }&lt;br /&gt;
                RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=52&lt;br /&gt;
                BuffType=DualPortCache, BuffSize=7965kB, MaxMultSect=16, MultSect=16&lt;br /&gt;
                CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=234375000&lt;br /&gt;
                IORDY=on/off, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}&lt;br /&gt;
                PIO modes:  pio0 pio1 pio2 pio3 pio4&lt;br /&gt;
                DMA modes:  mdma0 mdma1 mdma2&lt;br /&gt;
                UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5&lt;br /&gt;
                AdvancedPM=yes: disabled (255) WriteCache=enabled&lt;br /&gt;
                Drive conforms to: ATA/ATAPI-6 T13 1410D revision 3a:  2 3 4 5 6&lt;br /&gt;
&lt;br /&gt;
            How fast is your drive?&lt;br /&gt;
&lt;br /&gt;
                $ hdparm -tT /dev/hda&lt;br /&gt;
&lt;br /&gt;
                /dev/hda:&lt;br /&gt;
                Timing buffer-cache reads:   128 MB in  0.41 seconds =315.32 MB/sec&lt;br /&gt;
                Timing buffered disk reads:  64 MB in  1.19 seconds = 53.65 MB/sec&lt;br /&gt;
&lt;br /&gt;
            Need to find your device?&lt;br /&gt;
&lt;br /&gt;
                $ mount&lt;br /&gt;
                   or&lt;br /&gt;
                $ cat /proc/partitions&lt;br /&gt;
                   or&lt;br /&gt;
                $ dmesg | egrep '^(s|h)d'&lt;br /&gt;
&lt;br /&gt;
                   which for my system lists:&lt;br /&gt;
&lt;br /&gt;
                      hda: IC35L120AVV207-1, ATA DISK drive&lt;br /&gt;
                      hdc: Lite-On LTN486S 48x Max, ATAPI CD/DVD-ROM drive&lt;br /&gt;
                      hda: max request size: 1024KiB&lt;br /&gt;
                      hda: 234375000 sectors (120000 MB) w/7965KiB Cache, CHS=16383/255/63, UDMA(100)&lt;br /&gt;
&lt;br /&gt;
             By the way, if you want to turn on dma&lt;br /&gt;
&lt;br /&gt;
                 $ hdparm -d1 /dev/hda&lt;br /&gt;
                   setting using_dma to 1 (on)&lt;br /&gt;
                   using_dma    =  1 (on)&lt;br /&gt;
&lt;br /&gt;
         (Also see TIP 122 )&lt;br /&gt;
&lt;br /&gt;
     List all PCI devices&lt;br /&gt;
&lt;br /&gt;
                $ lspci -v&lt;br /&gt;
&lt;br /&gt;
          00:00.0 Host bridge: Intel Corp. 82845G/GL [Brookdale-G] Chipset Host Bridge (rev&lt;br /&gt;
                  Subsystem: Dell Computer Corporation: Unknown device 0160&lt;br /&gt;
                  Flags: bus master, fast devsel, latency 0&lt;br /&gt;
                  Memory at f0000000 (32-bit, prefetchable) [size=128M]&lt;br /&gt;
                  Capabilities: &amp;lt;available only to root&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              ... lots more ...&lt;br /&gt;
&lt;br /&gt;
           Note, there is also lspci -vv for even more information.&lt;br /&gt;
&lt;br /&gt;
          (Also see TIP 200)&lt;br /&gt;
&lt;br /&gt;
TIP 21:&lt;br /&gt;
&lt;br /&gt;
     Setting up &amp;quot;cron&amp;quot; Jobs.&lt;br /&gt;
&lt;br /&gt;
     If you want to use the emacs editor for editing cron jobs, then,&lt;br /&gt;
     set the following in your &amp;quot;/home/user/.bash_profile&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        EDITOR=emacs&lt;br /&gt;
&lt;br /&gt;
     Then, to edit cron jobs&lt;br /&gt;
&lt;br /&gt;
        $ crontab -e&lt;br /&gt;
&lt;br /&gt;
     You may want to put in the following header&lt;br /&gt;
&lt;br /&gt;
        #MINUTE(0-59) HOUR(0-23) DAYOFMONTH(1-31) MONTHOFYEAR(1-12) DAYOFWEEK(0-6) Note 0=Sun and 7=Sun&lt;br /&gt;
        #&lt;br /&gt;
        #14,15 10 * * 0   /usr/bin/somecommmand  &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     The sample &amp;quot;commented out command&amp;quot; will run at 10:14 and 10:15 every Sunday.  There will&lt;br /&gt;
     be no &amp;quot;mail&amp;quot; sent to the user because of the &amp;quot;&amp;gt;/dev/null 2&amp;gt;&amp;amp;1&amp;quot; entry.&lt;br /&gt;
&lt;br /&gt;
        $ crontab -l&lt;br /&gt;
&lt;br /&gt;
     The above will list all cron jobs. Or if you're root&lt;br /&gt;
&lt;br /&gt;
        $ crontab -l -u &amp;lt;username&amp;gt;&lt;br /&gt;
        $ crontab -e -u &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Reference &amp;quot;man 5 crontab&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
        The time and date fields are:&lt;br /&gt;
&lt;br /&gt;
                     field          allowed values&lt;br /&gt;
                     -----          --------------&lt;br /&gt;
                     minute         0-59&lt;br /&gt;
                     hour           0-23&lt;br /&gt;
                     day of month   1-31&lt;br /&gt;
                     month          1-12 (or names, see below)&lt;br /&gt;
                     day of week    0-7 (0 or 7 is Sun, or use names)&lt;br /&gt;
&lt;br /&gt;
              A field may be an asterisk (*), which always stands for ``first-last''.&lt;br /&gt;
&lt;br /&gt;
              Ranges of numbers are allowed.  Ranges are two numbers separated with a&lt;br /&gt;
              hyphen.   The  specified  range is inclusive.  For example, 8-11 for an&lt;br /&gt;
              ``hours'' entry specifies execution at hours 8, 9, 10 and 11.&lt;br /&gt;
&lt;br /&gt;
              Lists are allowed.  A list is a set of numbers (or ranges) separated by&lt;br /&gt;
              commas.  Examples: ``1,2,5,9'', ``0-4,8-12''.&lt;br /&gt;
&lt;br /&gt;
              Ranges can include &amp;quot;steps&amp;quot;, so &amp;quot;1-9/2&amp;quot; is the same as &amp;quot;1,3,5,7,9&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Note, you can run just every 5 minutes as follows:&lt;br /&gt;
&lt;br /&gt;
              */5 * * * * /etc/mrtg/domrtg  &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     To run jobs hourly,daily,weekly or monthly you can add shell scripts into the&lt;br /&gt;
     appropriate directory:&lt;br /&gt;
&lt;br /&gt;
             /etc/cron.hourly/&lt;br /&gt;
             /etc/cron.daily/&lt;br /&gt;
             /etc/cron.weekly/&lt;br /&gt;
             /etc/cron.monthly/&lt;br /&gt;
&lt;br /&gt;
     Note that the above are pre-configured schedules set in &amp;quot;/etc/crontab&amp;quot;, so&lt;br /&gt;
     if you want, you can change the schedule. Below is my /etc/crontab:&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/crontab&lt;br /&gt;
           SHELL=/bin/bash&lt;br /&gt;
           PATH=/sbin:/bin:/usr/sbin:/usr/bin&lt;br /&gt;
           MAILTO=root&lt;br /&gt;
           HOME=/&lt;br /&gt;
&lt;br /&gt;
           # run-parts&lt;br /&gt;
           01 * * * * root run-parts /etc/cron.hourly&lt;br /&gt;
           02 4 * * * root run-parts /etc/cron.daily&lt;br /&gt;
           22 4 * * 0 root run-parts /etc/cron.weekly&lt;br /&gt;
           42 4 1 * * root run-parts /etc/cron.monthly&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 22:&lt;br /&gt;
&lt;br /&gt;
     Keeping Files in Sync Between Servers.&lt;br /&gt;
&lt;br /&gt;
     The remote computer is &amp;quot;192.168.1.171&amp;quot; and has the account &amp;quot;donkey&amp;quot;.  You want&lt;br /&gt;
     to &amp;quot;keep in sync&amp;quot; the files under &amp;quot;/home/cu2000/Logs&amp;quot; on the remote computer&lt;br /&gt;
     with files on &amp;quot;/home/chirico/dev/MEDIA_Server&amp;quot; on the local computer.&lt;br /&gt;
&lt;br /&gt;
       $ rsync  -Lae ssh  donkey@192.168.1.171:/home/cu2000/Logs /home/chirico/dev/MEDIA_Server&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;rsync&amp;quot; is a convient command for keeping files in sync, and as shown here will work&lt;br /&gt;
     through ssh.  The -L option tells rsync to treat symbolic links like ordinary files.&lt;br /&gt;
&lt;br /&gt;
        Also see [http://www.rsnapshot.org/]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 23:&lt;br /&gt;
&lt;br /&gt;
     Looking up the Spelling of a Word.&lt;br /&gt;
&lt;br /&gt;
        $ look &amp;lt;partial spelling&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     so the following will list all words that&lt;br /&gt;
     start with stuff&lt;br /&gt;
&lt;br /&gt;
        $ look stuff&lt;br /&gt;
           stuff&lt;br /&gt;
           stuffage&lt;br /&gt;
           stuffata&lt;br /&gt;
           stuffed&lt;br /&gt;
           stuffender&lt;br /&gt;
           stuffer&lt;br /&gt;
           stuffers&lt;br /&gt;
           stuffgownsman&lt;br /&gt;
           stuffier&lt;br /&gt;
           stuffiest&lt;br /&gt;
           stuffily&lt;br /&gt;
           stuffiness&lt;br /&gt;
           stuffinesses&lt;br /&gt;
           stuffiness's&lt;br /&gt;
           stuffing&lt;br /&gt;
           stuffings&lt;br /&gt;
           stuffing's&lt;br /&gt;
           stuffless&lt;br /&gt;
           stuffs&lt;br /&gt;
           stuffy&lt;br /&gt;
&lt;br /&gt;
     It helps to have a large &amp;quot;linuxwords&amp;quot; dictionary.  You can download&lt;br /&gt;
     a much bigger dictionary from the following:&lt;br /&gt;
&lt;br /&gt;
              http://prdownloads.sourceforge.net/souptonuts/linuxwords.1.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
     Note: vim users can setup the .vimrc file with the following. Now when you type &lt;br /&gt;
       CTL-X CTL-T in insert mode, you'll get a thesaurus lookup.&lt;br /&gt;
&lt;br /&gt;
           set dictionary+=/usr/share/dict/words&lt;br /&gt;
           set thesaurus+=/usr/share/dict/words&lt;br /&gt;
&lt;br /&gt;
     Or, you can call aspell with the F6 command after putting the folling entry in your&lt;br /&gt;
     .vimrc file&lt;br /&gt;
&lt;br /&gt;
           :nmap &amp;lt;F6&amp;gt; :w&amp;lt;CR&amp;gt;:!aspell -e -c %&amp;lt;CR&amp;gt;:e&amp;lt;CR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Now, hit F6 when you're in vim, and you'll get a spell checker.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     There is also an X Windows dictionary that runs with the following command.&lt;br /&gt;
&lt;br /&gt;
           $ gnome-dictionary&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 24:&lt;br /&gt;
&lt;br /&gt;
     Find out if a Command is Aliased.&lt;br /&gt;
&lt;br /&gt;
         $ type -all &amp;lt;command&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Example:&lt;br /&gt;
&lt;br /&gt;
         $ type -all ls&lt;br /&gt;
            ls is aliased to `ls --color=tty'&lt;br /&gt;
            ls is /bin/ls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 25:&lt;br /&gt;
&lt;br /&gt;
     Create a Terminal Calculator&lt;br /&gt;
&lt;br /&gt;
      Put the following in your .bashrc file&lt;br /&gt;
&lt;br /&gt;
            function calc&lt;br /&gt;
            {&lt;br /&gt;
             echo &amp;quot;${1}&amp;quot;|bc -l;&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
      Or, run it at the shell prompt. Now&lt;br /&gt;
      &amp;quot;calc&amp;quot; from the shell will work as follows:&lt;br /&gt;
&lt;br /&gt;
            $ calc 3+45&lt;br /&gt;
               48&lt;br /&gt;
&lt;br /&gt;
      All functions  with a &amp;quot;(&amp;quot; or &amp;quot;)&amp;quot; must be enclosed&lt;br /&gt;
      in quotes.  For instance, to get the sin of .4&lt;br /&gt;
&lt;br /&gt;
            $ calc &amp;quot;s(.4)&amp;quot;&lt;br /&gt;
              .38941834230865049166&lt;br /&gt;
&lt;br /&gt;
          (See TIP 115 using the expr command)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 26:&lt;br /&gt;
&lt;br /&gt;
     Kill a User and All Their Current Processes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        #  This program will kill all processes from a&lt;br /&gt;
        #  user.  The user name is read from the command line.&lt;br /&gt;
        #&lt;br /&gt;
        #  This program also demonstrates reading a bash variable&lt;br /&gt;
        #  into an awk script.&lt;br /&gt;
        #&lt;br /&gt;
        #  Usage: kill9user &amp;lt;user&amp;gt;&lt;br /&gt;
        #&lt;br /&gt;
        kill -9 `ps aux|awk -v var=$1 '$1==var { print $2 }'`&lt;br /&gt;
&lt;br /&gt;
    or if you want want to create the above script the command&lt;br /&gt;
    below will kill the user &amp;quot;donkey&amp;quot; and all of his processes.&lt;br /&gt;
&lt;br /&gt;
        $ kill -9 `ps aux|awk -v var=&amp;quot;donkey&amp;quot; '$1==var { print $2 }'`&lt;br /&gt;
&lt;br /&gt;
    Check their cron jobs and &amp;quot;at&amp;quot; jobs, if you have a security issue.&lt;br /&gt;
&lt;br /&gt;
          $ crontab -u &amp;lt;user&amp;gt; -e&lt;br /&gt;
&lt;br /&gt;
    Lock the account:&lt;br /&gt;
&lt;br /&gt;
          $ passwd -l &amp;lt;user&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Remove all authorized_keys&lt;br /&gt;
&lt;br /&gt;
          $ rm /home/user/.shosts&lt;br /&gt;
          $ rm /home/user/.rhosts&lt;br /&gt;
          $ rm -rf /home/user/.ssh&lt;br /&gt;
          $ rm /home/user/.forward&lt;br /&gt;
&lt;br /&gt;
      or consider&lt;br /&gt;
&lt;br /&gt;
          $ mv /home/user  /home/safeuser&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Change the shell&lt;br /&gt;
&lt;br /&gt;
          $ chsh -s /bin/true &amp;lt;user&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Do an inventory&lt;br /&gt;
&lt;br /&gt;
          $ find / -user &amp;lt;user&amp;gt;  &amp;gt; list_of_user_files&lt;br /&gt;
&lt;br /&gt;
    NOTE: Also see (TIP 10).&lt;br /&gt;
&lt;br /&gt;
    To see all users, except the current user. Do not use the&lt;br /&gt;
    dash &amp;quot;ps -aux&amp;quot; is wrong but the following is correct:&lt;br /&gt;
&lt;br /&gt;
          $ ps aux| awk '!/'${USER}'/{printf(&amp;quot;%s \n&amp;quot;,$0)}'&lt;br /&gt;
&lt;br /&gt;
     or (ww = wide, wide output)&lt;br /&gt;
&lt;br /&gt;
          $ ps auwwx| awk '!/'${USER}'/{printf(&amp;quot;%s \n&amp;quot;,$0)}'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    The following codes may be useful:&lt;br /&gt;
&lt;br /&gt;
       D    Uninterruptible sleep (usually IO)&lt;br /&gt;
       R    Running or runnable (on run queue)&lt;br /&gt;
       S    Interruptible sleep (waiting for an event to complete)&lt;br /&gt;
       T    Stopped, either by a job control signal or because it is being traced.&lt;br /&gt;
       W    paging (not valid since the 2.6.xx kernel)&lt;br /&gt;
       X    dead (should never be seen)&lt;br /&gt;
       Z    Defunct (&amp;quot;zombie&amp;quot;) process, terminated but not reaped by its parent.&lt;br /&gt;
&lt;br /&gt;
    For BSD formats and when the stat keyword is used, additional&lt;br /&gt;
       characters may be displayed:&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;    high-priority (not nice to other users)&lt;br /&gt;
       N    low-priority (nice to other users)&lt;br /&gt;
       L    has pages locked into memory (for real-time and custom IO)&lt;br /&gt;
       s    is a session leader&lt;br /&gt;
       l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)&lt;br /&gt;
       +    is in the foreground process group&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Also see TIP 28. and TIP 89.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 27:&lt;br /&gt;
&lt;br /&gt;
     Format Dates for Logs and Files&lt;br /&gt;
&lt;br /&gt;
         $ date &amp;quot;+%m%d%y %A,%B %d %Y %X&amp;quot;&lt;br /&gt;
             061704 Thursday,June 17 2004 07:13:40 PM&lt;br /&gt;
&lt;br /&gt;
         $ date &amp;quot;+%m%d%Y&amp;quot;&lt;br /&gt;
             06172004&lt;br /&gt;
&lt;br /&gt;
         $ date -d '1 day ago' &amp;quot;+%m%d%Y&amp;quot;&lt;br /&gt;
             06162004&lt;br /&gt;
&lt;br /&gt;
         $ date -d '3 months 1 day  2 hour  15 minutes 2 seconds ago'&lt;br /&gt;
&lt;br /&gt;
      or to go into the future remove the &amp;quot;ago&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         $ date -d '3 months 1 day  2 hour  15 minutes 2 seconds '&lt;br /&gt;
&lt;br /&gt;
            Also the following works:&lt;br /&gt;
&lt;br /&gt;
                $ date -d '+2 year +1 month -1 week  +3 day -8 hour +2 min -5 seconds'&lt;br /&gt;
&lt;br /&gt;
      Quick question: If there are 100,000,000 stars in the visible sky, and you can&lt;br /&gt;
      count them, round the clock, at a rate of a star per second starting now, when&lt;br /&gt;
      would you finish counting?  Would you still be alive?&lt;br /&gt;
&lt;br /&gt;
                $ date -d '+100000000 seconds'&lt;br /&gt;
&lt;br /&gt;
      Sooner than you think!&lt;br /&gt;
&lt;br /&gt;
      This can be assigned to variables&lt;br /&gt;
&lt;br /&gt;
         $ mdate=`date -d '3 months 1 day  2 hour  15 minutes 2 seconds ' &amp;quot;+%m%d%Y_%A_%B_%D_%Y_%X&amp;quot;  `&lt;br /&gt;
         $ echo $mdate&lt;br /&gt;
             09182004_Saturday_September_09/18/04_2004_09:40:41 PM&lt;br /&gt;
             ^---- Easy to sort   ^-------^----- Easy to read&lt;br /&gt;
&lt;br /&gt;
      See TIP 28 below.&lt;br /&gt;
&lt;br /&gt;
      See TIP 87 when working with large delta time changes -40 years, or -200 years ago, or even&lt;br /&gt;
      1,000,000 days into the future.&lt;br /&gt;
&lt;br /&gt;
      Also see (TIP 1) for working with time zones.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 28:&lt;br /&gt;
&lt;br /&gt;
     Need Ascii Codes? For instance, for printing quotes:&lt;br /&gt;
&lt;br /&gt;
                         awk 'BEGIN { msg = &amp;quot;Don\047t Panic!&amp;quot;; printf &amp;quot;%s \n&amp;quot;,msg }'&lt;br /&gt;
              or&lt;br /&gt;
                         awk 'BEGIN { msg = &amp;quot;Don\x027t Panic!&amp;quot;; printf &amp;quot;%s \n&amp;quot;,msg }'&lt;br /&gt;
&lt;br /&gt;
     It's better to use \047, because certain characters that follow \x027 may cause problems.&lt;br /&gt;
&lt;br /&gt;
     For example, take a look at the following two lines. The first line prints a &amp;quot;}&amp;quot; caused&lt;br /&gt;
     by the extra D in \x027D. The the line immediately below does not work as expected.&lt;br /&gt;
&lt;br /&gt;
                      awk 'BEGIN {printf(&amp;quot;The D causes problems \x027D\n&amp;quot;)}'&lt;br /&gt;
&lt;br /&gt;
            However, the line below works fine:&lt;br /&gt;
&lt;br /&gt;
                      awk 'BEGIN {printf(&amp;quot;The D does not cause problems \047D\n&amp;quot;)}'&lt;br /&gt;
&lt;br /&gt;
     Or if you wanted to use the date command in &amp;quot;awk&amp;quot; to print date.time.nanosecond.timezone for&lt;br /&gt;
     each line of a file &amp;quot;test&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     The following date can be used in awk because the single quotes are enclosed within the&lt;br /&gt;
     double quotes.&lt;br /&gt;
&lt;br /&gt;
             date '+%m%d%Y.%H%M%S.%N%z'&lt;br /&gt;
&lt;br /&gt;
       $ awk 'BEGIN { &amp;quot;date '+%m%d%Y.%H%M%S.%N%z'&amp;quot; | getline MyDate  } { print MyDate,$0 }' &amp;lt; data&lt;br /&gt;
&lt;br /&gt;
     But it's also possible to replace  &amp;quot;+&amp;quot;  with  \x2B,  &amp;quot;%&amp;quot; with \x25, and &amp;quot;d&amp;quot; with \x64 as follows:&lt;br /&gt;
&lt;br /&gt;
       $ awk 'BEGIN { &amp;quot;date \x27\x2B\x25m\x25\x64\x25Y.\x25H\x25M\x25S.\x25N\x25z\x27&amp;quot; | getline MyDate  } { print MyDate,$0 }' &amp;lt; test&lt;br /&gt;
&lt;br /&gt;
             07062004.113820.346033000-0400 bob 71&lt;br /&gt;
             07062004.113820.346033000-0400 tom 43&lt;br /&gt;
             07062004.113820.346033000-0400 sal 34&lt;br /&gt;
             07062004.113820.346033000-0400 bob 89&lt;br /&gt;
             07062004.113820.346033000-0400 tom 66&lt;br /&gt;
             07062004.113820.346033000-0400 sal 99&lt;br /&gt;
&lt;br /&gt;
     For this example it's not needed because single quotes are used inside of double quotes; however, there may be times when&lt;br /&gt;
     hex replacement is easier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ man ascii&lt;br /&gt;
&lt;br /&gt;
        Oct   Dec   Hex   Char           Oct   Dec   Hex   Char&lt;br /&gt;
            -----------------------------------------------------------&lt;br /&gt;
            000   0     00    NUL '\0'       100   64    40    @&lt;br /&gt;
            001   1     01    SOH            101   65    41    A&lt;br /&gt;
            002   2     02    STX            102   66    42    B&lt;br /&gt;
            003   3     03    ETX            103   67    43    C&lt;br /&gt;
            004   4     04    EOT            104   68    44    D&lt;br /&gt;
            005   5     05    ENQ            105   69    45    E&lt;br /&gt;
            006   6     06    ACK            106   70    46    F&lt;br /&gt;
            007   7     07    BEL '\a'       107   71    47    G&lt;br /&gt;
            010   8     08    BS  '\b'       110   72    48    H&lt;br /&gt;
            011   9     09    HT  '\t'       111   73    49    I&lt;br /&gt;
            012   10    0A    LF  '\n'       112   74    4A    J&lt;br /&gt;
            013   11    0B    VT  '\v'       113   75    4B    K&lt;br /&gt;
            014   12    0C    FF  '\f'       114   76    4C    L&lt;br /&gt;
            015   13    0D    CR  '\r'       115   77    4D    M&lt;br /&gt;
            016   14    0E    SO             116   78    4E    N&lt;br /&gt;
            017   15    0F    SI             117   79    4F    O&lt;br /&gt;
            020   16    10    DLE            120   80    50    P&lt;br /&gt;
            021   17    11    DC1            121   81    51    Q&lt;br /&gt;
            022   18    12    DC2            122   82    52    R&lt;br /&gt;
            023   19    13    DC3            123   83    53    S&lt;br /&gt;
            024   20    14    DC4            124   84    54    T&lt;br /&gt;
            025   21    15    NAK            125   85    55    U&lt;br /&gt;
            026   22    16    SYN            126   86    56    V&lt;br /&gt;
            027   23    17    ETB            127   87    57    W&lt;br /&gt;
            030   24    18    CAN            130   88    58    X&lt;br /&gt;
            031   25    19    EM             131   89    59    Y&lt;br /&gt;
            032   26    1A    SUB            132   90    5A    Z&lt;br /&gt;
            033   27    1B    ESC            133   91    5B    [&lt;br /&gt;
            034   28    1C    FS             134   92    5C    \   '\\'&lt;br /&gt;
            035   29    1D    GS             135   93    5D    ]&lt;br /&gt;
            036   30    1E    RS             136   94    5E    ^&lt;br /&gt;
            037   31    1F    US             137   95    5F    _&lt;br /&gt;
            040   32    20    SPACE          140   96    60    `&lt;br /&gt;
            041   33    21    !              141   97    61    a&lt;br /&gt;
            042   34    22    &amp;quot;              142   98    62    b&lt;br /&gt;
            043   35    23    #              143   99    63    c&lt;br /&gt;
            044   36    24    $              144   100   64    d&lt;br /&gt;
            045   37    25    %              145   101   65    e&lt;br /&gt;
            046   38    26    &amp;amp;              146   102   66    f&lt;br /&gt;
            047   39    27    '              147   103   67    g&lt;br /&gt;
            050   40    28    (              150   104   68    h&lt;br /&gt;
            051   41    29    )              151   105   69    i&lt;br /&gt;
            052   42    2A    *              152   106   6A    j&lt;br /&gt;
            053   43    2B    +              153   107   6B    k&lt;br /&gt;
            054   44    2C    ,              154   108   6C    l&lt;br /&gt;
            055   45    2D    -              155   109   6D    m&lt;br /&gt;
            056   46    2E    .              156   110   6E    n&lt;br /&gt;
            057   47    2F    /              157   111   6F    o&lt;br /&gt;
            060   48    30    0              160   112   70    p&lt;br /&gt;
            061   49    31    1              161   113   71    q&lt;br /&gt;
            062   50    32    2              162   114   72    r&lt;br /&gt;
            063   51    33    3              163   115   73    s&lt;br /&gt;
            064   52    34    4              164   116   74    t&lt;br /&gt;
            065   53    35    5              165   117   75    u&lt;br /&gt;
            066   54    36    6              166   118   76    v&lt;br /&gt;
            067   55    37    7              167   119   77    w&lt;br /&gt;
            070   56    38    8              170   120   78    x&lt;br /&gt;
            071   57    39    9              171   121   79    y&lt;br /&gt;
            072   58    3A    :              172   122   7A    z&lt;br /&gt;
            073   59    3B    ;              173   123   7B    {&lt;br /&gt;
            074   60    3C    &amp;lt;              174   124   7C    |&lt;br /&gt;
            075   61    3D    =              175   125   7D    }&lt;br /&gt;
            076   62    3E    &amp;gt;              176   126   7E    ~&lt;br /&gt;
            077   63    3F    ?              177   127   7F    DEL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 29:&lt;br /&gt;
&lt;br /&gt;
     Need a WWW Browser for the Terminal Session? Try lynx or elinks.&lt;br /&gt;
&lt;br /&gt;
         $ lynx&lt;br /&gt;
&lt;br /&gt;
     Or to read all these tips, with the latest updates&lt;br /&gt;
&lt;br /&gt;
      $ lynx http://umn.dl.sourceforge.net/sourceforge/souptonuts/How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Or, better yet elinks.&lt;br /&gt;
&lt;br /&gt;
         $ elinks http://somepage.&lt;br /&gt;
&lt;br /&gt;
     You can get elinks at the following site:&lt;br /&gt;
&lt;br /&gt;
             http://elinks.or.cz/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 30:&lt;br /&gt;
&lt;br /&gt;
    screen - screen manager with VT100/ANSI terminal emulation&lt;br /&gt;
&lt;br /&gt;
         This is an excellent utility. But if you work a lot in Emacs,&lt;br /&gt;
         then, you should place the following in your ~./.bashrc&lt;br /&gt;
&lt;br /&gt;
             alias s='screen -e^Pa -D -R'&lt;br /&gt;
&lt;br /&gt;
         After loging in again (or source .bashrc) ,&lt;br /&gt;
         type the following to load &amp;quot;screen&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
             $ s&lt;br /&gt;
&lt;br /&gt;
         If you're using the not using the alias command above, substitute&lt;br /&gt;
         CTL-a for CTL-p below. :&lt;br /&gt;
&lt;br /&gt;
             CTL-p CTL-C       To get a new session&lt;br /&gt;
             CTL-p  &amp;quot;           To list sessions, and arrow keys to move&lt;br /&gt;
             CTL-p SHFT-A      To name sessions&lt;br /&gt;
             CTL-p S            To split screens&lt;br /&gt;
             CLT-p Q            To unsplit screens&lt;br /&gt;
             CLT-p TAB          To switch between screens&lt;br /&gt;
             CLT-p :resize n    To resize screen to n rows, on split screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Screen is very powerful.  Should you become disconneced, you can&lt;br /&gt;
         still resume work after loggin in.&lt;br /&gt;
&lt;br /&gt;
             $ man screen&lt;br /&gt;
&lt;br /&gt;
         The above command will give you more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 31:&lt;br /&gt;
&lt;br /&gt;
     Need to Find the Factors of a Number?&lt;br /&gt;
&lt;br /&gt;
           $ factor 2345678992&lt;br /&gt;
                2345678992: 2 2 2 2 6581 22277&lt;br /&gt;
&lt;br /&gt;
     It's a quick way to find out if a number is prime&lt;br /&gt;
&lt;br /&gt;
           $ factor 7867&lt;br /&gt;
                7867: 7867&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 32:&lt;br /&gt;
&lt;br /&gt;
     Less is More -- piping to less to scroll backword and forward&lt;br /&gt;
&lt;br /&gt;
      For large &amp;quot;ls&amp;quot; listings try the followin, then, use the arrow key&lt;br /&gt;
      to move up and down the list.&lt;br /&gt;
&lt;br /&gt;
           $ ls /some_large_dir/ | less&lt;br /&gt;
&lt;br /&gt;
                 or&lt;br /&gt;
&lt;br /&gt;
           $ cat some_large_file | less&lt;br /&gt;
&lt;br /&gt;
                 or&lt;br /&gt;
&lt;br /&gt;
           $ less some_large_file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 33:&lt;br /&gt;
&lt;br /&gt;
     C &amp;quot;indent&amp;quot; Settings for Kernel Development&lt;br /&gt;
&lt;br /&gt;
           $ indent -kr -i8  program.c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 34:&lt;br /&gt;
&lt;br /&gt;
     FTP auto-login.  &amp;quot;ftp&amp;quot; to a site and have the password stored.&lt;br /&gt;
&lt;br /&gt;
     For instance, here's a sample &amp;quot;.net&amp;quot; file in a user's home&lt;br /&gt;
     directory for uploading to sourceforge. Note, sourceforge will&lt;br /&gt;
     take any password, so m@temp.com is used here for login &amp;quot;anonymous&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ cat ~/.netrc&lt;br /&gt;
               machine upload.sourceforge.net login anonymous password m@temp.com&lt;br /&gt;
               default login anonymous password user@site&lt;br /&gt;
&lt;br /&gt;
     It might be a good idea to change the rights on this file&lt;br /&gt;
&lt;br /&gt;
           $ chmod 0400 ~/.netrc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         #!/bin/bash&lt;br /&gt;
         #&lt;br /&gt;
         #  Sample ftp automated script to download&lt;br /&gt;
         #  file to ${dwnld}&lt;br /&gt;
         #&lt;br /&gt;
         dwnld=&amp;quot;/work/faq/unix-faq&amp;quot;&lt;br /&gt;
         cd ${dwnld}&lt;br /&gt;
         ftp &amp;lt;&amp;lt; FTPSTRING&lt;br /&gt;
         prompt off&lt;br /&gt;
         open rtfm.mit.edu&lt;br /&gt;
         cd /pub/usenet-by-group/news.answers/unix-faq/faq&lt;br /&gt;
         mget contents&lt;br /&gt;
         mget diff&lt;br /&gt;
         mget part*&lt;br /&gt;
         bye&lt;br /&gt;
         FTPSTRING&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      (Also see TIP 114 for ncftpget, which is a very powerful restarting&lt;br /&gt;
                            ftp program)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 35:&lt;br /&gt;
&lt;br /&gt;
     Bash Brace Expansion&lt;br /&gt;
&lt;br /&gt;
           $ echo f{ee,ie,oe,um}&lt;br /&gt;
                fee fie foe fum&lt;br /&gt;
&lt;br /&gt;
     This works with almost any command&lt;br /&gt;
&lt;br /&gt;
           $ mkdir -p /work/junk/{one,two,three,four}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 36:&lt;br /&gt;
&lt;br /&gt;
     Getting a List of Users on the System&lt;br /&gt;
&lt;br /&gt;
           $ cut -d: -f1 /etc/passwd | sort&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 37:&lt;br /&gt;
&lt;br /&gt;
     Editing a Bash Command&lt;br /&gt;
&lt;br /&gt;
      Try typing a long command say, then, type &amp;quot;fc&amp;quot; for an easy way&lt;br /&gt;
      to edit the command.&lt;br /&gt;
&lt;br /&gt;
           $ find /etc -iname '*.cnf' -exec grep -H 'log' {} \;&lt;br /&gt;
           $ fc&lt;br /&gt;
&lt;br /&gt;
      &amp;quot;fc&amp;quot; will bring the last command typed into an editor, &amp;quot;emacs&amp;quot; if&lt;br /&gt;
      that's the default editor. Type &amp;quot;fc -l&amp;quot; to list last few commands.&lt;br /&gt;
&lt;br /&gt;
      To seach for a command, try typing &amp;quot;CTL-r&amp;quot; at the shell prompt for&lt;br /&gt;
      searching. &amp;quot;CTL-t&amp;quot; to transpose, say &amp;quot;sl&amp;quot; was typed by you want &amp;quot;ls&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Hints when using &amp;quot;fc: in emacs:&lt;br /&gt;
&lt;br /&gt;
           ESC-b     move one word backward&lt;br /&gt;
           ESC-f     move one word forward&lt;br /&gt;
           ESC-DEL   kill one word backward&lt;br /&gt;
           CTL-k     kill point to end&lt;br /&gt;
           CTL-y     un-yank killed region at point&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 38:&lt;br /&gt;
&lt;br /&gt;
     Moving around Directories.&lt;br /&gt;
&lt;br /&gt;
     Change to the home directory:&lt;br /&gt;
          $ cd ~&lt;br /&gt;
            or&lt;br /&gt;
          $ cd&lt;br /&gt;
&lt;br /&gt;
     To go back to the last directory&lt;br /&gt;
          $ cd -&lt;br /&gt;
&lt;br /&gt;
     Instead of &amp;quot;cd&amp;quot; to a directory try &amp;quot;pushd&amp;quot; and look&lt;br /&gt;
     at the heading...you can see a list of directories.&lt;br /&gt;
&lt;br /&gt;
          $ pushd /etc&lt;br /&gt;
          $ pushd /usr/local&lt;br /&gt;
&lt;br /&gt;
      Then, to get back &amp;quot;popd&amp;quot; or &amp;quot;popd 1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      To list all the directories pushed on the stack&lt;br /&gt;
      use the &amp;quot;dirs -v&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
          $ dirs -v&lt;br /&gt;
           0  /usr/local&lt;br /&gt;
           1  /etc&lt;br /&gt;
           2  /work/souptonuts/documentation/theBook&lt;br /&gt;
&lt;br /&gt;
      Now, if you &amp;quot;pushd +1&amp;quot; you will be moved to &amp;quot;/etc&amp;quot;, since&lt;br /&gt;
      is number &amp;quot;1&amp;quot; on the stack, and this directory will become&lt;br /&gt;
      &amp;quot;0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ pwd&lt;br /&gt;
           /usr/local&lt;br /&gt;
          $ pushd +1&lt;br /&gt;
          $ pwd&lt;br /&gt;
           /etc&lt;br /&gt;
&lt;br /&gt;
          $ dirs -v&lt;br /&gt;
           0  /etc&lt;br /&gt;
           1  /work/souptonuts/documentation/theBook&lt;br /&gt;
           2  /usr/local&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 39:&lt;br /&gt;
&lt;br /&gt;
     Need an Underscore after a Variable?&lt;br /&gt;
&lt;br /&gt;
       Enclose the variable in &amp;quot;{}&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $echo ${UID}_&lt;br /&gt;
&lt;br /&gt;
       Compare to&lt;br /&gt;
&lt;br /&gt;
          $echo $UID_&lt;br /&gt;
&lt;br /&gt;
       Also try the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ m=&amp;quot;my stuff here&amp;quot;&lt;br /&gt;
                $ echo -e ${m// /'\n'}&lt;br /&gt;
                        my&lt;br /&gt;
                        stuff&lt;br /&gt;
                        here&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 40:&lt;br /&gt;
&lt;br /&gt;
     Bash Variable Offset and String Operators&lt;br /&gt;
&lt;br /&gt;
        $ r=&amp;quot;this is stuff&amp;quot;&lt;br /&gt;
        $ echo ${r:3}&lt;br /&gt;
        $ echo ${r:5:2}&lt;br /&gt;
&lt;br /&gt;
      Note, ${varname:offset:length}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         ${varname:?message}  If varname exist and isn't null return value, else,&lt;br /&gt;
                              print var and message.&lt;br /&gt;
&lt;br /&gt;
           $ r=&amp;quot;new stuff&amp;quot;&lt;br /&gt;
           $ echo ${r:? &amp;quot;that's r for you&amp;quot;}&lt;br /&gt;
               new stuff&lt;br /&gt;
           $ unset r&lt;br /&gt;
           $ echo ${r:? &amp;quot;that's r for you&amp;quot;}&lt;br /&gt;
               bash: r:  that's r for you&lt;br /&gt;
&lt;br /&gt;
         ${varname:+word}    If varname exist and not null return word. Else, return null.&lt;br /&gt;
&lt;br /&gt;
         ${varname:-word}    If varname exist and not null return value. Else, return word.&lt;br /&gt;
&lt;br /&gt;
      Working with arrays in bash - bash arrays.&lt;br /&gt;
&lt;br /&gt;
           $ unset p&lt;br /&gt;
           $ p=(one two three)&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[@]}&amp;quot;&lt;br /&gt;
           one two three&lt;br /&gt;
&lt;br /&gt;
      or&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[*]}&amp;quot;&lt;br /&gt;
           one two three&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${#p[@]}&amp;quot;&lt;br /&gt;
           3&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[0]}&amp;quot;&lt;br /&gt;
           one&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[1]}&amp;quot;&lt;br /&gt;
           two&lt;br /&gt;
&lt;br /&gt;
            Also see (TIP 95)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 41:&lt;br /&gt;
&lt;br /&gt;
     Loops in Bash&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The command below loops through directories listed in $PATH.&lt;br /&gt;
&lt;br /&gt;
          $ path=$PATH:&lt;br /&gt;
          $ while [ $path ]; do echo &amp;quot; ${path%%:*} &amp;quot;; path=${path#*:}; done&lt;br /&gt;
&lt;br /&gt;
       The command below will also loop through directories in your path.&lt;br /&gt;
&lt;br /&gt;
          $IFS=:&lt;br /&gt;
          $ for dir in $PATH&lt;br /&gt;
          &amp;gt; do&lt;br /&gt;
          &amp;gt; ls -ld $dir&lt;br /&gt;
          &amp;gt; done&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Jun 10 20:16 /usr/local/bin&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Jun 13 23:12 /bin&lt;br /&gt;
              drwxr-xr-x    3 root     root        40960 Jun 12 08:00 /usr/bin&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Feb 14 03:12 /usr/X11R6/bin&lt;br /&gt;
              drwxrwxr-x    2 chirico  chirico      4096 Jun  6 13:06 /home/chirico/bin&lt;br /&gt;
&lt;br /&gt;
     Other ways of doing loops:&lt;br /&gt;
&lt;br /&gt;
        for (( i=1; i &amp;lt;= 20; i++))&lt;br /&gt;
                do&lt;br /&gt;
                        echo -n &amp;quot;$i &amp;quot;&lt;br /&gt;
                done&lt;br /&gt;
&lt;br /&gt;
     Note, to do it all on one line, do the following:&lt;br /&gt;
&lt;br /&gt;
        $ for (( i=1; i &amp;lt;= 20; i++)); do echo -n &amp;quot;$i&amp;quot;; done&lt;br /&gt;
&lt;br /&gt;
     Below, is an example of declaring i an integer so that you do not&lt;br /&gt;
     have to preface with let.&lt;br /&gt;
&lt;br /&gt;
          $ declare -i i&lt;br /&gt;
          $ i=5;&lt;br /&gt;
          $ while (( $i &amp;gt; 1 )); do&lt;br /&gt;
          &amp;gt; i=i-1&lt;br /&gt;
          &amp;gt; echo $i&lt;br /&gt;
          &amp;gt; done&lt;br /&gt;
          4&lt;br /&gt;
          3&lt;br /&gt;
          2&lt;br /&gt;
&lt;br /&gt;
     You can also use &amp;quot;while [ $i -gt 1 ]; do&amp;quot;  in place of &amp;quot;while (( $i &amp;gt; 1 )); do&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     To get a listing of all declared values&lt;br /&gt;
&lt;br /&gt;
          $ declare -i&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Try putting a few words in the file &amp;quot;test&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         $ while read filename; do echo  &amp;quot;- $filename &amp;quot;; done &amp;lt; test |nl -w1&lt;br /&gt;
&lt;br /&gt;
     Or, using an array&lt;br /&gt;
&lt;br /&gt;
                declare -a Array&lt;br /&gt;
                Array[0]=&amp;quot;zero&amp;quot;&lt;br /&gt;
                Array[1]=&amp;quot;one&amp;quot;&lt;br /&gt;
                Array[2]=&amp;quot;two&amp;quot;&lt;br /&gt;
                for i in `seq ${#Array[@]}`&lt;br /&gt;
                do&lt;br /&gt;
                  echo $Array[$i-1]&lt;br /&gt;
                done&lt;br /&gt;
&lt;br /&gt;
         Also see (TIP 95 and TIP 133).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 42:&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;diff&amp;quot; and &amp;quot;patch&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
        You have created a program &amp;quot;prog.c&amp;quot;, saved as this name and also copied&lt;br /&gt;
        to  &amp;quot;prog.c.old&amp;quot;. You post &amp;quot;prog.c&amp;quot; to users.  Next, you make changes&lt;br /&gt;
        to prog.c&lt;br /&gt;
&lt;br /&gt;
          $ diff -c prog.c.old prog.c &amp;gt; prog.patch&lt;br /&gt;
&lt;br /&gt;
        Now, users can get the latest updates by running.&lt;br /&gt;
&lt;br /&gt;
          $ patch &amp;lt; prog.patch&lt;br /&gt;
&lt;br /&gt;
        By the way, you can make backups of your data easily.&lt;br /&gt;
&lt;br /&gt;
          $ cp /etc/fstab{,.bak}&lt;br /&gt;
&lt;br /&gt;
        Now, you do your edits to &amp;quot;/etc/fstab&amp;quot; and if you need&lt;br /&gt;
        to go back to the original, you can find it at&lt;br /&gt;
        &amp;quot;/etc/fstab.bak&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 43:&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;cat&amp;quot; the Contents of Files Listed in a File, in That Order.&lt;br /&gt;
&lt;br /&gt;
       SETUP (Assume you have the following)&lt;br /&gt;
&lt;br /&gt;
              $ cat file_of_files&lt;br /&gt;
                  file1&lt;br /&gt;
                  file2&lt;br /&gt;
&lt;br /&gt;
              $ cat file1&lt;br /&gt;
                  This is the data in file1&lt;br /&gt;
&lt;br /&gt;
              $ cat file 2&lt;br /&gt;
                  This is the data in file2&lt;br /&gt;
&lt;br /&gt;
       So there are 3 files here &amp;quot;file_of_files&amp;quot; which contains the name of&lt;br /&gt;
       other files.  In this case &amp;quot;file1&amp;quot; and &amp;quot;file2&amp;quot;. And the contents of&lt;br /&gt;
       &amp;quot;file1&amp;quot; and &amp;quot;file2&amp;quot; is shown above.&lt;br /&gt;
&lt;br /&gt;
               $ cat file_of_files|xargs cat&lt;br /&gt;
                    This is the data in  file1&lt;br /&gt;
                    This is the data in  file2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 44:&lt;br /&gt;
&lt;br /&gt;
     Columns and Rows -- getting anything you want.&lt;br /&gt;
&lt;br /&gt;
     Assume you have the following file.&lt;br /&gt;
&lt;br /&gt;
        $ cat data&lt;br /&gt;
           1 2 3&lt;br /&gt;
           4 5&lt;br /&gt;
           6 7 8 9 10&lt;br /&gt;
           11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
     How to you get everything in  2 columns?&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l2&lt;br /&gt;
           1 2&lt;br /&gt;
           3 4&lt;br /&gt;
           5 6&lt;br /&gt;
           7 8&lt;br /&gt;
           9 10&lt;br /&gt;
           11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
    Three columns?&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l3&lt;br /&gt;
           1 2 3&lt;br /&gt;
           4 5 6&lt;br /&gt;
           7 8 9&lt;br /&gt;
           10 11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
    What's the row sum of the &amp;quot;three columns?&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
           6&lt;br /&gt;
           15&lt;br /&gt;
           24&lt;br /&gt;
           33&lt;br /&gt;
           27&lt;br /&gt;
&lt;br /&gt;
    or&lt;br /&gt;
&lt;br /&gt;
        $ tr ' ' '\n' &amp;lt; data |xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
&lt;br /&gt;
    NOTE &amp;quot;Steven Heiner's rule&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
             cat one_file | program&lt;br /&gt;
&lt;br /&gt;
           can always be rewritten as&lt;br /&gt;
&lt;br /&gt;
             program &amp;lt; one_file&lt;br /&gt;
&lt;br /&gt;
   Note: thanks to Steven Heiner (http://www.shelldorado.com/) the above can be&lt;br /&gt;
       shortened as follows:&lt;br /&gt;
&lt;br /&gt;
               $ tr ' ' '\n' &amp;lt; data|xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
&lt;br /&gt;
          Need to &amp;quot;tr&amp;quot; from the stdin?&lt;br /&gt;
&lt;br /&gt;
               $ tr &amp;quot;xy&amp;quot; &amp;quot;yx&amp;quot;| ... | ...&lt;br /&gt;
&lt;br /&gt;
       But there is a the &amp;quot;Stephane CHAZELAS&amp;quot; condition here&lt;br /&gt;
&lt;br /&gt;
         &amp;quot;Note that tr, sed, and awk mail fail on files containing '\0'&lt;br /&gt;
          sed and awk have unspecified behaviors if the input&lt;br /&gt;
          doesn't end in a '\n' (or to sum up, cat works for&lt;br /&gt;
          binary and text files, text utilities such as sed or awk&lt;br /&gt;
          work only for text files).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 45:&lt;br /&gt;
&lt;br /&gt;
     Auto Directory Spelling Corrections.&lt;br /&gt;
&lt;br /&gt;
      To turn this on:&lt;br /&gt;
&lt;br /&gt;
           $ shopt -s cdspell&lt;br /&gt;
&lt;br /&gt;
      Now mispell a directory in the cd command.&lt;br /&gt;
&lt;br /&gt;
           $ cd /usk/local&lt;br /&gt;
                   ^-------- still gets you to --&lt;br /&gt;
                                                |&lt;br /&gt;
                                            /usr/local&lt;br /&gt;
&lt;br /&gt;
      What other options can you set? The following will list&lt;br /&gt;
      all the options:&lt;br /&gt;
&lt;br /&gt;
           $ shopt -p&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 46:&lt;br /&gt;
&lt;br /&gt;
     Record Eveything Printed on Your Terminal Screen.&lt;br /&gt;
&lt;br /&gt;
            $ script -a &amp;lt;filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Now start doing stuff and &amp;quot;everything&amp;quot; is appended to &amp;lt;filename&amp;gt;.&lt;br /&gt;
     For example&lt;br /&gt;
&lt;br /&gt;
            $ script installation&lt;br /&gt;
&lt;br /&gt;
            $ (command)&lt;br /&gt;
&lt;br /&gt;
            $ (result)&lt;br /&gt;
&lt;br /&gt;
            $ ...&lt;br /&gt;
&lt;br /&gt;
            $ ...&lt;br /&gt;
&lt;br /&gt;
            $ (command)&lt;br /&gt;
&lt;br /&gt;
            $ (result)&lt;br /&gt;
&lt;br /&gt;
            $ exit&lt;br /&gt;
&lt;br /&gt;
     The whole session log is in the installation file that you can later&lt;br /&gt;
     read and/or cleanup and add to a documentation.&lt;br /&gt;
&lt;br /&gt;
     This command can also be used to redirect the contents to another user,&lt;br /&gt;
     but you must be root to do this.&lt;br /&gt;
&lt;br /&gt;
     Step 1 - find out what pts they are using.&lt;br /&gt;
&lt;br /&gt;
            $ w&lt;br /&gt;
&lt;br /&gt;
     Step 2 - Run script on that pts. After running this command below&lt;br /&gt;
              everything you type will appear on their screen.&lt;br /&gt;
&lt;br /&gt;
            $ script /dev/pts/4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Thanks to Jacques.GARNIER-EXTERIEUR@EU.RHODIA.COM for his contribution&lt;br /&gt;
     to this tip.&lt;br /&gt;
&lt;br /&gt;
     Also reference TIP 208.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 47:&lt;br /&gt;
&lt;br /&gt;
     Monitor all Network Traffic Except Your Current ssh Connection.&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX -s 1500 port not 22&lt;br /&gt;
&lt;br /&gt;
       Or to filter out port 123 as well getting the full length of the packet&lt;br /&gt;
       (-s 0), use the following:&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX -s 0 port not 22  and port not 123&lt;br /&gt;
&lt;br /&gt;
       Or to filter only a certain host say 81.169.158.205&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX  port not 22 and host 81.169.158.205&lt;br /&gt;
&lt;br /&gt;
     Just want ip addresses and a little bit of data, then,&lt;br /&gt;
     use this. The &amp;quot;-c 20&amp;quot; is to stop after 20 packets.&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN  -s 1500 port not 22 -c 20&lt;br /&gt;
&lt;br /&gt;
     If you're looking for sign of DOS attacks, the following show just the SYN&lt;br /&gt;
     packets on all interfaces:&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump 'tcp[13] &amp;amp; 2 == 2'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 48:&lt;br /&gt;
&lt;br /&gt;
     Where are the GNU Reference Manuals?&lt;br /&gt;
&lt;br /&gt;
           http://www.gnu.org/manual/manual.html&lt;br /&gt;
&lt;br /&gt;
     Also worth a look the &amp;quot;Linux Documentation Project&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           http://en.tldp.org/&lt;br /&gt;
&lt;br /&gt;
     and Red Hat manuals&lt;br /&gt;
&lt;br /&gt;
           http://www.redhat.com/docs/manuals/enterprise/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 49:&lt;br /&gt;
&lt;br /&gt;
     Setting or Changing the Library Path.&lt;br /&gt;
&lt;br /&gt;
     The following contains the settings to be added or deleted&lt;br /&gt;
&lt;br /&gt;
           /etc/ld.so.conf&lt;br /&gt;
&lt;br /&gt;
     After this file is edited, you must run the following:&lt;br /&gt;
&lt;br /&gt;
           $ ldconfig&lt;br /&gt;
&lt;br /&gt;
     See &amp;quot;man ldconfig&amp;quot; for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 50:&lt;br /&gt;
&lt;br /&gt;
     Working with Libraries in C&lt;br /&gt;
&lt;br /&gt;
     Assume the following 3 programs:&lt;br /&gt;
&lt;br /&gt;
      $ cat ./src/test.c&lt;br /&gt;
&lt;br /&gt;
         int test(int t)&lt;br /&gt;
         {&lt;br /&gt;
           printf(&amp;quot;%d\n&amp;quot;,t);&lt;br /&gt;
           return t;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      $ cat ./src/prog1.c&lt;br /&gt;
&lt;br /&gt;
         /*&lt;br /&gt;
          program: prog1.c&lt;br /&gt;
          dependences: test.c&lt;br /&gt;
&lt;br /&gt;
          compiling this program:&lt;br /&gt;
          gcc -o prog test.c prog1.c&lt;br /&gt;
&lt;br /&gt;
          Note the libpersonal include&lt;br /&gt;
          should be remove if NOT using the&lt;br /&gt;
          library&lt;br /&gt;
         */&lt;br /&gt;
&lt;br /&gt;
         #include &amp;lt;libpersonal.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         int&lt;br /&gt;
         main(int argc, char **argv)&lt;br /&gt;
         {&lt;br /&gt;
           test(45);&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
      $ cat ./include/libpersonal.h&lt;br /&gt;
&lt;br /&gt;
         extern int test(int);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Prog1.c needs the test function in  test.c&lt;br /&gt;
     To compile, so that both programs work together, do the following:&lt;br /&gt;
&lt;br /&gt;
          $ cd src&lt;br /&gt;
          $ gcc -o prog test.c prog1.c -I../include&lt;br /&gt;
&lt;br /&gt;
     However, if you want to create your own static library, then, run the following:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p ../lib&lt;br /&gt;
          $ gcc -c test.c  -o ../lib/test.o&lt;br /&gt;
          $ cd ../lib&lt;br /&gt;
          $ ar r libpersonal.a test.o&lt;br /&gt;
          $ ranlib libpersonal.a&lt;br /&gt;
&lt;br /&gt;
     or, the ar and ranlib command can be combined as follows:&lt;br /&gt;
&lt;br /&gt;
          $ ar rs libpersonal.a test.o&lt;br /&gt;
&lt;br /&gt;
     To compile the program with the static library:&lt;br /&gt;
&lt;br /&gt;
          $ cd ../src&lt;br /&gt;
          $ gcc -I../include -L../lib -o prog1 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     The -I../include  tells  gcc to look in the ../include directory for&lt;br /&gt;
     libpersonal.h. and -L../lib, tells gcc to look for the&lt;br /&gt;
     &amp;quot;libpersonal.a&amp;quot; library.&lt;br /&gt;
&lt;br /&gt;
           $ cd ..&lt;br /&gt;
           $ tree src lib include&lt;br /&gt;
           src&lt;br /&gt;
           |-- prog&lt;br /&gt;
           |-- prog1&lt;br /&gt;
           |-- prog1.c&lt;br /&gt;
           `-- test.c&lt;br /&gt;
           lib&lt;br /&gt;
           |-- libpersonal.a&lt;br /&gt;
           `-- test.o&lt;br /&gt;
           include&lt;br /&gt;
           `-- libpersonal.h&lt;br /&gt;
&lt;br /&gt;
     This was a STATIC library. Often times you will want to use a SHARED&lt;br /&gt;
     or dynamic library.&lt;br /&gt;
&lt;br /&gt;
     SHARED LIBRARY:&lt;br /&gt;
&lt;br /&gt;
     You must recompile test.c with -fpic option.&lt;br /&gt;
&lt;br /&gt;
          $ cd ../lib&lt;br /&gt;
          $ gcc -c -fpic ../src/test.c -o test.o&lt;br /&gt;
&lt;br /&gt;
     Next create the libpersonal.so file.&lt;br /&gt;
&lt;br /&gt;
          $ gcc -shared -o libpersonal.so test.o&lt;br /&gt;
&lt;br /&gt;
     Now, compile the source prog1.c as follows:&lt;br /&gt;
&lt;br /&gt;
          $ cd ../src&lt;br /&gt;
          $ gcc -Wl,-R../lib -L../lib -I../include -o prog2 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
     This should work fine. But, take a look at prog2 using the ldd command.&lt;br /&gt;
&lt;br /&gt;
          $ ldd prog2&lt;br /&gt;
&lt;br /&gt;
        libpersonal.so =&amp;gt; ../lib/libpersonal.so (0x40017000)&lt;br /&gt;
        libc.so.6 =&amp;gt; /lib/tls/libc.so.6 (0x42000000)&lt;br /&gt;
        /lib/ld-linux.so.2 =&amp;gt; /lib/ld-linux.so.2 (0x40000000)&lt;br /&gt;
&lt;br /&gt;
     If you move the program prog2 to a different location, it will not run.&lt;br /&gt;
     Instead you will get the following error:&lt;br /&gt;
&lt;br /&gt;
           prog2: error while loading shared libraries: libpersonal.so:&lt;br /&gt;
                     cannot open shared object file: No such file or directory&lt;br /&gt;
&lt;br /&gt;
     To fix this, you should specify the direct path to the library. And in my&lt;br /&gt;
     case it is rather long&lt;br /&gt;
&lt;br /&gt;
      $  gcc -Wl,-R/work/souptonuts/documentation/theBook/lib -L../lib -I../include -o prog2 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE: The -R must always follow the -Wl.  (-Wl,-R&amp;lt;directory&amp;gt;) They always go together&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 51:&lt;br /&gt;
&lt;br /&gt;
     Actively Monitor a File and Send Email when Expression Occurs.&lt;br /&gt;
&lt;br /&gt;
     This is a way to monitor &amp;quot;/var/log/messages&amp;quot; or any file for certain changes.&lt;br /&gt;
     The example below actively monitors &amp;quot;stuff&amp;quot; for the work &amp;quot;now&amp;quot; and as soon as&lt;br /&gt;
     &amp;quot;now&amp;quot; is added to the file, the contents of msg are sent to the user&lt;br /&gt;
     mikechirico@hotmail.com&lt;br /&gt;
&lt;br /&gt;
          $ tail -f stuff | \&lt;br /&gt;
              awk ' /now/ { system(&amp;quot;mail -s \&amp;quot;This is working\&amp;quot;  mikechirico@hotmail.com &amp;lt; msg&amp;quot;) }'&lt;br /&gt;
&lt;br /&gt;
     Or, you can run a program, say get headings on slashdot from the program &amp;quot;getslash.php&amp;quot; which&lt;br /&gt;
     runs on  &amp;quot;192.168.1.155&amp;quot; with account &amp;quot;chirico&amp;quot;. Assuming you have ssh keys setup, then, the following&lt;br /&gt;
     will send mail from the output:&lt;br /&gt;
&lt;br /&gt;
          $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;|mail -s &amp;quot;Slash cron Headlines&amp;quot;  mchirico@comcast.net&lt;br /&gt;
&lt;br /&gt;
     See (TIP 80) for scraping the headings on slash dot and how to get a copy of &amp;quot;getslash.php&amp;quot;.  If you still&lt;br /&gt;
     want to use awk:&lt;br /&gt;
&lt;br /&gt;
           $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;| \&lt;br /&gt;
                      awk '{ print $0 | &amp;quot;mail -s \x27 Slash Topics \x27 mchirico@comcast.net &amp;quot;}'&lt;br /&gt;
&lt;br /&gt;
     Note the &amp;quot;\x27&amp;quot; is a quote.  Maybe you only want articles dealing with &amp;quot;Linux&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
           $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;| \&lt;br /&gt;
                      awk '/Linux/{ print $0 | &amp;quot;mail -s \x27 Slash Topics \x27 mchirico@comcast.net &amp;quot;}'&lt;br /&gt;
&lt;br /&gt;
     For $60, you can get a numeric display from &amp;quot;delcom engineering&amp;quot; that you can send messages and&lt;br /&gt;
     data to.  I get weather information off the internet and send it to this device.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/projects/delcom/&lt;br /&gt;
&lt;br /&gt;
     (Reference TIP 151 for ssh tips)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 52:&lt;br /&gt;
&lt;br /&gt;
     Need to Keep Secrets? Encrypt it.&lt;br /&gt;
&lt;br /&gt;
      To Encrypt:&lt;br /&gt;
&lt;br /&gt;
            $ openssl des3 -salt -in file.txt -out file.des3&lt;br /&gt;
&lt;br /&gt;
      The above will prompt for a password, or you can put it in&lt;br /&gt;
      with a -k option, assuming you're on a trusted server.&lt;br /&gt;
&lt;br /&gt;
      To Decrypt&lt;br /&gt;
&lt;br /&gt;
            $  openssl des3 -d -salt -in file.des3 -out file.txt -k mypassword&lt;br /&gt;
&lt;br /&gt;
      Need to encrypt what you type? Enter the following, then start typing&lt;br /&gt;
      and  ^D to end.&lt;br /&gt;
&lt;br /&gt;
            $ openssl des3 -salt -out stuff.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 53:&lt;br /&gt;
&lt;br /&gt;
     Check that a File has Not Been Tampered With: Use Cryptographic Hashing Function.&lt;br /&gt;
&lt;br /&gt;
     The md5sum is popular but dated&lt;br /&gt;
&lt;br /&gt;
              $ md5sum file&lt;br /&gt;
&lt;br /&gt;
     Instead, use one of the following;&lt;br /&gt;
&lt;br /&gt;
              $ openssl dgst -sha1 -c file&lt;br /&gt;
&lt;br /&gt;
              $ openssl dgst -ripemd160 -c  file&lt;br /&gt;
&lt;br /&gt;
     All calls give a fixed length string or &amp;quot;message digest&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 54:&lt;br /&gt;
&lt;br /&gt;
     Need to View Information About a Secure Web Server? A SSL/TLS test.&lt;br /&gt;
&lt;br /&gt;
           $ openssl s_client -connect www.sourceforge.net:443&lt;br /&gt;
&lt;br /&gt;
     Above will give a long listing of certificates.&lt;br /&gt;
&lt;br /&gt;
     Note, it is also possible to get certificate information about a mail server&lt;br /&gt;
&lt;br /&gt;
           $ openssl s_client -connect mail.comcast.net:995 -showcerts&lt;br /&gt;
&lt;br /&gt;
     When you do the above command you get two certificates. If you copy&lt;br /&gt;
     past both certificates by taking the following contents include the&lt;br /&gt;
     begin and end show below:&lt;br /&gt;
&lt;br /&gt;
                 -----BEGIN CERTIFICATE-----&lt;br /&gt;
                 ....&lt;br /&gt;
                 -----END CERTIFICATE-----&lt;br /&gt;
&lt;br /&gt;
     Then create files &amp;quot;comcast0.pem&amp;quot; and &amp;quot;comcast1.pem&amp;quot; out of these certificaties and&lt;br /&gt;
     put them in a directory &amp;quot;/home/donkey/.certs&amp;quot;, then, with the openssl src package, in&lt;br /&gt;
     the &amp;quot;./tools/c_rehash&amp;quot; run&lt;br /&gt;
&lt;br /&gt;
            $ c_rehash .certs&lt;br /&gt;
            Doing .certs&lt;br /&gt;
            comcast0.pem =&amp;gt; 72f90dc0.0&lt;br /&gt;
            comcast1.pem =&amp;gt; f73e89fd.0&lt;br /&gt;
&lt;br /&gt;
     Now it's possible to have fetchmail work with these certs.&lt;br /&gt;
&lt;br /&gt;
       #&lt;br /&gt;
       #&lt;br /&gt;
       # Sample .fetchmailrc file for Comcast&lt;br /&gt;
       #&lt;br /&gt;
       # Check mail every 90 seconds&lt;br /&gt;
       set daemon 90&lt;br /&gt;
       set syslog&lt;br /&gt;
       set postmaster donkey&lt;br /&gt;
       #set bouncemail&lt;br /&gt;
       #&lt;br /&gt;
       # Comcast email is zdonkey but computer account is  just donkey&lt;br /&gt;
       #&lt;br /&gt;
       poll mail.comcast.net with proto POP3 and options no dns&lt;br /&gt;
              user 'zdonkey' with pass &amp;quot;somethin35&amp;quot;  is 'donkey' here options ssl sslcertck sslcertpath '/home/donkey/.certs'&lt;br /&gt;
              smtphost comcast.net&lt;br /&gt;
       # currently not used&lt;br /&gt;
       mda '/usr/bin/procmail -d %T'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     REFERENCE: http://www.openssl.org/&lt;br /&gt;
                http://www.catb.org/~esr/fetchmail/fetchmail-6.2.5.tar.gz&lt;br /&gt;
                http://www.madboa.com/geek/openssl/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 55:&lt;br /&gt;
&lt;br /&gt;
     cp --parents. What does this option do?&lt;br /&gt;
&lt;br /&gt;
     Assume you have the following directory structure&lt;br /&gt;
&lt;br /&gt;
            .&lt;br /&gt;
            |-- a&lt;br /&gt;
            |   `-- b&lt;br /&gt;
            |       `-- c&lt;br /&gt;
            |           `-- d&lt;br /&gt;
            |               |-- file1&lt;br /&gt;
            |               `-- file2&lt;br /&gt;
            `-- newdir&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Issue the following command:&lt;br /&gt;
&lt;br /&gt;
         $ cp --parents ./a/b/c/d/* ./newdir/&lt;br /&gt;
&lt;br /&gt;
     Now you have the following:&lt;br /&gt;
&lt;br /&gt;
            .&lt;br /&gt;
            |-- a&lt;br /&gt;
            |   `-- b&lt;br /&gt;
            |       `-- c&lt;br /&gt;
            |           `-- d&lt;br /&gt;
            |               |-- file1&lt;br /&gt;
            |               `-- file2&lt;br /&gt;
            `-- newdir&lt;br /&gt;
                `-- a&lt;br /&gt;
                    `-- b&lt;br /&gt;
                        `-- c&lt;br /&gt;
                            `-- d&lt;br /&gt;
                                |-- file1&lt;br /&gt;
                                `-- file2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 56:&lt;br /&gt;
&lt;br /&gt;
     Quickly Locating files.&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;locate&amp;quot; command quickly searches the indexed database for files.  It just&lt;br /&gt;
     gives the name of the files; but, if you need more information use it as follows&lt;br /&gt;
&lt;br /&gt;
         $ locate document|xargs ls -l&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;locate&amp;quot; database may only get updated every 24 hours.  For more recent finds,&lt;br /&gt;
     use the &amp;quot;find&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 57:&lt;br /&gt;
&lt;br /&gt;
     Using the &amp;quot;find&amp;quot; Command.&lt;br /&gt;
&lt;br /&gt;
     List only directories, max 2 nodes down that have &amp;quot;net&amp;quot; in the name&lt;br /&gt;
&lt;br /&gt;
       $ find /proc -type d -maxdepth 2 -iname '*net*'&lt;br /&gt;
&lt;br /&gt;
     Find all *.c and *.h files starting from the current &amp;quot;.&amp;quot; position.&lt;br /&gt;
&lt;br /&gt;
       $ find . \( -iname '*.c'  -o -iname '*.h' \) -print&lt;br /&gt;
&lt;br /&gt;
     Find all, but skip what's in &amp;quot;/CVS&amp;quot; and &amp;quot;/junk&amp;quot;. Start from &amp;quot;/work&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ find /work \( -iregex '.*/CVS'  -o -iregex '.*/junk' \)  -prune -o -print&lt;br /&gt;
&lt;br /&gt;
     Note -regex and -iregex work on the directory as well, which means&lt;br /&gt;
     you must consider the &amp;quot;./&amp;quot; that comes before all listings.&lt;br /&gt;
&lt;br /&gt;
     Here is another example. Find all files except what is under the CVS, including&lt;br /&gt;
     CVS listings. Also exclude &amp;quot;#&amp;quot; and &amp;quot;~&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       $ find . -regex '.*' ! \( -regex '.*CVS.*'  -o -regex '.*[#|~].*' \)&lt;br /&gt;
&lt;br /&gt;
     Find a *.c file, then run grep on it looking for &amp;quot;stdio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       $ find . -iname '*.c' -exec grep -H 'stdio.h' {} \;&lt;br /&gt;
         sample output --&amp;gt;  ./prog1.c:#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
                            ./test.c:#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Looking for the disk-hog on the whole system?&lt;br /&gt;
&lt;br /&gt;
       $ find /  -size +10000k 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
     Looking for files changed in the last 24 hours? Make sure you add the&lt;br /&gt;
     minus sign &amp;quot;-1&amp;quot;, otherwise, you will only find files changed exactly&lt;br /&gt;
     24 hours from now. With the &amp;quot;-1&amp;quot; you get files changed from now to 24&lt;br /&gt;
     hours.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ find  . -ctime -1  -printf &amp;quot;%a %f\n&amp;quot;&lt;br /&gt;
       Wed Oct  6 12:51:56 2004 .&lt;br /&gt;
       Wed Oct  6 12:35:16 2004 How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
     Or if you just want files.&lt;br /&gt;
&lt;br /&gt;
       $ find . -type f -ctime -1  -printf &amp;quot;%a %f\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Details on file status change in the last 48 hours, current directory. Also note &amp;quot;-atime -2&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
       $ find . -ctime -2 -type f -exec ls -l {} \;&lt;br /&gt;
&lt;br /&gt;
             NOTE: if you don't use -type f, you make get &amp;quot;.&amp;quot; returned, which&lt;br /&gt;
             when run through ls &amp;quot;ls .&amp;quot; may list more than what you want.&lt;br /&gt;
&lt;br /&gt;
             Also you may only want the current directory&lt;br /&gt;
&lt;br /&gt;
       $ find . -ctime -2 -type f -maxdepth 1 -exec ls -l {} \;&lt;br /&gt;
&lt;br /&gt;
     To find files modified within the last 5 to 10 minutes&lt;br /&gt;
&lt;br /&gt;
       $ find . -mmin +5 -mmin -10 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     For more example &amp;quot;find&amp;quot; commands, reference the following looking&lt;br /&gt;
     for the latest version of &amp;quot;bashscripts.x.x.x.tar.gz&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79320&amp;amp;package_id=80711&lt;br /&gt;
&lt;br /&gt;
     See &amp;quot;TIP 71&amp;quot; for examples of find using the inode feature. &amp;quot; $ find . -inum &amp;lt;inode&amp;gt; -exec rm -- '{}' \; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     If you don't want error messages, or need to redirect error messages &amp;quot;&amp;gt; /dev/null 2&amp;gt;&amp;amp;1&amp;quot;, or see&lt;br /&gt;
     &amp;quot;TIP 81&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 58:&lt;br /&gt;
&lt;br /&gt;
     Using the &amp;quot;rm&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
     How do you remove a file that has the name &amp;quot;-&amp;quot;.  For instance, if you run the command&lt;br /&gt;
     &amp;quot;$ cat &amp;gt; - &amp;quot; and type some text followed by ^d, how does the &amp;quot;-&amp;quot; file get deleted?&lt;br /&gt;
&lt;br /&gt;
        $ rm -- -&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;--&amp;quot; nullifies any rm options.&lt;br /&gt;
&lt;br /&gt;
     How do you delete the directory &amp;quot;one&amp;quot;, all it's sub-directories, and any data?&lt;br /&gt;
&lt;br /&gt;
        $ rm -rf ./one&lt;br /&gt;
&lt;br /&gt;
     Note, to selectively delete stuff on a directory, use the find command &amp;quot;TIP 57&amp;quot;.&lt;br /&gt;
     To delete by inode, see &amp;quot;TIP 71&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 59:&lt;br /&gt;
&lt;br /&gt;
     Giving ownership.&lt;br /&gt;
&lt;br /&gt;
     How do you give the user &amp;quot;donkey&amp;quot; ownership to all directories and files under&lt;br /&gt;
     &amp;quot;./fordonkey&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          $ chown -R donkey ./fordonkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 60:&lt;br /&gt;
&lt;br /&gt;
     Only Permit root login -- give others a message when they try to login.&lt;br /&gt;
&lt;br /&gt;
     Create the file &amp;quot;/etc/nologin&amp;quot; with &amp;quot;nologin&amp;quot; containing the contents&lt;br /&gt;
     of the message.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 61:&lt;br /&gt;
&lt;br /&gt;
     Limits: file size, open files, pipe size, stack size, max memory size&lt;br /&gt;
             cpu time, plus others.&lt;br /&gt;
&lt;br /&gt;
     To get a listing of current limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -a&lt;br /&gt;
             core file size        (blocks, -c) 0&lt;br /&gt;
             data seg size         (kbytes, -d) unlimited&lt;br /&gt;
             file size             (blocks, -f) unlimited&lt;br /&gt;
             max locked memory     (kbytes, -l) unlimited&lt;br /&gt;
             max memory size       (kbytes, -m) unlimited&lt;br /&gt;
             open files                    (-n) 1024&lt;br /&gt;
             pipe size          (512 bytes, -p) 8&lt;br /&gt;
             stack size            (kbytes, -s) 8192&lt;br /&gt;
             cpu time             (seconds, -t) unlimited&lt;br /&gt;
             max user processes            (-u) 8179&lt;br /&gt;
             virtual memory        (kbytes, -v) unlimited&lt;br /&gt;
&lt;br /&gt;
     Note as a user you can decrease your limits in the current&lt;br /&gt;
     shell session; but, you cannot increase.  This can be ideal&lt;br /&gt;
     for testing programs.  But, first you may want to create&lt;br /&gt;
     another shell &amp;quot;sh&amp;quot; so that you can &amp;quot;go back to where started&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -f 10&lt;br /&gt;
&lt;br /&gt;
     Now try&lt;br /&gt;
&lt;br /&gt;
          $ yes &amp;gt;&amp;gt; out&lt;br /&gt;
             File size limit exceeded&lt;br /&gt;
&lt;br /&gt;
     To set limits on users, make changes to &amp;quot;/etc/security/limits.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           bozo   - maxlogins 1&lt;br /&gt;
&lt;br /&gt;
     Will keep bozo from loging in more than once.&lt;br /&gt;
&lt;br /&gt;
     To list hard limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -Ha&lt;br /&gt;
&lt;br /&gt;
     To list soft limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -Sa&lt;br /&gt;
&lt;br /&gt;
     To restrict user access by time, day make changes to&lt;br /&gt;
             &amp;quot;/etc/security/time.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Also take a look at &amp;quot;/etc/profile&amp;quot; to see what other changes&lt;br /&gt;
     can be made, plus take a look under &amp;quot;/etc/security/*.conf&amp;quot; for&lt;br /&gt;
     other configuration files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 62:&lt;br /&gt;
&lt;br /&gt;
     Stupid &amp;quot;cat&amp;quot; Tricks.&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 43).&lt;br /&gt;
&lt;br /&gt;
     If you have multiple blank lines, squeeze these lines down to one,&lt;br /&gt;
     then, try the following:&lt;br /&gt;
&lt;br /&gt;
          $ cat -s &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to number the lines?&lt;br /&gt;
&lt;br /&gt;
          $ cat -n &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to show tabs?&lt;br /&gt;
&lt;br /&gt;
          $ cat -t &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Need to mark end of lines by &amp;quot;$&amp;quot;? The following was suggested by  (Amos Shapira)&lt;br /&gt;
&lt;br /&gt;
          $ cat -e &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to see all the ctl characters?&lt;br /&gt;
&lt;br /&gt;
          /* ctlgen.c&lt;br /&gt;
            Program to generate ctl characters.&lt;br /&gt;
&lt;br /&gt;
            Compile:&lt;br /&gt;
&lt;br /&gt;
               gcc -o ctlgen ctlgen.c&lt;br /&gt;
&lt;br /&gt;
            Run:&lt;br /&gt;
&lt;br /&gt;
               ./ctlgen &amp;gt; mout&lt;br /&gt;
&lt;br /&gt;
            Now see the characters:&lt;br /&gt;
&lt;br /&gt;
               cat -v mout&lt;br /&gt;
&lt;br /&gt;
            Here's a sample output:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               $ cat -v mout|tail&lt;br /&gt;
                   test M-v&lt;br /&gt;
                   test M-w&lt;br /&gt;
                   test M-x&lt;br /&gt;
                   test M-y&lt;br /&gt;
                   test M-z&lt;br /&gt;
                   test M-{&lt;br /&gt;
                   test M-|&lt;br /&gt;
                   test M-}&lt;br /&gt;
                   test M-~&lt;br /&gt;
                   test M-^?&lt;br /&gt;
&lt;br /&gt;
          */&lt;br /&gt;
          #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
          #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
          int main()&lt;br /&gt;
          {&lt;br /&gt;
            int i;&lt;br /&gt;
&lt;br /&gt;
            for(i=0; i &amp;lt; 256; ++i)&lt;br /&gt;
              printf(&amp;quot;test %c \n&amp;quot;,i);&lt;br /&gt;
&lt;br /&gt;
            return 0;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 63:&lt;br /&gt;
&lt;br /&gt;
     Guard against SYN attacks and &amp;quot;ping&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     As root do the following:&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/tcp_syncookies&lt;br /&gt;
&lt;br /&gt;
     Want to disable &amp;quot;ping&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_all&lt;br /&gt;
&lt;br /&gt;
     Disable broadcast/multicast &amp;quot;ping&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts&lt;br /&gt;
&lt;br /&gt;
     And to enable again:&lt;br /&gt;
&lt;br /&gt;
          echo 0 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_all&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 64:&lt;br /&gt;
&lt;br /&gt;
     Make changes to .bash_profile and need to update the current session?&lt;br /&gt;
&lt;br /&gt;
       $ source .bash_profile&lt;br /&gt;
&lt;br /&gt;
     With the above command, the user does not have to logout.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 65:&lt;br /&gt;
&lt;br /&gt;
     What are the Special Shell Variables?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        $#   The number of arguments.&lt;br /&gt;
        $@   All arguments, as separate words.&lt;br /&gt;
        $*   All arguments, as one word.&lt;br /&gt;
        $$   ID of the current process.&lt;br /&gt;
        $?   Exit status of the last command.&lt;br /&gt;
        $0,$1,..$9,${10},${11}...${N}    Positional parameters. After &amp;quot;9&amp;quot; you must use the ${k} syntax.&lt;br /&gt;
&lt;br /&gt;
     Note that 0 is true. For example if you execute the following, which is true you get zero.&lt;br /&gt;
&lt;br /&gt;
         $  [[ -f /etc/passwd ]]&lt;br /&gt;
         $  echo $?&lt;br /&gt;
         0&lt;br /&gt;
     And the following is false, which returns a 1.&lt;br /&gt;
&lt;br /&gt;
         $  [[ -f /etc/passwdjabberwisnohere ]]&lt;br /&gt;
         $  echo $?&lt;br /&gt;
         1&lt;br /&gt;
&lt;br /&gt;
     So true=0 and false=1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Sample program &amp;quot;mdo&amp;quot;  to show the difference between &amp;quot;$@&amp;quot; and &amp;quot;$*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        function myarg&lt;br /&gt;
        {&lt;br /&gt;
            echo &amp;quot;$# in myarg function&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
        echo -e &amp;quot;$# parameters on the cmd line\n&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;calling: myarg \&amp;quot;\$@\&amp;quot; and myarg \&amp;quot;\$*\&amp;quot;\n&amp;quot;&lt;br /&gt;
        myarg &amp;quot;$@&amp;quot;&lt;br /&gt;
        myarg &amp;quot;$*&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;\ncalling: myarg \$@ and myarg \$* without quotes\n&amp;quot;&lt;br /&gt;
        myarg $@&lt;br /&gt;
        myarg $*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The result of running &amp;quot;./mdo one two&amp;quot;. Note that when quoted, myarg &amp;quot;$*&amp;quot;,&lt;br /&gt;
      returns 1 ... all parameters are smushed together as one word.&lt;br /&gt;
&lt;br /&gt;
            [chirico@third-fl-71 theBook]$ ./mdo one two&lt;br /&gt;
            2 parameters on the cmd line&lt;br /&gt;
&lt;br /&gt;
            calling: myarg &amp;quot;$@&amp;quot; and myarg &amp;quot;$*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
            1 in myarg function&lt;br /&gt;
&lt;br /&gt;
            calling: myarg $@ and myarg $* without quotes&lt;br /&gt;
&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
&lt;br /&gt;
      Example program &amp;quot;mdo2&amp;quot; shows how the input separator can be changed.&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        IFS=|&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=,&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=\;&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=$1&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            [chirico@third-fl-71 theBook]$ ./mdo2 one two three four five&lt;br /&gt;
            one two three four five&lt;br /&gt;
&lt;br /&gt;
            one,two,three,four,five&lt;br /&gt;
&lt;br /&gt;
            one;two;three;four;five&lt;br /&gt;
&lt;br /&gt;
            oneotwoothreeofourofive&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 66:&lt;br /&gt;
&lt;br /&gt;
     Replace all &amp;quot;x&amp;quot; with &amp;quot;y&amp;quot; and all &amp;quot;y&amp;quot; with &amp;quot;x&amp;quot; in file data.&lt;br /&gt;
&lt;br /&gt;
        $ cata data&lt;br /&gt;
          x y&lt;br /&gt;
          y x&lt;br /&gt;
&lt;br /&gt;
        $ tr &amp;quot;xy&amp;quot;  &amp;quot;yx&amp;quot; &amp;lt; data&lt;br /&gt;
          y x&lt;br /&gt;
          x y&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 67:&lt;br /&gt;
&lt;br /&gt;
     On a Linux 2.6.x Kernel, how do you directly measure disk activity,&lt;br /&gt;
     and where is this information documented?&lt;br /&gt;
&lt;br /&gt;
          o The information is documented in the kernel source&lt;br /&gt;
               ./Documentation/iostats.txt&lt;br /&gt;
&lt;br /&gt;
          o The new way of getting this info in 2.6.x is&lt;br /&gt;
              $ cat /sys/block/hda/stat&lt;br /&gt;
            151121 5694 1932358 796675 37867 76770 916994 8353762 0 800672 9150437&lt;br /&gt;
&lt;br /&gt;
             Field  1 -- # of reads issued&lt;br /&gt;
                 This is the total number of reads completed successfully.&lt;br /&gt;
             Field  2 -- # of reads merged, field 6 -- # of writes merged&lt;br /&gt;
                 Reads and writes which are adjacent to each other may be merged for&lt;br /&gt;
                 efficiency.  Thus two 4K reads may become one 8K read before it is&lt;br /&gt;
                 ultimately handed to the disk, and so it will be counted (and queued)&lt;br /&gt;
                 as only one I/O.  This field lets you know how often this was done.&lt;br /&gt;
             Field  3 -- # of sectors read&lt;br /&gt;
                 This is the total number of sectors read successfully.&lt;br /&gt;
             Field  4 -- # of milliseconds spent reading&lt;br /&gt;
                 This is the total number of milliseconds spent by all reads (as&lt;br /&gt;
                 measured from __make_request() to end_that_request_last()).&lt;br /&gt;
             Field  5 -- # of writes completed&lt;br /&gt;
                 This is the total number of writes completed successfully.&lt;br /&gt;
             Field  7 -- # of sectors written&lt;br /&gt;
                 This is the total number of sectors written successfully.&lt;br /&gt;
             Field  8 -- # of milliseconds spent writing&lt;br /&gt;
                 This is the total number of milliseconds spent by all writes (as&lt;br /&gt;
                 measured from __make_request() to end_that_request_last()).&lt;br /&gt;
             Field  9 -- # of I/Os currently in progress&lt;br /&gt;
                 The only field that should go to zero. Incremented as requests are&lt;br /&gt;
                 given to appropriate request_queue_t and decremented as they finish.&lt;br /&gt;
             Field 10 -- # of milliseconds spent doing I/Os&lt;br /&gt;
                 This field is increases so long as field 9 is nonzero.&lt;br /&gt;
             Field 11 -- weighted # of milliseconds spent doing I/Os&lt;br /&gt;
                 This field is incremented at each I/O start, I/O completion, I/O&lt;br /&gt;
                 merge, or read of these stats by the number of I/Os in progress&lt;br /&gt;
                 (field 9) times the number of milliseconds spent doing I/O since the&lt;br /&gt;
                 last update of this field.  This can provide an easy measure of both&lt;br /&gt;
                 I/O completion time and the backlog that may be accumulating.&lt;br /&gt;
&lt;br /&gt;
       Note, this is device specific.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 68:&lt;br /&gt;
&lt;br /&gt;
     Passing Outbound Mail, plus Masquerading User and Hostname.&lt;br /&gt;
&lt;br /&gt;
     Here's a specific example:&lt;br /&gt;
&lt;br /&gt;
         How does one send and receive Comcast email from a home Linux box,&lt;br /&gt;
         which uses Comcast as the ISP, if the local account on the Linux&lt;br /&gt;
         box is different from the Comcast email.  For instance, the&lt;br /&gt;
         account on the Linux box is &amp;quot;chirico@third-fl-71&amp;quot; and the Comcast&lt;br /&gt;
         email account is &amp;quot;mchirico@comcast.net&amp;quot;.  Note both the hostname and&lt;br /&gt;
         username are different.&lt;br /&gt;
&lt;br /&gt;
         So, the user &amp;quot;chirico&amp;quot; using &amp;quot;mutt&amp;quot;, &amp;quot;elm&amp;quot; or any email program would&lt;br /&gt;
         like to send out email to say &amp;quot;donkey@comcast.net&amp;quot;; yet, donkey would&lt;br /&gt;
         see the email from &amp;quot;mchirico@comcast.net&amp;quot; and not &amp;quot;chirico@third-fl-71&amp;quot;&lt;br /&gt;
         but chirico@third-fl-71 would get the replies.&lt;br /&gt;
&lt;br /&gt;
         For a full description of how to solve this problem, including related&lt;br /&gt;
         &amp;quot;sendmail.mc&amp;quot;, &amp;quot;site.config.m4&amp;quot;, &amp;quot;genericstable&amp;quot;, &amp;quot;genericsdomain&amp;quot;,&lt;br /&gt;
         &amp;quot;.procmailrc&amp;quot;, and &amp;quot;.forward&amp;quot; files,  reference the following:&lt;br /&gt;
&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/README_COMCAST_EMAIL.txt?download&lt;br /&gt;
&lt;br /&gt;
         Included in the above link are instructions for building sendmail with&lt;br /&gt;
         &amp;quot;SASL&amp;quot; and &amp;quot;STARTTLS&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 69:&lt;br /&gt;
&lt;br /&gt;
     How do you remove just the last 2 lines from a file and save the result?&lt;br /&gt;
&lt;br /&gt;
         $ sed  '$d' file | sed '$d' &amp;gt; savefile&lt;br /&gt;
&lt;br /&gt;
     Or, as Amos Shapira pointed out, it's much easier with the head command.&lt;br /&gt;
&lt;br /&gt;
         $ head -2 file&lt;br /&gt;
&lt;br /&gt;
      And, of course, removing just the last line&lt;br /&gt;
&lt;br /&gt;
         $ sed '$d' file &amp;gt; savefile&lt;br /&gt;
&lt;br /&gt;
         (See REFERENCES (13))&lt;br /&gt;
&lt;br /&gt;
     How do you remove extra spaces at the end of a line?&lt;br /&gt;
&lt;br /&gt;
         $ sed 's/[ ]*$//g'&lt;br /&gt;
&lt;br /&gt;
     How do you remove blank lines, or lines with just spaces and tabs,&lt;br /&gt;
     saving the origional file as file.backup?&lt;br /&gt;
&lt;br /&gt;
         $ perl -pi.backup -e &amp;quot;s/^(\s)*\n//&amp;quot;  file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 70:&lt;br /&gt;
&lt;br /&gt;
     Generating Random Numbers.&lt;br /&gt;
&lt;br /&gt;
         $ od -vAn -N4 -tu4 &amp;lt; /dev/urandom&lt;br /&gt;
             3905158199&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 71:&lt;br /&gt;
&lt;br /&gt;
     Deleting a File by it's Inode Value.&lt;br /&gt;
&lt;br /&gt;
       See (PROGRAMMING TIP 5) for creating the file, or&lt;br /&gt;
&lt;br /&gt;
       $ cat &amp;gt; '\n\n\n\n\n\n\n'&lt;br /&gt;
         type some text&lt;br /&gt;
         ^D&lt;br /&gt;
&lt;br /&gt;
     To list the inode and display the characters.&lt;br /&gt;
&lt;br /&gt;
       $ ls -libt *&lt;br /&gt;
&lt;br /&gt;
     To remove by inode. Note the &amp;quot;--&amp;quot; option.  This&lt;br /&gt;
     will keep any special characters in the file from being&lt;br /&gt;
     interpreted at &amp;quot;rm&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
       $ find . -inum &amp;lt;inode&amp;gt; -exec rm -- '{}' \;&lt;br /&gt;
&lt;br /&gt;
     Or to check contents&lt;br /&gt;
&lt;br /&gt;
       $ find . -inum &amp;lt;inode&amp;gt; -exec cat '{}' \;&lt;br /&gt;
&lt;br /&gt;
     Reference:&lt;br /&gt;
         http://www.faqs.org/ftp/usenet/news.answers/unix-faq/faq/part2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 72:&lt;br /&gt;
&lt;br /&gt;
     Sending Attachments Using Mutt -- On the Command Line.&lt;br /&gt;
&lt;br /&gt;
        $ mutt -s &amp;quot;See Attachment&amp;quot; -a file.doc user@domain.net &amp;lt; message.txt&lt;br /&gt;
&lt;br /&gt;
          or just the message:&lt;br /&gt;
&lt;br /&gt;
        $ echo | mutt -a sample.tar.gz user@domain.net&lt;br /&gt;
&lt;br /&gt;
      Reference:&lt;br /&gt;
          http://www.shelldorado.com/articles/mailattachments.html&lt;br /&gt;
&lt;br /&gt;
        Also see (TIP 51).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 73:&lt;br /&gt;
&lt;br /&gt;
     Want to find out what functions a program calls?&lt;br /&gt;
&lt;br /&gt;
         $ strace &amp;lt;program&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Try this with &amp;quot;topen.c&amp;quot; (see PROGRAMMING TIP 5)&lt;br /&gt;
&lt;br /&gt;
         $ strace  ./topen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 74:&lt;br /&gt;
&lt;br /&gt;
     RPM Usage Summary.&lt;br /&gt;
&lt;br /&gt;
     Install. Full filename is needed.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -ivh Fedora/RPMS/postgresql-libs-7.4.2-1.i386.rpm&lt;br /&gt;
&lt;br /&gt;
     To view list of files installed with a particular package.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -ql postgresql-libs&lt;br /&gt;
                /usr/lib/libecpg.so.4&lt;br /&gt;
                /usr/lib/libecpg.so.4.1&lt;br /&gt;
                /usr/lib/libecpg_compat.so.1&lt;br /&gt;
                /usr/lib/libecpg_compat.so.1.1&lt;br /&gt;
                /usr/lib/libpgtypes.so.1&lt;br /&gt;
                ...&lt;br /&gt;
&lt;br /&gt;
     Or, to get the file listing from a package that is not installed use the&lt;br /&gt;
     &amp;quot;-p&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -pql /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/CHANGES&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/LICENSE&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/README&lt;br /&gt;
               /usr/share/man/man3/pcap.3.gz&lt;br /&gt;
&lt;br /&gt;
     For dependencies listing, use the &amp;quot;R&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qpR /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /sbin/ldconfig&lt;br /&gt;
               /sbin/ldconfig&lt;br /&gt;
               kernel &amp;gt;= 2.2.0&lt;br /&gt;
               libc.so.6&lt;br /&gt;
               libc.so.6(GLIBC_2.0)&lt;br /&gt;
               libc.so.6(GLIBC_2.1)&lt;br /&gt;
               libc.so.6(GLIBC_2.1.3)&lt;br /&gt;
               libc.so.6(GLIBC_2.3)&lt;br /&gt;
               openssl&lt;br /&gt;
               rpmlib(CompressedFileNames) &amp;lt;= 3.0.4-1&lt;br /&gt;
               rpmlib(PayloadFilesHavePrefix) &amp;lt;= 4.0-1&lt;br /&gt;
&lt;br /&gt;
     To check the integrity, use the &amp;quot;-K&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -K /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm: (sha1) dsa sha1 md5 gpg OK&lt;br /&gt;
&lt;br /&gt;
     To list all packages installed.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qa&lt;br /&gt;
&lt;br /&gt;
     To find out which file a package belongs to.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qf /usr/lib/libecpg.so.4.1&lt;br /&gt;
&lt;br /&gt;
     To uninstall a package&lt;br /&gt;
&lt;br /&gt;
         $ rpm -e&lt;br /&gt;
&lt;br /&gt;
     For building rpm packages reference the following:&lt;br /&gt;
       http://www-106.ibm.com/developerworks/library/l-rpm1/&lt;br /&gt;
&lt;br /&gt;
     To verify md5 sum so that you know it downloaded ok&lt;br /&gt;
&lt;br /&gt;
         $ rpm -K  *.rpm&lt;br /&gt;
&lt;br /&gt;
     The following is a good reference:&lt;br /&gt;
        http://www.rpm.org/max-rpm/s1-rpm-install-additional-options.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 75:&lt;br /&gt;
&lt;br /&gt;
     Listing Output from a Bash Script.&lt;br /&gt;
&lt;br /&gt;
     Add &amp;quot;set -x&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          #!/bin/bash&lt;br /&gt;
          set -x&lt;br /&gt;
          ls&lt;br /&gt;
          date&lt;br /&gt;
&lt;br /&gt;
     Will list the files and output as follows:&lt;br /&gt;
&lt;br /&gt;
           + ls&lt;br /&gt;
           ChangeLog  CVS  data  test&lt;br /&gt;
           + date&lt;br /&gt;
           Thu Jul  1 20:41:04 EDT 2004&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 76:&lt;br /&gt;
&lt;br /&gt;
     Using wget.&lt;br /&gt;
&lt;br /&gt;
     Grap a webpage and pipe it to less. For example suppose you wanted to pipe the&lt;br /&gt;
     contents of all these tips, directly from the web.&lt;br /&gt;
&lt;br /&gt;
      $ wget -O - http://sourceforge.net/direct-dl/mchirico/souptonuts/How_to_Linux_and_Open_Source.txt|less&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 77:&lt;br /&gt;
&lt;br /&gt;
     Finding IP address and MAC address.&lt;br /&gt;
&lt;br /&gt;
       $ /sbin/ifconfig&lt;br /&gt;
&lt;br /&gt;
     Note the following output &amp;quot;eth0&amp;quot; and &amp;quot;eth0:1&amp;quot; which means&lt;br /&gt;
     two IP addresses are tied to 1 NIC (Network Interface Card).&lt;br /&gt;
&lt;br /&gt;
             eth0      Link encap:Ethernet  HWaddr 00:50:DA:60:5B:AD&lt;br /&gt;
                       inet addr:192.168.1.155  Bcast:192.168.99.255  Mask:255.255.252.0&lt;br /&gt;
                       UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
                       RX packets:982757 errors:116 dropped:0 overruns:0 frame:116&lt;br /&gt;
                       TX packets:439297 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:1000&lt;br /&gt;
                       RX bytes:693529078 (661.4 Mb)  TX bytes:78400296 (74.7 Mb)&lt;br /&gt;
                       Interrupt:10 Base address:0xa800&lt;br /&gt;
&lt;br /&gt;
             eth0:1    Link encap:Ethernet  HWaddr 00:50:DA:60:5B:AD&lt;br /&gt;
                       inet addr:192.168.1.182  Bcast:192.168.3.255  Mask:255.255.252.0&lt;br /&gt;
                       UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
                       RX packets:982757 errors:116 dropped:0 overruns:0 frame:116&lt;br /&gt;
                       TX packets:439299 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:1000&lt;br /&gt;
                       RX bytes:693529078 (661.4 Mb)  TX bytes:78400636 (74.7 Mb)&lt;br /&gt;
                       Interrupt:10 Base address:0xa800&lt;br /&gt;
&lt;br /&gt;
             lo        Link encap:Local Loopback&lt;br /&gt;
                       inet addr:127.0.0.1  Mask:255.0.0.0&lt;br /&gt;
                       UP LOOPBACK RUNNING  MTU:16436  Metric:1&lt;br /&gt;
                       RX packets:785 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
                       TX packets:785 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:0&lt;br /&gt;
                       RX bytes:2372833 (2.2 Mb)  TX bytes:2372833 (2.2 Mb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 78:&lt;br /&gt;
&lt;br /&gt;
     DOS to UNIX and UNIX to DOS.&lt;br /&gt;
&lt;br /&gt;
        $ dos2unix file.txt&lt;br /&gt;
&lt;br /&gt;
     And to go the other way from UNIX to DOS&lt;br /&gt;
&lt;br /&gt;
        $ unix2dos unixfile&lt;br /&gt;
&lt;br /&gt;
     See the man page, since there are MAC options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     NOTE: If you're working file DOS files, you'll probably want to use&lt;br /&gt;
           &amp;quot;zip&amp;quot; instead of &amp;quot;gzip&amp;quot; so users on Windows can unzip them.&lt;br /&gt;
&lt;br /&gt;
              $ zip test.zip test.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 79:&lt;br /&gt;
&lt;br /&gt;
     Need to Run Interactive Commands? Try &amp;quot;expect&amp;quot;.&lt;br /&gt;
       http://expect.nist.gov/expect.tar.gz&lt;br /&gt;
&lt;br /&gt;
     This simple example waits for the input &amp;quot;hi&amp;quot;, in some form before&lt;br /&gt;
     returning, immediately, &amp;quot;hello there!&amp;quot;. Otherwise, it will wait for&lt;br /&gt;
     60 seconds, then, return &amp;quot;hello there!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/expect&lt;br /&gt;
          set timeout 60&lt;br /&gt;
          expect &amp;quot;hi\n&amp;quot;&lt;br /&gt;
          send &amp;quot;hello there!\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference:&lt;br /&gt;
        http://www.oreilly.com/catalog/expect/chapter/ch03.html&lt;br /&gt;
&lt;br /&gt;
        http://www.cotse.com/dlf/man/expect/bulletproof1.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 80:&lt;br /&gt;
&lt;br /&gt;
     Using PHP as a Command Line Scripting Language.&lt;br /&gt;
&lt;br /&gt;
     The following will grab the complete file from slashdot.&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/php -q&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;?php&lt;br /&gt;
         $fileName = &amp;quot;http://slashdot.org/slashdot.xml&amp;quot;;&lt;br /&gt;
         $rss = file($fileName) or die (&amp;quot;Cannot open file $fileName\n&amp;quot;);&lt;br /&gt;
         for ($index=0; $index &amp;lt; count($rss); $index++)&lt;br /&gt;
              {&lt;br /&gt;
              echo $rss[$index];&lt;br /&gt;
              }&lt;br /&gt;
         ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       Note, if you want an example that parses the XML of&lt;br /&gt;
       slashdot, then, download the following:&lt;br /&gt;
&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/php_scripts.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 81:&lt;br /&gt;
&lt;br /&gt;
     Discarding all output -- including stderr messages.&lt;br /&gt;
&lt;br /&gt;
         $ ls  &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     Or sending all output to a file&lt;br /&gt;
&lt;br /&gt;
         $ someprog &amp;gt; /tmp/file 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     Sometimes, find displays a lot of errors when searching through&lt;br /&gt;
     directories that the user doesn't have access to. To discard&lt;br /&gt;
     error messages &amp;quot;stderr&amp;quot;, which is normally file descripter &amp;quot;2&amp;quot;&lt;br /&gt;
     work the following:&lt;br /&gt;
&lt;br /&gt;
         $ find / -iname 'stuff' 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
          or to pipe results elsewhere&lt;br /&gt;
&lt;br /&gt;
         $ find / -iname 'stuff' &amp;gt; /tmp/results_of_find  2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 118).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 82:&lt;br /&gt;
&lt;br /&gt;
     Using MIX.  D. Knuth's  assembly language/machine-code instruction set used in&lt;br /&gt;
     his books to illustrate his algorithms.&lt;br /&gt;
&lt;br /&gt;
     Download the source:&lt;br /&gt;
&lt;br /&gt;
       http://sourceforge.net/project/showfiles.php?group_id=13897&lt;br /&gt;
&lt;br /&gt;
       $ ./configure&lt;br /&gt;
       $ make&lt;br /&gt;
       $ make install&lt;br /&gt;
&lt;br /&gt;
     Documentation can be found at the following link. The link on&lt;br /&gt;
     sourceforge is not correct, but, the one below works.&lt;br /&gt;
&lt;br /&gt;
       http://www.gnu.org/software/mdk/manual/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 83:&lt;br /&gt;
&lt;br /&gt;
     Gnuplot [ http://sourceforge.net/projects/gnuplot/ ].&lt;br /&gt;
&lt;br /&gt;
     This software is ideal for printing graphs.&lt;br /&gt;
&lt;br /&gt;
         gnuplot&amp;gt; set term png&lt;br /&gt;
         gnuplot&amp;gt; set output 'testcos.png'&lt;br /&gt;
         gnuplot&amp;gt; plot cos(x)*sin(x)&lt;br /&gt;
         gnuplot&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
     Or the following command can be put into &amp;quot;file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            $ cat &amp;gt; file&lt;br /&gt;
            set term png&lt;br /&gt;
            set output 'testcos.png'&lt;br /&gt;
            plot cos(x)*sin(x)&lt;br /&gt;
            exit&lt;br /&gt;
            ^D&lt;br /&gt;
&lt;br /&gt;
     Then, run as follows:&lt;br /&gt;
&lt;br /&gt;
            $ gnuplot file&lt;br /&gt;
&lt;br /&gt;
     Or, suppose you have the following file &amp;quot;/home/chirico/data&amp;quot;. Comments&lt;br /&gt;
     with &amp;quot;#&amp;quot; are not read by gnuplot.&lt;br /&gt;
&lt;br /&gt;
            # File /home/chirico/data&lt;br /&gt;
            #&lt;br /&gt;
            2005-07-26  1    2.3    3&lt;br /&gt;
            2005-07-27  2    3.4    5&lt;br /&gt;
            2005-07-28  3    4    6.6&lt;br /&gt;
            2005-07-29  4    6    2.5&lt;br /&gt;
&lt;br /&gt;
     And you have the following new &amp;quot;file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            set term png&lt;br /&gt;
            set xdata time&lt;br /&gt;
            set timefmt &amp;quot;%Y-%m-%d &amp;quot;&lt;br /&gt;
            set format x &amp;quot;%Y/%m/%d&amp;quot;&lt;br /&gt;
            set output '/var/www/html/chirico/gnuplot/data.png'&lt;br /&gt;
            plot '/home/chirico/data' using 1:2 w linespoints  title '1st col', \&lt;br /&gt;
             '/home/chirico/data' using 1:3 w linespoints  title '2nd col', \&lt;br /&gt;
             '/home/chirico/data' using 1:4 w linespoints  title '3rd col'&lt;br /&gt;
            exit&lt;br /&gt;
&lt;br /&gt;
     You can now get a graph of this data running the following:&lt;br /&gt;
&lt;br /&gt;
            $ gnuplot file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 84:&lt;br /&gt;
&lt;br /&gt;
     CPU Information - speed, processor, cache.&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/cpuinfo&lt;br /&gt;
&lt;br /&gt;
               processor       : 0&lt;br /&gt;
               vendor_id       : GenuineIntel&lt;br /&gt;
               cpu family      : 15&lt;br /&gt;
               model           : 2&lt;br /&gt;
               model name      : Intel(R) Pentium(R) 4 CPU 2.20GHz&lt;br /&gt;
               stepping        : 9&lt;br /&gt;
               cpu MHz         : 2193.221&lt;br /&gt;
               cache size      : 512 KB&lt;br /&gt;
               fdiv_bug        : no&lt;br /&gt;
               hlt_bug         : no&lt;br /&gt;
               f00f_bug        : no&lt;br /&gt;
               coma_bug        : no&lt;br /&gt;
               fpu             : yes&lt;br /&gt;
               fpu_exception   : yes&lt;br /&gt;
               cpuid level     : 2&lt;br /&gt;
               wp              : yes&lt;br /&gt;
               flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr&lt;br /&gt;
               bogomips        : 4325.37&lt;br /&gt;
&lt;br /&gt;
      &amp;quot;bogomips&amp;quot; is a rough but good way to quickly compare two computer speeds. True it's a&lt;br /&gt;
      bogus reading; but, a &amp;quot;good enough&amp;quot; for government work calculation.  See (TIP 10) for&lt;br /&gt;
      &amp;quot;vmstat&amp;quot; and &amp;quot;iostat&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 85:&lt;br /&gt;
&lt;br /&gt;
     POVRAY - Making Animated GIFs&lt;br /&gt;
&lt;br /&gt;
     To see this in action, reference:&lt;br /&gt;
      http://souptonuts.sourceforge.net/povray/orbit.pov.html&lt;br /&gt;
&lt;br /&gt;
     These are the basic command to create:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        $ povray orbit.ini -Iorbit.pov&lt;br /&gt;
        $ convert -delay 20 *.ppm orbit.gif&lt;br /&gt;
&lt;br /&gt;
     By the way, convert is a program from imagemagick, and it can&lt;br /&gt;
     be downloaded from ( http://www.imagemagick.org ).&lt;br /&gt;
&lt;br /&gt;
    The following is &amp;quot;orbit.pov&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          #include &amp;quot;colors.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;finish.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;metals.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;textures.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;stones.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;skies.inc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          camera {&lt;br /&gt;
            location &amp;lt; 2, 3, -8 &amp;gt;&lt;br /&gt;
            look_at  &amp;lt; 0, 0, 0 &amp;gt;&lt;br /&gt;
            focal_point &amp;lt;0, 0, 0&amp;gt;&lt;br /&gt;
            blur_samples 20&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          light_source {&lt;br /&gt;
                  &amp;lt; 0, 10, 0&amp;gt;&lt;br /&gt;
                  color White&lt;br /&gt;
                  area_light &amp;lt;2,0,0&amp;gt;,&amp;lt;0,0,2&amp;gt;, 2, 2&lt;br /&gt;
                  adaptive 1&lt;br /&gt;
                  fade_distance 8&lt;br /&gt;
                  fade_power 1&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          sky_sphere {&lt;br /&gt;
            S_Cloud3&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          plane { &amp;lt;0, 1, 0&amp;gt;, -1&lt;br /&gt;
                  texture {&lt;br /&gt;
                          pigment {&lt;br /&gt;
                                  checker color Blue, color White&lt;br /&gt;
                          }&lt;br /&gt;
                          finish {Phong_Glossy}&lt;br /&gt;
                  }&lt;br /&gt;
          }&lt;br /&gt;
          #declare ball0=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;0.5, 0.5, 0&amp;gt;, 1&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Yellow}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          #declare ball1=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;3, 2, 0&amp;gt;, 0.5&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Blue}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          #declare ball2=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;3, 1, 0&amp;gt;, 1&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Green}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          object {ball0 rotate 360*clock*y}&lt;br /&gt;
          object {ball1 rotate 720*clock*y}&lt;br /&gt;
          object {ball2 rotate 360*(1 - clock)*y}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    And, &amp;quot;orbit.ini&amp;quot; follows:&lt;br /&gt;
&lt;br /&gt;
          Output_File_Type=P&lt;br /&gt;
&lt;br /&gt;
          Width=320&lt;br /&gt;
          Height=240&lt;br /&gt;
&lt;br /&gt;
          Initial_Frame=1&lt;br /&gt;
          Final_Frame=10&lt;br /&gt;
          Antialias=true&lt;br /&gt;
&lt;br /&gt;
          Subset_Start_Frame=1&lt;br /&gt;
          Subset_End_Frame=10&lt;br /&gt;
&lt;br /&gt;
          Cyclic_Animation=on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 86:&lt;br /&gt;
&lt;br /&gt;
     GPG --  GnuPG&lt;br /&gt;
&lt;br /&gt;
        Reference: http://www.gnupg.org/documentation/faqs.html&lt;br /&gt;
                   http://codesorcery.net/mutt/mutt-gnupg-howto&lt;br /&gt;
                   http://www.gnupg.org/(en)/download/index.html&lt;br /&gt;
                   (SCRIPT 4) on following link:&lt;br /&gt;
                   http://prdownloads.sourceforge.net/souptonuts/README_common_script_commands.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Generage key:&lt;br /&gt;
&lt;br /&gt;
        $ gpg --gen-key&lt;br /&gt;
&lt;br /&gt;
     Generate public key ID and fingerprint&lt;br /&gt;
&lt;br /&gt;
        $ gpg --fingerprint&lt;br /&gt;
&lt;br /&gt;
     Get a list of keys:&lt;br /&gt;
&lt;br /&gt;
        $ gpg --list-keys&lt;br /&gt;
&lt;br /&gt;
          pub  1024D/A11C1499 2004-07-15 Mike Chirico &amp;lt;mchirico@comcast.net&amp;gt;&lt;br /&gt;
          sub  1024g/E1A3C2B3 2004-07-15&lt;br /&gt;
&lt;br /&gt;
     Encrypt&lt;br /&gt;
&lt;br /&gt;
        $ gpg -r Mike  --encrypt sample.txt&lt;br /&gt;
&lt;br /&gt;
       This will produce &amp;quot;sample.txt.asc&amp;quot;, which is a binary file.  Note, I can use &amp;quot;Mike&amp;quot; because that's the&lt;br /&gt;
       name on the list of keys. Again, it will be a binary file.&lt;br /&gt;
&lt;br /&gt;
     Encrypt using &amp;quot;ASCII-armored text&amp;quot;  (--armor), which is probably what you want when sending &amp;quot;in&amp;quot; the body of an&lt;br /&gt;
     email, or some document.&lt;br /&gt;
&lt;br /&gt;
        $ gpg  -r Mike  --encrypt --armor sample.txt&lt;br /&gt;
            or&lt;br /&gt;
        $ gpg -r Mike -e -a sample.txt&lt;br /&gt;
            or&lt;br /&gt;
        $ gpg --output somefile.asc --armor -r Mike  --encrypt --armor sample.txt&lt;br /&gt;
&lt;br /&gt;
     The above 3 statements will still produce &amp;quot;sample.txt.asc&amp;quot;, but look at it, or &amp;quot;$ cat sample.txt.asc&amp;quot; without &lt;br /&gt;
     fear, since there are no binary characters. Yes, you could even compile a program &amp;quot;$ g++ -o test test.c&amp;quot; , then,&lt;br /&gt;
     &amp;quot;$ gpg --output test.asc  -r Mike --encrypt --armor test&amp;quot;. However, when decrypting make sure to pipe&lt;br /&gt;
     the results.&lt;br /&gt;
&lt;br /&gt;
            $ gpg --decrypt test.asc &amp;gt; test&lt;br /&gt;
&lt;br /&gt;
     Export &amp;quot;public&amp;quot; key:&lt;br /&gt;
&lt;br /&gt;
           $ gpg --armor --export Mike &amp;gt; m1.asc&lt;br /&gt;
&lt;br /&gt;
     Signing the file &amp;quot;message.txt&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
           $ gpg --clearsign message.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Sending the key to the &amp;quot;key-server&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        First, list the keys.&lt;br /&gt;
&lt;br /&gt;
                $ gpg --list-keys&lt;br /&gt;
                    /home/chirico/.gnupg/pubring.gpg&lt;br /&gt;
                                 v------------------ Use this with &amp;quot;0x&amp;quot; in front -------&lt;br /&gt;
                  pub  1024D/A11C1499 2004-07-15 Mike Chirico  &amp;lt;mchirico@comcast.net&amp;gt;   |&lt;br /&gt;
                  sub  1024g/E1A3C2B3 2004-07-15                                        |&lt;br /&gt;
                                                                                        |&lt;br /&gt;
                                   v----------------------------------------------------&lt;br /&gt;
                $ gpg --send-keys 0xA11C1499&lt;br /&gt;
&lt;br /&gt;
             The above sends it to the keyserver defined in &amp;quot;/home/chirico/.gnupg/gpg.conf&amp;quot;.  Other key servers:&lt;br /&gt;
&lt;br /&gt;
                            wwwkeys.pgp.net&lt;br /&gt;
                            search.keyserver.net&lt;br /&gt;
                            pgp.ai.mit.edu&lt;br /&gt;
&lt;br /&gt;
             When you go to your user-group meetings, you need to bring 2 forms of ID, and&lt;br /&gt;
             list your Key fingerprint. Shown below is the command for getting this fingerprint.&lt;br /&gt;
&lt;br /&gt;
                $ gpg --fingerprint mchirico@comcast.net&lt;br /&gt;
                 pub   1024D/A11C1499 2004-07-15&lt;br /&gt;
                 Key fingerprint = 9D7F C80D BB7B 4BAB CCA4  1BE9 9056 5BEC A11C 1499&lt;br /&gt;
                 uid   Mike Chirico (http://souptonuts.sourceforge.net/chirico/index.php) &amp;lt;mchirico@comcast.net&amp;gt;&lt;br /&gt;
                 sub   1024g/E1A3C2B3 2004-07-15&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Receving keys:&lt;br /&gt;
&lt;br /&gt;
        The following will retrieve my mchirico@comcast.net key&lt;br /&gt;
&lt;br /&gt;
               $ gpg --recv-keys 0xA11C1499&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Special Note: If you get the following error &amp;quot;GPG: Warning: Using Insecure Memory&amp;quot; , then,&lt;br /&gt;
                   &amp;quot; chmod 4755 /path/to/gpg&amp;quot;  to setuid(root) permissioins on the gpg binary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     NOTE: If using mutt, just before sending with the &amp;quot;y&amp;quot; option, hit &amp;quot;p&amp;quot; to sign or encrypt.&lt;br /&gt;
&lt;br /&gt;
     It's possible to create a gpg/pgp email from the command line. For a tutorial on this,&lt;br /&gt;
     reference (SCRIPT 4) at the following link:&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/README_common_script_commands.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 87:&lt;br /&gt;
&lt;br /&gt;
     Working with Dates: Steffen Beyer has developed a Perl and C module for working with dates&lt;br /&gt;
&lt;br /&gt;
     This softare can be downloaded from the following location:&lt;br /&gt;
        http://www.engelschall.com/u/sb/download/pkg/Date-Calc-5.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
         $ wget http://www.engelschall.com/u/sb/download/pkg/Date-Calc-5.3.tar.gz&lt;br /&gt;
         $ tar -xzvf Date-Calc-5.3.tar.gz&lt;br /&gt;
         $ cd Date-Calc-5.3&lt;br /&gt;
         $ cp ./examples/cal.c .&lt;br /&gt;
         $ gcc cal.c DateCalc.c -o mcal&lt;br /&gt;
&lt;br /&gt;
     The file cal.c contains sample function calls from DateCalc.c.  Note, &amp;quot;DateCalc.c&amp;quot;&lt;br /&gt;
     is just a list of functions and includes for &amp;quot;DateCalc.h&amp;quot; and &amp;quot;ToolBox.h&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Or, and this may be easier, just download the following:&lt;br /&gt;
         http://prdownloads.sourceforge.net/cpearls/date_calc.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
     The above link contains a few examples.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 88:&lt;br /&gt;
&lt;br /&gt;
     Color patterns for mutt.&lt;br /&gt;
&lt;br /&gt;
     The colors can be changed in the /home/user/.muttrc file. The first field begins with&lt;br /&gt;
     color, the second field is the foreground color, and the third field is the background&lt;br /&gt;
     color, or default.&lt;br /&gt;
&lt;br /&gt;
     An example .muttrc for colors:&lt;br /&gt;
&lt;br /&gt;
       # color patterns for mutt&lt;br /&gt;
       color normal     white          black # normal text&lt;br /&gt;
       color indicator  black          yellow  # actual message&lt;br /&gt;
       color tree       brightmagenta  default # thread arrows&lt;br /&gt;
       color status     brightyellow         default # status line&lt;br /&gt;
       color error      brightred      default # errors&lt;br /&gt;
       color message    magenta        default # info messages&lt;br /&gt;
       color signature  magenta        default # signature&lt;br /&gt;
       color attachment brightyellow   red     # MIME attachments&lt;br /&gt;
       color search     brightyellow   red     # search matches&lt;br /&gt;
       color tilde      brightmagenta  default # ~ at bottom of msg&lt;br /&gt;
       color markers    red            default # + at beginning of wrapped lines&lt;br /&gt;
       color hdrdefault cyan           default # default header lines&lt;br /&gt;
       color bold       red            default # hiliting bold patterns in body&lt;br /&gt;
       color underline  green          default # hiliting underlined patterns in body&lt;br /&gt;
       color quoted     cyan           default # quoted text&lt;br /&gt;
       color quoted1    magenta        default&lt;br /&gt;
       color quoted2    red            default&lt;br /&gt;
       color quoted3    green          default&lt;br /&gt;
       color quoted4    magenta           default&lt;br /&gt;
       color quoted5    cyan           default&lt;br /&gt;
       color quoted6    magenta        default&lt;br /&gt;
       color quoted7    red            default&lt;br /&gt;
       color quoted8    green          default&lt;br /&gt;
       color quoted9    cyan           default&lt;br /&gt;
       color body   cyan  default  &amp;quot;((ftp|http|https)://|news:)[^ &amp;gt;)\&amp;quot;\t]+&amp;quot;&lt;br /&gt;
       color body   cyan  default  &amp;quot;[-a-z_0-9.+]+@[-a-z_0-9.]+&amp;quot;&lt;br /&gt;
       color body   red   default  &amp;quot;(^| )\\*[-a-z0-9*]+\\*[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color body   green default  &amp;quot;(^| )_[-a-z0-9_]+_[,.?]?[\n]&amp;quot;&lt;br /&gt;
       color body   red   default  &amp;quot;(^| )\\*[-a-z0-9*]+\\*[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color body   green default  &amp;quot;(^| )_[-a-z0-9_]+_[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color index  cyan  default  ~F         # Flagged&lt;br /&gt;
       color index  red   default  ~N         # New&lt;br /&gt;
       color index  magenta    default  ~T         # Tagged&lt;br /&gt;
       color index  cyan       default  ~D         # Deleted&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 190)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 89:&lt;br /&gt;
&lt;br /&gt;
     ps command in detail&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Here are the possible codes when using state &amp;quot;$ ps -e -o state,cmd&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             PROCESS STATE CODES&lt;br /&gt;
                  D   uninterruptible sleep (usually IO)&lt;br /&gt;
                  R   runnable (on run queue)&lt;br /&gt;
                  S   sleeping&lt;br /&gt;
                  T   traced or stopped&lt;br /&gt;
                  Z   a defunct (&amp;quot;zombie&amp;quot;) process&lt;br /&gt;
&lt;br /&gt;
                  &amp;lt;    high-priority (not nice to other users)&lt;br /&gt;
                  N    low-priority (nice to other users)&lt;br /&gt;
                  L    has pages locked into memory (for real-time and custom IO)&lt;br /&gt;
                  s    is a session leader&lt;br /&gt;
                  l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)&lt;br /&gt;
                  +    is in the foreground process group&lt;br /&gt;
&lt;br /&gt;
    For instance:&lt;br /&gt;
&lt;br /&gt;
     Note that the -o is for user defined, and -e is for select&lt;br /&gt;
     all process.&lt;br /&gt;
&lt;br /&gt;
       $ ps -e -o pid,state,start,time,etime,cmd&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
             9946 S 15:40:45 00:00:00    02:23:29 /bin/bash -i&lt;br /&gt;
             9985 T 15:41:24 00:00:01    02:22:50 emacs mout2&lt;br /&gt;
            10003 T 15:43:59 00:00:00    02:20:15 emacs NOTES&lt;br /&gt;
            10320 T 17:38:42 00:00:00       25:32 emacs stuff.c&lt;br /&gt;
         ...&lt;br /&gt;
&lt;br /&gt;
     You may want to command below, without the -e, which will give the&lt;br /&gt;
     process only under the current terminal.&lt;br /&gt;
&lt;br /&gt;
       $ ps -o pid,state,start,time,etime,cmd&lt;br /&gt;
&lt;br /&gt;
     Want to find what 's impacting your load?&lt;br /&gt;
&lt;br /&gt;
       $ ps -e -o %cpu,pid,state,start,time,etime,%cpu,%mem,cmd|sort -rn|less&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ ps aux&lt;br /&gt;
&lt;br /&gt;
            USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND&lt;br /&gt;
            root         1  0.0  0.0  1380  480 ?        S    Aug04   0:00 init [3]&lt;br /&gt;
            root         2  0.0  0.0     0    0 ?        SWN  Aug04   0:00 [ksoftirqd/0]&lt;br /&gt;
            root         3  0.0  0.0     0    0 ?        SW&amp;lt;  Aug04   0:00 [events/0]&lt;br /&gt;
            root         4  0.0  0.0     0    0 ?        SW&amp;lt;  Aug04   0:00 [khelper]&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     Or, if you want to see the environment add the -e option&lt;br /&gt;
&lt;br /&gt;
       $ ps aeux&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
            chirico   2735  0.0  0.1  4400 1492 pts/0    S    Aug04   0:00 -bash USER=chirico LOGNAME=chirico HOME=/home/chirico PATH=/usr/&lt;br /&gt;
            chirico   2771  0.0  0.0  4328  924 pts/0    S    Aug04   0:00 screen -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm S&lt;br /&gt;
            chirico   2772  0.0  0.6  9476 6352 ?        S    Aug04   0:54 SCREEN -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm S&lt;br /&gt;
            chirico   2773  0.0  0.1  4432 1548 pts/1    S    Aug04   0:10 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            chirico   2797  0.0  0.1  4416 1496 pts/2    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            root      2821  0.0  0.0  4100  952 pts/2    S    Aug04   0:00 su -&lt;br /&gt;
            root      2822  0.0  0.1  4384 1480 pts/2    S    Aug04   0:00 -bash&lt;br /&gt;
            chirico   2862  0.0  0.1  4428 1524 pts/3    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            sporkey   2946  0.0  0.2  6836 2960 ?        S    Aug04   0:15 fetchmail&lt;br /&gt;
            chirico   2952  0.0  0.1  4436 1552 pts/5    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            chirico   3880  0.0  0.1  4416 1496 pts/6    S    Aug05   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            root      3904  0.0  0.0  4100  956 pts/6    S    Aug05   0:00 su - donkey&lt;br /&gt;
            donkey    3905  0.0  0.1  4336 1452 pts/6    S    Aug05   0:00 -bash&lt;br /&gt;
            donkey    3938  0.0  0.2  6732 2856 ?        S    Aug05   0:14 fetchmail&lt;br /&gt;
            chirico   3944  0.0  0.1  4416 1496 pts/7    S    Aug05   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     There is also a -f &amp;quot;forrest&amp;quot; option. Also note below &amp;quot; -bash&amp;quot; is the start of a login shell.&lt;br /&gt;
&lt;br /&gt;
      $ ps aeuxwwf &lt;br /&gt;
     &lt;br /&gt;
     The ww option above gives a wide format with all variables. Use the above command if you plan&lt;br /&gt;
     to parse through a Perl script. Otherwise, it may be easier to do a quick read using the command&lt;br /&gt;
     below, without &amp;quot;ww&amp;quot;.    &lt;br /&gt;
&lt;br /&gt;
      $ ps aeuxf&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
            root      2339  0.0  0.1  3512 1444 ?        S    Dec01   0:00 /usr/sbin/sshd&lt;br /&gt;
            root     25651  0.0  0.1  6764 1980 ?        S    Dec23   0:00  \_ /usr/sbin/sshd&lt;br /&gt;
            chirico  25653  0.0  0.2  6840 2236 ?        S    Dec23   0:14      \_ /usr/sbin/sshd&lt;br /&gt;
            chirico  25654  0.0  0.1  4364 1440 pts/4    S    Dec23   0:00          \_ -bash USER=chirico LOGNAME=chirico HOME=/home/chirico&lt;br /&gt;
            chirico  25690  0.0  0.0  4328  920 pts/4    S    Dec23   0:00              \_ screen -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm&lt;br /&gt;
            root      2355  0.0  0.0  2068  904 ?        S    Dec01   0:00 xinetd -stayalive -pidfile /var/run/xinetd.pid&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     It is also possible to list the process by command line. For example, the following command will only list the emacs&lt;br /&gt;
     processes.&lt;br /&gt;
&lt;br /&gt;
      $ ps -fC emacs&lt;br /&gt;
       UID        PID  PPID  C STIME TTY          TIME CMD&lt;br /&gt;
       chirico   5049  5020  0 May11 pts/13   00:00:00 emacs -nw Notes&lt;br /&gt;
       chirico  12368  5104  0 May12 pts/18   00:00:00 emacs -nw dnotify.c&lt;br /&gt;
       chirico  19792 18028  0 May13 pts/20   00:00:00 emacs -nw hello.c&lt;br /&gt;
       chirico  14034 27367  0 18:52 pts/8    00:00:00 emacs -nw How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
     You may also want to consider using top in batch mode. Here the &amp;quot;-n 1&amp;quot; means refresh once,&lt;br /&gt;
     and the &amp;quot;b&amp;quot; is for batch. The &amp;quot;fmt -s&amp;quot; is to put it in a more readable format.&lt;br /&gt;
&lt;br /&gt;
       $ top -n 1 b |fmt  -s &amp;gt;&amp;gt;statfile&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 90:&lt;br /&gt;
&lt;br /&gt;
     Learning Assembly.&lt;br /&gt;
&lt;br /&gt;
     Once you have written the source, assuming the file is &amp;quot;exit.s&amp;quot;, it can be compiled as follows:&lt;br /&gt;
&lt;br /&gt;
            $ as exit.s -o exit.o&lt;br /&gt;
            $ ld exit.o -o exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Here is the program:&lt;br /&gt;
&lt;br /&gt;
         #&lt;br /&gt;
         #INPUT:  none&lt;br /&gt;
         #&lt;br /&gt;
         #OUTPUT:         returns a status code. This can be viewed&lt;br /&gt;
         # by typing&lt;br /&gt;
         #&lt;br /&gt;
         # echo $?&lt;br /&gt;
         #&lt;br /&gt;
         # after running the program&lt;br /&gt;
         #&lt;br /&gt;
         #VARIABLES:&lt;br /&gt;
         # %eax holds the system call number&lt;br /&gt;
         # (this is always the case)&lt;br /&gt;
         #&lt;br /&gt;
         # %ebx holds the return status&lt;br /&gt;
         #&lt;br /&gt;
                 .section .data&lt;br /&gt;
                 .section .text&lt;br /&gt;
&lt;br /&gt;
                 .globl _start&lt;br /&gt;
         _start:&lt;br /&gt;
                 movl $1, %eax # this is the linux kernel command&lt;br /&gt;
                 # number (system call) for exiting&lt;br /&gt;
                 # a program&lt;br /&gt;
                 movl $0, %ebx # this is the status number we will&lt;br /&gt;
                 # return to the operating system.&lt;br /&gt;
                 # Change this around and it will&lt;br /&gt;
                 # return different things to&lt;br /&gt;
                 # echo $?&lt;br /&gt;
                 int $0x80 # this wakes up the kernel to run&lt;br /&gt;
                 # the exit command&lt;br /&gt;
&lt;br /&gt;
     After running this program, you can get the exit code.&lt;br /&gt;
&lt;br /&gt;
            $ exit $?&lt;br /&gt;
            0&lt;br /&gt;
&lt;br /&gt;
     That is about all it does; but, get the book for more details. The&lt;br /&gt;
     book is free.&lt;br /&gt;
&lt;br /&gt;
          http://savannah.nongnu.org/download/pgubook/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 91:&lt;br /&gt;
&lt;br /&gt;
     Creating a sandbox for reiserfstune,debugreiserfs and ACL.  Also see TIP 4.&lt;br /&gt;
&lt;br /&gt;
     Assume you have a reisers files system created from a disk file, which&lt;br /&gt;
     means you have done something like the following:&lt;br /&gt;
&lt;br /&gt;
          # dd if=/dev/zero of=disk-rfs count=102400&lt;br /&gt;
          # losetup  /dev/loop4 ./disk-rfs&lt;br /&gt;
          # mkfs -t reiserfs /dev/loop4&lt;br /&gt;
          # mkdir /fs2&lt;br /&gt;
          # mount -o loop,acl ./disk-rfs /fs2&lt;br /&gt;
&lt;br /&gt;
     Now, you can run reiserfstune. But, first you will need to umount fs2&lt;br /&gt;
&lt;br /&gt;
          # umount /fs2&lt;br /&gt;
          # reiserfstune ./disk-rfs&lt;br /&gt;
&lt;br /&gt;
     Or you can run the debug command&lt;br /&gt;
&lt;br /&gt;
          # debugreiserfs -J ./disk-rfs&lt;br /&gt;
&lt;br /&gt;
     Now, suppose you run through a lot of the debug options on&lt;br /&gt;
     http://www.namesys.com/ and you destroy this file.&lt;br /&gt;
&lt;br /&gt;
     You can recreate the file and delete the loop device.&lt;br /&gt;
&lt;br /&gt;
          # dd if=/dev/zero of=disk-rfs count=102400&lt;br /&gt;
          # losetup -d /dev/loop4&lt;br /&gt;
          # mount -o loop,acl ./disk-rfs /fs2&lt;br /&gt;
&lt;br /&gt;
     Now, try working with some of the ACL options - you can only do this&lt;br /&gt;
     with the latest kernel and tools -- Fedora Core 2 will work.&lt;br /&gt;
&lt;br /&gt;
     Assume you have 3 users, donkey, chirico and bozo2. You can give&lt;br /&gt;
     everyone rights to this file system as follows:&lt;br /&gt;
&lt;br /&gt;
          # setfacl -R -m d:u:donkey:rwx,d:u:chirico:rwx,d:u:bozo2:rwx /fs2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 92:&lt;br /&gt;
&lt;br /&gt;
     SpamAssassin - Setup.&lt;br /&gt;
&lt;br /&gt;
     Step 1.&lt;br /&gt;
&lt;br /&gt;
           Installing the SpamAssassin CPAN utility. You will need to do this&lt;br /&gt;
           as root.&lt;br /&gt;
        &lt;br /&gt;
              $ su -&lt;br /&gt;
&lt;br /&gt;
           Once you have root privileges invoke cpan.&lt;br /&gt;
        &lt;br /&gt;
              # perl -MCPAN -e shell&lt;br /&gt;
&lt;br /&gt;
              cpan&amp;gt;&lt;br /&gt;
&lt;br /&gt;
           Now install with prerequisites policy set to ask.&lt;br /&gt;
        &lt;br /&gt;
              cpan&amp;gt; o conf prerequisites_policy ask&lt;br /&gt;
        &lt;br /&gt;
              cpan&amp;gt; install Mail::SpamAssassin&lt;br /&gt;
        &lt;br /&gt;
           You will get lots of output as the necessary modules are downloaded and&lt;br /&gt;
           compiled and installed.&lt;br /&gt;
&lt;br /&gt;
     Step 2.&lt;br /&gt;
&lt;br /&gt;
            Configuration.&lt;br /&gt;
&lt;br /&gt;
            Edit the following &amp;quot;/etc/mail/spamassassin/local.cf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            Here is a look at my file&lt;br /&gt;
&lt;br /&gt;
                $ cat /etc/mail/spamassassin/local.cf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                # This is the right place to customize your installation of SpamAssassin.&lt;br /&gt;
                #&lt;br /&gt;
                # See 'perldoc Mail::SpamAssassin::Conf' for details of what can be&lt;br /&gt;
                # tweaked.&lt;br /&gt;
                #&lt;br /&gt;
                ###########################################################################&lt;br /&gt;
                #&lt;br /&gt;
                # rewrite_subject 0&lt;br /&gt;
                # report_safe 1&lt;br /&gt;
                # trusted_networks 212.17.35.&lt;br /&gt;
                #&lt;br /&gt;
                &lt;br /&gt;
                # Below added from book&lt;br /&gt;
                # You may want to set this to 5, then, work your way down.&lt;br /&gt;
                # Currently I have this 3&lt;br /&gt;
                required_hits 3&lt;br /&gt;
                &lt;br /&gt;
                # This determines how spam is reported. Currently safe email is reported&lt;br /&gt;
                # in the message.&lt;br /&gt;
                report_safe 1&lt;br /&gt;
                &lt;br /&gt;
                # The will rewrite the tag of the spam message.&lt;br /&gt;
                rewrite_subject 1&lt;br /&gt;
                &lt;br /&gt;
                # By default, SpamAssassin will run RBL checks.  If your ISP already&lt;br /&gt;
                # does this, set this to 1.&lt;br /&gt;
                skip_rbl_checks 0&lt;br /&gt;
&lt;br /&gt;
     Step 3.&lt;br /&gt;
&lt;br /&gt;
            Update .procmail.&lt;br /&gt;
&lt;br /&gt;
            You should update the .procmail file as follows. Here is my /home/chirico/.procmail file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ cat /home/chirico/.procmailrc&lt;br /&gt;
&lt;br /&gt;
                PATH=/bin:/usr/bin:/usr/local/bin&lt;br /&gt;
                MAILDIR=/var/spool/mail&lt;br /&gt;
                DEFAULT=/var/spool/mail/chirico&lt;br /&gt;
                LOGFILE=/home/chirico/MailBAG&lt;br /&gt;
                MYHOME=/home/chirico&lt;br /&gt;
                #  Must have folder MailTRASH&lt;br /&gt;
                TRASH=/home/chirico/MailTRASH&lt;br /&gt;
                &lt;br /&gt;
                # Will get everything from this mail&lt;br /&gt;
                :0&lt;br /&gt;
                * ^From:.*sporkey@comcast.net&lt;br /&gt;
                        $DEFAULT&lt;br /&gt;
                &lt;br /&gt;
                # Spamassassin&lt;br /&gt;
                :0fw&lt;br /&gt;
                * &amp;lt;300000&lt;br /&gt;
                |/usr/local/bin/spamassassin&lt;br /&gt;
&lt;br /&gt;
      Reference:&lt;br /&gt;
        http://pm-doc.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 93:&lt;br /&gt;
&lt;br /&gt;
     Make Graphs: using dot and neato.&lt;br /&gt;
&lt;br /&gt;
       $ dot -Tpng dotfile -o myout.png&lt;br /&gt;
&lt;br /&gt;
     To see the output reference the following:&lt;br /&gt;
       http://souptonuts.sourceforge.net/code/myout.png&lt;br /&gt;
&lt;br /&gt;
     Where &amp;quot;dotfile&amp;quot; is the following:&lt;br /&gt;
&lt;br /&gt;
       $ cat dotfile&lt;br /&gt;
&lt;br /&gt;
       digraph g&lt;br /&gt;
       {&lt;br /&gt;
               node [shape = record];&lt;br /&gt;
&lt;br /&gt;
               node0 [ label =&amp;quot;&amp;lt;f0&amp;gt; stuff | &amp;lt;f1&amp;gt; J | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node1 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; E | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node4 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; C | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node6 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; I | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node2 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; U | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node5 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; N | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node9 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; Y | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node8 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; W | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node10 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; Z | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node7 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; A | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node3 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; G | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node0&amp;quot;:f0 -&amp;gt; &amp;quot;node1&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node0&amp;quot;:f2 -&amp;gt; &amp;quot;node2&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node1&amp;quot;:f0 -&amp;gt; &amp;quot;node4&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node1&amp;quot;:f2 -&amp;gt; &amp;quot;node6&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node4&amp;quot;:f0 -&amp;gt; &amp;quot;node7&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node4&amp;quot;:f2 -&amp;gt; &amp;quot;node3&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node2&amp;quot;:f0 -&amp;gt; &amp;quot;node5&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node2&amp;quot;:f2 -&amp;gt; &amp;quot;node9&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node9&amp;quot;:f0 -&amp;gt; &amp;quot;node8&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node9&amp;quot;:f2 -&amp;gt; &amp;quot;node10&amp;quot;:f1;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
     Checkout the following article:&lt;br /&gt;
        http://www.linuxjournal.com/article.php?sid=7275&lt;br /&gt;
&lt;br /&gt;
     To download this software&lt;br /&gt;
        http://www.graphviz.org/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 94:&lt;br /&gt;
&lt;br /&gt;
     Makefile: working with conditions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     First note that all the indentations of the file must be&lt;br /&gt;
     a single tab. There cannot be any spaces, or make will&lt;br /&gt;
     not run.&lt;br /&gt;
&lt;br /&gt;
       $ cat Makefile&lt;br /&gt;
&lt;br /&gt;
        # Compiler flags&lt;br /&gt;
        sqliteLIB := $(shell ls /usr/local/lib/libsqlite.so)&lt;br /&gt;
        sqlite3LIB := $(shell ls /usr/local/lib/libsqlite3.so)&lt;br /&gt;
        # all assumes sqlite and sqlite3 are installed&lt;br /&gt;
        #&lt;br /&gt;
&lt;br /&gt;
        test:&lt;br /&gt;
        ifeq (&amp;quot;$(sqlite3LIB)&amp;quot;,&amp;quot;/usr/local/lib/libsqlite3.so&amp;quot;)&lt;br /&gt;
             @echo -e &amp;quot;True -- we found the file&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
             @echo &amp;quot;False -- we did not find the file&amp;quot;&lt;br /&gt;
        endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     So, if I run make I will get the following output.&lt;br /&gt;
&lt;br /&gt;
       $ make&lt;br /&gt;
       True -- we found the file&lt;br /&gt;
&lt;br /&gt;
     This is because I have a file /usr/local/lib/libsqlite3.so on my system.&lt;br /&gt;
     Note how the assignment is made, with the shell command&lt;br /&gt;
&lt;br /&gt;
           sqlite3LIB := $(shell ls /usr/local/lib/libsqlite3.so)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 95:&lt;br /&gt;
&lt;br /&gt;
     Bash: Conditional Expressions&lt;br /&gt;
&lt;br /&gt;
          if [ -e /etc/ntp.conf ]&lt;br /&gt;
            then&lt;br /&gt;
              echo &amp;quot;You have the ntp config file&amp;quot;&lt;br /&gt;
            else&lt;br /&gt;
              echo &amp;quot;You do not have the ntp config file&amp;quot;&lt;br /&gt;
          fi&lt;br /&gt;
&lt;br /&gt;
       Now using an AND condition inside the [ ]. By the way, above, you&lt;br /&gt;
       can put the &amp;quot;then&amp;quot; on the same line as the if &amp;quot;if [ -e /etc/ntp.conf ]; then&amp;quot;&lt;br /&gt;
       as long as you use the &amp;quot;;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           if [ \( -e /etc/ntp.conf \) -a \( -e /etc/ntp/ntpservers \) ]&lt;br /&gt;
             then&lt;br /&gt;
               echo &amp;quot;You have ntp config and ntpservers&amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp.conf ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntp.conf &amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp/ntpservers ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntpservers &amp;quot;&lt;br /&gt;
             else&lt;br /&gt;
               echo &amp;quot; you have neither ntp.conf or ntpservers&amp;quot;&lt;br /&gt;
           fi&lt;br /&gt;
&lt;br /&gt;
        A few things to note above. Else if statement is written as &amp;quot;elif&amp;quot;, and when&lt;br /&gt;
        dealing with &amp;quot;(&amp;quot; you will need to insert &amp;quot;\(&amp;quot;. By the way &amp;quot;-o&amp;quot; can replace &amp;quot;-a&amp;quot;&lt;br /&gt;
        and the &amp;quot;-o&amp;quot; is for OR condition. AND can be done as follows too.&lt;br /&gt;
&lt;br /&gt;
           if [ -e /etc/ntp.conf ] &amp;amp;&amp;amp; [ -e /etc/ntp/ntpservers ]&lt;br /&gt;
             then&lt;br /&gt;
               echo &amp;quot;You have ntp config and ntpservers&amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp.conf ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntp.conf &amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp/ntpservers ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntpservers &amp;quot;&lt;br /&gt;
             else&lt;br /&gt;
               echo &amp;quot; you have neither ntp.conf or ntpservers&amp;quot;&lt;br /&gt;
           fi&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (files).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             -b file      True if file exists and is a block file&lt;br /&gt;
             -c file      True if file exists and is a character device file&lt;br /&gt;
             -d file      True if file exists and is a directory&lt;br /&gt;
             -e file      True if file exists&lt;br /&gt;
             -f file      True if file exists and is a regular file&lt;br /&gt;
             -g file      True if file exists and is set goup id&lt;br /&gt;
             -G file      True if owned by the effective group ID&lt;br /&gt;
&lt;br /&gt;
             -k file      True if &amp;quot;sticky&amp;quot; bit is set and file exists&lt;br /&gt;
             -L file      True if file exists and is a symbolic link&lt;br /&gt;
             -n string    True if string is non-null&lt;br /&gt;
&lt;br /&gt;
             -O file      Ture if file exists and is owned by the effective user ID&lt;br /&gt;
&lt;br /&gt;
             -p file      True if file is a named pipe (FIFO)&lt;br /&gt;
             -r file      True if file is readable&lt;br /&gt;
             -s file      True if file has size &amp;gt; 0&lt;br /&gt;
             -S file      True if file exists and is a socket&lt;br /&gt;
&lt;br /&gt;
             -t file      True if file is open and refers to a terminal.&lt;br /&gt;
             -u file      True if setuid bit is set&lt;br /&gt;
             -w file      True if file exists and is writeable&lt;br /&gt;
             -x file      True if file executable&lt;br /&gt;
             -x dir       True if directory can be searched&lt;br /&gt;
&lt;br /&gt;
             file1 -nt file2     True if file1 modification date newer than file2&lt;br /&gt;
             file1 -ot file2     True if file1 modification date older than file2&lt;br /&gt;
             file1 -ef file2     True if file1 and file2 have same inode&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (Integers).&lt;br /&gt;
&lt;br /&gt;
             -lt  Less than&lt;br /&gt;
             -le  Less than or equal&lt;br /&gt;
             -eq  Equal&lt;br /&gt;
             -ge  Greater than or equal&lt;br /&gt;
             -gt  Greater than&lt;br /&gt;
             -ne  Not equal&lt;br /&gt;
&lt;br /&gt;
          Example usage.&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
             {&lt;br /&gt;
               while read num value; do&lt;br /&gt;
                if [ $num -gt  2 ]; then&lt;br /&gt;
                  echo $value&lt;br /&gt;
                fi&lt;br /&gt;
               done&lt;br /&gt;
             } &amp;lt; somefile&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (Strings).&lt;br /&gt;
&lt;br /&gt;
             str1 = str2      str1 matches str2&lt;br /&gt;
             str1 != str2     str1 does not matches str2&lt;br /&gt;
             str1 &amp;lt; str2      str1 is less than str2&lt;br /&gt;
             str1 &amp;gt;  str2     str1 is greater than str2&lt;br /&gt;
             -n str1          str1 is not null (length greater than 0)&lt;br /&gt;
             -z str1          str1 is null (las length 0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 96:&lt;br /&gt;
&lt;br /&gt;
     CVS: Working with cvs&lt;br /&gt;
&lt;br /&gt;
      INITIAL REPOSITORY:&lt;br /&gt;
&lt;br /&gt;
       To create a repository, and this is normally done by the system admin. This&lt;br /&gt;
       is NOT creating a project to checkout, but the location where everything&lt;br /&gt;
       will be stored! The initial repository!&lt;br /&gt;
&lt;br /&gt;
             cvs -d repository_root_directory init&lt;br /&gt;
&lt;br /&gt;
       Or here is a specific example:&lt;br /&gt;
&lt;br /&gt;
             cvs -d /work/cvsREPOSITORY/   init&lt;br /&gt;
&lt;br /&gt;
       Creating a directory tree from scratch. For a new project, the easiest thing to&lt;br /&gt;
       do is probably to create an empty directory structure, like this:&lt;br /&gt;
&lt;br /&gt;
             $ mkdir sqlite_examples&lt;br /&gt;
             $ mkdir sqlite_examples/man&lt;br /&gt;
             $ mkdir sqlite_examples/testing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       After that, you use the import command to create the&lt;br /&gt;
       corresponding (empty) directory structure inside the repository:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             $ cd &amp;lt;directory&amp;gt;&lt;br /&gt;
             $ cvs -d repository_root_directory import  -m &amp;quot;Created directory structure&amp;quot; yoyodyne/dir yoyo start&lt;br /&gt;
&lt;br /&gt;
       Or, here is a specific example.&lt;br /&gt;
&lt;br /&gt;
             $  cd sqlite_examples&lt;br /&gt;
             $  cvs  -d /work/cvsREPOSITORY/ import -m 'test SQlite'  sqlite_examples sqlite_examples start&lt;br /&gt;
&lt;br /&gt;
       Now, you can delete the directory sqlite_examples, or go to another directory and type&lt;br /&gt;
       the following:&lt;br /&gt;
&lt;br /&gt;
             $ cvs -d /work/cvsREPOSITORY/ co sqlite_examples&lt;br /&gt;
&lt;br /&gt;
     COOL TOOLS:&lt;br /&gt;
&lt;br /&gt;
           1. cvsps&lt;br /&gt;
           2. cvsreport&lt;br /&gt;
&lt;br /&gt;
         cvsps which you can find at http://www.cobite.com/cvsps/cvsps-2.0rc1.tar.gz&lt;br /&gt;
&lt;br /&gt;
             $ cvsps -f README_sqlite_tutorial.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 97:&lt;br /&gt;
&lt;br /&gt;
     Common vi and vim commands&lt;br /&gt;
&lt;br /&gt;
           Command mode ESC&lt;br /&gt;
&lt;br /&gt;
                dd       delete&lt;br /&gt;
                u        undelete&lt;br /&gt;
                y        yank (copy to buffer)&lt;br /&gt;
                p/P      p before cursor/P after cursor&lt;br /&gt;
&lt;br /&gt;
                Ctl-g    show current line number&lt;br /&gt;
                shft-G   end of file&lt;br /&gt;
              n shft-G   move to line n&lt;br /&gt;
&lt;br /&gt;
               /stuff/   search&lt;br /&gt;
                  n   repeat in same direction&lt;br /&gt;
                  N   repeat in opposite direction&lt;br /&gt;
                  /return  repeat seach forward&lt;br /&gt;
                  ?return  repeat seach backward&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;dyy  Yank current line to buffer d&lt;br /&gt;
               &amp;quot;a7yy Yank next 7 lines to buffer a&lt;br /&gt;
                    or&lt;br /&gt;
               :1,7ya a  Yank [ya] lines 1,7 to buffer a&lt;br /&gt;
               :1,7ya b  Yank [ya] lines 1,7 to buffer b&lt;br /&gt;
&lt;br /&gt;
               :5 pu b   Put [pu] buffer b after line 5&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;dP   Put the content of buffer d before cursor&lt;br /&gt;
               &amp;quot;ap   Put the contents of buffer a after cursor&lt;br /&gt;
&lt;br /&gt;
               :1,4 w! file2  Write lines 1,4 to file2&lt;br /&gt;
               :1,3&lt;br /&gt;
&lt;br /&gt;
               :set nu     Display line numbers&lt;br /&gt;
               :set nonum  Turns off display&lt;br /&gt;
&lt;br /&gt;
               :e &amp;lt;filename&amp;gt; Edit a file in a new buffer&lt;br /&gt;
&lt;br /&gt;
            vim&lt;br /&gt;
               :split&lt;br /&gt;
               :split &amp;lt;filename&amp;gt;&lt;br /&gt;
               :sp &amp;lt;filename&amp;gt;&lt;br /&gt;
               :split new&lt;br /&gt;
&lt;br /&gt;
                   ctl-w   To move between windows&lt;br /&gt;
                   ctl-w+&lt;br /&gt;
                   ctl-w-  To change size&lt;br /&gt;
                   ctl+wv  Split windows vertically&lt;br /&gt;
                   ctl-wq  Close window&lt;br /&gt;
&lt;br /&gt;
               :only       To view only 1 window&lt;br /&gt;
&lt;br /&gt;
            vim dictionary - put the following command in ~/.vimrc&lt;br /&gt;
&lt;br /&gt;
                   set dictionary+=/usr/share/dict/words&lt;br /&gt;
                   set thesaurus+=/usr/share/dict/words&lt;br /&gt;
              &lt;br /&gt;
               Now, after you type a word &amp;lt;ctl-x&amp;gt;&amp;lt;ctl-k&amp;gt;&amp;lt;ctl-n&amp;gt; and to &lt;br /&gt;
               go back in the listing &amp;lt;ctl-p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                   butter&amp;lt;ctl-x&amp;gt;&amp;lt;ctl-k&amp;gt;&amp;lt;ctl-n&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 98:&lt;br /&gt;
&lt;br /&gt;
     Using apt-get&lt;br /&gt;
&lt;br /&gt;
          $ apt-get update&lt;br /&gt;
          $ apt-get -s install &amp;lt;pkage&amp;gt;    &amp;lt;---- if everything is ok, then, remove the s&lt;br /&gt;
&lt;br /&gt;
     Note you may want to use dpkg to purge if you have to do a reinstall.&lt;br /&gt;
&lt;br /&gt;
          $ dpkg --purge exim4-base&lt;br /&gt;
          $ dpkg --purge exim4-config&lt;br /&gt;
          $ apt-get install exim4&lt;br /&gt;
&lt;br /&gt;
          $ dpkg-reconfigure exim4-config&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 99:&lt;br /&gt;
&lt;br /&gt;
     Mounting a cdrom on openbsd and installing packages&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /cdrom&lt;br /&gt;
          $ mount /dev/cd0a /cdrom&lt;br /&gt;
          $ cd /cdrom&lt;br /&gt;
&lt;br /&gt;
     To add packages&lt;br /&gt;
&lt;br /&gt;
          $ pkg_add -v  &amp;lt;directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Mounting a cdrom on linux to a user's home sub-directory:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /home/chirico/cdrom&lt;br /&gt;
          $ mount /dev/cdrom /home/chirico/cdrom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 100:&lt;br /&gt;
&lt;br /&gt;
    Creating a boot floppy for knoppix cd:&lt;br /&gt;
&lt;br /&gt;
          $ dd if=/mnt/cdrom/KNOPPIX/boot.img of=/dev/fd0 bs=1440k&lt;br /&gt;
&lt;br /&gt;
    References:&lt;br /&gt;
        http://www.knoppix.net/docs/index.php/BootFloppyHowTo&lt;br /&gt;
&lt;br /&gt;
    For a lot of the knoppix how-to's&lt;br /&gt;
        http://www.knoppix.net/docs/index.php/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 101:&lt;br /&gt;
&lt;br /&gt;
    Diction and Style Tools for Linux  http://ftp.gnu.org/gnu/diction/&lt;br /&gt;
&lt;br /&gt;
        $ diction mytext|less&lt;br /&gt;
&lt;br /&gt;
    Or, this can be done interactively&lt;br /&gt;
&lt;br /&gt;
        $ diction&lt;br /&gt;
        This is more text to read and you can do with it&lt;br /&gt;
        what you want.&lt;br /&gt;
        (stdin):1: This is more text to read and you [can -&amp;gt; (do not confuse with &amp;quot;may&amp;quot;)] do with it what you want.&lt;br /&gt;
&lt;br /&gt;
    DESCRIPTION&lt;br /&gt;
       Diction finds all sentences in a document, that contain phrases from  a&lt;br /&gt;
       database  of  frequently  misused,  bad  or  wordy diction.  It further&lt;br /&gt;
       checks for double words.  If no files are given, the document  is  read&lt;br /&gt;
       from  standard input.  Each found phrase is enclosed in [ ] (brackets).&lt;br /&gt;
       Suggestions and advice, if any, are printed headed by a right arrow -&amp;gt;.&lt;br /&gt;
       A  sentence is a sequence of words, that starts with a capitalised word&lt;br /&gt;
       and ends with a full stop, double colon, question mark or  exclaimation&lt;br /&gt;
       mark.  A single letter followed by a dot is considered an abbreviation,&lt;br /&gt;
       so it does not terminate a sentence.   Various  multi-letter  abbrevia-&lt;br /&gt;
       tions are recognized, they do not terminate a sentence as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 102:&lt;br /&gt;
&lt;br /&gt;
    Using a mail alias.&lt;br /&gt;
&lt;br /&gt;
       Suppose all root mail on your system to go to one root account root@main.com&lt;br /&gt;
&lt;br /&gt;
       In the following file:&lt;br /&gt;
&lt;br /&gt;
             /etc/aliases&lt;br /&gt;
&lt;br /&gt;
       Add this line&lt;br /&gt;
&lt;br /&gt;
             root:    root@main.com&lt;br /&gt;
&lt;br /&gt;
       Next, run newaliases [/usr/bin/newaliases] as follows:&lt;br /&gt;
&lt;br /&gt;
             $ newaliases&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Special note: It's possible to send mail to more than one address. Suppose you want&lt;br /&gt;
                     mail going to root@main.com above, plus you want it going to user donkey&lt;br /&gt;
                     on the local system.&lt;br /&gt;
&lt;br /&gt;
             root:  root@main.com donkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 103:&lt;br /&gt;
&lt;br /&gt;
    Chrony - this service is similiar to ntp. It keeps accurate time&lt;br /&gt;
            on your computer against a very accurate clock in across&lt;br /&gt;
            a network with various time delays.&lt;br /&gt;
&lt;br /&gt;
    Reference: http://go.to/chrony&lt;br /&gt;
&lt;br /&gt;
        In the file &amp;quot;/etc/chrony/chrony.conf&amp;quot; add/replace the following&lt;br /&gt;
&lt;br /&gt;
             server 146.186.218.60&lt;br /&gt;
             server 128.118.25.3&lt;br /&gt;
             server 128.2.129.21&lt;br /&gt;
&lt;br /&gt;
        Next start the chrony service&lt;br /&gt;
&lt;br /&gt;
           $ /etc/init.d/chrony restart&lt;br /&gt;
&lt;br /&gt;
     Next verify that this is working. It may take 20 or 30 minutes to update&lt;br /&gt;
     the clock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Shell command:&lt;br /&gt;
       # chronyc&lt;br /&gt;
       chronyc&amp;gt; sourcestats&lt;br /&gt;
       210 Number of sources = 3&lt;br /&gt;
       Name/IP Address            NP  NR  Span  Frequency   Freq Skew   Std Dev&lt;br /&gt;
       ========================================================================&lt;br /&gt;
       b50.cede.psu.edu            2   0    64       0.000    2000.000  4000ms&lt;br /&gt;
       otc2.psu.edu                2   0    66       0.000    2000.000  4000ms&lt;br /&gt;
       FS3.ECE.CMU.EDU             2   0    64       0.000    2000.000  4000ms&lt;br /&gt;
       chronyc&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    It is probably best to let chrony do its work. However, if you want to&lt;br /&gt;
    set both the hardware and software clock, the following will work:&lt;br /&gt;
&lt;br /&gt;
      Sets the hardware clock&lt;br /&gt;
        # hwclock --set --date=&amp;quot;12/10/04 10:18:05&amp;quot;&lt;br /&gt;
      Sync the hardware clock to software&lt;br /&gt;
        # hwclock --hctosys&lt;br /&gt;
&lt;br /&gt;
    Normally the system keep accurate time with the software clock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 104:&lt;br /&gt;
&lt;br /&gt;
    NFS mount&lt;br /&gt;
&lt;br /&gt;
     SERVER (192.168.1.182)&lt;br /&gt;
&lt;br /&gt;
       Make sure nfs is running on the server&lt;br /&gt;
 &lt;br /&gt;
           $ /etc/init.d/nfs restart&lt;br /&gt;
&lt;br /&gt;
       At the server the contents of /etc/exports for&lt;br /&gt;
       allowing 2 computers (192.168.1.171 and 192.168.1.71)&lt;br /&gt;
       to access the home directory of this server. Note that&lt;br /&gt;
       read write (rw) access is allowed.&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/exports&lt;br /&gt;
         /home   192.168.1.171(rw)&lt;br /&gt;
         /home   192.168.1.71(rw)&lt;br /&gt;
&lt;br /&gt;
       Or, if you have a lot of clients on 192.168.1.* then consider&lt;br /&gt;
       the following:&lt;br /&gt;
&lt;br /&gt;
          /home 192.168.1.0/255.255.252.0(rw)&lt;br /&gt;
&lt;br /&gt;
       Next, still at the server, run the exportfs command&lt;br /&gt;
&lt;br /&gt;
          $ exportfs -rv&lt;br /&gt;
&lt;br /&gt;
       IPTABLES (lokkit). If you're using fedora with default lokkit firewall&lt;br /&gt;
                then you can put the following under &amp;quot;Other ports&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                  Other ports nfs:tcp nfs:udp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       If the above does not work or you are not using lokkit&lt;br /&gt;
        IPTABLES (values in /etc/sysconfig/iptables on SERVER )&lt;br /&gt;
&lt;br /&gt;
        # NFS Need to accept fragmented packets and may not have header&lt;br /&gt;
        #             so you will not know where they are coming from&lt;br /&gt;
        -A INPUT -f -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -m tcp -s 192.168.1.171 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -s 192.168.1.171 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -m udp -s 192.168.1.171 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -s 192.168.1.171 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        &lt;br /&gt;
        -A INPUT -f -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -m tcp -s 192.168.1.71 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -s 192.168.1.71 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -m udp -s 192.168.1.71 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -s 192.168.1.71 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        (Reference: http://nfs.sourceforge.net/nfs-howto/server.html)&lt;br /&gt;
                  and&lt;br /&gt;
        (Reference: http://nfs.sourceforge.net/nfs-howto/security.html)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     CLIENT1 (192.168.1.171)&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /home2&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/fstab&lt;br /&gt;
         192.168.1.182:/home          /home2     nfs     rw 0 0&lt;br /&gt;
&lt;br /&gt;
          $ mount -a -t nfs&lt;br /&gt;
&lt;br /&gt;
        Or to do a one time mounting by hand&lt;br /&gt;
&lt;br /&gt;
          $ mount -t nfs 192.168.1.182:/home  /home2&lt;br /&gt;
&lt;br /&gt;
        Now /home2 on the client will be /home on the server&lt;br /&gt;
&lt;br /&gt;
        Reference:&lt;br /&gt;
          http://nfs.sourceforge.net/nfs-howto/index.html&lt;br /&gt;
&lt;br /&gt;
     MONITOR NFS:&lt;br /&gt;
&lt;br /&gt;
        To monitor the client:&lt;br /&gt;
&lt;br /&gt;
          $ nfsstat -c&lt;br /&gt;
&lt;br /&gt;
           Also note you can &amp;quot;cat /proc/net/rpc/nfs&amp;quot; as well.&lt;br /&gt;
&lt;br /&gt;
       To monitor the server (note the -s instead of the -c).&lt;br /&gt;
&lt;br /&gt;
         $ nfsstat -s&lt;br /&gt;
&lt;br /&gt;
           Also note you can &amp;quot;cat /proc/net/rpc/nfsd&amp;quot; as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       The following &amp;quot;cat&amp;quot; command is done on the NFS server, and shows which&lt;br /&gt;
       clients are mounting. This does not go with examples above. By the way,&lt;br /&gt;
       &amp;quot;root_squash&amp;quot; is the default, and means that root access on the clients is&lt;br /&gt;
       denied. So, how does the client root get access to these filesystems? You have&lt;br /&gt;
       to &amp;quot;su - &amp;lt;someuser&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
              $ cat /proc/fs/nfs/exports&lt;br /&gt;
              # Version 1.1&lt;br /&gt;
              # Path Client(Flags) # IPs&lt;br /&gt;
              /home   192.168.1.102(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   squeezel.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   192.168.1.106(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   livingroom.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   10.8.0.1(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   closet.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
&lt;br /&gt;
     (Reference: http://www.vanemery.com/Linux/NFSv4/NFSv4-no-rpcsec.html#automount )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 105:&lt;br /&gt;
&lt;br /&gt;
      Ports used for Microsoft products&lt;br /&gt;
               http://www.microsoft.com/canada/smallbiz/sgc/articles/ref_net_ports_ms_prod.mspx?pf=true&lt;br /&gt;
          Firewalling?&lt;br /&gt;
               http://www.microsoft.com/technet/prodtechnol/windowsserver2003/library/ServerHelp/428c1bbf-2ceb-4f76-a1ef-0219982eca10.mspx&lt;br /&gt;
&lt;br /&gt;
      To find out common port mappings, take a look at &amp;quot;/etc/services&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 106:&lt;br /&gt;
&lt;br /&gt;
      Man pages: If man pages are formatting incorrectly with PuTTY, try editing&lt;br /&gt;
      the &amp;quot;/etc/man.config&amp;quot; file with the following changes:&lt;br /&gt;
&lt;br /&gt;
           NROFF /usr/bin/groff -Tlatin1 -mandoc&lt;br /&gt;
           NEQN /usr/bin/geqn -Tlatin1&lt;br /&gt;
&lt;br /&gt;
         (Reference TIP 7 for using man)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 107:&lt;br /&gt;
&lt;br /&gt;
      Valgrind: check for memory leaks in your programs. (http://valgrind.org/)&lt;br /&gt;
&lt;br /&gt;
       This is how you can run it on the program &amp;quot;a.out&amp;quot; for valgrind version 2.2.0&lt;br /&gt;
&lt;br /&gt;
         $ valgrind --logfile=valgrind.output   --tool=memcheck ./a.out&lt;br /&gt;
&lt;br /&gt;
       This is how you write the logfile &amp;quot;--log-file&amp;quot; for valgrind-3.0.1&lt;br /&gt;
&lt;br /&gt;
         $ valgrind  --log-file=valgrind --leak-check=yes --tool=memcheck ./a.out&lt;br /&gt;
&lt;br /&gt;
       With C++ programs with gcc 3.4 and later that use STL, export GLIBCXX_FORCE_NEW &lt;br /&gt;
       only when testing to disable memory caching. Remember to enable for production&lt;br /&gt;
       as this will have a performance penalty. Reference  http://valgrind.org/docs/FAQ/ &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 108:&lt;br /&gt;
&lt;br /&gt;
      Runlevel Configuring.&lt;br /&gt;
&lt;br /&gt;
       These two programs, run as root give you a ncurses GUI to what will&lt;br /&gt;
       run on your system on boot.&lt;br /&gt;
&lt;br /&gt;
            # ntsysv&lt;br /&gt;
&lt;br /&gt;
            # chkconfig&lt;br /&gt;
&lt;br /&gt;
       Note, you can also set these manually. For example, normally you will&lt;br /&gt;
       have files in &amp;quot;/etc/init.d/&amp;quot; that will take parameters like &amp;quot;start&amp;quot;,&amp;quot;stop&amp;quot;&lt;br /&gt;
       &amp;quot;restart&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       Take a look at &amp;quot;/etc/init.d/mysql&amp;quot; this file will start and stop the&lt;br /&gt;
       mysql daemon. So, how does know which run levels, and the order it gets&lt;br /&gt;
       loaded in the run level to other programs? By the K&amp;lt;number&amp;gt; and S&amp;lt;number&amp;gt;&lt;br /&gt;
       values.&lt;br /&gt;
&lt;br /&gt;
            $ ls /etc/rc3.d/*mysql&lt;br /&gt;
&lt;br /&gt;
                /etc/rc3.d/K85mysql&lt;br /&gt;
                /etc/rc3.d/S85mysql&lt;br /&gt;
&lt;br /&gt;
       So here on my system the start value is 85. Looking in /etc/rc3.d, which is&lt;br /&gt;
       run level 3, any program with a lower number S84something will get loaded&lt;br /&gt;
       before mysql.&lt;br /&gt;
&lt;br /&gt;
       I manually set the run level as follows for mysql.&lt;br /&gt;
&lt;br /&gt;
            # cd /etc/rc3.d&lt;br /&gt;
            # ln -s ../init.d/mysql S85mysql&lt;br /&gt;
            # ln -s ../init.d/mysql K85mysql&lt;br /&gt;
&lt;br /&gt;
            # cd /etc/rc5.d&lt;br /&gt;
            # ln -s ../init.d/mysql S85mysql&lt;br /&gt;
            # ln -s ../init.d/mysql K85mysql&lt;br /&gt;
&lt;br /&gt;
       Note that I could have chose other numbers as well. &amp;quot;ntsysv&amp;quot; gives&lt;br /&gt;
       you a graphical interface.&lt;br /&gt;
&lt;br /&gt;
       This is a way of doing this with &amp;quot;chkconfig&amp;quot; at the command prompt.&lt;br /&gt;
&lt;br /&gt;
            # chkconfig --list mysqld&lt;br /&gt;
            mysqld          0:off   1:off   2:off   3:on    4:off   5:on    6:off&lt;br /&gt;
&lt;br /&gt;
       Above you can see it's on. Here's how we would have turned this on with chkconfig.&lt;br /&gt;
&lt;br /&gt;
            # chkconfig --level 35 mysqld on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 109:&lt;br /&gt;
&lt;br /&gt;
       File Alteration Monitor - Gamin a FAM replacement&lt;br /&gt;
        http://www.gnome.org/~veillard/gamin/&lt;br /&gt;
        http://www.gnome.org/~veillard/gamin/sources/&lt;br /&gt;
       ******  EXAMPLE NOT COMPLETE *****&lt;br /&gt;
&lt;br /&gt;
       Working with fam  - file alteration monitor.  Mail uses this to signify&lt;br /&gt;
           a change in a file's status.&lt;br /&gt;
&lt;br /&gt;
        Below is the sample C program ftest.c which can be compiled as&lt;br /&gt;
        follows:&lt;br /&gt;
&lt;br /&gt;
              $ gcc -o ftest ftest.c  -lfam&lt;br /&gt;
&lt;br /&gt;
        You will need to work with this as root&lt;br /&gt;
&lt;br /&gt;
              #  ./ftest &amp;lt;somefile absolute path&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Reference:&lt;br /&gt;
            http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?db=man&amp;amp;fname=/usr/share/catman/p_man/cat3x/fam.z&lt;br /&gt;
            http://www.devchannel.org/devtoolschannel/04/05/13/2146252.shtml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 110:&lt;br /&gt;
&lt;br /&gt;
       glibc - this is the main library used by C, and the following&lt;br /&gt;
        link below gives you examples on everything from sockets,math,&lt;br /&gt;
        date and time functions, user environment, and much more.&lt;br /&gt;
&lt;br /&gt;
         http://www.gnu.org/software/libc/manual/html_mono/libc.html&lt;br /&gt;
&lt;br /&gt;
       How do you know which version of glibc you are running?&lt;br /&gt;
&lt;br /&gt;
          #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
          #include &amp;lt;gnu/libc-version.h&amp;gt;&lt;br /&gt;
          int main (void)&lt;br /&gt;
           {&lt;br /&gt;
             puts (gnu_get_libc_version ());&lt;br /&gt;
             return 0;&lt;br /&gt;
           }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 111:&lt;br /&gt;
&lt;br /&gt;
       nslookup and dig - query Internet name servers interactively.&lt;br /&gt;
&lt;br /&gt;
         $ nslookup&lt;br /&gt;
         &amp;gt;chirico.org&lt;br /&gt;
         Server:        68.80.0.6&lt;br /&gt;
         Address:       68.80.0.6#53&lt;br /&gt;
&lt;br /&gt;
         Name: chirico.org&lt;br /&gt;
         Address: 66.35.250.210&lt;br /&gt;
         &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      The nslookup command will query the dns server is &amp;quot;/etc/resolve.conf&amp;quot;&lt;br /&gt;
      However, you can force a certain dns with &amp;quot;- server&amp;quot;.  For example the&lt;br /&gt;
      command below goes to the server named dilbert&lt;br /&gt;
&lt;br /&gt;
         $ nslookup - dilbert&lt;br /&gt;
         &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      dig:&lt;br /&gt;
&lt;br /&gt;
      dig gives you more information. You should probably use dig instead&lt;br /&gt;
      of nslookup.&lt;br /&gt;
&lt;br /&gt;
      Below I am forcing the lookup from DNS 68.80.0.6 of the name chirico.org, and&lt;br /&gt;
      note that the query time is return too.&lt;br /&gt;
&lt;br /&gt;
         $ dig @68.80.0.6  +qr chirico.org&lt;br /&gt;
&lt;br /&gt;
         ; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.2.1 &amp;lt;&amp;lt;&amp;gt;&amp;gt; @68.80.0.6 +qr chirico.org&lt;br /&gt;
         ;; global options:  printcmd&lt;br /&gt;
         ;; Sending:&lt;br /&gt;
         ;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 55908&lt;br /&gt;
         ;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0&lt;br /&gt;
        &lt;br /&gt;
         ;; QUESTION SECTION:&lt;br /&gt;
         ;chirico.org.                   IN      A&lt;br /&gt;
        &lt;br /&gt;
         ;; Got answer:&lt;br /&gt;
         ;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 55908&lt;br /&gt;
         ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
        &lt;br /&gt;
         ;; QUESTION SECTION:&lt;br /&gt;
         ;chirico.org.                   IN      A&lt;br /&gt;
        &lt;br /&gt;
         ;; ANSWER SECTION:&lt;br /&gt;
         chirico.org.            5538    IN      A       66.35.250.210&lt;br /&gt;
        &lt;br /&gt;
         ;; AUTHORITY SECTION:&lt;br /&gt;
         chirico.org.            30599   IN      NS      ns78.worldnic.com.&lt;br /&gt;
         chirico.org.            30599   IN      NS      ns77.worldnic.com.&lt;br /&gt;
        &lt;br /&gt;
         ;; ADDITIONAL SECTION:&lt;br /&gt;
         ns78.worldnic.com.      16022   IN      A       216.168.225.218&lt;br /&gt;
         ns77.worldnic.com.      7       IN      A       216.168.228.41&lt;br /&gt;
        &lt;br /&gt;
         ;; Query time: 155 msec&lt;br /&gt;
         ;; SERVER: 68.80.0.6#53(68.80.0.6)&lt;br /&gt;
         ;; WHEN: Thu Dec 23 07:48:23 2004&lt;br /&gt;
         ;; MSG SIZE  rcvd: 127&lt;br /&gt;
&lt;br /&gt;
      So what if you wanted to know what name the IP address 66.35.250.210&lt;br /&gt;
      resolves to, when using dns 68.80.0.12.&lt;br /&gt;
&lt;br /&gt;
          $ dig @68.80.0.12 -x 66.35.250.210&lt;br /&gt;
          ...&lt;br /&gt;
          ;; ANSWER SECTION:&lt;br /&gt;
          210.250.35.66.in-addr.arpa. 3600 IN   CNAME   210.0/24.250.35.66.in-addr.arpa.&lt;br /&gt;
          210.0/24.250.35.66.in-addr.arpa. 3600 IN PTR  vhost.sourceforge.net.&lt;br /&gt;
&lt;br /&gt;
      Above you can see it resolved to &amp;quot;vhost.sourceforge.net&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      Reference ( http://www.tldp.org/HOWTO/DNS-HOWTO-5.html )&lt;br /&gt;
        Also see TIP 223.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 112:&lt;br /&gt;
&lt;br /&gt;
       Using GNU Autotools - so you can produce the familiar &amp;quot;./configure&amp;quot;  &amp;quot;make&amp;quot;  and &amp;quot;make install&amp;quot;&lt;br /&gt;
                             commands. There is also a &amp;quot;make dist&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                The program sqlite3api.cc and the rest of this code can be found at&lt;br /&gt;
                 http://prdownloads.sourceforge.net/cpearls/autotools.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         A &amp;quot;Makefile.am&amp;quot; is required:&lt;br /&gt;
&lt;br /&gt;
            bin_PROGRAMS = sprog&lt;br /&gt;
            sprog_SOURCES = sqlite3api.cc&lt;br /&gt;
            sprog_LDADD = @INCLUDES@ @SQLIBOBJS@&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         In addition, a &amp;quot;configure.in&amp;quot; file is required. Note, AC_CHECK_LIB will&lt;br /&gt;
         check the &amp;quot;libsqlite3.so&amp;quot; file for the &amp;quot;sqlite3_open&amp;quot; file. Note that&lt;br /&gt;
         &amp;quot;sqlite3&amp;quot;, is a shortcut for &amp;quot;libsqlite3&amp;quot; by convention. If this file&lt;br /&gt;
         is not found, AC_CHECK_FILE looks for &amp;quot;/usr/local/lib/libsqlite3.a&amp;quot;. If&lt;br /&gt;
         this is found, then, &amp;quot;-lsqlite3&amp;quot; is added to the LIBS environment variable.&lt;br /&gt;
         Also, &amp;quot;-I/usr/local/include&amp;quot; and &amp;quot;-L/usr/local/lib&amp;quot; will be added on the&lt;br /&gt;
         command line. This is common when some one does not have the library in&lt;br /&gt;
         the path.  (See TIP 49)&lt;br /&gt;
&lt;br /&gt;
            dnl Process this file with autoconf to produce a configure script.&lt;br /&gt;
            AC_INIT(sqlite3api.cc)&lt;br /&gt;
            AM_INIT_AUTOMAKE(sqliteprog, 1.0)&lt;br /&gt;
            AC_PROG_CXX&lt;br /&gt;
            CXXFLAGS='-Wall -W -O2 -s -pipe'&lt;br /&gt;
            AC_CHECK_LIB(sqlite3,sqlite3_open,[],found=no)&lt;br /&gt;
             if test &amp;quot;$found&amp;quot; = &amp;quot;no&amp;quot;; then&lt;br /&gt;
               AC_CHECK_FILE(/usr/local/lib/libsqlite3.a, found=yes)&lt;br /&gt;
               if test &amp;quot;$found&amp;quot; = &amp;quot;yes&amp;quot;; then&lt;br /&gt;
                 LIBS=&amp;quot;$LIBS -lsqlite3&amp;quot;&lt;br /&gt;
                 INCLUDES=&amp;quot;$INCLUDES -I/usr/local/include&amp;quot;&lt;br /&gt;
                 EXTRALIB='-L/usr/local/lib'&lt;br /&gt;
                else&lt;br /&gt;
                 echo &amp;quot;Are you SURE sqlite3 is installed?&amp;quot;&lt;br /&gt;
               fi&lt;br /&gt;
             fi&lt;br /&gt;
            SQLIBOBJS='-Wl,-R/usr/local/lib'&lt;br /&gt;
            AC_SUBST(INCLUDES)&lt;br /&gt;
            AC_SUBST(SQLIBOBJS)&lt;br /&gt;
            AC_SUBST(EXTRALIB)&lt;br /&gt;
            AC_OUTPUT(Makefile)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         To build the configure file, just run the following:&lt;br /&gt;
&lt;br /&gt;
             $ aclocal&lt;br /&gt;
             $ autoconf&lt;br /&gt;
             $ touch NEWS README AUTHORS ChangeLog&lt;br /&gt;
             $ automake --add-missing&lt;br /&gt;
&lt;br /&gt;
         Now if you want to make a tar.gz file &amp;quot;sqliteprog-1.0.tar.gz&amp;quot;, then&lt;br /&gt;
         all you have to run is the following:&lt;br /&gt;
&lt;br /&gt;
             $ make dist&lt;br /&gt;
&lt;br /&gt;
         Note: did you ever want to save all the output from a ./configure? Well, it&lt;br /&gt;
               is automatically saved in the &amp;quot;config.log&amp;quot; file. In fact, this file may&lt;br /&gt;
               contain a lot more than what you saw on the screen.&lt;br /&gt;
&lt;br /&gt;
               Also, you may need to rerun ./configure. But before you do, delete&lt;br /&gt;
               the &amp;quot;config.cache&amp;quot; file to get a clean build.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 113:&lt;br /&gt;
&lt;br /&gt;
       EMACS - common emacs commands.&lt;br /&gt;
&lt;br /&gt;
         M is the ESC&lt;br /&gt;
         C or c is the Ctl&lt;br /&gt;
&lt;br /&gt;
        Shell - when working in a shell. &amp;quot;M-x rename-uniquely&amp;quot; is good for split screen editing.&lt;br /&gt;
&lt;br /&gt;
          M-x rename-uniquely   Use this for multiple shells (renames buffer so it's not the same shell)&lt;br /&gt;
          C-c C-z               Send job in background (when working in a shell)&lt;br /&gt;
          C-c C-o               commit-kill-output (gets rid of a lot of shell output)&lt;br /&gt;
          C-c C-r               reposition at beginning of output&lt;br /&gt;
          C-c C-e               reposition at end of output&lt;br /&gt;
          M-x send-invisible    Hide passwords - use this before typing a password&lt;br /&gt;
&lt;br /&gt;
         Note: if the shell prompt does not show up correctly, then, you may want to creat a &amp;quot;.emacs_bash&amp;quot;&lt;br /&gt;
               file with the following contents:&lt;br /&gt;
&lt;br /&gt;
                          PS1=&amp;quot;emacs:\W \$ &amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Directories  (C-x d) give you a directory listing. You know all those annoying &amp;quot;~&amp;quot; and &amp;quot;#&amp;quot;&lt;br /&gt;
                     file that you get? You can easily delete these when in &amp;quot;dired&amp;quot; mode by hitting&lt;br /&gt;
                     &amp;quot;~&amp;quot;, then  &amp;quot;d&amp;quot; to flag it for delete. Then, hit &amp;quot;x&amp;quot; to and confirm deletion.&lt;br /&gt;
&lt;br /&gt;
                     These are other command that work on highlighted files in &amp;quot;dired&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
                          R   rename&lt;br /&gt;
                          v   view&lt;br /&gt;
                          Z   compress the file&lt;br /&gt;
                          +   create directory&lt;br /&gt;
&lt;br /&gt;
        Other common commands:&lt;br /&gt;
&lt;br /&gt;
          c-x l          list the line you are on, and how many lines in the document.&lt;br /&gt;
                         You will get something like: Page has 4881 lines (4440 + 442),&lt;br /&gt;
                         which means you are on the 4440 line.&lt;br /&gt;
&lt;br /&gt;
          c-x rm bookmark make&lt;br /&gt;
          c-x rb bookmark bounce&lt;br /&gt;
        &lt;br /&gt;
          c-x rb notes&lt;br /&gt;
          c-x rb emacs&lt;br /&gt;
        &lt;br /&gt;
          c-x / &amp;lt;r&amp;gt; (save position in register &amp;lt;r&amp;gt;)&lt;br /&gt;
          c-x j &amp;lt;r&amp;gt; (jump to position in register &amp;lt;r&amp;gt;)&lt;br /&gt;
          c-x r SPC 1 (mark current point in register 1)&lt;br /&gt;
          c-x r j 1 (jump to marked point in register 1)&lt;br /&gt;
          c-x r t &amp;lt;string&amp;gt;  (insert string into register)&lt;br /&gt;
        &lt;br /&gt;
          c-x r s 1 (save marked region in register 1)&lt;br /&gt;
          c-x r i 1 (insert marked region)&lt;br /&gt;
        &lt;br /&gt;
          c-x c-o (delete all blank lines, except one)&lt;br /&gt;
        &lt;br /&gt;
          c-x z (repeat the last command ... stop with an a)&lt;br /&gt;
          c-x zz (repeat the last command twice)&lt;br /&gt;
&lt;br /&gt;
          rectangle&lt;br /&gt;
          ---------&lt;br /&gt;
          C-SPC&lt;br /&gt;
          goto the next region&lt;br /&gt;
          C-x&lt;br /&gt;
          C-x&lt;br /&gt;
          then, C-x r r &amp;quot;name of register&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
          to insert the register&lt;br /&gt;
          C-x r i &amp;quot;name of register&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
          macros:&lt;br /&gt;
          -------&lt;br /&gt;
          c-x (    start macro&lt;br /&gt;
          c-x )    end macro&lt;br /&gt;
          c-x e    execute macro&lt;br /&gt;
        &lt;br /&gt;
          mail:&lt;br /&gt;
          -----&lt;br /&gt;
          c-x m   mail&lt;br /&gt;
          c-c c-s send&lt;br /&gt;
        &lt;br /&gt;
          C-x C-e&lt;br /&gt;
          (insert &amp;quot;\n\nExtra Line of text&amp;quot;)&lt;br /&gt;
        &lt;br /&gt;
          ;; chirico functions in .emacs&lt;br /&gt;
          ;; This creates an html template&lt;br /&gt;
          (defun my-html ()&lt;br /&gt;
          (interactive)&lt;br /&gt;
          (insert &amp;quot;&amp;lt;html&amp;gt;&lt;br /&gt;
          &amp;lt;head&amp;gt;&lt;br /&gt;
          &amp;lt;META HTTP-EQUIV=\&amp;quot;Pragma\&amp;quot; CONTENT=\&amp;quot;no-cache\&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;META HTTP-EQUIV=\&amp;quot;Expires\&amp;quot; CONTENT=\&amp;quot;-1\&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;/head&amp;gt;&lt;br /&gt;
          &amp;lt;body bgcolor=\&amp;quot;#ffffff\&amp;quot;&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
          &amp;lt;/body&amp;gt;&lt;br /&gt;
          &amp;lt;/html&amp;gt;&amp;quot;)&lt;br /&gt;
          )&lt;br /&gt;
&lt;br /&gt;
     Backspace issues when using &amp;quot;emacs -nw&amp;quot;? They putting the following in your &amp;quot;~/.emacs&amp;quot; file&lt;br /&gt;
&lt;br /&gt;
             (global-set-key &amp;quot;\C-d&amp;quot; 'backward-delete-char)&lt;br /&gt;
             (global-set-key &amp;quot;\C-h&amp;quot; 'backward-delete-char)&lt;br /&gt;
             (global-set-key (kbd &amp;quot;DEL&amp;quot;) 'delete-char)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 114:&lt;br /&gt;
&lt;br /&gt;
        ncftpget - an intelligent ftp client (http://www.ncftp.com/). Also&lt;br /&gt;
                   check your fedora or debian install. This package allows&lt;br /&gt;
                   you to easily download packages from ftp sites.&lt;br /&gt;
&lt;br /&gt;
          This is an example of connect to an ftp site, with a subdirectory, and&lt;br /&gt;
          downloading all in one command.&lt;br /&gt;
&lt;br /&gt;
           $ ncftpget ftp://ftp.gnu.org/pub/gnu/gcc/gcc-3.2.3/gcc-3.2.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
          Of if you want to get the fedora core 3 installs&lt;br /&gt;
&lt;br /&gt;
           $ ncftpget ftp://ftp.linux.ncsu.edu/pub/fedora/linux/core/3/i386/iso/FC3*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 115:&lt;br /&gt;
&lt;br /&gt;
        expr - evaluate expressions. You can use this on the command line&lt;br /&gt;
&lt;br /&gt;
           $ expr 6 + 4&lt;br /&gt;
           10&lt;br /&gt;
&lt;br /&gt;
         Note the spaces. Without spaces, you get the following:&lt;br /&gt;
&lt;br /&gt;
           $ expr 6+4&lt;br /&gt;
           6+4&lt;br /&gt;
&lt;br /&gt;
         If you're using &amp;quot;*&amp;quot;, you'll need a &amp;quot;\&amp;quot; before it&lt;br /&gt;
&lt;br /&gt;
           $ expr 10 \* 10&lt;br /&gt;
           100&lt;br /&gt;
&lt;br /&gt;
         This also works for variables&lt;br /&gt;
&lt;br /&gt;
           $ var1=34&lt;br /&gt;
           $ expr $var1 + 3&lt;br /&gt;
           37&lt;br /&gt;
&lt;br /&gt;
         or&lt;br /&gt;
&lt;br /&gt;
           $ var1=2&lt;br /&gt;
           $ var1=`expr $var1 \* 2`&lt;br /&gt;
           $ echo $var1&lt;br /&gt;
           4&lt;br /&gt;
&lt;br /&gt;
         see (TIP 25) you can get the cosine(.23)&lt;br /&gt;
&lt;br /&gt;
           $ var1=`echo &amp;quot;c(.23)&amp;quot;|bc -l`&lt;br /&gt;
           $ echo $var1&lt;br /&gt;
           .97366639500537483696&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         You can also do substrings:&lt;br /&gt;
&lt;br /&gt;
           $ expr substr &amp;quot;BigBear&amp;quot; 4 4&lt;br /&gt;
           Bear&lt;br /&gt;
&lt;br /&gt;
         And length of strings&lt;br /&gt;
&lt;br /&gt;
           $ mstr=&amp;quot;12345&amp;quot;&lt;br /&gt;
           $ expr length $mstr&lt;br /&gt;
           5&lt;br /&gt;
&lt;br /&gt;
         Regular expressions&lt;br /&gt;
&lt;br /&gt;
           $ expr &amp;quot;a3&amp;quot; : [a-z][1-9]&lt;br /&gt;
           2&lt;br /&gt;
&lt;br /&gt;
         Or you can get a bit fancy&lt;br /&gt;
&lt;br /&gt;
           $ myexpr=&amp;quot;[a-z][1-9]&amp;quot;&lt;br /&gt;
           $ echo $myexpr&lt;br /&gt;
           [a-z][1-9]&lt;br /&gt;
&lt;br /&gt;
           $ expr &amp;quot;a3&amp;quot; : $myexpr&lt;br /&gt;
           2&lt;br /&gt;
&lt;br /&gt;
         This may not be the best way to find out if it is Friday, but&lt;br /&gt;
         it seems to work. It's more of an exercise in xargs.&lt;br /&gt;
&lt;br /&gt;
           $ date&lt;br /&gt;
           Fri Dec 31 16:44:47 EST 2004&lt;br /&gt;
           $ date|xargs -i expr {} : &amp;quot;[Fri]&amp;quot;&lt;br /&gt;
           1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 116:&lt;br /&gt;
&lt;br /&gt;
        eval&lt;br /&gt;
&lt;br /&gt;
           $ mypipe=&amp;quot;|&amp;quot;&lt;br /&gt;
           $ eval ls $mypipe wc&lt;br /&gt;
           6       6     129&lt;br /&gt;
&lt;br /&gt;
        Did you catch that? The above statement is the same as&lt;br /&gt;
&lt;br /&gt;
           $ ls | wc&lt;br /&gt;
&lt;br /&gt;
        Where &amp;quot;|&amp;quot; is put into the variable $mypipe&lt;br /&gt;
&lt;br /&gt;
        (also see TIP 118)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 117:&lt;br /&gt;
&lt;br /&gt;
        lxr, glimpse, patchset - tools for reading the kernel source&lt;br /&gt;
&lt;br /&gt;
          This example puts some of the files in /home/src since my home&lt;br /&gt;
          partition is the largest. Plus, you do not want to over write&lt;br /&gt;
          the source in /usr/src/ If you want to put your files elsewhere&lt;br /&gt;
          just substitute /home/src for your desired directory.&lt;br /&gt;
&lt;br /&gt;
         patchset -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ export SRCDIR=/home/src&lt;br /&gt;
            $ cd $SRCDIR&lt;br /&gt;
            $ wget http://www.csn.ul.ie/~mel/projects/patchset/patchset-0.5.tar.gz&lt;br /&gt;
            $ export PATH=$PATH:$SRCDIR/patchset-0.5/bin&lt;br /&gt;
&lt;br /&gt;
          Now edit &amp;quot;/home/src/patchset-0.5/etc/patchset.conf&amp;quot; and set WWW_USER to&lt;br /&gt;
          whatever your website runs as&lt;br /&gt;
&lt;br /&gt;
                  export WWW_USER=nobody&lt;br /&gt;
&lt;br /&gt;
          Getting kernel source. The last step builds and asks a lot of questions. Enter&lt;br /&gt;
          yes to things that interest you, since this is what you will see in the source&lt;br /&gt;
          code. It is not going to build for booting. The &amp;quot;downlaod -p&amp;quot; is for downloading&lt;br /&gt;
          a patch.&lt;br /&gt;
&lt;br /&gt;
            $ download 2.6.10&lt;br /&gt;
            $ createset 2.6.10&lt;br /&gt;
            $ make-kernel -b 2.6.10&lt;br /&gt;
&lt;br /&gt;
        glimpse -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ mkdir -p /home/src/glimpse&lt;br /&gt;
            $ cd /home/src/glimpse&lt;br /&gt;
            $ wget http://webglimpse.net/trial/glimpse-latest.tar.gz&lt;br /&gt;
            $ tar -xzf glimpse-latest.tar.gz&lt;br /&gt;
            $ cd glimpse-4.18.0&lt;br /&gt;
            $ ./configure; make&lt;br /&gt;
            $ make install&lt;br /&gt;
&lt;br /&gt;
        lxr -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ make -p /home/src/lxr&lt;br /&gt;
            $ cd /home/src/lxr&lt;br /&gt;
            $ wget http://heanet.dl.sourceforge.net/sourceforge/lxr/lxr-0.3.1.tar.gz&lt;br /&gt;
            $ cd lxr-0.3&lt;br /&gt;
&lt;br /&gt;
          Edit &amp;quot;Makefile&amp;quot; and set PERLBIN to &amp;quot;/usr/bin/perl&amp;quot; or the where perl is&lt;br /&gt;
          on your system. Also set INSTALLPREFIX to &amp;quot;/var/www/lxr&amp;quot;.  Then, as root&lt;br /&gt;
          do the following:&lt;br /&gt;
&lt;br /&gt;
            $ make install&lt;br /&gt;
&lt;br /&gt;
         Apache changes&lt;br /&gt;
&lt;br /&gt;
          Next edit the apache httpd.conf. On my system it is&lt;br /&gt;
          &amp;quot;/usr/local/apache2/conf/httpd.conf&amp;quot;, but if you did a fedora install&lt;br /&gt;
          I think this file is located at &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             Alias  /lxr/ &amp;quot;/var/www/lxr/&amp;quot;&lt;br /&gt;
             &amp;lt;Directory &amp;quot;/var/www/lxr/&amp;quot;&amp;gt;&lt;br /&gt;
               Options ExecCGI Indexes Includes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride all&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
&lt;br /&gt;
              &amp;lt;Files ~ (search|source|ident|diff|find)&amp;gt;&lt;br /&gt;
                    SetHandler cgi-script&lt;br /&gt;
              &amp;lt;/Files&amp;gt;&lt;br /&gt;
             &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          lxr - continued &amp;quot;/var/www/lxr/http/lxr.conf&amp;quot; changes.  The following contains&lt;br /&gt;
                my lxr.conf with changes made to almost every variable. Make sure you use&lt;br /&gt;
                your website in place of 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
                 # Configuration file.&lt;br /&gt;
                &lt;br /&gt;
                 # Define typed variable &amp;quot;v&amp;quot;, read valueset from file.&lt;br /&gt;
                 variable: v, Version, [/var/www/lxr/source/versions], [/var/www/lxr/source/defversion]&lt;br /&gt;
                &lt;br /&gt;
                 # Define typed variable &amp;quot;a&amp;quot;.  First value is default.&lt;br /&gt;
                 variable: a, Architecture, (i386, alpha, m68k, mips, ppc, sparc, sparc64)&lt;br /&gt;
                &lt;br /&gt;
                 # Define the base url for the LXR files.&lt;br /&gt;
                 baseurl: http://192.168.1.71/lxr/http/&lt;br /&gt;
                &lt;br /&gt;
                 # These are the templates for the HTML heading, directory listing and&lt;br /&gt;
                 # footer, respectively.&lt;br /&gt;
                 htmlhead: /var/www/lxr/http/template-head&lt;br /&gt;
                 htmltail: /var/www/lxr/http/template-tail&lt;br /&gt;
                 htmldir:  /var/www/lxr/http/template-dir&lt;br /&gt;
                &lt;br /&gt;
                 # The source is here.&lt;br /&gt;
                 sourceroot: /var/www/lxr/source/$v/&lt;br /&gt;
                 srcrootname: Linux&lt;br /&gt;
                &lt;br /&gt;
                 # &amp;quot;#include &amp;lt;foo.h&amp;gt;&amp;quot; is mapped to this directory (in the LXR source&lt;br /&gt;
                 # tree)&lt;br /&gt;
                 incprefix: /include&lt;br /&gt;
                &lt;br /&gt;
                 # The database files go here.&lt;br /&gt;
                 dbdir: /var/www/lxr/source/$v/&lt;br /&gt;
                &lt;br /&gt;
                 # Glimpse can be found here.&lt;br /&gt;
                 glimpsebin: /usr/local/bin/glimpse&lt;br /&gt;
                &lt;br /&gt;
                 # The power of regexps.  This is pretty Linux-specific, but quite&lt;br /&gt;
                 # useful.  Tinker with it and see what it does.  (How's that for&lt;br /&gt;
                 # documentation?)&lt;br /&gt;
                 map: /include/asm[^\/]*/ /include/asm-$a/&lt;br /&gt;
                 map: /arch/[^\/]+/ /arch/$a/&lt;br /&gt;
&lt;br /&gt;
         Now you should be ready to run &amp;quot;make-lxr&amp;quot;. Make sure the path is setup to patchset,&lt;br /&gt;
         which is repeated here. The last step take awhile.&lt;br /&gt;
&lt;br /&gt;
            $ export SRCDIR=/home/src&lt;br /&gt;
            $ cd $SRCDIR&lt;br /&gt;
            $ export PATH=$PATH:$SRCDIR/patchset-0.5/bin&lt;br /&gt;
&lt;br /&gt;
            $  make-lxr 2.6.10&lt;br /&gt;
&lt;br /&gt;
         Now you need to index the source. Below the ./glimpse_* file will be put in&lt;br /&gt;
         root. Checkout the -H option if you do not want them here on a temporary&lt;br /&gt;
         bases of if you run out of room.&lt;br /&gt;
&lt;br /&gt;
            $ glimpseindex -o -t -w 5000 /var/www/lxr/source/2.6.10 &amp;gt;&amp;amp; .glimpse_out&lt;br /&gt;
&lt;br /&gt;
         Since the above put the files under /root/.glimpse_* they should be moved&lt;br /&gt;
&lt;br /&gt;
            $ mv /root/.glimps_* /var/www/lxr/source/2.6.10/.&lt;br /&gt;
            $ chown -R nobody.nobody ./.glimpse_*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 118:&lt;br /&gt;
&lt;br /&gt;
        exec - you can change standard output and input without starting a new&lt;br /&gt;
               process.&lt;br /&gt;
&lt;br /&gt;
          The exec redirect the output from ls and date to a file. Nothing&lt;br /&gt;
          is show on the terminal until &amp;quot;exec &amp;gt; /dev/tty&amp;quot; is performed&lt;br /&gt;
&lt;br /&gt;
            $ exec &amp;gt; mfile&lt;br /&gt;
            $ ls&lt;br /&gt;
            $ date&lt;br /&gt;
            $ exec &amp;gt; /dev/tty&lt;br /&gt;
&lt;br /&gt;
          This is an example of assigning file descriptor 3 to file &amp;quot;output3&amp;quot; for&lt;br /&gt;
          output, then, redirecting &amp;quot;ls&amp;quot; to this descriptor. Finally, file descriptor&lt;br /&gt;
          3 is used for input, and the contents are read into the cat command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
            $ exec 3&amp;gt;output3&lt;br /&gt;
            $ ls  &amp;gt;&amp;amp; 3&lt;br /&gt;
            $ exec 3&amp;lt;output3&lt;br /&gt;
            $ cat &amp;lt;&amp;amp;3&lt;br /&gt;
            ChangeLog&lt;br /&gt;
            CVS&lt;br /&gt;
            How_to_Linux_and_Open_Source.txt&lt;br /&gt;
            How_to_Linux_and_Open_Source.txt.~1.193.~&lt;br /&gt;
            mfile&lt;br /&gt;
            mfile2&lt;br /&gt;
            mfile3&lt;br /&gt;
            mftp&lt;br /&gt;
            output3&lt;br /&gt;
&lt;br /&gt;
        Could you redirect the output to 3 files and stderr?&lt;br /&gt;
&lt;br /&gt;
            $ exec 3&amp;gt;output3&lt;br /&gt;
            $ exec 4&amp;gt;output4&lt;br /&gt;
            $ exec 5&amp;gt;output5&lt;br /&gt;
&lt;br /&gt;
            $ ls &amp;gt;&amp;amp; 3 &amp;gt;&amp;amp; 4 &amp;gt;&amp;amp; 5 &amp;gt;&amp;amp; 2   // Nope, can't do this.&lt;br /&gt;
            output3  output4  output5&lt;br /&gt;
&lt;br /&gt;
         Instead, you should do the following:&lt;br /&gt;
&lt;br /&gt;
            $ ls | tee output3 | tee output4 |tee output5&lt;br /&gt;
&lt;br /&gt;
         Closing the &amp;quot;output&amp;quot; file descriptor&lt;br /&gt;
&lt;br /&gt;
            $ &amp;gt;&amp;amp;3-&lt;br /&gt;
&lt;br /&gt;
         Closing the &amp;quot;input&amp;quot; file descriptor&lt;br /&gt;
&lt;br /&gt;
            $ 3&amp;lt;&amp;amp;-&lt;br /&gt;
&lt;br /&gt;
         See what is still open on 0-10&lt;br /&gt;
&lt;br /&gt;
            $ lsof -a -p $$ -d 0-10&lt;br /&gt;
&lt;br /&gt;
         Recursion - the following counts to 5, then, quits.&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
            sleep 1&lt;br /&gt;
            declare -x n&lt;br /&gt;
            let n=${n:=0}+1&lt;br /&gt;
            [ $n -le 5 ] &amp;amp;&amp;amp; echo &amp;quot;$n&amp;quot; &amp;amp;&amp;amp;  exec $0&lt;br /&gt;
&lt;br /&gt;
         There are some real-life applications for this technique, as follows:&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
            declare -x N&lt;br /&gt;
            declare -x n&lt;br /&gt;
            N=${N:=$(od -vAn -N1 -tu4 &amp;lt; /dev/urandom)}&lt;br /&gt;
            let n=${n:=0}+1&lt;br /&gt;
            [ $(($n%2)) -eq 0 ] &amp;amp;&amp;amp; echo &amp;quot;She Loves Me!&amp;quot; || echo &amp;quot;She Loves Me NOT!&amp;quot;&lt;br /&gt;
            [ $n -lt $N ] &amp;amp;&amp;amp;  exec $0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 119:&lt;br /&gt;
&lt;br /&gt;
        runlevel - need to know the current runlevel?&lt;br /&gt;
&lt;br /&gt;
           $ who -r&lt;br /&gt;
           run-level 3  Dec 31 19:02                   last=S&lt;br /&gt;
&lt;br /&gt;
        Need to know the architecture?&lt;br /&gt;
&lt;br /&gt;
          $ arch&lt;br /&gt;
          i686&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 120:&lt;br /&gt;
&lt;br /&gt;
        at - executes commands at a specified time.&lt;br /&gt;
&lt;br /&gt;
         A few examples here. The 1970 program will run&lt;br /&gt;
         next Auguest 2 even though the year 1970 has long past.&lt;br /&gt;
&lt;br /&gt;
          $ at 6:30am Jan 12 &amp;lt; program&lt;br /&gt;
          $ at noon tomorrow &amp;lt; program&lt;br /&gt;
          $ at 1970 pm August 2 &amp;lt; program&lt;br /&gt;
&lt;br /&gt;
        This is an interactive way to use the command:&lt;br /&gt;
&lt;br /&gt;
          $ at now + 6 minutes&lt;br /&gt;
          warning: commands will be executed using (in order) a) $SHELL b) login shell c) /bin/sh&lt;br /&gt;
          at&amp;gt; ls&lt;br /&gt;
          at&amp;gt; date &amp;gt; /tmp/5min&lt;br /&gt;
          at&amp;gt; ^D&lt;br /&gt;
          job 3 at 2005-01-01 08:50&lt;br /&gt;
&lt;br /&gt;
        What jobs are in the queue?&lt;br /&gt;
&lt;br /&gt;
          $ atq&lt;br /&gt;
&lt;br /&gt;
        or&lt;br /&gt;
&lt;br /&gt;
          $ at -l&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 121:&lt;br /&gt;
&lt;br /&gt;
        Creating a Manpage&lt;br /&gt;
&lt;br /&gt;
         As root you can copy the following to /usr/local/man/man1/soup.1 which will&lt;br /&gt;
         give you a manpage for soup.&lt;br /&gt;
&lt;br /&gt;
              .\&amp;quot; Manpage for souptonuts.&lt;br /&gt;
              .\&amp;quot; Contact mchirico@users.sourceforge.com to correct errors or omissions.&lt;br /&gt;
              .TH man 1 &amp;quot;04 January 2005&amp;quot; &amp;quot;1.0&amp;quot; &amp;quot;souptonuts man page&amp;quot;&lt;br /&gt;
              .SH NAME&lt;br /&gt;
              soup \- man page for souptonuts&lt;br /&gt;
              .SH SYNOPSIS&lt;br /&gt;
              soup&lt;br /&gt;
              .SH DESCRIPTION&lt;br /&gt;
              souptonuts is a collection of linux and open&lt;br /&gt;
              source tips.&lt;br /&gt;
              off for golf.&lt;br /&gt;
              .SH OPTIONS&lt;br /&gt;
              The souptonuts does not take any options.&lt;br /&gt;
              .SH SEE ALSO&lt;br /&gt;
              doughnut(1), golf(8)&lt;br /&gt;
              .SH BUGS&lt;br /&gt;
              No known bugs at this time.&lt;br /&gt;
              .SH AUTHOR&lt;br /&gt;
              Mike Chirico (mchirico@comcast.net mchirico@users.sourceforge.net)&lt;br /&gt;
&lt;br /&gt;
         So, to view this man page&lt;br /&gt;
&lt;br /&gt;
            $ man soup&lt;br /&gt;
&lt;br /&gt;
         It's also possible to compress&lt;br /&gt;
&lt;br /&gt;
            $ gzip /usr/local/man/man1/soup.1&lt;br /&gt;
&lt;br /&gt;
         For plenty of examples look at the other man pages. Also the following&lt;br /&gt;
         is helpful. The last one is a tutorial &amp;quot;man 7 mdoc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            $ man manpath&lt;br /&gt;
            $ man groff&lt;br /&gt;
            $ man 7 mdoc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 122:&lt;br /&gt;
&lt;br /&gt;
        dmesg - print out boot messages, or what is in the kernel ring buffer.&lt;br /&gt;
&lt;br /&gt;
          If you missed the messages on boot-up, you can use dmesg to print them.&lt;br /&gt;
&lt;br /&gt;
            $ dmesg &amp;gt; boot.msg&lt;br /&gt;
&lt;br /&gt;
          Or to print, then, clear the ring&lt;br /&gt;
&lt;br /&gt;
            # dmesg -c &amp;gt; boot.msg&lt;br /&gt;
&lt;br /&gt;
          (also see TIP 20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 123:&lt;br /&gt;
&lt;br /&gt;
        gnus - emacs email nntp news reader (comcast as example with NO TLS or SSL)&lt;br /&gt;
&lt;br /&gt;
          First check that you can connect to the news group:&lt;br /&gt;
&lt;br /&gt;
                 $ telnet newsgroups.comcast.net 119&lt;br /&gt;
                 Trying 216.196.97.136...&lt;br /&gt;
                 Connected to newsgroups.comcast.net.&lt;br /&gt;
                 Escape character is '^]'.&lt;br /&gt;
                 200 News.GigaNews.Com&lt;br /&gt;
&lt;br /&gt;
          If you want to check for TLS or SSL see (TIP 54).&lt;br /&gt;
&lt;br /&gt;
          Here is a very simple configuration example without encryption. It&lt;br /&gt;
          appears that comcast does not support ssl or TLS.&lt;br /&gt;
&lt;br /&gt;
          In the &amp;quot;~/.emacs&amp;quot; file you would add the following to get comcast&lt;br /&gt;
          news groups&lt;br /&gt;
&lt;br /&gt;
             (setq gnus-select-method '(nntp &amp;quot;newsgroups.comcast.net&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
          Then, create an &amp;quot;~/.authinfo&amp;quot; file with the following settings using&lt;br /&gt;
          you own username and password.&lt;br /&gt;
&lt;br /&gt;
             machine newsgroups.comcast.net login borkey@comcast.net  password borkeypass0rd&lt;br /&gt;
&lt;br /&gt;
          Next create a &amp;quot;~/.newsrc&amp;quot; with your groups&lt;br /&gt;
&lt;br /&gt;
             news.announce.newusers:&lt;br /&gt;
             comp.lang.c++.moderated! 1-500&lt;br /&gt;
             comp.unix.programmer! 1-500&lt;br /&gt;
             comp.unix.shell! 1-500&lt;br /&gt;
             gnu.emacs.gnus! 1-500&lt;br /&gt;
&lt;br /&gt;
          Finally, create a &amp;quot;~/.gnus&amp;quot; with the following email settings for you&lt;br /&gt;
&lt;br /&gt;
             (setq user-mail-address &amp;quot;mchirico@comcast.net&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
             (defun my-message-mode-setup ()&lt;br /&gt;
               (setq fill-column 72)&lt;br /&gt;
               (turn-on-auto-fill))&lt;br /&gt;
               (add-hook 'message-mode-hook 'my-message-mode-setup)&lt;br /&gt;
&lt;br /&gt;
          To get into gnus&lt;br /&gt;
&lt;br /&gt;
              E-x gnus&lt;br /&gt;
&lt;br /&gt;
          The following are common gnus commands&lt;br /&gt;
&lt;br /&gt;
                RET  view the article under the cursor&lt;br /&gt;
&lt;br /&gt;
                A A (shift-a, shift a): List all newsgroups known&lt;br /&gt;
                                        to the server.&lt;br /&gt;
&lt;br /&gt;
                l (lower-case L)      : List only  subscribed groups&lt;br /&gt;
                                        with unread articles.&lt;br /&gt;
&lt;br /&gt;
                L                     : List all newsgroups in .newsrc file.&lt;br /&gt;
&lt;br /&gt;
                g                     : See if new articles have arrived.&lt;br /&gt;
&lt;br /&gt;
            Some commands for reading&lt;br /&gt;
&lt;br /&gt;
                n  next unread article&lt;br /&gt;
&lt;br /&gt;
                p  previous article&lt;br /&gt;
&lt;br /&gt;
                SPC  scroll down  moves to next unread&lt;br /&gt;
                     when at the bottom of the article&lt;br /&gt;
&lt;br /&gt;
                del  scroll up&lt;br /&gt;
&lt;br /&gt;
                F  follow-up to group on the article you are&lt;br /&gt;
                   reading now.&lt;br /&gt;
&lt;br /&gt;
                f  follow-up to group without citing the article&lt;br /&gt;
&lt;br /&gt;
                R  reply by mail and cite the article&lt;br /&gt;
&lt;br /&gt;
                r  reply by mail without citing the article&lt;br /&gt;
&lt;br /&gt;
                m  new mail&lt;br /&gt;
&lt;br /&gt;
                a  new posting&lt;br /&gt;
&lt;br /&gt;
                c  Catchup&lt;br /&gt;
&lt;br /&gt;
                C-u / t  Show only young headers&lt;br /&gt;
                         / t without C-u limits the summary&lt;br /&gt;
                         to old headers&lt;br /&gt;
&lt;br /&gt;
                T T  toggle threading&lt;br /&gt;
&lt;br /&gt;
                C-u g  Display raw article&lt;br /&gt;
                       hit g to return to normal view&lt;br /&gt;
&lt;br /&gt;
                t  Show all headers  it's a toggle&lt;br /&gt;
&lt;br /&gt;
                W w  Wordwrap the current article&lt;br /&gt;
&lt;br /&gt;
                W r  Decode ROT13  a toggle&lt;br /&gt;
&lt;br /&gt;
                ^  fetch parent of article&lt;br /&gt;
&lt;br /&gt;
                L  create a scorefile-entry based&lt;br /&gt;
                   on the current article (low score)&lt;br /&gt;
                   ? gives you information what each char means&lt;br /&gt;
&lt;br /&gt;
                I  like L but high score&lt;br /&gt;
&lt;br /&gt;
          Commands to send email&lt;br /&gt;
&lt;br /&gt;
            C-c C-c  send message&lt;br /&gt;
&lt;br /&gt;
            C-c C-d  save message as draft&lt;br /&gt;
&lt;br /&gt;
            C-c C-k  kill message&lt;br /&gt;
&lt;br /&gt;
            C-c C-m f  attach file&lt;br /&gt;
&lt;br /&gt;
            M-q  reformat paragraph&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 124:&lt;br /&gt;
&lt;br /&gt;
        Sending Email from telnet&lt;br /&gt;
&lt;br /&gt;
           Note, if you are on the computer you can sometime use the local loopback.&lt;br /&gt;
           In fact, sometimes you can only use the local loop back 127.0.0.1 in&lt;br /&gt;
           place of &amp;quot;bozo.company.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            1     [mchirico@soup Notes]$ telnet bozo.company.com 25&lt;br /&gt;
            2     Trying 192.168.0.204...&lt;br /&gt;
            3     Connected to bozo.company.com.&lt;br /&gt;
            4     Escape character is '^]'.&lt;br /&gt;
            5     220 bozo.company.com ESMTP Postfix (Postfix-20010228-pl03) (Mandrake Linux)&lt;br /&gt;
            6     HELO fakedomain.com&lt;br /&gt;
            7     HELO fakedomain.com         // server echo&lt;br /&gt;
            8     250 bozo.company.com&lt;br /&gt;
            9     MAIL FROM: test@fakedomain.com&lt;br /&gt;
           10     MAIL FROM: test@fakedomain.com   // server echo&lt;br /&gt;
           11     250 Ok&lt;br /&gt;
           12     RCPT TO: mchirico@someother.com&lt;br /&gt;
           13     RCPT TO: mchirico@someother.com   // server echo&lt;br /&gt;
           14     250 Ok&lt;br /&gt;
           15     DATA&lt;br /&gt;
           16     DATA    // echo&lt;br /&gt;
           17     354 Enter mail, end with &amp;quot;.&amp;quot; on a line by itself&lt;br /&gt;
           18     This is a test message&lt;br /&gt;
           19     This is a test message&lt;br /&gt;
           20     to send&lt;br /&gt;
           21     to send&lt;br /&gt;
           22     .&lt;br /&gt;
           23     250 2.0.0 j0B0uH3L018469 Message accepted for delivery&lt;br /&gt;
&lt;br /&gt;
          Above on line 6 you can type in any domain name. Line 7 is an echo. All&lt;br /&gt;
          echos are listed in the comment field.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 125:&lt;br /&gt;
&lt;br /&gt;
          IP forwarding, IP Masquerade&lt;br /&gt;
&lt;br /&gt;
             # echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
             # ipchains -F forward&lt;br /&gt;
             # ipchains -P forward DENY&lt;br /&gt;
             # ipchains -A forward -s 192.168.0.0/24 -j MASQ&lt;br /&gt;
             # ipchains -A forward -i eth1 -j MASQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          This assumes that your internal network is 192.168.0.0 on eth1, and the&lt;br /&gt;
          internet is connected to eth0.&lt;br /&gt;
&lt;br /&gt;
          (Also See TIP 182)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 126:&lt;br /&gt;
&lt;br /&gt;
         Setting KDE as the default desktop manager&lt;br /&gt;
&lt;br /&gt;
               Edit &amp;quot;/etc/sysconfig/desktop&amp;quot; to include the two lines:&lt;br /&gt;
&lt;br /&gt;
                 DESKTOP=&amp;quot;KDE&amp;quot;&lt;br /&gt;
                 DISPLAYMANAGER=&amp;quot;KDE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 127:&lt;br /&gt;
&lt;br /&gt;
        Have a file and you do not know whay type it is (tar, gz, ASCII, binary) ?&lt;br /&gt;
        Use the file command.  Below it is used on the file &amp;quot;mftp&amp;quot;&lt;br /&gt;
&lt;br /&gt;
               $ file mftp&lt;br /&gt;
               mftp: Bourne-Again shell script text executable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 128:&lt;br /&gt;
&lt;br /&gt;
        Software RAID: Two good references&lt;br /&gt;
&lt;br /&gt;
          http://www.tldp.org/HOWTO/Software-RAID-HOWTO-1.html&lt;br /&gt;
          http://lists.us.dell.com/pipermail/linux-poweredge/2003-July/014331.html&lt;br /&gt;
&lt;br /&gt;
        Note, you must setup grub for each RAID 1 device. Suppose you have&lt;br /&gt;
        2 SCSI drives (sda and sdb). By default grub is setup on sda; but, you&lt;br /&gt;
        need to enable it for sdb (/dev/hdb for ide) as follows:&lt;br /&gt;
&lt;br /&gt;
           grub&amp;gt;device (hd0) /dev/sdb&lt;br /&gt;
           grub&amp;gt;root (hd0,0)&lt;br /&gt;
           grub&amp;gt;setup (hd0)&lt;br /&gt;
&lt;br /&gt;
           Checking if &amp;quot;/boot/grub/stage1&amp;quot; exists... no&lt;br /&gt;
           Checking if &amp;quot;/grub/stage1&amp;quot; exists... yes&lt;br /&gt;
           Checking if &amp;quot;/grub/stage2&amp;quot; exists... yes&lt;br /&gt;
           Checking if &amp;quot;/grub/e2fs_stage1_5&amp;quot; exists.. yes&lt;br /&gt;
           Running &amp;quot;embed /grub/e2fs_stage1_5 (hd0)&amp;quot;... 16 sectors are embedded.&lt;br /&gt;
          succeeded&lt;br /&gt;
           Running &amp;quot;install /grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/grub/stage2 /grub/grub&lt;br /&gt;
         .conf&amp;quot;... succeeded.&lt;br /&gt;
         Done.&lt;br /&gt;
&lt;br /&gt;
          grub&amp;gt;&lt;br /&gt;
          grub&amp;gt;quit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Checking to see if everything is working:&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
        Checking the drives&lt;br /&gt;
&lt;br /&gt;
          $ sfdisk -d /dev/sdb&lt;br /&gt;
          $ sfdisk -d /dev/sda&lt;br /&gt;
&lt;br /&gt;
          $ fdisk -l /dev/sda  &amp;quot;This will give general information&amp;quot;&lt;br /&gt;
          $ fdisk -l           &amp;quot;General information for all drives&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Adding raid (assume you want to add the first drive &amp;quot;sda1&amp;quot;, or if it is the second&lt;br /&gt;
                    drive then substitute &amp;quot;sda2&amp;quot; below )&lt;br /&gt;
&lt;br /&gt;
          $ raidhotadd /dev/md0 /dev/sda1&lt;br /&gt;
          $ raidhotadd /dev/md1 /dev/sda2&lt;br /&gt;
          $ raidhotadd /dev/md2 /dev/sda3&lt;br /&gt;
&lt;br /&gt;
        This is an example of an cat /proc/mdstat that is working. Note that&lt;br /&gt;
        there is a listing for both sda1[0] and sdb1[1]&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
                Personalities : [raid1]&lt;br /&gt;
                read_ahead 1024 sectors&lt;br /&gt;
                Event: 12&lt;br /&gt;
                md0 : active raid1 sda1[0] sdb1[1]&lt;br /&gt;
                      104320 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md1 : active raid1 sda2[0] sdb2[1]&lt;br /&gt;
                      1044160 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md2 : active raid1 sda3[0] sdb3[1]&lt;br /&gt;
                      34411136 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        Compare that to this where md2 is missing sdb3&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
                Personalities : [raid1]&lt;br /&gt;
                read_ahead 1024 sectors&lt;br /&gt;
                Event: 9&lt;br /&gt;
                md0 : active raid1 sda1[0] sdb1[1]&lt;br /&gt;
                      104320 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md1 : active raid1 sda2[0] sdb2[1]&lt;br /&gt;
                      1044160 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md2 : active raid1 sdb3[1]        &amp;lt;---- HERE&lt;br /&gt;
                      34411136 blocks [2/1] [_U]&lt;br /&gt;
&lt;br /&gt;
                unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        If you are rebuilding an array, you can watch it by doing the following:&lt;br /&gt;
&lt;br /&gt;
           $ watch -n1 cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
        Need to know the raid setup?&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/raidtab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 129:&lt;br /&gt;
&lt;br /&gt;
        Resetting Redhat Linux Passwords using GRUB&lt;br /&gt;
&lt;br /&gt;
           1. Press 'e'&lt;br /&gt;
           2. Press 'e' again&lt;br /&gt;
           3. Append 'single' to the kernel version listing&lt;br /&gt;
&lt;br /&gt;
          See&lt;br /&gt;
             http://linuxgazette.net/107/tomar.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 130:&lt;br /&gt;
&lt;br /&gt;
        mtr - matt's traceroute. This is an advanced traceroute that keeps&lt;br /&gt;
              [http://www.bitwizard.nl/mtr/]&lt;br /&gt;
                  $ mtr www.yahoo.com&lt;br /&gt;
&lt;br /&gt;
                                              Matt's traceroute  [v0.52]&lt;br /&gt;
                     third-fl-71.localdomain                            Thu Jan 20 11:05:57 2005&lt;br /&gt;
                     Keys:  D - Display mode    R - Restart statistics    Q - Quit&lt;br /&gt;
                                                            Packets               Pings&lt;br /&gt;
                     Hostname                            %Loss  Rcv  Snt  Last Best  Avg  Worst&lt;br /&gt;
                      1. 192.168.1.1                        0%    3    3     0    0    0      1&lt;br /&gt;
                      2. ???&lt;br /&gt;
                      3. fe-2-6-rr01.willogrove5.pa.pa01    0%    3    3     8    7    7      8&lt;br /&gt;
                      4. srp-8-1-ar01.willowgrove1.pa.pa    0%    2    2     8    8    8      8&lt;br /&gt;
                      5. pos7-3-cr01.torresdale.pa.core.    0%    2    2     8    8    8      8&lt;br /&gt;
                      6. 12.119.53.53                       0%    2    2    12   12   12     13&lt;br /&gt;
                      7. tbr1-p012401.phlpa.ip.att.net      0%    2    2    12   12   13     13&lt;br /&gt;
                      8. tbr1-cl8.n54ny.ip.att.net          0%    2    2    13   13   13     13&lt;br /&gt;
                      9. ggr2-p310.n54ny.ip.att.net         0%    2    2    12   12   13     14&lt;br /&gt;
                     10. so-1-0-0.gar4.NewYork1.Level3.n    0%    2    2    14   14   37     61&lt;br /&gt;
                     11. ae-1-54.bbr2.NewYork1.Level3.ne    0%    2    2    13   12   13     13&lt;br /&gt;
                     12. ge-0-3-0.bbr2.Washington1.Level    0%    2    2    19   19   19     19&lt;br /&gt;
                     13. ge-1-1-51.car1.Washington1.Leve    0%    2    2    18   18   19     20&lt;br /&gt;
                     14. 4.79.228.6                         0%    2    2    21   19   20     21&lt;br /&gt;
                     15. UNKNOWN-216-109-120-201.yahoo.c    0%    2    2    21   20   20     21&lt;br /&gt;
                     16. w2.rc.vip.dcn.yahoo.com            0%    2    2    23   21   22     23&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 131:&lt;br /&gt;
&lt;br /&gt;
        chfn - change finger information&lt;br /&gt;
&lt;br /&gt;
            $ chfn&lt;br /&gt;
&lt;br /&gt;
          Next you are asked for a password and user information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 132:&lt;br /&gt;
&lt;br /&gt;
        chsh - change login shell&lt;br /&gt;
&lt;br /&gt;
          First, you may want to get a listing of all the possible&lt;br /&gt;
          shells.&lt;br /&gt;
&lt;br /&gt;
             $ chsh -l&lt;br /&gt;
&lt;br /&gt;
               /bin/sh&lt;br /&gt;
               /bin/bash&lt;br /&gt;
               /sbin/nologin&lt;br /&gt;
               /bin/ash&lt;br /&gt;
               /bin/bsh&lt;br /&gt;
               /bin/ksh&lt;br /&gt;
               /usr/bin/ksh&lt;br /&gt;
               /usr/bin/pdksh&lt;br /&gt;
               /bin/tcsh&lt;br /&gt;
               /bin/csh&lt;br /&gt;
               /bin/zsh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 133:&lt;br /&gt;
&lt;br /&gt;
        bash - working with binary, hex and base 3.&lt;br /&gt;
&lt;br /&gt;
         For the variable must be declare as an integer. Then&lt;br /&gt;
         specify the  &amp;lt;base&amp;gt;#&amp;lt;value&amp;gt;. The example below is 22 in&lt;br /&gt;
         base 3.&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n&lt;br /&gt;
              $ n=3#22&lt;br /&gt;
              $ echo $n&lt;br /&gt;
                8&lt;br /&gt;
&lt;br /&gt;
           Base 16 (hex)&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n2&lt;br /&gt;
              $ n2=16#a&lt;br /&gt;
              $ echo $n2&lt;br /&gt;
                10&lt;br /&gt;
&lt;br /&gt;
           Base 8 (octal)&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n3&lt;br /&gt;
              $ n3=8#11&lt;br /&gt;
              $ echo $n3&lt;br /&gt;
                9   Note 8+1=9&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 134:&lt;br /&gt;
&lt;br /&gt;
        monitoring IP traffic. Try iptraf http://iptraf.seul.org/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 135:&lt;br /&gt;
&lt;br /&gt;
        enscript - convert text files to PostScript&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 136:&lt;br /&gt;
&lt;br /&gt;
        dd and tar - blocking factor. How to determine the blocking factor, block size&lt;br /&gt;
                   so that tar and dd can work together.&lt;br /&gt;
&lt;br /&gt;
        Step 1: Create a large file on local disk, in a directory &amp;quot;1&amp;quot; that will eventually&lt;br /&gt;
                be written to tape. This will be created with dd as follows:&lt;br /&gt;
&lt;br /&gt;
                $ mkdir 1&lt;br /&gt;
                $ dd if=/dev/zero of=disk-image count=40960&lt;br /&gt;
                  40960+0 records in&lt;br /&gt;
                  40960+0 records out&lt;br /&gt;
&lt;br /&gt;
                $ cd ..&lt;br /&gt;
&lt;br /&gt;
        Step 2: tar the directory and contents to tape. First rewind the tape. These examples&lt;br /&gt;
                use /dev/nst0 as the location of the tape. Make sure to substitute your values&lt;br /&gt;
                if needed.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ tar --label=&amp;quot;Test 1&amp;quot; --create --blocking-factor=128 --file=/dev/nst0 1&lt;br /&gt;
&lt;br /&gt;
        Step 3: Read data from the tape using a block size of 128k. If you get an I/O error, which&lt;br /&gt;
                could happend if you used a different blocking factor above, then, you may need&lt;br /&gt;
                to increase the bs to 256, or 512 etc. as needed.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=/dev/nst0 bs=128k of=testblocksz count=1&lt;br /&gt;
                 0+1 records in&lt;br /&gt;
                 0+1 records out&lt;br /&gt;
&lt;br /&gt;
                $ ls -l testblocksz&lt;br /&gt;
                 -rw-r--r--    1 root     root        65536 Feb  9 10:41 testblocksz&lt;br /&gt;
&lt;br /&gt;
                $ ls -lh testblocksz&lt;br /&gt;
                 -rw-r--r--    1 root     root          64k Feb  9 10:41 testblocksz&lt;br /&gt;
&lt;br /&gt;
               Note above that the size 65536 is equal to 64k. That &amp;quot;h&amp;quot; switch in &amp;quot;ls&amp;quot; is for&lt;br /&gt;
               human readable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 4: tar uses a multiplier of 512*blocking-factor to get block size. Again&lt;br /&gt;
&lt;br /&gt;
                 512 * blocking-factor = block size used in dd command.&lt;br /&gt;
&lt;br /&gt;
              Putting in the values, we see that&lt;br /&gt;
&lt;br /&gt;
                 512 * 128 = 65536&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 5: So what does this tell you? You can now use these numbers to &amp;quot;dd&amp;quot; files&lt;br /&gt;
              to tape. But, first tar will be used to create the file locally.&lt;br /&gt;
&lt;br /&gt;
                $ tar --label=&amp;quot;Test 1&amp;quot; --create --blocking-factor=128 --file=test.tar 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 6: Send this to tape with the dd command. Remember 64k is equal to 65536.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=test.tar bs=64k of=/dev/nst0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 7: Now test that it can be read with tar command using blocking-factor=128.&lt;br /&gt;
             Note the &amp;quot;t&amp;quot; command in tar is for tell. It will not write data.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ tar -tvf /dev/nst0 --blocking-factor=128&lt;br /&gt;
                 V--------- 0/0               0 2005-02-09 10:38:20 Test 1--Volume Header--&lt;br /&gt;
                 drwxr-xr-x root/root         0 2005-02-09 10:34:10 1/&lt;br /&gt;
                 -rw-r--r-- root/root  20971520 2005-02-09 10:34:11 1/disk-image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 8: Reading tape data with dd. Most of the time a high &amp;quot;ibs&amp;quot; input block size&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=/dev/nst0 of=outfromdd.tar ibs=64k&lt;br /&gt;
                 321+0 records in&lt;br /&gt;
                 41088+0 records out&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 9: Verify that outfromdd.tar can be read by tar with blocking-factor=128&lt;br /&gt;
&lt;br /&gt;
                $ tar -tvf outfromdd.tar --blocking-factor=128&lt;br /&gt;
                 V--------- 0/0               0 2005-02-09 10:38:20 Test 1--Volume Header--&lt;br /&gt;
                 drwxr-xr-x root/root         0 2005-02-09 10:34:10 1/&lt;br /&gt;
                 -rw-r--r-- root/root  20971520 2005-02-09 10:34:11 1/disk-image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       PULLING FILES:  The dd command can be used to pull files.&lt;br /&gt;
&lt;br /&gt;
              ssh target_address dd if=remotefile | dd of=localfile&lt;br /&gt;
&lt;br /&gt;
           Or, a specific example of getting a file from a computer called hamlet.&lt;br /&gt;
&lt;br /&gt;
              $ ssh root@hamlet  dd if=/home/cvs/test | dd of=/home/storage/test&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        GOING BACKWARD AND FORWARD ON TAPE:&lt;br /&gt;
&lt;br /&gt;
             Go to end of data&lt;br /&gt;
              $ mt -f /dev/nst0  eod&lt;br /&gt;
&lt;br /&gt;
             Previous record&lt;br /&gt;
              $ mt -f /dev/nst0  bsfm 1&lt;br /&gt;
&lt;br /&gt;
             Forward record&lt;br /&gt;
              $ mt -f /dev/nst0  fsf 1&lt;br /&gt;
&lt;br /&gt;
             Rewind&lt;br /&gt;
              $ mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
             Tell&lt;br /&gt;
              $ mt -f /dev/nst0 tell&lt;br /&gt;
&lt;br /&gt;
         (Reference TIP 151 - for how to get around firewalls)&lt;br /&gt;
&lt;br /&gt;
         Below is a script that I use to backup computers via ssh. The&lt;br /&gt;
         tape drive is on &amp;quot;nis&amp;quot; and the extra space is on &amp;quot;hamlet&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                #!/bin/bash&lt;br /&gt;
                # Program to backup server remotely&lt;br /&gt;
                # Assume remote server is nis, you are on squeezel&lt;br /&gt;
                #&lt;br /&gt;
                # Recover from tape&lt;br /&gt;
                #&lt;br /&gt;
                #   dd if=/dev/nst0 of=test.tar.gz bs=64k&lt;br /&gt;
                #&lt;br /&gt;
                filename=&amp;quot;support1.$(date &amp;quot;+%m%d%y%H%M&amp;quot;).tar.gz&amp;quot;&lt;br /&gt;
                DIRTOBACKUP=/var/www&lt;br /&gt;
                #tar cvzf - $DIRTOBACKUP | ssh  root@nis  '(mt -f /dev/nst0 rewind; dd of=/dev/nst0 bs=64k )'&lt;br /&gt;
                tar cvzf - $DIRTOBACKUP | ssh  support1@hamlet &amp;quot;dd of=/home/support1/backups/${filename} &amp;quot;&lt;br /&gt;
&lt;br /&gt;
         Another example program, below, pushes the last &amp;quot;.tar.gz&amp;quot; file to tape:&lt;br /&gt;
&lt;br /&gt;
                #!/bin/bash&lt;br /&gt;
                # Program to push files to tape&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                # Notes on recovering from tape&lt;br /&gt;
                #&lt;br /&gt;
                #   dd if=/dev/nst0 of=test.tar.gz ibs=64k&lt;br /&gt;
                #    or&lt;br /&gt;
                #  $ ssh root@tapeserver &amp;quot;mt -f /dev/nst0 rewind&amp;quot;&lt;br /&gt;
                #  $ ssh root@tapeserver &amp;quot;dd if=/dev/nst0 ibs=64k&amp;quot;|dd of=cvs1.tar.gz&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                # First rewind tape&lt;br /&gt;
                ssh root@tapeserver 'mt -f /dev/nst0 rewind'&lt;br /&gt;
                #&lt;br /&gt;
                # Grab only the last file&lt;br /&gt;
                file=$(find /home/cvs  -iname 'cvs*.tar.gz'|sort|tail -n 1)&lt;br /&gt;
                dd if=${file}|ssh root@tapeserver 'dd of=/dev/nst0 bs=64k'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 137:&lt;br /&gt;
&lt;br /&gt;
        Apache - redirecting pages. All changes are in httpd.conf&lt;br /&gt;
&lt;br /&gt;
               RedirectMatch (.*)\.gif$ http://www.anotherserver.com$1.jpg&lt;br /&gt;
&lt;br /&gt;
               Redirect /service http://foo2.bar.com/service&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 138:&lt;br /&gt;
&lt;br /&gt;
        samba mounts via ssh - mounting a samba share through an ssh tunnel, going&lt;br /&gt;
               through an intermediate computer, that accepts ssh. We'll call this&lt;br /&gt;
               intermediate computer middle [65.219.4.23], and we want to get to&lt;br /&gt;
               destination [192.168.0.81]. The user will be mchirico.&lt;br /&gt;
&lt;br /&gt;
          STEP 1:&lt;br /&gt;
&lt;br /&gt;
               $ mkdir -p /samba/share&lt;br /&gt;
&lt;br /&gt;
          STEP 2:&lt;br /&gt;
&lt;br /&gt;
            This has to be done as root, since we are using a lower port.&lt;br /&gt;
&lt;br /&gt;
               $ ssh -N -L 139:192.168.0.81:139 mchirico@65.219.4.23&lt;br /&gt;
&lt;br /&gt;
          STEP 3:&lt;br /&gt;
&lt;br /&gt;
              umount /samba/sales&lt;br /&gt;
              /bin/mount -t smbfs -o  username=donkey,workgroup=donkeydomain,&lt;br /&gt;
                      password=passw0rk1,port=139,dmask=770,fmask=660,&lt;br /&gt;
                      netbiosname=homecpu //localhost/share /samba/share&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 139:&lt;br /&gt;
&lt;br /&gt;
        Music on Fedora Core -- How to play music on http://magnatune.com with &amp;quot;xmms&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           The following command will show the sound driver:&lt;br /&gt;
&lt;br /&gt;
              $ lspci|grep -i audio&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          STEP 1:&lt;br /&gt;
&lt;br /&gt;
                Unmute amixer with the following command:&lt;br /&gt;
&lt;br /&gt;
              $ amixer set Master 100% unmute&lt;br /&gt;
              $ amixer set PCM 100%  unmute&lt;br /&gt;
&lt;br /&gt;
                Note you can also get a graphical interface with &amp;quot;alsamixer&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              $ alsamixer&lt;br /&gt;
&lt;br /&gt;
                 h,F1   -- for help&lt;br /&gt;
                 Esc    -- exit&lt;br /&gt;
                 Tab    -- move to selections&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          STEP 2:&lt;br /&gt;
&lt;br /&gt;
                Test a sound file &amp;quot;*.au&amp;quot; with aplay. To quickly find files on your system use&lt;br /&gt;
                the &amp;quot;locate *.au&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
                  $ aplay /usr/lib/python2.3/test/audiotest.au&lt;br /&gt;
&lt;br /&gt;
          STEP 3:&lt;br /&gt;
&lt;br /&gt;
                Install &amp;quot;xmms-mp3-1.2.10-9.2.1.fc3.rf.i386.rpm&amp;quot; which does not come with Fedora because&lt;br /&gt;
                of GPL license restrictions.  The latest version of this package can be found&lt;br /&gt;
                at the following url:&lt;br /&gt;
&lt;br /&gt;
                  http://rpmseek.com/rpm-pl/xmms-mp3.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                  $ rpm -ivh xmms-mp3-1.2.10-9.2.1.fc3.rf.i386.rpm&lt;br /&gt;
&lt;br /&gt;
          STEP 4:&lt;br /&gt;
&lt;br /&gt;
                Go to magnatun &amp;quot;http://magnatune.com/&amp;quot;, select genre and make sure xmms&lt;br /&gt;
                is the default player.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 140:&lt;br /&gt;
&lt;br /&gt;
        Routing -- getting access to a network 1 hop away. You are currently on the 192 network&lt;br /&gt;
                   and you want access to the 172.21.0.0 network that has a computer straddling&lt;br /&gt;
                   the two, with /proc/sys/net/ipv4/ip_forward set to 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               $ route add -net 172.21.0.0 netmask 255.255.255.0 gw 192.168.0.204&lt;br /&gt;
&lt;br /&gt;
         To undo:&lt;br /&gt;
&lt;br /&gt;
               $ route del -net 172.21.0.0 netmask 255.255.255.0 gw 192.168.0.204&lt;br /&gt;
&lt;br /&gt;
         Now you can ping 172.21.0.21.&lt;br /&gt;
&lt;br /&gt;
         Does not work?&lt;br /&gt;
&lt;br /&gt;
         Go on to 192.168.0.204 and execute the following commands:&lt;br /&gt;
&lt;br /&gt;
               $ echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
               $ cat /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
               1&lt;br /&gt;
&lt;br /&gt;
         To Look at the the gateway, execute the following command.&lt;br /&gt;
&lt;br /&gt;
               $ netstat -r&lt;br /&gt;
&lt;br /&gt;
         References: &lt;br /&gt;
&lt;br /&gt;
               http://lartc.org/lartc.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 141:&lt;br /&gt;
&lt;br /&gt;
        RAM disk -- creating a filesystem in RAM.&lt;br /&gt;
&lt;br /&gt;
               $ mkfs -t ext3 -q /dev/ram1 4096&lt;br /&gt;
               $ mkdir -p /fsram&lt;br /&gt;
               $ mount /dev/ram1 /fsram -o defaults,rw&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 142:&lt;br /&gt;
&lt;br /&gt;
        Create a Live Linux CDROM  using  BusyBox and OpenSSH.&lt;br /&gt;
&lt;br /&gt;
            These steps are rather long. A complete tutorial is given at&lt;br /&gt;
            the following link:&lt;br /&gt;
             http://prdownloads.sourceforge.net/souptonuts/instructions_boot_system.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 143:&lt;br /&gt;
&lt;br /&gt;
      SystemImager (http://www.systemimager.org/) SystemImager is software that automates Linux installs,&lt;br /&gt;
                       software distribution, and production deployment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 144:&lt;br /&gt;
&lt;br /&gt;
      Mounted a filesystem in rescue mode, yet, you cannot read and write?  Remount.&lt;br /&gt;
&lt;br /&gt;
             $ mount -o remount /&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 145:&lt;br /&gt;
&lt;br /&gt;
      Nmap commands to check for Microsoft VPN connection.&lt;br /&gt;
&lt;br /&gt;
         $ nmap -sO -p 47 vpn1.someserver.com&lt;br /&gt;
         $ nmap -sS -p T:1723 vpn1.someserver.com&lt;br /&gt;
&lt;br /&gt;
      By the way, with nmap you can specify multiple ports. Below&lt;br /&gt;
      is an example of multiple ports; but, use the commands above&lt;br /&gt;
      for Microsoft VPN services.&lt;br /&gt;
&lt;br /&gt;
         $ nmap -sS -p T:1723-3000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 146:&lt;br /&gt;
&lt;br /&gt;
      Perl and ssh - monitoring systems. The output from ssh can be parsed. Below is&lt;br /&gt;
      a simple procedure to just to read the ssh ouput into perl.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #&lt;br /&gt;
          $pid = open $readme, &amp;quot;ssh root\@hamlet df -lh|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
          while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
           print $_&lt;br /&gt;
          }&lt;br /&gt;
          close $readme&lt;br /&gt;
&lt;br /&gt;
      But note, you probably want to do something more complex. Below is a more robust&lt;br /&gt;
      example that bypassed all the fortune, heading junk that you may encounter when&lt;br /&gt;
      logging in.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #&lt;br /&gt;
          $pid = open $readme, &amp;quot;ssh root\@hamlet df -lh 2&amp;gt;/dev/null|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
          while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
           print $_&lt;br /&gt;
          }&lt;br /&gt;
          close $readme&lt;br /&gt;
&lt;br /&gt;
      NO! you CANNOT do bidirectional communication with the open statement. Note the &amp;quot;|&amp;quot; before&lt;br /&gt;
      and after below, which cannot be done.&lt;br /&gt;
&lt;br /&gt;
          # Cannot do this!&lt;br /&gt;
          $pid = open $readme, &amp;quot;|ssh root\@hamlet df -lh 2&amp;gt;/dev/null|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
      Below is a simple Perl example working with arrays:&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          @ArrayOfArray = (&lt;br /&gt;
                   [ &amp;quot;ant&amp;quot;, &amp;quot;bee&amp;quot; ],&lt;br /&gt;
                   [ &amp;quot;mouse&amp;quot;, &amp;quot;mole&amp;quot;, &amp;quot;rat&amp;quot; ],&lt;br /&gt;
                   [ &amp;quot;duck&amp;quot;, &amp;quot;goose&amp;quot;, &amp;quot;flamingo&amp;quot; ],&lt;br /&gt;
                   [  &amp;quot;rose&amp;quot;,&amp;quot;carnation&amp;quot;,&amp;quot;sunflower&amp;quot;],&lt;br /&gt;
                  );&lt;br /&gt;
&lt;br /&gt;
          for $i ( 0 .. $#ArrayOfArray ) {&lt;br /&gt;
              for $j ( 0 .. $#{$ArrayOfArray[$i]} ) {&lt;br /&gt;
                  print &amp;quot;Element $i $j is $ArrayOfArray[$i][$j]\n&amp;quot;;&lt;br /&gt;
              }&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          # Or this is another way to list elements&lt;br /&gt;
          foreach( @ArrayOfArray ) {&lt;br /&gt;
             foreach $i (0..$#$_) {&lt;br /&gt;
                print &amp;quot;$_-&amp;gt;[$i] &amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
             print &amp;quot;\n&amp;quot;;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Below is an example of working with Hash of Arrays:&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #  ./program &amp;lt; /etc/passwd&lt;br /&gt;
          while(&amp;lt;&amp;gt;){&lt;br /&gt;
              next unless s/^(.*?):\s*//;&lt;br /&gt;
              $HoA{$1} = [ split(/:/) ];&lt;br /&gt;
          }&lt;br /&gt;
          for $i (keys %HoA ) {&lt;br /&gt;
              print &amp;quot;$i: @{ $HoA{$i} } \n&amp;quot;;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
      Example of regular expression. This is my most used regular expression - I like&lt;br /&gt;
      this sample. See the &amp;quot;www.unix.org.ua&amp;quot; link at the end of this tip.&lt;br /&gt;
&lt;br /&gt;
          &amp;quot;hot cross buns&amp;quot; =~ /cross/;&lt;br /&gt;
          print &amp;quot;Matched: &amp;lt;$`&amp;gt; $&amp;amp; &amp;lt;$'&amp;gt;\n&amp;quot;;    # Matched: &amp;lt;hot &amp;gt; cross &amp;lt; buns&amp;gt;&lt;br /&gt;
          print &amp;quot;Left:    &amp;lt;$`&amp;gt;\n&amp;quot;;            # Left:    &amp;lt;hot &amp;gt;&lt;br /&gt;
          print &amp;quot;Match:   &amp;lt;$&amp;amp;&amp;gt;\n&amp;quot;;            # Match:   &amp;lt;cross&amp;gt;&lt;br /&gt;
          print &amp;quot;Right:   &amp;lt;$'&amp;gt;\n&amp;quot;;            # Right:   &amp;lt; buns&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      If you're looking for Perl information, type &amp;quot;man perl&amp;quot;, which will show you how&lt;br /&gt;
      to get even more information. Or better yet, take a look at the following&lt;br /&gt;
      link:&lt;br /&gt;
&lt;br /&gt;
          http://www.unix.org.ua/orelly/perl/prog3/ch09_01.htm&lt;br /&gt;
               also&lt;br /&gt;
          http://www.stonehenge.com/merlyn/UnixReview/&lt;br /&gt;
&lt;br /&gt;
      For a quick example on using Perl with SQLite, see the following links:&lt;br /&gt;
&lt;br /&gt;
          http://prdownloads.sourceforge.net/souptonuts/README_sqlite_tutorial.html?download&lt;br /&gt;
            or&lt;br /&gt;
          http://freshmeat.net/articles/view/1428/&lt;br /&gt;
            or&lt;br /&gt;
          http://www.perl.com/pub/a/1999/09/refererents.html&lt;br /&gt;
&lt;br /&gt;
      Standard input for files. This example will read from stdin, or open a file if given as&lt;br /&gt;
      an argument, and convert all &amp;quot;&amp;lt;&amp;quot; to &amp;quot;&amp;amp;lt;&amp;quot; and &amp;quot;&amp;gt;&amp;quot; to &amp;quot;&amp;amp;gt;&amp;quot;, which can be handy when&lt;br /&gt;
      converting text files to html files. Note the &amp;quot;while(&amp;lt;&amp;gt;)&amp;quot; will take multiple file names&lt;br /&gt;
      on the command line.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          while(&amp;lt;&amp;gt;) {&lt;br /&gt;
             s/&amp;amp;amp;/&amp;amp;amp;amp;/g;&lt;br /&gt;
             s/&amp;amp;lt;/&amp;amp;amp;lt;/g;&lt;br /&gt;
             s/&amp;amp;gt;/&amp;amp;amp;gt;/g;&lt;br /&gt;
             s/&amp;lt;/&amp;amp;lt;/g;&lt;br /&gt;
             s/&amp;gt;/&amp;amp;gt;/g;&lt;br /&gt;
             print;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
      Perl Debugger is very useful for testing commands and works like an interpreter, just&lt;br /&gt;
      like python. So to get into the Perl Debugger execute the command below, &amp;quot;q&amp;quot; to quit.&lt;br /&gt;
&lt;br /&gt;
          $ perl -de 0&lt;br /&gt;
&lt;br /&gt;
      Reference TIP 170&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 147:&lt;br /&gt;
&lt;br /&gt;
      Shutdown&lt;br /&gt;
&lt;br /&gt;
          # shutdown 8:00 -- Shutdown at 8:00&lt;br /&gt;
&lt;br /&gt;
          # shutdown +13  -- Shutdown after 13min&lt;br /&gt;
&lt;br /&gt;
          # shutdown -r now  -- Shutdown now and restart&lt;br /&gt;
&lt;br /&gt;
          # shutdown -k +2  -- &amp;quot;The system is going DOWN to maintenance mode in 2 minutes!&amp;quot;&lt;br /&gt;
                              The above is only a warning.&lt;br /&gt;
&lt;br /&gt;
          # shutdown -h now   -- Shutdown now and halt&lt;br /&gt;
&lt;br /&gt;
          # shutdown -c    -- Cancel shutdown&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 148:&lt;br /&gt;
&lt;br /&gt;
      ac -  print statistics about users connect time&lt;br /&gt;
&lt;br /&gt;
          $ ac -p    -- print hour usage by user (individual)&lt;br /&gt;
          $ ac -dy   -- print daily usage&lt;br /&gt;
&lt;br /&gt;
       Options can also be combined&lt;br /&gt;
&lt;br /&gt;
          $ ac -dyp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 149:&lt;br /&gt;
&lt;br /&gt;
      Smart Monitoring Tools:&lt;br /&gt;
      Disk failing? Or want to know the temperature of your hard-drive?&lt;br /&gt;
&lt;br /&gt;
         http://smartmontools.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
      For a good, quick tutorial, see the Linux Journal article&lt;br /&gt;
        http://www.linuxjournal.com/article/6983&lt;br /&gt;
&lt;br /&gt;
      Below are some common commands:&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -i /dev/hda&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -Hc /dev/hda&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -A /dev/hda&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 150:&lt;br /&gt;
&lt;br /&gt;
      Monitor dhcp trafic - dhcpdump and tcpdump.&lt;br /&gt;
&lt;br /&gt;
      Download dhcpdump&lt;br /&gt;
&lt;br /&gt;
         $ wget  http://voxel.dl.sourceforge.net/sourceforge/mavetju/dhcpdump-1.5.tar.gz&lt;br /&gt;
         $ ./configure&lt;br /&gt;
         $ make &amp;amp;&amp;amp; make install&lt;br /&gt;
&lt;br /&gt;
     Once it's installed, you can monitor all dhcp traffic as follows, if done with root.&lt;br /&gt;
&lt;br /&gt;
         $ tcpdump -lenx -i eth0 -s 1500 port bootps or port bootpc| dhcpdump&lt;br /&gt;
&lt;br /&gt;
     The above assumes you are using eth0 (ethernet port 0).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 151:&lt;br /&gt;
&lt;br /&gt;
      Breaking Firewalls with ssh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      A sample .ssh/config file (note this must have chmod 600 rights)&lt;br /&gt;
&lt;br /&gt;
           ## Server1 ##&lt;br /&gt;
           Host 130.21.19.227&lt;br /&gt;
               LocalForward 20000 192.168.0.66:80&lt;br /&gt;
               LocalForward 22000 192.168.0.66:22&lt;br /&gt;
&lt;br /&gt;
      With the above &amp;quot;~/.ssh/config&amp;quot; file, after sshing into 130.21.19.227 it&lt;br /&gt;
      is then possible to ssh into nearby computers directly.&lt;br /&gt;
&lt;br /&gt;
         $ ssh -l mchirico 130.21.19.227&lt;br /&gt;
         $ scp -P 22000 authorized_keys* mchirico@localhost:.&lt;br /&gt;
         $ ssh -l mchirico localhost -p 22000&lt;br /&gt;
&lt;br /&gt;
      For the complete article reference the following link:&lt;br /&gt;
        http://souptonuts.sourceforge.net/sshtips.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 152:&lt;br /&gt;
&lt;br /&gt;
      Renaming files - suppose you want to rename all the &amp;quot;.htm&amp;quot; files to &amp;quot;.html&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          $ rename .htm .html *.htm&lt;br /&gt;
&lt;br /&gt;
      Or, suppose you files file1, file2, file3 ...&lt;br /&gt;
&lt;br /&gt;
          $ touch file1 file2 file3 file4 file5 file6&lt;br /&gt;
          $ rename file file. file*&lt;br /&gt;
&lt;br /&gt;
      The above command will give you &amp;quot;file.1&amp;quot;, &amp;quot;file.2&amp;quot; ... &amp;quot;file.6&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 153:&lt;br /&gt;
&lt;br /&gt;
      Renaming files with Perl - this is taken from &amp;quot;Programming Perl 3rd Edition&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          # rename - change filenames&lt;br /&gt;
          $op = shift;&lt;br /&gt;
          for (@ARGV) {&lt;br /&gt;
              $was = $_;&lt;br /&gt;
              eval $op;&lt;br /&gt;
              die if $@;&lt;br /&gt;
              # next line calls built-in function, not the script&lt;br /&gt;
              rename($was,$_) unless $was eq $_;&lt;br /&gt;
           }&lt;br /&gt;
&lt;br /&gt;
      The above Perl program can be used as follows:&lt;br /&gt;
&lt;br /&gt;
           $ rename 's/\.orig$//'    *.orig&lt;br /&gt;
           $ rename 'y/A-Z/a-z/ unless /^Make/' *&lt;br /&gt;
&lt;br /&gt;
      Also reference:&lt;br /&gt;
           http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 154:&lt;br /&gt;
&lt;br /&gt;
      R project (http://www.r-project.org)&lt;br /&gt;
&lt;br /&gt;
      To start R, just type &amp;quot;R&amp;quot; at the command prompt and &amp;quot;q()&amp;quot; to quit. Below&lt;br /&gt;
      2 is raised to powers 0 through 6 and thrown into an array.&lt;br /&gt;
&lt;br /&gt;
           $ R&lt;br /&gt;
           &amp;gt; N &amp;lt;- 2^(0:6)&lt;br /&gt;
           &amp;gt; N&lt;br /&gt;
           [1]  1  2  4  8 16 32 64&lt;br /&gt;
           &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      There is a summary summary() command.&lt;br /&gt;
&lt;br /&gt;
           &amp;gt; summary(N)&lt;br /&gt;
           Min. 1st Qu.  Median    Mean 3rd Qu.    Max.&lt;br /&gt;
           1.00    3.00    8.00   18.14   24.00   64.00&lt;br /&gt;
&lt;br /&gt;
      Note that the array begins as 1 and not 0&lt;br /&gt;
&lt;br /&gt;
           &amp;gt; N[1:3]&lt;br /&gt;
           [1] 1 2 4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 155:&lt;br /&gt;
&lt;br /&gt;
      ls - listing files by size, with the biggest file listed last&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           $ ls --sort=size -lhr&lt;br /&gt;
&lt;br /&gt;
      The above command sorts files by size, listing the contents in&lt;br /&gt;
      &amp;quot;h&amp;quot; human readable format in reverse order.&lt;br /&gt;
&lt;br /&gt;
      Note the options:  --sort={none,time,size,extension}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 156:&lt;br /&gt;
&lt;br /&gt;
     Perl - program to clean up old versions of files&lt;br /&gt;
&lt;br /&gt;
       #!/usr/bin/perl&lt;br /&gt;
       #   Copyright (c) GPL 2005 Mike Chirico&lt;br /&gt;
       # This program deletes old files from several directories&lt;br /&gt;
       # and within each directory there must be x number of copies&lt;br /&gt;
       # each y number of bytes&lt;br /&gt;
       #&lt;br /&gt;
&lt;br /&gt;
       sub delete_old_ones {&lt;br /&gt;
           $directory_and_file=$_[0];&lt;br /&gt;
           $save_count=$_[1];&lt;br /&gt;
           $bytes_in_file=$_[2];&lt;br /&gt;
         # Don't change setting here of '-lt'&lt;br /&gt;
           $pid = open $readme, &amp;quot;ls -lt $directory_and_file|&amp;quot; or die &amp;quot;Could not execute\n&amp;quot;;&lt;br /&gt;
           while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
               my @fields = split;&lt;br /&gt;
              # Make sure we have $save_count good ones with data&lt;br /&gt;
               if ($fields[4] &amp;gt; $bytes_in_file &amp;amp;&amp;amp; $save_count &amp;gt; 0) {&lt;br /&gt;
                   $save_count--;&lt;br /&gt;
                   print &amp;quot;Kept files: $fields[4] $fields[8]\n&amp;quot;;&lt;br /&gt;
               }&lt;br /&gt;
              # delete the old ones&lt;br /&gt;
              if ($save_count &amp;lt;= 0 )&lt;br /&gt;
              {&lt;br /&gt;
                  print &amp;quot;Deleted files: $fields[4] $fields[8]\n&amp;quot;;&lt;br /&gt;
                  unlink $fields[8];&lt;br /&gt;
              }&lt;br /&gt;
           }&lt;br /&gt;
           close $readme;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       @AofA = (&lt;br /&gt;
          [ &amp;quot;/home/cvs/backups/*.gz&amp;quot;, &amp;quot;6&amp;quot;,196621 ],&lt;br /&gt;
          [ &amp;quot;/home/mail/backups/*.gz&amp;quot;,&amp;quot;5&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/snort/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/server1/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/actserver/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/server2/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
                );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       foreach( @AofA ) {&lt;br /&gt;
           &amp;amp;delete_old_ones($_-&amp;gt;[0],$_-&amp;gt;[1],$_-&amp;gt;[2]);&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
     Reference TIP 170 and the following link:&lt;br /&gt;
       http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 157:&lt;br /&gt;
&lt;br /&gt;
     Graphics and Visualization Software that runs on Linux&lt;br /&gt;
        http://www.tldp.org/HOWTO/Scientific-Computing-with-GNU-Linux/graphvis.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 158:&lt;br /&gt;
&lt;br /&gt;
     Keeping files in sync going both ways. Unlike rsync, this is not a one way mirror&lt;br /&gt;
     option.&lt;br /&gt;
&lt;br /&gt;
     You will need ocaml installed first.&lt;br /&gt;
&lt;br /&gt;
       $ wget http://caml.inria.fr/pub/distrib/ocaml-3.08/ocaml-3.08.3.tar.gz&lt;br /&gt;
       $ tar -xzf ocaml-3.08.3.tar.gz&lt;br /&gt;
       $ cd ocaml-3.08.3&lt;br /&gt;
&lt;br /&gt;
       $ ./configure&lt;br /&gt;
       $ make world&lt;br /&gt;
       $ make opt&lt;br /&gt;
       $ make install&lt;br /&gt;
&lt;br /&gt;
     Next, get unison and put it in a different directory.&lt;br /&gt;
     [http://www.cis.upenn.edu/~bcpierce/unison/]&lt;br /&gt;
&lt;br /&gt;
       $ wget http://www.cis.upenn.edu/~bcpierce/unison/download/stable/latest/unison-2.10.2.tar.gz&lt;br /&gt;
       $ tar -xzf unison-2.10.2.tar.gz&lt;br /&gt;
       $ cd unison-2.10.2&lt;br /&gt;
       $ make UISTYLE=text&lt;br /&gt;
       $ su&lt;br /&gt;
       # cp unison /usr/local/bin/.&lt;br /&gt;
&lt;br /&gt;
     Note, you have to copy the file manually.&lt;br /&gt;
&lt;br /&gt;
     See the following article [http://www.linuxjournal.com/article/7712]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 159:&lt;br /&gt;
&lt;br /&gt;
     Dump ext2/ext3 filesystem information with &amp;quot;dumpe2fs&amp;quot;. Perform the mount command&lt;br /&gt;
     and query away.&lt;br /&gt;
&lt;br /&gt;
       $ dumpe2fs /dev/sda1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 160:&lt;br /&gt;
&lt;br /&gt;
     sysreport - a script that generates an HTML report on the system configuration. It&lt;br /&gt;
     gathers information about the hardware and is somewhat redhat specific. The utility&lt;br /&gt;
     should be run as root.&lt;br /&gt;
&lt;br /&gt;
       $ /usr/sbin/sysreport&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 161:&lt;br /&gt;
&lt;br /&gt;
     Key Bindings Using bind.  You can bind, say, ctl-t to a command.&lt;br /&gt;
&lt;br /&gt;
     Add the following to you &amp;quot;~/.inputrc&amp;quot; file, just as it is typed below with quotes.&lt;br /&gt;
&lt;br /&gt;
           &amp;quot;\C-t&amp;quot;: ls -l&lt;br /&gt;
&lt;br /&gt;
     Next, run the command&lt;br /&gt;
&lt;br /&gt;
           $ bind -f .inputrc&lt;br /&gt;
&lt;br /&gt;
     Or, you can do everything on the command line; however, it won't be there the next time&lt;br /&gt;
     you log in. Below is the way to do everything on the command line.&lt;br /&gt;
&lt;br /&gt;
           $ bind -x '&amp;quot;\C-t&amp;quot;:ls -l'&lt;br /&gt;
&lt;br /&gt;
     To unbind use the &amp;quot;-r&amp;quot; option. Single quotes are not needed.&lt;br /&gt;
&lt;br /&gt;
           $ bind -r &amp;quot;\C-t&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Getting a list of all bindings can be done as follows, and not this can be redirected&lt;br /&gt;
     to the &amp;quot;.inputrc&amp;quot; file for further editing.&lt;br /&gt;
&lt;br /&gt;
           $ bind -p &amp;gt; .inputrc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 162:&lt;br /&gt;
&lt;br /&gt;
     awk - common awk commands.&lt;br /&gt;
&lt;br /&gt;
     Find device names &amp;quot;sd&amp;quot; or with major number 4 and device name &amp;quot;tty&amp;quot;. Print the&lt;br /&gt;
     record number NR, plus the major number and minor number.&lt;br /&gt;
&lt;br /&gt;
          $ awk '$2 == &amp;quot;sd&amp;quot;||$1 == 4 &amp;amp;&amp;amp; $2 == &amp;quot;tty&amp;quot; { print NR,$1,$2}' /proc/devices&lt;br /&gt;
&lt;br /&gt;
     Find device name equal to &amp;quot;sound&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ awk '/sound/{print NR,$1,$2}' /proc/devices&lt;br /&gt;
&lt;br /&gt;
     Print the 5th record, first field, in file test&lt;br /&gt;
&lt;br /&gt;
          $ awk 'NR==5{print $1}' test&lt;br /&gt;
&lt;br /&gt;
     Print a record, skip 4 records, print a record etc from file1&lt;br /&gt;
&lt;br /&gt;
          $ awk '(NR-1) % 4 == 0 {print $1}' file1&lt;br /&gt;
&lt;br /&gt;
     Print all records except the last one from file1&lt;br /&gt;
&lt;br /&gt;
          $ tac file1|awk 'NR &amp;gt; 1 {print $0}'|tac&lt;br /&gt;
&lt;br /&gt;
     Print A,B,C ..Z on each line, cycling back to A if greater than 26 lines&lt;br /&gt;
&lt;br /&gt;
          $ awk '{ print substr(&amp;quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&amp;quot;,(NR-1)%26+1,1),$0}' file1&lt;br /&gt;
&lt;br /&gt;
     Number of bytes in a directory.&lt;br /&gt;
&lt;br /&gt;
          $ ls -l|awk 'BEGIN{ c=0}{ c+=$5} END{ print c}'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 163:&lt;br /&gt;
&lt;br /&gt;
     Configuring Remote Logging.  If you have several servers on 192.168.1.0, you can setup remote logging&lt;br /&gt;
     as follows.&lt;br /&gt;
&lt;br /&gt;
     MAIN LOG SERVER (192.168.1.81):&lt;br /&gt;
&lt;br /&gt;
        Firewall - allow UDP port 514 on the main server that will receive the logs.&lt;br /&gt;
&lt;br /&gt;
          $ iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 514 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        Edit &amp;quot;/etc/sysconfig/syslog&amp;quot; and add the &amp;quot;-r&amp;quot; option to SYSLOGD_OPTIONS as shown below.&lt;br /&gt;
&lt;br /&gt;
          SYSLOGD_OPTIONS=&amp;quot;-r -m -0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Note, the &amp;quot;-r&amp;quot; is to allow remote logging and  &amp;quot;-m 0&amp;quot; specifies that that the syslog process should&lt;br /&gt;
        not write regular timestamps.  I prefer to only write timestamps for the clients.&lt;br /&gt;
&lt;br /&gt;
        Next, restart the logging process&lt;br /&gt;
&lt;br /&gt;
          $ service syslog restart&lt;br /&gt;
&lt;br /&gt;
     CLIENT LOG SERVER:&lt;br /&gt;
&lt;br /&gt;
        Edit &amp;quot;/etc/syslog.conf&amp;quot; and add the ip address of the log server, or put in the hostname.&lt;br /&gt;
&lt;br /&gt;
            *.* @192.168.1.81&lt;br /&gt;
&lt;br /&gt;
        Next, restart the logging process&lt;br /&gt;
&lt;br /&gt;
          $ service syslog restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 164:&lt;br /&gt;
&lt;br /&gt;
     kudzu - hardware on your system. To probe the hardware on your system without doing&lt;br /&gt;
             anything, issue the following command.&lt;br /&gt;
&lt;br /&gt;
          $ kudzu -p&lt;br /&gt;
&lt;br /&gt;
      But wait, a lot of this information is already recorded in the following file&lt;br /&gt;
&lt;br /&gt;
            /etc/sysconfig/hwconf&lt;br /&gt;
&lt;br /&gt;
      You can also use lspci to list all PCI devices.&lt;br /&gt;
&lt;br /&gt;
          $ lspci&lt;br /&gt;
&lt;br /&gt;
      Also, take a look at the script /etc/sbin/sysreport, since this script has a lot of&lt;br /&gt;
      info gathering commands. You can pick and choose what you want, or run the complete&lt;br /&gt;
      report.&lt;br /&gt;
&lt;br /&gt;
      If you just want information on the NIC&lt;br /&gt;
&lt;br /&gt;
          $ ip link show eth0&lt;br /&gt;
          2: eth0: &amp;lt;BROADCAST,MULTICAST,UP&amp;gt; mtu 1500 qdisc pfifo_fast qlen 1000&lt;br /&gt;
          link/ether 00:11:11:8a:be:3f brd ff:ff:ff:ff:ff:ff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 165:&lt;br /&gt;
&lt;br /&gt;
     cfengine - a very power agent for monitoring and administrating both a single computer&lt;br /&gt;
              and or multiple computers. [ http://www.cfengine.org/ ]&lt;br /&gt;
&lt;br /&gt;
     The following is a quick example on downloading and installing cfengine.&lt;br /&gt;
&lt;br /&gt;
          $ ncftpget ftp://ftp.iu.hio.no/pub/cfengine/cfengine-2.1.15.tar.gz&lt;br /&gt;
          $ md5sum cfengine-2.1.15.tar.gz&lt;br /&gt;
          f03de82709f84c3d6d916b6e557321f9  cfengine-2.1.15.tar.gz&lt;br /&gt;
&lt;br /&gt;
          $ tar -xzf cfengine-2.1.15.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You need to have a current version of BerkeleyDB (http://downloads.sleepycat.com/db-4.3.28.tar.gz).&lt;br /&gt;
     Note that BerkeleyDB has a funny install. You cd to the &amp;quot;build_unix&amp;quot; directory, then,&lt;br /&gt;
&lt;br /&gt;
          Installing BerkeleyDB if needed:&lt;br /&gt;
                 $ wget http://downloads.sleepycat.com/db-4.3.28.tar.gz&lt;br /&gt;
                 $ tar -xzf db-4.3.28.tar.gz&lt;br /&gt;
                 $ cd db-4.3.28/build_unix/&lt;br /&gt;
                 $ ../dist/configure&lt;br /&gt;
                 make&lt;br /&gt;
                 make install&lt;br /&gt;
&lt;br /&gt;
     You also need a current version of OpenSSL. For instructions on how to install OpenSSL see&lt;br /&gt;
     (http://souptonuts.sourceforge.net/postfix_tutorial.html).&lt;br /&gt;
&lt;br /&gt;
     See (TIP 49) on putting &amp;quot;/usr/local/BerkeleyDB.4.3/lib&amp;quot; in the &amp;quot;/etc/ld.so.conf&amp;quot; file. Or&lt;br /&gt;
     once BerkeleyDB is installed, you can put the location on the command line as follows:&lt;br /&gt;
&lt;br /&gt;
     Configuring cfengine with direct reference to BerkeleyDB.4.3.  First cd to the cfengine source.&lt;br /&gt;
&lt;br /&gt;
          $ ./configure --with-berkeleydb=/usr/local/BerkeleyDB.4.3/lib&lt;br /&gt;
          $ make&lt;br /&gt;
          $ make install&lt;br /&gt;
&lt;br /&gt;
     Next create the following directories:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /var/cfengine/bin&lt;br /&gt;
          $ mkdir -p /var/cfengine/inputs&lt;br /&gt;
&lt;br /&gt;
     Copy needed files (cfagent, cfdoc, cfenvd, cfenvgraph, cfexecd, cfkey, cfrun, cfservd, cfshow):&lt;br /&gt;
&lt;br /&gt;
          $ cp /usr/local/sbin/cf* /var/cfengine/bin&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You'll also need to generate keys. As root, execute the following:&lt;br /&gt;
&lt;br /&gt;
          $ cfkey&lt;br /&gt;
&lt;br /&gt;
     The command above will write the public and private keys in&lt;br /&gt;
     &amp;quot;/var/cfengine/ppkeys&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You probably want (cfexecd, cfservd, and cfenvd) running on all servers. If you&lt;br /&gt;
     add the following to &amp;quot;/etc/rc.local&amp;quot; these daemons will start on reboot.&lt;br /&gt;
&lt;br /&gt;
           # Lines in /etc/rc.local&lt;br /&gt;
           /usr/local/sbin/cfexecd&lt;br /&gt;
           /usr/local/sbin/cfservd&lt;br /&gt;
           /usr/local/sbin/cfenvd&lt;br /&gt;
&lt;br /&gt;
     Also, make sure you run each command now as follows:&lt;br /&gt;
&lt;br /&gt;
          $ /usr/local/sbin/cfexecd&lt;br /&gt;
          $ /usr/local/sbin/cfservd&lt;br /&gt;
          $ /usr/local/sbin/cfenvd&lt;br /&gt;
&lt;br /&gt;
     Firewall settings must be adjusted to allows 5308 for tcp/udp. My local network&lt;br /&gt;
     is 192.168.1.0, so I'm opening it up for all my computers.&lt;br /&gt;
&lt;br /&gt;
          $ iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 5308 -j ACCEPT&lt;br /&gt;
          $ iptables -A INPUT -p tcp -s 192.168.1.0/24  --dport 5308 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
     A set of keys needs to be on the server and hosts. For example, my key on &amp;quot;tape.squeezel.com&amp;quot;&lt;br /&gt;
     should be copied over to the server &amp;quot;squeezel.squeezel.com&amp;quot; as follows:&lt;br /&gt;
&lt;br /&gt;
     This is done from tape.squeezel.com&lt;br /&gt;
&lt;br /&gt;
          $ scp /var/cfengine/ppkeys/localhost.pub  root@squeezel.squeezel.com:/var/cfengine/ppkeys/root-tape.squeezel.com.pub&lt;br /&gt;
          $ scp root@squeezel.squeezel.com:/var/cfengine/ppkeys/localhost.pub /var/cfengine/ppkeys/root-squeezel.squeezel.com.pub&lt;br /&gt;
&lt;br /&gt;
     Also, &amp;quot;/var/cfengine/inputs/cfrun.hosts&amp;quot; on the server &amp;quot;squeezel.squeezel.com&amp;quot; must contain&lt;br /&gt;
     all the computers that will get updated. This is &amp;quot;cfrun.hosts&amp;quot; on &amp;quot;squeezel.squeezel.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          closet.squeezel.com&lt;br /&gt;
          tape.squeezel.com&lt;br /&gt;
&lt;br /&gt;
     Once I'm done, from &amp;quot;tape.squeezel.com&amp;quot; I can run the following test:&lt;br /&gt;
&lt;br /&gt;
          $ cfrun squeezel.squeezel.com -v&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 166:&lt;br /&gt;
&lt;br /&gt;
     cfengine - a quick example. This example will be run as root. You create the file &amp;quot;cfagent.conf&amp;quot; in&lt;br /&gt;
     &amp;quot;/var/cfengine/inputs/&amp;quot;. The example below will checksum all the files in /home/chirico/deleteme/tripwire,&lt;br /&gt;
     it will also comment out the line &amp;quot;finger&amp;quot; in any file located in /tmp/testdir/stuff, also appending&lt;br /&gt;
     the command in this file &amp;quot; Edit change with cfengine&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          # /var/cfengine/inputs/cfagent.conf&lt;br /&gt;
          #&lt;br /&gt;
          # You run this with the following:&lt;br /&gt;
          #   cfagent -vK&lt;br /&gt;
        &lt;br /&gt;
          control:&lt;br /&gt;
                 actionsequence = ( files tidy editfiles )&lt;br /&gt;
                 ChecksumDatabase = ( /var/cfengine/cache.db )&lt;br /&gt;
                 # Below, true to update md5&lt;br /&gt;
                 ChecksumUpdates = ( true )&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
          files:&lt;br /&gt;
                 /home/chirico/deleteme/tripwire checksum=md5 recurse=inf&lt;br /&gt;
                 /home/chirico/deleteme/tripwire/moredata checksum=md5 recurse=inf&lt;br /&gt;
                 #/home/chirico/deleteme/tripwire/compress  recurse=inf include=*.txt acti on=compress&lt;br /&gt;
                   # If the database isn't secure, nothing is secure...&lt;br /&gt;
                 /var/cfengine/cache.db  mode=600 owner=root action=fixall&lt;br /&gt;
        &lt;br /&gt;
          tidy:&lt;br /&gt;
                 /home/chirico/deleteme/tripwire pattern=*~ recurse=inf age=0&lt;br /&gt;
                 # You must put an age. 0 runs now.&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
          editfiles:&lt;br /&gt;
        &lt;br /&gt;
                {  /tmp/testdir/stuff&lt;br /&gt;
&lt;br /&gt;
                   HashCommentLinesContaining &amp;quot;finger&amp;quot;&lt;br /&gt;
                   AppendIfNoSuchLine &amp;quot;# Edit Change with cfengine &amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     A few further notes on the above. The command &amp;quot;actionsequence = ( files tidy editfiles) tells the order&lt;br /&gt;
     of what to execute. The heading &amp;quot;tidy:&amp;quot; deletes files, and of course, &amp;quot;editfiles&amp;quot; does the editing of files.&lt;br /&gt;
&lt;br /&gt;
     To run the example, execute the following command. The  &amp;quot;-K&amp;quot; causes the lock file to be ignored.&lt;br /&gt;
&lt;br /&gt;
            $ cfagent -vK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 167:&lt;br /&gt;
&lt;br /&gt;
     Implementing Disk Quotas - a quick example that can easily be done on a live system for testing. There&lt;br /&gt;
     is no need to reboot, since you'll be creating a virtual filesystem.&lt;br /&gt;
&lt;br /&gt;
     Do the following as root. First create a mount point.&lt;br /&gt;
&lt;br /&gt;
            # mkdir -p /quota&lt;br /&gt;
&lt;br /&gt;
     Next, create 20M file. Since I have many of these files, I created a special directory &amp;quot;/usr/disk-img&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            # mkdir -p /usr/disk-img&lt;br /&gt;
            # dd if=/dev/zero of=/usr/disk-img/disk-quota.ext3 count=40960&lt;br /&gt;
&lt;br /&gt;
     The dd command above create a 20 MB file because, by default, dd uses a block size of 512 bytes. That makes&lt;br /&gt;
     the size: 40960*512=20971520.&lt;br /&gt;
&lt;br /&gt;
     Next, format this as an ext3 filesystem&lt;br /&gt;
&lt;br /&gt;
            # /sbin/mkfs -t ext3 -q /usr/disk-img/disk-quota.ext3 -F&lt;br /&gt;
&lt;br /&gt;
     Add the following line to &amp;quot;/etc/fstab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            /usr/disk-img/disk-quota.ext3    /quota ext3    rw,loop,usrquota,grpquota  0 0&lt;br /&gt;
&lt;br /&gt;
     Now, mount this filesystem&lt;br /&gt;
&lt;br /&gt;
            # mount /quota&lt;br /&gt;
&lt;br /&gt;
     Take a look at it:&lt;br /&gt;
&lt;br /&gt;
            # ls -l /quota&lt;br /&gt;
            lost+found&lt;br /&gt;
&lt;br /&gt;
     Now, run &amp;quot;quotacheck&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            # quotacheck -vug /quota&lt;br /&gt;
&lt;br /&gt;
     You'll get errors the first time this is run, because you have no quota files.&lt;br /&gt;
     But, run it a second time and you'll see something similiar to the following:&lt;br /&gt;
&lt;br /&gt;
            # quotacheck -vug /quota&lt;br /&gt;
            quotacheck: Scanning /dev/loop2 [/quota] done&lt;br /&gt;
            quotacheck: Checked 3 directories and 4 files&lt;br /&gt;
&lt;br /&gt;
     Now take a look at the files:&lt;br /&gt;
&lt;br /&gt;
            # ls -l /quota&lt;br /&gt;
            total 26&lt;br /&gt;
            -rw-------  1 root root  6144 Jun 14 12:23 aquota.group&lt;br /&gt;
            -rw-------  1 root root  6144 Jun 14 12:23 aquota.user&lt;br /&gt;
            drwx------  2 root root 12288 Jun 14 12:18 lost+found&lt;br /&gt;
&lt;br /&gt;
     Next use &amp;quot;edquota&amp;quot; to grant the user &amp;quot;chirico&amp;quot; a certain quota&lt;br /&gt;
&lt;br /&gt;
            # edquota -f /quota chirico&lt;br /&gt;
&lt;br /&gt;
     This will bring up a menu, and here I have edited so that user &amp;quot;chirico&amp;quot;&lt;br /&gt;
     has a soft limit of 120*512=61K, and a soft limit of 2 inodes and a hard limit of 5.&lt;br /&gt;
&lt;br /&gt;
             Disk quotas for user chirico (uid 500):&lt;br /&gt;
             Filesystem                   blocks       soft       hard     inodes     soft     hard&lt;br /&gt;
             /dev/loop2                        2        120        150         1        2         3&lt;br /&gt;
&lt;br /&gt;
     Next, turn quotas on with the following command:&lt;br /&gt;
&lt;br /&gt;
             $ quotaon /quota&lt;br /&gt;
&lt;br /&gt;
     If you need to turn off quotas, the command is &amp;quot;quotaoff -a&amp;quot; for all filesystems. You'll run into&lt;br /&gt;
     errors if you try to run quotacheck, say &amp;quot;quotacheck -avug&amp;quot; because this tries to unmount and mount&lt;br /&gt;
     the filesystem. You need to turn off quotas first &amp;quot;quotaoff /quota&amp;quot;. Note you only need to run&lt;br /&gt;
     quotacheck once, or when doing maintenance after a system crash.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      To get a report on the quote, runn &amp;quot;repquota&amp;quot; as follows:&lt;br /&gt;
&lt;br /&gt;
           $ repquota /quota&lt;br /&gt;
            *** Report for user quotas on device /dev/loop0&lt;br /&gt;
            Block grace time: 7days; Inode grace time: 7days&lt;br /&gt;
                                    Block limits                File limits&lt;br /&gt;
            User            used    soft    hard  grace    used  soft  hard  grace&lt;br /&gt;
            ----------------------------------------------------------------------&lt;br /&gt;
            root      --    1189       0       0              2     0     0&lt;br /&gt;
            chirico   -+      93       0       0              4     2     5  6days&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Note above that user &amp;quot;chirico&amp;quot; has used 4 on the file limits. This user has a hard&lt;br /&gt;
      limit of 5. So when this user tries to create 2 more files (bring this over the limit of 5)&lt;br /&gt;
      then he will get the following error as demonstrated below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           [chirico@squeezel chirico]$ touch one&lt;br /&gt;
           [chirico@squeezel chirico]$ touch two&lt;br /&gt;
           loop0: write failed, user file limit reached.&lt;br /&gt;
           touch: cannot touch `two': Disk quota exceeded&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Now, if repquota (run by root) is executed it shows the following:&lt;br /&gt;
&lt;br /&gt;
           $ repquota /quota&lt;br /&gt;
           *** Report for user quotas on device /dev/loop0&lt;br /&gt;
           Block grace time: 7days; Inode grace time: 7days&lt;br /&gt;
                                   Block limits                File limits&lt;br /&gt;
           User            used    soft    hard  grace    used  soft  hard  grace&lt;br /&gt;
           ----------------------------------------------------------------------&lt;br /&gt;
           root      --    1189       0       0              2     0     0&lt;br /&gt;
           chirico   -+      94       0       0              5     2     5  6days&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Note the &amp;quot;+&amp;quot; sign above. User &amp;quot;chirico&amp;quot; is above the File soft limits, and in this case&lt;br /&gt;
      above the hard limits.&lt;br /&gt;
&lt;br /&gt;
      To warn user by sending email to them, run &amp;quot;warnquota&amp;quot;, but you need check that&lt;br /&gt;
      &amp;quot;/etc/warnquota.conf&amp;quot; is setup correctly. For the example above, this file should&lt;br /&gt;
      look as follows:&lt;br /&gt;
&lt;br /&gt;
            $ cat /etc/quotatab&lt;br /&gt;
            #&lt;br /&gt;
            #  This is sample quotatab (/etc/quotatab)&lt;br /&gt;
            #  Here you can specify description of each device for user&lt;br /&gt;
            #&lt;br /&gt;
            #  Comments begin with hash in the beginning of the line&lt;br /&gt;
&lt;br /&gt;
            # Example of description&lt;br /&gt;
            /dev/loop0: This is loopback device&lt;br /&gt;
&lt;br /&gt;
      Just run the following as root:&lt;br /&gt;
&lt;br /&gt;
            $ warnquota&lt;br /&gt;
&lt;br /&gt;
      By the way, if you want to change the grace period, it can only be done on a filesystem&lt;br /&gt;
      basis. Not per user.&lt;br /&gt;
&lt;br /&gt;
            $  edquota -t&lt;br /&gt;
&lt;br /&gt;
      Users can run &amp;quot;quota&amp;quot; to see their usage as follows:&lt;br /&gt;
&lt;br /&gt;
            [chirico@squeezel ~]$ quota&lt;br /&gt;
            Disk quotas for user chirico (uid 500):&lt;br /&gt;
                 Filesystem  blocks   quota   limit   grace   files   quota   limit   grace&lt;br /&gt;
                 /dev/loop0      94       0       0               5      10      50&lt;br /&gt;
&lt;br /&gt;
      As you can see from above, I changed my inode limit to 50.&lt;br /&gt;
&lt;br /&gt;
      What about running this on the whole filesystem? Yes, below is an example where I'm running&lt;br /&gt;
      this on FC3, on the root of the filesystem &amp;quot;/&amp;quot;. This assumes that you have installed the&lt;br /&gt;
      quota package. Try doing &amp;quot;rpm -q quota&amp;quot; to see if this package is installed.&lt;br /&gt;
&lt;br /&gt;
        Step 1:&lt;br /&gt;
&lt;br /&gt;
           Check to make sure the quota software is installed. You can either do a &amp;quot;whereis quota&amp;quot;,&lt;br /&gt;
           or check for the rpm package.&lt;br /&gt;
&lt;br /&gt;
             $ whereis quota&lt;br /&gt;
             whereis quota&lt;br /&gt;
             quota: /usr/bin/quota /usr/share/man/man1/quota.1.gz&lt;br /&gt;
&lt;br /&gt;
           Checking for the rpm package.&lt;br /&gt;
&lt;br /&gt;
            $ rpm -q quota&lt;br /&gt;
            quota-3.12-5&lt;br /&gt;
&lt;br /&gt;
        Step 2:&lt;br /&gt;
&lt;br /&gt;
           Edit /etc/fstab and add usrquota and grpquota options for &amp;quot;/dev/VolGroup00/LogVol00&amp;quot;,&lt;br /&gt;
           which is shown on the first line below:&lt;br /&gt;
&lt;br /&gt;
             /dev/VolGroup00/LogVol00 /                      ext3    defaults,usrquota,grpquota        1 1&lt;br /&gt;
             LABEL=/boot             /boot                   ext3    defaults        1 2&lt;br /&gt;
             none                    /dev/pts                devpts  gid=5,mode=620  0 0&lt;br /&gt;
             none                    /dev/shm                tmpfs   defaults        0 0&lt;br /&gt;
             none                    /proc                   proc    defaults        0 0&lt;br /&gt;
             none                    /sys                    sysfs   defaults        0 0&lt;br /&gt;
             /dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0&lt;br /&gt;
&lt;br /&gt;
        Step 3:&lt;br /&gt;
&lt;br /&gt;
           Remount the filesystem as follows:&lt;br /&gt;
&lt;br /&gt;
             $ mount -o remount /&lt;br /&gt;
&lt;br /&gt;
        Step 4:&lt;br /&gt;
&lt;br /&gt;
           Run quotacheck with the &amp;quot;-m&amp;quot; option. Like the above statement, this will have to be run with&lt;br /&gt;
           root priviliges. This creates the quota database files, and it can take a long time if it is&lt;br /&gt;
           a large full filesystem.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             $ quotacheck -cugm /&lt;br /&gt;
&lt;br /&gt;
        Step 5:&lt;br /&gt;
&lt;br /&gt;
           This step is optional, but it's good to know if you need to recalculate quotas because of a&lt;br /&gt;
           system crash. It's demonstrated here, because at this point quota's have not been turned on.&lt;br /&gt;
           Again, note the &amp;quot;m&amp;quot; option below.&lt;br /&gt;
&lt;br /&gt;
             $ quotacheck -avumg&lt;br /&gt;
&lt;br /&gt;
        Step 6:&lt;br /&gt;
&lt;br /&gt;
           Set limits for specific users or groups using the &amp;quot;edquota&amp;quot; command. Shown below is the command&lt;br /&gt;
           to setup quotas for user &amp;quot;chirico&amp;quot;. Shown below this user has used 161560 blocks, he has a soft&lt;br /&gt;
           limit of 1161560 and a hard limit of 900000. He has used 3085 inodes and has a soft limit of 10000&lt;br /&gt;
           and a hard limit of 12000.&lt;br /&gt;
&lt;br /&gt;
             $ edquota -f / chirico&lt;br /&gt;
&lt;br /&gt;
             Disk quotas for user chirico (uid 500):&lt;br /&gt;
               Filesystem                   blocks       soft       hard     inodes     soft     hard&lt;br /&gt;
               /dev/mapper/VolGroup00-LogVol00     161560    1161560     900000       3085    10000    12000&lt;br /&gt;
&lt;br /&gt;
           You can put quotas on groups as well. The following is done as root. See (TIP 186 and TIP 6) for creating&lt;br /&gt;
           groups and adding users to groups.&lt;br /&gt;
&lt;br /&gt;
             $ edquota -g share&lt;br /&gt;
&lt;br /&gt;
           If you create a sharable directory for anyone in the group &amp;quot;share&amp;quot; (TIP 6), quota restrictions against&lt;br /&gt;
           group &amp;quot;share&amp;quot; will only apply to files added in the &amp;quot;/home/share&amp;quot; directory. When user &amp;quot;chirico&amp;quot; creates&lt;br /&gt;
           files in &amp;quot;/home/share&amp;quot; they also go against this user quota as well. However, when files are created in&lt;br /&gt;
           his home directory they do not go against the &amp;quot;share&amp;quot; group.&lt;br /&gt;
&lt;br /&gt;
           Note - if you get errors when trying to run &amp;quot;edquota -g share&amp;quot;, turn quotas off &amp;quot;quotaoff /&amp;quot; and&lt;br /&gt;
                  run &amp;quot;quotacheck -avugm&amp;quot;. Then, turn the quotas back on &amp;quot;quotaon /&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           You can see the status of the group quota with the following command:&lt;br /&gt;
&lt;br /&gt;
             $ quota -g share&lt;br /&gt;
&lt;br /&gt;
        Step 7:&lt;br /&gt;
&lt;br /&gt;
           Turn on quotas with the &amp;quot;qutoaon&amp;quot; command. This command needs to be done with root privileges.&lt;br /&gt;
&lt;br /&gt;
             $ quotaon /&lt;br /&gt;
&lt;br /&gt;
        Step 8:&lt;br /&gt;
&lt;br /&gt;
           Check &amp;quot;/etc/quotatab&amp;quot; file for the correct entries. Note that when you do the &amp;quot;mount&amp;quot; command&lt;br /&gt;
           the filesystem returned needs to match what is in the &amp;quot;quotatab&amp;quot; file. I have noticed that this&lt;br /&gt;
           is not the case by default.&lt;br /&gt;
&lt;br /&gt;
             $ mount&lt;br /&gt;
             /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw,usrquota,grpquota)&lt;br /&gt;
&lt;br /&gt;
           So the &amp;quot;/etc/quotatab&amp;quot; must contain the following line.&lt;br /&gt;
&lt;br /&gt;
             /dev/mapper/VolGroup00-LogVol00: This is the Volume group&lt;br /&gt;
&lt;br /&gt;
        Step 9:&lt;br /&gt;
&lt;br /&gt;
           Run &amp;quot;warnquota&amp;quot; as a check that the &amp;quot;/etc/quotatab&amp;quot; files is setup correctly.&lt;br /&gt;
&lt;br /&gt;
              $ warnquota&lt;br /&gt;
&lt;br /&gt;
        Step 10:&lt;br /&gt;
&lt;br /&gt;
           Setup a daily cron job for running &amp;quot;warnquota&amp;quot;. The following should be placed&lt;br /&gt;
           in &amp;quot;/etc/cron.daily&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              #!/bin/sh&lt;br /&gt;
              # Place this file in /etc/cron.daily&lt;br /&gt;
              # with rights 0755&lt;br /&gt;
              /usr/sbin/warnquota&lt;br /&gt;
              EXITVALUE=$?&lt;br /&gt;
              if [ $EXITVALUE != 0 ]; then&lt;br /&gt;
                 /usr/bin/logger -t warnquota &amp;quot;ALERT exited abnormally with [$EXITVALUE]&amp;quot;&lt;br /&gt;
              fi&lt;br /&gt;
              exit 0&lt;br /&gt;
&lt;br /&gt;
      References:&lt;br /&gt;
        http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/sysadmin-guide/ch-disk-quotas.html&lt;br /&gt;
        (TIP 6, TIP 186, and TIP 205)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 168:&lt;br /&gt;
&lt;br /&gt;
     rdist - remote file distribution client program. You can use this program in combination with&lt;br /&gt;
     ssh. This program does more than just copy files. Once a file has been copied, you can dictate&lt;br /&gt;
     other actions to be performed. Or you can hold off copying all together if the destination is&lt;br /&gt;
     running low on inodes, or disk space.&lt;br /&gt;
&lt;br /&gt;
     For the purpose of this example, all commands will been run on &amp;quot;squeezel.squeezel.com&amp;quot;, and the&lt;br /&gt;
     computers that will be updated are &amp;quot;tape.squeezel.com&amp;quot; and &amp;quot;closet.squeezel.com&amp;quot;. Obviously, you&lt;br /&gt;
     would substitute your computer names.&lt;br /&gt;
&lt;br /&gt;
     It helps to setup ssh keys on each computer first. Reference [http://souptonuts.sourceforge.net/sshtips.htm]&lt;br /&gt;
     and (TIP 12).&lt;br /&gt;
&lt;br /&gt;
     Step 1: Create the Configuration file myDistfile&lt;br /&gt;
&lt;br /&gt;
       Below is my sample &amp;quot;myDistfile&amp;quot;. This file will access hosts &amp;quot;tape.squeezel.com&amp;quot; using username chirico&lt;br /&gt;
       and &amp;quot;closet.squeezel.com&amp;quot; with the username running this command, and copy the&lt;br /&gt;
       files &amp;quot;/home/chirico/file1&amp;quot; and &amp;quot;/home/chirico/file2&amp;quot; to the these two servers creating the&lt;br /&gt;
       directory ~/tmpdir if it doesn't exist. Once these files are updated, a mail check (&amp;quot;sendmail -bv&amp;quot;)&lt;br /&gt;
       will be performed, and mail will be sent to &amp;quot;chirico@squeezel&amp;quot;. This happens twice, once for each file.&lt;br /&gt;
&lt;br /&gt;
       Note, the line &amp;quot;/home/chirico/file2 -&amp;gt; tape.squeezel.com&amp;quot; which moves the file &amp;quot;file2&amp;quot; to&lt;br /&gt;
       tape.squeezel.com renaming the file to &amp;quot;tapedest&amp;quot; in the directory &amp;quot;/home/chirico&amp;quot;. Once this file&lt;br /&gt;
       is copied, the rights are modified to &amp;quot;chmod +r&amp;quot;.  Likewise, &amp;quot;/home/chirico/file2 -&amp;gt; closet.squeezel.com&amp;quot;&lt;br /&gt;
       copies the file file2, which is renamed as closetdest.&lt;br /&gt;
&lt;br /&gt;
                 # Contents of myDistfile&lt;br /&gt;
                 HOSTS = ( chirico@tape.squeezel.com closet.squeezel.com )&lt;br /&gt;
&lt;br /&gt;
                 FILES = ( /home/chirico/file1 /home/chirico/file2 )&lt;br /&gt;
&lt;br /&gt;
                 ${FILES} -&amp;gt; ${HOSTS}&lt;br /&gt;
                    # Directory tmpdir will be created if it doesn't exist&lt;br /&gt;
                    install tmpdir ;&lt;br /&gt;
                    special /home/chirico/file1  &amp;quot;/usr/sbin/sendmail -bv mchirico@gmail.com&amp;quot;;&lt;br /&gt;
                    notify chirico@squeezel;&lt;br /&gt;
&lt;br /&gt;
                 /home/chirico/file2 -&amp;gt; tape.squeezel.com&lt;br /&gt;
                    install  /home/chirico/tapedest;&lt;br /&gt;
                    special  /home/chirico/tapedest &amp;quot;chmod +r /home/chirico/tapedest&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
                 /home/chirico/file2 -&amp;gt; closet.squeezel.com&lt;br /&gt;
                    install /home/chirico/closetdest;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 2: Command from squeezel.squeezel.com to run myDistfile above&lt;br /&gt;
&lt;br /&gt;
       Below is the command that will execute the contents in &amp;quot;myDistfile&amp;quot;. This command is run from the&lt;br /&gt;
       computer &amp;quot;squeezel.squeezel.com&amp;quot;. All output will go in the file &amp;quot;cmd1rdist.log&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ rdist -P /usr/local/bin/ssh -f ./myDistfile -l file=./cmd1rdist.log=all&lt;br /&gt;
&lt;br /&gt;
       Obviously you want a secure copy (using scp), so the -P option uses ssh as your secure&lt;br /&gt;
       transport mechanism.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 169:&lt;br /&gt;
&lt;br /&gt;
     Restricting root logins (/etc/securetty). ctl-alt-F4 will give you a prompt for tty3. Note&lt;br /&gt;
     that it is one number less. Take a look at the contents of &amp;quot;/etc/securetty&amp;quot;. To prevent&lt;br /&gt;
     root from logging in on this device, take out tty3 from this listing. Note, you can always&lt;br /&gt;
     login as another user, then, su to root.  Below is an example of the default&lt;br /&gt;
     &amp;quot;/etc/securetty&amp;quot; that allows root to login to everything.&lt;br /&gt;
&lt;br /&gt;
         [root@squeezel ~]# cat /etc/securetty&lt;br /&gt;
         console&lt;br /&gt;
         vc/1&lt;br /&gt;
         vc/2&lt;br /&gt;
         vc/3&lt;br /&gt;
         vc/4&lt;br /&gt;
         vc/5&lt;br /&gt;
         vc/6&lt;br /&gt;
         vc/7&lt;br /&gt;
         vc/8&lt;br /&gt;
         vc/9&lt;br /&gt;
         vc/10&lt;br /&gt;
         vc/11&lt;br /&gt;
         tty1&lt;br /&gt;
         tty2&lt;br /&gt;
         tty3&lt;br /&gt;
         tty4&lt;br /&gt;
         tty5&lt;br /&gt;
         tty6&lt;br /&gt;
         tty7&lt;br /&gt;
         tty8&lt;br /&gt;
         tty9&lt;br /&gt;
         tty10&lt;br /&gt;
         tty11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 170:&lt;br /&gt;
&lt;br /&gt;
     Perl map function. Try the following to get a quick take on this function,&lt;br /&gt;
     which increments each value in the array a;&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map {$_++} @a;&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot; } @a;&lt;br /&gt;
&lt;br /&gt;
     or&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     And you can easily make modifications, like reversing the order&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     Plus there is a grep() function that works on each element as well&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse grep{ $_ &amp;gt; 3} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     To get only odd numbers in reverse order:&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse grep{ !($_ % 2)} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference: http://www-128.ibm.com/developerworks/linux/library/l-road4.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 171:&lt;br /&gt;
&lt;br /&gt;
     Perl - subroutine call and shifting through variables. A simple and useful&lt;br /&gt;
     technique.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          sub test {&lt;br /&gt;
            local $mval;&lt;br /&gt;
            while( $mval = shift ) {&lt;br /&gt;
              print &amp;quot; $mval\n&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          test(&amp;quot;one&amp;quot;,&amp;quot;two&amp;quot;,&amp;quot;three&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 172:&lt;br /&gt;
&lt;br /&gt;
     Tcp wrappers - First &amp;quot;/etc/hosts.allow&amp;quot; is check, and if there is an entry in this file, no more&lt;br /&gt;
     checking it done.  If are no matches in &amp;quot;/etc/hosts.allow&amp;quot;, the &amp;quot;/etc/hosts.deny&amp;quot; file is checked&lt;br /&gt;
     and if a match is found, that service is blocked for that host.&lt;br /&gt;
&lt;br /&gt;
     Example &amp;quot;/etc/hosts.deny&amp;quot; file:&lt;br /&gt;
&lt;br /&gt;
         sshd: 192.168.1.171&lt;br /&gt;
&lt;br /&gt;
     The above file blocks access to computer 192.168.1.171. It's also possible to run commands when&lt;br /&gt;
     someone from this computer tries to ssh in. This example sends mail.&lt;br /&gt;
&lt;br /&gt;
         sshd: 192.168.1.171: spawn (echo -e &amp;quot;%d %h %H %u&amp;quot;| /bin/mail -s 'hosts.deny entry' root)&lt;br /&gt;
&lt;br /&gt;
     Of course, you can also run commands in the &amp;quot;/etc/hosts.allow&amp;quot; if you wanted mail sent for a successful&lt;br /&gt;
     login.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 173:&lt;br /&gt;
&lt;br /&gt;
     pgrep, pkill - look up or signal process based on name and other attributes.&lt;br /&gt;
&lt;br /&gt;
     To quick find all instances of ssh running, for user root, execute the following&lt;br /&gt;
     command:&lt;br /&gt;
&lt;br /&gt;
           $ pgrep -u root -l ssh&lt;br /&gt;
&lt;br /&gt;
     To kill a process, or send a signal use the &amp;quot;pkill&amp;quot; option. For example, to&lt;br /&gt;
     make syslog reread its configuration file:&lt;br /&gt;
&lt;br /&gt;
           $ pkill -HUP syslogd&lt;br /&gt;
&lt;br /&gt;
     Another command command is &amp;quot;pidof&amp;quot; that can tell you how many processes are running.&lt;br /&gt;
     This can be useful for detecting DOS attacks.&lt;br /&gt;
&lt;br /&gt;
           $ pidof sshd&lt;br /&gt;
           4783 4781 30008 30006 29888 29886 2246&lt;br /&gt;
&lt;br /&gt;
     Above there are 7 sshd's running. Reference &amp;quot;Tcpdump, Raw Socket and Libpap Tutorial&amp;quot;&lt;br /&gt;
     at [http://souptonuts.sourceforge.net/tcpdump_tutorial.html].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 174:&lt;br /&gt;
&lt;br /&gt;
     Password Cracking - tools to check your users passwords:&lt;br /&gt;
&lt;br /&gt;
      John The Ripper&lt;br /&gt;
        http://www.openwall.com/john/&lt;br /&gt;
&lt;br /&gt;
      Crack&lt;br /&gt;
        http://www.crypticide.com/users/alecm/&lt;br /&gt;
&lt;br /&gt;
      Slurpie&lt;br /&gt;
        http://www.ussrback.com/distributed.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 175:&lt;br /&gt;
&lt;br /&gt;
     Password Aging - setting the number of days a password is valid.&lt;br /&gt;
&lt;br /&gt;
         $ chage -M 90 &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 176:&lt;br /&gt;
&lt;br /&gt;
     Kernel Performance Tuning - /Documentation/sysctl/vm.txt documents kernel settings to&lt;br /&gt;
     improve performance. Below are some examples.&lt;br /&gt;
&lt;br /&gt;
       overcommit_memory:  0 -- default estimates the amount of memory for malloc&lt;br /&gt;
                           1 -- kernel pretends there is always enough memory until it runs out&lt;br /&gt;
                           3 -- never overcommit&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/overcommit_memory&lt;br /&gt;
          0&lt;br /&gt;
&lt;br /&gt;
       page-cluster:&lt;br /&gt;
            The Linux VM subsystem avoids excessive disk seeks by reading&lt;br /&gt;
            multiple pages on a page fault. The number of pages it reads&lt;br /&gt;
            is dependent on the amount of memory in your machine.&lt;br /&gt;
        &lt;br /&gt;
            The number of pages the kernel reads in at once is equal to&lt;br /&gt;
            2 ^ page-cluster. Values above 2 ^ 5 don't make much sense&lt;br /&gt;
            for swap because we only cluster swap data in 32-page groups.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/page-cluster&lt;br /&gt;
          3&lt;br /&gt;
&lt;br /&gt;
       min_free_kbytes:&lt;br /&gt;
            This is used to force the Linux VM to keep a minimum number&lt;br /&gt;
            of kilobytes free.  The VM uses this number to compute a pages_min&lt;br /&gt;
            value for each lowmem zone in the system.  Each lowmem zone gets&lt;br /&gt;
            a number of reserved free pages based proportionally on its size.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/min_free_kbytes&lt;br /&gt;
          3831&lt;br /&gt;
&lt;br /&gt;
       max_map_count:&lt;br /&gt;
            This file contains the maximum number of memory map areas a process&lt;br /&gt;
            may have. Memory map areas are used as a side-effect of calling&lt;br /&gt;
            malloc, directly by mmap and mprotect, and also when loading shared&lt;br /&gt;
            libraries.&lt;br /&gt;
&lt;br /&gt;
            While most applications need less than a thousand maps, certain&lt;br /&gt;
            programs, particularly malloc debuggers, may consume lots of them,&lt;br /&gt;
            e.g., up to one or two maps per allocation.&lt;br /&gt;
&lt;br /&gt;
            The default value is 65536.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/max_map_count&lt;br /&gt;
          65536&lt;br /&gt;
&lt;br /&gt;
        Also see http://people.redhat.com/alikins/system_tuning.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 177:&lt;br /&gt;
&lt;br /&gt;
     IO Scheduler - /Documentation/block/as-iosched.txt documents kernel settings for disk&lt;br /&gt;
     performance.&lt;br /&gt;
&lt;br /&gt;
     If you're not sure what partitions you have &amp;quot;$ cat /proc/partitions&amp;quot;. This example&lt;br /&gt;
     assumes hda, and you can see some of the kernel settings:&lt;br /&gt;
&lt;br /&gt;
          $ ls /sys/block/hda/queue/iosched&lt;br /&gt;
          back_seek_max  back_seek_penalty  clear_elapsed  fifo_batch_expire  fifo_expire_async&lt;br /&gt;
           fifo_expire_sync  find_best_crq  key_type  quantum  queued&lt;br /&gt;
&lt;br /&gt;
     References: http://lwn.net/Articles/102505/&lt;br /&gt;
                 http://bhhdoa.org.au/pipermail/ck/2004-September/000961.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 178:&lt;br /&gt;
&lt;br /&gt;
     iozone -- getting data on disk performance (http://www.iozone.org/). This is a very&lt;br /&gt;
     comprehensive package.&lt;br /&gt;
&lt;br /&gt;
           $ wget http://www.iozone.org/src/current/iozone3_242.tar&lt;br /&gt;
           $ tar -xf iozone3_242.tar&lt;br /&gt;
           $ cd iozone3_242/src/current&lt;br /&gt;
           $ make linux&lt;br /&gt;
&lt;br /&gt;
     At this point you should read the documentation. There is no &amp;quot;make install&amp;quot;. You&lt;br /&gt;
     copy it to each filesystem you want to run this program on. Below are some quick&lt;br /&gt;
     start commands.&lt;br /&gt;
&lt;br /&gt;
       Good comprehensive test.&lt;br /&gt;
&lt;br /&gt;
           $ iozone -a&lt;br /&gt;
&lt;br /&gt;
       I prefer this for small filesystems. It limits the record size to 10000 and does&lt;br /&gt;
       the output in operations per second (higher numbers mean faster drive).&lt;br /&gt;
&lt;br /&gt;
           $ ./iozone -a -s 10000 -O&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 179:&lt;br /&gt;
&lt;br /&gt;
     history - bash command to get a history of all commands typed. But, here is a way&lt;br /&gt;
     that you can get date and time listed as well.&lt;br /&gt;
&lt;br /&gt;
           $ HISTTIMEFORMAT=&amp;quot;%y/%m/%d %T &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Defining the environment variable above give you the date/time info when you&lt;br /&gt;
     execute history:&lt;br /&gt;
&lt;br /&gt;
           $ history&lt;br /&gt;
              ...&lt;br /&gt;
               175  05/06/30 12:51:46 grep '141.162.' mout &amp;gt; mout2&lt;br /&gt;
               176  05/06/30 12:51:48 e mout2&lt;br /&gt;
               177  05/06/30 12:56:59 ls&lt;br /&gt;
               178  05/06/30 12:57:02 ls&lt;br /&gt;
               179  05/06/30 12:57:39 ls&lt;br /&gt;
               180  05/06/30 12:57:49 ls -l&lt;br /&gt;
               181  05/06/30 13:01:10 history&lt;br /&gt;
               182  05/06/30 13:01:20 HISTTIMEFORMAT=&amp;quot;%y/%m/%d %T &amp;quot;&lt;br /&gt;
               183  05/06/30 13:01:23 history&lt;br /&gt;
              ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 180:&lt;br /&gt;
&lt;br /&gt;
     .config - Fedora Core getting the .config to rebuild the kernel. You can find&lt;br /&gt;
     this file, the &amp;quot;.config&amp;quot; file at the following location:&lt;br /&gt;
&lt;br /&gt;
          $ ls &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Or, to see the contents&lt;br /&gt;
&lt;br /&gt;
          $ cat &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     This can be important, if you're planning to build your own kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 181:&lt;br /&gt;
&lt;br /&gt;
     Listing control key settings.&lt;br /&gt;
&lt;br /&gt;
          $ stty -a&lt;br /&gt;
          speed 38400 baud; rows 0; columns 0; line = 0;&lt;br /&gt;
          intr = ^C; quit = ^\; erase = &amp;lt;undef&amp;gt;; kill = &amp;lt;undef&amp;gt;; eof = ^D; eol = &amp;lt;undef&amp;gt;; eol2 = &amp;lt;undef&amp;gt;; start = ^Q;&lt;br /&gt;
          stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;&lt;br /&gt;
          -parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts&lt;br /&gt;
          -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel&lt;br /&gt;
          opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0&lt;br /&gt;
          isig icanon iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 182:&lt;br /&gt;
&lt;br /&gt;
     iptables DNAT and SNAT. You have a webserver on 192.168.1.71. When people query this webserver, you want them&lt;br /&gt;
     to goto 192.168.1.81, with no indication that they are going to another web server. In fact, they always make&lt;br /&gt;
     their web hits to 192.168.1.71.&lt;br /&gt;
&lt;br /&gt;
     The following is the iptables commands:&lt;br /&gt;
&lt;br /&gt;
        $ echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
        $ iptables -t nat -A PREROUTING -d 192.168.1.71 -p tcp --dport 80 -j DNAT --to 192.168.1.81&lt;br /&gt;
        $ iptables -t nat -A POSTROUTING -d 192.168.1.81 -s 192.168.1.0/24 -p tcp --dport 80 -j SNAT --to 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
     Change 192.168.1.0/24 to whatever source you expect the web browser to come in on. Below is the tcpdump showing&lt;br /&gt;
     all traffic is relayed via 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
         [root@closet iptables]# tcpdump -nN port 80&lt;br /&gt;
&lt;br /&gt;
         17:34:58.790398 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: S 3620106373:3620106373(0) win 16384 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790465 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: S 3620106373:3620106373(0) win 16384 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790703 IP 192.168.1.81.80 &amp;gt; 192.168.1.71.1158: S 1973665156:1973665156(0) ack 3620106374 win 5840 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790720 IP 192.168.1.71.80 &amp;gt; 192.168.1.102.1158: S 1973665156:1973665156(0) ack 3620106374 win 5840 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790951 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: . ack 1 win 17520&lt;br /&gt;
         17:34:58.790965 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: . ack 1 win 17520&lt;br /&gt;
         17:34:58.791451 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: P 1:327(326) ack 1 win 17520&lt;br /&gt;
         17:34:58.791472 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: P 1:327(326) ack 1 win 17520&lt;br /&gt;
         17:34:58.791973 IP 192.168.1.81.80 &amp;gt; 192.168.1.71.1158: . ack 327 win 6432&lt;br /&gt;
&lt;br /&gt;
     Above the web client is on &amp;quot;192.168.1.102&amp;quot;. You can see that the 1st server &amp;quot;192.168.1.71&amp;quot; then goes out to&lt;br /&gt;
     the 2nd server &amp;quot;192.168.1.81&amp;quot; on the second line. The third line shows the 2nd server &amp;quot;192.168.1.81&amp;quot; responding to&lt;br /&gt;
     the 1st server, and the forth line passes this data back to the web client &amp;quot;192.168.1.102&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Note: You can save your current iptables setting with the following command:&lt;br /&gt;
&lt;br /&gt;
         $ iptables-save &amp;gt; iptables_store&lt;br /&gt;
&lt;br /&gt;
       The big advantage is that you can store the counters as well.&lt;br /&gt;
&lt;br /&gt;
         $ iptables-save -c &amp;gt; iptables_store_w_cnts&lt;br /&gt;
&lt;br /&gt;
       To restore the file, use the following:&lt;br /&gt;
&lt;br /&gt;
         $ iptables-restore -c &amp;lt; iptables_store_w_cnts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 183:&lt;br /&gt;
&lt;br /&gt;
     mailstats - display mail statistics. This file reads data from &amp;quot;/var/log/mail/statistics&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         [root@closet ~]# mailstats&lt;br /&gt;
         Statistics from Sat Jun 25 15:59:52 2005&lt;br /&gt;
          M   msgsfr  bytes_from   msgsto    bytes_to  msgsrej msgsdis msgsqur  Mailer&lt;br /&gt;
          4        1          2K        0          0K        0       0       0  esmtp&lt;br /&gt;
          9        0          0K        1          2K        0       0       0  local&lt;br /&gt;
         =====================================================================&lt;br /&gt;
          T        1          2K        1          2K        0       0       0&lt;br /&gt;
          C        1                    0                    0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 184:&lt;br /&gt;
&lt;br /&gt;
     Profiling C Applications - Assume you have the following program p1.c:&lt;br /&gt;
&lt;br /&gt;
         /* Program  p1.c */&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
         t1(int i)&lt;br /&gt;
         {&lt;br /&gt;
                 printf(&amp;quot;t1:%d\n&amp;quot;, i);&lt;br /&gt;
         }&lt;br /&gt;
        &lt;br /&gt;
         t2(int j)&lt;br /&gt;
         {&lt;br /&gt;
                 printf(&amp;quot;t2:%d\n&amp;quot;, j);&lt;br /&gt;
         }&lt;br /&gt;
        &lt;br /&gt;
         int main(void)&lt;br /&gt;
         {&lt;br /&gt;
                 int i, j;&lt;br /&gt;
        &lt;br /&gt;
                 for (i = 0; i &amp;lt; 5; ++i) {&lt;br /&gt;
                         t1(i);&lt;br /&gt;
                         for (j = 0; j &amp;lt; 2; ++j) {&lt;br /&gt;
                                 t2(j);&lt;br /&gt;
                         }&lt;br /&gt;
                 }&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
     Compile the program as follows:&lt;br /&gt;
&lt;br /&gt;
        $ gcc -pg -g -o p1 p1.c&lt;br /&gt;
        $ ./p1&lt;br /&gt;
        t1:0&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:1&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:2&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:3&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:4&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
&lt;br /&gt;
     Next, to get the profile graph.&lt;br /&gt;
&lt;br /&gt;
        $ gprof -p -b p1&lt;br /&gt;
        Flat profile:&lt;br /&gt;
        &lt;br /&gt;
        Each sample counts as 0.01 seconds.&lt;br /&gt;
         no time accumulated&lt;br /&gt;
        &lt;br /&gt;
          %   cumulative   self              self     total&lt;br /&gt;
         time   seconds   seconds    calls  Ts/call  Ts/call  name&lt;br /&gt;
          0.00      0.00     0.00       10     0.00     0.00  t2&lt;br /&gt;
          0.00      0.00     0.00        5     0.00     0.00  t1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Above note the 10 calls to t2 and 5 calls to t1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 185:&lt;br /&gt;
&lt;br /&gt;
     CDPATH - this is a bash variable like PATH that defines a search path&lt;br /&gt;
              for the cd command.&lt;br /&gt;
&lt;br /&gt;
     Suppose you have the following directory structure:&lt;br /&gt;
&lt;br /&gt;
             /home/chirico/stuff&lt;br /&gt;
                               |-- dirA&lt;br /&gt;
                               `-- dirB&lt;br /&gt;
&lt;br /&gt;
     Assume you define CDPATH as follows:&lt;br /&gt;
&lt;br /&gt;
             CDPATH=/home/chirico/stuff&lt;br /&gt;
&lt;br /&gt;
     Now, no matter what directory you are in if you use the cd command below&lt;br /&gt;
     you will automatically move to &amp;quot;/home/chirico/stuff/dirA&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             $ cd dirA&lt;br /&gt;
&lt;br /&gt;
     Note you could be in &amp;quot;/etc&amp;quot; and will move directly to &amp;quot;/home/chirico/stuff/dirA&amp;quot;.&lt;br /&gt;
     This command has the same format as PATH - multiple entries are separated by a colon.&lt;br /&gt;
     If the current directory contain a sub-directory dirA, then, it gets priority.&lt;br /&gt;
&lt;br /&gt;
     The following is part of my .bash_profile&lt;br /&gt;
&lt;br /&gt;
             CDPATH=/work/cpearls/src/posted_on_sf/:/work/souptonuts/documentation/:/home/chirico/deleteme/&lt;br /&gt;
             export PATH CVS_RSH EDITOR JAVA_HOME CDPATH&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 186:&lt;br /&gt;
&lt;br /&gt;
     Groups - add groups and users to groups. The following shows how to create the group &amp;quot;share&amp;quot;&lt;br /&gt;
              and add the user &amp;quot;chirico&amp;quot; to this group. The following should be done as root, and&lt;br /&gt;
              assumes the account &amp;quot;chirico&amp;quot; already exits.&lt;br /&gt;
&lt;br /&gt;
             $ groupadd share&lt;br /&gt;
             $ usermod -G share chirico&lt;br /&gt;
&lt;br /&gt;
     Note the change made to &amp;quot;/etc/group&amp;quot; below:&lt;br /&gt;
&lt;br /&gt;
             $ cat /etc/group|grep 'share'&lt;br /&gt;
             share:x:616:chirico&lt;br /&gt;
&lt;br /&gt;
     If the user chirico is currently logged in, he should run the following&lt;br /&gt;
     command to immediately have group &amp;quot;share&amp;quot; rights. Or, the next time he logs&lt;br /&gt;
     in he will have access to this group.&lt;br /&gt;
&lt;br /&gt;
             $ newgrp share&lt;br /&gt;
&lt;br /&gt;
     Reference the following (TIP 6, TIP 167).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 187:&lt;br /&gt;
&lt;br /&gt;
     oprofile - steps for running oprofile on Fedora.&lt;br /&gt;
&lt;br /&gt;
     Step 1:&lt;br /&gt;
&lt;br /&gt;
       Find out what version of the kernel you are running.&lt;br /&gt;
&lt;br /&gt;
           $ uname -a&lt;br /&gt;
           Linux closet.squeezel.com 2.6.12-1.1398_FC4 #1 Fri Jul 15 00:52:32 EDT 2005 i686 i686 i386 GNU/Linux&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 2:&lt;br /&gt;
&lt;br /&gt;
       Download the source in a chosen directory. Above, I'm running 2.6.12-1, but I'm going to go for 2.6.12.3, since&lt;br /&gt;
       it's a little later. You want the signed file as well.&lt;br /&gt;
&lt;br /&gt;
           $ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.12.3.tar.gz&lt;br /&gt;
           $ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.12.3.tar.gz.sign&lt;br /&gt;
&lt;br /&gt;
       Now, check the signature.&lt;br /&gt;
&lt;br /&gt;
           $ gpg --verify linux-2.6.12.3.tar.gz.sign linux-2.6.12.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 3:&lt;br /&gt;
&lt;br /&gt;
       Unpack the file.&lt;br /&gt;
&lt;br /&gt;
           $ tar -xzf linux-2.6.12.3.tar.gz&lt;br /&gt;
           $ cd cd linux-2.6.12.3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 4:&lt;br /&gt;
&lt;br /&gt;
       Copy the &amp;quot;.config&amp;quot; used to compile your previous kernel. You should find it&lt;br /&gt;
       in the following direcotry &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       Copy it to the linux-2.6.12.3 directory.&lt;br /&gt;
&lt;br /&gt;
           $ cp &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot; .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 5:&lt;br /&gt;
&lt;br /&gt;
       Run make as follows. It will ask for a few questions on &amp;quot;make oldconfig&amp;quot;. The&lt;br /&gt;
       make installs below will have to be done with root privileges.&lt;br /&gt;
&lt;br /&gt;
          $ make oldconfig&lt;br /&gt;
          $ make bzImage&lt;br /&gt;
          $ make modules&lt;br /&gt;
          $ make modules_install&lt;br /&gt;
          $ make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 6:&lt;br /&gt;
&lt;br /&gt;
       Edit the &amp;quot;/boot/grub/grub.conf&amp;quot; and set default = 0  as shown below in this&lt;br /&gt;
       file.&lt;br /&gt;
&lt;br /&gt;
            default=0&lt;br /&gt;
            timeout=5&lt;br /&gt;
            splashimage=(hd0,2)/grub/splash.xpm.gz&lt;br /&gt;
            hiddenmenu&lt;br /&gt;
            title Fedora Core (2.6.12.3)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.12.3 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.12.3.img&lt;br /&gt;
            title Fedora Core (2.6.12-1.1398_FC4)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.12-1.1398_FC4 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.12-1.1398_FC4.img&lt;br /&gt;
            title Fedora Core (2.6.11-1.1369_FC4)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.11-1.1369_FC4 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.11-1.1369_FC4.img&lt;br /&gt;
            title Other&lt;br /&gt;
                    rootnoverify (hd0,1)&lt;br /&gt;
                    chainloader +1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 7:&lt;br /&gt;
&lt;br /&gt;
       Shutdown with the restart option.&lt;br /&gt;
&lt;br /&gt;
           $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 8:&lt;br /&gt;
&lt;br /&gt;
       Run opcontrol. The commands below are done as root.  My kernel was compiled in the following&lt;br /&gt;
       directory &amp;quot;/home/kernel/linux-2.6.12.3/&amp;quot;, so I'll run opcontrol as follows:&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --vmlinux=/home/kernel/linux-2.6.12.3/vmlinux&lt;br /&gt;
&lt;br /&gt;
       Now start.&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --start&lt;br /&gt;
           Using 2.6+ OProfile kernel interface.&lt;br /&gt;
           Reading module info.&lt;br /&gt;
           Using log file /var/lib/oprofile/oprofiled.log&lt;br /&gt;
           Daemon started.&lt;br /&gt;
           Profiler running.&lt;br /&gt;
&lt;br /&gt;
       Shutdown opcontrol.&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --shutdown&lt;br /&gt;
&lt;br /&gt;
       Run report.&lt;br /&gt;
&lt;br /&gt;
           $ opreport&lt;br /&gt;
&lt;br /&gt;
           CPU: CPU with timer interrupt, speed 0 MHz (estimated)&lt;br /&gt;
           Profiling through timer interrupt&lt;br /&gt;
                     TIMER:0|&lt;br /&gt;
             samples|      %|&lt;br /&gt;
           ------------------&lt;br /&gt;
              156088 99.8746 vmlinux&lt;br /&gt;
                  60  0.0384 libc-2.3.5.so&lt;br /&gt;
                  30  0.0192 oprofiled&lt;br /&gt;
                  23  0.0147 libcrypto.so.0.9.7f&lt;br /&gt;
                  13  0.0083 bash&lt;br /&gt;
                  12  0.0077 screen&lt;br /&gt;
                  10  0.0064 sshd&lt;br /&gt;
                   9  0.0058 ssh&lt;br /&gt;
                   6  0.0038 ip_tables&lt;br /&gt;
                   6  0.0038 libncurses.so.5.4&lt;br /&gt;
                   5  0.0032 b44&lt;br /&gt;
                   5  0.0032 ext3&lt;br /&gt;
                   5  0.0032 ld-2.3.5.so&lt;br /&gt;
                   4  0.0026 ip_conntrack&lt;br /&gt;
                   4  0.0026 jbd&lt;br /&gt;
                   2  0.0013 grep&lt;br /&gt;
                   1 6.4e-04 libdns.so.20.0.2&lt;br /&gt;
                   1 6.4e-04 libisc.so.9.1.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Reference the following for more documentation:&lt;br /&gt;
             http://oprofile.sourceforge.net/doc/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 188:&lt;br /&gt;
&lt;br /&gt;
     cyrus-imapd with Postfix using sasldb for authentication. For this example&lt;br /&gt;
     the server is tape.squeezel.com and the user is chirico.&lt;br /&gt;
&lt;br /&gt;
        Step 1:&lt;br /&gt;
        &lt;br /&gt;
                   $ yum install cyrus-imapd&lt;br /&gt;
                   $ yum install cyrus-imapd-utils&lt;br /&gt;
        &lt;br /&gt;
            You need &amp;quot;cyrus-imapd-utils&amp;quot; for cyradm.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 2:&lt;br /&gt;
        &lt;br /&gt;
          Edit /etc/imapd.conf&lt;br /&gt;
        &lt;br /&gt;
               configdirectory: /var/lib/imap&lt;br /&gt;
               partition-default: /var/spool/imap&lt;br /&gt;
               admins: cyrus&lt;br /&gt;
               sievedir: /var/lib/imap/sieve&lt;br /&gt;
               sendmail: /usr/sbin/sendmail&lt;br /&gt;
               hashimapspool: true&lt;br /&gt;
               # Chirico Commented the below line&lt;br /&gt;
               # sasl_pwcheck_method: saslauthd&lt;br /&gt;
               # Because using sasldb&lt;br /&gt;
               sasl_pwcheck_method: auxprop&lt;br /&gt;
               sasl_auxprop_plugin: sasldb&lt;br /&gt;
               #  Chirico end change&lt;br /&gt;
               sasl_mech_list: PLAIN&lt;br /&gt;
               tls_cert_file: /usr/share/ssl/certs/cyrus-imapd.pem&lt;br /&gt;
               tls_key_file: /usr/share/ssl/certs/cyrus-imapd.pem&lt;br /&gt;
               tls_ca_file: /usr/share/ssl/certs/ca-bundle.crt&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 3:&lt;br /&gt;
        &lt;br /&gt;
           Create a user and password:&lt;br /&gt;
        &lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` cyrus&lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` chirico&lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` allmail&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
           This will automatically create the file /etc/sasldb2. But look&lt;br /&gt;
           at the default rights, assuming you ran saslpasswd2 as root:&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /etc/sasldb2&lt;br /&gt;
                 -rw-r-----  1 root root 12288 Jul 31 09:50 /etc/sasldb2&lt;br /&gt;
        &lt;br /&gt;
           We need to correct this in step 4.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 4:&lt;br /&gt;
        &lt;br /&gt;
                 $ chown root.mail /etc/sasldb2&lt;br /&gt;
                 $ ls -l /etc/sasldb2&lt;br /&gt;
                 -rw-r-----  1 root mail 12288 Jul 31 09:50 /etc/sasldb2&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 5:&lt;br /&gt;
        &lt;br /&gt;
            Update &amp;quot;/etc/postfix/main.cf&amp;quot;. Note in /etc/imapd.conf the configdirectory&lt;br /&gt;
            points to /var/lib/imap, and if I look at this directory I see the&lt;br /&gt;
            socket directory. However, after staring /etc/init.d/cyrus-imapd  there&lt;br /&gt;
            will be a socket file &amp;quot;/var/lib/imap/socket/lmtp&amp;quot;. (See step 6).&lt;br /&gt;
        &lt;br /&gt;
                  mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp&lt;br /&gt;
                  mailbox_transport = cyrus&lt;br /&gt;
        &lt;br /&gt;
            Restart postfix.&lt;br /&gt;
        &lt;br /&gt;
                  /etc/init.d/postfix restart&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 6:&lt;br /&gt;
&lt;br /&gt;
            Start cyrus-imapd and look for the socket file.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
                   $ /etc/init.d/cyrus-imapd restart&lt;br /&gt;
                   Shutting down cyrus-imapd:                                 [  OK  ]&lt;br /&gt;
                   Starting cyrus-imapd: preparing databases... done.         [  OK  ]&lt;br /&gt;
        &lt;br /&gt;
            Now you should see the lmtp file:&lt;br /&gt;
        &lt;br /&gt;
                   $ ls -l /var/lib/imap/socket/lmtp&lt;br /&gt;
                   srwxrwxrwx  1 root root 0 Jul 31 10:04 /var/lib/imap/socket/lmtp&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 7:&lt;br /&gt;
        &lt;br /&gt;
            Add users. Note, you may have to go back to step 3 to add them to /etc/sasldb2&lt;br /&gt;
            as well.&lt;br /&gt;
        &lt;br /&gt;
                   $ su - cyrus&lt;br /&gt;
                   $ cyradm tape.squeezel.com&lt;br /&gt;
                   tape.squeezel.com&amp;gt; cm user.chirico&lt;br /&gt;
                   tape.squeezel.com&amp;gt; quit&lt;br /&gt;
        &lt;br /&gt;
            Now got back as root, and check that everything was created correctly.&lt;br /&gt;
        &lt;br /&gt;
                   $ ls /var/spool/imap/c/user/&lt;br /&gt;
                   total 8&lt;br /&gt;
                   drwx------  2 cyrus mail 4096 Jul 31 10:21 chirico&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 8:&lt;br /&gt;
        &lt;br /&gt;
             Run a mail test. We'll do this as root to the chirico account.&lt;br /&gt;
        &lt;br /&gt;
                   $ mail -s 'First test'  chirico&lt;br /&gt;
                   first test&lt;br /&gt;
                   .&lt;br /&gt;
        &lt;br /&gt;
             Now, still as root check the maillog. Normally everything should work.&lt;br /&gt;
        &lt;br /&gt;
                  $ tail /var/log/maillog&lt;br /&gt;
        &lt;br /&gt;
             However, I got the following error below.&lt;br /&gt;
&lt;br /&gt;
                     Jul 31 10:29:03 tape postfix/cleanup[30124]: AE7CB1B34A4: message-id=&amp;lt;20050731142903.AE7CB1B34A4@tape.squeezel.com&amp;gt;&lt;br /&gt;
                     Jul 31 10:29:03 tape postfix/qmgr[30120]: AE7CB1B34A4: from=&amp;lt;root@tape.squeezel.com&amp;gt;, size=315, nrcpt=1 (queue active)&lt;br /&gt;
                     Jul 31 10:29:03 tape pipe[30128]: fatal: pipe_comand: execvp /cyrus/bin/deliver: No such file or directory&lt;br /&gt;
&lt;br /&gt;
             If you get a similiar error, you may need to adjust the settting in /etc/postfix/master.cf&lt;br /&gt;
        &lt;br /&gt;
                 # This is the problem in /etc/postfix/master.cf&lt;br /&gt;
                 cyrus     unix  -       n       n       -       -       pipe&lt;br /&gt;
                   user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}&lt;br /&gt;
        &lt;br /&gt;
             My deliver file is the following&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
                 -rwxr-xr-x  1 root root 846228 Apr  4 18:59 /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
        &lt;br /&gt;
             So I need to change my /etc/postfix/master.cf as follows:&lt;br /&gt;
        &lt;br /&gt;
                 # Fix because by deliver file is under  /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
                 cyrus     unix  -       n       n       -       -       pipe&lt;br /&gt;
                   user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -r ${sender} -m ${extension} ${user}&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
             If changes were needed, like I had to do, restart postfix&lt;br /&gt;
        &lt;br /&gt;
                 $ /etc/init.d/postfix restart&lt;br /&gt;
        &lt;br /&gt;
             Now, if everything works, you should start to see numbers in the spool directory like &amp;quot;1.&amp;quot; and&lt;br /&gt;
             &amp;quot;2.&amp;quot;.&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /var/spool/imap/c/user/chirico/&lt;br /&gt;
                 total 40&lt;br /&gt;
                 -rw-------  1 cyrus mail  545 Jul 31 10:44 1.&lt;br /&gt;
                 -rw-------  1 cyrus mail  547 Jul 31 10:45 2.&lt;br /&gt;
                 -rw-------  1 cyrus mail 1276 Jul 31 10:45 cyrus.cache&lt;br /&gt;
                 -rw-------  1 cyrus mail  153 Jul 31 10:21 cyrus.header&lt;br /&gt;
                 -rw-------  1 cyrus mail  196 Jul 31 10:45 cyrus.index&lt;br /&gt;
&lt;br /&gt;
        Step 9:&lt;br /&gt;
        &lt;br /&gt;
             Local firewall.&lt;br /&gt;
        &lt;br /&gt;
                 # imap&lt;br /&gt;
                iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 143 -j ACCEPT&lt;br /&gt;
                iptables -A INPUT -p tcp -s 192.168.1.0/24  --dport 143 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        Step 10:&lt;br /&gt;
        &lt;br /&gt;
             Configure cyrus-imapd to start for run-level 3 and 5.&lt;br /&gt;
&lt;br /&gt;
                 # chkconfig --level 35 cyrus-imapd on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       HINTS - &lt;br /&gt;
&lt;br /&gt;
        Something to watch out for:&lt;br /&gt;
&lt;br /&gt;
              Something to watch out for: If a user creates a .forward file in their shell account with the&lt;br /&gt;
              following entry, then, mail will not get mail relayed to cyrus.&lt;br /&gt;
&lt;br /&gt;
                  &amp;quot;|exec /usr/bin/procmail&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             The /etc/maillog will show something like this:&lt;br /&gt;
&lt;br /&gt;
                    to=&amp;lt;chirico@squeezel.squeezel.com&amp;gt;, orig_to=&amp;lt;chirico&amp;gt;, relay=local, delay=0,&lt;br /&gt;
                          status=sent (delivered to command: exec /usr/bin/procmail)&lt;br /&gt;
&lt;br /&gt;
             Remove the &amp;quot;.forward&amp;quot; file from their home directory and you'll get the following:&lt;br /&gt;
&lt;br /&gt;
                    to=&amp;lt;chirico@squeezel.squeezel.com&amp;gt;, relay=cyrus, delay=0,&lt;br /&gt;
                          status=sent (squeezel.squeezel.com)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              mutt with IMAP?  (See TIP 190)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 189:&lt;br /&gt;
&lt;br /&gt;
     expand - convert tabs to spaces in a file.&lt;br /&gt;
&lt;br /&gt;
             $ expand How_to_Linux_and_Open_Source.txt &amp;gt; notabs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 190:&lt;br /&gt;
&lt;br /&gt;
     mutt with imap - assume you have setup imap (see tip 188). Now how do you configure&lt;br /&gt;
                      your &amp;quot;.muttrc&amp;quot; file to automatically connect, securely to the IMAP server?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       &lt;br /&gt;
     Below is an example of my &amp;quot;.muttrc&amp;quot; file. For this example, assume my password is &amp;quot;S0m3paSSw0r9&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             $ cat .muttrc&lt;br /&gt;
             set spoolfile = &amp;quot;imaps://chirico:S0m3paSSw0r9@squeezel.squeezel.com/&lt;br /&gt;
             set imap_force_ssl=yes&lt;br /&gt;
             set certificate_file=~/.mutt/certificates/72d31154.0&lt;br /&gt;
&lt;br /&gt;
     Now, you want to copy the certificate as a &amp;quot;file.pem&amp;quot; and run &amp;quot;c_rehash&amp;quot; to convert this&lt;br /&gt;
     file to a number. See the article. See the following article on how to do this under the &lt;br /&gt;
     fetchmail section.&lt;br /&gt;
&lt;br /&gt;
          http://souptonuts.sourceforge.net/postfix_tutorial.html&lt;br /&gt;
&lt;br /&gt;
     This is a quick summary of creating this key.&lt;br /&gt;
&lt;br /&gt;
             $ openssl s_client -connect squeezel.squeezel.com:995 -showcerts &amp;gt; file.pem&lt;br /&gt;
             $ c_rehash ~/.mutt/certificates&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 191:&lt;br /&gt;
&lt;br /&gt;
     Apache - CGI scripts.  There are two ways to enable CGI scripts. The second method is the&lt;br /&gt;
              prefered method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           First way, the easy way. Look for the &amp;quot;http.conf&amp;quot; file. On Fedora Core, this file can be&lt;br /&gt;
           found under &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;. Edit this file as follows to make &lt;br /&gt;
           &amp;quot;http://squeezel.squeezel.com/chirico-cgi/&amp;quot; execute scripts.&lt;br /&gt;
&lt;br /&gt;
                     ScriptAlias /chirico-cgi/ &amp;quot;/home/chirico/cgi-bin/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           Second way, the better way. Instead of doing the above, make the following change in &lt;br /&gt;
           &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                     &amp;lt;Directory /home/chirico/cgi-bin&amp;gt;&lt;br /&gt;
                      Options +ExecCGI&lt;br /&gt;
                      SetHandler chirico-cgi&lt;br /&gt;
                     &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Running a test script. Now copy the following test script into the directory &amp;quot;/home/chirico/cgi-bin&amp;quot;&lt;br /&gt;
        and change the rights to execute for the user running this.&lt;br /&gt;
&lt;br /&gt;
                  #!/bin/sh&lt;br /&gt;
                  # Save as test.cgi&lt;br /&gt;
                  #  chown apache.apache test.cgi&lt;br /&gt;
                  #  chmod 700 test.cgi&lt;br /&gt;
                  echo &amp;quot;Content-Type: text/html&amp;quot;&lt;br /&gt;
                  echo&lt;br /&gt;
                  echo &amp;quot;Hello world from user &amp;lt;b&amp;gt;`whoami`&amp;lt;/b&amp;gt;! &amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 192:&lt;br /&gt;
&lt;br /&gt;
     Bash - using getopts for your bash scripts.&lt;br /&gt;
&lt;br /&gt;
                   #!/bin/bash&lt;br /&gt;
                   while getopts &amp;quot;ab:cd:&amp;quot; Option&lt;br /&gt;
                   # b and d take arguments&lt;br /&gt;
                   #&lt;br /&gt;
                   do&lt;br /&gt;
                     case $Option in&lt;br /&gt;
                       a) echo -e &amp;quot;a = $OPTIND&amp;quot;;;&lt;br /&gt;
                       b) echo -e &amp;quot;b = $OPTIND $OPTARG&amp;quot;;;&lt;br /&gt;
                       c) echo -e &amp;quot;c = $OPTIND&amp;quot;;;&lt;br /&gt;
                       d) echo -e &amp;quot;d = $OPTIND $OPTARG&amp;quot;;;&lt;br /&gt;
                    esac&lt;br /&gt;
                  done&lt;br /&gt;
                  shift $(($OPTIND - 1))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 193:&lt;br /&gt;
&lt;br /&gt;
     Sieve - creating sieve recipes with &amp;quot;sieveshell&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     The following sieve script put all jefferson.edu mail into the &lt;br /&gt;
     folder jefferson. This assumes that I have already created the IMP &lt;br /&gt;
     directory, or mail box (INBOX.jefferson), which can be done in mutt &lt;br /&gt;
     with the &amp;quot;C&amp;quot; command. Below is an example of finding &amp;quot;jefferson.edu&amp;quot;&lt;br /&gt;
     anywhere in the header. &lt;br /&gt;
&lt;br /&gt;
         # This is a file named jefferson.siv&lt;br /&gt;
         require [&amp;quot;fileinto&amp;quot;];&lt;br /&gt;
         if header :contains &amp;quot;Received&amp;quot; &amp;quot;from jefferson.edu&amp;quot; {&lt;br /&gt;
           fileinto &amp;quot;INBOX.jefferson&amp;quot;;&lt;br /&gt;
           stop;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
     Now, from the command propt execute &amp;quot;sieveshell&amp;quot; with the hostname of the&lt;br /&gt;
     imap server. My server is squeezel.squeezel.com, so I would execute the &lt;br /&gt;
     following:&lt;br /&gt;
&lt;br /&gt;
          $ sieveshell squeezel.squeezel.com&lt;br /&gt;
          connecting to squeezel.squeezel.com&lt;br /&gt;
          Please enter your password:****&lt;br /&gt;
          &amp;gt; put jefferson.siv&lt;br /&gt;
          &amp;gt; activate jefferson.siv&lt;br /&gt;
          &amp;gt; list&lt;br /&gt;
          jefferson.siv  &amp;lt;- active script&lt;br /&gt;
          &amp;gt; quit&lt;br /&gt;
&lt;br /&gt;
     Note the put brings in the script. And you need to activiate it.&lt;br /&gt;
&lt;br /&gt;
     You can activate a sieve script for any user on your system if you are&lt;br /&gt;
     root. This is an example of activating a script for user chirico. Assume&lt;br /&gt;
     below the root prompt is &amp;quot;#&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          # sieveshell -a chirico -u chirico squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
     You can also automate everything from a bash script. But note after&lt;br /&gt;
     the -e the commands, and not a file with the commands, follows within&lt;br /&gt;
     quotes. This is the script I use for my home system.&lt;br /&gt;
&lt;br /&gt;
         #!/bin/bash&lt;br /&gt;
         sieveshell -a chirico -u chirico -e 'deactivate&lt;br /&gt;
         delete chirico.siv&lt;br /&gt;
         put chirico.siv&lt;br /&gt;
         activate chirico.siv&lt;br /&gt;
         list&lt;br /&gt;
         '  squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     References:&lt;br /&gt;
         http://wiki.fastmail.fm/index.php/SieveRecipes&lt;br /&gt;
         http://www.cyrusoft.com/sieve/#documents&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 194:&lt;br /&gt;
&lt;br /&gt;
     emacs - editing files remotely with tramp. Tramp comes with the latest version of emacs.&lt;br /&gt;
             That means if you're using Fedora core 4, with emacs, you have tramp. This is &lt;br /&gt;
             ideal for editing files on remote computers that do not use emacs.&lt;br /&gt;
&lt;br /&gt;
             Edit the &amp;quot;.emacs&amp;quot; file and add the following line:&lt;br /&gt;
&lt;br /&gt;
                 (require 'tramp)&lt;br /&gt;
                 (setq tramp-default-method &amp;quot;scp&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
             Now, to edit a file on computer tape.squeezel.com (C-x, C-f) and&lt;br /&gt;
             enter the following in Find file:&lt;br /&gt;
&lt;br /&gt;
                 Find file:/chirico@tape.squeezel.com:test.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             References:&lt;br /&gt;
&lt;br /&gt;
                    http://savannah.gnu.org/projects/tramp/&lt;br /&gt;
&lt;br /&gt;
             &lt;br /&gt;
&lt;br /&gt;
TIP 195:&lt;br /&gt;
&lt;br /&gt;
     trusted X11 forwarding - running gnome and KDE both on one screen, at the same&lt;br /&gt;
             time securely. The following assumes gnome is running on the current&lt;br /&gt;
             computer and &amp;quot;closet.squeezel.com&amp;quot; has KDE&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y  closet.squeezel.com&lt;br /&gt;
              $ startkde&lt;br /&gt;
&lt;br /&gt;
          Or assume you want to run gnome on &amp;quot;closet.squeezel.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y  closet.squeezel.com&lt;br /&gt;
              $ gnome-session&lt;br /&gt;
&lt;br /&gt;
          By default Fedora Core allows ForwardX11 over ssh. Note you want to use&lt;br /&gt;
          the -Y option above and NOT -X. &lt;br /&gt;
&lt;br /&gt;
          Suppose you want a remote &amp;quot;gnome-session&amp;quot; on ctl-alt-F12. Below is an &lt;br /&gt;
          example of getting the remote computer closet.squeezel.com, and you&lt;br /&gt;
          can still have the above configuration.&lt;br /&gt;
&lt;br /&gt;
          First you must allow magic cookies for each server connection.&lt;br /&gt;
             &lt;br /&gt;
              $ MCOOKIE=$(mcookie)&lt;br /&gt;
              $ xauth add $(hostname)/unix:1 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
              $ xauth add localhost/unix:1 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
  &lt;br /&gt;
          Again, note that you have to add this for EACH connection. So if you wanted 2 as well&lt;br /&gt;
&lt;br /&gt;
              $ MCOOKIE=$(mcookie)&lt;br /&gt;
              $ xauth add $(hostname)/unix:2 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
              $ xauth add localhost/unix:2 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
&lt;br /&gt;
          On squeezel.squeezel.com create a new xterm. If :1 is take below&lt;br /&gt;
          try :2. The vt12 is for switching to ctl-alt-F12.&lt;br /&gt;
&lt;br /&gt;
              $ xinit -- :1 vt12&lt;br /&gt;
&lt;br /&gt;
          Note, if you do not add the above cookies, you will get the follow error:&lt;br /&gt;
         &lt;br /&gt;
               Xlib: connection to &amp;quot;:1.0&amp;quot; refused by server&lt;br /&gt;
               Xlib: No protocol specified&lt;br /&gt;
&lt;br /&gt;
          The screen may be hard to read. At this point ssh -Y to the remote computer.&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y closet.squeezel.com&lt;br /&gt;
              $ gnome-session&lt;br /&gt;
&lt;br /&gt;
          Yes, you will get errors about sound and some custom drivers is the remove &lt;br /&gt;
          computer has different hardware. After is loads, you can switch back and&lt;br /&gt;
          forth between session with (ctl-alt-F12)  and (ctl-alt-F7)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 196:&lt;br /&gt;
&lt;br /&gt;
     Suspend ssh session - you have just sshed into a computer &amp;quot;ssh -l user example.com&amp;quot;, and you&lt;br /&gt;
          want to get back to the terminal prompt of the computer you started with. Escapte, by &lt;br /&gt;
          default with ssh is &amp;quot;~&amp;quot;, so enter &amp;quot;~&amp;quot; followed by &amp;quot;ctl-z&amp;quot; to suspend.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 197:&lt;br /&gt;
&lt;br /&gt;
     Quick way to send a text file &lt;br /&gt;
&lt;br /&gt;
              $ sendmail -f mike.chirico@gmail.com mchirico@comcast.net &amp;lt; /etc/fstab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 198:&lt;br /&gt;
&lt;br /&gt;
     size - determining the size of the text segment, data segment, and &amp;quot;bss&amp;quot; or uninitialized data segment.&lt;br /&gt;
&lt;br /&gt;
              $ size /bin/sh /bin/bash&lt;br /&gt;
               text        data     bss     dec     hex filename&lt;br /&gt;
              586946      22444   18784  628174   995ce /bin/sh&lt;br /&gt;
              586946      22444   18784  628174   995ce /bin/bash&lt;br /&gt;
&lt;br /&gt;
          Note above that &amp;quot;/bin/sh&amp;quot; and &amp;quot;/bin/bash&amp;quot; have equal text,data and bss numbers. It's&lt;br /&gt;
          highly likely that these are the same programs.&lt;br /&gt;
&lt;br /&gt;
              $ ls -l /bin/sh&lt;br /&gt;
               lrwxrwxrwx  1 root root 4 Jan 14  2005 /bin/sh -&amp;gt; bash&lt;br /&gt;
&lt;br /&gt;
          Yep, it's the same program. Here's a further definition of each segment.&lt;br /&gt;
&lt;br /&gt;
              Text segment: The machine instructions that the CPU executes. This is usually&lt;br /&gt;
                            read only and sharable.&lt;br /&gt;
&lt;br /&gt;
              Data segment: Contains initialized variables in a program. You also know these&lt;br /&gt;
                            as declarations and definitions.&lt;br /&gt;
&lt;br /&gt;
                               int max = 200;&lt;br /&gt;
&lt;br /&gt;
              Uninitialized data segment: Think of this as a declaration only, or data that&lt;br /&gt;
                            is only initialized by the kernel to arithmetic 0 or null pointers&lt;br /&gt;
                            before program execution.&lt;br /&gt;
&lt;br /&gt;
                               char s[10];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 199:&lt;br /&gt;
&lt;br /&gt;
     Using the at command.&lt;br /&gt;
&lt;br /&gt;
       Below is a simple example if running the ls command at 11:42am that&lt;br /&gt;
       will send mail -m to the user that executed it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       We'll execute job1 defined as follows and set to be executable. &lt;br /&gt;
&lt;br /&gt;
           $ cat ./job1&lt;br /&gt;
           #!/bin/bash&lt;br /&gt;
           date &amp;gt;&amp;gt; /tmp/job1&lt;br /&gt;
&lt;br /&gt;
       The at command is listed below. For queue &amp;quot;-q&amp;quot; names you can only&lt;br /&gt;
       specify one letter. Here we're using x. The letter determines the&lt;br /&gt;
       priority with &amp;quot;a&amp;quot; the highest.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x  -f ./job1 -m  11:54am&lt;br /&gt;
           job 3 at 2005-10-04 11:54&lt;br /&gt;
&lt;br /&gt;
       Now, if you execute the atq command, you'll get the following.&lt;br /&gt;
&lt;br /&gt;
           $ atq&lt;br /&gt;
           3       2005-10-04 11:54 x chirico&lt;br /&gt;
&lt;br /&gt;
       It's also possible to execute jobs at the command line entering&lt;br /&gt;
       a ctl-d at the end of the input.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x  -m 12:08pm&lt;br /&gt;
           at&amp;gt; ls -l&lt;br /&gt;
           at&amp;gt; who&lt;br /&gt;
           at&amp;gt; date&lt;br /&gt;
           at&amp;gt; ^D&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Or for a job to execute 1 minute from now.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x -m `date -d '1 minute' +&amp;quot;%H:%M&amp;quot;`&lt;br /&gt;
           at&amp;gt; ls -l&lt;br /&gt;
           at&amp;gt; date&lt;br /&gt;
     &lt;br /&gt;
&lt;br /&gt;
     Important points: The atd daemon must be running. To check if&lt;br /&gt;
      it's running do the following:&lt;br /&gt;
&lt;br /&gt;
            $ /etc/init.d/atd status&lt;br /&gt;
&lt;br /&gt;
      Also, if there is an /etc/at.allow file, then only users in that&lt;br /&gt;
      file will be allowed to execute at.&lt;br /&gt;
&lt;br /&gt;
      If /etc/at.deny exists but is empty and there is no /etc/at.allow,&lt;br /&gt;
      then, everyone can execute the at command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 200:&lt;br /&gt;
&lt;br /&gt;
     lsusb - command will display all USB buses and all devices connected.&lt;br /&gt;
&lt;br /&gt;
        $ lsusb&lt;br /&gt;
        Bus 005 Device 003: ID 413c:2010 Dell Computer Corp.&lt;br /&gt;
        Bus 005 Device 002: ID 413c:1003 Dell Computer Corp.&lt;br /&gt;
        Bus 005 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 004 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 003 Device 003: ID 0fc5:1227 Delcom Engineering&lt;br /&gt;
        Bus 003 Device 002: ID 046d:c016 Logitech, Inc. Optical Mouse&lt;br /&gt;
        Bus 003 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 002 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 001 Device 001: ID 0000:0000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 201:&lt;br /&gt;
&lt;br /&gt;
     Memory fragmentation - if you suspect workload memory fragmentation issues&lt;br /&gt;
     and you want to monitor the current state of you system, then, consider&lt;br /&gt;
     looking at the output from /proc/buddyinfo on recent kernels.&lt;br /&gt;
&lt;br /&gt;
        $ cat /proc/buddyinfo&lt;br /&gt;
      Node 0, zone      DMA    541    218     42      2      0      0      0      1      1      1      0 &lt;br /&gt;
      Node 0, zone   Normal   2508   2614     52      1      5      5      0      1      1      1      0 &lt;br /&gt;
      Node 0, zone  HighMem      0      1      3      0      1      0      0      0      0      0      0 &lt;br /&gt;
&lt;br /&gt;
     The following definition is taken from  ./Documentation/filesystems/proc.txt in the &lt;br /&gt;
     Linux kernel source.&lt;br /&gt;
&lt;br /&gt;
       Each column represents the number of pages of a certain order which are&lt;br /&gt;
       available.  In this case, there are 0 chunks of 2^0*PAGE_SIZE available in&lt;br /&gt;
       ZONE_DMA, 4 chunks of 2^1*PAGE_SIZE in ZONE_DMA, 101 chunks of 2^4*PAGE_SIZE&lt;br /&gt;
       available in ZONE_NORMAL, etc...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 202:&lt;br /&gt;
&lt;br /&gt;
     arp - Linux ARP kernel moduel.  This command implements the Address Resolution Protocol.&lt;br /&gt;
&lt;br /&gt;
     This is an example of the command.&lt;br /&gt;
&lt;br /&gt;
        $ arp&lt;br /&gt;
        Address                  HWtype  HWaddress           Flags Mask            Iface&lt;br /&gt;
        tape.squeezel.com        ether   00:50:DA:60:5B:AD   C                     eth0&lt;br /&gt;
        squeezel.squeezel.com    ether   00:11:11:8A:BE:3F   C                     eth0&lt;br /&gt;
        gw.squeezel.com          ether   00:0F:66:47:15:73   C                     eth0&lt;br /&gt;
&lt;br /&gt;
       &lt;br /&gt;
TIP 203:&lt;br /&gt;
&lt;br /&gt;
     dbench - performance monitoring. &lt;br /&gt;
&lt;br /&gt;
     So, how does your system react when the load average is above 600. Have you even seen a &lt;br /&gt;
     computer with a load average of 600? Well, this could be your chance. &lt;br /&gt;
&lt;br /&gt;
         Reference: http://freshmeat.net/projects/dbench/&lt;br /&gt;
&lt;br /&gt;
     The following gives a load average of 10 on my system.&lt;br /&gt;
&lt;br /&gt;
        $ dbench 34&lt;br /&gt;
&lt;br /&gt;
     If you want a higher load, just increase the number.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 204:&lt;br /&gt;
&lt;br /&gt;
     /etc guide - a listing of common files in the /etc directory.&lt;br /&gt;
&lt;br /&gt;
        /etc/exports: this file is used to configure NFS.&lt;br /&gt;
&lt;br /&gt;
        /etc/ftpusers: the users on your system who are restricted from FTP login.&lt;br /&gt;
&lt;br /&gt;
        /etc/motd: message of the day, which users see after login.&lt;br /&gt;
&lt;br /&gt;
        /etc/named.conf: DNS config file.&lt;br /&gt;
&lt;br /&gt;
        /etc/profile: common user information.&lt;br /&gt;
&lt;br /&gt;
        /etc/inittab: this file contains runlevel start information.&lt;br /&gt;
&lt;br /&gt;
        /etc/services: the services and their respective ports.&lt;br /&gt;
&lt;br /&gt;
        /etc/shells: this contains the names of all shells installed on the system.&lt;br /&gt;
&lt;br /&gt;
        /etc/passwd: this file contains user information.&lt;br /&gt;
&lt;br /&gt;
        /etc/group: security group rights.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
TIP 205: &lt;br /&gt;
&lt;br /&gt;
     logger - is a bash command utility for writing to /var/log/messages or the&lt;br /&gt;
            other files defined in /etc/syslog.conf.&lt;br /&gt;
&lt;br /&gt;
            $ logger -t TEST more of a test here&lt;br /&gt;
&lt;br /&gt;
         This is what shows up in /var/log/messages&lt;br /&gt;
  &lt;br /&gt;
            Oct 28 07:15:50 squeezel TEST: more of a test here&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
TIP 206: &lt;br /&gt;
&lt;br /&gt;
     accton, lastcomm - accouting on and last command. This is &lt;br /&gt;
         a way to monitor users on your system. As root, you &lt;br /&gt;
         would implement this as follows:&lt;br /&gt;
&lt;br /&gt;
           $ accton -h&lt;br /&gt;
            Usage: accton [-hV] [file]&lt;br /&gt;
            [--help] [--version]&lt;br /&gt;
&lt;br /&gt;
            The system's default process accounting file is /var/account/pacct.&lt;br /&gt;
&lt;br /&gt;
         Note the default file location is /var/account/pacct so we'll turn&lt;br /&gt;
         it on system wide with the following command.&lt;br /&gt;
&lt;br /&gt;
           $ accton /var/account/pacct&lt;br /&gt;
&lt;br /&gt;
         Now take a look at this file. It will grow. To see command that&lt;br /&gt;
         are executed, use the lastcomm command.&lt;br /&gt;
&lt;br /&gt;
           $ lastcomm&lt;br /&gt;
&lt;br /&gt;
         The above command gives output for all users. To get the data&lt;br /&gt;
         for user &amp;quot;chirico&amp;quot; execute the following command:&lt;br /&gt;
&lt;br /&gt;
           $ lastcomm --user chirico&lt;br /&gt;
&lt;br /&gt;
         You can also get a summary of commands with sa.&lt;br /&gt;
&lt;br /&gt;
           [chirico@big ~]$ sa&lt;br /&gt;
           30       5.23re       0.00cp    10185k&lt;br /&gt;
           11       4.83re       0.00cp     8961k   ***other&lt;br /&gt;
            8       0.13re       0.00cp    19744k   nagios*&lt;br /&gt;
            4       0.00re       0.00cp     2542k   automount*&lt;br /&gt;
            3       0.00re       0.00cp      680k   sa&lt;br /&gt;
            2       0.13re       0.00cp    17424k   check_ping&lt;br /&gt;
            2       0.13re       0.00cp      978k   ping&lt;br /&gt;
&lt;br /&gt;
         To turn off accounting, execute accton without a filename.&lt;br /&gt;
&lt;br /&gt;
           $ accton&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 207:&lt;br /&gt;
&lt;br /&gt;
     CPU Temperature on a laptop. The following is the temperature&lt;br /&gt;
       of my Dell laptop. &lt;br /&gt;
&lt;br /&gt;
           $ cat /proc/acpi/thermal_zone/THM/temperature&lt;br /&gt;
           temperature:             58 C&lt;br /&gt;
&lt;br /&gt;
      &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 208:&lt;br /&gt;
&lt;br /&gt;
     script -f with mkfifo to allow another user to view what you type&lt;br /&gt;
          in real-time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Step 1.  Create a fifo (first in first out) file that the other&lt;br /&gt;
              user can view. For this example create the file /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
               [chirico@laptop ~]$ mkfifo /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
        Step 2.  Have the second user, voyeur user, cat this file. Output will block&lt;br /&gt;
              for them until you complete step 3. The other user, voyer,&lt;br /&gt;
              is executing the command below.&lt;br /&gt;
 &lt;br /&gt;
               [voyeur@laptop ~]$ cat /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
        Step 3.  The original user runs the following command.&lt;br /&gt;
&lt;br /&gt;
               [chirico@laptop ~]$ script -f  /tmp/scriptout&lt;br /&gt;
               Script started, file is /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
             Now anything typed, including a vi session, will be displayed to the&lt;br /&gt;
             voyeur user in step 2. &lt;br /&gt;
&lt;br /&gt;
        See TIP 46.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 209:&lt;br /&gt;
&lt;br /&gt;
     fsck forced on next reboot.  To do this, as root issue the following commands.&lt;br /&gt;
&lt;br /&gt;
            $ cd /&lt;br /&gt;
            $ touch forcefsck&lt;br /&gt;
&lt;br /&gt;
          Now reboot the system, and when it comes up fsck will be forced on the system.&lt;br /&gt;
&lt;br /&gt;
            $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 210:&lt;br /&gt;
&lt;br /&gt;
     /dev/random and /dev/urandom differ in their random generating properties. /dev/random&lt;br /&gt;
        only returns bytes when enough noise has been generated from the entropy pool. In&lt;br /&gt;
        contrast /dev/urandom will always return bytes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference: http://sourceforge.net/direct-dl/mchirico/cpearls/simple_but_common.tar.gz (rand.c)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 211:&lt;br /&gt;
&lt;br /&gt;
     Want to find out the speed of your NIC?  (Full Duplex or Half), then use ethtool.&lt;br /&gt;
&lt;br /&gt;
               [root@squeezel ~]# ethtool eth0&lt;br /&gt;
               Settings for eth0:&lt;br /&gt;
                       Supported ports: [ MII ]&lt;br /&gt;
                       Supported link modes:   10baseT/Half 10baseT/Full&lt;br /&gt;
                                               100baseT/Half 100baseT/Full&lt;br /&gt;
                                               1000baseT/Half 1000baseT/Full&lt;br /&gt;
                       Supports auto-negotiation: Yes&lt;br /&gt;
                       Advertised link modes:  10baseT/Half 10baseT/Full&lt;br /&gt;
                                               100baseT/Half 100baseT/Full&lt;br /&gt;
                                               1000baseT/Half 1000baseT/Full&lt;br /&gt;
                       Advertised auto-negotiation: Yes&lt;br /&gt;
                       Speed: 100Mb/s&lt;br /&gt;
                       Duplex: Full&lt;br /&gt;
                       Port: Twisted Pair&lt;br /&gt;
                       PHYAD: 1&lt;br /&gt;
                       Transceiver: internal&lt;br /&gt;
                       Auto-negotiation: on&lt;br /&gt;
                       Supports Wake-on: g&lt;br /&gt;
                       Wake-on: d&lt;br /&gt;
                       Current message level: 0x000000ff (255)&lt;br /&gt;
                       Link detected: yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 212:&lt;br /&gt;
&lt;br /&gt;
     rpm install hang? You might need to delete the lock state information. &lt;br /&gt;
&lt;br /&gt;
        $ nl /etc/rc.d/rc.sysinit | grep rpm&lt;br /&gt;
        720   rm -f /var/lib/rpm/__db* &amp;amp;&amp;gt; /dev/null&lt;br /&gt;
&lt;br /&gt;
     Note the command &lt;br /&gt;
&lt;br /&gt;
        $ rm -f /var/lib/rpm/__db*&lt;br /&gt;
&lt;br /&gt;
     Because sometimes you will run &amp;quot;rpm -ivh somerpm&amp;quot; and it will just sit&lt;br /&gt;
     there.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 213:&lt;br /&gt;
&lt;br /&gt;
     Apache - limit access to certain directories based on IP address in the&lt;br /&gt;
         httpd.conf file.&lt;br /&gt;
&lt;br /&gt;
          You can do this completely from /etc/httpd/conf/httpd.conf which&lt;br /&gt;
          are shown below for multiple IP addresses. Note that all 3 setting&lt;br /&gt;
          are the same.&lt;br /&gt;
&lt;br /&gt;
                10.0.0.0/255.0.0.0&lt;br /&gt;
                10.0.0.0/8&lt;br /&gt;
                10&lt;br /&gt;
&lt;br /&gt;
          However, the following is different&lt;br /&gt;
&lt;br /&gt;
                10.0.0.0/24   only allows 10.0.0.1 to 10.0.0.254&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Some complete settings in /etc/httpd/conf/httpd.conf &lt;br /&gt;
&lt;br /&gt;
             &amp;lt;Directory /var/www/html/chirico/&amp;gt;&lt;br /&gt;
                 Order allow,deny&lt;br /&gt;
                 Allow from 10.0.0.0/8      # All 10.&lt;br /&gt;
                 Allow from 192.168.0.0/16  # All 192.168&lt;br /&gt;
                 Allow from 127             # All 127.&lt;br /&gt;
             &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          Don't forget to reload httpd with the following command.&lt;br /&gt;
        &lt;br /&gt;
             $ /etc/init.d/httpd reload&lt;br /&gt;
&lt;br /&gt;
          &lt;br /&gt;
&lt;br /&gt;
TIP 214:&lt;br /&gt;
&lt;br /&gt;
     Open Files - determining how many files are currently open.&lt;br /&gt;
&lt;br /&gt;
             $ cat /proc/sys/fs/file-nr&lt;br /&gt;
             2030    263     104851&lt;br /&gt;
              |       |        \- maximum open file descriptors &lt;br /&gt;
              |       |         &lt;br /&gt;
              |       \- total free allocated file descriptors&lt;br /&gt;
              |&lt;br /&gt;
              (Total allocated file descriptors since boot)&lt;br /&gt;
&lt;br /&gt;
        Note the maximum number can be set or changed.&lt;br /&gt;
&lt;br /&gt;
              $ cat /proc/sys/fs/file-max&lt;br /&gt;
              104851&lt;br /&gt;
&lt;br /&gt;
        To change this&lt;br /&gt;
&lt;br /&gt;
              $ echo &amp;quot;804854&amp;quot; &amp;gt; /proc/sys/fs/file-max&lt;br /&gt;
 &lt;br /&gt;
        Note lsof | wc -l will report higher numbers because this includes&lt;br /&gt;
        open files that are not using file descriptors such as directories,&lt;br /&gt;
        memory mapped files, and executable text files.&lt;br /&gt;
&lt;br /&gt;
        (Reference http://www.netadmintools.com/art295.html&lt;br /&gt;
         and also see the man page for this: man 5 proc )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 215:&lt;br /&gt;
&lt;br /&gt;
     Ctrl-Alt-Del will cause an immediate reboot, without syncing dirty buffers by&lt;br /&gt;
     setting the value &amp;gt; 0 in /proc/sys/kernel/ctrl-alt-del.&lt;br /&gt;
&lt;br /&gt;
               $ echo 1 &amp;gt; /proc/sys/kernel/ctrl-alt-del&lt;br /&gt;
       &lt;br /&gt;
&lt;br /&gt;
        (Reference: man 5 proc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 216:&lt;br /&gt;
&lt;br /&gt;
     Redefining keys in X using xev and xmodmap.  The program xev, used in an X window &lt;br /&gt;
     terminal screen will display information on mouse movements, keys pressed and &lt;br /&gt;
     released.&lt;br /&gt;
&lt;br /&gt;
        $ xev&lt;br /&gt;
&lt;br /&gt;
     Now type shift-4 and you'll notice the event details below:&lt;br /&gt;
&lt;br /&gt;
        KeyPress event, serial 29, synthetic NO, window 0x3800001,&lt;br /&gt;
            root 0x60, subw 0x0, time 55307049, (418,242), root:(428,339),&lt;br /&gt;
            state 0x1, keycode 13 (keysym 0x24, dollar), same_screen YES,&lt;br /&gt;
            XLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
            XmbLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
            XFilterEvent returns: False&lt;br /&gt;
        &lt;br /&gt;
        KeyRelease event, serial 29, synthetic NO, window 0x3800001,&lt;br /&gt;
            root 0x60, subw 0x0, time 55307184, (418,242), root:(428,339),&lt;br /&gt;
            state 0x1, keycode 13 (keysym 0x24, dollar), same_screen YES,&lt;br /&gt;
            XLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
       &lt;br /&gt;
     So, if you want to redefine this key to say copyright, see (/usr/X11R6/include/X11/keysymdef.h)&lt;br /&gt;
     you would type the following.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 copyright'&lt;br /&gt;
&lt;br /&gt;
     To get the key back to the dollar, issue the following command.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 dollar'&lt;br /&gt;
&lt;br /&gt;
     By the way it's possible to define multiple key codes for a sigle key. You'll need&lt;br /&gt;
     to have a key defined as the Mode_switch. Perhaps you'd like to use the Windows key,&lt;br /&gt;
     or the key with the Microsoft logo on it, since you're using Linux. This key is&lt;br /&gt;
     keycode 115&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 115 = Mode_switch'&lt;br /&gt;
&lt;br /&gt;
     Now you could define 3 values to the shift-4. For this example use ld, Yen and dollar.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 dollar sterling yen'&lt;br /&gt;
&lt;br /&gt;
     So pressing the keys gives you the following:&lt;br /&gt;
&lt;br /&gt;
          shift-$          (dollar sign)&lt;br /&gt;
          Windows-$        (lb sign)&lt;br /&gt;
          Windows-shift-$  (Yen sign)&lt;br /&gt;
&lt;br /&gt;
     You could go crazy and redefine all you keys.&lt;br /&gt;
&lt;br /&gt;
     (Thanks to hisham for this tip).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 217:&lt;br /&gt;
&lt;br /&gt;
     Threads - which version of threads are you using?&lt;br /&gt;
&lt;br /&gt;
          $ getconf GNU_LIBPTHREAD_VERSION&lt;br /&gt;
          NPTL 2.3.90&lt;br /&gt;
&lt;br /&gt;
     For a history on threads used with gcc reference the following:&lt;br /&gt;
          &lt;br /&gt;
          http://en.wikipedia.org/wiki/NPTL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 218:&lt;br /&gt;
&lt;br /&gt;
     Screenshots using ImageMagick. &lt;br /&gt;
&lt;br /&gt;
        If you want the entire screen, execute the following:&lt;br /&gt;
&lt;br /&gt;
            $ import -window root screen.png&lt;br /&gt;
&lt;br /&gt;
        Or to crosshair select the region with your mouse, execute &lt;br /&gt;
        the following instead.&lt;br /&gt;
&lt;br /&gt;
            $ import screen.png&lt;br /&gt;
&lt;br /&gt;
        KDE has the ability to take screenshots with the command below.&lt;br /&gt;
&lt;br /&gt;
            $ ksnapshot&lt;br /&gt;
&lt;br /&gt;
        GNOME likewise has a command too.&lt;br /&gt;
&lt;br /&gt;
            $ gnome-panel-screenshot --delay 6&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Visting ImageMagick again, the xwininfo command give window information and the id can be&lt;br /&gt;
        used to capture images with the import command.&lt;br /&gt;
&lt;br /&gt;
            $ xwininfo&lt;br /&gt;
&lt;br /&gt;
          xwininfo: Please select the window about which you&lt;br /&gt;
          would like information by clicking the&lt;br /&gt;
          mouse in that window.&lt;br /&gt;
&lt;br /&gt;
          xwininfo: Window id: 0x1e00007 &amp;quot;chirico@squeezel:/work/svn/souptonuts - Shell - Konsole&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          Absolute upper-left X:  4&lt;br /&gt;
          Absolute upper-left Y:  21&lt;br /&gt;
          Relative upper-left X:  0&lt;br /&gt;
          Relative upper-left Y:  0&lt;br /&gt;
          Width: 880&lt;br /&gt;
          Height: 510&lt;br /&gt;
          Depth: 24&lt;br /&gt;
          Visual Class: TrueColor&lt;br /&gt;
          Border width: 0&lt;br /&gt;
          Class: InputOutput&lt;br /&gt;
          Colormap: 0x20 (installed)&lt;br /&gt;
          Bit Gravity State: NorthWestGravity&lt;br /&gt;
          Window Gravity State: NorthWestGravity&lt;br /&gt;
          Backing Store State: NotUseful&lt;br /&gt;
          Save Under State: no&lt;br /&gt;
          Map State: IsViewable&lt;br /&gt;
          Override Redirect State: no&lt;br /&gt;
          Corners:  +4+21  -396+21  -396-493  +4-493&lt;br /&gt;
          -geometry 880x510+0+0&lt;br /&gt;
&lt;br /&gt;
        Now use the import command with the Window id. My example is shown below.&lt;br /&gt;
&lt;br /&gt;
             $ import -window 0x1e00007  id.miff&lt;br /&gt;
&lt;br /&gt;
        And to quickly display this image that you just saved, use the display command.&lt;br /&gt;
&lt;br /&gt;
             $ display id.miff &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 219:&lt;br /&gt;
&lt;br /&gt;
     File Access over SSH using FUSE (Filesystem in USErspace). This is a very good way to &lt;br /&gt;
     mount a remote filesystem locally. It's  like a secure NFS mount, but you don't require &lt;br /&gt;
     admin privileges on the remote computer. You do need to have fuse-sshfs installed on &lt;br /&gt;
     the local computer that will perform the filesystem mount.&lt;br /&gt;
&lt;br /&gt;
     The following works with Fedora Core 5. Only the users added to the fuse group can mout &lt;br /&gt;
     external drives. Below the user chirico is being added to the group fuse.&lt;br /&gt;
&lt;br /&gt;
             $ yum install fuse-sshfs&lt;br /&gt;
             $ usermod -a -G fuse chirico&lt;br /&gt;
     &lt;br /&gt;
     You'll need to reboot.&lt;br /&gt;
&lt;br /&gt;
             $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
             &lt;br /&gt;
     Next I'm going to mount the remote filesystem v0.squeezel.com. This is done as user chirico&lt;br /&gt;
     on the local computer. I'm using root on the remote computer v0.squeezel.com because I&lt;br /&gt;
     want to mount the complete drive.&lt;br /&gt;
&lt;br /&gt;
             $ mkdir v0&lt;br /&gt;
             $ sshfs root@v0.squeezel.com:/  v0&lt;br /&gt;
             $ cd v0&lt;br /&gt;
             $ ls -l&lt;br /&gt;
               bin   dev  home  lost+found     media  mnt  opt   q     sbin     srv  tmp  var&lt;br /&gt;
               boot  etc  lib   master_backup  misc   net  proc  root  selinux  sys  usr&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
     Now to unmount the filesystem&lt;br /&gt;
&lt;br /&gt;
             $ fusermount -u /home/chirico/v0&lt;br /&gt;
&lt;br /&gt;
     Yes, you can mount the filesystem on boot. Below shows an example entry for /etc/fstab, but&lt;br /&gt;
     this only allows user on the current system to view what is is /mnt/v0. &lt;br /&gt;
&lt;br /&gt;
             sshfs#root@v0.squeezel.com:/var/log             /mnt/v0 fuse defaults    0 0&lt;br /&gt;
&lt;br /&gt;
     References:&lt;br /&gt;
        (http://fuse.sourceforge.net/sshfs.html)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 220:&lt;br /&gt;
&lt;br /&gt;
     OpenVPN - A full-featured SSL VPN solution. The following demonstrates&lt;br /&gt;
               a very simple OpenVPN setup between two Fedora Core 5 computers&lt;br /&gt;
               big.squeezel.com 192.168.1.12 and tape.squeezel.com 192.168.1.155&lt;br /&gt;
&lt;br /&gt;
               As root install the package on both computers.&lt;br /&gt;
&lt;br /&gt;
                  $ yum -y install openvpn&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Setup on big.squeezel.com 192.168.1.12&lt;br /&gt;
&lt;br /&gt;
                  $ iptables -A INPUT -p udp -s 192.168.1.155  --dport 1194 -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tun+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A FORWARD -i tap+ -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
             Note - make sure you have commented out the following line &lt;br /&gt;
                    in /etc/sysconfig/iptables&lt;br /&gt;
&lt;br /&gt;
                  # -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
&lt;br /&gt;
             Now from continuting with the commands that need to be executed on &lt;br /&gt;
             big.squeezel.com 192.168.1.12 do one of the following&lt;br /&gt;
           &lt;br /&gt;
                  $ openvpn --remote tape.squeezel.com  --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 --verb 9&lt;br /&gt;
&lt;br /&gt;
             The above statement gives lots of errors. Once it's working you may want&lt;br /&gt;
             the following statement without the --verb 9 option.&lt;br /&gt;
&lt;br /&gt;
                  $ openvpn --remote tape.squeezel.com  --dev tun1 --ifconfig 10.4.0.1 10.4.0.2&lt;br /&gt;
&lt;br /&gt;
             After you finish the setup commands for tape.squeezel.com immediately below, you'll be&lt;br /&gt;
             able to access tape.squeezel.com as 10.4.0.2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Setup on tape.squeezel.com 192.168.1.155&lt;br /&gt;
&lt;br /&gt;
                  $ iptables -A INPUT -p udp -s 192.168.1.12  --dport 1194 -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tun+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A FORWARD -i tap+ -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
             Note - again, make sure you have commented out the following line &lt;br /&gt;
                    in /etc/sysconfig/iptables&lt;br /&gt;
&lt;br /&gt;
                  # -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
&lt;br /&gt;
             The openvpn commands are tape.squeezel.com are reversed from what is shown&lt;br /&gt;
             above.&lt;br /&gt;
&lt;br /&gt;
                  $ openvpn --remote big.squeezel.com --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 --verb 9&lt;br /&gt;
&lt;br /&gt;
             Or&lt;br /&gt;
                  $ openvpn --remote big.squeezel.com --dev tun1 --ifconfig 10.4.0.2 10.4.0.1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             Now you can access all services and ports from big.squeezel.com on 10.4.0.1 for &lt;br /&gt;
             such services as MySQL, secure Web, imap, etc. A quick test is nmap as follows:&lt;br /&gt;
&lt;br /&gt;
                  $ nmap -A -T4 10.4.0.1&lt;br /&gt;
&lt;br /&gt;
                  Starting Nmap 4.03 ( http://www.insecure.org/nmap/ ) at 2006-05-20 13:54 EDT&lt;br /&gt;
                  Interesting ports on 10.4.0.1:&lt;br /&gt;
                  (The 1671 ports scanned but not shown below are in state: closed)&lt;br /&gt;
                  PORT     STATE SERVICE VERSION&lt;br /&gt;
                  22/tcp   open  ssh     OpenSSH 4.3 (protocol 2.0)&lt;br /&gt;
                  111/tcp  open  rpcbind  2 (rpc #100000)&lt;br /&gt;
                  3306/tcp open  mysql   MySQL (unauthorized)&lt;br /&gt;
&lt;br /&gt;
                  Nmap finished: 1 IP address (1 host up) scanned in 7.116 seconds&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 221:&lt;br /&gt;
&lt;br /&gt;
     openssl - Some common commands.&lt;br /&gt;
&lt;br /&gt;
             Finding the openssldir (Directory for OpenSSL files).&lt;br /&gt;
&lt;br /&gt;
                  $ openssl version -a|grep OPENSSLDIR&lt;br /&gt;
                  OPENSSLDIR: &amp;quot;/etc/pki/tls&amp;quot;&lt;br /&gt;
&lt;br /&gt;
             Connect to a secure SMTP server with STARTTLS, assuming the server name is&lt;br /&gt;
             squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
                  $ openssl s_client -connect squeezel.squeezel.com:25 -starttls&lt;br /&gt;
&lt;br /&gt;
         &lt;br /&gt;
&lt;br /&gt;
      Reference (http://www.madboa.com/geek/openssl/)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 222:&lt;br /&gt;
&lt;br /&gt;
     Bash functions. This is easy, and I find it very useful to create bash functions&lt;br /&gt;
     for repeated commands. For example, suppose you want to create a quick bash function&lt;br /&gt;
     to cd to /var/log, tail messages and tail secure. You can create this function as&lt;br /&gt;
     follows:&lt;br /&gt;
&lt;br /&gt;
                  [root@v5 log]# m()&lt;br /&gt;
                  m()&lt;br /&gt;
                  &amp;gt; { cd /var/log&lt;br /&gt;
                  { cd /var/log&lt;br /&gt;
                  &amp;gt; tail messages&lt;br /&gt;
                  tail messages&lt;br /&gt;
                  &amp;gt; tail secure&lt;br /&gt;
                  tail secure&lt;br /&gt;
                  &amp;gt; }&lt;br /&gt;
                  }&lt;br /&gt;
                  &lt;br /&gt;
     Above I'm typing m() then hitting return. Note the echo on the next line followed&lt;br /&gt;
     by the prompt &amp;gt;. I then enter {. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 223:&lt;br /&gt;
&lt;br /&gt;
     Stats on DNS Server. You can get stats on your DNS server. &lt;br /&gt;
&lt;br /&gt;
       The following works for BIND 9:&lt;br /&gt;
&lt;br /&gt;
                  $ rndc stats&lt;br /&gt;
&lt;br /&gt;
         On my system I see the output in &amp;quot;/var/named/chroot/var/named/data/named_stats.txt&amp;quot;, which&lt;br /&gt;
         if an FC4 system. By the way, if you're using BIND 8, the command is &amp;quot;ndc stats&amp;quot;, but that&lt;br /&gt;
         has a completely different format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Format of the output&lt;br /&gt;
&lt;br /&gt;
            +++ Statistics Dump +++ (1153791199)&lt;br /&gt;
            success 297621&lt;br /&gt;
            referral 32&lt;br /&gt;
            nxrrset 21953&lt;br /&gt;
            nxdomain 33742&lt;br /&gt;
            recursion 28243&lt;br /&gt;
            failure 54&lt;br /&gt;
            --- Statistics Dump --- (1153791199)&lt;br /&gt;
&lt;br /&gt;
      The number (1153791199) can be converted with the date command.&lt;br /&gt;
&lt;br /&gt;
                  $ date -d '1970-01-01 1153791199 sec'&lt;br /&gt;
                  Tue Jul 25 02:33:19 EDT 2006&lt;br /&gt;
&lt;br /&gt;
      That's 1153791199 seconds since 1970-01-01 UCT. Which is 4 hours fast,&lt;br /&gt;
      from EDT.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 224:&lt;br /&gt;
&lt;br /&gt;
     snmp - simple network monitoring protocol. The following steps setup snmp on Fedora Core 5.&lt;br /&gt;
&lt;br /&gt;
                  $ yum install net-snmp*&lt;br /&gt;
&lt;br /&gt;
         Next add the following line in &amp;quot;/etc/snmp/snmpd.conf&amp;quot; at the bottom.&lt;br /&gt;
&lt;br /&gt;
                  rocommunity pA33worD&lt;br /&gt;
&lt;br /&gt;
         Start the snmp service.&lt;br /&gt;
&lt;br /&gt;
                  $ /etc/init.d/snmpd restart&lt;br /&gt;
&lt;br /&gt;
         Once started, from the command prompt, it's possible to get stats on the computer.&lt;br /&gt;
&lt;br /&gt;
                  $ snmpwalk -v 1 -c pA33worD localhost system&lt;br /&gt;
         Or&lt;br /&gt;
                  $ snmpwalk -v 1 -c pA33worD localhost interface&lt;br /&gt;
&lt;br /&gt;
         Or&lt;br /&gt;
                  $ snmpgetnext -v 1 -c pA33worD localhost sysUpTime&lt;br /&gt;
                  DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (26452) 0:04:24.52&lt;br /&gt;
&lt;br /&gt;
         Note the Timeticks is in 100th of a second. So the computer above has been running&lt;br /&gt;
         for 264.52 seconds.&lt;br /&gt;
&lt;br /&gt;
         Reference( TIP 225 shows how to use MRTG for gathering snmp stats).&lt;br /&gt;
                  http://www.net-snmp.org/tutorial/tutorial-5/commands/snmpv3.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 225:&lt;br /&gt;
&lt;br /&gt;
     MRTG - Multi Router Traffic Grapher.  &lt;br /&gt;
&lt;br /&gt;
                  $ cfgmaker --output=/etc/mrtg/v5.squeezel.com \&lt;br /&gt;
                    ifref=ip --global &amp;quot;workdir:/var/www/html/mrtg/stats&amp;quot;\&lt;br /&gt;
                    pA33worD@v5.squeezel.com&lt;br /&gt;
&lt;br /&gt;
        Reference: http://www.chinalinuxpub.com/doc/www.siliconvalleyccie.com/linux-hn/mrtg.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 226:&lt;br /&gt;
&lt;br /&gt;
     Back Trace - This is a method of getting a back trace for all processes on the system.&lt;br /&gt;
                  it assumes the following: a. Kernel was build with CONFIG_MAGIC_SYS-REQ &lt;br /&gt;
                  enabled (which Fedora 5 kernels are) b. You can get direct access to the &lt;br /&gt;
                  monitor.&lt;br /&gt;
&lt;br /&gt;
             Step 1.&lt;br /&gt;
&lt;br /&gt;
                  Ctl-Alt-F1 (This brings you to the text console)&lt;br /&gt;
&lt;br /&gt;
             Step 2.&lt;br /&gt;
&lt;br /&gt;
                  Alt-ScrollLock &lt;br /&gt;
                  Ctl-ScrollLock&lt;br /&gt;
          &lt;br /&gt;
                  Note above that's Alt-ScrollLock followed by Ctl-ScrollLock. You should see&lt;br /&gt;
                  a lot of text on the screen. To fast to read, but don't worry the text will&lt;br /&gt;
                  be in /var/log/messages at the end.&lt;br /&gt;
&lt;br /&gt;
                  On my system the ScrollLock key is next to the NumLock key. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 227:&lt;br /&gt;
&lt;br /&gt;
     Ext3 Tuning - One advantage of Ext3 over Ext2 is directory indexing, which  imporves file&lt;br /&gt;
                  access in directories containing large files or when the directory contains&lt;br /&gt;
                  many files. Directory indexing improves performance by using hashed binary &lt;br /&gt;
                  trees. &lt;br /&gt;
&lt;br /&gt;
                  There are two ways to enable dir_index. First, find the device using the mount&lt;br /&gt;
                  command.&lt;br /&gt;
&lt;br /&gt;
                      $ mount&lt;br /&gt;
&lt;br /&gt;
                      /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)&lt;br /&gt;
                      proc on /proc type proc (rw)&lt;br /&gt;
                      sysfs on /sys type sysfs (rw)&lt;br /&gt;
                      devpts on /dev/pts type devpts (rw,gid=5,mode=620)&lt;br /&gt;
                      /dev/sda1 on /boot type ext3 (rw) &amp;lt;--- This is the one you want&lt;br /&gt;
                      tmpfs on /dev/shm type tmpfs (rw)&lt;br /&gt;
                      none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)&lt;br /&gt;
                      sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)&lt;br /&gt;
                      automount(pid2001) on /net type autofs (rw,fd=4,pgrp=2001,minproto=2,maxproto=4)                   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                  From the above command, the device used is /dev/sda1.  Using the tune2fs command,&lt;br /&gt;
                  directory indexing will only apply to directories created after running the &lt;br /&gt;
                  command below.               &lt;br /&gt;
&lt;br /&gt;
                       $ tune2fs -O dir_index /dev/sda1&lt;br /&gt;
&lt;br /&gt;
                  However, if you want it to apply to all directories, use the e2fsck command as  &lt;br /&gt;
                  shown below:&lt;br /&gt;
&lt;br /&gt;
                       $ e2fsck -D -f /dev/sda1&lt;br /&gt;
&lt;br /&gt;
                  You'll need to bypass the warning message.&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
     Reference: &amp;quot;Tuning Journaling File Systems: A small amount of effort an dtime can yield big&lt;br /&gt;
                results&amp;quot;,by Steve Best. Linux Magazine, September 10, 2006. This author as has&lt;br /&gt;
                a very good book titled: &amp;quot;Linux Debugging and Performance Tuning.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 228:&lt;br /&gt;
&lt;br /&gt;
     NIC bonding - binding two or more NICs to one IP address to improve performance. The following&lt;br /&gt;
                instructions were done on Fedora Core 5.&lt;br /&gt;
&lt;br /&gt;
         Step 1.&lt;br /&gt;
             &lt;br /&gt;
            Create the file ifcfg-bond0 with the IP address, netmask and gateway. Shown&lt;br /&gt;
            below is my file.&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-bond0&lt;br /&gt;
&lt;br /&gt;
                   DEVICE=bond0&lt;br /&gt;
                   IPADDR=192.168.1.12&lt;br /&gt;
                   NETMASK=255.255.255.0&lt;br /&gt;
                   GATEWAY=192.168.1.1&lt;br /&gt;
                   USERCTL=no&lt;br /&gt;
                   BOOTPROTO=none&lt;br /&gt;
                   ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
         Step 2.&lt;br /&gt;
&lt;br /&gt;
            Modify eth0, eth1 and eth2. Shown below are each one of my files. Note that&lt;br /&gt;
            you must comment out, or remove the ip address, netmask, gateway and hardware&lt;br /&gt;
            address from each one of these files, since settings should only come from&lt;br /&gt;
            the ifcfg-bond0 file above. I've chosen to comment out the lines, instead of &lt;br /&gt;
            removing, should I decide to unbond my NICS sometime in the future.&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth0&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:9D&lt;br /&gt;
                  #IPADDR=192.168.1.12&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  #GATEWAY=192.168.1.1&lt;br /&gt;
                  #USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  # Settings for Bond&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth1&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth1&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:C9&lt;br /&gt;
                  #IPADDR=192.168.1.13&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  #&lt;br /&gt;
                  # Settings for bonding&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth2&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth2&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:9D&lt;br /&gt;
                  #IPADDR=192.168.1.12&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  #GATEWAY=192.168.1.1&lt;br /&gt;
                  #USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
         Step 3.&lt;br /&gt;
&lt;br /&gt;
            Set the load parameters for bond0 bonding kernel module. Append the&lt;br /&gt;
            following lines to /etc/modprobe.conf &lt;br /&gt;
&lt;br /&gt;
                 # bonding commands &lt;br /&gt;
                 alias bond0 bonding&lt;br /&gt;
                 options bond0 mode=balance-alb miimon=100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Step 4.&lt;br /&gt;
&lt;br /&gt;
            Load the bond driver module from the command prompt.&lt;br /&gt;
&lt;br /&gt;
                 $ modprobe bonding&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Step 5.&lt;br /&gt;
&lt;br /&gt;
            Restart the network, or restart the computer. Note I restarted to computer,&lt;br /&gt;
            since my NICs above had MAC assignments.&lt;br /&gt;
&lt;br /&gt;
                 $ service network restart   # Or restart computer&lt;br /&gt;
&lt;br /&gt;
             Take a look at the proc settings. &lt;br /&gt;
&lt;br /&gt;
                 $ cat /proc/net/bonding/bond0 &lt;br /&gt;
                 Ethernet Channel Bonding Driver: v3.0.3 (March 23, 2006)&lt;br /&gt;
&lt;br /&gt;
                 Bonding Mode: adaptive load balancing&lt;br /&gt;
                 Primary Slave: None&lt;br /&gt;
                 Currently Active Slave: eth2&lt;br /&gt;
                 MII Status: up&lt;br /&gt;
                 MII Polling Interval (ms): 100&lt;br /&gt;
                 Up Delay (ms): 0&lt;br /&gt;
                 Down Delay (ms): 0&lt;br /&gt;
&lt;br /&gt;
                 Slave Interface: eth2&lt;br /&gt;
                 MII Status: up&lt;br /&gt;
                 Link Failure Count: 0&lt;br /&gt;
                 Permanent HW addr: 00:13:72:80:62:f0&lt;br /&gt;
            &lt;br /&gt;
     References:&lt;br /&gt;
&lt;br /&gt;
         http://www.cyberciti.biz/nixcraft/vivek/blogger/2006/04/linux-bond-or-team-multiple-network.php&lt;br /&gt;
          Good, well written article describing the steps above.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=24692&amp;amp;package_id=146474&lt;br /&gt;
          Documentation for bonding that can also be found in the kernel&lt;br /&gt;
          ./Documentation/networking/bonding.txt&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 229:&lt;br /&gt;
&lt;br /&gt;
     /etc/nsswitch.conf - System Databases and Name Service Switch configuration file. &lt;br /&gt;
&lt;br /&gt;
         This file determines lookup order of services. For example, to match a name&lt;br /&gt;
         to an IP address, an entry can be put into the /etc/hosts file. Or a DNS query&lt;br /&gt;
         can be made. What's the order?  Normally, it's the entry in the /etc/hosts file.&lt;br /&gt;
         because /etc/nsswitch.conf contains the following setting&lt;br /&gt;
        &lt;br /&gt;
            hosts:      files dns&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	 See man nsswitch.conf for more settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
THE FOLLOWING SECTIONS STARTS THE PROGRAMMING TIPS&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 1:&lt;br /&gt;
&lt;br /&gt;
     Simple open command that restarts the close if a signal&lt;br /&gt;
     occurs.  Also note, the POSIX standards committee decided&lt;br /&gt;
     all new functions would not use errno and would instead&lt;br /&gt;
     directly return the error number in the function.&lt;br /&gt;
&lt;br /&gt;
     A lot of functions return -1 on an error condition, then,&lt;br /&gt;
     set errno to the value of the error.  This will still work&lt;br /&gt;
     for all the well known functions; but, it's changing.&lt;br /&gt;
&lt;br /&gt;
     /* start of code open.c&lt;br /&gt;
        Compile gcc -o open open.c&lt;br /&gt;
&lt;br /&gt;
        Reference (Look for simple_but_common_x.x.x.tar.gz):&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79066&lt;br /&gt;
&lt;br /&gt;
                             */&lt;br /&gt;
     #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     #include &amp;lt;string.h&amp;gt;             /* for strerror(int errno) */&lt;br /&gt;
     #include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     #define BUFLEN 100&lt;br /&gt;
     extern int errno;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     int&lt;br /&gt;
     main (void)&lt;br /&gt;
     {&lt;br /&gt;
       int fp,error;&lt;br /&gt;
       char buf[BUFLEN+1];&lt;br /&gt;
&lt;br /&gt;
       if ((fp = open (&amp;quot;data&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1)&lt;br /&gt;
         {&lt;br /&gt;
           fprintf (stderr, &amp;quot;Can't open data: %s\n&amp;quot;, strerror (errno));&lt;br /&gt;
           return 1;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
       snprintf (buf, BUFLEN, &amp;quot;123&amp;quot;);&lt;br /&gt;
       write (fp, buf, strlen (buf));&lt;br /&gt;
&lt;br /&gt;
       // Restart close should a signal occur */&lt;br /&gt;
       while((( error = close (fp) ) == -1) &amp;amp;&amp;amp; (errno == EINTR));&lt;br /&gt;
       if(error == -1)&lt;br /&gt;
         perror(&amp;quot;Failed to close the file\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
       return 0;&lt;br /&gt;
      }&lt;br /&gt;
     /* end of open.c */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 2:&lt;br /&gt;
&lt;br /&gt;
     Example of setting the effective UID on a file&lt;br /&gt;
&lt;br /&gt;
     /*  start of code&lt;br /&gt;
       gcc uid_open.c -o uid_open&lt;br /&gt;
       su&lt;br /&gt;
       chown root.chirico uid_open&lt;br /&gt;
       chmod u+s uid_open&lt;br /&gt;
       exit&lt;br /&gt;
&lt;br /&gt;
       Now you can run this as chirico and write to the&lt;br /&gt;
       root directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     */&lt;br /&gt;
     #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;string.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     int main()&lt;br /&gt;
     {&lt;br /&gt;
             int fd;&lt;br /&gt;
&lt;br /&gt;
             if ((fd = open(&amp;quot;/root/datajunk&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1) {&lt;br /&gt;
                     fprintf(stderr, &amp;quot;Can't open file \n&amp;quot;);&lt;br /&gt;
                     return 1;&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
             write(fd, &amp;quot;0123456&amp;quot;, strlen(&amp;quot;0123456&amp;quot;));&lt;br /&gt;
             close(fd);&lt;br /&gt;
             return 0;&lt;br /&gt;
     }&lt;br /&gt;
&lt;br /&gt;
     /* end of code */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 3:&lt;br /&gt;
&lt;br /&gt;
     Writing a C http post.&lt;br /&gt;
&lt;br /&gt;
     For downloads reference:&lt;br /&gt;
      http://prdownloads.sourceforge.net/cpearls/spider.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 4:&lt;br /&gt;
&lt;br /&gt;
     Writing a 2.6.x Kernel Module:&lt;br /&gt;
&lt;br /&gt;
       Look for the latest version of &amp;quot;procreadwrite&amp;quot;.  This is a 2.6 kernel&lt;br /&gt;
       modules that demonstrates how to create /proc entires and write directly&lt;br /&gt;
       to user-land via tty.  It's updated to reflect replacement of &amp;quot;current-&amp;gt;tty&amp;quot;&lt;br /&gt;
       with &amp;quot;current-&amp;gt;signal-&amp;gt;tty&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79066&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 5:&lt;br /&gt;
&lt;br /&gt;
     Creating a filename with '\n'.  This goes with (TIP 71)&lt;br /&gt;
&lt;br /&gt;
         /**** topen.c ***********************************************************&lt;br /&gt;
           Filenames can be created with any character except the null character&lt;br /&gt;
           and a slash.&lt;br /&gt;
&lt;br /&gt;
           This example creates a file with returns '\n\n'&lt;br /&gt;
&lt;br /&gt;
           There's a way to remove a file by inode:&lt;br /&gt;
&lt;br /&gt;
               $ ls -libt *&lt;br /&gt;
&lt;br /&gt;
           And, once you know the inode&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec mv '{}' goodstuff \;&lt;br /&gt;
&lt;br /&gt;
           or&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec rm '{}' goodstuff \;&lt;br /&gt;
&lt;br /&gt;
           or&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec cat '{}' \;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Compile:&lt;br /&gt;
&lt;br /&gt;
             gcc -o topen -Wall -W -O2 -s -pipe  topen.c&lt;br /&gt;
&lt;br /&gt;
         Reference:&lt;br /&gt;
           http://prdownloads.sourceforge.net/cpearls/simple_but_common_0.0.14.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
         */&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         #include &amp;lt;string.h&amp;gt;             /* for strerror(int errno) */&lt;br /&gt;
         #include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         #define BUFLEN 100&lt;br /&gt;
         extern int errno;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         int&lt;br /&gt;
         main (void)&lt;br /&gt;
         {&lt;br /&gt;
           int fp,error;&lt;br /&gt;
           char buf[BUFLEN+1];&lt;br /&gt;
&lt;br /&gt;
           if ((fp = open (&amp;quot;\n\n\n\n\n\n\n\n\n&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1)&lt;br /&gt;
             {&lt;br /&gt;
               fprintf (stderr, &amp;quot;Can't open data: %s\n&amp;quot;, strerror (errno));&lt;br /&gt;
               return 1;&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
           snprintf (buf, BUFLEN, &amp;quot;123&amp;quot;);&lt;br /&gt;
           write (fp, buf, strlen (buf));&lt;br /&gt;
&lt;br /&gt;
           // Restart close should a signal occur */&lt;br /&gt;
           while((( error = close (fp) ) == -1) &amp;amp;&amp;amp; (errno == EINTR));&lt;br /&gt;
           if(error == -1)&lt;br /&gt;
             perror(&amp;quot;Failed to close the file\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
           return 0;&lt;br /&gt;
&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  **Note, if you want email notification after every 50 new tips have been&lt;br /&gt;
    added, then, click on the following link:&lt;br /&gt;
&lt;br /&gt;
     https://sourceforge.net/project/filemodule_monitor.php?filemodule_id=120838&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 6:&lt;br /&gt;
&lt;br /&gt;
     Working With The Lemon Parser Generator.&lt;br /&gt;
     http://prdownloads.sourceforge.net/souptonuts/lemon_examples.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 7:&lt;br /&gt;
&lt;br /&gt;
     copy command for std container output.&lt;br /&gt;
&lt;br /&gt;
        #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
        #include &amp;lt;list&amp;gt;&lt;br /&gt;
        #include &amp;lt;vector&amp;gt;&lt;br /&gt;
        #include &amp;lt;iterator&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        using namespace std;&lt;br /&gt;
        int main(void)&lt;br /&gt;
        {&lt;br /&gt;
          vector&amp;lt;int&amp;gt; v;&lt;br /&gt;
          list&amp;lt;int&amp;gt; l;&lt;br /&gt;
&lt;br /&gt;
          v.push_back(1);&lt;br /&gt;
          v.push_back(2);&lt;br /&gt;
          copy(v.begin(),v.end(),ostream_iterator&amp;lt;int&amp;gt;(cout,&amp;quot;\n&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          l.push_back(23);&lt;br /&gt;
          l.push_back(12);&lt;br /&gt;
          copy(l.begin(),l.end(),ostream_iterator&amp;lt;int&amp;gt;(cout,&amp;quot;\n&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 8:&lt;br /&gt;
&lt;br /&gt;
  /* Copyright (c) 2005 Mike Chirico mchirico@comcast.net mchirico@users.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Example of using virtual functions. Note the use of &amp;quot;initialization lists&amp;quot;&lt;br /&gt;
              for assinging the variable first and last.&lt;br /&gt;
&lt;br /&gt;
      Compile:&lt;br /&gt;
        g++ -o virtualfunc -Wall -W -O2 -s -pipe  virtual_function.cc&lt;br /&gt;
&lt;br /&gt;
      Download:&lt;br /&gt;
        http://prdownloads.sourceforge.net/cpearls/simple_but_common_cpp.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  */&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
  #include &amp;lt;string&amp;gt;&lt;br /&gt;
  #include &amp;lt;list&amp;gt;&lt;br /&gt;
  #include &amp;lt;algorithm&amp;gt;&lt;br /&gt;
  #include &amp;lt;iterator&amp;gt;&lt;br /&gt;
  #include &amp;lt;functional&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  using namespace std;&lt;br /&gt;
&lt;br /&gt;
  class Employee {&lt;br /&gt;
  string first,last;&lt;br /&gt;
  public:&lt;br /&gt;
    Employee(const string&amp;amp; fn=&amp;quot;John&amp;quot;,const  string&amp;amp; ln=&amp;quot;Smith&amp;quot;): first(fn),last(ln) {}&lt;br /&gt;
    virtual void print() const {&lt;br /&gt;
    cout &amp;lt;&amp;lt; &amp;quot;First name: &amp;quot; &amp;lt;&amp;lt; first &amp;lt;&amp;lt; &amp;quot;, Last name: &amp;quot; &amp;lt;&amp;lt; last &amp;lt;&amp;lt; endl;&lt;br /&gt;
    }&lt;br /&gt;
    virtual ~Employee() {}&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  class Manager : public Employee {&lt;br /&gt;
    int level;&lt;br /&gt;
    list&amp;lt;Employee*&amp;gt; subordinates;&lt;br /&gt;
  public:&lt;br /&gt;
    Manager(const string&amp;amp; fn=&amp;quot;Ivan&amp;quot;,const string&amp;amp; ln=&amp;quot;Stedwick&amp;quot;, int lvl=1): Employee(fn,ln), level(lvl) {}&lt;br /&gt;
    void print() {&lt;br /&gt;
      cout &amp;lt;&amp;lt; &amp;quot;Manager level: &amp;quot; &amp;lt;&amp;lt; level &amp;lt;&amp;lt; &amp;quot;  &amp;quot;;&lt;br /&gt;
      Employee::print();&lt;br /&gt;
      cout &amp;lt;&amp;lt; &amp;quot;Supervises:&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
      for_each(subordinates.begin(),subordinates.end(),mem_fun(&amp;amp;Employee::print));&lt;br /&gt;
      cout &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; endl;&lt;br /&gt;
    }&lt;br /&gt;
    void addstaff(Employee&amp;amp; staff){&lt;br /&gt;
      subordinates.push_front(&amp;amp;staff);&lt;br /&gt;
    }&lt;br /&gt;
    void addstaff(Employee* staff){&lt;br /&gt;
      subordinates.push_front(staff);&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   int main()&lt;br /&gt;
   {&lt;br /&gt;
     Employee p0(&amp;quot;Lisa&amp;quot;,&amp;quot;Payne&amp;quot;);&lt;br /&gt;
     Manager m0;&lt;br /&gt;
&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Zoe&amp;quot;,&amp;quot;Bear&amp;quot;)); /* uses void addstaff(Employee* staff) */&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Leah&amp;quot;,&amp;quot;Bopper&amp;quot;));&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Abby&amp;quot;,&amp;quot;Chicken&amp;quot;));&lt;br /&gt;
     m0.addstaff(p0);  /* void addstaff(Employee&amp;amp; staff)  needed for this one */&lt;br /&gt;
     m0.addstaff(new Employee());&lt;br /&gt;
     m0.print();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     return 0;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 9:&lt;br /&gt;
&lt;br /&gt;
   /*  Named Constructor Idiom.&lt;br /&gt;
       Reference: http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.6&lt;br /&gt;
&lt;br /&gt;
   */&lt;br /&gt;
   #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
   #include &amp;lt;cmath&amp;gt;&lt;br /&gt;
   using namespace std;&lt;br /&gt;
&lt;br /&gt;
   class Point {&lt;br /&gt;
&lt;br /&gt;
   public:&lt;br /&gt;
     static Point rectangular(float x, float y);&lt;br /&gt;
     static Point polar(float radius, float angle);&lt;br /&gt;
     float get_x() { return x_; }&lt;br /&gt;
     float get_y() { return y_; }&lt;br /&gt;
&lt;br /&gt;
   private:&lt;br /&gt;
     Point(float x, float y);&lt;br /&gt;
     float x_, y_;&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
   inline Point::Point(float x, float y)&lt;br /&gt;
     : x_(x), y_(y) {}&lt;br /&gt;
&lt;br /&gt;
   inline Point Point::rectangular(float x, float y)&lt;br /&gt;
   { return Point(x,y); }&lt;br /&gt;
&lt;br /&gt;
   inline Point Point::polar(float radius, float angle)&lt;br /&gt;
   { return Point(radius*cos(angle),radius*sin(angle)); }&lt;br /&gt;
&lt;br /&gt;
   int main(void)&lt;br /&gt;
   {&lt;br /&gt;
     Point p1 = Point::rectangular(5.7,1.2);&lt;br /&gt;
     Point p2 = Point::polar(5.7,1.2);&lt;br /&gt;
&lt;br /&gt;
     cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; p1.get_x() &amp;lt;&amp;lt; &amp;quot;, &amp;quot; &amp;lt;&amp;lt; p1.get_y() &amp;lt;&amp;lt; &amp;quot;)&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
     cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; p2.get_x() &amp;lt;&amp;lt; &amp;quot;, &amp;quot; &amp;lt;&amp;lt; p2.get_y() &amp;lt;&amp;lt; &amp;quot;)&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 10:&lt;br /&gt;
&lt;br /&gt;
   /* Copy_constructor_assignment.cc&lt;br /&gt;
      Copyright (c) 2004 GPL Mike Chirico, mchirico@comcast.net or mchirico@users.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
      Reference: &amp;quot;The C++ Programming Language&amp;quot;, 3rd ed, by Stroustrup&lt;br /&gt;
      pg. 246.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Download:&lt;br /&gt;
      http://prdownloads.sourceforge.net/cpearls/simple_but_common.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
   */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   class Name {&lt;br /&gt;
   public:&lt;br /&gt;
     char* s;&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   class Table {&lt;br /&gt;
     Name *p;&lt;br /&gt;
     size_t sz;&lt;br /&gt;
   public:&lt;br /&gt;
     Table(size_t s=15) {&lt;br /&gt;
               p = new Name[sz=s];&lt;br /&gt;
               for(size_t i=0; i&amp;lt; sz; ++i) p[i].s=&amp;quot;****&amp;quot;;&lt;br /&gt;
                          }&lt;br /&gt;
     Table(const Table &amp;amp;t);&lt;br /&gt;
     Table&amp;amp; operator=(const Table&amp;amp;);&lt;br /&gt;
     int prt();&lt;br /&gt;
     void asgn(char* ts,size_t index);&lt;br /&gt;
     ~Table(){ delete[] p; }&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Table&amp;amp; Table::operator=(const Table &amp;amp;t)&lt;br /&gt;
   {&lt;br /&gt;
     if( this != &amp;amp;t) {&lt;br /&gt;
       delete[] p;&lt;br /&gt;
       p = new Name[sz=t.sz];&lt;br /&gt;
       for(size_t i=0; i&amp;lt; t.sz; ++i) p[i]=t.p[i];&lt;br /&gt;
     }&lt;br /&gt;
     return *this;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   int Table::prt()&lt;br /&gt;
   {&lt;br /&gt;
     for(size_t i=0; i&amp;lt; sz; ++i) std::cout &amp;lt;&amp;lt; p[i].s &amp;lt;&amp;lt; &amp;quot; &amp;quot;;&lt;br /&gt;
     std::cout &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
     return 0;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   /*&lt;br /&gt;
     asgn will increase the array of strings, if needed&lt;br /&gt;
     to size index+1, and add the string ts to position&lt;br /&gt;
     index.&lt;br /&gt;
   */&lt;br /&gt;
   void Table::asgn(char* ts,size_t index)&lt;br /&gt;
   {&lt;br /&gt;
     if(index &amp;lt; sz ) {&lt;br /&gt;
        p[index].s=ts;&lt;br /&gt;
     }else if ( index &amp;gt;= sz ){&lt;br /&gt;
        Name *tp;&lt;br /&gt;
        tp=p;&lt;br /&gt;
&lt;br /&gt;
        p = new Name[index+1];&lt;br /&gt;
&lt;br /&gt;
        for(size_t i=0; i&amp;lt; sz; ++i) p[i].s=tp[i].s;&lt;br /&gt;
        delete [] tp;&lt;br /&gt;
        for(size_t i=sz; i &amp;lt; index; ++i)p[i].s=&amp;quot;****&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
        p[index].s=ts;&lt;br /&gt;
        sz=index+1;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   int main(void)&lt;br /&gt;
   {&lt;br /&gt;
&lt;br /&gt;
     Table t1;&lt;br /&gt;
     Table t2(5);&lt;br /&gt;
&lt;br /&gt;
     // this is bigger than initial sz&lt;br /&gt;
     t1.asgn(&amp;quot;myname&amp;quot;,20);&lt;br /&gt;
     t1.prt();&lt;br /&gt;
     t2.prt();&lt;br /&gt;
&lt;br /&gt;
     t1=t2;&lt;br /&gt;
&lt;br /&gt;
     t1.prt();&lt;br /&gt;
     t2.prt();&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REFERENCES:&lt;br /&gt;
&lt;br /&gt;
  (1)  http://www.tldp.org/LDP/abs/html/index.html&lt;br /&gt;
  (2)  http://www.shelldorado.com/&lt;br /&gt;
  (3)  http://www.faqs.org/ftp/usenet/news.answers/unix-faq/faq/part1&lt;br /&gt;
  (4)  http://www-106.ibm.com/developerworks/library/l-rpm1/&lt;br /&gt;
  (5)  http://www-136.ibm.com/developerworks/linux/&lt;br /&gt;
  (6)  http://www.gnu.org/manual/manual.html&lt;br /&gt;
  (7)  http://fedora.redhat.com/&lt;br /&gt;
  (8)  http://souptonuts.sourceforge.net/chirico/index.php&lt;br /&gt;
  (9)  http://www.faqs.org/faqs/&lt;br /&gt;
 (10)  http://www.faqs.org/docs/linux_network/&lt;br /&gt;
 (11)  http://www.tml.hut.fi/~viu/linux/sag/sag-0.6.2.html/index.html&lt;br /&gt;
 (12)  http://www.yolinux.com/TUTORIALS/LinuxTutorialSysAdmin.html&lt;br /&gt;
 (13)  http://sed.sourceforge.net/grabbag/scripts/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  SUMMARY:&lt;br /&gt;
   (1)(2)(3) Excellent resource for bash scripts.&lt;br /&gt;
   (4)       rpm resource&lt;br /&gt;
   (6)       GNU Manuals Online&lt;br /&gt;
   (7)       Fedora&lt;br /&gt;
   (8)       Authors Website&lt;br /&gt;
   (11)(12)  System Admin&lt;br /&gt;
   (13)      Excellent source of sed scripts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
HIGHLY RECOMMENDED BOOKS:&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX Network Programming, The Sockets Networking API&amp;quot;, Volume 1, Third Edition.&lt;br /&gt;
        W. Richard Stevens, Bill Fenner, Andrew M. Rudoff.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX Network Programming, Interprocess Communications&amp;quot;, Volume 2, Second Edition.&lt;br /&gt;
        W. Richard Stevens.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX SYSTEMS Programming, Communication, Concurrency, and Threads&amp;quot;, Kay A. Robbins,&lt;br /&gt;
        Steven Robbins&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming with POSIX Threads&amp;quot;, David R. Butenhof. Addison-Wesley&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;The C++ Programming Language&amp;quot; Third Edition. Bjarne Stroustrup. Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C Programming Language&amp;quot; (2nd Edition), Second Edition, Kernighan and Ritchie&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Advanced Linux Programming&amp;quot; by Mark Mitchell, Jeffrey Oldham, and Alex Samuel, of&lt;br /&gt;
        CodeSourcery LL. This book if free at the following resource:&lt;br /&gt;
        http://www.advancedlinuxprogramming.com/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Accelerated C++, Practical Programming by Example&amp;quot; Andrew Koenig, Barbara E. Moo.&lt;br /&gt;
        Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C: A Reference Manual&amp;quot;, Fifth Edition, Samuel P. Harbison, Guy L. Steele.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Standard Library: A Tutorial and Reference, The&amp;quot;, Nicolai M. Josuttis. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Templates: The Complete Guide&amp;quot;, David Vandevoorde, Nicolai M. Josuttis. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Exceptional C++: 47 Engineering Puzzles, Programming Problems, and Solutions&amp;quot;, Herb Sutter.&lt;br /&gt;
     Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;More Exceptional C++&amp;quot;, Herb Sutter.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Exceptional C++ Style: 40 New Engineering Puzzles, Programming Problems, and Solutions&amp;quot;,&lt;br /&gt;
       Herb Sutter. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;The Art of Computer Programming (TAOCP)&amp;quot;, Vol 1,Vol 2, Vol 3. Donald E. Knuth. Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming Perl, 3rd Edition&amp;quot;, Tom Christiansen, Jon Orwant, Larry Wall. O'Reilly.&lt;br /&gt;
       http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming from the Ground Up&amp;quot;, Jonathan Bartlett, Edited by Dominick Bruno, Jr.&lt;br /&gt;
       http://savannah.nongnu.org/download/pgubook/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Expert C Programming&amp;quot;, Peter van der Linden, Prentice Hall PTR.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Coding Standards 101 Rules, Guidelines, and Best Practices&amp;quot;, by Herb Sutter and&lt;br /&gt;
       Andrei Alexandrescu.  http://www.gotw.ca/publications/c++cs/bibliography.htm&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Linux Kernel Development: A practical guide to the design and implementation of&lt;br /&gt;
       the Linux kernel&amp;quot;, by Robert Love, Sams Publishing.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond&amp;quot;, by&lt;br /&gt;
       David Abrahams and Aleksey Gurtovoy. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
HIGHLY RECOMMENDED: PHILOSOPHICAL&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;Zen and the Art of Motorcycle Maintenance: An Inquiry into Values&amp;quot;, Robert Pirsig.&lt;br /&gt;
        http://www.virtualschool.edu/mon/Quality/PirsigZen/index.html&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;Lila: An Inquiry Into Morals&amp;quot;, Robert Pirsig.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RECOMMENDED BOOKS:&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Structure and Interpretation of Computer Programs&amp;quot;, Harold Abelson, Gerald Jay Sussman,&lt;br /&gt;
      Julie Sussman. This book is free:&lt;br /&gt;
        http://mitpress.mit.edu/sicp/full-text/book/book.html&lt;br /&gt;
              and&lt;br /&gt;
        http://www.gnu.org/software/mit-scheme/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RECOMMENDED HOTOS:&lt;br /&gt;
&lt;br /&gt;
    Linux Networking-HOWTO (Previously the Net-3 Howto)&lt;br /&gt;
     http://en.tldp.org/HOWTO/NET3-4-HOWTO.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CORRECTIONS:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following people made suggestions and corrections:&lt;br /&gt;
  - Jorge Fabregas &amp;lt;fabregasj@prtc.net&amp;gt; TIP 21&lt;br /&gt;
  - Malcolm Parsons &amp;lt;malcolm.parsons@gmail.com&amp;gt; TIP 44&lt;br /&gt;
  - Andreas Haunschmidt &amp;lt;Andreas.Haunschmidt@utanet.at&amp;gt; TIP 102, TIP 90&lt;br /&gt;
  - P@draigBrady.com (Following links )&lt;br /&gt;
  - Jacques.GARNIER-EXTERIEUR@EU.RHODIA.COM TIP 46&lt;br /&gt;
&lt;br /&gt;
                http://www.pixelbeat.org/cmdline.html&lt;br /&gt;
                http://www.pixelbeat.org/rotagator/linux.tips/rotagator.fortune&lt;br /&gt;
                http://www.pixelbeat.org/scripts/&lt;br /&gt;
&lt;br /&gt;
  - Tobias Nix &amp;lt;tobias.nix@gmail.com&amp;gt; TIP 12&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>C4tboCcdro</name></author>	</entry>

	<entry>
		<id>https://wiki.gacq.com/index.php?title=Linux_tips&amp;diff=2749</id>
		<title>Linux tips</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacq.com/index.php?title=Linux_tips&amp;diff=2749"/>
				<updated>2009-01-09T13:53:12Z</updated>
		
		<summary type="html">&lt;p&gt;C4tboCcdro: http://caraines.qsh.eu/zelgolg.htm&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://caraines.qsh.eu/zelgolg.htm amc movie .com] [http://caraines.qsh.eu/zmexplnrb.htm ejaculate galleries.squirting video] [http://spfortne.qsh.eu/20081226-adult-alyssa.html adult alyssa milano movie] [http://lofaako.strefa.pl/sitemap.html map] [http://caraines.qsh.eu/caelttro.htm anne curtis video scandal download] &lt;br /&gt;
[http://zelgetgo.0lx.net/sitemap.htm url] [http://relquaca.is-the-boss.com/20090104-lanhound-serial.html lanhound serial number] [http://bukgetert.0lx.net/article-28.htm sitemap] [http://fispruil.qsh.eu/news1763.html she will be loved video cast maroon 5] [http://bukgetert.0lx.net/article-52.htm make a movie screen] &lt;br /&gt;
[http://lifokdron.0lx.net/1739.html michael thriller video] [http://huruple.qsh.eu/20090101-interracial-video.htm interracial video tgp] [http://relquaca.is-the-boss.com/20090103-password-stealer.html password stealer crack] [http://acsitzar.0lx.net/news-most-wanted-2008-11-17.html most wanted movie] [http://vihencbr.0lx.net/secure-video.html secure video chat] &lt;br /&gt;
[http://acsitzar.0lx.net/news-jethro-tull-videos-2008-11-19.html jethro tull videos] [http://bukgetert.0lx.net/sitemap.htm links] [http://lifokdron.0lx.net/504.html movie theater in virginia] [http://flheddin.qsh.eu/brfadron-453.html motivational military videos] [http://sematild.qsh.eu/resource322.htm real player video codecs] &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Mike Chirico (mchirico@users.sourceforge.net) or (mchirico@comcast.net)&lt;br /&gt;
Copyright (C) 2004 (GNU Free Documentation License)&lt;br /&gt;
Last Updated: Thu Dec 28 16:42:50 EST 2006&lt;br /&gt;
&lt;br /&gt;
The latest version of this document can be found at:&lt;br /&gt;
http://souptonuts.sourceforge.net/how_to_linux_and_open_source.htm&lt;br /&gt;
  or text version ( if you have trouble downloading the full document: over 140 pages )&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/How_to_Linux_and_Open_Source.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on Gmail with Postix and Fetchmail&lt;br /&gt;
http://souptonuts.sourceforge.net/postfix_tutorial.html&lt;br /&gt;
&lt;br /&gt;
For tips on using SQLite (over 25 pages)&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_sqlite_tutorial.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on MySQL reference:&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_mysql.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For a recommended reading list&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/Recommended_Reading.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on upgrading RedHat 9 or 8.0 to 2.6.x src kernel&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_26.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on Comcast Email with Home Linux Box&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_COMCAST_EMAIL.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  **Note, if you want email notification after every 50 new tips have been&lt;br /&gt;
    added, then, click on the following link:&lt;br /&gt;
     https://sourceforge.net/project/filemodule_monitor.php?filemodule_id=120838&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 1:&lt;br /&gt;
&lt;br /&gt;
     Is NTP Working?&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Test the current server):&lt;br /&gt;
&lt;br /&gt;
          Try issuing the following command:&lt;br /&gt;
&lt;br /&gt;
          $ ntpq -pn&lt;br /&gt;
&lt;br /&gt;
           remote refid st t when poll reach delay offset jitter&lt;br /&gt;
           ===================================================&lt;br /&gt;
           tock.usno.navy 0.0.0.0 16 u - 64 0 0.000 0.000 4000.00&lt;br /&gt;
&lt;br /&gt;
          The above is an example of a problem.&lt;br /&gt;
          Compare it to a working configuration.&lt;br /&gt;
&lt;br /&gt;
          $ ntpq -pn&lt;br /&gt;
&lt;br /&gt;
           remote refid st t when poll reach delay offset jitter&lt;br /&gt;
           ========================================================&lt;br /&gt;
           +128.4.40.12 128.4.40.10 2 u 107 128 377 25.642 3.350 1.012&lt;br /&gt;
           127.127.1.0 127.127.1.0 10 l 40 64 377 0.000 0.000 0.008&lt;br /&gt;
           +128.91.2.13 128.4.40.12 3 u 34 128 377 21.138 6.118 0.398&lt;br /&gt;
           *192.5.41.41 .USNO. 1 u 110 128 377 33.69 9.533 3.534&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Configure the /etc/ntp.conf):&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/ntp.conf&lt;br /&gt;
&lt;br /&gt;
            # My simple client-only ntp configuration.&lt;br /&gt;
            server timeserver1.upenn.edu&lt;br /&gt;
            # ping -a timeserver1.upenn.edu shows the IP address 128.91.2.13&lt;br /&gt;
            # which is used in the restrict below&lt;br /&gt;
            restrict 128.91.2.13&lt;br /&gt;
            server tock.usno.navy.mil&lt;br /&gt;
            restrict 192.5.41.41&lt;br /&gt;
            server 128.4.40.12&lt;br /&gt;
            restrict 128.4.40.12&lt;br /&gt;
            server 127.127.1.0 # local clock&lt;br /&gt;
            fudge 127.127.1.0 stratum 10&lt;br /&gt;
            driftfile /etc/ntp/drift&lt;br /&gt;
            restrict default ignore&lt;br /&gt;
            restrict 127.0.0.0 mask 255.0.0.0&lt;br /&gt;
            authenticate no&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Configure /etc/ntp/step-tickers):&lt;br /&gt;
&lt;br /&gt;
          The values for server above are placed in the &amp;quot;/etc/ntp/step-tickers&amp;quot; file&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/ntp/step-tickers&lt;br /&gt;
&lt;br /&gt;
              timeserver1.upenn.edu&lt;br /&gt;
              tock.usno.navy.mil&lt;br /&gt;
              128.4.40.12&lt;br /&gt;
&lt;br /&gt;
          The startup script /etc/rc.d/init.d/ntpd will grab the servers in this&lt;br /&gt;
          file and execute the ntpdate command as follows:&lt;br /&gt;
&lt;br /&gt;
             /usr/sbin/ntpdate -s -b -p 8 timeserver1.upenn.edu&lt;br /&gt;
&lt;br /&gt;
          Why? Because if the time is off ntpd will not start. The command above set the&lt;br /&gt;
          clock. If System Time deviates from true time by more than 1000 seconds, then,&lt;br /&gt;
          the ntpd daemon  will enter panic mode and exit.&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Restart the service and check):&lt;br /&gt;
&lt;br /&gt;
          Issue the restart command&lt;br /&gt;
&lt;br /&gt;
            /etc/init.d/ntpd restart&lt;br /&gt;
&lt;br /&gt;
          check the values for &amp;quot;ntpq -pn&amp;quot;,&lt;br /&gt;
          which should match step 1.&lt;br /&gt;
&lt;br /&gt;
             ntpq -pn&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE:&lt;br /&gt;
&lt;br /&gt;
          Time is always stored in the kernel as the number of seconds since&lt;br /&gt;
          midnight of the 1st of January 1970 UTC, regardless of whether the&lt;br /&gt;
          hardware clock is stored as UTC or not.  Conversions to local time&lt;br /&gt;
          are done at run-time. So, it's easy to get the time in different&lt;br /&gt;
          timezones for only the current session as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ export TZ=EST&lt;br /&gt;
              $ date&lt;br /&gt;
              Mon Aug  2 10:34:04 EST 2004&lt;br /&gt;
&lt;br /&gt;
              $ export TZ=NET&lt;br /&gt;
              $ date&lt;br /&gt;
              Mon Aug  2 15:34:18 NET 2004&lt;br /&gt;
&lt;br /&gt;
          The following are possible values for TZ:&lt;br /&gt;
&lt;br /&gt;
              Hours From Greenwich Mean Time (GMT) Value Description&lt;br /&gt;
              0 GMT Greenwich Mean Time&lt;br /&gt;
              +1 ECT European Central Time&lt;br /&gt;
              +2 EET European Eastern Time&lt;br /&gt;
              +2 ART&lt;br /&gt;
              +3 EAT Saudi Arabia&lt;br /&gt;
              +3.5 MET Iran&lt;br /&gt;
              +4 NET&lt;br /&gt;
              +5 PLT West Asia&lt;br /&gt;
              +5.5 IST India&lt;br /&gt;
              +6 BST Central Asia&lt;br /&gt;
              +7 VST Bangkok&lt;br /&gt;
              +8 CTT China&lt;br /&gt;
              +9 JST Japan&lt;br /&gt;
              +9.5 ACT Central Australia&lt;br /&gt;
              +10 AET Eastern Australia&lt;br /&gt;
              +11 SST Central Pacific&lt;br /&gt;
              +12 NST New Zealand&lt;br /&gt;
              -11 MIT Samoa&lt;br /&gt;
              -10 HST Hawaii&lt;br /&gt;
              -9 AST Alaska&lt;br /&gt;
              -8 PST Pacific Standard Time&lt;br /&gt;
              -7 PNT Arizona&lt;br /&gt;
              -7 MST Mountain Standard Time&lt;br /&gt;
              -6 CST Central Standard Time&lt;br /&gt;
              -5 EST Eastern Standard Time&lt;br /&gt;
              -5 IET Indiana East&lt;br /&gt;
              -4 PRT Atlantic Standard Time&lt;br /&gt;
              -3.5 CNT Newfoundland&lt;br /&gt;
              -3 AGT Eastern South America&lt;br /&gt;
              -3 BET Eastern South America&lt;br /&gt;
              -1 CAT Azores&lt;br /&gt;
&lt;br /&gt;
              DST timezone&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              0      BST for British Summer.&lt;br /&gt;
              +400   ADT for Atlantic Daylight.&lt;br /&gt;
              +500   EDT for Eastern Daylight.&lt;br /&gt;
              +600   CDT for Central Daylight.&lt;br /&gt;
              +700   MDT for Mountain Daylight.&lt;br /&gt;
              +800   PDT for Pacific Daylight.&lt;br /&gt;
              +900   YDT for Yukon Daylight.&lt;br /&gt;
              +1000  HDT for Hawaii Daylight.&lt;br /&gt;
              -100   MEST for Middle European Summer,&lt;br /&gt;
                         MESZ for Middle European Summer,&lt;br /&gt;
                         SST for Swedish Summer and FST for French Summer.&lt;br /&gt;
              -700   WADT for West Australian Daylight.&lt;br /&gt;
              -1000  EADT for Eastern Australian Daylight.&lt;br /&gt;
              -1200  NZDT for New Zealand Daylight.&lt;br /&gt;
&lt;br /&gt;
     The following is an example of setting the TZ environment variable&lt;br /&gt;
     for the timezone, only when timezone changes go into effect.&lt;br /&gt;
&lt;br /&gt;
               $ export TZ=EST+5EDT,M4.1.0/2,M10.5.0/2&lt;br /&gt;
&lt;br /&gt;
     Take a look at the last line &amp;quot;M10.5.0/2&amp;quot;. What does it mean? Here is the&lt;br /&gt;
     documentation&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Mm.w.d This  specifies  day  d (0 &amp;lt;= d &amp;lt;= 6) of week w (1 &amp;lt;= w &amp;lt;= 5) of&lt;br /&gt;
              month m (1 &amp;lt;= m &amp;lt;= 12).  Week 1 is the first week in which day d&lt;br /&gt;
              occurs and week 5 is the last week in which day d occurs.  Day 0&lt;br /&gt;
              is a Sunday.&lt;br /&gt;
&lt;br /&gt;
              The time fields specify when, in the local time  currently  in&lt;br /&gt;
              effect, the  change  to  the  other  time  occurs.   If omitted,&lt;br /&gt;
              the default is  02:00:00.&lt;br /&gt;
&lt;br /&gt;
      So this is what it means. M10 stands for October, the 5 is the fifth week&lt;br /&gt;
      that includes a Sunday (note 0 in M10.5.0/2 is Sunday). To see that it is&lt;br /&gt;
      the fifth week see the calendar below. The time change occurs a 2am in&lt;br /&gt;
      the morning.&lt;br /&gt;
&lt;br /&gt;
                                October&lt;br /&gt;
                         Su Mo Tu We Th Fr Sa&lt;br /&gt;
                                         1  2&lt;br /&gt;
                          3  4  5  6  7  8  9&lt;br /&gt;
                         10 11 12 13 14 15 16&lt;br /&gt;
                         17 18 19 20 21 22 23&lt;br /&gt;
                         24 25 26 27 28 29 30&lt;br /&gt;
                         31&lt;br /&gt;
&lt;br /&gt;
       Prove it. Take the following program sunrise, which can calcuates sunrise&lt;br /&gt;
       and sunset for an latitude and longitude. This program can be downloaded&lt;br /&gt;
       from the following location:&lt;br /&gt;
           http://sourceforge.net/direct-dl/mchirico/souptonuts/working_with_time.tar.gz&lt;br /&gt;
&lt;br /&gt;
       Below is a bash script that will run the program for the next 100 days.&lt;br /&gt;
&lt;br /&gt;
          #!/bin/bash&lt;br /&gt;
          #  program: next100days  Mike Chirico&lt;br /&gt;
          #  download:&lt;br /&gt;
          #  http://sourceforge.net/direct-dl/mchirico/souptonuts/working_with_time.tar.gz&lt;br /&gt;
          #&lt;br /&gt;
          #  This will calculate the sunrise and sunset for&lt;br /&gt;
          #  latitude     39.95  Note must convert to degrees&lt;br /&gt;
          #  longitude  75.15  Note must convert to degrees&lt;br /&gt;
          lat=39.95&lt;br /&gt;
          long=75.15&lt;br /&gt;
          for (( i=0; i &amp;lt;= 100; i++))&lt;br /&gt;
          do&lt;br /&gt;
            sunrise    `date -d &amp;quot;+$i day&amp;quot; &amp;quot;+%Y %m %d&amp;quot;` $lat $long&lt;br /&gt;
          done&lt;br /&gt;
&lt;br /&gt;
       Take a look at the following sample output.&lt;br /&gt;
&lt;br /&gt;
           $ export TZ=EST+5EDT,M4.1.0/2,M10.5.0/2&lt;br /&gt;
           $ ./next100days&lt;br /&gt;
&lt;br /&gt;
          Sunrise  08-24-2004  06:21:12   Sunset 08-24-2004  19:43:42&lt;br /&gt;
          Sunrise  08-25-2004  06:22:09   Sunset 08-25-2004  19:42:12&lt;br /&gt;
          Sunrise  08-26-2004  06:23:06   Sunset 08-26-2004  19:40:41&lt;br /&gt;
          Sunrise  08-27-2004  06:24:03   Sunset 08-27-2004  19:39:09&lt;br /&gt;
          Sunrise  08-28-2004  06:25:00   Sunset 08-28-2004  19:37:37&lt;br /&gt;
          Sunrise  08-29-2004  06:25:56   Sunset 08-29-2004  19:36:04&lt;br /&gt;
          Sunrise  08-30-2004  06:26:53   Sunset 08-30-2004  19:34:31&lt;br /&gt;
          Sunrise  08-31-2004  06:27:50   Sunset 08-31-2004  19:32:57&lt;br /&gt;
          Sunrise  09-01-2004  06:28:46   Sunset 09-01-2004  19:31:22&lt;br /&gt;
          Sunrise  09-02-2004  06:29:43   Sunset 09-02-2004  19:29:47&lt;br /&gt;
          ..[values omitted ]&lt;br /&gt;
          Sunrise  10-28-2004  07:25:31   Sunset 10-28-2004  18:02:34&lt;br /&gt;
          Sunrise  10-29-2004  07:26:38   Sunset 10-29-2004  18:01:19&lt;br /&gt;
          Sunrise  10-30-2004  07:27:46   Sunset 10-30-2004  18:00:06&lt;br /&gt;
          Sunrise  10-31-2004  06:28:53   Sunset 10-31-2004  16:58:54&lt;br /&gt;
          Sunrise  11-01-2004  06:30:01   Sunset 11-01-2004  16:57:44&lt;br /&gt;
          Sunrise  11-02-2004  06:31:10   Sunset 11-02-2004  16:56:35&lt;br /&gt;
&lt;br /&gt;
       Compare 10-30-2004 with 10-31-2004. Sunrise is an hour earlier because&lt;br /&gt;
       daylight saving time has ended, just as predicted.&lt;br /&gt;
&lt;br /&gt;
       There is an easier way to switch between timezones. Take a look at the&lt;br /&gt;
       directory zoneinfo as follows:&lt;br /&gt;
&lt;br /&gt;
            $ ls /usr/share/zoneinfo&lt;br /&gt;
&lt;br /&gt;
            Africa      Chile    Factory    Iceland      Mexico    posix       UCT&lt;br /&gt;
            America     CST6CDT  GB         Indian       Mideast   posixrules  Universal&lt;br /&gt;
            Antarctica  Cuba     GB-Eire    Iran         MST       PRC         US&lt;br /&gt;
            Arctic      EET      GMT        iso3166.tab  MST7MDT   PST8PDT     UTC&lt;br /&gt;
            Asia        Egypt    GMT0       Israel       Navajo    right       WET&lt;br /&gt;
            Atlantic    Eire     GMT-0      Jamaica      NZ        ROC         W-SU&lt;br /&gt;
            Australia   EST      GMT+0      Japan        NZ-CHAT   ROK         zone.tab&lt;br /&gt;
            Brazil      EST5EDT  Greenwich  Kwajalein    Pacific   Singapore   Zulu&lt;br /&gt;
            Canada      Etc      Hongkong   Libya        Poland    SystemV&lt;br /&gt;
            CET         Europe   HST        MET          Portugal  Turkey&lt;br /&gt;
&lt;br /&gt;
       TZ can be set to any one of these files. Some of these are directories and contain&lt;br /&gt;
       subdirectories, such as ./posix/America. This way you don not have to enter the&lt;br /&gt;
       timezone, offset, and range for dst, since it has already been calculated.&lt;br /&gt;
&lt;br /&gt;
           $ export TZ=:/usr/share/zoneinfo/posix/America/Aruba&lt;br /&gt;
           $ export TZ=:/usr/share/zoneinfo/Egypt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Reference:&lt;br /&gt;
          http://prdownloads.sourceforge.net/cpearls/date_calc.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
          Also see  (TIP 27).&lt;br /&gt;
          Also see  (TIP 103) using chrony which is very similiar to ntpd.&lt;br /&gt;
          Note time settings can usually be found in /etc/sysconfig/clock&lt;br /&gt;
         &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 2:&lt;br /&gt;
&lt;br /&gt;
     cpio works like tar, only better.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Create two directories with data ../dir1 an ../dir2)&lt;br /&gt;
&lt;br /&gt;
          mkdir -p ../dir1&lt;br /&gt;
          mkdir -p ../dir2&lt;br /&gt;
          cp /etc/*.conf ../dir1/.&lt;br /&gt;
          cp /etc/*.cnf ../dir2/.&lt;br /&gt;
&lt;br /&gt;
          Which will backup all your cnf and conf files.&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Piping the files to tar)&lt;br /&gt;
&lt;br /&gt;
          cpio works like tar but can take input&lt;br /&gt;
          from the &amp;quot;find&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar &amp;gt; test.tar&lt;br /&gt;
               or&lt;br /&gt;
           $ find ../dir1/ | cpio -o -H tar &amp;gt; test2.tar&lt;br /&gt;
&lt;br /&gt;
          Same command without the &amp;quot;&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar -F test.tar&lt;br /&gt;
              or&lt;br /&gt;
           $ find ../dir1/ | cpio -o -H tar -F test2.tar&lt;br /&gt;
&lt;br /&gt;
          Using append&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar -F test.tar&lt;br /&gt;
             or&lt;br /&gt;
           $ find ../dir2/ | cpio -o --format=tar --append -F test.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (List contents of the tar file)&lt;br /&gt;
&lt;br /&gt;
          $ cpio -it &amp;lt; test.tar&lt;br /&gt;
                or&lt;br /&gt;
          $ cpio -it -F test.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Extract the contents)&lt;br /&gt;
&lt;br /&gt;
          $ cpio -i -F test.tar&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 3:&lt;br /&gt;
&lt;br /&gt;
     Working with tar. The basics with encryption.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Using the tar command on the directory /stuff)&lt;br /&gt;
&lt;br /&gt;
          Suppose you have a directory /stuff&lt;br /&gt;
          To tar everything in stuff to create a &amp;quot;.tar&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
          $ tar -cvf stuff.tar stuff&lt;br /&gt;
&lt;br /&gt;
          Which will create &amp;quot;stuff.tar&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Using the tar command to create a &amp;quot;.tar.gz&amp;quot; of /stuff)&lt;br /&gt;
&lt;br /&gt;
          $ tar -czf stuff.tar.gz stuff&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (List the files in the archive)&lt;br /&gt;
&lt;br /&gt;
          $ tar -tzf stuff.tar.gz&lt;br /&gt;
               or&lt;br /&gt;
          $ tar -tf stuff.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (A way to list specific files)&lt;br /&gt;
&lt;br /&gt;
          Note, pipe the results to a file and edit&lt;br /&gt;
&lt;br /&gt;
           $ tar -tzf stuff.tar.gz &amp;gt; mout&lt;br /&gt;
&lt;br /&gt;
          Then, edit mout to only include the files you want&lt;br /&gt;
&lt;br /&gt;
           $ tar -T mout -xzf stuff.tar.gz&lt;br /&gt;
&lt;br /&gt;
          The above command will only get the files in mout.&lt;br /&gt;
          Of couse, if you want them all&lt;br /&gt;
&lt;br /&gt;
           $ tar -xzf stuff.tar.gz&lt;br /&gt;
&lt;br /&gt;
     STEP 5 (ENCRYPTION)&lt;br /&gt;
&lt;br /&gt;
           $ tar -zcvf - stuff|openssl des3 -salt -k secretpassword | dd of=stuff.des3&lt;br /&gt;
&lt;br /&gt;
          This will create stuff.des3...don't forget the password you&lt;br /&gt;
          put in place of  secretpassword. This can be done interactively as&lt;br /&gt;
          well.&lt;br /&gt;
&lt;br /&gt;
            $ dd if=stuff.des3 |openssl des3 -d -k secretpassword|tar zxf -&lt;br /&gt;
&lt;br /&gt;
     NOTE:  above there is a &amp;quot;-&amp;quot; at the end... this will&lt;br /&gt;
            extract everything.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 4:&lt;br /&gt;
&lt;br /&gt;
     Creating a Virtual File System and Mounting it with a Loopback Device.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Construct a 10MB file)&lt;br /&gt;
&lt;br /&gt;
           $ dd if=/dev/zero of=/tmp/disk-image count=20480&lt;br /&gt;
&lt;br /&gt;
          By default dd uses block of 512 so the size will be 20480*512&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Make an ext2 or ext3 file system) -- ext2 shown here.&lt;br /&gt;
&lt;br /&gt;
           $ mke2fs -q&lt;br /&gt;
&lt;br /&gt;
          or if you want ext3&lt;br /&gt;
&lt;br /&gt;
           $ mkfs -t ext3 -q /tmp/disk-image&lt;br /&gt;
&lt;br /&gt;
          yes, you can even use reiser, but you'll need to create a bigger&lt;br /&gt;
          disk image. Something like &amp;quot;dd if=/dev/zero of=/tmp/disk-image count=50480&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ mkfs -t reiserfs -q /tmp/disk-image&lt;br /&gt;
&lt;br /&gt;
          Hit yes for confirmation.  It only asks this because it's a file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Create a directory &amp;quot;virtual-fs&amp;quot; and mount. This has to be done as root)&lt;br /&gt;
&lt;br /&gt;
           $ mkdir /virtual-fs&lt;br /&gt;
           $ mount -o loop=/dev/loop0 /tmp/disk-image /virtual-fs&lt;br /&gt;
&lt;br /&gt;
         SPECIAL NOTE: if you mount a second device you will have to increase the&lt;br /&gt;
                       loop count: loop=/dev/loop1, loop=/dev/loop2, ... loop=/dev/loopn&lt;br /&gt;
&lt;br /&gt;
          Now it operates just like a disk. This virtual filesystem can be mounted&lt;br /&gt;
          when the system boots by adding the following to the &amp;quot;/etc/fstab&amp;quot; file. Then,&lt;br /&gt;
          to mount, just type &amp;quot;mount /virtual-fs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                 /tmp/disk-image /virtual-fs ext2               rw,loop=/dev/loop0 0 0&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (When done, umount it)&lt;br /&gt;
&lt;br /&gt;
           $ umount /virtual-fs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE: If you are using Fedora core 2, in the /etc/fstab you can take&lt;br /&gt;
              advantage of acl properties for this mount. Note the acl next to the&lt;br /&gt;
              rw entry. This is shown here with ext3.&lt;br /&gt;
&lt;br /&gt;
                 /tmp/disk-image     /virtual-fs ext3    rw,acl,loop=/dev/loop1 0 0&lt;br /&gt;
&lt;br /&gt;
              Also, if you are using Fedora core 2 and above, you can mount the file&lt;br /&gt;
              on a cryptoloop.&lt;br /&gt;
&lt;br /&gt;
                $ dd if=/dev/urandom of=disk-aes count=20480&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ modprobe loop&lt;br /&gt;
                $ modprobe cryptoloop&lt;br /&gt;
                $ modprobe aes&lt;br /&gt;
&lt;br /&gt;
                $ losetup -e aes /dev/loop0 disk-aes&lt;br /&gt;
                $ mkfs -t ext2 /dev/loop0&lt;br /&gt;
                $ mount -o loop,encryption=aes disk-aes &amp;lt;mount point&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              If you do not have Fedora core 2, then, you can build the kernel from source&lt;br /&gt;
              with some of the following options (not complete, yet)&lt;br /&gt;
               reference:&lt;br /&gt;
     http://cvs.sourceforge.net/viewcvs.py/cpearls/cpearls/src/posted_on_sf/acl/ehd.pdf?rev=1.1&amp;amp;view=log&lt;br /&gt;
&lt;br /&gt;
                      Cryptographic API Support (CONFIG_CRYPTO)&lt;br /&gt;
                      generic loop cryptographic (CONFIG_CRYPTOLOOP)&lt;br /&gt;
                      Cryptographic ciphers (CONFIG_CIPHERS)&lt;br /&gt;
                      Enable one or more  ciphers  (CONFIG CIPHER .*) such as AES.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     HELPFUL INFORMATION: It is possible to bind mount partitions, or associate the&lt;br /&gt;
                     mounted partition to a directory name.&lt;br /&gt;
&lt;br /&gt;
                  # mount --bind  /virtual-fs      /home/mchirico/vfs&lt;br /&gt;
&lt;br /&gt;
             Also, if you want to see what filesystems are currently mounted, &amp;quot;cat&amp;quot; the&lt;br /&gt;
             file &amp;quot;/etc/mtab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
                  $ cat /etc/mtab&lt;br /&gt;
&lt;br /&gt;
     Also see TIP 91.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 5:&lt;br /&gt;
&lt;br /&gt;
     Setting up 2 IP address on &amp;quot;One&amp;quot; NIC. This example is on ethernet.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (The settings for the initial IP address)&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
&lt;br /&gt;
            DEVICE=eth0&lt;br /&gt;
            BOOTPROTO=static&lt;br /&gt;
            BROADCAST=192.168.99.255&lt;br /&gt;
            IPADDR=192.168.1.155&lt;br /&gt;
            NETMASK=255.255.252.0&lt;br /&gt;
            NETWORK=192.168.1.0&lt;br /&gt;
            ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (2nd IP address: )&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/sysconfig/network-scripts/ifcfg-eth0:1&lt;br /&gt;
&lt;br /&gt;
            DEVICE=eth0:1&lt;br /&gt;
            BOOTPROTO=static&lt;br /&gt;
            BROADCAST=192.168.99.255&lt;br /&gt;
            IPADDR=192.168.1.182&lt;br /&gt;
            NETMASK=255.255.252.0&lt;br /&gt;
            NETWORK=192.168.1.0&lt;br /&gt;
            ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
     SUMMARY  Note, in STEP 1 the filename is &amp;quot;ifcfg-eth0&amp;quot;, whereas in&lt;br /&gt;
              STEP 2 it's &amp;quot;ifcfg-eth0:1&amp;quot; and also not the matching&lt;br /&gt;
              entries for &amp;quot;DEVICE=...&amp;quot;.  Also, obviously, the&lt;br /&gt;
              &amp;quot;IPADDR&amp;quot; is different as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 6:&lt;br /&gt;
&lt;br /&gt;
     Sharing Directories Among Several Users.&lt;br /&gt;
&lt;br /&gt;
     Several people are working on a project in &amp;quot;/home/share&amp;quot;&lt;br /&gt;
     and they need to create documents and programs so that&lt;br /&gt;
     others in the group can edit and execute these documents&lt;br /&gt;
     as needed. Also see (TIP 186) for adding existing users&lt;br /&gt;
     to groups.&lt;br /&gt;
&lt;br /&gt;
       $  /usr/sbin/groupadd share&lt;br /&gt;
       $  chown -R root.share /home/share&lt;br /&gt;
       $  /usr/bin/gpasswd -a &amp;lt;username&amp;gt; share&lt;br /&gt;
       $  chmod 2775 /home/share&lt;br /&gt;
&lt;br /&gt;
       $  ls -ld /home/share&lt;br /&gt;
             drwxrwsr-x    2 root     share        4096 Nov  8 16:19 /home/share&lt;br /&gt;
                   ^---------- Note the s bit, which was set with the chmod 2775&lt;br /&gt;
&lt;br /&gt;
       $  cat /etc/group&lt;br /&gt;
          ...&lt;br /&gt;
           share:x:502:chirico,donkey,zoe&lt;br /&gt;
          ...          ^------- users are added to this group.&lt;br /&gt;
&lt;br /&gt;
     The user may need to login again to get access. Or, if the user is currently&lt;br /&gt;
     logged in, they can run the following command:&lt;br /&gt;
&lt;br /&gt;
       $ su - &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Note, the above step is recommended over  &amp;quot;newgrp - share&amp;quot; since currently&lt;br /&gt;
     newgrp in FC2,FC3, and FC4 gets access to the group but the umask is not&lt;br /&gt;
     correctly formed.&lt;br /&gt;
&lt;br /&gt;
     As root you  can test their account.&lt;br /&gt;
&lt;br /&gt;
       $ su - &amp;lt;username&amp;gt;   &amp;quot;You need to '-' to pickup thier environment  '$ su - chirico' &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Note: SUID, SGID, Sticky bit. Only the left most octet is examined, and &amp;quot;chmod 755&amp;quot; is used&lt;br /&gt;
          as an example of the full command. But, anything else could be used as well. Normally&lt;br /&gt;
          you'd want executable permissions.&lt;br /&gt;
&lt;br /&gt;
        Octal digit  Binary value      Meaning                           Example usage&lt;br /&gt;
            0           000       all cleared                             $ chmod 0755 or chmod 755&lt;br /&gt;
            1           001       sticky                                  $ chmod 1755&lt;br /&gt;
            2           010       setgid                                  $ chmod 2755&lt;br /&gt;
            3           011       setgid, sticky                          $ chmod 3755&lt;br /&gt;
            4           100       setuid                                  $ chmod 4755&lt;br /&gt;
            5           101       setuid, sticky                          $ chmod 5755&lt;br /&gt;
            6           110       setuid, setgid                          $ chmod 6755&lt;br /&gt;
            7           111       setuid, setgid, sticky                  $ chmod 7755&lt;br /&gt;
&lt;br /&gt;
     A few examples applied to a directory below. In the first example all users in the group can&lt;br /&gt;
     add files to directory &amp;quot;dirA&amp;quot; and they can delete their own files. Users cannot delete other&lt;br /&gt;
     user's files.&lt;br /&gt;
&lt;br /&gt;
        Sticky bit:&lt;br /&gt;
           $ chmod 1770  dirA&lt;br /&gt;
&lt;br /&gt;
     Below files created within the directory have the group ID of the directory, rather than that&lt;br /&gt;
     of the default group setting for the user who created the file.&lt;br /&gt;
&lt;br /&gt;
        Set group ID bit:&lt;br /&gt;
           $ chmod 2755  dirB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 7:&lt;br /&gt;
&lt;br /&gt;
     Getting Infomation on Commands&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;info&amp;quot; is a great utility for getting information about the system.&lt;br /&gt;
     Here's a quick key on using &amp;quot;info&amp;quot; from the terminal prompt.&lt;br /&gt;
&lt;br /&gt;
       'q' exits.&lt;br /&gt;
       'u' moves up to the table of contents of the current section.&lt;br /&gt;
       'n' moves to the next chapter.&lt;br /&gt;
       'p' moves to the previous chapter.&lt;br /&gt;
       'space' goes into the selected section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The following is a good starting point:&lt;br /&gt;
&lt;br /&gt;
        $ info coreutils&lt;br /&gt;
&lt;br /&gt;
      Need to find out what a certain program does?&lt;br /&gt;
&lt;br /&gt;
        $ whatis  open&lt;br /&gt;
       open   (2)  - open and possibly create a file or device&lt;br /&gt;
       open   (3)  - perl pragma to set default PerlIO layers for input and output&lt;br /&gt;
       open   (3pm)  - perl pragma to set default PerlIO layers for input and output&lt;br /&gt;
       open   (n)  - Open a file-based or command pipeline channel&lt;br /&gt;
&lt;br /&gt;
      To get specific information about the open commmand&lt;br /&gt;
&lt;br /&gt;
        $ man 2 open&lt;br /&gt;
&lt;br /&gt;
       also try 'keyword' search, which is the same as the apropos command.&lt;br /&gt;
       For example, to find all the man pages on selinux, type the following:&lt;br /&gt;
&lt;br /&gt;
        $ man -k selinux&lt;br /&gt;
&lt;br /&gt;
       or the man full word search. Same as whatis command.&lt;br /&gt;
&lt;br /&gt;
        $ man -f &amp;lt;some string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       This is a hint once you are inside man.&lt;br /&gt;
&lt;br /&gt;
        space      moves forward one page&lt;br /&gt;
        b          moves backward&lt;br /&gt;
        y          scrolls up one line &amp;quot;yikes, I missed it!&amp;quot;&lt;br /&gt;
        g          goes to the beginning&lt;br /&gt;
        q          quits&lt;br /&gt;
        /&amp;lt;string&amp;gt;  search, repeat seach n&lt;br /&gt;
        m          mark, enter a letter like &amp;quot;a&amp;quot;, then, ' to go back&lt;br /&gt;
        '          enter a letter that is marked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       To get section numbers&lt;br /&gt;
&lt;br /&gt;
        $ man 8 ping&lt;br /&gt;
&lt;br /&gt;
       Note the numbers are used as follows&lt;br /&gt;
         (This is OpenBSD)&lt;br /&gt;
&lt;br /&gt;
         1  General Commands&lt;br /&gt;
         2  System Calls and Error Numbers&lt;br /&gt;
         3  C Libraries&lt;br /&gt;
         3p perl&lt;br /&gt;
         4  Devices and device drivers&lt;br /&gt;
         5  File Formats and config files&lt;br /&gt;
         6  Game instructions&lt;br /&gt;
         7  Miscellaneous information&lt;br /&gt;
         8  System maintenance&lt;br /&gt;
         9  Kernel internals&lt;br /&gt;
&lt;br /&gt;
       To find the man page directly, &amp;quot;ls&amp;quot; command:&lt;br /&gt;
&lt;br /&gt;
         $ whereis -m ls&lt;br /&gt;
         ls: /usr/share/man/man1/ls.1.gz /usr/share/man/man1/ls.1 /usr/share/man/man1p/ls.1p&lt;br /&gt;
&lt;br /&gt;
       To read this file directly, do the following:&lt;br /&gt;
&lt;br /&gt;
         $ man /usr/share/man/man1/ls.1.gz&lt;br /&gt;
&lt;br /&gt;
       If you want to know the manpath, execute manpath.&lt;br /&gt;
&lt;br /&gt;
         $ manpath&lt;br /&gt;
         /usr/share/man:/usr/X11R6/man:/usr/local/share/man:/usr/local/pgsql/man:/usr/man:/usr/local/man&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 8:&lt;br /&gt;
&lt;br /&gt;
     How to Put a &amp;quot;Running Job&amp;quot; in the Background.&lt;br /&gt;
&lt;br /&gt;
     You're running a job at the terminal prompt, and it's taking&lt;br /&gt;
     a very long time. You want to put the job in the backgroud.&lt;br /&gt;
&lt;br /&gt;
       &amp;quot;CTL - z&amp;quot; Temporarily suspends the job&lt;br /&gt;
       $ jobs     This will list all the jobs&lt;br /&gt;
       $ bg %jobnumber (bg %1)  To run in the background&lt;br /&gt;
       $ fg %jobnumber          To bring back in the foreground&lt;br /&gt;
&lt;br /&gt;
     Need to kill all jobs -- say you're using several suspended&lt;br /&gt;
     emacs sessions and you just want everything to exit.&lt;br /&gt;
&lt;br /&gt;
       $ kill -9  `jobs -p`&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;jobs -p&amp;quot; gives the process number of each job, and the&lt;br /&gt;
     kill -9 kills everything. Yes, sometimes &amp;quot;kill -9&amp;quot; is excessive&lt;br /&gt;
     and you should issue a &amp;quot;kill -15&amp;quot; that allows jobs to clean-up.&lt;br /&gt;
     However, for exacs session, I prefer &amp;quot;kill -9&amp;quot; and haven't had&lt;br /&gt;
     a problem.&lt;br /&gt;
&lt;br /&gt;
     Sometimes you need to list the process id along with job&lt;br /&gt;
     information. For instance, here's process id with the listing.&lt;br /&gt;
&lt;br /&gt;
       $ jobs -l&lt;br /&gt;
&lt;br /&gt;
     Note you can also renice a job, or give it lower priority.&lt;br /&gt;
&lt;br /&gt;
       $ nice -n +15 find . -ctime 2 -type f  -exec ls {} \; &amp;gt; last48hours&lt;br /&gt;
        ^z&lt;br /&gt;
       $  bg&lt;br /&gt;
&lt;br /&gt;
     So above that was a ctl-z to suppend. Then, bg to run it in&lt;br /&gt;
     the background. Now, if you want to change the priority lower&lt;br /&gt;
     you just renice it, once you know the process id.&lt;br /&gt;
&lt;br /&gt;
       $ jobs -pl&lt;br /&gt;
   [1]+ 29388 Running                 nice -n +15 find . -ctime 2 -exec ls -l {} \; &amp;gt;mout &amp;amp;&lt;br /&gt;
&lt;br /&gt;
       $ renice +30 -p 29388&lt;br /&gt;
        29388: old priority 15, new priority 19&lt;br /&gt;
&lt;br /&gt;
      19 was the lowest priority for this job. You cannot increase&lt;br /&gt;
      the priority unless you are root.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 9:&lt;br /&gt;
&lt;br /&gt;
     Need to Delete a File for Good -- not even GOD can recover.&lt;br /&gt;
&lt;br /&gt;
     You have a file &amp;quot;secret&amp;quot;.  The following makes it so no one&lt;br /&gt;
     can read it.  If the file was 12 bytes, it's now 4096 after it&lt;br /&gt;
     has been over written 100 times.  There's no way to recover this.&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z secret&lt;br /&gt;
&lt;br /&gt;
     Want to remove the file? Use the &amp;quot;u&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z -u test2&lt;br /&gt;
&lt;br /&gt;
     It can be applied to a device&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z -u /dev/fd0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       CAUTION: Note that shred relies on a very important assumption: that the file system  overwrites  data&lt;br /&gt;
       in  place.   This is the traditional way to do things, but many modern file system designs do not sat-&lt;br /&gt;
       isfy this assumption.  The following are examples of file systems on which shred is not effective,  or&lt;br /&gt;
       is not guaranteed to be effective in all file system modes:&lt;br /&gt;
&lt;br /&gt;
       * log-structured or journaled file systems, such as those supplied with&lt;br /&gt;
&lt;br /&gt;
              AIX and Solaris (and JFS, ReiserFS, XFS, Ext3, etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 52).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 10:&lt;br /&gt;
&lt;br /&gt;
     Who and What is doing What on Your System - finding open sockets,&lt;br /&gt;
     files etc.&lt;br /&gt;
&lt;br /&gt;
       $ lsof&lt;br /&gt;
          or as root&lt;br /&gt;
       $ watch lsof -i&lt;br /&gt;
&lt;br /&gt;
     To list all open Internet files, use:&lt;br /&gt;
&lt;br /&gt;
       $ lsof -i -U&lt;br /&gt;
&lt;br /&gt;
       (See TIP 118)&lt;br /&gt;
&lt;br /&gt;
     Also try fuser. Suppose you have a mounted file-system, and you need&lt;br /&gt;
     to umount it. To list the users on the file-system /work&lt;br /&gt;
&lt;br /&gt;
       $ fuser -u /work&lt;br /&gt;
&lt;br /&gt;
     To kill all processes accessing the file system /work  in  any way.&lt;br /&gt;
&lt;br /&gt;
       $ fuser -km /work&lt;br /&gt;
&lt;br /&gt;
     Or better yet, maybe you want to eject a cdrom on /mnt/cdrom&lt;br /&gt;
&lt;br /&gt;
       $ fuser -km /mnt/cdrom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     If you need IO load information about your system, you can execute&lt;br /&gt;
     iostat. But note, the very first iostat gives a snapshot since&lt;br /&gt;
     the last boot. You typically want the following command, which gives&lt;br /&gt;
     you 3 outputs every 5 seconds.&lt;br /&gt;
&lt;br /&gt;
       $ iostat -xtc 5 3&lt;br /&gt;
       Linux 2.6.12-1.1376_FC3smp (squeezel.squeezel.com) 	10/05/2005&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:04 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  0.97    0.06    1.94    0.62   96.41&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:09 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  0.60    0.00    1.70    0.00   97.70&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:14 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  1.00    0.00    1.60    0.00   97.39&lt;br /&gt;
&lt;br /&gt;
     vmstat reports memory statistics.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ vmstat&lt;br /&gt;
       $ ifconfig&lt;br /&gt;
       $ cat /proc/sys/vm/.. (entries under here)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      *NOTE: (TIP 77) shows sample usage of &amp;quot;ifconfig&amp;quot;. Also&lt;br /&gt;
       (TIP 84) shows sample output of &amp;quot;$ cat /proc/cpuinfo&amp;quot;. You can download iostat&lt;br /&gt;
       and other packages from (http://perso.wanadoo.fr/sebastien.godard/download_en.html).&lt;br /&gt;
       You also may want to look at iozone (TIP 178).&lt;br /&gt;
&lt;br /&gt;
     Also&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/meminfo&lt;br /&gt;
       $ cat /proc/stat&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/uptime&lt;br /&gt;
       1078623.55 1048008.34       First number is the number of seconds since boot.&lt;br /&gt;
                                   The second number is the number of idle seconds.&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/loadavg&lt;br /&gt;
       0.25 0.14 0.10 1/166 7778   This shows load at 1,5, and 15 minutes,&lt;br /&gt;
                                   a total of 1 current running process out&lt;br /&gt;
                                   from a total of 166. The 7778 is the last&lt;br /&gt;
                                   process id used.&lt;br /&gt;
                                   Ref: http://www.teamquest.com/resources/gunther/ldavg1.shtml&lt;br /&gt;
&lt;br /&gt;
     Or current process open file descriptors&lt;br /&gt;
&lt;br /&gt;
        $ ls -l /proc/self/fd/0&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lr-x------    1 chirico  chirico        64 Jun 29 13:17 3 -&amp;gt; /proc/26667/fd&lt;br /&gt;
&lt;br /&gt;
      So you could, $ echo &amp;quot;stuff&amp;quot; &amp;gt; /dev/pts/51, to get output. Note, tree is also&lt;br /&gt;
      helpful here:&lt;br /&gt;
&lt;br /&gt;
         $ tree /proc/self&lt;br /&gt;
&lt;br /&gt;
            /proc/self&lt;br /&gt;
            |-- auxv&lt;br /&gt;
            |-- cmdline&lt;br /&gt;
            |-- cwd -&amp;gt; /work/souptonuts/documentation/theBook&lt;br /&gt;
            |-- environ&lt;br /&gt;
            |-- exe -&amp;gt; /usr/bin/tree&lt;br /&gt;
            |-- fd&lt;br /&gt;
            |   |-- 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   |-- 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   |-- 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   `-- 3 -&amp;gt; /proc/26668/fd&lt;br /&gt;
            |-- maps&lt;br /&gt;
            |-- mem&lt;br /&gt;
            |-- mounts&lt;br /&gt;
            |-- root -&amp;gt; /&lt;br /&gt;
            |-- stat&lt;br /&gt;
            |-- statm&lt;br /&gt;
            |-- status&lt;br /&gt;
            |-- task&lt;br /&gt;
            |   `-- 26668&lt;br /&gt;
            |       |-- auxv&lt;br /&gt;
            |       |-- cmdline&lt;br /&gt;
            |       |-- cwd -&amp;gt; /work/souptonuts/documentation/theBook&lt;br /&gt;
            |       |-- environ&lt;br /&gt;
            |       |-- exe -&amp;gt; /usr/bin/tree&lt;br /&gt;
            |       |-- fd&lt;br /&gt;
            |       |   |-- 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   |-- 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   |-- 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   `-- 3 -&amp;gt; /proc/26668/task/26668/fd&lt;br /&gt;
            |       |-- maps&lt;br /&gt;
            |       |-- mem&lt;br /&gt;
            |       |-- mounts&lt;br /&gt;
            |       |-- root -&amp;gt; /&lt;br /&gt;
            |       |-- stat&lt;br /&gt;
            |       |-- statm&lt;br /&gt;
            |       |-- status&lt;br /&gt;
            |       `-- wchan&lt;br /&gt;
            `-- wchan&lt;br /&gt;
&lt;br /&gt;
            10 directories, 28 files&lt;br /&gt;
&lt;br /&gt;
     Need a listing of the system settings?&lt;br /&gt;
&lt;br /&gt;
       $ sysctl -a&lt;br /&gt;
&lt;br /&gt;
     Need IPC (Shared Memory Segments, Semaphore Arrays, Message Queue) status&lt;br /&gt;
     etc?&lt;br /&gt;
&lt;br /&gt;
       $ ipcs&lt;br /&gt;
       $ ipcs -l  &amp;quot;This gives limits&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Need to &amp;quot;watch&amp;quot; everything a user does?  The following watches donkey.&lt;br /&gt;
&lt;br /&gt;
       $ watch lsof -u donkey&lt;br /&gt;
&lt;br /&gt;
     Or, to see what in  going on in directory &amp;quot;/work/junk&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       $ watch lsof +D /work/junk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 11:&lt;br /&gt;
&lt;br /&gt;
     How to make a File &amp;quot;immutable&amp;quot; or &amp;quot;unalterable&amp;quot; -- it cannot be changed&lt;br /&gt;
     or deleted even by root. Note this works on (ext2/ext3) filesystems.&lt;br /&gt;
     And, yes, root can delete after it's changed back.&lt;br /&gt;
&lt;br /&gt;
     As root:&lt;br /&gt;
&lt;br /&gt;
       $ chattr +i filename&lt;br /&gt;
&lt;br /&gt;
     And to change it back:&lt;br /&gt;
&lt;br /&gt;
       $ chattr -i filename&lt;br /&gt;
&lt;br /&gt;
     List attributes&lt;br /&gt;
&lt;br /&gt;
       $ lsattr filename&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 12:&lt;br /&gt;
&lt;br /&gt;
     SSH - How to Generate the Key Pair.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     On the local server&lt;br /&gt;
&lt;br /&gt;
       $  ssh-keygen -t dsa -b 2048&lt;br /&gt;
&lt;br /&gt;
     This will create the two files:&lt;br /&gt;
&lt;br /&gt;
            .ssh/id_dsa (Private key)&lt;br /&gt;
            .ssh/id_dsa.pub  (Public key you can share)&lt;br /&gt;
&lt;br /&gt;
     Next insert &amp;quot;.ssh/id_dsa.pub&amp;quot; on the remote server&lt;br /&gt;
     in the file  &amp;quot;.ssh/authorized_keys&amp;quot; and &amp;quot;.ssh/authorized_keys2&amp;quot;&lt;br /&gt;
     and change the  permission of each file to (chmod 600). Plus, make&lt;br /&gt;
     sure the directory &amp;quot;.ssh&amp;quot; exists on the remote computer with 700 rights.&lt;br /&gt;
     Ok, assuming  192.168.1.155 is the remote server and &amp;quot;donkey&amp;quot; is the&lt;br /&gt;
     account on that remote server.&lt;br /&gt;
&lt;br /&gt;
       $ ssh donkey@192.168.1.155 &amp;quot;mkdir -p .ssh&amp;quot;&lt;br /&gt;
       $ ssh donkey@192.168.1.155 &amp;quot;chmod 700 .ssh&amp;quot;&lt;br /&gt;
       $ scp ./.ssh/id_dsa.pub  donkey@192.168.1.155:.ssh/newkey.pub&lt;br /&gt;
&lt;br /&gt;
     Now connect to that remote server &amp;quot;192.168.1.155&amp;quot; and add .ssh/newkey.pub&lt;br /&gt;
     to both &amp;quot;authorized_keys&amp;quot; and &amp;quot;authorized_keys2&amp;quot;.  When done, the permission&lt;br /&gt;
     on&lt;br /&gt;
       (This is on the remote server)&lt;br /&gt;
&lt;br /&gt;
        $chmod 600 .ssh/authorized_key*&lt;br /&gt;
&lt;br /&gt;
     Next, go back to the local server and issue the following:&lt;br /&gt;
&lt;br /&gt;
        $ ssh-agent $SHELL&lt;br /&gt;
        $ ssh-add&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;ssh-add&amp;quot; will allow you to enter the passphrase and it will&lt;br /&gt;
     save it for the current login session.&lt;br /&gt;
&lt;br /&gt;
     You don't have to enter a password when running &amp;quot;ssh-keygen&amp;quot; above. But,&lt;br /&gt;
     remember anyone with root access can &amp;quot;su - &amp;lt;username&amp;gt;&amp;quot; and then connect&lt;br /&gt;
     to your computers.  It's harder, however, not impossible, for root to do&lt;br /&gt;
     this if  you have a password.&lt;br /&gt;
&lt;br /&gt;
     (Reference TIP 151)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 13:&lt;br /&gt;
&lt;br /&gt;
     Securing the System: Don't allow root to login remotely.  Instead,&lt;br /&gt;
     the admin could login as another account, then, &amp;quot;su -&amp;quot;.  However,&lt;br /&gt;
     root can still login &amp;quot;from the local terminal&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     In the &amp;quot;/etc/ssh/sshd_config&amp;quot; file change the following lines:&lt;br /&gt;
&lt;br /&gt;
        Protocol 2&lt;br /&gt;
        PermitRootLogin no&lt;br /&gt;
        PermitEmptyPasswords no&lt;br /&gt;
&lt;br /&gt;
     Then, restart ssh&lt;br /&gt;
&lt;br /&gt;
        /etc/init.d/sshd restart&lt;br /&gt;
&lt;br /&gt;
     Why would you want to do this?  It's not possible for anyone to guess&lt;br /&gt;
     or keep trying the root account.  This is especially good for computers&lt;br /&gt;
     on the Internet. So, even if the &amp;quot;root&amp;quot; passwords is known, they can't&lt;br /&gt;
     get access to the system remotely.  Only from the terminal, which is locked&lt;br /&gt;
     in your computer room. However, if anyone has a account on the server,&lt;br /&gt;
     then, they can login under their  account then &amp;quot;su -&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Suppose you only want a limited number of users:  &amp;quot;mchirico&amp;quot; and &amp;quot;donkey&amp;quot;.&lt;br /&gt;
     Add the following line to &amp;quot;/etc/ssh/sshd_config&amp;quot;. Note, this allows access&lt;br /&gt;
     for chirico and donkey, but everyone else is denied.&lt;br /&gt;
&lt;br /&gt;
         #  Once you add AllowUsers - everyone else is denied.&lt;br /&gt;
         AllowUsers mchirico donkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 14:&lt;br /&gt;
&lt;br /&gt;
     Keep Logs Longer with Less Space.&lt;br /&gt;
&lt;br /&gt;
     Normally logs rotate monthly, over writing all the old data.  Here's a&lt;br /&gt;
     sample &amp;quot;/etc/logrotate.conf&amp;quot; that will keep 12 months of backup&lt;br /&gt;
     compressing the logfiles&lt;br /&gt;
&lt;br /&gt;
       $ cat /etc/logrotate.conf&lt;br /&gt;
&lt;br /&gt;
             # see &amp;quot;man logrotate&amp;quot; for details&lt;br /&gt;
             # rotate log files weekly&lt;br /&gt;
             #chirico changes to monthly&lt;br /&gt;
             monthly&lt;br /&gt;
&lt;br /&gt;
             # keep 4 weeks worth of backlogs&lt;br /&gt;
             # keep 12 months of backup&lt;br /&gt;
             rotate 12&lt;br /&gt;
&lt;br /&gt;
             # create new (empty) log files after rotating old ones&lt;br /&gt;
             create&lt;br /&gt;
&lt;br /&gt;
             # uncomment this if you want your log files compressed&lt;br /&gt;
             compress&lt;br /&gt;
&lt;br /&gt;
             # RPM packages drop log rotation information into this directory&lt;br /&gt;
             include /etc/logrotate.d&lt;br /&gt;
&lt;br /&gt;
             # no packages own wtmp -- we'll rotate them here&lt;br /&gt;
             /var/log/wtmp {&lt;br /&gt;
                 monthly&lt;br /&gt;
                 create 0664 root utmp&lt;br /&gt;
                 rotate 1&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
             # system-specific logs may be also be configured here.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Note: see tip 1. The clock should always be correctly set.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 15:&lt;br /&gt;
&lt;br /&gt;
     What Network Services are Running?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -atup&lt;br /&gt;
&lt;br /&gt;
     or&lt;br /&gt;
&lt;br /&gt;
          $ netstat -ap|grep LISTEN|less&lt;br /&gt;
&lt;br /&gt;
     This can be helpful to determine the services running.&lt;br /&gt;
&lt;br /&gt;
     Need stats on dropped UDP packets?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s -u&lt;br /&gt;
&lt;br /&gt;
     or TCP&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s -t&lt;br /&gt;
&lt;br /&gt;
     or summary of everything&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s&lt;br /&gt;
&lt;br /&gt;
     or looking for error rates on the interface?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -i&lt;br /&gt;
&lt;br /&gt;
     Listening interfaces?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -l&lt;br /&gt;
&lt;br /&gt;
     (Tip above provided by Amos Shapira)&lt;br /&gt;
&lt;br /&gt;
     Also see TIP 77.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 16:&lt;br /&gt;
&lt;br /&gt;
     Apache: Creating and Using an &amp;quot;.htaccess&amp;quot; File&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Below is a sample &amp;quot;.htaccess&amp;quot; file which goes in&lt;br /&gt;
     &amp;quot;/usr/local/apache/htdocs/chirico/alpha/.htaccess&amp;quot; for this&lt;br /&gt;
     example&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         AuthUserFile /usr/local/apache/htdocs/chirico/alpha/.htpasswd&lt;br /&gt;
         AuthGroupFile /dev/null&lt;br /&gt;
         AuthName &amp;quot;Your Name and regular password required&amp;quot;&lt;br /&gt;
         AuthType Basic&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;Limit GET POST&amp;gt;&lt;br /&gt;
         require valid-user&lt;br /&gt;
         &amp;lt;/Limit&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    In order for this to work /usr/local/apache/conf/httpd.conf must&lt;br /&gt;
    have the following line in it:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       #&lt;br /&gt;
       &amp;lt;Directory /usr/local/apache/htdocs/chirico/alpha&amp;gt;&lt;br /&gt;
           AllowOverride FileInfo AuthConfig Limit&lt;br /&gt;
           Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec&lt;br /&gt;
           &amp;lt;Limit GET POST OPTIONS PROPFIND&amp;gt;&lt;br /&gt;
               Order allow,deny&lt;br /&gt;
               Allow from all&lt;br /&gt;
           &amp;lt;/Limit&amp;gt;&lt;br /&gt;
           &amp;lt;LimitExcept GET POST OPTIONS PROPFIND&amp;gt;&lt;br /&gt;
               Order deny,allow&lt;br /&gt;
               Deny from all&lt;br /&gt;
           &amp;lt;/LimitExcept&amp;gt;&lt;br /&gt;
       &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Also, a password file must be created&lt;br /&gt;
&lt;br /&gt;
      $ /usr/local/apache/bin/htpasswd -c .htpasswd chirico&lt;br /&gt;
&lt;br /&gt;
    And enter the user names and passwords.&lt;br /&gt;
&lt;br /&gt;
    Next Reload Apache:&lt;br /&gt;
&lt;br /&gt;
      $ /etc/init.d/httpd reload&lt;br /&gt;
&lt;br /&gt;
    (Reference TIP 213 limit access to certain directories based on IP address).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 17:&lt;br /&gt;
&lt;br /&gt;
     Working with &amp;quot;mt&amp;quot; Commands: reading and writing to tape.&lt;br /&gt;
&lt;br /&gt;
     The following assumes the tape device is &amp;quot;/dev/st0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     STEP 1 ( rewind the tape)&lt;br /&gt;
&lt;br /&gt;
          # mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (check to see if you are at block 0)&lt;br /&gt;
&lt;br /&gt;
          # mt -f /dev/nst0 tell&lt;br /&gt;
            At block 0.&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Backup &amp;quot;tar compress&amp;quot;  directories &amp;quot;one&amp;quot;  and &amp;quot;two&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
          # tar -czf /dev/nst0 one two&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Check to see what block you are at)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
&lt;br /&gt;
       You should get something like block 2 at this point.&lt;br /&gt;
&lt;br /&gt;
     STEP 5 (Rewind the tape)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
     STEP 6 (List the files)&lt;br /&gt;
&lt;br /&gt;
           # tar -tzf /dev/nst0&lt;br /&gt;
              one/&lt;br /&gt;
              one/test&lt;br /&gt;
              two/&lt;br /&gt;
&lt;br /&gt;
     STEP 7 (Restore directory &amp;quot;one&amp;quot;  into directory &amp;quot;junk&amp;quot;).  Note, you&lt;br /&gt;
          have to first rewind the tape, since the last operation moved&lt;br /&gt;
          ahead 2 blocks. Check this with &amp;quot;mt -f /dev/nst0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           # cd junk&lt;br /&gt;
           # mt -f /dev/nst0 rewind&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
              At block 0.&lt;br /&gt;
           # tar -xzf /dev/nst0 one&lt;br /&gt;
&lt;br /&gt;
     STEP 8 (Next, take a look to see what block the tape is at)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
              At block 2.&lt;br /&gt;
&lt;br /&gt;
     STEP 9 (Now backup directories three  and four)&lt;br /&gt;
&lt;br /&gt;
           # tar -czf /dev/nst0 three four&lt;br /&gt;
&lt;br /&gt;
       After backing up the files, the tape should be past block 2.&lt;br /&gt;
       Check this.&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
             At block 4.&lt;br /&gt;
&lt;br /&gt;
          Currently the following exist:&lt;br /&gt;
&lt;br /&gt;
                At block 1:&lt;br /&gt;
                     one/&lt;br /&gt;
                    one/test&lt;br /&gt;
                    two/&lt;br /&gt;
&lt;br /&gt;
                At block 2:&lt;br /&gt;
                    three/&lt;br /&gt;
                    three/samplehere&lt;br /&gt;
                    four/&lt;br /&gt;
&lt;br /&gt;
                At block 4:&lt;br /&gt;
                    (* This is empty *)&lt;br /&gt;
&lt;br /&gt;
     A few notes. You can set the blocking factor and a label&lt;br /&gt;
     with tar. For example:&lt;br /&gt;
&lt;br /&gt;
      $ tar --label=&amp;quot;temp label&amp;quot; --create  --blocking-factor=128 --file=/dev/nst0 Notes&lt;br /&gt;
&lt;br /&gt;
     But note if you try to read it with the default, incorrect blocking&lt;br /&gt;
     factor, then, you will get the following error:&lt;br /&gt;
&lt;br /&gt;
        $ tar -t   --file=/dev/nst0&lt;br /&gt;
        tar: /dev/nst0: Cannot read: Cannot allocate memory&lt;br /&gt;
        tar: At beginning of tape, quitting now&lt;br /&gt;
        tar: Error is not recoverable: exiting now&lt;br /&gt;
&lt;br /&gt;
     However this is easily fixed with the correct blocking factor&lt;br /&gt;
&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ tar -t --blocking-factor=128 --file=/dev/nst0&lt;br /&gt;
         temp label&lt;br /&gt;
         Notes&lt;br /&gt;
&lt;br /&gt;
     Take advantage of the label command.&lt;br /&gt;
&lt;br /&gt;
         $ MYCOMMENTS=&amp;quot;Big_important_tape&amp;quot;&lt;br /&gt;
         $ tar --label=&amp;quot;$(date +%F)&amp;quot;+&amp;quot;${MYCOMMENTS}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Writing to tape on a remote 192.168.1.155 computer&lt;br /&gt;
&lt;br /&gt;
         $ tar cvzf - ./tmp | ssh -l chirico 192.168.1.155 '(mt -f /dev/nst0 rewind; dd of=/dev/st0 )'&lt;br /&gt;
&lt;br /&gt;
     Restoring the contents from tape on a remote computer&lt;br /&gt;
&lt;br /&gt;
         $ ssh -l chirico 192.168.1.155 '(mt -f /dev/nst0 rewind; dd if=/dev/st0  )'|tar xzf -&lt;br /&gt;
&lt;br /&gt;
     Getting data off of tape with dd command with odd blocking factor. Just set ibs very high&lt;br /&gt;
&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ tar --label=&amp;quot;Contenets of Notes&amp;quot; --create  --blocking-factor=128 --file=/dev/nst0 Notes&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ dd ibs=1048576 if=/dev/st0 of=notes.tar&lt;br /&gt;
&lt;br /&gt;
     The above will probably work with ibs=64k as well&lt;br /&gt;
&lt;br /&gt;
        (Also see TIP 136)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 18:&lt;br /&gt;
&lt;br /&gt;
     Encrypting Data to Tape using &amp;quot;tar&amp;quot; and &amp;quot;openssl&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     The following shows an example of writing the contents of &amp;quot;tapetest&amp;quot; to tape:&lt;br /&gt;
&lt;br /&gt;
        $ tar zcvf - tapetest|openssl des3 -salt  -k secretpassword | dd of=/dev/st0&lt;br /&gt;
&lt;br /&gt;
     Reading the data back:&lt;br /&gt;
&lt;br /&gt;
        $ dd if=/dev/st0|openssl des3 -d -k secretpassword|tar xzf -&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 19:&lt;br /&gt;
&lt;br /&gt;
     Mounting an ISO Image as a Filesystem -- this is great if you don't have the DVD&lt;br /&gt;
         hardware, but, need to get at the data.  The following show an example of&lt;br /&gt;
         mounting the Fedora core 2 as a file.&lt;br /&gt;
&lt;br /&gt;
         $ mkdir /iso0&lt;br /&gt;
         $ mount -o loop -t iso9660 /FC2-i386-DVD.iso  /iso0&lt;br /&gt;
&lt;br /&gt;
     Or to mount automatically at boot, add the following to &amp;quot;/etc/fstab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         /FC2-i386-DVD.iso /iso0     iso9660 rw,loop  0 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Reference: http://umn.dl.sourceforge.net/sourceforge/souptonuts/README_fedora.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 20:&lt;br /&gt;
&lt;br /&gt;
     Getting Information about the Hard drive and list all PCI devices.&lt;br /&gt;
&lt;br /&gt;
                $ hdparm /dev/hda&lt;br /&gt;
&lt;br /&gt;
                  /dev/hda:&lt;br /&gt;
                   multcount    = 16 (on)&lt;br /&gt;
                   IO_support   =  0 (default 16-bit)&lt;br /&gt;
                   unmaskirq    =  0 (off)&lt;br /&gt;
                   using_dma    =  1 (on)&lt;br /&gt;
                   keepsettings =  0 (off)&lt;br /&gt;
                   readonly     =  0 (off)&lt;br /&gt;
                   readahead    = 256 (on)&lt;br /&gt;
                   geometry     = 16383/255/63, sectors = 234375000, start = 0&lt;br /&gt;
&lt;br /&gt;
            or for SCSI&lt;br /&gt;
&lt;br /&gt;
                $ hdparm /dev/sda&lt;br /&gt;
&lt;br /&gt;
            Try it with the -i option for information&lt;br /&gt;
&lt;br /&gt;
                $ hdparm -i /dev/hda&lt;br /&gt;
&lt;br /&gt;
                /dev/hda:&lt;br /&gt;
&lt;br /&gt;
                Model=IC35L120AVV207-1, FwRev=V24OA66A, SerialNo=VNVD09G4CZ6E0T&lt;br /&gt;
                Config={ HardSect NotMFM HdSw&amp;gt;15uSec Fixed DTR&amp;gt;10Mbs }&lt;br /&gt;
                RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=52&lt;br /&gt;
                BuffType=DualPortCache, BuffSize=7965kB, MaxMultSect=16, MultSect=16&lt;br /&gt;
                CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=234375000&lt;br /&gt;
                IORDY=on/off, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}&lt;br /&gt;
                PIO modes:  pio0 pio1 pio2 pio3 pio4&lt;br /&gt;
                DMA modes:  mdma0 mdma1 mdma2&lt;br /&gt;
                UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5&lt;br /&gt;
                AdvancedPM=yes: disabled (255) WriteCache=enabled&lt;br /&gt;
                Drive conforms to: ATA/ATAPI-6 T13 1410D revision 3a:  2 3 4 5 6&lt;br /&gt;
&lt;br /&gt;
            How fast is your drive?&lt;br /&gt;
&lt;br /&gt;
                $ hdparm -tT /dev/hda&lt;br /&gt;
&lt;br /&gt;
                /dev/hda:&lt;br /&gt;
                Timing buffer-cache reads:   128 MB in  0.41 seconds =315.32 MB/sec&lt;br /&gt;
                Timing buffered disk reads:  64 MB in  1.19 seconds = 53.65 MB/sec&lt;br /&gt;
&lt;br /&gt;
            Need to find your device?&lt;br /&gt;
&lt;br /&gt;
                $ mount&lt;br /&gt;
                   or&lt;br /&gt;
                $ cat /proc/partitions&lt;br /&gt;
                   or&lt;br /&gt;
                $ dmesg | egrep '^(s|h)d'&lt;br /&gt;
&lt;br /&gt;
                   which for my system lists:&lt;br /&gt;
&lt;br /&gt;
                      hda: IC35L120AVV207-1, ATA DISK drive&lt;br /&gt;
                      hdc: Lite-On LTN486S 48x Max, ATAPI CD/DVD-ROM drive&lt;br /&gt;
                      hda: max request size: 1024KiB&lt;br /&gt;
                      hda: 234375000 sectors (120000 MB) w/7965KiB Cache, CHS=16383/255/63, UDMA(100)&lt;br /&gt;
&lt;br /&gt;
             By the way, if you want to turn on dma&lt;br /&gt;
&lt;br /&gt;
                 $ hdparm -d1 /dev/hda&lt;br /&gt;
                   setting using_dma to 1 (on)&lt;br /&gt;
                   using_dma    =  1 (on)&lt;br /&gt;
&lt;br /&gt;
         (Also see TIP 122 )&lt;br /&gt;
&lt;br /&gt;
     List all PCI devices&lt;br /&gt;
&lt;br /&gt;
                $ lspci -v&lt;br /&gt;
&lt;br /&gt;
          00:00.0 Host bridge: Intel Corp. 82845G/GL [Brookdale-G] Chipset Host Bridge (rev&lt;br /&gt;
                  Subsystem: Dell Computer Corporation: Unknown device 0160&lt;br /&gt;
                  Flags: bus master, fast devsel, latency 0&lt;br /&gt;
                  Memory at f0000000 (32-bit, prefetchable) [size=128M]&lt;br /&gt;
                  Capabilities: &amp;lt;available only to root&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              ... lots more ...&lt;br /&gt;
&lt;br /&gt;
           Note, there is also lspci -vv for even more information.&lt;br /&gt;
&lt;br /&gt;
          (Also see TIP 200)&lt;br /&gt;
&lt;br /&gt;
TIP 21:&lt;br /&gt;
&lt;br /&gt;
     Setting up &amp;quot;cron&amp;quot; Jobs.&lt;br /&gt;
&lt;br /&gt;
     If you want to use the emacs editor for editing cron jobs, then,&lt;br /&gt;
     set the following in your &amp;quot;/home/user/.bash_profile&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        EDITOR=emacs&lt;br /&gt;
&lt;br /&gt;
     Then, to edit cron jobs&lt;br /&gt;
&lt;br /&gt;
        $ crontab -e&lt;br /&gt;
&lt;br /&gt;
     You may want to put in the following header&lt;br /&gt;
&lt;br /&gt;
        #MINUTE(0-59) HOUR(0-23) DAYOFMONTH(1-31) MONTHOFYEAR(1-12) DAYOFWEEK(0-6) Note 0=Sun and 7=Sun&lt;br /&gt;
        #&lt;br /&gt;
        #14,15 10 * * 0   /usr/bin/somecommmand  &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     The sample &amp;quot;commented out command&amp;quot; will run at 10:14 and 10:15 every Sunday.  There will&lt;br /&gt;
     be no &amp;quot;mail&amp;quot; sent to the user because of the &amp;quot;&amp;gt;/dev/null 2&amp;gt;&amp;amp;1&amp;quot; entry.&lt;br /&gt;
&lt;br /&gt;
        $ crontab -l&lt;br /&gt;
&lt;br /&gt;
     The above will list all cron jobs. Or if you're root&lt;br /&gt;
&lt;br /&gt;
        $ crontab -l -u &amp;lt;username&amp;gt;&lt;br /&gt;
        $ crontab -e -u &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Reference &amp;quot;man 5 crontab&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
        The time and date fields are:&lt;br /&gt;
&lt;br /&gt;
                     field          allowed values&lt;br /&gt;
                     -----          --------------&lt;br /&gt;
                     minute         0-59&lt;br /&gt;
                     hour           0-23&lt;br /&gt;
                     day of month   1-31&lt;br /&gt;
                     month          1-12 (or names, see below)&lt;br /&gt;
                     day of week    0-7 (0 or 7 is Sun, or use names)&lt;br /&gt;
&lt;br /&gt;
              A field may be an asterisk (*), which always stands for ``first-last''.&lt;br /&gt;
&lt;br /&gt;
              Ranges of numbers are allowed.  Ranges are two numbers separated with a&lt;br /&gt;
              hyphen.   The  specified  range is inclusive.  For example, 8-11 for an&lt;br /&gt;
              ``hours'' entry specifies execution at hours 8, 9, 10 and 11.&lt;br /&gt;
&lt;br /&gt;
              Lists are allowed.  A list is a set of numbers (or ranges) separated by&lt;br /&gt;
              commas.  Examples: ``1,2,5,9'', ``0-4,8-12''.&lt;br /&gt;
&lt;br /&gt;
              Ranges can include &amp;quot;steps&amp;quot;, so &amp;quot;1-9/2&amp;quot; is the same as &amp;quot;1,3,5,7,9&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Note, you can run just every 5 minutes as follows:&lt;br /&gt;
&lt;br /&gt;
              */5 * * * * /etc/mrtg/domrtg  &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     To run jobs hourly,daily,weekly or monthly you can add shell scripts into the&lt;br /&gt;
     appropriate directory:&lt;br /&gt;
&lt;br /&gt;
             /etc/cron.hourly/&lt;br /&gt;
             /etc/cron.daily/&lt;br /&gt;
             /etc/cron.weekly/&lt;br /&gt;
             /etc/cron.monthly/&lt;br /&gt;
&lt;br /&gt;
     Note that the above are pre-configured schedules set in &amp;quot;/etc/crontab&amp;quot;, so&lt;br /&gt;
     if you want, you can change the schedule. Below is my /etc/crontab:&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/crontab&lt;br /&gt;
           SHELL=/bin/bash&lt;br /&gt;
           PATH=/sbin:/bin:/usr/sbin:/usr/bin&lt;br /&gt;
           MAILTO=root&lt;br /&gt;
           HOME=/&lt;br /&gt;
&lt;br /&gt;
           # run-parts&lt;br /&gt;
           01 * * * * root run-parts /etc/cron.hourly&lt;br /&gt;
           02 4 * * * root run-parts /etc/cron.daily&lt;br /&gt;
           22 4 * * 0 root run-parts /etc/cron.weekly&lt;br /&gt;
           42 4 1 * * root run-parts /etc/cron.monthly&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 22:&lt;br /&gt;
&lt;br /&gt;
     Keeping Files in Sync Between Servers.&lt;br /&gt;
&lt;br /&gt;
     The remote computer is &amp;quot;192.168.1.171&amp;quot; and has the account &amp;quot;donkey&amp;quot;.  You want&lt;br /&gt;
     to &amp;quot;keep in sync&amp;quot; the files under &amp;quot;/home/cu2000/Logs&amp;quot; on the remote computer&lt;br /&gt;
     with files on &amp;quot;/home/chirico/dev/MEDIA_Server&amp;quot; on the local computer.&lt;br /&gt;
&lt;br /&gt;
       $ rsync  -Lae ssh  donkey@192.168.1.171:/home/cu2000/Logs /home/chirico/dev/MEDIA_Server&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;rsync&amp;quot; is a convient command for keeping files in sync, and as shown here will work&lt;br /&gt;
     through ssh.  The -L option tells rsync to treat symbolic links like ordinary files.&lt;br /&gt;
&lt;br /&gt;
        Also see [http://www.rsnapshot.org/]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 23:&lt;br /&gt;
&lt;br /&gt;
     Looking up the Spelling of a Word.&lt;br /&gt;
&lt;br /&gt;
        $ look &amp;lt;partial spelling&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     so the following will list all words that&lt;br /&gt;
     start with stuff&lt;br /&gt;
&lt;br /&gt;
        $ look stuff&lt;br /&gt;
           stuff&lt;br /&gt;
           stuffage&lt;br /&gt;
           stuffata&lt;br /&gt;
           stuffed&lt;br /&gt;
           stuffender&lt;br /&gt;
           stuffer&lt;br /&gt;
           stuffers&lt;br /&gt;
           stuffgownsman&lt;br /&gt;
           stuffier&lt;br /&gt;
           stuffiest&lt;br /&gt;
           stuffily&lt;br /&gt;
           stuffiness&lt;br /&gt;
           stuffinesses&lt;br /&gt;
           stuffiness's&lt;br /&gt;
           stuffing&lt;br /&gt;
           stuffings&lt;br /&gt;
           stuffing's&lt;br /&gt;
           stuffless&lt;br /&gt;
           stuffs&lt;br /&gt;
           stuffy&lt;br /&gt;
&lt;br /&gt;
     It helps to have a large &amp;quot;linuxwords&amp;quot; dictionary.  You can download&lt;br /&gt;
     a much bigger dictionary from the following:&lt;br /&gt;
&lt;br /&gt;
              http://prdownloads.sourceforge.net/souptonuts/linuxwords.1.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
     Note: vim users can setup the .vimrc file with the following. Now when you type &lt;br /&gt;
       CTL-X CTL-T in insert mode, you'll get a thesaurus lookup.&lt;br /&gt;
&lt;br /&gt;
           set dictionary+=/usr/share/dict/words&lt;br /&gt;
           set thesaurus+=/usr/share/dict/words&lt;br /&gt;
&lt;br /&gt;
     Or, you can call aspell with the F6 command after putting the folling entry in your&lt;br /&gt;
     .vimrc file&lt;br /&gt;
&lt;br /&gt;
           :nmap &amp;lt;F6&amp;gt; :w&amp;lt;CR&amp;gt;:!aspell -e -c %&amp;lt;CR&amp;gt;:e&amp;lt;CR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Now, hit F6 when you're in vim, and you'll get a spell checker.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     There is also an X Windows dictionary that runs with the following command.&lt;br /&gt;
&lt;br /&gt;
           $ gnome-dictionary&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 24:&lt;br /&gt;
&lt;br /&gt;
     Find out if a Command is Aliased.&lt;br /&gt;
&lt;br /&gt;
         $ type -all &amp;lt;command&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Example:&lt;br /&gt;
&lt;br /&gt;
         $ type -all ls&lt;br /&gt;
            ls is aliased to `ls --color=tty'&lt;br /&gt;
            ls is /bin/ls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 25:&lt;br /&gt;
&lt;br /&gt;
     Create a Terminal Calculator&lt;br /&gt;
&lt;br /&gt;
      Put the following in your .bashrc file&lt;br /&gt;
&lt;br /&gt;
            function calc&lt;br /&gt;
            {&lt;br /&gt;
             echo &amp;quot;${1}&amp;quot;|bc -l;&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
      Or, run it at the shell prompt. Now&lt;br /&gt;
      &amp;quot;calc&amp;quot; from the shell will work as follows:&lt;br /&gt;
&lt;br /&gt;
            $ calc 3+45&lt;br /&gt;
               48&lt;br /&gt;
&lt;br /&gt;
      All functions  with a &amp;quot;(&amp;quot; or &amp;quot;)&amp;quot; must be enclosed&lt;br /&gt;
      in quotes.  For instance, to get the sin of .4&lt;br /&gt;
&lt;br /&gt;
            $ calc &amp;quot;s(.4)&amp;quot;&lt;br /&gt;
              .38941834230865049166&lt;br /&gt;
&lt;br /&gt;
          (See TIP 115 using the expr command)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 26:&lt;br /&gt;
&lt;br /&gt;
     Kill a User and All Their Current Processes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        #  This program will kill all processes from a&lt;br /&gt;
        #  user.  The user name is read from the command line.&lt;br /&gt;
        #&lt;br /&gt;
        #  This program also demonstrates reading a bash variable&lt;br /&gt;
        #  into an awk script.&lt;br /&gt;
        #&lt;br /&gt;
        #  Usage: kill9user &amp;lt;user&amp;gt;&lt;br /&gt;
        #&lt;br /&gt;
        kill -9 `ps aux|awk -v var=$1 '$1==var { print $2 }'`&lt;br /&gt;
&lt;br /&gt;
    or if you want want to create the above script the command&lt;br /&gt;
    below will kill the user &amp;quot;donkey&amp;quot; and all of his processes.&lt;br /&gt;
&lt;br /&gt;
        $ kill -9 `ps aux|awk -v var=&amp;quot;donkey&amp;quot; '$1==var { print $2 }'`&lt;br /&gt;
&lt;br /&gt;
    Check their cron jobs and &amp;quot;at&amp;quot; jobs, if you have a security issue.&lt;br /&gt;
&lt;br /&gt;
          $ crontab -u &amp;lt;user&amp;gt; -e&lt;br /&gt;
&lt;br /&gt;
    Lock the account:&lt;br /&gt;
&lt;br /&gt;
          $ passwd -l &amp;lt;user&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Remove all authorized_keys&lt;br /&gt;
&lt;br /&gt;
          $ rm /home/user/.shosts&lt;br /&gt;
          $ rm /home/user/.rhosts&lt;br /&gt;
          $ rm -rf /home/user/.ssh&lt;br /&gt;
          $ rm /home/user/.forward&lt;br /&gt;
&lt;br /&gt;
      or consider&lt;br /&gt;
&lt;br /&gt;
          $ mv /home/user  /home/safeuser&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Change the shell&lt;br /&gt;
&lt;br /&gt;
          $ chsh -s /bin/true &amp;lt;user&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Do an inventory&lt;br /&gt;
&lt;br /&gt;
          $ find / -user &amp;lt;user&amp;gt;  &amp;gt; list_of_user_files&lt;br /&gt;
&lt;br /&gt;
    NOTE: Also see (TIP 10).&lt;br /&gt;
&lt;br /&gt;
    To see all users, except the current user. Do not use the&lt;br /&gt;
    dash &amp;quot;ps -aux&amp;quot; is wrong but the following is correct:&lt;br /&gt;
&lt;br /&gt;
          $ ps aux| awk '!/'${USER}'/{printf(&amp;quot;%s \n&amp;quot;,$0)}'&lt;br /&gt;
&lt;br /&gt;
     or (ww = wide, wide output)&lt;br /&gt;
&lt;br /&gt;
          $ ps auwwx| awk '!/'${USER}'/{printf(&amp;quot;%s \n&amp;quot;,$0)}'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    The following codes may be useful:&lt;br /&gt;
&lt;br /&gt;
       D    Uninterruptible sleep (usually IO)&lt;br /&gt;
       R    Running or runnable (on run queue)&lt;br /&gt;
       S    Interruptible sleep (waiting for an event to complete)&lt;br /&gt;
       T    Stopped, either by a job control signal or because it is being traced.&lt;br /&gt;
       W    paging (not valid since the 2.6.xx kernel)&lt;br /&gt;
       X    dead (should never be seen)&lt;br /&gt;
       Z    Defunct (&amp;quot;zombie&amp;quot;) process, terminated but not reaped by its parent.&lt;br /&gt;
&lt;br /&gt;
    For BSD formats and when the stat keyword is used, additional&lt;br /&gt;
       characters may be displayed:&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;    high-priority (not nice to other users)&lt;br /&gt;
       N    low-priority (nice to other users)&lt;br /&gt;
       L    has pages locked into memory (for real-time and custom IO)&lt;br /&gt;
       s    is a session leader&lt;br /&gt;
       l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)&lt;br /&gt;
       +    is in the foreground process group&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Also see TIP 28. and TIP 89.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 27:&lt;br /&gt;
&lt;br /&gt;
     Format Dates for Logs and Files&lt;br /&gt;
&lt;br /&gt;
         $ date &amp;quot;+%m%d%y %A,%B %d %Y %X&amp;quot;&lt;br /&gt;
             061704 Thursday,June 17 2004 07:13:40 PM&lt;br /&gt;
&lt;br /&gt;
         $ date &amp;quot;+%m%d%Y&amp;quot;&lt;br /&gt;
             06172004&lt;br /&gt;
&lt;br /&gt;
         $ date -d '1 day ago' &amp;quot;+%m%d%Y&amp;quot;&lt;br /&gt;
             06162004&lt;br /&gt;
&lt;br /&gt;
         $ date -d '3 months 1 day  2 hour  15 minutes 2 seconds ago'&lt;br /&gt;
&lt;br /&gt;
      or to go into the future remove the &amp;quot;ago&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         $ date -d '3 months 1 day  2 hour  15 minutes 2 seconds '&lt;br /&gt;
&lt;br /&gt;
            Also the following works:&lt;br /&gt;
&lt;br /&gt;
                $ date -d '+2 year +1 month -1 week  +3 day -8 hour +2 min -5 seconds'&lt;br /&gt;
&lt;br /&gt;
      Quick question: If there are 100,000,000 stars in the visible sky, and you can&lt;br /&gt;
      count them, round the clock, at a rate of a star per second starting now, when&lt;br /&gt;
      would you finish counting?  Would you still be alive?&lt;br /&gt;
&lt;br /&gt;
                $ date -d '+100000000 seconds'&lt;br /&gt;
&lt;br /&gt;
      Sooner than you think!&lt;br /&gt;
&lt;br /&gt;
      This can be assigned to variables&lt;br /&gt;
&lt;br /&gt;
         $ mdate=`date -d '3 months 1 day  2 hour  15 minutes 2 seconds ' &amp;quot;+%m%d%Y_%A_%B_%D_%Y_%X&amp;quot;  `&lt;br /&gt;
         $ echo $mdate&lt;br /&gt;
             09182004_Saturday_September_09/18/04_2004_09:40:41 PM&lt;br /&gt;
             ^---- Easy to sort   ^-------^----- Easy to read&lt;br /&gt;
&lt;br /&gt;
      See TIP 28 below.&lt;br /&gt;
&lt;br /&gt;
      See TIP 87 when working with large delta time changes -40 years, or -200 years ago, or even&lt;br /&gt;
      1,000,000 days into the future.&lt;br /&gt;
&lt;br /&gt;
      Also see (TIP 1) for working with time zones.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 28:&lt;br /&gt;
&lt;br /&gt;
     Need Ascii Codes? For instance, for printing quotes:&lt;br /&gt;
&lt;br /&gt;
                         awk 'BEGIN { msg = &amp;quot;Don\047t Panic!&amp;quot;; printf &amp;quot;%s \n&amp;quot;,msg }'&lt;br /&gt;
              or&lt;br /&gt;
                         awk 'BEGIN { msg = &amp;quot;Don\x027t Panic!&amp;quot;; printf &amp;quot;%s \n&amp;quot;,msg }'&lt;br /&gt;
&lt;br /&gt;
     It's better to use \047, because certain characters that follow \x027 may cause problems.&lt;br /&gt;
&lt;br /&gt;
     For example, take a look at the following two lines. The first line prints a &amp;quot;}&amp;quot; caused&lt;br /&gt;
     by the extra D in \x027D. The the line immediately below does not work as expected.&lt;br /&gt;
&lt;br /&gt;
                      awk 'BEGIN {printf(&amp;quot;The D causes problems \x027D\n&amp;quot;)}'&lt;br /&gt;
&lt;br /&gt;
            However, the line below works fine:&lt;br /&gt;
&lt;br /&gt;
                      awk 'BEGIN {printf(&amp;quot;The D does not cause problems \047D\n&amp;quot;)}'&lt;br /&gt;
&lt;br /&gt;
     Or if you wanted to use the date command in &amp;quot;awk&amp;quot; to print date.time.nanosecond.timezone for&lt;br /&gt;
     each line of a file &amp;quot;test&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     The following date can be used in awk because the single quotes are enclosed within the&lt;br /&gt;
     double quotes.&lt;br /&gt;
&lt;br /&gt;
             date '+%m%d%Y.%H%M%S.%N%z'&lt;br /&gt;
&lt;br /&gt;
       $ awk 'BEGIN { &amp;quot;date '+%m%d%Y.%H%M%S.%N%z'&amp;quot; | getline MyDate  } { print MyDate,$0 }' &amp;lt; data&lt;br /&gt;
&lt;br /&gt;
     But it's also possible to replace  &amp;quot;+&amp;quot;  with  \x2B,  &amp;quot;%&amp;quot; with \x25, and &amp;quot;d&amp;quot; with \x64 as follows:&lt;br /&gt;
&lt;br /&gt;
       $ awk 'BEGIN { &amp;quot;date \x27\x2B\x25m\x25\x64\x25Y.\x25H\x25M\x25S.\x25N\x25z\x27&amp;quot; | getline MyDate  } { print MyDate,$0 }' &amp;lt; test&lt;br /&gt;
&lt;br /&gt;
             07062004.113820.346033000-0400 bob 71&lt;br /&gt;
             07062004.113820.346033000-0400 tom 43&lt;br /&gt;
             07062004.113820.346033000-0400 sal 34&lt;br /&gt;
             07062004.113820.346033000-0400 bob 89&lt;br /&gt;
             07062004.113820.346033000-0400 tom 66&lt;br /&gt;
             07062004.113820.346033000-0400 sal 99&lt;br /&gt;
&lt;br /&gt;
     For this example it's not needed because single quotes are used inside of double quotes; however, there may be times when&lt;br /&gt;
     hex replacement is easier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ man ascii&lt;br /&gt;
&lt;br /&gt;
        Oct   Dec   Hex   Char           Oct   Dec   Hex   Char&lt;br /&gt;
            -----------------------------------------------------------&lt;br /&gt;
            000   0     00    NUL '\0'       100   64    40    @&lt;br /&gt;
            001   1     01    SOH            101   65    41    A&lt;br /&gt;
            002   2     02    STX            102   66    42    B&lt;br /&gt;
            003   3     03    ETX            103   67    43    C&lt;br /&gt;
            004   4     04    EOT            104   68    44    D&lt;br /&gt;
            005   5     05    ENQ            105   69    45    E&lt;br /&gt;
            006   6     06    ACK            106   70    46    F&lt;br /&gt;
            007   7     07    BEL '\a'       107   71    47    G&lt;br /&gt;
            010   8     08    BS  '\b'       110   72    48    H&lt;br /&gt;
            011   9     09    HT  '\t'       111   73    49    I&lt;br /&gt;
            012   10    0A    LF  '\n'       112   74    4A    J&lt;br /&gt;
            013   11    0B    VT  '\v'       113   75    4B    K&lt;br /&gt;
            014   12    0C    FF  '\f'       114   76    4C    L&lt;br /&gt;
            015   13    0D    CR  '\r'       115   77    4D    M&lt;br /&gt;
            016   14    0E    SO             116   78    4E    N&lt;br /&gt;
            017   15    0F    SI             117   79    4F    O&lt;br /&gt;
            020   16    10    DLE            120   80    50    P&lt;br /&gt;
            021   17    11    DC1            121   81    51    Q&lt;br /&gt;
            022   18    12    DC2            122   82    52    R&lt;br /&gt;
            023   19    13    DC3            123   83    53    S&lt;br /&gt;
            024   20    14    DC4            124   84    54    T&lt;br /&gt;
            025   21    15    NAK            125   85    55    U&lt;br /&gt;
            026   22    16    SYN            126   86    56    V&lt;br /&gt;
            027   23    17    ETB            127   87    57    W&lt;br /&gt;
            030   24    18    CAN            130   88    58    X&lt;br /&gt;
            031   25    19    EM             131   89    59    Y&lt;br /&gt;
            032   26    1A    SUB            132   90    5A    Z&lt;br /&gt;
            033   27    1B    ESC            133   91    5B    [&lt;br /&gt;
            034   28    1C    FS             134   92    5C    \   '\\'&lt;br /&gt;
            035   29    1D    GS             135   93    5D    ]&lt;br /&gt;
            036   30    1E    RS             136   94    5E    ^&lt;br /&gt;
            037   31    1F    US             137   95    5F    _&lt;br /&gt;
            040   32    20    SPACE          140   96    60    `&lt;br /&gt;
            041   33    21    !              141   97    61    a&lt;br /&gt;
            042   34    22    &amp;quot;              142   98    62    b&lt;br /&gt;
            043   35    23    #              143   99    63    c&lt;br /&gt;
            044   36    24    $              144   100   64    d&lt;br /&gt;
            045   37    25    %              145   101   65    e&lt;br /&gt;
            046   38    26    &amp;amp;              146   102   66    f&lt;br /&gt;
            047   39    27    '              147   103   67    g&lt;br /&gt;
            050   40    28    (              150   104   68    h&lt;br /&gt;
            051   41    29    )              151   105   69    i&lt;br /&gt;
            052   42    2A    *              152   106   6A    j&lt;br /&gt;
            053   43    2B    +              153   107   6B    k&lt;br /&gt;
            054   44    2C    ,              154   108   6C    l&lt;br /&gt;
            055   45    2D    -              155   109   6D    m&lt;br /&gt;
            056   46    2E    .              156   110   6E    n&lt;br /&gt;
            057   47    2F    /              157   111   6F    o&lt;br /&gt;
            060   48    30    0              160   112   70    p&lt;br /&gt;
            061   49    31    1              161   113   71    q&lt;br /&gt;
            062   50    32    2              162   114   72    r&lt;br /&gt;
            063   51    33    3              163   115   73    s&lt;br /&gt;
            064   52    34    4              164   116   74    t&lt;br /&gt;
            065   53    35    5              165   117   75    u&lt;br /&gt;
            066   54    36    6              166   118   76    v&lt;br /&gt;
            067   55    37    7              167   119   77    w&lt;br /&gt;
            070   56    38    8              170   120   78    x&lt;br /&gt;
            071   57    39    9              171   121   79    y&lt;br /&gt;
            072   58    3A    :              172   122   7A    z&lt;br /&gt;
            073   59    3B    ;              173   123   7B    {&lt;br /&gt;
            074   60    3C    &amp;lt;              174   124   7C    |&lt;br /&gt;
            075   61    3D    =              175   125   7D    }&lt;br /&gt;
            076   62    3E    &amp;gt;              176   126   7E    ~&lt;br /&gt;
            077   63    3F    ?              177   127   7F    DEL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 29:&lt;br /&gt;
&lt;br /&gt;
     Need a WWW Browser for the Terminal Session? Try lynx or elinks.&lt;br /&gt;
&lt;br /&gt;
         $ lynx&lt;br /&gt;
&lt;br /&gt;
     Or to read all these tips, with the latest updates&lt;br /&gt;
&lt;br /&gt;
      $ lynx http://umn.dl.sourceforge.net/sourceforge/souptonuts/How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Or, better yet elinks.&lt;br /&gt;
&lt;br /&gt;
         $ elinks http://somepage.&lt;br /&gt;
&lt;br /&gt;
     You can get elinks at the following site:&lt;br /&gt;
&lt;br /&gt;
             http://elinks.or.cz/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 30:&lt;br /&gt;
&lt;br /&gt;
    screen - screen manager with VT100/ANSI terminal emulation&lt;br /&gt;
&lt;br /&gt;
         This is an excellent utility. But if you work a lot in Emacs,&lt;br /&gt;
         then, you should place the following in your ~./.bashrc&lt;br /&gt;
&lt;br /&gt;
             alias s='screen -e^Pa -D -R'&lt;br /&gt;
&lt;br /&gt;
         After loging in again (or source .bashrc) ,&lt;br /&gt;
         type the following to load &amp;quot;screen&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
             $ s&lt;br /&gt;
&lt;br /&gt;
         If you're using the not using the alias command above, substitute&lt;br /&gt;
         CTL-a for CTL-p below. :&lt;br /&gt;
&lt;br /&gt;
             CTL-p CTL-C       To get a new session&lt;br /&gt;
             CTL-p  &amp;quot;           To list sessions, and arrow keys to move&lt;br /&gt;
             CTL-p SHFT-A      To name sessions&lt;br /&gt;
             CTL-p S            To split screens&lt;br /&gt;
             CLT-p Q            To unsplit screens&lt;br /&gt;
             CLT-p TAB          To switch between screens&lt;br /&gt;
             CLT-p :resize n    To resize screen to n rows, on split screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Screen is very powerful.  Should you become disconneced, you can&lt;br /&gt;
         still resume work after loggin in.&lt;br /&gt;
&lt;br /&gt;
             $ man screen&lt;br /&gt;
&lt;br /&gt;
         The above command will give you more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 31:&lt;br /&gt;
&lt;br /&gt;
     Need to Find the Factors of a Number?&lt;br /&gt;
&lt;br /&gt;
           $ factor 2345678992&lt;br /&gt;
                2345678992: 2 2 2 2 6581 22277&lt;br /&gt;
&lt;br /&gt;
     It's a quick way to find out if a number is prime&lt;br /&gt;
&lt;br /&gt;
           $ factor 7867&lt;br /&gt;
                7867: 7867&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 32:&lt;br /&gt;
&lt;br /&gt;
     Less is More -- piping to less to scroll backword and forward&lt;br /&gt;
&lt;br /&gt;
      For large &amp;quot;ls&amp;quot; listings try the followin, then, use the arrow key&lt;br /&gt;
      to move up and down the list.&lt;br /&gt;
&lt;br /&gt;
           $ ls /some_large_dir/ | less&lt;br /&gt;
&lt;br /&gt;
                 or&lt;br /&gt;
&lt;br /&gt;
           $ cat some_large_file | less&lt;br /&gt;
&lt;br /&gt;
                 or&lt;br /&gt;
&lt;br /&gt;
           $ less some_large_file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 33:&lt;br /&gt;
&lt;br /&gt;
     C &amp;quot;indent&amp;quot; Settings for Kernel Development&lt;br /&gt;
&lt;br /&gt;
           $ indent -kr -i8  program.c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 34:&lt;br /&gt;
&lt;br /&gt;
     FTP auto-login.  &amp;quot;ftp&amp;quot; to a site and have the password stored.&lt;br /&gt;
&lt;br /&gt;
     For instance, here's a sample &amp;quot;.net&amp;quot; file in a user's home&lt;br /&gt;
     directory for uploading to sourceforge. Note, sourceforge will&lt;br /&gt;
     take any password, so m@temp.com is used here for login &amp;quot;anonymous&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ cat ~/.netrc&lt;br /&gt;
               machine upload.sourceforge.net login anonymous password m@temp.com&lt;br /&gt;
               default login anonymous password user@site&lt;br /&gt;
&lt;br /&gt;
     It might be a good idea to change the rights on this file&lt;br /&gt;
&lt;br /&gt;
           $ chmod 0400 ~/.netrc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         #!/bin/bash&lt;br /&gt;
         #&lt;br /&gt;
         #  Sample ftp automated script to download&lt;br /&gt;
         #  file to ${dwnld}&lt;br /&gt;
         #&lt;br /&gt;
         dwnld=&amp;quot;/work/faq/unix-faq&amp;quot;&lt;br /&gt;
         cd ${dwnld}&lt;br /&gt;
         ftp &amp;lt;&amp;lt; FTPSTRING&lt;br /&gt;
         prompt off&lt;br /&gt;
         open rtfm.mit.edu&lt;br /&gt;
         cd /pub/usenet-by-group/news.answers/unix-faq/faq&lt;br /&gt;
         mget contents&lt;br /&gt;
         mget diff&lt;br /&gt;
         mget part*&lt;br /&gt;
         bye&lt;br /&gt;
         FTPSTRING&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      (Also see TIP 114 for ncftpget, which is a very powerful restarting&lt;br /&gt;
                            ftp program)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 35:&lt;br /&gt;
&lt;br /&gt;
     Bash Brace Expansion&lt;br /&gt;
&lt;br /&gt;
           $ echo f{ee,ie,oe,um}&lt;br /&gt;
                fee fie foe fum&lt;br /&gt;
&lt;br /&gt;
     This works with almost any command&lt;br /&gt;
&lt;br /&gt;
           $ mkdir -p /work/junk/{one,two,three,four}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 36:&lt;br /&gt;
&lt;br /&gt;
     Getting a List of Users on the System&lt;br /&gt;
&lt;br /&gt;
           $ cut -d: -f1 /etc/passwd | sort&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 37:&lt;br /&gt;
&lt;br /&gt;
     Editing a Bash Command&lt;br /&gt;
&lt;br /&gt;
      Try typing a long command say, then, type &amp;quot;fc&amp;quot; for an easy way&lt;br /&gt;
      to edit the command.&lt;br /&gt;
&lt;br /&gt;
           $ find /etc -iname '*.cnf' -exec grep -H 'log' {} \;&lt;br /&gt;
           $ fc&lt;br /&gt;
&lt;br /&gt;
      &amp;quot;fc&amp;quot; will bring the last command typed into an editor, &amp;quot;emacs&amp;quot; if&lt;br /&gt;
      that's the default editor. Type &amp;quot;fc -l&amp;quot; to list last few commands.&lt;br /&gt;
&lt;br /&gt;
      To seach for a command, try typing &amp;quot;CTL-r&amp;quot; at the shell prompt for&lt;br /&gt;
      searching. &amp;quot;CTL-t&amp;quot; to transpose, say &amp;quot;sl&amp;quot; was typed by you want &amp;quot;ls&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Hints when using &amp;quot;fc: in emacs:&lt;br /&gt;
&lt;br /&gt;
           ESC-b     move one word backward&lt;br /&gt;
           ESC-f     move one word forward&lt;br /&gt;
           ESC-DEL   kill one word backward&lt;br /&gt;
           CTL-k     kill point to end&lt;br /&gt;
           CTL-y     un-yank killed region at point&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 38:&lt;br /&gt;
&lt;br /&gt;
     Moving around Directories.&lt;br /&gt;
&lt;br /&gt;
     Change to the home directory:&lt;br /&gt;
          $ cd ~&lt;br /&gt;
            or&lt;br /&gt;
          $ cd&lt;br /&gt;
&lt;br /&gt;
     To go back to the last directory&lt;br /&gt;
          $ cd -&lt;br /&gt;
&lt;br /&gt;
     Instead of &amp;quot;cd&amp;quot; to a directory try &amp;quot;pushd&amp;quot; and look&lt;br /&gt;
     at the heading...you can see a list of directories.&lt;br /&gt;
&lt;br /&gt;
          $ pushd /etc&lt;br /&gt;
          $ pushd /usr/local&lt;br /&gt;
&lt;br /&gt;
      Then, to get back &amp;quot;popd&amp;quot; or &amp;quot;popd 1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      To list all the directories pushed on the stack&lt;br /&gt;
      use the &amp;quot;dirs -v&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
          $ dirs -v&lt;br /&gt;
           0  /usr/local&lt;br /&gt;
           1  /etc&lt;br /&gt;
           2  /work/souptonuts/documentation/theBook&lt;br /&gt;
&lt;br /&gt;
      Now, if you &amp;quot;pushd +1&amp;quot; you will be moved to &amp;quot;/etc&amp;quot;, since&lt;br /&gt;
      is number &amp;quot;1&amp;quot; on the stack, and this directory will become&lt;br /&gt;
      &amp;quot;0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ pwd&lt;br /&gt;
           /usr/local&lt;br /&gt;
          $ pushd +1&lt;br /&gt;
          $ pwd&lt;br /&gt;
           /etc&lt;br /&gt;
&lt;br /&gt;
          $ dirs -v&lt;br /&gt;
           0  /etc&lt;br /&gt;
           1  /work/souptonuts/documentation/theBook&lt;br /&gt;
           2  /usr/local&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 39:&lt;br /&gt;
&lt;br /&gt;
     Need an Underscore after a Variable?&lt;br /&gt;
&lt;br /&gt;
       Enclose the variable in &amp;quot;{}&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $echo ${UID}_&lt;br /&gt;
&lt;br /&gt;
       Compare to&lt;br /&gt;
&lt;br /&gt;
          $echo $UID_&lt;br /&gt;
&lt;br /&gt;
       Also try the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ m=&amp;quot;my stuff here&amp;quot;&lt;br /&gt;
                $ echo -e ${m// /'\n'}&lt;br /&gt;
                        my&lt;br /&gt;
                        stuff&lt;br /&gt;
                        here&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 40:&lt;br /&gt;
&lt;br /&gt;
     Bash Variable Offset and String Operators&lt;br /&gt;
&lt;br /&gt;
        $ r=&amp;quot;this is stuff&amp;quot;&lt;br /&gt;
        $ echo ${r:3}&lt;br /&gt;
        $ echo ${r:5:2}&lt;br /&gt;
&lt;br /&gt;
      Note, ${varname:offset:length}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         ${varname:?message}  If varname exist and isn't null return value, else,&lt;br /&gt;
                              print var and message.&lt;br /&gt;
&lt;br /&gt;
           $ r=&amp;quot;new stuff&amp;quot;&lt;br /&gt;
           $ echo ${r:? &amp;quot;that's r for you&amp;quot;}&lt;br /&gt;
               new stuff&lt;br /&gt;
           $ unset r&lt;br /&gt;
           $ echo ${r:? &amp;quot;that's r for you&amp;quot;}&lt;br /&gt;
               bash: r:  that's r for you&lt;br /&gt;
&lt;br /&gt;
         ${varname:+word}    If varname exist and not null return word. Else, return null.&lt;br /&gt;
&lt;br /&gt;
         ${varname:-word}    If varname exist and not null return value. Else, return word.&lt;br /&gt;
&lt;br /&gt;
      Working with arrays in bash - bash arrays.&lt;br /&gt;
&lt;br /&gt;
           $ unset p&lt;br /&gt;
           $ p=(one two three)&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[@]}&amp;quot;&lt;br /&gt;
           one two three&lt;br /&gt;
&lt;br /&gt;
      or&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[*]}&amp;quot;&lt;br /&gt;
           one two three&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${#p[@]}&amp;quot;&lt;br /&gt;
           3&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[0]}&amp;quot;&lt;br /&gt;
           one&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[1]}&amp;quot;&lt;br /&gt;
           two&lt;br /&gt;
&lt;br /&gt;
            Also see (TIP 95)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 41:&lt;br /&gt;
&lt;br /&gt;
     Loops in Bash&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The command below loops through directories listed in $PATH.&lt;br /&gt;
&lt;br /&gt;
          $ path=$PATH:&lt;br /&gt;
          $ while [ $path ]; do echo &amp;quot; ${path%%:*} &amp;quot;; path=${path#*:}; done&lt;br /&gt;
&lt;br /&gt;
       The command below will also loop through directories in your path.&lt;br /&gt;
&lt;br /&gt;
          $IFS=:&lt;br /&gt;
          $ for dir in $PATH&lt;br /&gt;
          &amp;gt; do&lt;br /&gt;
          &amp;gt; ls -ld $dir&lt;br /&gt;
          &amp;gt; done&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Jun 10 20:16 /usr/local/bin&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Jun 13 23:12 /bin&lt;br /&gt;
              drwxr-xr-x    3 root     root        40960 Jun 12 08:00 /usr/bin&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Feb 14 03:12 /usr/X11R6/bin&lt;br /&gt;
              drwxrwxr-x    2 chirico  chirico      4096 Jun  6 13:06 /home/chirico/bin&lt;br /&gt;
&lt;br /&gt;
     Other ways of doing loops:&lt;br /&gt;
&lt;br /&gt;
        for (( i=1; i &amp;lt;= 20; i++))&lt;br /&gt;
                do&lt;br /&gt;
                        echo -n &amp;quot;$i &amp;quot;&lt;br /&gt;
                done&lt;br /&gt;
&lt;br /&gt;
     Note, to do it all on one line, do the following:&lt;br /&gt;
&lt;br /&gt;
        $ for (( i=1; i &amp;lt;= 20; i++)); do echo -n &amp;quot;$i&amp;quot;; done&lt;br /&gt;
&lt;br /&gt;
     Below, is an example of declaring i an integer so that you do not&lt;br /&gt;
     have to preface with let.&lt;br /&gt;
&lt;br /&gt;
          $ declare -i i&lt;br /&gt;
          $ i=5;&lt;br /&gt;
          $ while (( $i &amp;gt; 1 )); do&lt;br /&gt;
          &amp;gt; i=i-1&lt;br /&gt;
          &amp;gt; echo $i&lt;br /&gt;
          &amp;gt; done&lt;br /&gt;
          4&lt;br /&gt;
          3&lt;br /&gt;
          2&lt;br /&gt;
&lt;br /&gt;
     You can also use &amp;quot;while [ $i -gt 1 ]; do&amp;quot;  in place of &amp;quot;while (( $i &amp;gt; 1 )); do&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     To get a listing of all declared values&lt;br /&gt;
&lt;br /&gt;
          $ declare -i&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Try putting a few words in the file &amp;quot;test&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         $ while read filename; do echo  &amp;quot;- $filename &amp;quot;; done &amp;lt; test |nl -w1&lt;br /&gt;
&lt;br /&gt;
     Or, using an array&lt;br /&gt;
&lt;br /&gt;
                declare -a Array&lt;br /&gt;
                Array[0]=&amp;quot;zero&amp;quot;&lt;br /&gt;
                Array[1]=&amp;quot;one&amp;quot;&lt;br /&gt;
                Array[2]=&amp;quot;two&amp;quot;&lt;br /&gt;
                for i in `seq ${#Array[@]}`&lt;br /&gt;
                do&lt;br /&gt;
                  echo $Array[$i-1]&lt;br /&gt;
                done&lt;br /&gt;
&lt;br /&gt;
         Also see (TIP 95 and TIP 133).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 42:&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;diff&amp;quot; and &amp;quot;patch&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
        You have created a program &amp;quot;prog.c&amp;quot;, saved as this name and also copied&lt;br /&gt;
        to  &amp;quot;prog.c.old&amp;quot;. You post &amp;quot;prog.c&amp;quot; to users.  Next, you make changes&lt;br /&gt;
        to prog.c&lt;br /&gt;
&lt;br /&gt;
          $ diff -c prog.c.old prog.c &amp;gt; prog.patch&lt;br /&gt;
&lt;br /&gt;
        Now, users can get the latest updates by running.&lt;br /&gt;
&lt;br /&gt;
          $ patch &amp;lt; prog.patch&lt;br /&gt;
&lt;br /&gt;
        By the way, you can make backups of your data easily.&lt;br /&gt;
&lt;br /&gt;
          $ cp /etc/fstab{,.bak}&lt;br /&gt;
&lt;br /&gt;
        Now, you do your edits to &amp;quot;/etc/fstab&amp;quot; and if you need&lt;br /&gt;
        to go back to the original, you can find it at&lt;br /&gt;
        &amp;quot;/etc/fstab.bak&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 43:&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;cat&amp;quot; the Contents of Files Listed in a File, in That Order.&lt;br /&gt;
&lt;br /&gt;
       SETUP (Assume you have the following)&lt;br /&gt;
&lt;br /&gt;
              $ cat file_of_files&lt;br /&gt;
                  file1&lt;br /&gt;
                  file2&lt;br /&gt;
&lt;br /&gt;
              $ cat file1&lt;br /&gt;
                  This is the data in file1&lt;br /&gt;
&lt;br /&gt;
              $ cat file 2&lt;br /&gt;
                  This is the data in file2&lt;br /&gt;
&lt;br /&gt;
       So there are 3 files here &amp;quot;file_of_files&amp;quot; which contains the name of&lt;br /&gt;
       other files.  In this case &amp;quot;file1&amp;quot; and &amp;quot;file2&amp;quot;. And the contents of&lt;br /&gt;
       &amp;quot;file1&amp;quot; and &amp;quot;file2&amp;quot; is shown above.&lt;br /&gt;
&lt;br /&gt;
               $ cat file_of_files|xargs cat&lt;br /&gt;
                    This is the data in  file1&lt;br /&gt;
                    This is the data in  file2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 44:&lt;br /&gt;
&lt;br /&gt;
     Columns and Rows -- getting anything you want.&lt;br /&gt;
&lt;br /&gt;
     Assume you have the following file.&lt;br /&gt;
&lt;br /&gt;
        $ cat data&lt;br /&gt;
           1 2 3&lt;br /&gt;
           4 5&lt;br /&gt;
           6 7 8 9 10&lt;br /&gt;
           11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
     How to you get everything in  2 columns?&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l2&lt;br /&gt;
           1 2&lt;br /&gt;
           3 4&lt;br /&gt;
           5 6&lt;br /&gt;
           7 8&lt;br /&gt;
           9 10&lt;br /&gt;
           11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
    Three columns?&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l3&lt;br /&gt;
           1 2 3&lt;br /&gt;
           4 5 6&lt;br /&gt;
           7 8 9&lt;br /&gt;
           10 11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
    What's the row sum of the &amp;quot;three columns?&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
           6&lt;br /&gt;
           15&lt;br /&gt;
           24&lt;br /&gt;
           33&lt;br /&gt;
           27&lt;br /&gt;
&lt;br /&gt;
    or&lt;br /&gt;
&lt;br /&gt;
        $ tr ' ' '\n' &amp;lt; data |xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
&lt;br /&gt;
    NOTE &amp;quot;Steven Heiner's rule&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
             cat one_file | program&lt;br /&gt;
&lt;br /&gt;
           can always be rewritten as&lt;br /&gt;
&lt;br /&gt;
             program &amp;lt; one_file&lt;br /&gt;
&lt;br /&gt;
   Note: thanks to Steven Heiner (http://www.shelldorado.com/) the above can be&lt;br /&gt;
       shortened as follows:&lt;br /&gt;
&lt;br /&gt;
               $ tr ' ' '\n' &amp;lt; data|xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
&lt;br /&gt;
          Need to &amp;quot;tr&amp;quot; from the stdin?&lt;br /&gt;
&lt;br /&gt;
               $ tr &amp;quot;xy&amp;quot; &amp;quot;yx&amp;quot;| ... | ...&lt;br /&gt;
&lt;br /&gt;
       But there is a the &amp;quot;Stephane CHAZELAS&amp;quot; condition here&lt;br /&gt;
&lt;br /&gt;
         &amp;quot;Note that tr, sed, and awk mail fail on files containing '\0'&lt;br /&gt;
          sed and awk have unspecified behaviors if the input&lt;br /&gt;
          doesn't end in a '\n' (or to sum up, cat works for&lt;br /&gt;
          binary and text files, text utilities such as sed or awk&lt;br /&gt;
          work only for text files).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 45:&lt;br /&gt;
&lt;br /&gt;
     Auto Directory Spelling Corrections.&lt;br /&gt;
&lt;br /&gt;
      To turn this on:&lt;br /&gt;
&lt;br /&gt;
           $ shopt -s cdspell&lt;br /&gt;
&lt;br /&gt;
      Now mispell a directory in the cd command.&lt;br /&gt;
&lt;br /&gt;
           $ cd /usk/local&lt;br /&gt;
                   ^-------- still gets you to --&lt;br /&gt;
                                                |&lt;br /&gt;
                                            /usr/local&lt;br /&gt;
&lt;br /&gt;
      What other options can you set? The following will list&lt;br /&gt;
      all the options:&lt;br /&gt;
&lt;br /&gt;
           $ shopt -p&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 46:&lt;br /&gt;
&lt;br /&gt;
     Record Eveything Printed on Your Terminal Screen.&lt;br /&gt;
&lt;br /&gt;
            $ script -a &amp;lt;filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Now start doing stuff and &amp;quot;everything&amp;quot; is appended to &amp;lt;filename&amp;gt;.&lt;br /&gt;
     For example&lt;br /&gt;
&lt;br /&gt;
            $ script installation&lt;br /&gt;
&lt;br /&gt;
            $ (command)&lt;br /&gt;
&lt;br /&gt;
            $ (result)&lt;br /&gt;
&lt;br /&gt;
            $ ...&lt;br /&gt;
&lt;br /&gt;
            $ ...&lt;br /&gt;
&lt;br /&gt;
            $ (command)&lt;br /&gt;
&lt;br /&gt;
            $ (result)&lt;br /&gt;
&lt;br /&gt;
            $ exit&lt;br /&gt;
&lt;br /&gt;
     The whole session log is in the installation file that you can later&lt;br /&gt;
     read and/or cleanup and add to a documentation.&lt;br /&gt;
&lt;br /&gt;
     This command can also be used to redirect the contents to another user,&lt;br /&gt;
     but you must be root to do this.&lt;br /&gt;
&lt;br /&gt;
     Step 1 - find out what pts they are using.&lt;br /&gt;
&lt;br /&gt;
            $ w&lt;br /&gt;
&lt;br /&gt;
     Step 2 - Run script on that pts. After running this command below&lt;br /&gt;
              everything you type will appear on their screen.&lt;br /&gt;
&lt;br /&gt;
            $ script /dev/pts/4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Thanks to Jacques.GARNIER-EXTERIEUR@EU.RHODIA.COM for his contribution&lt;br /&gt;
     to this tip.&lt;br /&gt;
&lt;br /&gt;
     Also reference TIP 208.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 47:&lt;br /&gt;
&lt;br /&gt;
     Monitor all Network Traffic Except Your Current ssh Connection.&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX -s 1500 port not 22&lt;br /&gt;
&lt;br /&gt;
       Or to filter out port 123 as well getting the full length of the packet&lt;br /&gt;
       (-s 0), use the following:&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX -s 0 port not 22  and port not 123&lt;br /&gt;
&lt;br /&gt;
       Or to filter only a certain host say 81.169.158.205&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX  port not 22 and host 81.169.158.205&lt;br /&gt;
&lt;br /&gt;
     Just want ip addresses and a little bit of data, then,&lt;br /&gt;
     use this. The &amp;quot;-c 20&amp;quot; is to stop after 20 packets.&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN  -s 1500 port not 22 -c 20&lt;br /&gt;
&lt;br /&gt;
     If you're looking for sign of DOS attacks, the following show just the SYN&lt;br /&gt;
     packets on all interfaces:&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump 'tcp[13] &amp;amp; 2 == 2'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 48:&lt;br /&gt;
&lt;br /&gt;
     Where are the GNU Reference Manuals?&lt;br /&gt;
&lt;br /&gt;
           http://www.gnu.org/manual/manual.html&lt;br /&gt;
&lt;br /&gt;
     Also worth a look the &amp;quot;Linux Documentation Project&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           http://en.tldp.org/&lt;br /&gt;
&lt;br /&gt;
     and Red Hat manuals&lt;br /&gt;
&lt;br /&gt;
           http://www.redhat.com/docs/manuals/enterprise/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 49:&lt;br /&gt;
&lt;br /&gt;
     Setting or Changing the Library Path.&lt;br /&gt;
&lt;br /&gt;
     The following contains the settings to be added or deleted&lt;br /&gt;
&lt;br /&gt;
           /etc/ld.so.conf&lt;br /&gt;
&lt;br /&gt;
     After this file is edited, you must run the following:&lt;br /&gt;
&lt;br /&gt;
           $ ldconfig&lt;br /&gt;
&lt;br /&gt;
     See &amp;quot;man ldconfig&amp;quot; for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 50:&lt;br /&gt;
&lt;br /&gt;
     Working with Libraries in C&lt;br /&gt;
&lt;br /&gt;
     Assume the following 3 programs:&lt;br /&gt;
&lt;br /&gt;
      $ cat ./src/test.c&lt;br /&gt;
&lt;br /&gt;
         int test(int t)&lt;br /&gt;
         {&lt;br /&gt;
           printf(&amp;quot;%d\n&amp;quot;,t);&lt;br /&gt;
           return t;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      $ cat ./src/prog1.c&lt;br /&gt;
&lt;br /&gt;
         /*&lt;br /&gt;
          program: prog1.c&lt;br /&gt;
          dependences: test.c&lt;br /&gt;
&lt;br /&gt;
          compiling this program:&lt;br /&gt;
          gcc -o prog test.c prog1.c&lt;br /&gt;
&lt;br /&gt;
          Note the libpersonal include&lt;br /&gt;
          should be remove if NOT using the&lt;br /&gt;
          library&lt;br /&gt;
         */&lt;br /&gt;
&lt;br /&gt;
         #include &amp;lt;libpersonal.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         int&lt;br /&gt;
         main(int argc, char **argv)&lt;br /&gt;
         {&lt;br /&gt;
           test(45);&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
      $ cat ./include/libpersonal.h&lt;br /&gt;
&lt;br /&gt;
         extern int test(int);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Prog1.c needs the test function in  test.c&lt;br /&gt;
     To compile, so that both programs work together, do the following:&lt;br /&gt;
&lt;br /&gt;
          $ cd src&lt;br /&gt;
          $ gcc -o prog test.c prog1.c -I../include&lt;br /&gt;
&lt;br /&gt;
     However, if you want to create your own static library, then, run the following:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p ../lib&lt;br /&gt;
          $ gcc -c test.c  -o ../lib/test.o&lt;br /&gt;
          $ cd ../lib&lt;br /&gt;
          $ ar r libpersonal.a test.o&lt;br /&gt;
          $ ranlib libpersonal.a&lt;br /&gt;
&lt;br /&gt;
     or, the ar and ranlib command can be combined as follows:&lt;br /&gt;
&lt;br /&gt;
          $ ar rs libpersonal.a test.o&lt;br /&gt;
&lt;br /&gt;
     To compile the program with the static library:&lt;br /&gt;
&lt;br /&gt;
          $ cd ../src&lt;br /&gt;
          $ gcc -I../include -L../lib -o prog1 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     The -I../include  tells  gcc to look in the ../include directory for&lt;br /&gt;
     libpersonal.h. and -L../lib, tells gcc to look for the&lt;br /&gt;
     &amp;quot;libpersonal.a&amp;quot; library.&lt;br /&gt;
&lt;br /&gt;
           $ cd ..&lt;br /&gt;
           $ tree src lib include&lt;br /&gt;
           src&lt;br /&gt;
           |-- prog&lt;br /&gt;
           |-- prog1&lt;br /&gt;
           |-- prog1.c&lt;br /&gt;
           `-- test.c&lt;br /&gt;
           lib&lt;br /&gt;
           |-- libpersonal.a&lt;br /&gt;
           `-- test.o&lt;br /&gt;
           include&lt;br /&gt;
           `-- libpersonal.h&lt;br /&gt;
&lt;br /&gt;
     This was a STATIC library. Often times you will want to use a SHARED&lt;br /&gt;
     or dynamic library.&lt;br /&gt;
&lt;br /&gt;
     SHARED LIBRARY:&lt;br /&gt;
&lt;br /&gt;
     You must recompile test.c with -fpic option.&lt;br /&gt;
&lt;br /&gt;
          $ cd ../lib&lt;br /&gt;
          $ gcc -c -fpic ../src/test.c -o test.o&lt;br /&gt;
&lt;br /&gt;
     Next create the libpersonal.so file.&lt;br /&gt;
&lt;br /&gt;
          $ gcc -shared -o libpersonal.so test.o&lt;br /&gt;
&lt;br /&gt;
     Now, compile the source prog1.c as follows:&lt;br /&gt;
&lt;br /&gt;
          $ cd ../src&lt;br /&gt;
          $ gcc -Wl,-R../lib -L../lib -I../include -o prog2 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
     This should work fine. But, take a look at prog2 using the ldd command.&lt;br /&gt;
&lt;br /&gt;
          $ ldd prog2&lt;br /&gt;
&lt;br /&gt;
        libpersonal.so =&amp;gt; ../lib/libpersonal.so (0x40017000)&lt;br /&gt;
        libc.so.6 =&amp;gt; /lib/tls/libc.so.6 (0x42000000)&lt;br /&gt;
        /lib/ld-linux.so.2 =&amp;gt; /lib/ld-linux.so.2 (0x40000000)&lt;br /&gt;
&lt;br /&gt;
     If you move the program prog2 to a different location, it will not run.&lt;br /&gt;
     Instead you will get the following error:&lt;br /&gt;
&lt;br /&gt;
           prog2: error while loading shared libraries: libpersonal.so:&lt;br /&gt;
                     cannot open shared object file: No such file or directory&lt;br /&gt;
&lt;br /&gt;
     To fix this, you should specify the direct path to the library. And in my&lt;br /&gt;
     case it is rather long&lt;br /&gt;
&lt;br /&gt;
      $  gcc -Wl,-R/work/souptonuts/documentation/theBook/lib -L../lib -I../include -o prog2 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE: The -R must always follow the -Wl.  (-Wl,-R&amp;lt;directory&amp;gt;) They always go together&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 51:&lt;br /&gt;
&lt;br /&gt;
     Actively Monitor a File and Send Email when Expression Occurs.&lt;br /&gt;
&lt;br /&gt;
     This is a way to monitor &amp;quot;/var/log/messages&amp;quot; or any file for certain changes.&lt;br /&gt;
     The example below actively monitors &amp;quot;stuff&amp;quot; for the work &amp;quot;now&amp;quot; and as soon as&lt;br /&gt;
     &amp;quot;now&amp;quot; is added to the file, the contents of msg are sent to the user&lt;br /&gt;
     mikechirico@hotmail.com&lt;br /&gt;
&lt;br /&gt;
          $ tail -f stuff | \&lt;br /&gt;
              awk ' /now/ { system(&amp;quot;mail -s \&amp;quot;This is working\&amp;quot;  mikechirico@hotmail.com &amp;lt; msg&amp;quot;) }'&lt;br /&gt;
&lt;br /&gt;
     Or, you can run a program, say get headings on slashdot from the program &amp;quot;getslash.php&amp;quot; which&lt;br /&gt;
     runs on  &amp;quot;192.168.1.155&amp;quot; with account &amp;quot;chirico&amp;quot;. Assuming you have ssh keys setup, then, the following&lt;br /&gt;
     will send mail from the output:&lt;br /&gt;
&lt;br /&gt;
          $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;|mail -s &amp;quot;Slash cron Headlines&amp;quot;  mchirico@comcast.net&lt;br /&gt;
&lt;br /&gt;
     See (TIP 80) for scraping the headings on slash dot and how to get a copy of &amp;quot;getslash.php&amp;quot;.  If you still&lt;br /&gt;
     want to use awk:&lt;br /&gt;
&lt;br /&gt;
           $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;| \&lt;br /&gt;
                      awk '{ print $0 | &amp;quot;mail -s \x27 Slash Topics \x27 mchirico@comcast.net &amp;quot;}'&lt;br /&gt;
&lt;br /&gt;
     Note the &amp;quot;\x27&amp;quot; is a quote.  Maybe you only want articles dealing with &amp;quot;Linux&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
           $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;| \&lt;br /&gt;
                      awk '/Linux/{ print $0 | &amp;quot;mail -s \x27 Slash Topics \x27 mchirico@comcast.net &amp;quot;}'&lt;br /&gt;
&lt;br /&gt;
     For $60, you can get a numeric display from &amp;quot;delcom engineering&amp;quot; that you can send messages and&lt;br /&gt;
     data to.  I get weather information off the internet and send it to this device.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/projects/delcom/&lt;br /&gt;
&lt;br /&gt;
     (Reference TIP 151 for ssh tips)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 52:&lt;br /&gt;
&lt;br /&gt;
     Need to Keep Secrets? Encrypt it.&lt;br /&gt;
&lt;br /&gt;
      To Encrypt:&lt;br /&gt;
&lt;br /&gt;
            $ openssl des3 -salt -in file.txt -out file.des3&lt;br /&gt;
&lt;br /&gt;
      The above will prompt for a password, or you can put it in&lt;br /&gt;
      with a -k option, assuming you're on a trusted server.&lt;br /&gt;
&lt;br /&gt;
      To Decrypt&lt;br /&gt;
&lt;br /&gt;
            $  openssl des3 -d -salt -in file.des3 -out file.txt -k mypassword&lt;br /&gt;
&lt;br /&gt;
      Need to encrypt what you type? Enter the following, then start typing&lt;br /&gt;
      and  ^D to end.&lt;br /&gt;
&lt;br /&gt;
            $ openssl des3 -salt -out stuff.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 53:&lt;br /&gt;
&lt;br /&gt;
     Check that a File has Not Been Tampered With: Use Cryptographic Hashing Function.&lt;br /&gt;
&lt;br /&gt;
     The md5sum is popular but dated&lt;br /&gt;
&lt;br /&gt;
              $ md5sum file&lt;br /&gt;
&lt;br /&gt;
     Instead, use one of the following;&lt;br /&gt;
&lt;br /&gt;
              $ openssl dgst -sha1 -c file&lt;br /&gt;
&lt;br /&gt;
              $ openssl dgst -ripemd160 -c  file&lt;br /&gt;
&lt;br /&gt;
     All calls give a fixed length string or &amp;quot;message digest&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 54:&lt;br /&gt;
&lt;br /&gt;
     Need to View Information About a Secure Web Server? A SSL/TLS test.&lt;br /&gt;
&lt;br /&gt;
           $ openssl s_client -connect www.sourceforge.net:443&lt;br /&gt;
&lt;br /&gt;
     Above will give a long listing of certificates.&lt;br /&gt;
&lt;br /&gt;
     Note, it is also possible to get certificate information about a mail server&lt;br /&gt;
&lt;br /&gt;
           $ openssl s_client -connect mail.comcast.net:995 -showcerts&lt;br /&gt;
&lt;br /&gt;
     When you do the above command you get two certificates. If you copy&lt;br /&gt;
     past both certificates by taking the following contents include the&lt;br /&gt;
     begin and end show below:&lt;br /&gt;
&lt;br /&gt;
                 -----BEGIN CERTIFICATE-----&lt;br /&gt;
                 ....&lt;br /&gt;
                 -----END CERTIFICATE-----&lt;br /&gt;
&lt;br /&gt;
     Then create files &amp;quot;comcast0.pem&amp;quot; and &amp;quot;comcast1.pem&amp;quot; out of these certificaties and&lt;br /&gt;
     put them in a directory &amp;quot;/home/donkey/.certs&amp;quot;, then, with the openssl src package, in&lt;br /&gt;
     the &amp;quot;./tools/c_rehash&amp;quot; run&lt;br /&gt;
&lt;br /&gt;
            $ c_rehash .certs&lt;br /&gt;
            Doing .certs&lt;br /&gt;
            comcast0.pem =&amp;gt; 72f90dc0.0&lt;br /&gt;
            comcast1.pem =&amp;gt; f73e89fd.0&lt;br /&gt;
&lt;br /&gt;
     Now it's possible to have fetchmail work with these certs.&lt;br /&gt;
&lt;br /&gt;
       #&lt;br /&gt;
       #&lt;br /&gt;
       # Sample .fetchmailrc file for Comcast&lt;br /&gt;
       #&lt;br /&gt;
       # Check mail every 90 seconds&lt;br /&gt;
       set daemon 90&lt;br /&gt;
       set syslog&lt;br /&gt;
       set postmaster donkey&lt;br /&gt;
       #set bouncemail&lt;br /&gt;
       #&lt;br /&gt;
       # Comcast email is zdonkey but computer account is  just donkey&lt;br /&gt;
       #&lt;br /&gt;
       poll mail.comcast.net with proto POP3 and options no dns&lt;br /&gt;
              user 'zdonkey' with pass &amp;quot;somethin35&amp;quot;  is 'donkey' here options ssl sslcertck sslcertpath '/home/donkey/.certs'&lt;br /&gt;
              smtphost comcast.net&lt;br /&gt;
       # currently not used&lt;br /&gt;
       mda '/usr/bin/procmail -d %T'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     REFERENCE: http://www.openssl.org/&lt;br /&gt;
                http://www.catb.org/~esr/fetchmail/fetchmail-6.2.5.tar.gz&lt;br /&gt;
                http://www.madboa.com/geek/openssl/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 55:&lt;br /&gt;
&lt;br /&gt;
     cp --parents. What does this option do?&lt;br /&gt;
&lt;br /&gt;
     Assume you have the following directory structure&lt;br /&gt;
&lt;br /&gt;
            .&lt;br /&gt;
            |-- a&lt;br /&gt;
            |   `-- b&lt;br /&gt;
            |       `-- c&lt;br /&gt;
            |           `-- d&lt;br /&gt;
            |               |-- file1&lt;br /&gt;
            |               `-- file2&lt;br /&gt;
            `-- newdir&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Issue the following command:&lt;br /&gt;
&lt;br /&gt;
         $ cp --parents ./a/b/c/d/* ./newdir/&lt;br /&gt;
&lt;br /&gt;
     Now you have the following:&lt;br /&gt;
&lt;br /&gt;
            .&lt;br /&gt;
            |-- a&lt;br /&gt;
            |   `-- b&lt;br /&gt;
            |       `-- c&lt;br /&gt;
            |           `-- d&lt;br /&gt;
            |               |-- file1&lt;br /&gt;
            |               `-- file2&lt;br /&gt;
            `-- newdir&lt;br /&gt;
                `-- a&lt;br /&gt;
                    `-- b&lt;br /&gt;
                        `-- c&lt;br /&gt;
                            `-- d&lt;br /&gt;
                                |-- file1&lt;br /&gt;
                                `-- file2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 56:&lt;br /&gt;
&lt;br /&gt;
     Quickly Locating files.&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;locate&amp;quot; command quickly searches the indexed database for files.  It just&lt;br /&gt;
     gives the name of the files; but, if you need more information use it as follows&lt;br /&gt;
&lt;br /&gt;
         $ locate document|xargs ls -l&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;locate&amp;quot; database may only get updated every 24 hours.  For more recent finds,&lt;br /&gt;
     use the &amp;quot;find&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 57:&lt;br /&gt;
&lt;br /&gt;
     Using the &amp;quot;find&amp;quot; Command.&lt;br /&gt;
&lt;br /&gt;
     List only directories, max 2 nodes down that have &amp;quot;net&amp;quot; in the name&lt;br /&gt;
&lt;br /&gt;
       $ find /proc -type d -maxdepth 2 -iname '*net*'&lt;br /&gt;
&lt;br /&gt;
     Find all *.c and *.h files starting from the current &amp;quot;.&amp;quot; position.&lt;br /&gt;
&lt;br /&gt;
       $ find . \( -iname '*.c'  -o -iname '*.h' \) -print&lt;br /&gt;
&lt;br /&gt;
     Find all, but skip what's in &amp;quot;/CVS&amp;quot; and &amp;quot;/junk&amp;quot;. Start from &amp;quot;/work&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ find /work \( -iregex '.*/CVS'  -o -iregex '.*/junk' \)  -prune -o -print&lt;br /&gt;
&lt;br /&gt;
     Note -regex and -iregex work on the directory as well, which means&lt;br /&gt;
     you must consider the &amp;quot;./&amp;quot; that comes before all listings.&lt;br /&gt;
&lt;br /&gt;
     Here is another example. Find all files except what is under the CVS, including&lt;br /&gt;
     CVS listings. Also exclude &amp;quot;#&amp;quot; and &amp;quot;~&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       $ find . -regex '.*' ! \( -regex '.*CVS.*'  -o -regex '.*[#|~].*' \)&lt;br /&gt;
&lt;br /&gt;
     Find a *.c file, then run grep on it looking for &amp;quot;stdio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       $ find . -iname '*.c' -exec grep -H 'stdio.h' {} \;&lt;br /&gt;
         sample output --&amp;gt;  ./prog1.c:#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
                            ./test.c:#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Looking for the disk-hog on the whole system?&lt;br /&gt;
&lt;br /&gt;
       $ find /  -size +10000k 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
     Looking for files changed in the last 24 hours? Make sure you add the&lt;br /&gt;
     minus sign &amp;quot;-1&amp;quot;, otherwise, you will only find files changed exactly&lt;br /&gt;
     24 hours from now. With the &amp;quot;-1&amp;quot; you get files changed from now to 24&lt;br /&gt;
     hours.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ find  . -ctime -1  -printf &amp;quot;%a %f\n&amp;quot;&lt;br /&gt;
       Wed Oct  6 12:51:56 2004 .&lt;br /&gt;
       Wed Oct  6 12:35:16 2004 How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
     Or if you just want files.&lt;br /&gt;
&lt;br /&gt;
       $ find . -type f -ctime -1  -printf &amp;quot;%a %f\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Details on file status change in the last 48 hours, current directory. Also note &amp;quot;-atime -2&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
       $ find . -ctime -2 -type f -exec ls -l {} \;&lt;br /&gt;
&lt;br /&gt;
             NOTE: if you don't use -type f, you make get &amp;quot;.&amp;quot; returned, which&lt;br /&gt;
             when run through ls &amp;quot;ls .&amp;quot; may list more than what you want.&lt;br /&gt;
&lt;br /&gt;
             Also you may only want the current directory&lt;br /&gt;
&lt;br /&gt;
       $ find . -ctime -2 -type f -maxdepth 1 -exec ls -l {} \;&lt;br /&gt;
&lt;br /&gt;
     To find files modified within the last 5 to 10 minutes&lt;br /&gt;
&lt;br /&gt;
       $ find . -mmin +5 -mmin -10 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     For more example &amp;quot;find&amp;quot; commands, reference the following looking&lt;br /&gt;
     for the latest version of &amp;quot;bashscripts.x.x.x.tar.gz&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79320&amp;amp;package_id=80711&lt;br /&gt;
&lt;br /&gt;
     See &amp;quot;TIP 71&amp;quot; for examples of find using the inode feature. &amp;quot; $ find . -inum &amp;lt;inode&amp;gt; -exec rm -- '{}' \; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     If you don't want error messages, or need to redirect error messages &amp;quot;&amp;gt; /dev/null 2&amp;gt;&amp;amp;1&amp;quot;, or see&lt;br /&gt;
     &amp;quot;TIP 81&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 58:&lt;br /&gt;
&lt;br /&gt;
     Using the &amp;quot;rm&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
     How do you remove a file that has the name &amp;quot;-&amp;quot;.  For instance, if you run the command&lt;br /&gt;
     &amp;quot;$ cat &amp;gt; - &amp;quot; and type some text followed by ^d, how does the &amp;quot;-&amp;quot; file get deleted?&lt;br /&gt;
&lt;br /&gt;
        $ rm -- -&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;--&amp;quot; nullifies any rm options.&lt;br /&gt;
&lt;br /&gt;
     How do you delete the directory &amp;quot;one&amp;quot;, all it's sub-directories, and any data?&lt;br /&gt;
&lt;br /&gt;
        $ rm -rf ./one&lt;br /&gt;
&lt;br /&gt;
     Note, to selectively delete stuff on a directory, use the find command &amp;quot;TIP 57&amp;quot;.&lt;br /&gt;
     To delete by inode, see &amp;quot;TIP 71&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 59:&lt;br /&gt;
&lt;br /&gt;
     Giving ownership.&lt;br /&gt;
&lt;br /&gt;
     How do you give the user &amp;quot;donkey&amp;quot; ownership to all directories and files under&lt;br /&gt;
     &amp;quot;./fordonkey&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          $ chown -R donkey ./fordonkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 60:&lt;br /&gt;
&lt;br /&gt;
     Only Permit root login -- give others a message when they try to login.&lt;br /&gt;
&lt;br /&gt;
     Create the file &amp;quot;/etc/nologin&amp;quot; with &amp;quot;nologin&amp;quot; containing the contents&lt;br /&gt;
     of the message.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 61:&lt;br /&gt;
&lt;br /&gt;
     Limits: file size, open files, pipe size, stack size, max memory size&lt;br /&gt;
             cpu time, plus others.&lt;br /&gt;
&lt;br /&gt;
     To get a listing of current limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -a&lt;br /&gt;
             core file size        (blocks, -c) 0&lt;br /&gt;
             data seg size         (kbytes, -d) unlimited&lt;br /&gt;
             file size             (blocks, -f) unlimited&lt;br /&gt;
             max locked memory     (kbytes, -l) unlimited&lt;br /&gt;
             max memory size       (kbytes, -m) unlimited&lt;br /&gt;
             open files                    (-n) 1024&lt;br /&gt;
             pipe size          (512 bytes, -p) 8&lt;br /&gt;
             stack size            (kbytes, -s) 8192&lt;br /&gt;
             cpu time             (seconds, -t) unlimited&lt;br /&gt;
             max user processes            (-u) 8179&lt;br /&gt;
             virtual memory        (kbytes, -v) unlimited&lt;br /&gt;
&lt;br /&gt;
     Note as a user you can decrease your limits in the current&lt;br /&gt;
     shell session; but, you cannot increase.  This can be ideal&lt;br /&gt;
     for testing programs.  But, first you may want to create&lt;br /&gt;
     another shell &amp;quot;sh&amp;quot; so that you can &amp;quot;go back to where started&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -f 10&lt;br /&gt;
&lt;br /&gt;
     Now try&lt;br /&gt;
&lt;br /&gt;
          $ yes &amp;gt;&amp;gt; out&lt;br /&gt;
             File size limit exceeded&lt;br /&gt;
&lt;br /&gt;
     To set limits on users, make changes to &amp;quot;/etc/security/limits.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           bozo   - maxlogins 1&lt;br /&gt;
&lt;br /&gt;
     Will keep bozo from loging in more than once.&lt;br /&gt;
&lt;br /&gt;
     To list hard limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -Ha&lt;br /&gt;
&lt;br /&gt;
     To list soft limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -Sa&lt;br /&gt;
&lt;br /&gt;
     To restrict user access by time, day make changes to&lt;br /&gt;
             &amp;quot;/etc/security/time.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Also take a look at &amp;quot;/etc/profile&amp;quot; to see what other changes&lt;br /&gt;
     can be made, plus take a look under &amp;quot;/etc/security/*.conf&amp;quot; for&lt;br /&gt;
     other configuration files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 62:&lt;br /&gt;
&lt;br /&gt;
     Stupid &amp;quot;cat&amp;quot; Tricks.&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 43).&lt;br /&gt;
&lt;br /&gt;
     If you have multiple blank lines, squeeze these lines down to one,&lt;br /&gt;
     then, try the following:&lt;br /&gt;
&lt;br /&gt;
          $ cat -s &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to number the lines?&lt;br /&gt;
&lt;br /&gt;
          $ cat -n &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to show tabs?&lt;br /&gt;
&lt;br /&gt;
          $ cat -t &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Need to mark end of lines by &amp;quot;$&amp;quot;? The following was suggested by  (Amos Shapira)&lt;br /&gt;
&lt;br /&gt;
          $ cat -e &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to see all the ctl characters?&lt;br /&gt;
&lt;br /&gt;
          /* ctlgen.c&lt;br /&gt;
            Program to generate ctl characters.&lt;br /&gt;
&lt;br /&gt;
            Compile:&lt;br /&gt;
&lt;br /&gt;
               gcc -o ctlgen ctlgen.c&lt;br /&gt;
&lt;br /&gt;
            Run:&lt;br /&gt;
&lt;br /&gt;
               ./ctlgen &amp;gt; mout&lt;br /&gt;
&lt;br /&gt;
            Now see the characters:&lt;br /&gt;
&lt;br /&gt;
               cat -v mout&lt;br /&gt;
&lt;br /&gt;
            Here's a sample output:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               $ cat -v mout|tail&lt;br /&gt;
                   test M-v&lt;br /&gt;
                   test M-w&lt;br /&gt;
                   test M-x&lt;br /&gt;
                   test M-y&lt;br /&gt;
                   test M-z&lt;br /&gt;
                   test M-{&lt;br /&gt;
                   test M-|&lt;br /&gt;
                   test M-}&lt;br /&gt;
                   test M-~&lt;br /&gt;
                   test M-^?&lt;br /&gt;
&lt;br /&gt;
          */&lt;br /&gt;
          #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
          #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
          int main()&lt;br /&gt;
          {&lt;br /&gt;
            int i;&lt;br /&gt;
&lt;br /&gt;
            for(i=0; i &amp;lt; 256; ++i)&lt;br /&gt;
              printf(&amp;quot;test %c \n&amp;quot;,i);&lt;br /&gt;
&lt;br /&gt;
            return 0;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 63:&lt;br /&gt;
&lt;br /&gt;
     Guard against SYN attacks and &amp;quot;ping&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     As root do the following:&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/tcp_syncookies&lt;br /&gt;
&lt;br /&gt;
     Want to disable &amp;quot;ping&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_all&lt;br /&gt;
&lt;br /&gt;
     Disable broadcast/multicast &amp;quot;ping&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts&lt;br /&gt;
&lt;br /&gt;
     And to enable again:&lt;br /&gt;
&lt;br /&gt;
          echo 0 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_all&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 64:&lt;br /&gt;
&lt;br /&gt;
     Make changes to .bash_profile and need to update the current session?&lt;br /&gt;
&lt;br /&gt;
       $ source .bash_profile&lt;br /&gt;
&lt;br /&gt;
     With the above command, the user does not have to logout.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 65:&lt;br /&gt;
&lt;br /&gt;
     What are the Special Shell Variables?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        $#   The number of arguments.&lt;br /&gt;
        $@   All arguments, as separate words.&lt;br /&gt;
        $*   All arguments, as one word.&lt;br /&gt;
        $$   ID of the current process.&lt;br /&gt;
        $?   Exit status of the last command.&lt;br /&gt;
        $0,$1,..$9,${10},${11}...${N}    Positional parameters. After &amp;quot;9&amp;quot; you must use the ${k} syntax.&lt;br /&gt;
&lt;br /&gt;
     Note that 0 is true. For example if you execute the following, which is true you get zero.&lt;br /&gt;
&lt;br /&gt;
         $  [[ -f /etc/passwd ]]&lt;br /&gt;
         $  echo $?&lt;br /&gt;
         0&lt;br /&gt;
     And the following is false, which returns a 1.&lt;br /&gt;
&lt;br /&gt;
         $  [[ -f /etc/passwdjabberwisnohere ]]&lt;br /&gt;
         $  echo $?&lt;br /&gt;
         1&lt;br /&gt;
&lt;br /&gt;
     So true=0 and false=1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Sample program &amp;quot;mdo&amp;quot;  to show the difference between &amp;quot;$@&amp;quot; and &amp;quot;$*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        function myarg&lt;br /&gt;
        {&lt;br /&gt;
            echo &amp;quot;$# in myarg function&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
        echo -e &amp;quot;$# parameters on the cmd line\n&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;calling: myarg \&amp;quot;\$@\&amp;quot; and myarg \&amp;quot;\$*\&amp;quot;\n&amp;quot;&lt;br /&gt;
        myarg &amp;quot;$@&amp;quot;&lt;br /&gt;
        myarg &amp;quot;$*&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;\ncalling: myarg \$@ and myarg \$* without quotes\n&amp;quot;&lt;br /&gt;
        myarg $@&lt;br /&gt;
        myarg $*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The result of running &amp;quot;./mdo one two&amp;quot;. Note that when quoted, myarg &amp;quot;$*&amp;quot;,&lt;br /&gt;
      returns 1 ... all parameters are smushed together as one word.&lt;br /&gt;
&lt;br /&gt;
            [chirico@third-fl-71 theBook]$ ./mdo one two&lt;br /&gt;
            2 parameters on the cmd line&lt;br /&gt;
&lt;br /&gt;
            calling: myarg &amp;quot;$@&amp;quot; and myarg &amp;quot;$*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
            1 in myarg function&lt;br /&gt;
&lt;br /&gt;
            calling: myarg $@ and myarg $* without quotes&lt;br /&gt;
&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
&lt;br /&gt;
      Example program &amp;quot;mdo2&amp;quot; shows how the input separator can be changed.&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        IFS=|&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=,&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=\;&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=$1&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            [chirico@third-fl-71 theBook]$ ./mdo2 one two three four five&lt;br /&gt;
            one two three four five&lt;br /&gt;
&lt;br /&gt;
            one,two,three,four,five&lt;br /&gt;
&lt;br /&gt;
            one;two;three;four;five&lt;br /&gt;
&lt;br /&gt;
            oneotwoothreeofourofive&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 66:&lt;br /&gt;
&lt;br /&gt;
     Replace all &amp;quot;x&amp;quot; with &amp;quot;y&amp;quot; and all &amp;quot;y&amp;quot; with &amp;quot;x&amp;quot; in file data.&lt;br /&gt;
&lt;br /&gt;
        $ cata data&lt;br /&gt;
          x y&lt;br /&gt;
          y x&lt;br /&gt;
&lt;br /&gt;
        $ tr &amp;quot;xy&amp;quot;  &amp;quot;yx&amp;quot; &amp;lt; data&lt;br /&gt;
          y x&lt;br /&gt;
          x y&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 67:&lt;br /&gt;
&lt;br /&gt;
     On a Linux 2.6.x Kernel, how do you directly measure disk activity,&lt;br /&gt;
     and where is this information documented?&lt;br /&gt;
&lt;br /&gt;
          o The information is documented in the kernel source&lt;br /&gt;
               ./Documentation/iostats.txt&lt;br /&gt;
&lt;br /&gt;
          o The new way of getting this info in 2.6.x is&lt;br /&gt;
              $ cat /sys/block/hda/stat&lt;br /&gt;
            151121 5694 1932358 796675 37867 76770 916994 8353762 0 800672 9150437&lt;br /&gt;
&lt;br /&gt;
             Field  1 -- # of reads issued&lt;br /&gt;
                 This is the total number of reads completed successfully.&lt;br /&gt;
             Field  2 -- # of reads merged, field 6 -- # of writes merged&lt;br /&gt;
                 Reads and writes which are adjacent to each other may be merged for&lt;br /&gt;
                 efficiency.  Thus two 4K reads may become one 8K read before it is&lt;br /&gt;
                 ultimately handed to the disk, and so it will be counted (and queued)&lt;br /&gt;
                 as only one I/O.  This field lets you know how often this was done.&lt;br /&gt;
             Field  3 -- # of sectors read&lt;br /&gt;
                 This is the total number of sectors read successfully.&lt;br /&gt;
             Field  4 -- # of milliseconds spent reading&lt;br /&gt;
                 This is the total number of milliseconds spent by all reads (as&lt;br /&gt;
                 measured from __make_request() to end_that_request_last()).&lt;br /&gt;
             Field  5 -- # of writes completed&lt;br /&gt;
                 This is the total number of writes completed successfully.&lt;br /&gt;
             Field  7 -- # of sectors written&lt;br /&gt;
                 This is the total number of sectors written successfully.&lt;br /&gt;
             Field  8 -- # of milliseconds spent writing&lt;br /&gt;
                 This is the total number of milliseconds spent by all writes (as&lt;br /&gt;
                 measured from __make_request() to end_that_request_last()).&lt;br /&gt;
             Field  9 -- # of I/Os currently in progress&lt;br /&gt;
                 The only field that should go to zero. Incremented as requests are&lt;br /&gt;
                 given to appropriate request_queue_t and decremented as they finish.&lt;br /&gt;
             Field 10 -- # of milliseconds spent doing I/Os&lt;br /&gt;
                 This field is increases so long as field 9 is nonzero.&lt;br /&gt;
             Field 11 -- weighted # of milliseconds spent doing I/Os&lt;br /&gt;
                 This field is incremented at each I/O start, I/O completion, I/O&lt;br /&gt;
                 merge, or read of these stats by the number of I/Os in progress&lt;br /&gt;
                 (field 9) times the number of milliseconds spent doing I/O since the&lt;br /&gt;
                 last update of this field.  This can provide an easy measure of both&lt;br /&gt;
                 I/O completion time and the backlog that may be accumulating.&lt;br /&gt;
&lt;br /&gt;
       Note, this is device specific.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 68:&lt;br /&gt;
&lt;br /&gt;
     Passing Outbound Mail, plus Masquerading User and Hostname.&lt;br /&gt;
&lt;br /&gt;
     Here's a specific example:&lt;br /&gt;
&lt;br /&gt;
         How does one send and receive Comcast email from a home Linux box,&lt;br /&gt;
         which uses Comcast as the ISP, if the local account on the Linux&lt;br /&gt;
         box is different from the Comcast email.  For instance, the&lt;br /&gt;
         account on the Linux box is &amp;quot;chirico@third-fl-71&amp;quot; and the Comcast&lt;br /&gt;
         email account is &amp;quot;mchirico@comcast.net&amp;quot;.  Note both the hostname and&lt;br /&gt;
         username are different.&lt;br /&gt;
&lt;br /&gt;
         So, the user &amp;quot;chirico&amp;quot; using &amp;quot;mutt&amp;quot;, &amp;quot;elm&amp;quot; or any email program would&lt;br /&gt;
         like to send out email to say &amp;quot;donkey@comcast.net&amp;quot;; yet, donkey would&lt;br /&gt;
         see the email from &amp;quot;mchirico@comcast.net&amp;quot; and not &amp;quot;chirico@third-fl-71&amp;quot;&lt;br /&gt;
         but chirico@third-fl-71 would get the replies.&lt;br /&gt;
&lt;br /&gt;
         For a full description of how to solve this problem, including related&lt;br /&gt;
         &amp;quot;sendmail.mc&amp;quot;, &amp;quot;site.config.m4&amp;quot;, &amp;quot;genericstable&amp;quot;, &amp;quot;genericsdomain&amp;quot;,&lt;br /&gt;
         &amp;quot;.procmailrc&amp;quot;, and &amp;quot;.forward&amp;quot; files,  reference the following:&lt;br /&gt;
&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/README_COMCAST_EMAIL.txt?download&lt;br /&gt;
&lt;br /&gt;
         Included in the above link are instructions for building sendmail with&lt;br /&gt;
         &amp;quot;SASL&amp;quot; and &amp;quot;STARTTLS&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 69:&lt;br /&gt;
&lt;br /&gt;
     How do you remove just the last 2 lines from a file and save the result?&lt;br /&gt;
&lt;br /&gt;
         $ sed  '$d' file | sed '$d' &amp;gt; savefile&lt;br /&gt;
&lt;br /&gt;
     Or, as Amos Shapira pointed out, it's much easier with the head command.&lt;br /&gt;
&lt;br /&gt;
         $ head -2 file&lt;br /&gt;
&lt;br /&gt;
      And, of course, removing just the last line&lt;br /&gt;
&lt;br /&gt;
         $ sed '$d' file &amp;gt; savefile&lt;br /&gt;
&lt;br /&gt;
         (See REFERENCES (13))&lt;br /&gt;
&lt;br /&gt;
     How do you remove extra spaces at the end of a line?&lt;br /&gt;
&lt;br /&gt;
         $ sed 's/[ ]*$//g'&lt;br /&gt;
&lt;br /&gt;
     How do you remove blank lines, or lines with just spaces and tabs,&lt;br /&gt;
     saving the origional file as file.backup?&lt;br /&gt;
&lt;br /&gt;
         $ perl -pi.backup -e &amp;quot;s/^(\s)*\n//&amp;quot;  file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 70:&lt;br /&gt;
&lt;br /&gt;
     Generating Random Numbers.&lt;br /&gt;
&lt;br /&gt;
         $ od -vAn -N4 -tu4 &amp;lt; /dev/urandom&lt;br /&gt;
             3905158199&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 71:&lt;br /&gt;
&lt;br /&gt;
     Deleting a File by it's Inode Value.&lt;br /&gt;
&lt;br /&gt;
       See (PROGRAMMING TIP 5) for creating the file, or&lt;br /&gt;
&lt;br /&gt;
       $ cat &amp;gt; '\n\n\n\n\n\n\n'&lt;br /&gt;
         type some text&lt;br /&gt;
         ^D&lt;br /&gt;
&lt;br /&gt;
     To list the inode and display the characters.&lt;br /&gt;
&lt;br /&gt;
       $ ls -libt *&lt;br /&gt;
&lt;br /&gt;
     To remove by inode. Note the &amp;quot;--&amp;quot; option.  This&lt;br /&gt;
     will keep any special characters in the file from being&lt;br /&gt;
     interpreted at &amp;quot;rm&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
       $ find . -inum &amp;lt;inode&amp;gt; -exec rm -- '{}' \;&lt;br /&gt;
&lt;br /&gt;
     Or to check contents&lt;br /&gt;
&lt;br /&gt;
       $ find . -inum &amp;lt;inode&amp;gt; -exec cat '{}' \;&lt;br /&gt;
&lt;br /&gt;
     Reference:&lt;br /&gt;
         http://www.faqs.org/ftp/usenet/news.answers/unix-faq/faq/part2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 72:&lt;br /&gt;
&lt;br /&gt;
     Sending Attachments Using Mutt -- On the Command Line.&lt;br /&gt;
&lt;br /&gt;
        $ mutt -s &amp;quot;See Attachment&amp;quot; -a file.doc user@domain.net &amp;lt; message.txt&lt;br /&gt;
&lt;br /&gt;
          or just the message:&lt;br /&gt;
&lt;br /&gt;
        $ echo | mutt -a sample.tar.gz user@domain.net&lt;br /&gt;
&lt;br /&gt;
      Reference:&lt;br /&gt;
          http://www.shelldorado.com/articles/mailattachments.html&lt;br /&gt;
&lt;br /&gt;
        Also see (TIP 51).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 73:&lt;br /&gt;
&lt;br /&gt;
     Want to find out what functions a program calls?&lt;br /&gt;
&lt;br /&gt;
         $ strace &amp;lt;program&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Try this with &amp;quot;topen.c&amp;quot; (see PROGRAMMING TIP 5)&lt;br /&gt;
&lt;br /&gt;
         $ strace  ./topen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 74:&lt;br /&gt;
&lt;br /&gt;
     RPM Usage Summary.&lt;br /&gt;
&lt;br /&gt;
     Install. Full filename is needed.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -ivh Fedora/RPMS/postgresql-libs-7.4.2-1.i386.rpm&lt;br /&gt;
&lt;br /&gt;
     To view list of files installed with a particular package.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -ql postgresql-libs&lt;br /&gt;
                /usr/lib/libecpg.so.4&lt;br /&gt;
                /usr/lib/libecpg.so.4.1&lt;br /&gt;
                /usr/lib/libecpg_compat.so.1&lt;br /&gt;
                /usr/lib/libecpg_compat.so.1.1&lt;br /&gt;
                /usr/lib/libpgtypes.so.1&lt;br /&gt;
                ...&lt;br /&gt;
&lt;br /&gt;
     Or, to get the file listing from a package that is not installed use the&lt;br /&gt;
     &amp;quot;-p&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -pql /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/CHANGES&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/LICENSE&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/README&lt;br /&gt;
               /usr/share/man/man3/pcap.3.gz&lt;br /&gt;
&lt;br /&gt;
     For dependencies listing, use the &amp;quot;R&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qpR /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /sbin/ldconfig&lt;br /&gt;
               /sbin/ldconfig&lt;br /&gt;
               kernel &amp;gt;= 2.2.0&lt;br /&gt;
               libc.so.6&lt;br /&gt;
               libc.so.6(GLIBC_2.0)&lt;br /&gt;
               libc.so.6(GLIBC_2.1)&lt;br /&gt;
               libc.so.6(GLIBC_2.1.3)&lt;br /&gt;
               libc.so.6(GLIBC_2.3)&lt;br /&gt;
               openssl&lt;br /&gt;
               rpmlib(CompressedFileNames) &amp;lt;= 3.0.4-1&lt;br /&gt;
               rpmlib(PayloadFilesHavePrefix) &amp;lt;= 4.0-1&lt;br /&gt;
&lt;br /&gt;
     To check the integrity, use the &amp;quot;-K&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -K /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm: (sha1) dsa sha1 md5 gpg OK&lt;br /&gt;
&lt;br /&gt;
     To list all packages installed.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qa&lt;br /&gt;
&lt;br /&gt;
     To find out which file a package belongs to.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qf /usr/lib/libecpg.so.4.1&lt;br /&gt;
&lt;br /&gt;
     To uninstall a package&lt;br /&gt;
&lt;br /&gt;
         $ rpm -e&lt;br /&gt;
&lt;br /&gt;
     For building rpm packages reference the following:&lt;br /&gt;
       http://www-106.ibm.com/developerworks/library/l-rpm1/&lt;br /&gt;
&lt;br /&gt;
     To verify md5 sum so that you know it downloaded ok&lt;br /&gt;
&lt;br /&gt;
         $ rpm -K  *.rpm&lt;br /&gt;
&lt;br /&gt;
     The following is a good reference:&lt;br /&gt;
        http://www.rpm.org/max-rpm/s1-rpm-install-additional-options.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 75:&lt;br /&gt;
&lt;br /&gt;
     Listing Output from a Bash Script.&lt;br /&gt;
&lt;br /&gt;
     Add &amp;quot;set -x&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          #!/bin/bash&lt;br /&gt;
          set -x&lt;br /&gt;
          ls&lt;br /&gt;
          date&lt;br /&gt;
&lt;br /&gt;
     Will list the files and output as follows:&lt;br /&gt;
&lt;br /&gt;
           + ls&lt;br /&gt;
           ChangeLog  CVS  data  test&lt;br /&gt;
           + date&lt;br /&gt;
           Thu Jul  1 20:41:04 EDT 2004&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 76:&lt;br /&gt;
&lt;br /&gt;
     Using wget.&lt;br /&gt;
&lt;br /&gt;
     Grap a webpage and pipe it to less. For example suppose you wanted to pipe the&lt;br /&gt;
     contents of all these tips, directly from the web.&lt;br /&gt;
&lt;br /&gt;
      $ wget -O - http://sourceforge.net/direct-dl/mchirico/souptonuts/How_to_Linux_and_Open_Source.txt|less&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 77:&lt;br /&gt;
&lt;br /&gt;
     Finding IP address and MAC address.&lt;br /&gt;
&lt;br /&gt;
       $ /sbin/ifconfig&lt;br /&gt;
&lt;br /&gt;
     Note the following output &amp;quot;eth0&amp;quot; and &amp;quot;eth0:1&amp;quot; which means&lt;br /&gt;
     two IP addresses are tied to 1 NIC (Network Interface Card).&lt;br /&gt;
&lt;br /&gt;
             eth0      Link encap:Ethernet  HWaddr 00:50:DA:60:5B:AD&lt;br /&gt;
                       inet addr:192.168.1.155  Bcast:192.168.99.255  Mask:255.255.252.0&lt;br /&gt;
                       UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
                       RX packets:982757 errors:116 dropped:0 overruns:0 frame:116&lt;br /&gt;
                       TX packets:439297 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:1000&lt;br /&gt;
                       RX bytes:693529078 (661.4 Mb)  TX bytes:78400296 (74.7 Mb)&lt;br /&gt;
                       Interrupt:10 Base address:0xa800&lt;br /&gt;
&lt;br /&gt;
             eth0:1    Link encap:Ethernet  HWaddr 00:50:DA:60:5B:AD&lt;br /&gt;
                       inet addr:192.168.1.182  Bcast:192.168.3.255  Mask:255.255.252.0&lt;br /&gt;
                       UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
                       RX packets:982757 errors:116 dropped:0 overruns:0 frame:116&lt;br /&gt;
                       TX packets:439299 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:1000&lt;br /&gt;
                       RX bytes:693529078 (661.4 Mb)  TX bytes:78400636 (74.7 Mb)&lt;br /&gt;
                       Interrupt:10 Base address:0xa800&lt;br /&gt;
&lt;br /&gt;
             lo        Link encap:Local Loopback&lt;br /&gt;
                       inet addr:127.0.0.1  Mask:255.0.0.0&lt;br /&gt;
                       UP LOOPBACK RUNNING  MTU:16436  Metric:1&lt;br /&gt;
                       RX packets:785 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
                       TX packets:785 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:0&lt;br /&gt;
                       RX bytes:2372833 (2.2 Mb)  TX bytes:2372833 (2.2 Mb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 78:&lt;br /&gt;
&lt;br /&gt;
     DOS to UNIX and UNIX to DOS.&lt;br /&gt;
&lt;br /&gt;
        $ dos2unix file.txt&lt;br /&gt;
&lt;br /&gt;
     And to go the other way from UNIX to DOS&lt;br /&gt;
&lt;br /&gt;
        $ unix2dos unixfile&lt;br /&gt;
&lt;br /&gt;
     See the man page, since there are MAC options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     NOTE: If you're working file DOS files, you'll probably want to use&lt;br /&gt;
           &amp;quot;zip&amp;quot; instead of &amp;quot;gzip&amp;quot; so users on Windows can unzip them.&lt;br /&gt;
&lt;br /&gt;
              $ zip test.zip test.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 79:&lt;br /&gt;
&lt;br /&gt;
     Need to Run Interactive Commands? Try &amp;quot;expect&amp;quot;.&lt;br /&gt;
       http://expect.nist.gov/expect.tar.gz&lt;br /&gt;
&lt;br /&gt;
     This simple example waits for the input &amp;quot;hi&amp;quot;, in some form before&lt;br /&gt;
     returning, immediately, &amp;quot;hello there!&amp;quot;. Otherwise, it will wait for&lt;br /&gt;
     60 seconds, then, return &amp;quot;hello there!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/expect&lt;br /&gt;
          set timeout 60&lt;br /&gt;
          expect &amp;quot;hi\n&amp;quot;&lt;br /&gt;
          send &amp;quot;hello there!\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference:&lt;br /&gt;
        http://www.oreilly.com/catalog/expect/chapter/ch03.html&lt;br /&gt;
&lt;br /&gt;
        http://www.cotse.com/dlf/man/expect/bulletproof1.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 80:&lt;br /&gt;
&lt;br /&gt;
     Using PHP as a Command Line Scripting Language.&lt;br /&gt;
&lt;br /&gt;
     The following will grab the complete file from slashdot.&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/php -q&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;?php&lt;br /&gt;
         $fileName = &amp;quot;http://slashdot.org/slashdot.xml&amp;quot;;&lt;br /&gt;
         $rss = file($fileName) or die (&amp;quot;Cannot open file $fileName\n&amp;quot;);&lt;br /&gt;
         for ($index=0; $index &amp;lt; count($rss); $index++)&lt;br /&gt;
              {&lt;br /&gt;
              echo $rss[$index];&lt;br /&gt;
              }&lt;br /&gt;
         ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       Note, if you want an example that parses the XML of&lt;br /&gt;
       slashdot, then, download the following:&lt;br /&gt;
&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/php_scripts.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 81:&lt;br /&gt;
&lt;br /&gt;
     Discarding all output -- including stderr messages.&lt;br /&gt;
&lt;br /&gt;
         $ ls  &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     Or sending all output to a file&lt;br /&gt;
&lt;br /&gt;
         $ someprog &amp;gt; /tmp/file 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     Sometimes, find displays a lot of errors when searching through&lt;br /&gt;
     directories that the user doesn't have access to. To discard&lt;br /&gt;
     error messages &amp;quot;stderr&amp;quot;, which is normally file descripter &amp;quot;2&amp;quot;&lt;br /&gt;
     work the following:&lt;br /&gt;
&lt;br /&gt;
         $ find / -iname 'stuff' 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
          or to pipe results elsewhere&lt;br /&gt;
&lt;br /&gt;
         $ find / -iname 'stuff' &amp;gt; /tmp/results_of_find  2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 118).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 82:&lt;br /&gt;
&lt;br /&gt;
     Using MIX.  D. Knuth's  assembly language/machine-code instruction set used in&lt;br /&gt;
     his books to illustrate his algorithms.&lt;br /&gt;
&lt;br /&gt;
     Download the source:&lt;br /&gt;
&lt;br /&gt;
       http://sourceforge.net/project/showfiles.php?group_id=13897&lt;br /&gt;
&lt;br /&gt;
       $ ./configure&lt;br /&gt;
       $ make&lt;br /&gt;
       $ make install&lt;br /&gt;
&lt;br /&gt;
     Documentation can be found at the following link. The link on&lt;br /&gt;
     sourceforge is not correct, but, the one below works.&lt;br /&gt;
&lt;br /&gt;
       http://www.gnu.org/software/mdk/manual/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 83:&lt;br /&gt;
&lt;br /&gt;
     Gnuplot [ http://sourceforge.net/projects/gnuplot/ ].&lt;br /&gt;
&lt;br /&gt;
     This software is ideal for printing graphs.&lt;br /&gt;
&lt;br /&gt;
         gnuplot&amp;gt; set term png&lt;br /&gt;
         gnuplot&amp;gt; set output 'testcos.png'&lt;br /&gt;
         gnuplot&amp;gt; plot cos(x)*sin(x)&lt;br /&gt;
         gnuplot&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
     Or the following command can be put into &amp;quot;file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            $ cat &amp;gt; file&lt;br /&gt;
            set term png&lt;br /&gt;
            set output 'testcos.png'&lt;br /&gt;
            plot cos(x)*sin(x)&lt;br /&gt;
            exit&lt;br /&gt;
            ^D&lt;br /&gt;
&lt;br /&gt;
     Then, run as follows:&lt;br /&gt;
&lt;br /&gt;
            $ gnuplot file&lt;br /&gt;
&lt;br /&gt;
     Or, suppose you have the following file &amp;quot;/home/chirico/data&amp;quot;. Comments&lt;br /&gt;
     with &amp;quot;#&amp;quot; are not read by gnuplot.&lt;br /&gt;
&lt;br /&gt;
            # File /home/chirico/data&lt;br /&gt;
            #&lt;br /&gt;
            2005-07-26  1    2.3    3&lt;br /&gt;
            2005-07-27  2    3.4    5&lt;br /&gt;
            2005-07-28  3    4    6.6&lt;br /&gt;
            2005-07-29  4    6    2.5&lt;br /&gt;
&lt;br /&gt;
     And you have the following new &amp;quot;file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            set term png&lt;br /&gt;
            set xdata time&lt;br /&gt;
            set timefmt &amp;quot;%Y-%m-%d &amp;quot;&lt;br /&gt;
            set format x &amp;quot;%Y/%m/%d&amp;quot;&lt;br /&gt;
            set output '/var/www/html/chirico/gnuplot/data.png'&lt;br /&gt;
            plot '/home/chirico/data' using 1:2 w linespoints  title '1st col', \&lt;br /&gt;
             '/home/chirico/data' using 1:3 w linespoints  title '2nd col', \&lt;br /&gt;
             '/home/chirico/data' using 1:4 w linespoints  title '3rd col'&lt;br /&gt;
            exit&lt;br /&gt;
&lt;br /&gt;
     You can now get a graph of this data running the following:&lt;br /&gt;
&lt;br /&gt;
            $ gnuplot file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 84:&lt;br /&gt;
&lt;br /&gt;
     CPU Information - speed, processor, cache.&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/cpuinfo&lt;br /&gt;
&lt;br /&gt;
               processor       : 0&lt;br /&gt;
               vendor_id       : GenuineIntel&lt;br /&gt;
               cpu family      : 15&lt;br /&gt;
               model           : 2&lt;br /&gt;
               model name      : Intel(R) Pentium(R) 4 CPU 2.20GHz&lt;br /&gt;
               stepping        : 9&lt;br /&gt;
               cpu MHz         : 2193.221&lt;br /&gt;
               cache size      : 512 KB&lt;br /&gt;
               fdiv_bug        : no&lt;br /&gt;
               hlt_bug         : no&lt;br /&gt;
               f00f_bug        : no&lt;br /&gt;
               coma_bug        : no&lt;br /&gt;
               fpu             : yes&lt;br /&gt;
               fpu_exception   : yes&lt;br /&gt;
               cpuid level     : 2&lt;br /&gt;
               wp              : yes&lt;br /&gt;
               flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr&lt;br /&gt;
               bogomips        : 4325.37&lt;br /&gt;
&lt;br /&gt;
      &amp;quot;bogomips&amp;quot; is a rough but good way to quickly compare two computer speeds. True it's a&lt;br /&gt;
      bogus reading; but, a &amp;quot;good enough&amp;quot; for government work calculation.  See (TIP 10) for&lt;br /&gt;
      &amp;quot;vmstat&amp;quot; and &amp;quot;iostat&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 85:&lt;br /&gt;
&lt;br /&gt;
     POVRAY - Making Animated GIFs&lt;br /&gt;
&lt;br /&gt;
     To see this in action, reference:&lt;br /&gt;
      http://souptonuts.sourceforge.net/povray/orbit.pov.html&lt;br /&gt;
&lt;br /&gt;
     These are the basic command to create:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        $ povray orbit.ini -Iorbit.pov&lt;br /&gt;
        $ convert -delay 20 *.ppm orbit.gif&lt;br /&gt;
&lt;br /&gt;
     By the way, convert is a program from imagemagick, and it can&lt;br /&gt;
     be downloaded from ( http://www.imagemagick.org ).&lt;br /&gt;
&lt;br /&gt;
    The following is &amp;quot;orbit.pov&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          #include &amp;quot;colors.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;finish.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;metals.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;textures.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;stones.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;skies.inc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          camera {&lt;br /&gt;
            location &amp;lt; 2, 3, -8 &amp;gt;&lt;br /&gt;
            look_at  &amp;lt; 0, 0, 0 &amp;gt;&lt;br /&gt;
            focal_point &amp;lt;0, 0, 0&amp;gt;&lt;br /&gt;
            blur_samples 20&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          light_source {&lt;br /&gt;
                  &amp;lt; 0, 10, 0&amp;gt;&lt;br /&gt;
                  color White&lt;br /&gt;
                  area_light &amp;lt;2,0,0&amp;gt;,&amp;lt;0,0,2&amp;gt;, 2, 2&lt;br /&gt;
                  adaptive 1&lt;br /&gt;
                  fade_distance 8&lt;br /&gt;
                  fade_power 1&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          sky_sphere {&lt;br /&gt;
            S_Cloud3&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          plane { &amp;lt;0, 1, 0&amp;gt;, -1&lt;br /&gt;
                  texture {&lt;br /&gt;
                          pigment {&lt;br /&gt;
                                  checker color Blue, color White&lt;br /&gt;
                          }&lt;br /&gt;
                          finish {Phong_Glossy}&lt;br /&gt;
                  }&lt;br /&gt;
          }&lt;br /&gt;
          #declare ball0=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;0.5, 0.5, 0&amp;gt;, 1&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Yellow}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          #declare ball1=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;3, 2, 0&amp;gt;, 0.5&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Blue}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          #declare ball2=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;3, 1, 0&amp;gt;, 1&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Green}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          object {ball0 rotate 360*clock*y}&lt;br /&gt;
          object {ball1 rotate 720*clock*y}&lt;br /&gt;
          object {ball2 rotate 360*(1 - clock)*y}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    And, &amp;quot;orbit.ini&amp;quot; follows:&lt;br /&gt;
&lt;br /&gt;
          Output_File_Type=P&lt;br /&gt;
&lt;br /&gt;
          Width=320&lt;br /&gt;
          Height=240&lt;br /&gt;
&lt;br /&gt;
          Initial_Frame=1&lt;br /&gt;
          Final_Frame=10&lt;br /&gt;
          Antialias=true&lt;br /&gt;
&lt;br /&gt;
          Subset_Start_Frame=1&lt;br /&gt;
          Subset_End_Frame=10&lt;br /&gt;
&lt;br /&gt;
          Cyclic_Animation=on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 86:&lt;br /&gt;
&lt;br /&gt;
     GPG --  GnuPG&lt;br /&gt;
&lt;br /&gt;
        Reference: http://www.gnupg.org/documentation/faqs.html&lt;br /&gt;
                   http://codesorcery.net/mutt/mutt-gnupg-howto&lt;br /&gt;
                   http://www.gnupg.org/(en)/download/index.html&lt;br /&gt;
                   (SCRIPT 4) on following link:&lt;br /&gt;
                   http://prdownloads.sourceforge.net/souptonuts/README_common_script_commands.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Generage key:&lt;br /&gt;
&lt;br /&gt;
        $ gpg --gen-key&lt;br /&gt;
&lt;br /&gt;
     Generate public key ID and fingerprint&lt;br /&gt;
&lt;br /&gt;
        $ gpg --fingerprint&lt;br /&gt;
&lt;br /&gt;
     Get a list of keys:&lt;br /&gt;
&lt;br /&gt;
        $ gpg --list-keys&lt;br /&gt;
&lt;br /&gt;
          pub  1024D/A11C1499 2004-07-15 Mike Chirico &amp;lt;mchirico@comcast.net&amp;gt;&lt;br /&gt;
          sub  1024g/E1A3C2B3 2004-07-15&lt;br /&gt;
&lt;br /&gt;
     Encrypt&lt;br /&gt;
&lt;br /&gt;
        $ gpg -r Mike  --encrypt sample.txt&lt;br /&gt;
&lt;br /&gt;
       This will produce &amp;quot;sample.txt.asc&amp;quot;, which is a binary file.  Note, I can use &amp;quot;Mike&amp;quot; because that's the&lt;br /&gt;
       name on the list of keys. Again, it will be a binary file.&lt;br /&gt;
&lt;br /&gt;
     Encrypt using &amp;quot;ASCII-armored text&amp;quot;  (--armor), which is probably what you want when sending &amp;quot;in&amp;quot; the body of an&lt;br /&gt;
     email, or some document.&lt;br /&gt;
&lt;br /&gt;
        $ gpg  -r Mike  --encrypt --armor sample.txt&lt;br /&gt;
            or&lt;br /&gt;
        $ gpg -r Mike -e -a sample.txt&lt;br /&gt;
            or&lt;br /&gt;
        $ gpg --output somefile.asc --armor -r Mike  --encrypt --armor sample.txt&lt;br /&gt;
&lt;br /&gt;
     The above 3 statements will still produce &amp;quot;sample.txt.asc&amp;quot;, but look at it, or &amp;quot;$ cat sample.txt.asc&amp;quot; without &lt;br /&gt;
     fear, since there are no binary characters. Yes, you could even compile a program &amp;quot;$ g++ -o test test.c&amp;quot; , then,&lt;br /&gt;
     &amp;quot;$ gpg --output test.asc  -r Mike --encrypt --armor test&amp;quot;. However, when decrypting make sure to pipe&lt;br /&gt;
     the results.&lt;br /&gt;
&lt;br /&gt;
            $ gpg --decrypt test.asc &amp;gt; test&lt;br /&gt;
&lt;br /&gt;
     Export &amp;quot;public&amp;quot; key:&lt;br /&gt;
&lt;br /&gt;
           $ gpg --armor --export Mike &amp;gt; m1.asc&lt;br /&gt;
&lt;br /&gt;
     Signing the file &amp;quot;message.txt&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
           $ gpg --clearsign message.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Sending the key to the &amp;quot;key-server&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        First, list the keys.&lt;br /&gt;
&lt;br /&gt;
                $ gpg --list-keys&lt;br /&gt;
                    /home/chirico/.gnupg/pubring.gpg&lt;br /&gt;
                                 v------------------ Use this with &amp;quot;0x&amp;quot; in front -------&lt;br /&gt;
                  pub  1024D/A11C1499 2004-07-15 Mike Chirico  &amp;lt;mchirico@comcast.net&amp;gt;   |&lt;br /&gt;
                  sub  1024g/E1A3C2B3 2004-07-15                                        |&lt;br /&gt;
                                                                                        |&lt;br /&gt;
                                   v----------------------------------------------------&lt;br /&gt;
                $ gpg --send-keys 0xA11C1499&lt;br /&gt;
&lt;br /&gt;
             The above sends it to the keyserver defined in &amp;quot;/home/chirico/.gnupg/gpg.conf&amp;quot;.  Other key servers:&lt;br /&gt;
&lt;br /&gt;
                            wwwkeys.pgp.net&lt;br /&gt;
                            search.keyserver.net&lt;br /&gt;
                            pgp.ai.mit.edu&lt;br /&gt;
&lt;br /&gt;
             When you go to your user-group meetings, you need to bring 2 forms of ID, and&lt;br /&gt;
             list your Key fingerprint. Shown below is the command for getting this fingerprint.&lt;br /&gt;
&lt;br /&gt;
                $ gpg --fingerprint mchirico@comcast.net&lt;br /&gt;
                 pub   1024D/A11C1499 2004-07-15&lt;br /&gt;
                 Key fingerprint = 9D7F C80D BB7B 4BAB CCA4  1BE9 9056 5BEC A11C 1499&lt;br /&gt;
                 uid   Mike Chirico (http://souptonuts.sourceforge.net/chirico/index.php) &amp;lt;mchirico@comcast.net&amp;gt;&lt;br /&gt;
                 sub   1024g/E1A3C2B3 2004-07-15&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Receving keys:&lt;br /&gt;
&lt;br /&gt;
        The following will retrieve my mchirico@comcast.net key&lt;br /&gt;
&lt;br /&gt;
               $ gpg --recv-keys 0xA11C1499&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Special Note: If you get the following error &amp;quot;GPG: Warning: Using Insecure Memory&amp;quot; , then,&lt;br /&gt;
                   &amp;quot; chmod 4755 /path/to/gpg&amp;quot;  to setuid(root) permissioins on the gpg binary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     NOTE: If using mutt, just before sending with the &amp;quot;y&amp;quot; option, hit &amp;quot;p&amp;quot; to sign or encrypt.&lt;br /&gt;
&lt;br /&gt;
     It's possible to create a gpg/pgp email from the command line. For a tutorial on this,&lt;br /&gt;
     reference (SCRIPT 4) at the following link:&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/README_common_script_commands.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 87:&lt;br /&gt;
&lt;br /&gt;
     Working with Dates: Steffen Beyer has developed a Perl and C module for working with dates&lt;br /&gt;
&lt;br /&gt;
     This softare can be downloaded from the following location:&lt;br /&gt;
        http://www.engelschall.com/u/sb/download/pkg/Date-Calc-5.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
         $ wget http://www.engelschall.com/u/sb/download/pkg/Date-Calc-5.3.tar.gz&lt;br /&gt;
         $ tar -xzvf Date-Calc-5.3.tar.gz&lt;br /&gt;
         $ cd Date-Calc-5.3&lt;br /&gt;
         $ cp ./examples/cal.c .&lt;br /&gt;
         $ gcc cal.c DateCalc.c -o mcal&lt;br /&gt;
&lt;br /&gt;
     The file cal.c contains sample function calls from DateCalc.c.  Note, &amp;quot;DateCalc.c&amp;quot;&lt;br /&gt;
     is just a list of functions and includes for &amp;quot;DateCalc.h&amp;quot; and &amp;quot;ToolBox.h&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Or, and this may be easier, just download the following:&lt;br /&gt;
         http://prdownloads.sourceforge.net/cpearls/date_calc.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
     The above link contains a few examples.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 88:&lt;br /&gt;
&lt;br /&gt;
     Color patterns for mutt.&lt;br /&gt;
&lt;br /&gt;
     The colors can be changed in the /home/user/.muttrc file. The first field begins with&lt;br /&gt;
     color, the second field is the foreground color, and the third field is the background&lt;br /&gt;
     color, or default.&lt;br /&gt;
&lt;br /&gt;
     An example .muttrc for colors:&lt;br /&gt;
&lt;br /&gt;
       # color patterns for mutt&lt;br /&gt;
       color normal     white          black # normal text&lt;br /&gt;
       color indicator  black          yellow  # actual message&lt;br /&gt;
       color tree       brightmagenta  default # thread arrows&lt;br /&gt;
       color status     brightyellow         default # status line&lt;br /&gt;
       color error      brightred      default # errors&lt;br /&gt;
       color message    magenta        default # info messages&lt;br /&gt;
       color signature  magenta        default # signature&lt;br /&gt;
       color attachment brightyellow   red     # MIME attachments&lt;br /&gt;
       color search     brightyellow   red     # search matches&lt;br /&gt;
       color tilde      brightmagenta  default # ~ at bottom of msg&lt;br /&gt;
       color markers    red            default # + at beginning of wrapped lines&lt;br /&gt;
       color hdrdefault cyan           default # default header lines&lt;br /&gt;
       color bold       red            default # hiliting bold patterns in body&lt;br /&gt;
       color underline  green          default # hiliting underlined patterns in body&lt;br /&gt;
       color quoted     cyan           default # quoted text&lt;br /&gt;
       color quoted1    magenta        default&lt;br /&gt;
       color quoted2    red            default&lt;br /&gt;
       color quoted3    green          default&lt;br /&gt;
       color quoted4    magenta           default&lt;br /&gt;
       color quoted5    cyan           default&lt;br /&gt;
       color quoted6    magenta        default&lt;br /&gt;
       color quoted7    red            default&lt;br /&gt;
       color quoted8    green          default&lt;br /&gt;
       color quoted9    cyan           default&lt;br /&gt;
       color body   cyan  default  &amp;quot;((ftp|http|https)://|news:)[^ &amp;gt;)\&amp;quot;\t]+&amp;quot;&lt;br /&gt;
       color body   cyan  default  &amp;quot;[-a-z_0-9.+]+@[-a-z_0-9.]+&amp;quot;&lt;br /&gt;
       color body   red   default  &amp;quot;(^| )\\*[-a-z0-9*]+\\*[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color body   green default  &amp;quot;(^| )_[-a-z0-9_]+_[,.?]?[\n]&amp;quot;&lt;br /&gt;
       color body   red   default  &amp;quot;(^| )\\*[-a-z0-9*]+\\*[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color body   green default  &amp;quot;(^| )_[-a-z0-9_]+_[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color index  cyan  default  ~F         # Flagged&lt;br /&gt;
       color index  red   default  ~N         # New&lt;br /&gt;
       color index  magenta    default  ~T         # Tagged&lt;br /&gt;
       color index  cyan       default  ~D         # Deleted&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 190)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 89:&lt;br /&gt;
&lt;br /&gt;
     ps command in detail&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Here are the possible codes when using state &amp;quot;$ ps -e -o state,cmd&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             PROCESS STATE CODES&lt;br /&gt;
                  D   uninterruptible sleep (usually IO)&lt;br /&gt;
                  R   runnable (on run queue)&lt;br /&gt;
                  S   sleeping&lt;br /&gt;
                  T   traced or stopped&lt;br /&gt;
                  Z   a defunct (&amp;quot;zombie&amp;quot;) process&lt;br /&gt;
&lt;br /&gt;
                  &amp;lt;    high-priority (not nice to other users)&lt;br /&gt;
                  N    low-priority (nice to other users)&lt;br /&gt;
                  L    has pages locked into memory (for real-time and custom IO)&lt;br /&gt;
                  s    is a session leader&lt;br /&gt;
                  l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)&lt;br /&gt;
                  +    is in the foreground process group&lt;br /&gt;
&lt;br /&gt;
    For instance:&lt;br /&gt;
&lt;br /&gt;
     Note that the -o is for user defined, and -e is for select&lt;br /&gt;
     all process.&lt;br /&gt;
&lt;br /&gt;
       $ ps -e -o pid,state,start,time,etime,cmd&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
             9946 S 15:40:45 00:00:00    02:23:29 /bin/bash -i&lt;br /&gt;
             9985 T 15:41:24 00:00:01    02:22:50 emacs mout2&lt;br /&gt;
            10003 T 15:43:59 00:00:00    02:20:15 emacs NOTES&lt;br /&gt;
            10320 T 17:38:42 00:00:00       25:32 emacs stuff.c&lt;br /&gt;
         ...&lt;br /&gt;
&lt;br /&gt;
     You may want to command below, without the -e, which will give the&lt;br /&gt;
     process only under the current terminal.&lt;br /&gt;
&lt;br /&gt;
       $ ps -o pid,state,start,time,etime,cmd&lt;br /&gt;
&lt;br /&gt;
     Want to find what 's impacting your load?&lt;br /&gt;
&lt;br /&gt;
       $ ps -e -o %cpu,pid,state,start,time,etime,%cpu,%mem,cmd|sort -rn|less&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ ps aux&lt;br /&gt;
&lt;br /&gt;
            USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND&lt;br /&gt;
            root         1  0.0  0.0  1380  480 ?        S    Aug04   0:00 init [3]&lt;br /&gt;
            root         2  0.0  0.0     0    0 ?        SWN  Aug04   0:00 [ksoftirqd/0]&lt;br /&gt;
            root         3  0.0  0.0     0    0 ?        SW&amp;lt;  Aug04   0:00 [events/0]&lt;br /&gt;
            root         4  0.0  0.0     0    0 ?        SW&amp;lt;  Aug04   0:00 [khelper]&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     Or, if you want to see the environment add the -e option&lt;br /&gt;
&lt;br /&gt;
       $ ps aeux&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
            chirico   2735  0.0  0.1  4400 1492 pts/0    S    Aug04   0:00 -bash USER=chirico LOGNAME=chirico HOME=/home/chirico PATH=/usr/&lt;br /&gt;
            chirico   2771  0.0  0.0  4328  924 pts/0    S    Aug04   0:00 screen -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm S&lt;br /&gt;
            chirico   2772  0.0  0.6  9476 6352 ?        S    Aug04   0:54 SCREEN -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm S&lt;br /&gt;
            chirico   2773  0.0  0.1  4432 1548 pts/1    S    Aug04   0:10 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            chirico   2797  0.0  0.1  4416 1496 pts/2    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            root      2821  0.0  0.0  4100  952 pts/2    S    Aug04   0:00 su -&lt;br /&gt;
            root      2822  0.0  0.1  4384 1480 pts/2    S    Aug04   0:00 -bash&lt;br /&gt;
            chirico   2862  0.0  0.1  4428 1524 pts/3    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            sporkey   2946  0.0  0.2  6836 2960 ?        S    Aug04   0:15 fetchmail&lt;br /&gt;
            chirico   2952  0.0  0.1  4436 1552 pts/5    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            chirico   3880  0.0  0.1  4416 1496 pts/6    S    Aug05   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            root      3904  0.0  0.0  4100  956 pts/6    S    Aug05   0:00 su - donkey&lt;br /&gt;
            donkey    3905  0.0  0.1  4336 1452 pts/6    S    Aug05   0:00 -bash&lt;br /&gt;
            donkey    3938  0.0  0.2  6732 2856 ?        S    Aug05   0:14 fetchmail&lt;br /&gt;
            chirico   3944  0.0  0.1  4416 1496 pts/7    S    Aug05   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     There is also a -f &amp;quot;forrest&amp;quot; option. Also note below &amp;quot; -bash&amp;quot; is the start of a login shell.&lt;br /&gt;
&lt;br /&gt;
      $ ps aeuxwwf &lt;br /&gt;
     &lt;br /&gt;
     The ww option above gives a wide format with all variables. Use the above command if you plan&lt;br /&gt;
     to parse through a Perl script. Otherwise, it may be easier to do a quick read using the command&lt;br /&gt;
     below, without &amp;quot;ww&amp;quot;.    &lt;br /&gt;
&lt;br /&gt;
      $ ps aeuxf&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
            root      2339  0.0  0.1  3512 1444 ?        S    Dec01   0:00 /usr/sbin/sshd&lt;br /&gt;
            root     25651  0.0  0.1  6764 1980 ?        S    Dec23   0:00  \_ /usr/sbin/sshd&lt;br /&gt;
            chirico  25653  0.0  0.2  6840 2236 ?        S    Dec23   0:14      \_ /usr/sbin/sshd&lt;br /&gt;
            chirico  25654  0.0  0.1  4364 1440 pts/4    S    Dec23   0:00          \_ -bash USER=chirico LOGNAME=chirico HOME=/home/chirico&lt;br /&gt;
            chirico  25690  0.0  0.0  4328  920 pts/4    S    Dec23   0:00              \_ screen -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm&lt;br /&gt;
            root      2355  0.0  0.0  2068  904 ?        S    Dec01   0:00 xinetd -stayalive -pidfile /var/run/xinetd.pid&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     It is also possible to list the process by command line. For example, the following command will only list the emacs&lt;br /&gt;
     processes.&lt;br /&gt;
&lt;br /&gt;
      $ ps -fC emacs&lt;br /&gt;
       UID        PID  PPID  C STIME TTY          TIME CMD&lt;br /&gt;
       chirico   5049  5020  0 May11 pts/13   00:00:00 emacs -nw Notes&lt;br /&gt;
       chirico  12368  5104  0 May12 pts/18   00:00:00 emacs -nw dnotify.c&lt;br /&gt;
       chirico  19792 18028  0 May13 pts/20   00:00:00 emacs -nw hello.c&lt;br /&gt;
       chirico  14034 27367  0 18:52 pts/8    00:00:00 emacs -nw How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
     You may also want to consider using top in batch mode. Here the &amp;quot;-n 1&amp;quot; means refresh once,&lt;br /&gt;
     and the &amp;quot;b&amp;quot; is for batch. The &amp;quot;fmt -s&amp;quot; is to put it in a more readable format.&lt;br /&gt;
&lt;br /&gt;
       $ top -n 1 b |fmt  -s &amp;gt;&amp;gt;statfile&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 90:&lt;br /&gt;
&lt;br /&gt;
     Learning Assembly.&lt;br /&gt;
&lt;br /&gt;
     Once you have written the source, assuming the file is &amp;quot;exit.s&amp;quot;, it can be compiled as follows:&lt;br /&gt;
&lt;br /&gt;
            $ as exit.s -o exit.o&lt;br /&gt;
            $ ld exit.o -o exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Here is the program:&lt;br /&gt;
&lt;br /&gt;
         #&lt;br /&gt;
         #INPUT:  none&lt;br /&gt;
         #&lt;br /&gt;
         #OUTPUT:         returns a status code. This can be viewed&lt;br /&gt;
         # by typing&lt;br /&gt;
         #&lt;br /&gt;
         # echo $?&lt;br /&gt;
         #&lt;br /&gt;
         # after running the program&lt;br /&gt;
         #&lt;br /&gt;
         #VARIABLES:&lt;br /&gt;
         # %eax holds the system call number&lt;br /&gt;
         # (this is always the case)&lt;br /&gt;
         #&lt;br /&gt;
         # %ebx holds the return status&lt;br /&gt;
         #&lt;br /&gt;
                 .section .data&lt;br /&gt;
                 .section .text&lt;br /&gt;
&lt;br /&gt;
                 .globl _start&lt;br /&gt;
         _start:&lt;br /&gt;
                 movl $1, %eax # this is the linux kernel command&lt;br /&gt;
                 # number (system call) for exiting&lt;br /&gt;
                 # a program&lt;br /&gt;
                 movl $0, %ebx # this is the status number we will&lt;br /&gt;
                 # return to the operating system.&lt;br /&gt;
                 # Change this around and it will&lt;br /&gt;
                 # return different things to&lt;br /&gt;
                 # echo $?&lt;br /&gt;
                 int $0x80 # this wakes up the kernel to run&lt;br /&gt;
                 # the exit command&lt;br /&gt;
&lt;br /&gt;
     After running this program, you can get the exit code.&lt;br /&gt;
&lt;br /&gt;
            $ exit $?&lt;br /&gt;
            0&lt;br /&gt;
&lt;br /&gt;
     That is about all it does; but, get the book for more details. The&lt;br /&gt;
     book is free.&lt;br /&gt;
&lt;br /&gt;
          http://savannah.nongnu.org/download/pgubook/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 91:&lt;br /&gt;
&lt;br /&gt;
     Creating a sandbox for reiserfstune,debugreiserfs and ACL.  Also see TIP 4.&lt;br /&gt;
&lt;br /&gt;
     Assume you have a reisers files system created from a disk file, which&lt;br /&gt;
     means you have done something like the following:&lt;br /&gt;
&lt;br /&gt;
          # dd if=/dev/zero of=disk-rfs count=102400&lt;br /&gt;
          # losetup  /dev/loop4 ./disk-rfs&lt;br /&gt;
          # mkfs -t reiserfs /dev/loop4&lt;br /&gt;
          # mkdir /fs2&lt;br /&gt;
          # mount -o loop,acl ./disk-rfs /fs2&lt;br /&gt;
&lt;br /&gt;
     Now, you can run reiserfstune. But, first you will need to umount fs2&lt;br /&gt;
&lt;br /&gt;
          # umount /fs2&lt;br /&gt;
          # reiserfstune ./disk-rfs&lt;br /&gt;
&lt;br /&gt;
     Or you can run the debug command&lt;br /&gt;
&lt;br /&gt;
          # debugreiserfs -J ./disk-rfs&lt;br /&gt;
&lt;br /&gt;
     Now, suppose you run through a lot of the debug options on&lt;br /&gt;
     http://www.namesys.com/ and you destroy this file.&lt;br /&gt;
&lt;br /&gt;
     You can recreate the file and delete the loop device.&lt;br /&gt;
&lt;br /&gt;
          # dd if=/dev/zero of=disk-rfs count=102400&lt;br /&gt;
          # losetup -d /dev/loop4&lt;br /&gt;
          # mount -o loop,acl ./disk-rfs /fs2&lt;br /&gt;
&lt;br /&gt;
     Now, try working with some of the ACL options - you can only do this&lt;br /&gt;
     with the latest kernel and tools -- Fedora Core 2 will work.&lt;br /&gt;
&lt;br /&gt;
     Assume you have 3 users, donkey, chirico and bozo2. You can give&lt;br /&gt;
     everyone rights to this file system as follows:&lt;br /&gt;
&lt;br /&gt;
          # setfacl -R -m d:u:donkey:rwx,d:u:chirico:rwx,d:u:bozo2:rwx /fs2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 92:&lt;br /&gt;
&lt;br /&gt;
     SpamAssassin - Setup.&lt;br /&gt;
&lt;br /&gt;
     Step 1.&lt;br /&gt;
&lt;br /&gt;
           Installing the SpamAssassin CPAN utility. You will need to do this&lt;br /&gt;
           as root.&lt;br /&gt;
        &lt;br /&gt;
              $ su -&lt;br /&gt;
&lt;br /&gt;
           Once you have root privileges invoke cpan.&lt;br /&gt;
        &lt;br /&gt;
              # perl -MCPAN -e shell&lt;br /&gt;
&lt;br /&gt;
              cpan&amp;gt;&lt;br /&gt;
&lt;br /&gt;
           Now install with prerequisites policy set to ask.&lt;br /&gt;
        &lt;br /&gt;
              cpan&amp;gt; o conf prerequisites_policy ask&lt;br /&gt;
        &lt;br /&gt;
              cpan&amp;gt; install Mail::SpamAssassin&lt;br /&gt;
        &lt;br /&gt;
           You will get lots of output as the necessary modules are downloaded and&lt;br /&gt;
           compiled and installed.&lt;br /&gt;
&lt;br /&gt;
     Step 2.&lt;br /&gt;
&lt;br /&gt;
            Configuration.&lt;br /&gt;
&lt;br /&gt;
            Edit the following &amp;quot;/etc/mail/spamassassin/local.cf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            Here is a look at my file&lt;br /&gt;
&lt;br /&gt;
                $ cat /etc/mail/spamassassin/local.cf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                # This is the right place to customize your installation of SpamAssassin.&lt;br /&gt;
                #&lt;br /&gt;
                # See 'perldoc Mail::SpamAssassin::Conf' for details of what can be&lt;br /&gt;
                # tweaked.&lt;br /&gt;
                #&lt;br /&gt;
                ###########################################################################&lt;br /&gt;
                #&lt;br /&gt;
                # rewrite_subject 0&lt;br /&gt;
                # report_safe 1&lt;br /&gt;
                # trusted_networks 212.17.35.&lt;br /&gt;
                #&lt;br /&gt;
                &lt;br /&gt;
                # Below added from book&lt;br /&gt;
                # You may want to set this to 5, then, work your way down.&lt;br /&gt;
                # Currently I have this 3&lt;br /&gt;
                required_hits 3&lt;br /&gt;
                &lt;br /&gt;
                # This determines how spam is reported. Currently safe email is reported&lt;br /&gt;
                # in the message.&lt;br /&gt;
                report_safe 1&lt;br /&gt;
                &lt;br /&gt;
                # The will rewrite the tag of the spam message.&lt;br /&gt;
                rewrite_subject 1&lt;br /&gt;
                &lt;br /&gt;
                # By default, SpamAssassin will run RBL checks.  If your ISP already&lt;br /&gt;
                # does this, set this to 1.&lt;br /&gt;
                skip_rbl_checks 0&lt;br /&gt;
&lt;br /&gt;
     Step 3.&lt;br /&gt;
&lt;br /&gt;
            Update .procmail.&lt;br /&gt;
&lt;br /&gt;
            You should update the .procmail file as follows. Here is my /home/chirico/.procmail file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ cat /home/chirico/.procmailrc&lt;br /&gt;
&lt;br /&gt;
                PATH=/bin:/usr/bin:/usr/local/bin&lt;br /&gt;
                MAILDIR=/var/spool/mail&lt;br /&gt;
                DEFAULT=/var/spool/mail/chirico&lt;br /&gt;
                LOGFILE=/home/chirico/MailBAG&lt;br /&gt;
                MYHOME=/home/chirico&lt;br /&gt;
                #  Must have folder MailTRASH&lt;br /&gt;
                TRASH=/home/chirico/MailTRASH&lt;br /&gt;
                &lt;br /&gt;
                # Will get everything from this mail&lt;br /&gt;
                :0&lt;br /&gt;
                * ^From:.*sporkey@comcast.net&lt;br /&gt;
                        $DEFAULT&lt;br /&gt;
                &lt;br /&gt;
                # Spamassassin&lt;br /&gt;
                :0fw&lt;br /&gt;
                * &amp;lt;300000&lt;br /&gt;
                |/usr/local/bin/spamassassin&lt;br /&gt;
&lt;br /&gt;
      Reference:&lt;br /&gt;
        http://pm-doc.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 93:&lt;br /&gt;
&lt;br /&gt;
     Make Graphs: using dot and neato.&lt;br /&gt;
&lt;br /&gt;
       $ dot -Tpng dotfile -o myout.png&lt;br /&gt;
&lt;br /&gt;
     To see the output reference the following:&lt;br /&gt;
       http://souptonuts.sourceforge.net/code/myout.png&lt;br /&gt;
&lt;br /&gt;
     Where &amp;quot;dotfile&amp;quot; is the following:&lt;br /&gt;
&lt;br /&gt;
       $ cat dotfile&lt;br /&gt;
&lt;br /&gt;
       digraph g&lt;br /&gt;
       {&lt;br /&gt;
               node [shape = record];&lt;br /&gt;
&lt;br /&gt;
               node0 [ label =&amp;quot;&amp;lt;f0&amp;gt; stuff | &amp;lt;f1&amp;gt; J | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node1 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; E | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node4 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; C | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node6 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; I | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node2 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; U | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node5 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; N | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node9 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; Y | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node8 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; W | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node10 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; Z | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node7 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; A | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node3 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; G | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node0&amp;quot;:f0 -&amp;gt; &amp;quot;node1&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node0&amp;quot;:f2 -&amp;gt; &amp;quot;node2&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node1&amp;quot;:f0 -&amp;gt; &amp;quot;node4&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node1&amp;quot;:f2 -&amp;gt; &amp;quot;node6&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node4&amp;quot;:f0 -&amp;gt; &amp;quot;node7&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node4&amp;quot;:f2 -&amp;gt; &amp;quot;node3&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node2&amp;quot;:f0 -&amp;gt; &amp;quot;node5&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node2&amp;quot;:f2 -&amp;gt; &amp;quot;node9&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node9&amp;quot;:f0 -&amp;gt; &amp;quot;node8&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node9&amp;quot;:f2 -&amp;gt; &amp;quot;node10&amp;quot;:f1;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
     Checkout the following article:&lt;br /&gt;
        http://www.linuxjournal.com/article.php?sid=7275&lt;br /&gt;
&lt;br /&gt;
     To download this software&lt;br /&gt;
        http://www.graphviz.org/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 94:&lt;br /&gt;
&lt;br /&gt;
     Makefile: working with conditions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     First note that all the indentations of the file must be&lt;br /&gt;
     a single tab. There cannot be any spaces, or make will&lt;br /&gt;
     not run.&lt;br /&gt;
&lt;br /&gt;
       $ cat Makefile&lt;br /&gt;
&lt;br /&gt;
        # Compiler flags&lt;br /&gt;
        sqliteLIB := $(shell ls /usr/local/lib/libsqlite.so)&lt;br /&gt;
        sqlite3LIB := $(shell ls /usr/local/lib/libsqlite3.so)&lt;br /&gt;
        # all assumes sqlite and sqlite3 are installed&lt;br /&gt;
        #&lt;br /&gt;
&lt;br /&gt;
        test:&lt;br /&gt;
        ifeq (&amp;quot;$(sqlite3LIB)&amp;quot;,&amp;quot;/usr/local/lib/libsqlite3.so&amp;quot;)&lt;br /&gt;
             @echo -e &amp;quot;True -- we found the file&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
             @echo &amp;quot;False -- we did not find the file&amp;quot;&lt;br /&gt;
        endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     So, if I run make I will get the following output.&lt;br /&gt;
&lt;br /&gt;
       $ make&lt;br /&gt;
       True -- we found the file&lt;br /&gt;
&lt;br /&gt;
     This is because I have a file /usr/local/lib/libsqlite3.so on my system.&lt;br /&gt;
     Note how the assignment is made, with the shell command&lt;br /&gt;
&lt;br /&gt;
           sqlite3LIB := $(shell ls /usr/local/lib/libsqlite3.so)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 95:&lt;br /&gt;
&lt;br /&gt;
     Bash: Conditional Expressions&lt;br /&gt;
&lt;br /&gt;
          if [ -e /etc/ntp.conf ]&lt;br /&gt;
            then&lt;br /&gt;
              echo &amp;quot;You have the ntp config file&amp;quot;&lt;br /&gt;
            else&lt;br /&gt;
              echo &amp;quot;You do not have the ntp config file&amp;quot;&lt;br /&gt;
          fi&lt;br /&gt;
&lt;br /&gt;
       Now using an AND condition inside the [ ]. By the way, above, you&lt;br /&gt;
       can put the &amp;quot;then&amp;quot; on the same line as the if &amp;quot;if [ -e /etc/ntp.conf ]; then&amp;quot;&lt;br /&gt;
       as long as you use the &amp;quot;;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           if [ \( -e /etc/ntp.conf \) -a \( -e /etc/ntp/ntpservers \) ]&lt;br /&gt;
             then&lt;br /&gt;
               echo &amp;quot;You have ntp config and ntpservers&amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp.conf ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntp.conf &amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp/ntpservers ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntpservers &amp;quot;&lt;br /&gt;
             else&lt;br /&gt;
               echo &amp;quot; you have neither ntp.conf or ntpservers&amp;quot;&lt;br /&gt;
           fi&lt;br /&gt;
&lt;br /&gt;
        A few things to note above. Else if statement is written as &amp;quot;elif&amp;quot;, and when&lt;br /&gt;
        dealing with &amp;quot;(&amp;quot; you will need to insert &amp;quot;\(&amp;quot;. By the way &amp;quot;-o&amp;quot; can replace &amp;quot;-a&amp;quot;&lt;br /&gt;
        and the &amp;quot;-o&amp;quot; is for OR condition. AND can be done as follows too.&lt;br /&gt;
&lt;br /&gt;
           if [ -e /etc/ntp.conf ] &amp;amp;&amp;amp; [ -e /etc/ntp/ntpservers ]&lt;br /&gt;
             then&lt;br /&gt;
               echo &amp;quot;You have ntp config and ntpservers&amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp.conf ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntp.conf &amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp/ntpservers ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntpservers &amp;quot;&lt;br /&gt;
             else&lt;br /&gt;
               echo &amp;quot; you have neither ntp.conf or ntpservers&amp;quot;&lt;br /&gt;
           fi&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (files).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             -b file      True if file exists and is a block file&lt;br /&gt;
             -c file      True if file exists and is a character device file&lt;br /&gt;
             -d file      True if file exists and is a directory&lt;br /&gt;
             -e file      True if file exists&lt;br /&gt;
             -f file      True if file exists and is a regular file&lt;br /&gt;
             -g file      True if file exists and is set goup id&lt;br /&gt;
             -G file      True if owned by the effective group ID&lt;br /&gt;
&lt;br /&gt;
             -k file      True if &amp;quot;sticky&amp;quot; bit is set and file exists&lt;br /&gt;
             -L file      True if file exists and is a symbolic link&lt;br /&gt;
             -n string    True if string is non-null&lt;br /&gt;
&lt;br /&gt;
             -O file      Ture if file exists and is owned by the effective user ID&lt;br /&gt;
&lt;br /&gt;
             -p file      True if file is a named pipe (FIFO)&lt;br /&gt;
             -r file      True if file is readable&lt;br /&gt;
             -s file      True if file has size &amp;gt; 0&lt;br /&gt;
             -S file      True if file exists and is a socket&lt;br /&gt;
&lt;br /&gt;
             -t file      True if file is open and refers to a terminal.&lt;br /&gt;
             -u file      True if setuid bit is set&lt;br /&gt;
             -w file      True if file exists and is writeable&lt;br /&gt;
             -x file      True if file executable&lt;br /&gt;
             -x dir       True if directory can be searched&lt;br /&gt;
&lt;br /&gt;
             file1 -nt file2     True if file1 modification date newer than file2&lt;br /&gt;
             file1 -ot file2     True if file1 modification date older than file2&lt;br /&gt;
             file1 -ef file2     True if file1 and file2 have same inode&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (Integers).&lt;br /&gt;
&lt;br /&gt;
             -lt  Less than&lt;br /&gt;
             -le  Less than or equal&lt;br /&gt;
             -eq  Equal&lt;br /&gt;
             -ge  Greater than or equal&lt;br /&gt;
             -gt  Greater than&lt;br /&gt;
             -ne  Not equal&lt;br /&gt;
&lt;br /&gt;
          Example usage.&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
             {&lt;br /&gt;
               while read num value; do&lt;br /&gt;
                if [ $num -gt  2 ]; then&lt;br /&gt;
                  echo $value&lt;br /&gt;
                fi&lt;br /&gt;
               done&lt;br /&gt;
             } &amp;lt; somefile&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (Strings).&lt;br /&gt;
&lt;br /&gt;
             str1 = str2      str1 matches str2&lt;br /&gt;
             str1 != str2     str1 does not matches str2&lt;br /&gt;
             str1 &amp;lt; str2      str1 is less than str2&lt;br /&gt;
             str1 &amp;gt;  str2     str1 is greater than str2&lt;br /&gt;
             -n str1          str1 is not null (length greater than 0)&lt;br /&gt;
             -z str1          str1 is null (las length 0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 96:&lt;br /&gt;
&lt;br /&gt;
     CVS: Working with cvs&lt;br /&gt;
&lt;br /&gt;
      INITIAL REPOSITORY:&lt;br /&gt;
&lt;br /&gt;
       To create a repository, and this is normally done by the system admin. This&lt;br /&gt;
       is NOT creating a project to checkout, but the location where everything&lt;br /&gt;
       will be stored! The initial repository!&lt;br /&gt;
&lt;br /&gt;
             cvs -d repository_root_directory init&lt;br /&gt;
&lt;br /&gt;
       Or here is a specific example:&lt;br /&gt;
&lt;br /&gt;
             cvs -d /work/cvsREPOSITORY/   init&lt;br /&gt;
&lt;br /&gt;
       Creating a directory tree from scratch. For a new project, the easiest thing to&lt;br /&gt;
       do is probably to create an empty directory structure, like this:&lt;br /&gt;
&lt;br /&gt;
             $ mkdir sqlite_examples&lt;br /&gt;
             $ mkdir sqlite_examples/man&lt;br /&gt;
             $ mkdir sqlite_examples/testing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       After that, you use the import command to create the&lt;br /&gt;
       corresponding (empty) directory structure inside the repository:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             $ cd &amp;lt;directory&amp;gt;&lt;br /&gt;
             $ cvs -d repository_root_directory import  -m &amp;quot;Created directory structure&amp;quot; yoyodyne/dir yoyo start&lt;br /&gt;
&lt;br /&gt;
       Or, here is a specific example.&lt;br /&gt;
&lt;br /&gt;
             $  cd sqlite_examples&lt;br /&gt;
             $  cvs  -d /work/cvsREPOSITORY/ import -m 'test SQlite'  sqlite_examples sqlite_examples start&lt;br /&gt;
&lt;br /&gt;
       Now, you can delete the directory sqlite_examples, or go to another directory and type&lt;br /&gt;
       the following:&lt;br /&gt;
&lt;br /&gt;
             $ cvs -d /work/cvsREPOSITORY/ co sqlite_examples&lt;br /&gt;
&lt;br /&gt;
     COOL TOOLS:&lt;br /&gt;
&lt;br /&gt;
           1. cvsps&lt;br /&gt;
           2. cvsreport&lt;br /&gt;
&lt;br /&gt;
         cvsps which you can find at http://www.cobite.com/cvsps/cvsps-2.0rc1.tar.gz&lt;br /&gt;
&lt;br /&gt;
             $ cvsps -f README_sqlite_tutorial.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 97:&lt;br /&gt;
&lt;br /&gt;
     Common vi and vim commands&lt;br /&gt;
&lt;br /&gt;
           Command mode ESC&lt;br /&gt;
&lt;br /&gt;
                dd       delete&lt;br /&gt;
                u        undelete&lt;br /&gt;
                y        yank (copy to buffer)&lt;br /&gt;
                p/P      p before cursor/P after cursor&lt;br /&gt;
&lt;br /&gt;
                Ctl-g    show current line number&lt;br /&gt;
                shft-G   end of file&lt;br /&gt;
              n shft-G   move to line n&lt;br /&gt;
&lt;br /&gt;
               /stuff/   search&lt;br /&gt;
                  n   repeat in same direction&lt;br /&gt;
                  N   repeat in opposite direction&lt;br /&gt;
                  /return  repeat seach forward&lt;br /&gt;
                  ?return  repeat seach backward&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;dyy  Yank current line to buffer d&lt;br /&gt;
               &amp;quot;a7yy Yank next 7 lines to buffer a&lt;br /&gt;
                    or&lt;br /&gt;
               :1,7ya a  Yank [ya] lines 1,7 to buffer a&lt;br /&gt;
               :1,7ya b  Yank [ya] lines 1,7 to buffer b&lt;br /&gt;
&lt;br /&gt;
               :5 pu b   Put [pu] buffer b after line 5&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;dP   Put the content of buffer d before cursor&lt;br /&gt;
               &amp;quot;ap   Put the contents of buffer a after cursor&lt;br /&gt;
&lt;br /&gt;
               :1,4 w! file2  Write lines 1,4 to file2&lt;br /&gt;
               :1,3&lt;br /&gt;
&lt;br /&gt;
               :set nu     Display line numbers&lt;br /&gt;
               :set nonum  Turns off display&lt;br /&gt;
&lt;br /&gt;
               :e &amp;lt;filename&amp;gt; Edit a file in a new buffer&lt;br /&gt;
&lt;br /&gt;
            vim&lt;br /&gt;
               :split&lt;br /&gt;
               :split &amp;lt;filename&amp;gt;&lt;br /&gt;
               :sp &amp;lt;filename&amp;gt;&lt;br /&gt;
               :split new&lt;br /&gt;
&lt;br /&gt;
                   ctl-w   To move between windows&lt;br /&gt;
                   ctl-w+&lt;br /&gt;
                   ctl-w-  To change size&lt;br /&gt;
                   ctl+wv  Split windows vertically&lt;br /&gt;
                   ctl-wq  Close window&lt;br /&gt;
&lt;br /&gt;
               :only       To view only 1 window&lt;br /&gt;
&lt;br /&gt;
            vim dictionary - put the following command in ~/.vimrc&lt;br /&gt;
&lt;br /&gt;
                   set dictionary+=/usr/share/dict/words&lt;br /&gt;
                   set thesaurus+=/usr/share/dict/words&lt;br /&gt;
              &lt;br /&gt;
               Now, after you type a word &amp;lt;ctl-x&amp;gt;&amp;lt;ctl-k&amp;gt;&amp;lt;ctl-n&amp;gt; and to &lt;br /&gt;
               go back in the listing &amp;lt;ctl-p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                   butter&amp;lt;ctl-x&amp;gt;&amp;lt;ctl-k&amp;gt;&amp;lt;ctl-n&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 98:&lt;br /&gt;
&lt;br /&gt;
     Using apt-get&lt;br /&gt;
&lt;br /&gt;
          $ apt-get update&lt;br /&gt;
          $ apt-get -s install &amp;lt;pkage&amp;gt;    &amp;lt;---- if everything is ok, then, remove the s&lt;br /&gt;
&lt;br /&gt;
     Note you may want to use dpkg to purge if you have to do a reinstall.&lt;br /&gt;
&lt;br /&gt;
          $ dpkg --purge exim4-base&lt;br /&gt;
          $ dpkg --purge exim4-config&lt;br /&gt;
          $ apt-get install exim4&lt;br /&gt;
&lt;br /&gt;
          $ dpkg-reconfigure exim4-config&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 99:&lt;br /&gt;
&lt;br /&gt;
     Mounting a cdrom on openbsd and installing packages&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /cdrom&lt;br /&gt;
          $ mount /dev/cd0a /cdrom&lt;br /&gt;
          $ cd /cdrom&lt;br /&gt;
&lt;br /&gt;
     To add packages&lt;br /&gt;
&lt;br /&gt;
          $ pkg_add -v  &amp;lt;directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Mounting a cdrom on linux to a user's home sub-directory:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /home/chirico/cdrom&lt;br /&gt;
          $ mount /dev/cdrom /home/chirico/cdrom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 100:&lt;br /&gt;
&lt;br /&gt;
    Creating a boot floppy for knoppix cd:&lt;br /&gt;
&lt;br /&gt;
          $ dd if=/mnt/cdrom/KNOPPIX/boot.img of=/dev/fd0 bs=1440k&lt;br /&gt;
&lt;br /&gt;
    References:&lt;br /&gt;
        http://www.knoppix.net/docs/index.php/BootFloppyHowTo&lt;br /&gt;
&lt;br /&gt;
    For a lot of the knoppix how-to's&lt;br /&gt;
        http://www.knoppix.net/docs/index.php/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 101:&lt;br /&gt;
&lt;br /&gt;
    Diction and Style Tools for Linux  http://ftp.gnu.org/gnu/diction/&lt;br /&gt;
&lt;br /&gt;
        $ diction mytext|less&lt;br /&gt;
&lt;br /&gt;
    Or, this can be done interactively&lt;br /&gt;
&lt;br /&gt;
        $ diction&lt;br /&gt;
        This is more text to read and you can do with it&lt;br /&gt;
        what you want.&lt;br /&gt;
        (stdin):1: This is more text to read and you [can -&amp;gt; (do not confuse with &amp;quot;may&amp;quot;)] do with it what you want.&lt;br /&gt;
&lt;br /&gt;
    DESCRIPTION&lt;br /&gt;
       Diction finds all sentences in a document, that contain phrases from  a&lt;br /&gt;
       database  of  frequently  misused,  bad  or  wordy diction.  It further&lt;br /&gt;
       checks for double words.  If no files are given, the document  is  read&lt;br /&gt;
       from  standard input.  Each found phrase is enclosed in [ ] (brackets).&lt;br /&gt;
       Suggestions and advice, if any, are printed headed by a right arrow -&amp;gt;.&lt;br /&gt;
       A  sentence is a sequence of words, that starts with a capitalised word&lt;br /&gt;
       and ends with a full stop, double colon, question mark or  exclaimation&lt;br /&gt;
       mark.  A single letter followed by a dot is considered an abbreviation,&lt;br /&gt;
       so it does not terminate a sentence.   Various  multi-letter  abbrevia-&lt;br /&gt;
       tions are recognized, they do not terminate a sentence as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 102:&lt;br /&gt;
&lt;br /&gt;
    Using a mail alias.&lt;br /&gt;
&lt;br /&gt;
       Suppose all root mail on your system to go to one root account root@main.com&lt;br /&gt;
&lt;br /&gt;
       In the following file:&lt;br /&gt;
&lt;br /&gt;
             /etc/aliases&lt;br /&gt;
&lt;br /&gt;
       Add this line&lt;br /&gt;
&lt;br /&gt;
             root:    root@main.com&lt;br /&gt;
&lt;br /&gt;
       Next, run newaliases [/usr/bin/newaliases] as follows:&lt;br /&gt;
&lt;br /&gt;
             $ newaliases&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Special note: It's possible to send mail to more than one address. Suppose you want&lt;br /&gt;
                     mail going to root@main.com above, plus you want it going to user donkey&lt;br /&gt;
                     on the local system.&lt;br /&gt;
&lt;br /&gt;
             root:  root@main.com donkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 103:&lt;br /&gt;
&lt;br /&gt;
    Chrony - this service is similiar to ntp. It keeps accurate time&lt;br /&gt;
            on your computer against a very accurate clock in across&lt;br /&gt;
            a network with various time delays.&lt;br /&gt;
&lt;br /&gt;
    Reference: http://go.to/chrony&lt;br /&gt;
&lt;br /&gt;
        In the file &amp;quot;/etc/chrony/chrony.conf&amp;quot; add/replace the following&lt;br /&gt;
&lt;br /&gt;
             server 146.186.218.60&lt;br /&gt;
             server 128.118.25.3&lt;br /&gt;
             server 128.2.129.21&lt;br /&gt;
&lt;br /&gt;
        Next start the chrony service&lt;br /&gt;
&lt;br /&gt;
           $ /etc/init.d/chrony restart&lt;br /&gt;
&lt;br /&gt;
     Next verify that this is working. It may take 20 or 30 minutes to update&lt;br /&gt;
     the clock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Shell command:&lt;br /&gt;
       # chronyc&lt;br /&gt;
       chronyc&amp;gt; sourcestats&lt;br /&gt;
       210 Number of sources = 3&lt;br /&gt;
       Name/IP Address            NP  NR  Span  Frequency   Freq Skew   Std Dev&lt;br /&gt;
       ========================================================================&lt;br /&gt;
       b50.cede.psu.edu            2   0    64       0.000    2000.000  4000ms&lt;br /&gt;
       otc2.psu.edu                2   0    66       0.000    2000.000  4000ms&lt;br /&gt;
       FS3.ECE.CMU.EDU             2   0    64       0.000    2000.000  4000ms&lt;br /&gt;
       chronyc&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    It is probably best to let chrony do its work. However, if you want to&lt;br /&gt;
    set both the hardware and software clock, the following will work:&lt;br /&gt;
&lt;br /&gt;
      Sets the hardware clock&lt;br /&gt;
        # hwclock --set --date=&amp;quot;12/10/04 10:18:05&amp;quot;&lt;br /&gt;
      Sync the hardware clock to software&lt;br /&gt;
        # hwclock --hctosys&lt;br /&gt;
&lt;br /&gt;
    Normally the system keep accurate time with the software clock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 104:&lt;br /&gt;
&lt;br /&gt;
    NFS mount&lt;br /&gt;
&lt;br /&gt;
     SERVER (192.168.1.182)&lt;br /&gt;
&lt;br /&gt;
       Make sure nfs is running on the server&lt;br /&gt;
 &lt;br /&gt;
           $ /etc/init.d/nfs restart&lt;br /&gt;
&lt;br /&gt;
       At the server the contents of /etc/exports for&lt;br /&gt;
       allowing 2 computers (192.168.1.171 and 192.168.1.71)&lt;br /&gt;
       to access the home directory of this server. Note that&lt;br /&gt;
       read write (rw) access is allowed.&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/exports&lt;br /&gt;
         /home   192.168.1.171(rw)&lt;br /&gt;
         /home   192.168.1.71(rw)&lt;br /&gt;
&lt;br /&gt;
       Or, if you have a lot of clients on 192.168.1.* then consider&lt;br /&gt;
       the following:&lt;br /&gt;
&lt;br /&gt;
          /home 192.168.1.0/255.255.252.0(rw)&lt;br /&gt;
&lt;br /&gt;
       Next, still at the server, run the exportfs command&lt;br /&gt;
&lt;br /&gt;
          $ exportfs -rv&lt;br /&gt;
&lt;br /&gt;
       IPTABLES (lokkit). If you're using fedora with default lokkit firewall&lt;br /&gt;
                then you can put the following under &amp;quot;Other ports&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                  Other ports nfs:tcp nfs:udp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       If the above does not work or you are not using lokkit&lt;br /&gt;
        IPTABLES (values in /etc/sysconfig/iptables on SERVER )&lt;br /&gt;
&lt;br /&gt;
        # NFS Need to accept fragmented packets and may not have header&lt;br /&gt;
        #             so you will not know where they are coming from&lt;br /&gt;
        -A INPUT -f -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -m tcp -s 192.168.1.171 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -s 192.168.1.171 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -m udp -s 192.168.1.171 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -s 192.168.1.171 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        &lt;br /&gt;
        -A INPUT -f -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -m tcp -s 192.168.1.71 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -s 192.168.1.71 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -m udp -s 192.168.1.71 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -s 192.168.1.71 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        (Reference: http://nfs.sourceforge.net/nfs-howto/server.html)&lt;br /&gt;
                  and&lt;br /&gt;
        (Reference: http://nfs.sourceforge.net/nfs-howto/security.html)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     CLIENT1 (192.168.1.171)&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /home2&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/fstab&lt;br /&gt;
         192.168.1.182:/home          /home2     nfs     rw 0 0&lt;br /&gt;
&lt;br /&gt;
          $ mount -a -t nfs&lt;br /&gt;
&lt;br /&gt;
        Or to do a one time mounting by hand&lt;br /&gt;
&lt;br /&gt;
          $ mount -t nfs 192.168.1.182:/home  /home2&lt;br /&gt;
&lt;br /&gt;
        Now /home2 on the client will be /home on the server&lt;br /&gt;
&lt;br /&gt;
        Reference:&lt;br /&gt;
          http://nfs.sourceforge.net/nfs-howto/index.html&lt;br /&gt;
&lt;br /&gt;
     MONITOR NFS:&lt;br /&gt;
&lt;br /&gt;
        To monitor the client:&lt;br /&gt;
&lt;br /&gt;
          $ nfsstat -c&lt;br /&gt;
&lt;br /&gt;
           Also note you can &amp;quot;cat /proc/net/rpc/nfs&amp;quot; as well.&lt;br /&gt;
&lt;br /&gt;
       To monitor the server (note the -s instead of the -c).&lt;br /&gt;
&lt;br /&gt;
         $ nfsstat -s&lt;br /&gt;
&lt;br /&gt;
           Also note you can &amp;quot;cat /proc/net/rpc/nfsd&amp;quot; as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       The following &amp;quot;cat&amp;quot; command is done on the NFS server, and shows which&lt;br /&gt;
       clients are mounting. This does not go with examples above. By the way,&lt;br /&gt;
       &amp;quot;root_squash&amp;quot; is the default, and means that root access on the clients is&lt;br /&gt;
       denied. So, how does the client root get access to these filesystems? You have&lt;br /&gt;
       to &amp;quot;su - &amp;lt;someuser&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
              $ cat /proc/fs/nfs/exports&lt;br /&gt;
              # Version 1.1&lt;br /&gt;
              # Path Client(Flags) # IPs&lt;br /&gt;
              /home   192.168.1.102(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   squeezel.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   192.168.1.106(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   livingroom.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   10.8.0.1(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   closet.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
&lt;br /&gt;
     (Reference: http://www.vanemery.com/Linux/NFSv4/NFSv4-no-rpcsec.html#automount )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 105:&lt;br /&gt;
&lt;br /&gt;
      Ports used for Microsoft products&lt;br /&gt;
               http://www.microsoft.com/canada/smallbiz/sgc/articles/ref_net_ports_ms_prod.mspx?pf=true&lt;br /&gt;
          Firewalling?&lt;br /&gt;
               http://www.microsoft.com/technet/prodtechnol/windowsserver2003/library/ServerHelp/428c1bbf-2ceb-4f76-a1ef-0219982eca10.mspx&lt;br /&gt;
&lt;br /&gt;
      To find out common port mappings, take a look at &amp;quot;/etc/services&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 106:&lt;br /&gt;
&lt;br /&gt;
      Man pages: If man pages are formatting incorrectly with PuTTY, try editing&lt;br /&gt;
      the &amp;quot;/etc/man.config&amp;quot; file with the following changes:&lt;br /&gt;
&lt;br /&gt;
           NROFF /usr/bin/groff -Tlatin1 -mandoc&lt;br /&gt;
           NEQN /usr/bin/geqn -Tlatin1&lt;br /&gt;
&lt;br /&gt;
         (Reference TIP 7 for using man)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 107:&lt;br /&gt;
&lt;br /&gt;
      Valgrind: check for memory leaks in your programs. (http://valgrind.org/)&lt;br /&gt;
&lt;br /&gt;
       This is how you can run it on the program &amp;quot;a.out&amp;quot; for valgrind version 2.2.0&lt;br /&gt;
&lt;br /&gt;
         $ valgrind --logfile=valgrind.output   --tool=memcheck ./a.out&lt;br /&gt;
&lt;br /&gt;
       This is how you write the logfile &amp;quot;--log-file&amp;quot; for valgrind-3.0.1&lt;br /&gt;
&lt;br /&gt;
         $ valgrind  --log-file=valgrind --leak-check=yes --tool=memcheck ./a.out&lt;br /&gt;
&lt;br /&gt;
       With C++ programs with gcc 3.4 and later that use STL, export GLIBCXX_FORCE_NEW &lt;br /&gt;
       only when testing to disable memory caching. Remember to enable for production&lt;br /&gt;
       as this will have a performance penalty. Reference  http://valgrind.org/docs/FAQ/ &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 108:&lt;br /&gt;
&lt;br /&gt;
      Runlevel Configuring.&lt;br /&gt;
&lt;br /&gt;
       These two programs, run as root give you a ncurses GUI to what will&lt;br /&gt;
       run on your system on boot.&lt;br /&gt;
&lt;br /&gt;
            # ntsysv&lt;br /&gt;
&lt;br /&gt;
            # chkconfig&lt;br /&gt;
&lt;br /&gt;
       Note, you can also set these manually. For example, normally you will&lt;br /&gt;
       have files in &amp;quot;/etc/init.d/&amp;quot; that will take parameters like &amp;quot;start&amp;quot;,&amp;quot;stop&amp;quot;&lt;br /&gt;
       &amp;quot;restart&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       Take a look at &amp;quot;/etc/init.d/mysql&amp;quot; this file will start and stop the&lt;br /&gt;
       mysql daemon. So, how does know which run levels, and the order it gets&lt;br /&gt;
       loaded in the run level to other programs? By the K&amp;lt;number&amp;gt; and S&amp;lt;number&amp;gt;&lt;br /&gt;
       values.&lt;br /&gt;
&lt;br /&gt;
            $ ls /etc/rc3.d/*mysql&lt;br /&gt;
&lt;br /&gt;
                /etc/rc3.d/K85mysql&lt;br /&gt;
                /etc/rc3.d/S85mysql&lt;br /&gt;
&lt;br /&gt;
       So here on my system the start value is 85. Looking in /etc/rc3.d, which is&lt;br /&gt;
       run level 3, any program with a lower number S84something will get loaded&lt;br /&gt;
       before mysql.&lt;br /&gt;
&lt;br /&gt;
       I manually set the run level as follows for mysql.&lt;br /&gt;
&lt;br /&gt;
            # cd /etc/rc3.d&lt;br /&gt;
            # ln -s ../init.d/mysql S85mysql&lt;br /&gt;
            # ln -s ../init.d/mysql K85mysql&lt;br /&gt;
&lt;br /&gt;
            # cd /etc/rc5.d&lt;br /&gt;
            # ln -s ../init.d/mysql S85mysql&lt;br /&gt;
            # ln -s ../init.d/mysql K85mysql&lt;br /&gt;
&lt;br /&gt;
       Note that I could have chose other numbers as well. &amp;quot;ntsysv&amp;quot; gives&lt;br /&gt;
       you a graphical interface.&lt;br /&gt;
&lt;br /&gt;
       This is a way of doing this with &amp;quot;chkconfig&amp;quot; at the command prompt.&lt;br /&gt;
&lt;br /&gt;
            # chkconfig --list mysqld&lt;br /&gt;
            mysqld          0:off   1:off   2:off   3:on    4:off   5:on    6:off&lt;br /&gt;
&lt;br /&gt;
       Above you can see it's on. Here's how we would have turned this on with chkconfig.&lt;br /&gt;
&lt;br /&gt;
            # chkconfig --level 35 mysqld on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 109:&lt;br /&gt;
&lt;br /&gt;
       File Alteration Monitor - Gamin a FAM replacement&lt;br /&gt;
        http://www.gnome.org/~veillard/gamin/&lt;br /&gt;
        http://www.gnome.org/~veillard/gamin/sources/&lt;br /&gt;
       ******  EXAMPLE NOT COMPLETE *****&lt;br /&gt;
&lt;br /&gt;
       Working with fam  - file alteration monitor.  Mail uses this to signify&lt;br /&gt;
           a change in a file's status.&lt;br /&gt;
&lt;br /&gt;
        Below is the sample C program ftest.c which can be compiled as&lt;br /&gt;
        follows:&lt;br /&gt;
&lt;br /&gt;
              $ gcc -o ftest ftest.c  -lfam&lt;br /&gt;
&lt;br /&gt;
        You will need to work with this as root&lt;br /&gt;
&lt;br /&gt;
              #  ./ftest &amp;lt;somefile absolute path&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Reference:&lt;br /&gt;
            http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?db=man&amp;amp;fname=/usr/share/catman/p_man/cat3x/fam.z&lt;br /&gt;
            http://www.devchannel.org/devtoolschannel/04/05/13/2146252.shtml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 110:&lt;br /&gt;
&lt;br /&gt;
       glibc - this is the main library used by C, and the following&lt;br /&gt;
        link below gives you examples on everything from sockets,math,&lt;br /&gt;
        date and time functions, user environment, and much more.&lt;br /&gt;
&lt;br /&gt;
         http://www.gnu.org/software/libc/manual/html_mono/libc.html&lt;br /&gt;
&lt;br /&gt;
       How do you know which version of glibc you are running?&lt;br /&gt;
&lt;br /&gt;
          #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
          #include &amp;lt;gnu/libc-version.h&amp;gt;&lt;br /&gt;
          int main (void)&lt;br /&gt;
           {&lt;br /&gt;
             puts (gnu_get_libc_version ());&lt;br /&gt;
             return 0;&lt;br /&gt;
           }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 111:&lt;br /&gt;
&lt;br /&gt;
       nslookup and dig - query Internet name servers interactively.&lt;br /&gt;
&lt;br /&gt;
         $ nslookup&lt;br /&gt;
         &amp;gt;chirico.org&lt;br /&gt;
         Server:        68.80.0.6&lt;br /&gt;
         Address:       68.80.0.6#53&lt;br /&gt;
&lt;br /&gt;
         Name: chirico.org&lt;br /&gt;
         Address: 66.35.250.210&lt;br /&gt;
         &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      The nslookup command will query the dns server is &amp;quot;/etc/resolve.conf&amp;quot;&lt;br /&gt;
      However, you can force a certain dns with &amp;quot;- server&amp;quot;.  For example the&lt;br /&gt;
      command below goes to the server named dilbert&lt;br /&gt;
&lt;br /&gt;
         $ nslookup - dilbert&lt;br /&gt;
         &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      dig:&lt;br /&gt;
&lt;br /&gt;
      dig gives you more information. You should probably use dig instead&lt;br /&gt;
      of nslookup.&lt;br /&gt;
&lt;br /&gt;
      Below I am forcing the lookup from DNS 68.80.0.6 of the name chirico.org, and&lt;br /&gt;
      note that the query time is return too.&lt;br /&gt;
&lt;br /&gt;
         $ dig @68.80.0.6  +qr chirico.org&lt;br /&gt;
&lt;br /&gt;
         ; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.2.1 &amp;lt;&amp;lt;&amp;gt;&amp;gt; @68.80.0.6 +qr chirico.org&lt;br /&gt;
         ;; global options:  printcmd&lt;br /&gt;
         ;; Sending:&lt;br /&gt;
         ;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 55908&lt;br /&gt;
         ;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0&lt;br /&gt;
        &lt;br /&gt;
         ;; QUESTION SECTION:&lt;br /&gt;
         ;chirico.org.                   IN      A&lt;br /&gt;
        &lt;br /&gt;
         ;; Got answer:&lt;br /&gt;
         ;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 55908&lt;br /&gt;
         ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
        &lt;br /&gt;
         ;; QUESTION SECTION:&lt;br /&gt;
         ;chirico.org.                   IN      A&lt;br /&gt;
        &lt;br /&gt;
         ;; ANSWER SECTION:&lt;br /&gt;
         chirico.org.            5538    IN      A       66.35.250.210&lt;br /&gt;
        &lt;br /&gt;
         ;; AUTHORITY SECTION:&lt;br /&gt;
         chirico.org.            30599   IN      NS      ns78.worldnic.com.&lt;br /&gt;
         chirico.org.            30599   IN      NS      ns77.worldnic.com.&lt;br /&gt;
        &lt;br /&gt;
         ;; ADDITIONAL SECTION:&lt;br /&gt;
         ns78.worldnic.com.      16022   IN      A       216.168.225.218&lt;br /&gt;
         ns77.worldnic.com.      7       IN      A       216.168.228.41&lt;br /&gt;
        &lt;br /&gt;
         ;; Query time: 155 msec&lt;br /&gt;
         ;; SERVER: 68.80.0.6#53(68.80.0.6)&lt;br /&gt;
         ;; WHEN: Thu Dec 23 07:48:23 2004&lt;br /&gt;
         ;; MSG SIZE  rcvd: 127&lt;br /&gt;
&lt;br /&gt;
      So what if you wanted to know what name the IP address 66.35.250.210&lt;br /&gt;
      resolves to, when using dns 68.80.0.12.&lt;br /&gt;
&lt;br /&gt;
          $ dig @68.80.0.12 -x 66.35.250.210&lt;br /&gt;
          ...&lt;br /&gt;
          ;; ANSWER SECTION:&lt;br /&gt;
          210.250.35.66.in-addr.arpa. 3600 IN   CNAME   210.0/24.250.35.66.in-addr.arpa.&lt;br /&gt;
          210.0/24.250.35.66.in-addr.arpa. 3600 IN PTR  vhost.sourceforge.net.&lt;br /&gt;
&lt;br /&gt;
      Above you can see it resolved to &amp;quot;vhost.sourceforge.net&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      Reference ( http://www.tldp.org/HOWTO/DNS-HOWTO-5.html )&lt;br /&gt;
        Also see TIP 223.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 112:&lt;br /&gt;
&lt;br /&gt;
       Using GNU Autotools - so you can produce the familiar &amp;quot;./configure&amp;quot;  &amp;quot;make&amp;quot;  and &amp;quot;make install&amp;quot;&lt;br /&gt;
                             commands. There is also a &amp;quot;make dist&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                The program sqlite3api.cc and the rest of this code can be found at&lt;br /&gt;
                 http://prdownloads.sourceforge.net/cpearls/autotools.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         A &amp;quot;Makefile.am&amp;quot; is required:&lt;br /&gt;
&lt;br /&gt;
            bin_PROGRAMS = sprog&lt;br /&gt;
            sprog_SOURCES = sqlite3api.cc&lt;br /&gt;
            sprog_LDADD = @INCLUDES@ @SQLIBOBJS@&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         In addition, a &amp;quot;configure.in&amp;quot; file is required. Note, AC_CHECK_LIB will&lt;br /&gt;
         check the &amp;quot;libsqlite3.so&amp;quot; file for the &amp;quot;sqlite3_open&amp;quot; file. Note that&lt;br /&gt;
         &amp;quot;sqlite3&amp;quot;, is a shortcut for &amp;quot;libsqlite3&amp;quot; by convention. If this file&lt;br /&gt;
         is not found, AC_CHECK_FILE looks for &amp;quot;/usr/local/lib/libsqlite3.a&amp;quot;. If&lt;br /&gt;
         this is found, then, &amp;quot;-lsqlite3&amp;quot; is added to the LIBS environment variable.&lt;br /&gt;
         Also, &amp;quot;-I/usr/local/include&amp;quot; and &amp;quot;-L/usr/local/lib&amp;quot; will be added on the&lt;br /&gt;
         command line. This is common when some one does not have the library in&lt;br /&gt;
         the path.  (See TIP 49)&lt;br /&gt;
&lt;br /&gt;
            dnl Process this file with autoconf to produce a configure script.&lt;br /&gt;
            AC_INIT(sqlite3api.cc)&lt;br /&gt;
            AM_INIT_AUTOMAKE(sqliteprog, 1.0)&lt;br /&gt;
            AC_PROG_CXX&lt;br /&gt;
            CXXFLAGS='-Wall -W -O2 -s -pipe'&lt;br /&gt;
            AC_CHECK_LIB(sqlite3,sqlite3_open,[],found=no)&lt;br /&gt;
             if test &amp;quot;$found&amp;quot; = &amp;quot;no&amp;quot;; then&lt;br /&gt;
               AC_CHECK_FILE(/usr/local/lib/libsqlite3.a, found=yes)&lt;br /&gt;
               if test &amp;quot;$found&amp;quot; = &amp;quot;yes&amp;quot;; then&lt;br /&gt;
                 LIBS=&amp;quot;$LIBS -lsqlite3&amp;quot;&lt;br /&gt;
                 INCLUDES=&amp;quot;$INCLUDES -I/usr/local/include&amp;quot;&lt;br /&gt;
                 EXTRALIB='-L/usr/local/lib'&lt;br /&gt;
                else&lt;br /&gt;
                 echo &amp;quot;Are you SURE sqlite3 is installed?&amp;quot;&lt;br /&gt;
               fi&lt;br /&gt;
             fi&lt;br /&gt;
            SQLIBOBJS='-Wl,-R/usr/local/lib'&lt;br /&gt;
            AC_SUBST(INCLUDES)&lt;br /&gt;
            AC_SUBST(SQLIBOBJS)&lt;br /&gt;
            AC_SUBST(EXTRALIB)&lt;br /&gt;
            AC_OUTPUT(Makefile)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         To build the configure file, just run the following:&lt;br /&gt;
&lt;br /&gt;
             $ aclocal&lt;br /&gt;
             $ autoconf&lt;br /&gt;
             $ touch NEWS README AUTHORS ChangeLog&lt;br /&gt;
             $ automake --add-missing&lt;br /&gt;
&lt;br /&gt;
         Now if you want to make a tar.gz file &amp;quot;sqliteprog-1.0.tar.gz&amp;quot;, then&lt;br /&gt;
         all you have to run is the following:&lt;br /&gt;
&lt;br /&gt;
             $ make dist&lt;br /&gt;
&lt;br /&gt;
         Note: did you ever want to save all the output from a ./configure? Well, it&lt;br /&gt;
               is automatically saved in the &amp;quot;config.log&amp;quot; file. In fact, this file may&lt;br /&gt;
               contain a lot more than what you saw on the screen.&lt;br /&gt;
&lt;br /&gt;
               Also, you may need to rerun ./configure. But before you do, delete&lt;br /&gt;
               the &amp;quot;config.cache&amp;quot; file to get a clean build.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 113:&lt;br /&gt;
&lt;br /&gt;
       EMACS - common emacs commands.&lt;br /&gt;
&lt;br /&gt;
         M is the ESC&lt;br /&gt;
         C or c is the Ctl&lt;br /&gt;
&lt;br /&gt;
        Shell - when working in a shell. &amp;quot;M-x rename-uniquely&amp;quot; is good for split screen editing.&lt;br /&gt;
&lt;br /&gt;
          M-x rename-uniquely   Use this for multiple shells (renames buffer so it's not the same shell)&lt;br /&gt;
          C-c C-z               Send job in background (when working in a shell)&lt;br /&gt;
          C-c C-o               commit-kill-output (gets rid of a lot of shell output)&lt;br /&gt;
          C-c C-r               reposition at beginning of output&lt;br /&gt;
          C-c C-e               reposition at end of output&lt;br /&gt;
          M-x send-invisible    Hide passwords - use this before typing a password&lt;br /&gt;
&lt;br /&gt;
         Note: if the shell prompt does not show up correctly, then, you may want to creat a &amp;quot;.emacs_bash&amp;quot;&lt;br /&gt;
               file with the following contents:&lt;br /&gt;
&lt;br /&gt;
                          PS1=&amp;quot;emacs:\W \$ &amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Directories  (C-x d) give you a directory listing. You know all those annoying &amp;quot;~&amp;quot; and &amp;quot;#&amp;quot;&lt;br /&gt;
                     file that you get? You can easily delete these when in &amp;quot;dired&amp;quot; mode by hitting&lt;br /&gt;
                     &amp;quot;~&amp;quot;, then  &amp;quot;d&amp;quot; to flag it for delete. Then, hit &amp;quot;x&amp;quot; to and confirm deletion.&lt;br /&gt;
&lt;br /&gt;
                     These are other command that work on highlighted files in &amp;quot;dired&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
                          R   rename&lt;br /&gt;
                          v   view&lt;br /&gt;
                          Z   compress the file&lt;br /&gt;
                          +   create directory&lt;br /&gt;
&lt;br /&gt;
        Other common commands:&lt;br /&gt;
&lt;br /&gt;
          c-x l          list the line you are on, and how many lines in the document.&lt;br /&gt;
                         You will get something like: Page has 4881 lines (4440 + 442),&lt;br /&gt;
                         which means you are on the 4440 line.&lt;br /&gt;
&lt;br /&gt;
          c-x rm bookmark make&lt;br /&gt;
          c-x rb bookmark bounce&lt;br /&gt;
        &lt;br /&gt;
          c-x rb notes&lt;br /&gt;
          c-x rb emacs&lt;br /&gt;
        &lt;br /&gt;
          c-x / &amp;lt;r&amp;gt; (save position in register &amp;lt;r&amp;gt;)&lt;br /&gt;
          c-x j &amp;lt;r&amp;gt; (jump to position in register &amp;lt;r&amp;gt;)&lt;br /&gt;
          c-x r SPC 1 (mark current point in register 1)&lt;br /&gt;
          c-x r j 1 (jump to marked point in register 1)&lt;br /&gt;
          c-x r t &amp;lt;string&amp;gt;  (insert string into register)&lt;br /&gt;
        &lt;br /&gt;
          c-x r s 1 (save marked region in register 1)&lt;br /&gt;
          c-x r i 1 (insert marked region)&lt;br /&gt;
        &lt;br /&gt;
          c-x c-o (delete all blank lines, except one)&lt;br /&gt;
        &lt;br /&gt;
          c-x z (repeat the last command ... stop with an a)&lt;br /&gt;
          c-x zz (repeat the last command twice)&lt;br /&gt;
&lt;br /&gt;
          rectangle&lt;br /&gt;
          ---------&lt;br /&gt;
          C-SPC&lt;br /&gt;
          goto the next region&lt;br /&gt;
          C-x&lt;br /&gt;
          C-x&lt;br /&gt;
          then, C-x r r &amp;quot;name of register&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
          to insert the register&lt;br /&gt;
          C-x r i &amp;quot;name of register&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
          macros:&lt;br /&gt;
          -------&lt;br /&gt;
          c-x (    start macro&lt;br /&gt;
          c-x )    end macro&lt;br /&gt;
          c-x e    execute macro&lt;br /&gt;
        &lt;br /&gt;
          mail:&lt;br /&gt;
          -----&lt;br /&gt;
          c-x m   mail&lt;br /&gt;
          c-c c-s send&lt;br /&gt;
        &lt;br /&gt;
          C-x C-e&lt;br /&gt;
          (insert &amp;quot;\n\nExtra Line of text&amp;quot;)&lt;br /&gt;
        &lt;br /&gt;
          ;; chirico functions in .emacs&lt;br /&gt;
          ;; This creates an html template&lt;br /&gt;
          (defun my-html ()&lt;br /&gt;
          (interactive)&lt;br /&gt;
          (insert &amp;quot;&amp;lt;html&amp;gt;&lt;br /&gt;
          &amp;lt;head&amp;gt;&lt;br /&gt;
          &amp;lt;META HTTP-EQUIV=\&amp;quot;Pragma\&amp;quot; CONTENT=\&amp;quot;no-cache\&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;META HTTP-EQUIV=\&amp;quot;Expires\&amp;quot; CONTENT=\&amp;quot;-1\&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;/head&amp;gt;&lt;br /&gt;
          &amp;lt;body bgcolor=\&amp;quot;#ffffff\&amp;quot;&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
          &amp;lt;/body&amp;gt;&lt;br /&gt;
          &amp;lt;/html&amp;gt;&amp;quot;)&lt;br /&gt;
          )&lt;br /&gt;
&lt;br /&gt;
     Backspace issues when using &amp;quot;emacs -nw&amp;quot;? They putting the following in your &amp;quot;~/.emacs&amp;quot; file&lt;br /&gt;
&lt;br /&gt;
             (global-set-key &amp;quot;\C-d&amp;quot; 'backward-delete-char)&lt;br /&gt;
             (global-set-key &amp;quot;\C-h&amp;quot; 'backward-delete-char)&lt;br /&gt;
             (global-set-key (kbd &amp;quot;DEL&amp;quot;) 'delete-char)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 114:&lt;br /&gt;
&lt;br /&gt;
        ncftpget - an intelligent ftp client (http://www.ncftp.com/). Also&lt;br /&gt;
                   check your fedora or debian install. This package allows&lt;br /&gt;
                   you to easily download packages from ftp sites.&lt;br /&gt;
&lt;br /&gt;
          This is an example of connect to an ftp site, with a subdirectory, and&lt;br /&gt;
          downloading all in one command.&lt;br /&gt;
&lt;br /&gt;
           $ ncftpget ftp://ftp.gnu.org/pub/gnu/gcc/gcc-3.2.3/gcc-3.2.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
          Of if you want to get the fedora core 3 installs&lt;br /&gt;
&lt;br /&gt;
           $ ncftpget ftp://ftp.linux.ncsu.edu/pub/fedora/linux/core/3/i386/iso/FC3*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 115:&lt;br /&gt;
&lt;br /&gt;
        expr - evaluate expressions. You can use this on the command line&lt;br /&gt;
&lt;br /&gt;
           $ expr 6 + 4&lt;br /&gt;
           10&lt;br /&gt;
&lt;br /&gt;
         Note the spaces. Without spaces, you get the following:&lt;br /&gt;
&lt;br /&gt;
           $ expr 6+4&lt;br /&gt;
           6+4&lt;br /&gt;
&lt;br /&gt;
         If you're using &amp;quot;*&amp;quot;, you'll need a &amp;quot;\&amp;quot; before it&lt;br /&gt;
&lt;br /&gt;
           $ expr 10 \* 10&lt;br /&gt;
           100&lt;br /&gt;
&lt;br /&gt;
         This also works for variables&lt;br /&gt;
&lt;br /&gt;
           $ var1=34&lt;br /&gt;
           $ expr $var1 + 3&lt;br /&gt;
           37&lt;br /&gt;
&lt;br /&gt;
         or&lt;br /&gt;
&lt;br /&gt;
           $ var1=2&lt;br /&gt;
           $ var1=`expr $var1 \* 2`&lt;br /&gt;
           $ echo $var1&lt;br /&gt;
           4&lt;br /&gt;
&lt;br /&gt;
         see (TIP 25) you can get the cosine(.23)&lt;br /&gt;
&lt;br /&gt;
           $ var1=`echo &amp;quot;c(.23)&amp;quot;|bc -l`&lt;br /&gt;
           $ echo $var1&lt;br /&gt;
           .97366639500537483696&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         You can also do substrings:&lt;br /&gt;
&lt;br /&gt;
           $ expr substr &amp;quot;BigBear&amp;quot; 4 4&lt;br /&gt;
           Bear&lt;br /&gt;
&lt;br /&gt;
         And length of strings&lt;br /&gt;
&lt;br /&gt;
           $ mstr=&amp;quot;12345&amp;quot;&lt;br /&gt;
           $ expr length $mstr&lt;br /&gt;
           5&lt;br /&gt;
&lt;br /&gt;
         Regular expressions&lt;br /&gt;
&lt;br /&gt;
           $ expr &amp;quot;a3&amp;quot; : [a-z][1-9]&lt;br /&gt;
           2&lt;br /&gt;
&lt;br /&gt;
         Or you can get a bit fancy&lt;br /&gt;
&lt;br /&gt;
           $ myexpr=&amp;quot;[a-z][1-9]&amp;quot;&lt;br /&gt;
           $ echo $myexpr&lt;br /&gt;
           [a-z][1-9]&lt;br /&gt;
&lt;br /&gt;
           $ expr &amp;quot;a3&amp;quot; : $myexpr&lt;br /&gt;
           2&lt;br /&gt;
&lt;br /&gt;
         This may not be the best way to find out if it is Friday, but&lt;br /&gt;
         it seems to work. It's more of an exercise in xargs.&lt;br /&gt;
&lt;br /&gt;
           $ date&lt;br /&gt;
           Fri Dec 31 16:44:47 EST 2004&lt;br /&gt;
           $ date|xargs -i expr {} : &amp;quot;[Fri]&amp;quot;&lt;br /&gt;
           1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 116:&lt;br /&gt;
&lt;br /&gt;
        eval&lt;br /&gt;
&lt;br /&gt;
           $ mypipe=&amp;quot;|&amp;quot;&lt;br /&gt;
           $ eval ls $mypipe wc&lt;br /&gt;
           6       6     129&lt;br /&gt;
&lt;br /&gt;
        Did you catch that? The above statement is the same as&lt;br /&gt;
&lt;br /&gt;
           $ ls | wc&lt;br /&gt;
&lt;br /&gt;
        Where &amp;quot;|&amp;quot; is put into the variable $mypipe&lt;br /&gt;
&lt;br /&gt;
        (also see TIP 118)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 117:&lt;br /&gt;
&lt;br /&gt;
        lxr, glimpse, patchset - tools for reading the kernel source&lt;br /&gt;
&lt;br /&gt;
          This example puts some of the files in /home/src since my home&lt;br /&gt;
          partition is the largest. Plus, you do not want to over write&lt;br /&gt;
          the source in /usr/src/ If you want to put your files elsewhere&lt;br /&gt;
          just substitute /home/src for your desired directory.&lt;br /&gt;
&lt;br /&gt;
         patchset -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ export SRCDIR=/home/src&lt;br /&gt;
            $ cd $SRCDIR&lt;br /&gt;
            $ wget http://www.csn.ul.ie/~mel/projects/patchset/patchset-0.5.tar.gz&lt;br /&gt;
            $ export PATH=$PATH:$SRCDIR/patchset-0.5/bin&lt;br /&gt;
&lt;br /&gt;
          Now edit &amp;quot;/home/src/patchset-0.5/etc/patchset.conf&amp;quot; and set WWW_USER to&lt;br /&gt;
          whatever your website runs as&lt;br /&gt;
&lt;br /&gt;
                  export WWW_USER=nobody&lt;br /&gt;
&lt;br /&gt;
          Getting kernel source. The last step builds and asks a lot of questions. Enter&lt;br /&gt;
          yes to things that interest you, since this is what you will see in the source&lt;br /&gt;
          code. It is not going to build for booting. The &amp;quot;downlaod -p&amp;quot; is for downloading&lt;br /&gt;
          a patch.&lt;br /&gt;
&lt;br /&gt;
            $ download 2.6.10&lt;br /&gt;
            $ createset 2.6.10&lt;br /&gt;
            $ make-kernel -b 2.6.10&lt;br /&gt;
&lt;br /&gt;
        glimpse -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ mkdir -p /home/src/glimpse&lt;br /&gt;
            $ cd /home/src/glimpse&lt;br /&gt;
            $ wget http://webglimpse.net/trial/glimpse-latest.tar.gz&lt;br /&gt;
            $ tar -xzf glimpse-latest.tar.gz&lt;br /&gt;
            $ cd glimpse-4.18.0&lt;br /&gt;
            $ ./configure; make&lt;br /&gt;
            $ make install&lt;br /&gt;
&lt;br /&gt;
        lxr -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ make -p /home/src/lxr&lt;br /&gt;
            $ cd /home/src/lxr&lt;br /&gt;
            $ wget http://heanet.dl.sourceforge.net/sourceforge/lxr/lxr-0.3.1.tar.gz&lt;br /&gt;
            $ cd lxr-0.3&lt;br /&gt;
&lt;br /&gt;
          Edit &amp;quot;Makefile&amp;quot; and set PERLBIN to &amp;quot;/usr/bin/perl&amp;quot; or the where perl is&lt;br /&gt;
          on your system. Also set INSTALLPREFIX to &amp;quot;/var/www/lxr&amp;quot;.  Then, as root&lt;br /&gt;
          do the following:&lt;br /&gt;
&lt;br /&gt;
            $ make install&lt;br /&gt;
&lt;br /&gt;
         Apache changes&lt;br /&gt;
&lt;br /&gt;
          Next edit the apache httpd.conf. On my system it is&lt;br /&gt;
          &amp;quot;/usr/local/apache2/conf/httpd.conf&amp;quot;, but if you did a fedora install&lt;br /&gt;
          I think this file is located at &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             Alias  /lxr/ &amp;quot;/var/www/lxr/&amp;quot;&lt;br /&gt;
             &amp;lt;Directory &amp;quot;/var/www/lxr/&amp;quot;&amp;gt;&lt;br /&gt;
               Options ExecCGI Indexes Includes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride all&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
&lt;br /&gt;
              &amp;lt;Files ~ (search|source|ident|diff|find)&amp;gt;&lt;br /&gt;
                    SetHandler cgi-script&lt;br /&gt;
              &amp;lt;/Files&amp;gt;&lt;br /&gt;
             &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          lxr - continued &amp;quot;/var/www/lxr/http/lxr.conf&amp;quot; changes.  The following contains&lt;br /&gt;
                my lxr.conf with changes made to almost every variable. Make sure you use&lt;br /&gt;
                your website in place of 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
                 # Configuration file.&lt;br /&gt;
                &lt;br /&gt;
                 # Define typed variable &amp;quot;v&amp;quot;, read valueset from file.&lt;br /&gt;
                 variable: v, Version, [/var/www/lxr/source/versions], [/var/www/lxr/source/defversion]&lt;br /&gt;
                &lt;br /&gt;
                 # Define typed variable &amp;quot;a&amp;quot;.  First value is default.&lt;br /&gt;
                 variable: a, Architecture, (i386, alpha, m68k, mips, ppc, sparc, sparc64)&lt;br /&gt;
                &lt;br /&gt;
                 # Define the base url for the LXR files.&lt;br /&gt;
                 baseurl: http://192.168.1.71/lxr/http/&lt;br /&gt;
                &lt;br /&gt;
                 # These are the templates for the HTML heading, directory listing and&lt;br /&gt;
                 # footer, respectively.&lt;br /&gt;
                 htmlhead: /var/www/lxr/http/template-head&lt;br /&gt;
                 htmltail: /var/www/lxr/http/template-tail&lt;br /&gt;
                 htmldir:  /var/www/lxr/http/template-dir&lt;br /&gt;
                &lt;br /&gt;
                 # The source is here.&lt;br /&gt;
                 sourceroot: /var/www/lxr/source/$v/&lt;br /&gt;
                 srcrootname: Linux&lt;br /&gt;
                &lt;br /&gt;
                 # &amp;quot;#include &amp;lt;foo.h&amp;gt;&amp;quot; is mapped to this directory (in the LXR source&lt;br /&gt;
                 # tree)&lt;br /&gt;
                 incprefix: /include&lt;br /&gt;
                &lt;br /&gt;
                 # The database files go here.&lt;br /&gt;
                 dbdir: /var/www/lxr/source/$v/&lt;br /&gt;
                &lt;br /&gt;
                 # Glimpse can be found here.&lt;br /&gt;
                 glimpsebin: /usr/local/bin/glimpse&lt;br /&gt;
                &lt;br /&gt;
                 # The power of regexps.  This is pretty Linux-specific, but quite&lt;br /&gt;
                 # useful.  Tinker with it and see what it does.  (How's that for&lt;br /&gt;
                 # documentation?)&lt;br /&gt;
                 map: /include/asm[^\/]*/ /include/asm-$a/&lt;br /&gt;
                 map: /arch/[^\/]+/ /arch/$a/&lt;br /&gt;
&lt;br /&gt;
         Now you should be ready to run &amp;quot;make-lxr&amp;quot;. Make sure the path is setup to patchset,&lt;br /&gt;
         which is repeated here. The last step take awhile.&lt;br /&gt;
&lt;br /&gt;
            $ export SRCDIR=/home/src&lt;br /&gt;
            $ cd $SRCDIR&lt;br /&gt;
            $ export PATH=$PATH:$SRCDIR/patchset-0.5/bin&lt;br /&gt;
&lt;br /&gt;
            $  make-lxr 2.6.10&lt;br /&gt;
&lt;br /&gt;
         Now you need to index the source. Below the ./glimpse_* file will be put in&lt;br /&gt;
         root. Checkout the -H option if you do not want them here on a temporary&lt;br /&gt;
         bases of if you run out of room.&lt;br /&gt;
&lt;br /&gt;
            $ glimpseindex -o -t -w 5000 /var/www/lxr/source/2.6.10 &amp;gt;&amp;amp; .glimpse_out&lt;br /&gt;
&lt;br /&gt;
         Since the above put the files under /root/.glimpse_* they should be moved&lt;br /&gt;
&lt;br /&gt;
            $ mv /root/.glimps_* /var/www/lxr/source/2.6.10/.&lt;br /&gt;
            $ chown -R nobody.nobody ./.glimpse_*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 118:&lt;br /&gt;
&lt;br /&gt;
        exec - you can change standard output and input without starting a new&lt;br /&gt;
               process.&lt;br /&gt;
&lt;br /&gt;
          The exec redirect the output from ls and date to a file. Nothing&lt;br /&gt;
          is show on the terminal until &amp;quot;exec &amp;gt; /dev/tty&amp;quot; is performed&lt;br /&gt;
&lt;br /&gt;
            $ exec &amp;gt; mfile&lt;br /&gt;
            $ ls&lt;br /&gt;
            $ date&lt;br /&gt;
            $ exec &amp;gt; /dev/tty&lt;br /&gt;
&lt;br /&gt;
          This is an example of assigning file descriptor 3 to file &amp;quot;output3&amp;quot; for&lt;br /&gt;
          output, then, redirecting &amp;quot;ls&amp;quot; to this descriptor. Finally, file descriptor&lt;br /&gt;
          3 is used for input, and the contents are read into the cat command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
            $ exec 3&amp;gt;output3&lt;br /&gt;
            $ ls  &amp;gt;&amp;amp; 3&lt;br /&gt;
            $ exec 3&amp;lt;output3&lt;br /&gt;
            $ cat &amp;lt;&amp;amp;3&lt;br /&gt;
            ChangeLog&lt;br /&gt;
            CVS&lt;br /&gt;
            How_to_Linux_and_Open_Source.txt&lt;br /&gt;
            How_to_Linux_and_Open_Source.txt.~1.193.~&lt;br /&gt;
            mfile&lt;br /&gt;
            mfile2&lt;br /&gt;
            mfile3&lt;br /&gt;
            mftp&lt;br /&gt;
            output3&lt;br /&gt;
&lt;br /&gt;
        Could you redirect the output to 3 files and stderr?&lt;br /&gt;
&lt;br /&gt;
            $ exec 3&amp;gt;output3&lt;br /&gt;
            $ exec 4&amp;gt;output4&lt;br /&gt;
            $ exec 5&amp;gt;output5&lt;br /&gt;
&lt;br /&gt;
            $ ls &amp;gt;&amp;amp; 3 &amp;gt;&amp;amp; 4 &amp;gt;&amp;amp; 5 &amp;gt;&amp;amp; 2   // Nope, can't do this.&lt;br /&gt;
            output3  output4  output5&lt;br /&gt;
&lt;br /&gt;
         Instead, you should do the following:&lt;br /&gt;
&lt;br /&gt;
            $ ls | tee output3 | tee output4 |tee output5&lt;br /&gt;
&lt;br /&gt;
         Closing the &amp;quot;output&amp;quot; file descriptor&lt;br /&gt;
&lt;br /&gt;
            $ &amp;gt;&amp;amp;3-&lt;br /&gt;
&lt;br /&gt;
         Closing the &amp;quot;input&amp;quot; file descriptor&lt;br /&gt;
&lt;br /&gt;
            $ 3&amp;lt;&amp;amp;-&lt;br /&gt;
&lt;br /&gt;
         See what is still open on 0-10&lt;br /&gt;
&lt;br /&gt;
            $ lsof -a -p $$ -d 0-10&lt;br /&gt;
&lt;br /&gt;
         Recursion - the following counts to 5, then, quits.&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
            sleep 1&lt;br /&gt;
            declare -x n&lt;br /&gt;
            let n=${n:=0}+1&lt;br /&gt;
            [ $n -le 5 ] &amp;amp;&amp;amp; echo &amp;quot;$n&amp;quot; &amp;amp;&amp;amp;  exec $0&lt;br /&gt;
&lt;br /&gt;
         There are some real-life applications for this technique, as follows:&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
            declare -x N&lt;br /&gt;
            declare -x n&lt;br /&gt;
            N=${N:=$(od -vAn -N1 -tu4 &amp;lt; /dev/urandom)}&lt;br /&gt;
            let n=${n:=0}+1&lt;br /&gt;
            [ $(($n%2)) -eq 0 ] &amp;amp;&amp;amp; echo &amp;quot;She Loves Me!&amp;quot; || echo &amp;quot;She Loves Me NOT!&amp;quot;&lt;br /&gt;
            [ $n -lt $N ] &amp;amp;&amp;amp;  exec $0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 119:&lt;br /&gt;
&lt;br /&gt;
        runlevel - need to know the current runlevel?&lt;br /&gt;
&lt;br /&gt;
           $ who -r&lt;br /&gt;
           run-level 3  Dec 31 19:02                   last=S&lt;br /&gt;
&lt;br /&gt;
        Need to know the architecture?&lt;br /&gt;
&lt;br /&gt;
          $ arch&lt;br /&gt;
          i686&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 120:&lt;br /&gt;
&lt;br /&gt;
        at - executes commands at a specified time.&lt;br /&gt;
&lt;br /&gt;
         A few examples here. The 1970 program will run&lt;br /&gt;
         next Auguest 2 even though the year 1970 has long past.&lt;br /&gt;
&lt;br /&gt;
          $ at 6:30am Jan 12 &amp;lt; program&lt;br /&gt;
          $ at noon tomorrow &amp;lt; program&lt;br /&gt;
          $ at 1970 pm August 2 &amp;lt; program&lt;br /&gt;
&lt;br /&gt;
        This is an interactive way to use the command:&lt;br /&gt;
&lt;br /&gt;
          $ at now + 6 minutes&lt;br /&gt;
          warning: commands will be executed using (in order) a) $SHELL b) login shell c) /bin/sh&lt;br /&gt;
          at&amp;gt; ls&lt;br /&gt;
          at&amp;gt; date &amp;gt; /tmp/5min&lt;br /&gt;
          at&amp;gt; ^D&lt;br /&gt;
          job 3 at 2005-01-01 08:50&lt;br /&gt;
&lt;br /&gt;
        What jobs are in the queue?&lt;br /&gt;
&lt;br /&gt;
          $ atq&lt;br /&gt;
&lt;br /&gt;
        or&lt;br /&gt;
&lt;br /&gt;
          $ at -l&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 121:&lt;br /&gt;
&lt;br /&gt;
        Creating a Manpage&lt;br /&gt;
&lt;br /&gt;
         As root you can copy the following to /usr/local/man/man1/soup.1 which will&lt;br /&gt;
         give you a manpage for soup.&lt;br /&gt;
&lt;br /&gt;
              .\&amp;quot; Manpage for souptonuts.&lt;br /&gt;
              .\&amp;quot; Contact mchirico@users.sourceforge.com to correct errors or omissions.&lt;br /&gt;
              .TH man 1 &amp;quot;04 January 2005&amp;quot; &amp;quot;1.0&amp;quot; &amp;quot;souptonuts man page&amp;quot;&lt;br /&gt;
              .SH NAME&lt;br /&gt;
              soup \- man page for souptonuts&lt;br /&gt;
              .SH SYNOPSIS&lt;br /&gt;
              soup&lt;br /&gt;
              .SH DESCRIPTION&lt;br /&gt;
              souptonuts is a collection of linux and open&lt;br /&gt;
              source tips.&lt;br /&gt;
              off for golf.&lt;br /&gt;
              .SH OPTIONS&lt;br /&gt;
              The souptonuts does not take any options.&lt;br /&gt;
              .SH SEE ALSO&lt;br /&gt;
              doughnut(1), golf(8)&lt;br /&gt;
              .SH BUGS&lt;br /&gt;
              No known bugs at this time.&lt;br /&gt;
              .SH AUTHOR&lt;br /&gt;
              Mike Chirico (mchirico@comcast.net mchirico@users.sourceforge.net)&lt;br /&gt;
&lt;br /&gt;
         So, to view this man page&lt;br /&gt;
&lt;br /&gt;
            $ man soup&lt;br /&gt;
&lt;br /&gt;
         It's also possible to compress&lt;br /&gt;
&lt;br /&gt;
            $ gzip /usr/local/man/man1/soup.1&lt;br /&gt;
&lt;br /&gt;
         For plenty of examples look at the other man pages. Also the following&lt;br /&gt;
         is helpful. The last one is a tutorial &amp;quot;man 7 mdoc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            $ man manpath&lt;br /&gt;
            $ man groff&lt;br /&gt;
            $ man 7 mdoc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 122:&lt;br /&gt;
&lt;br /&gt;
        dmesg - print out boot messages, or what is in the kernel ring buffer.&lt;br /&gt;
&lt;br /&gt;
          If you missed the messages on boot-up, you can use dmesg to print them.&lt;br /&gt;
&lt;br /&gt;
            $ dmesg &amp;gt; boot.msg&lt;br /&gt;
&lt;br /&gt;
          Or to print, then, clear the ring&lt;br /&gt;
&lt;br /&gt;
            # dmesg -c &amp;gt; boot.msg&lt;br /&gt;
&lt;br /&gt;
          (also see TIP 20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 123:&lt;br /&gt;
&lt;br /&gt;
        gnus - emacs email nntp news reader (comcast as example with NO TLS or SSL)&lt;br /&gt;
&lt;br /&gt;
          First check that you can connect to the news group:&lt;br /&gt;
&lt;br /&gt;
                 $ telnet newsgroups.comcast.net 119&lt;br /&gt;
                 Trying 216.196.97.136...&lt;br /&gt;
                 Connected to newsgroups.comcast.net.&lt;br /&gt;
                 Escape character is '^]'.&lt;br /&gt;
                 200 News.GigaNews.Com&lt;br /&gt;
&lt;br /&gt;
          If you want to check for TLS or SSL see (TIP 54).&lt;br /&gt;
&lt;br /&gt;
          Here is a very simple configuration example without encryption. It&lt;br /&gt;
          appears that comcast does not support ssl or TLS.&lt;br /&gt;
&lt;br /&gt;
          In the &amp;quot;~/.emacs&amp;quot; file you would add the following to get comcast&lt;br /&gt;
          news groups&lt;br /&gt;
&lt;br /&gt;
             (setq gnus-select-method '(nntp &amp;quot;newsgroups.comcast.net&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
          Then, create an &amp;quot;~/.authinfo&amp;quot; file with the following settings using&lt;br /&gt;
          you own username and password.&lt;br /&gt;
&lt;br /&gt;
             machine newsgroups.comcast.net login borkey@comcast.net  password borkeypass0rd&lt;br /&gt;
&lt;br /&gt;
          Next create a &amp;quot;~/.newsrc&amp;quot; with your groups&lt;br /&gt;
&lt;br /&gt;
             news.announce.newusers:&lt;br /&gt;
             comp.lang.c++.moderated! 1-500&lt;br /&gt;
             comp.unix.programmer! 1-500&lt;br /&gt;
             comp.unix.shell! 1-500&lt;br /&gt;
             gnu.emacs.gnus! 1-500&lt;br /&gt;
&lt;br /&gt;
          Finally, create a &amp;quot;~/.gnus&amp;quot; with the following email settings for you&lt;br /&gt;
&lt;br /&gt;
             (setq user-mail-address &amp;quot;mchirico@comcast.net&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
             (defun my-message-mode-setup ()&lt;br /&gt;
               (setq fill-column 72)&lt;br /&gt;
               (turn-on-auto-fill))&lt;br /&gt;
               (add-hook 'message-mode-hook 'my-message-mode-setup)&lt;br /&gt;
&lt;br /&gt;
          To get into gnus&lt;br /&gt;
&lt;br /&gt;
              E-x gnus&lt;br /&gt;
&lt;br /&gt;
          The following are common gnus commands&lt;br /&gt;
&lt;br /&gt;
                RET  view the article under the cursor&lt;br /&gt;
&lt;br /&gt;
                A A (shift-a, shift a): List all newsgroups known&lt;br /&gt;
                                        to the server.&lt;br /&gt;
&lt;br /&gt;
                l (lower-case L)      : List only  subscribed groups&lt;br /&gt;
                                        with unread articles.&lt;br /&gt;
&lt;br /&gt;
                L                     : List all newsgroups in .newsrc file.&lt;br /&gt;
&lt;br /&gt;
                g                     : See if new articles have arrived.&lt;br /&gt;
&lt;br /&gt;
            Some commands for reading&lt;br /&gt;
&lt;br /&gt;
                n  next unread article&lt;br /&gt;
&lt;br /&gt;
                p  previous article&lt;br /&gt;
&lt;br /&gt;
                SPC  scroll down  moves to next unread&lt;br /&gt;
                     when at the bottom of the article&lt;br /&gt;
&lt;br /&gt;
                del  scroll up&lt;br /&gt;
&lt;br /&gt;
                F  follow-up to group on the article you are&lt;br /&gt;
                   reading now.&lt;br /&gt;
&lt;br /&gt;
                f  follow-up to group without citing the article&lt;br /&gt;
&lt;br /&gt;
                R  reply by mail and cite the article&lt;br /&gt;
&lt;br /&gt;
                r  reply by mail without citing the article&lt;br /&gt;
&lt;br /&gt;
                m  new mail&lt;br /&gt;
&lt;br /&gt;
                a  new posting&lt;br /&gt;
&lt;br /&gt;
                c  Catchup&lt;br /&gt;
&lt;br /&gt;
                C-u / t  Show only young headers&lt;br /&gt;
                         / t without C-u limits the summary&lt;br /&gt;
                         to old headers&lt;br /&gt;
&lt;br /&gt;
                T T  toggle threading&lt;br /&gt;
&lt;br /&gt;
                C-u g  Display raw article&lt;br /&gt;
                       hit g to return to normal view&lt;br /&gt;
&lt;br /&gt;
                t  Show all headers  it's a toggle&lt;br /&gt;
&lt;br /&gt;
                W w  Wordwrap the current article&lt;br /&gt;
&lt;br /&gt;
                W r  Decode ROT13  a toggle&lt;br /&gt;
&lt;br /&gt;
                ^  fetch parent of article&lt;br /&gt;
&lt;br /&gt;
                L  create a scorefile-entry based&lt;br /&gt;
                   on the current article (low score)&lt;br /&gt;
                   ? gives you information what each char means&lt;br /&gt;
&lt;br /&gt;
                I  like L but high score&lt;br /&gt;
&lt;br /&gt;
          Commands to send email&lt;br /&gt;
&lt;br /&gt;
            C-c C-c  send message&lt;br /&gt;
&lt;br /&gt;
            C-c C-d  save message as draft&lt;br /&gt;
&lt;br /&gt;
            C-c C-k  kill message&lt;br /&gt;
&lt;br /&gt;
            C-c C-m f  attach file&lt;br /&gt;
&lt;br /&gt;
            M-q  reformat paragraph&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 124:&lt;br /&gt;
&lt;br /&gt;
        Sending Email from telnet&lt;br /&gt;
&lt;br /&gt;
           Note, if you are on the computer you can sometime use the local loopback.&lt;br /&gt;
           In fact, sometimes you can only use the local loop back 127.0.0.1 in&lt;br /&gt;
           place of &amp;quot;bozo.company.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            1     [mchirico@soup Notes]$ telnet bozo.company.com 25&lt;br /&gt;
            2     Trying 192.168.0.204...&lt;br /&gt;
            3     Connected to bozo.company.com.&lt;br /&gt;
            4     Escape character is '^]'.&lt;br /&gt;
            5     220 bozo.company.com ESMTP Postfix (Postfix-20010228-pl03) (Mandrake Linux)&lt;br /&gt;
            6     HELO fakedomain.com&lt;br /&gt;
            7     HELO fakedomain.com         // server echo&lt;br /&gt;
            8     250 bozo.company.com&lt;br /&gt;
            9     MAIL FROM: test@fakedomain.com&lt;br /&gt;
           10     MAIL FROM: test@fakedomain.com   // server echo&lt;br /&gt;
           11     250 Ok&lt;br /&gt;
           12     RCPT TO: mchirico@someother.com&lt;br /&gt;
           13     RCPT TO: mchirico@someother.com   // server echo&lt;br /&gt;
           14     250 Ok&lt;br /&gt;
           15     DATA&lt;br /&gt;
           16     DATA    // echo&lt;br /&gt;
           17     354 Enter mail, end with &amp;quot;.&amp;quot; on a line by itself&lt;br /&gt;
           18     This is a test message&lt;br /&gt;
           19     This is a test message&lt;br /&gt;
           20     to send&lt;br /&gt;
           21     to send&lt;br /&gt;
           22     .&lt;br /&gt;
           23     250 2.0.0 j0B0uH3L018469 Message accepted for delivery&lt;br /&gt;
&lt;br /&gt;
          Above on line 6 you can type in any domain name. Line 7 is an echo. All&lt;br /&gt;
          echos are listed in the comment field.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 125:&lt;br /&gt;
&lt;br /&gt;
          IP forwarding, IP Masquerade&lt;br /&gt;
&lt;br /&gt;
             # echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
             # ipchains -F forward&lt;br /&gt;
             # ipchains -P forward DENY&lt;br /&gt;
             # ipchains -A forward -s 192.168.0.0/24 -j MASQ&lt;br /&gt;
             # ipchains -A forward -i eth1 -j MASQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          This assumes that your internal network is 192.168.0.0 on eth1, and the&lt;br /&gt;
          internet is connected to eth0.&lt;br /&gt;
&lt;br /&gt;
          (Also See TIP 182)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 126:&lt;br /&gt;
&lt;br /&gt;
         Setting KDE as the default desktop manager&lt;br /&gt;
&lt;br /&gt;
               Edit &amp;quot;/etc/sysconfig/desktop&amp;quot; to include the two lines:&lt;br /&gt;
&lt;br /&gt;
                 DESKTOP=&amp;quot;KDE&amp;quot;&lt;br /&gt;
                 DISPLAYMANAGER=&amp;quot;KDE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 127:&lt;br /&gt;
&lt;br /&gt;
        Have a file and you do not know whay type it is (tar, gz, ASCII, binary) ?&lt;br /&gt;
        Use the file command.  Below it is used on the file &amp;quot;mftp&amp;quot;&lt;br /&gt;
&lt;br /&gt;
               $ file mftp&lt;br /&gt;
               mftp: Bourne-Again shell script text executable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 128:&lt;br /&gt;
&lt;br /&gt;
        Software RAID: Two good references&lt;br /&gt;
&lt;br /&gt;
          http://www.tldp.org/HOWTO/Software-RAID-HOWTO-1.html&lt;br /&gt;
          http://lists.us.dell.com/pipermail/linux-poweredge/2003-July/014331.html&lt;br /&gt;
&lt;br /&gt;
        Note, you must setup grub for each RAID 1 device. Suppose you have&lt;br /&gt;
        2 SCSI drives (sda and sdb). By default grub is setup on sda; but, you&lt;br /&gt;
        need to enable it for sdb (/dev/hdb for ide) as follows:&lt;br /&gt;
&lt;br /&gt;
           grub&amp;gt;device (hd0) /dev/sdb&lt;br /&gt;
           grub&amp;gt;root (hd0,0)&lt;br /&gt;
           grub&amp;gt;setup (hd0)&lt;br /&gt;
&lt;br /&gt;
           Checking if &amp;quot;/boot/grub/stage1&amp;quot; exists... no&lt;br /&gt;
           Checking if &amp;quot;/grub/stage1&amp;quot; exists... yes&lt;br /&gt;
           Checking if &amp;quot;/grub/stage2&amp;quot; exists... yes&lt;br /&gt;
           Checking if &amp;quot;/grub/e2fs_stage1_5&amp;quot; exists.. yes&lt;br /&gt;
           Running &amp;quot;embed /grub/e2fs_stage1_5 (hd0)&amp;quot;... 16 sectors are embedded.&lt;br /&gt;
          succeeded&lt;br /&gt;
           Running &amp;quot;install /grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/grub/stage2 /grub/grub&lt;br /&gt;
         .conf&amp;quot;... succeeded.&lt;br /&gt;
         Done.&lt;br /&gt;
&lt;br /&gt;
          grub&amp;gt;&lt;br /&gt;
          grub&amp;gt;quit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Checking to see if everything is working:&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
        Checking the drives&lt;br /&gt;
&lt;br /&gt;
          $ sfdisk -d /dev/sdb&lt;br /&gt;
          $ sfdisk -d /dev/sda&lt;br /&gt;
&lt;br /&gt;
          $ fdisk -l /dev/sda  &amp;quot;This will give general information&amp;quot;&lt;br /&gt;
          $ fdisk -l           &amp;quot;General information for all drives&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Adding raid (assume you want to add the first drive &amp;quot;sda1&amp;quot;, or if it is the second&lt;br /&gt;
                    drive then substitute &amp;quot;sda2&amp;quot; below )&lt;br /&gt;
&lt;br /&gt;
          $ raidhotadd /dev/md0 /dev/sda1&lt;br /&gt;
          $ raidhotadd /dev/md1 /dev/sda2&lt;br /&gt;
          $ raidhotadd /dev/md2 /dev/sda3&lt;br /&gt;
&lt;br /&gt;
        This is an example of an cat /proc/mdstat that is working. Note that&lt;br /&gt;
        there is a listing for both sda1[0] and sdb1[1]&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
                Personalities : [raid1]&lt;br /&gt;
                read_ahead 1024 sectors&lt;br /&gt;
                Event: 12&lt;br /&gt;
                md0 : active raid1 sda1[0] sdb1[1]&lt;br /&gt;
                      104320 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md1 : active raid1 sda2[0] sdb2[1]&lt;br /&gt;
                      1044160 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md2 : active raid1 sda3[0] sdb3[1]&lt;br /&gt;
                      34411136 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        Compare that to this where md2 is missing sdb3&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
                Personalities : [raid1]&lt;br /&gt;
                read_ahead 1024 sectors&lt;br /&gt;
                Event: 9&lt;br /&gt;
                md0 : active raid1 sda1[0] sdb1[1]&lt;br /&gt;
                      104320 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md1 : active raid1 sda2[0] sdb2[1]&lt;br /&gt;
                      1044160 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md2 : active raid1 sdb3[1]        &amp;lt;---- HERE&lt;br /&gt;
                      34411136 blocks [2/1] [_U]&lt;br /&gt;
&lt;br /&gt;
                unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        If you are rebuilding an array, you can watch it by doing the following:&lt;br /&gt;
&lt;br /&gt;
           $ watch -n1 cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
        Need to know the raid setup?&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/raidtab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 129:&lt;br /&gt;
&lt;br /&gt;
        Resetting Redhat Linux Passwords using GRUB&lt;br /&gt;
&lt;br /&gt;
           1. Press 'e'&lt;br /&gt;
           2. Press 'e' again&lt;br /&gt;
           3. Append 'single' to the kernel version listing&lt;br /&gt;
&lt;br /&gt;
          See&lt;br /&gt;
             http://linuxgazette.net/107/tomar.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 130:&lt;br /&gt;
&lt;br /&gt;
        mtr - matt's traceroute. This is an advanced traceroute that keeps&lt;br /&gt;
              [http://www.bitwizard.nl/mtr/]&lt;br /&gt;
                  $ mtr www.yahoo.com&lt;br /&gt;
&lt;br /&gt;
                                              Matt's traceroute  [v0.52]&lt;br /&gt;
                     third-fl-71.localdomain                            Thu Jan 20 11:05:57 2005&lt;br /&gt;
                     Keys:  D - Display mode    R - Restart statistics    Q - Quit&lt;br /&gt;
                                                            Packets               Pings&lt;br /&gt;
                     Hostname                            %Loss  Rcv  Snt  Last Best  Avg  Worst&lt;br /&gt;
                      1. 192.168.1.1                        0%    3    3     0    0    0      1&lt;br /&gt;
                      2. ???&lt;br /&gt;
                      3. fe-2-6-rr01.willogrove5.pa.pa01    0%    3    3     8    7    7      8&lt;br /&gt;
                      4. srp-8-1-ar01.willowgrove1.pa.pa    0%    2    2     8    8    8      8&lt;br /&gt;
                      5. pos7-3-cr01.torresdale.pa.core.    0%    2    2     8    8    8      8&lt;br /&gt;
                      6. 12.119.53.53                       0%    2    2    12   12   12     13&lt;br /&gt;
                      7. tbr1-p012401.phlpa.ip.att.net      0%    2    2    12   12   13     13&lt;br /&gt;
                      8. tbr1-cl8.n54ny.ip.att.net          0%    2    2    13   13   13     13&lt;br /&gt;
                      9. ggr2-p310.n54ny.ip.att.net         0%    2    2    12   12   13     14&lt;br /&gt;
                     10. so-1-0-0.gar4.NewYork1.Level3.n    0%    2    2    14   14   37     61&lt;br /&gt;
                     11. ae-1-54.bbr2.NewYork1.Level3.ne    0%    2    2    13   12   13     13&lt;br /&gt;
                     12. ge-0-3-0.bbr2.Washington1.Level    0%    2    2    19   19   19     19&lt;br /&gt;
                     13. ge-1-1-51.car1.Washington1.Leve    0%    2    2    18   18   19     20&lt;br /&gt;
                     14. 4.79.228.6                         0%    2    2    21   19   20     21&lt;br /&gt;
                     15. UNKNOWN-216-109-120-201.yahoo.c    0%    2    2    21   20   20     21&lt;br /&gt;
                     16. w2.rc.vip.dcn.yahoo.com            0%    2    2    23   21   22     23&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 131:&lt;br /&gt;
&lt;br /&gt;
        chfn - change finger information&lt;br /&gt;
&lt;br /&gt;
            $ chfn&lt;br /&gt;
&lt;br /&gt;
          Next you are asked for a password and user information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 132:&lt;br /&gt;
&lt;br /&gt;
        chsh - change login shell&lt;br /&gt;
&lt;br /&gt;
          First, you may want to get a listing of all the possible&lt;br /&gt;
          shells.&lt;br /&gt;
&lt;br /&gt;
             $ chsh -l&lt;br /&gt;
&lt;br /&gt;
               /bin/sh&lt;br /&gt;
               /bin/bash&lt;br /&gt;
               /sbin/nologin&lt;br /&gt;
               /bin/ash&lt;br /&gt;
               /bin/bsh&lt;br /&gt;
               /bin/ksh&lt;br /&gt;
               /usr/bin/ksh&lt;br /&gt;
               /usr/bin/pdksh&lt;br /&gt;
               /bin/tcsh&lt;br /&gt;
               /bin/csh&lt;br /&gt;
               /bin/zsh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 133:&lt;br /&gt;
&lt;br /&gt;
        bash - working with binary, hex and base 3.&lt;br /&gt;
&lt;br /&gt;
         For the variable must be declare as an integer. Then&lt;br /&gt;
         specify the  &amp;lt;base&amp;gt;#&amp;lt;value&amp;gt;. The example below is 22 in&lt;br /&gt;
         base 3.&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n&lt;br /&gt;
              $ n=3#22&lt;br /&gt;
              $ echo $n&lt;br /&gt;
                8&lt;br /&gt;
&lt;br /&gt;
           Base 16 (hex)&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n2&lt;br /&gt;
              $ n2=16#a&lt;br /&gt;
              $ echo $n2&lt;br /&gt;
                10&lt;br /&gt;
&lt;br /&gt;
           Base 8 (octal)&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n3&lt;br /&gt;
              $ n3=8#11&lt;br /&gt;
              $ echo $n3&lt;br /&gt;
                9   Note 8+1=9&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 134:&lt;br /&gt;
&lt;br /&gt;
        monitoring IP traffic. Try iptraf http://iptraf.seul.org/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 135:&lt;br /&gt;
&lt;br /&gt;
        enscript - convert text files to PostScript&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 136:&lt;br /&gt;
&lt;br /&gt;
        dd and tar - blocking factor. How to determine the blocking factor, block size&lt;br /&gt;
                   so that tar and dd can work together.&lt;br /&gt;
&lt;br /&gt;
        Step 1: Create a large file on local disk, in a directory &amp;quot;1&amp;quot; that will eventually&lt;br /&gt;
                be written to tape. This will be created with dd as follows:&lt;br /&gt;
&lt;br /&gt;
                $ mkdir 1&lt;br /&gt;
                $ dd if=/dev/zero of=disk-image count=40960&lt;br /&gt;
                  40960+0 records in&lt;br /&gt;
                  40960+0 records out&lt;br /&gt;
&lt;br /&gt;
                $ cd ..&lt;br /&gt;
&lt;br /&gt;
        Step 2: tar the directory and contents to tape. First rewind the tape. These examples&lt;br /&gt;
                use /dev/nst0 as the location of the tape. Make sure to substitute your values&lt;br /&gt;
                if needed.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ tar --label=&amp;quot;Test 1&amp;quot; --create --blocking-factor=128 --file=/dev/nst0 1&lt;br /&gt;
&lt;br /&gt;
        Step 3: Read data from the tape using a block size of 128k. If you get an I/O error, which&lt;br /&gt;
                could happend if you used a different blocking factor above, then, you may need&lt;br /&gt;
                to increase the bs to 256, or 512 etc. as needed.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=/dev/nst0 bs=128k of=testblocksz count=1&lt;br /&gt;
                 0+1 records in&lt;br /&gt;
                 0+1 records out&lt;br /&gt;
&lt;br /&gt;
                $ ls -l testblocksz&lt;br /&gt;
                 -rw-r--r--    1 root     root        65536 Feb  9 10:41 testblocksz&lt;br /&gt;
&lt;br /&gt;
                $ ls -lh testblocksz&lt;br /&gt;
                 -rw-r--r--    1 root     root          64k Feb  9 10:41 testblocksz&lt;br /&gt;
&lt;br /&gt;
               Note above that the size 65536 is equal to 64k. That &amp;quot;h&amp;quot; switch in &amp;quot;ls&amp;quot; is for&lt;br /&gt;
               human readable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 4: tar uses a multiplier of 512*blocking-factor to get block size. Again&lt;br /&gt;
&lt;br /&gt;
                 512 * blocking-factor = block size used in dd command.&lt;br /&gt;
&lt;br /&gt;
              Putting in the values, we see that&lt;br /&gt;
&lt;br /&gt;
                 512 * 128 = 65536&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 5: So what does this tell you? You can now use these numbers to &amp;quot;dd&amp;quot; files&lt;br /&gt;
              to tape. But, first tar will be used to create the file locally.&lt;br /&gt;
&lt;br /&gt;
                $ tar --label=&amp;quot;Test 1&amp;quot; --create --blocking-factor=128 --file=test.tar 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 6: Send this to tape with the dd command. Remember 64k is equal to 65536.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=test.tar bs=64k of=/dev/nst0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 7: Now test that it can be read with tar command using blocking-factor=128.&lt;br /&gt;
             Note the &amp;quot;t&amp;quot; command in tar is for tell. It will not write data.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ tar -tvf /dev/nst0 --blocking-factor=128&lt;br /&gt;
                 V--------- 0/0               0 2005-02-09 10:38:20 Test 1--Volume Header--&lt;br /&gt;
                 drwxr-xr-x root/root         0 2005-02-09 10:34:10 1/&lt;br /&gt;
                 -rw-r--r-- root/root  20971520 2005-02-09 10:34:11 1/disk-image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 8: Reading tape data with dd. Most of the time a high &amp;quot;ibs&amp;quot; input block size&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=/dev/nst0 of=outfromdd.tar ibs=64k&lt;br /&gt;
                 321+0 records in&lt;br /&gt;
                 41088+0 records out&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 9: Verify that outfromdd.tar can be read by tar with blocking-factor=128&lt;br /&gt;
&lt;br /&gt;
                $ tar -tvf outfromdd.tar --blocking-factor=128&lt;br /&gt;
                 V--------- 0/0               0 2005-02-09 10:38:20 Test 1--Volume Header--&lt;br /&gt;
                 drwxr-xr-x root/root         0 2005-02-09 10:34:10 1/&lt;br /&gt;
                 -rw-r--r-- root/root  20971520 2005-02-09 10:34:11 1/disk-image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       PULLING FILES:  The dd command can be used to pull files.&lt;br /&gt;
&lt;br /&gt;
              ssh target_address dd if=remotefile | dd of=localfile&lt;br /&gt;
&lt;br /&gt;
           Or, a specific example of getting a file from a computer called hamlet.&lt;br /&gt;
&lt;br /&gt;
              $ ssh root@hamlet  dd if=/home/cvs/test | dd of=/home/storage/test&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        GOING BACKWARD AND FORWARD ON TAPE:&lt;br /&gt;
&lt;br /&gt;
             Go to end of data&lt;br /&gt;
              $ mt -f /dev/nst0  eod&lt;br /&gt;
&lt;br /&gt;
             Previous record&lt;br /&gt;
              $ mt -f /dev/nst0  bsfm 1&lt;br /&gt;
&lt;br /&gt;
             Forward record&lt;br /&gt;
              $ mt -f /dev/nst0  fsf 1&lt;br /&gt;
&lt;br /&gt;
             Rewind&lt;br /&gt;
              $ mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
             Tell&lt;br /&gt;
              $ mt -f /dev/nst0 tell&lt;br /&gt;
&lt;br /&gt;
         (Reference TIP 151 - for how to get around firewalls)&lt;br /&gt;
&lt;br /&gt;
         Below is a script that I use to backup computers via ssh. The&lt;br /&gt;
         tape drive is on &amp;quot;nis&amp;quot; and the extra space is on &amp;quot;hamlet&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                #!/bin/bash&lt;br /&gt;
                # Program to backup server remotely&lt;br /&gt;
                # Assume remote server is nis, you are on squeezel&lt;br /&gt;
                #&lt;br /&gt;
                # Recover from tape&lt;br /&gt;
                #&lt;br /&gt;
                #   dd if=/dev/nst0 of=test.tar.gz bs=64k&lt;br /&gt;
                #&lt;br /&gt;
                filename=&amp;quot;support1.$(date &amp;quot;+%m%d%y%H%M&amp;quot;).tar.gz&amp;quot;&lt;br /&gt;
                DIRTOBACKUP=/var/www&lt;br /&gt;
                #tar cvzf - $DIRTOBACKUP | ssh  root@nis  '(mt -f /dev/nst0 rewind; dd of=/dev/nst0 bs=64k )'&lt;br /&gt;
                tar cvzf - $DIRTOBACKUP | ssh  support1@hamlet &amp;quot;dd of=/home/support1/backups/${filename} &amp;quot;&lt;br /&gt;
&lt;br /&gt;
         Another example program, below, pushes the last &amp;quot;.tar.gz&amp;quot; file to tape:&lt;br /&gt;
&lt;br /&gt;
                #!/bin/bash&lt;br /&gt;
                # Program to push files to tape&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                # Notes on recovering from tape&lt;br /&gt;
                #&lt;br /&gt;
                #   dd if=/dev/nst0 of=test.tar.gz ibs=64k&lt;br /&gt;
                #    or&lt;br /&gt;
                #  $ ssh root@tapeserver &amp;quot;mt -f /dev/nst0 rewind&amp;quot;&lt;br /&gt;
                #  $ ssh root@tapeserver &amp;quot;dd if=/dev/nst0 ibs=64k&amp;quot;|dd of=cvs1.tar.gz&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                # First rewind tape&lt;br /&gt;
                ssh root@tapeserver 'mt -f /dev/nst0 rewind'&lt;br /&gt;
                #&lt;br /&gt;
                # Grab only the last file&lt;br /&gt;
                file=$(find /home/cvs  -iname 'cvs*.tar.gz'|sort|tail -n 1)&lt;br /&gt;
                dd if=${file}|ssh root@tapeserver 'dd of=/dev/nst0 bs=64k'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 137:&lt;br /&gt;
&lt;br /&gt;
        Apache - redirecting pages. All changes are in httpd.conf&lt;br /&gt;
&lt;br /&gt;
               RedirectMatch (.*)\.gif$ http://www.anotherserver.com$1.jpg&lt;br /&gt;
&lt;br /&gt;
               Redirect /service http://foo2.bar.com/service&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 138:&lt;br /&gt;
&lt;br /&gt;
        samba mounts via ssh - mounting a samba share through an ssh tunnel, going&lt;br /&gt;
               through an intermediate computer, that accepts ssh. We'll call this&lt;br /&gt;
               intermediate computer middle [65.219.4.23], and we want to get to&lt;br /&gt;
               destination [192.168.0.81]. The user will be mchirico.&lt;br /&gt;
&lt;br /&gt;
          STEP 1:&lt;br /&gt;
&lt;br /&gt;
               $ mkdir -p /samba/share&lt;br /&gt;
&lt;br /&gt;
          STEP 2:&lt;br /&gt;
&lt;br /&gt;
            This has to be done as root, since we are using a lower port.&lt;br /&gt;
&lt;br /&gt;
               $ ssh -N -L 139:192.168.0.81:139 mchirico@65.219.4.23&lt;br /&gt;
&lt;br /&gt;
          STEP 3:&lt;br /&gt;
&lt;br /&gt;
              umount /samba/sales&lt;br /&gt;
              /bin/mount -t smbfs -o  username=donkey,workgroup=donkeydomain,&lt;br /&gt;
                      password=passw0rk1,port=139,dmask=770,fmask=660,&lt;br /&gt;
                      netbiosname=homecpu //localhost/share /samba/share&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 139:&lt;br /&gt;
&lt;br /&gt;
        Music on Fedora Core -- How to play music on http://magnatune.com with &amp;quot;xmms&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           The following command will show the sound driver:&lt;br /&gt;
&lt;br /&gt;
              $ lspci|grep -i audio&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          STEP 1:&lt;br /&gt;
&lt;br /&gt;
                Unmute amixer with the following command:&lt;br /&gt;
&lt;br /&gt;
              $ amixer set Master 100% unmute&lt;br /&gt;
              $ amixer set PCM 100%  unmute&lt;br /&gt;
&lt;br /&gt;
                Note you can also get a graphical interface with &amp;quot;alsamixer&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              $ alsamixer&lt;br /&gt;
&lt;br /&gt;
                 h,F1   -- for help&lt;br /&gt;
                 Esc    -- exit&lt;br /&gt;
                 Tab    -- move to selections&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          STEP 2:&lt;br /&gt;
&lt;br /&gt;
                Test a sound file &amp;quot;*.au&amp;quot; with aplay. To quickly find files on your system use&lt;br /&gt;
                the &amp;quot;locate *.au&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
                  $ aplay /usr/lib/python2.3/test/audiotest.au&lt;br /&gt;
&lt;br /&gt;
          STEP 3:&lt;br /&gt;
&lt;br /&gt;
                Install &amp;quot;xmms-mp3-1.2.10-9.2.1.fc3.rf.i386.rpm&amp;quot; which does not come with Fedora because&lt;br /&gt;
                of GPL license restrictions.  The latest version of this package can be found&lt;br /&gt;
                at the following url:&lt;br /&gt;
&lt;br /&gt;
                  http://rpmseek.com/rpm-pl/xmms-mp3.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                  $ rpm -ivh xmms-mp3-1.2.10-9.2.1.fc3.rf.i386.rpm&lt;br /&gt;
&lt;br /&gt;
          STEP 4:&lt;br /&gt;
&lt;br /&gt;
                Go to magnatun &amp;quot;http://magnatune.com/&amp;quot;, select genre and make sure xmms&lt;br /&gt;
                is the default player.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 140:&lt;br /&gt;
&lt;br /&gt;
        Routing -- getting access to a network 1 hop away. You are currently on the 192 network&lt;br /&gt;
                   and you want access to the 172.21.0.0 network that has a computer straddling&lt;br /&gt;
                   the two, with /proc/sys/net/ipv4/ip_forward set to 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               $ route add -net 172.21.0.0 netmask 255.255.255.0 gw 192.168.0.204&lt;br /&gt;
&lt;br /&gt;
         To undo:&lt;br /&gt;
&lt;br /&gt;
               $ route del -net 172.21.0.0 netmask 255.255.255.0 gw 192.168.0.204&lt;br /&gt;
&lt;br /&gt;
         Now you can ping 172.21.0.21.&lt;br /&gt;
&lt;br /&gt;
         Does not work?&lt;br /&gt;
&lt;br /&gt;
         Go on to 192.168.0.204 and execute the following commands:&lt;br /&gt;
&lt;br /&gt;
               $ echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
               $ cat /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
               1&lt;br /&gt;
&lt;br /&gt;
         To Look at the the gateway, execute the following command.&lt;br /&gt;
&lt;br /&gt;
               $ netstat -r&lt;br /&gt;
&lt;br /&gt;
         References: &lt;br /&gt;
&lt;br /&gt;
               http://lartc.org/lartc.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 141:&lt;br /&gt;
&lt;br /&gt;
        RAM disk -- creating a filesystem in RAM.&lt;br /&gt;
&lt;br /&gt;
               $ mkfs -t ext3 -q /dev/ram1 4096&lt;br /&gt;
               $ mkdir -p /fsram&lt;br /&gt;
               $ mount /dev/ram1 /fsram -o defaults,rw&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 142:&lt;br /&gt;
&lt;br /&gt;
        Create a Live Linux CDROM  using  BusyBox and OpenSSH.&lt;br /&gt;
&lt;br /&gt;
            These steps are rather long. A complete tutorial is given at&lt;br /&gt;
            the following link:&lt;br /&gt;
             http://prdownloads.sourceforge.net/souptonuts/instructions_boot_system.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 143:&lt;br /&gt;
&lt;br /&gt;
      SystemImager (http://www.systemimager.org/) SystemImager is software that automates Linux installs,&lt;br /&gt;
                       software distribution, and production deployment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 144:&lt;br /&gt;
&lt;br /&gt;
      Mounted a filesystem in rescue mode, yet, you cannot read and write?  Remount.&lt;br /&gt;
&lt;br /&gt;
             $ mount -o remount /&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 145:&lt;br /&gt;
&lt;br /&gt;
      Nmap commands to check for Microsoft VPN connection.&lt;br /&gt;
&lt;br /&gt;
         $ nmap -sO -p 47 vpn1.someserver.com&lt;br /&gt;
         $ nmap -sS -p T:1723 vpn1.someserver.com&lt;br /&gt;
&lt;br /&gt;
      By the way, with nmap you can specify multiple ports. Below&lt;br /&gt;
      is an example of multiple ports; but, use the commands above&lt;br /&gt;
      for Microsoft VPN services.&lt;br /&gt;
&lt;br /&gt;
         $ nmap -sS -p T:1723-3000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 146:&lt;br /&gt;
&lt;br /&gt;
      Perl and ssh - monitoring systems. The output from ssh can be parsed. Below is&lt;br /&gt;
      a simple procedure to just to read the ssh ouput into perl.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #&lt;br /&gt;
          $pid = open $readme, &amp;quot;ssh root\@hamlet df -lh|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
          while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
           print $_&lt;br /&gt;
          }&lt;br /&gt;
          close $readme&lt;br /&gt;
&lt;br /&gt;
      But note, you probably want to do something more complex. Below is a more robust&lt;br /&gt;
      example that bypassed all the fortune, heading junk that you may encounter when&lt;br /&gt;
      logging in.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #&lt;br /&gt;
          $pid = open $readme, &amp;quot;ssh root\@hamlet df -lh 2&amp;gt;/dev/null|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
          while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
           print $_&lt;br /&gt;
          }&lt;br /&gt;
          close $readme&lt;br /&gt;
&lt;br /&gt;
      NO! you CANNOT do bidirectional communication with the open statement. Note the &amp;quot;|&amp;quot; before&lt;br /&gt;
      and after below, which cannot be done.&lt;br /&gt;
&lt;br /&gt;
          # Cannot do this!&lt;br /&gt;
          $pid = open $readme, &amp;quot;|ssh root\@hamlet df -lh 2&amp;gt;/dev/null|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
      Below is a simple Perl example working with arrays:&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          @ArrayOfArray = (&lt;br /&gt;
                   [ &amp;quot;ant&amp;quot;, &amp;quot;bee&amp;quot; ],&lt;br /&gt;
                   [ &amp;quot;mouse&amp;quot;, &amp;quot;mole&amp;quot;, &amp;quot;rat&amp;quot; ],&lt;br /&gt;
                   [ &amp;quot;duck&amp;quot;, &amp;quot;goose&amp;quot;, &amp;quot;flamingo&amp;quot; ],&lt;br /&gt;
                   [  &amp;quot;rose&amp;quot;,&amp;quot;carnation&amp;quot;,&amp;quot;sunflower&amp;quot;],&lt;br /&gt;
                  );&lt;br /&gt;
&lt;br /&gt;
          for $i ( 0 .. $#ArrayOfArray ) {&lt;br /&gt;
              for $j ( 0 .. $#{$ArrayOfArray[$i]} ) {&lt;br /&gt;
                  print &amp;quot;Element $i $j is $ArrayOfArray[$i][$j]\n&amp;quot;;&lt;br /&gt;
              }&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          # Or this is another way to list elements&lt;br /&gt;
          foreach( @ArrayOfArray ) {&lt;br /&gt;
             foreach $i (0..$#$_) {&lt;br /&gt;
                print &amp;quot;$_-&amp;gt;[$i] &amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
             print &amp;quot;\n&amp;quot;;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Below is an example of working with Hash of Arrays:&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #  ./program &amp;lt; /etc/passwd&lt;br /&gt;
          while(&amp;lt;&amp;gt;){&lt;br /&gt;
              next unless s/^(.*?):\s*//;&lt;br /&gt;
              $HoA{$1} = [ split(/:/) ];&lt;br /&gt;
          }&lt;br /&gt;
          for $i (keys %HoA ) {&lt;br /&gt;
              print &amp;quot;$i: @{ $HoA{$i} } \n&amp;quot;;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
      Example of regular expression. This is my most used regular expression - I like&lt;br /&gt;
      this sample. See the &amp;quot;www.unix.org.ua&amp;quot; link at the end of this tip.&lt;br /&gt;
&lt;br /&gt;
          &amp;quot;hot cross buns&amp;quot; =~ /cross/;&lt;br /&gt;
          print &amp;quot;Matched: &amp;lt;$`&amp;gt; $&amp;amp; &amp;lt;$'&amp;gt;\n&amp;quot;;    # Matched: &amp;lt;hot &amp;gt; cross &amp;lt; buns&amp;gt;&lt;br /&gt;
          print &amp;quot;Left:    &amp;lt;$`&amp;gt;\n&amp;quot;;            # Left:    &amp;lt;hot &amp;gt;&lt;br /&gt;
          print &amp;quot;Match:   &amp;lt;$&amp;amp;&amp;gt;\n&amp;quot;;            # Match:   &amp;lt;cross&amp;gt;&lt;br /&gt;
          print &amp;quot;Right:   &amp;lt;$'&amp;gt;\n&amp;quot;;            # Right:   &amp;lt; buns&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      If you're looking for Perl information, type &amp;quot;man perl&amp;quot;, which will show you how&lt;br /&gt;
      to get even more information. Or better yet, take a look at the following&lt;br /&gt;
      link:&lt;br /&gt;
&lt;br /&gt;
          http://www.unix.org.ua/orelly/perl/prog3/ch09_01.htm&lt;br /&gt;
               also&lt;br /&gt;
          http://www.stonehenge.com/merlyn/UnixReview/&lt;br /&gt;
&lt;br /&gt;
      For a quick example on using Perl with SQLite, see the following links:&lt;br /&gt;
&lt;br /&gt;
          http://prdownloads.sourceforge.net/souptonuts/README_sqlite_tutorial.html?download&lt;br /&gt;
            or&lt;br /&gt;
          http://freshmeat.net/articles/view/1428/&lt;br /&gt;
            or&lt;br /&gt;
          http://www.perl.com/pub/a/1999/09/refererents.html&lt;br /&gt;
&lt;br /&gt;
      Standard input for files. This example will read from stdin, or open a file if given as&lt;br /&gt;
      an argument, and convert all &amp;quot;&amp;lt;&amp;quot; to &amp;quot;&amp;amp;lt;&amp;quot; and &amp;quot;&amp;gt;&amp;quot; to &amp;quot;&amp;amp;gt;&amp;quot;, which can be handy when&lt;br /&gt;
      converting text files to html files. Note the &amp;quot;while(&amp;lt;&amp;gt;)&amp;quot; will take multiple file names&lt;br /&gt;
      on the command line.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          while(&amp;lt;&amp;gt;) {&lt;br /&gt;
             s/&amp;amp;amp;/&amp;amp;amp;amp;/g;&lt;br /&gt;
             s/&amp;amp;lt;/&amp;amp;amp;lt;/g;&lt;br /&gt;
             s/&amp;amp;gt;/&amp;amp;amp;gt;/g;&lt;br /&gt;
             s/&amp;lt;/&amp;amp;lt;/g;&lt;br /&gt;
             s/&amp;gt;/&amp;amp;gt;/g;&lt;br /&gt;
             print;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
      Perl Debugger is very useful for testing commands and works like an interpreter, just&lt;br /&gt;
      like python. So to get into the Perl Debugger execute the command below, &amp;quot;q&amp;quot; to quit.&lt;br /&gt;
&lt;br /&gt;
          $ perl -de 0&lt;br /&gt;
&lt;br /&gt;
      Reference TIP 170&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 147:&lt;br /&gt;
&lt;br /&gt;
      Shutdown&lt;br /&gt;
&lt;br /&gt;
          # shutdown 8:00 -- Shutdown at 8:00&lt;br /&gt;
&lt;br /&gt;
          # shutdown +13  -- Shutdown after 13min&lt;br /&gt;
&lt;br /&gt;
          # shutdown -r now  -- Shutdown now and restart&lt;br /&gt;
&lt;br /&gt;
          # shutdown -k +2  -- &amp;quot;The system is going DOWN to maintenance mode in 2 minutes!&amp;quot;&lt;br /&gt;
                              The above is only a warning.&lt;br /&gt;
&lt;br /&gt;
          # shutdown -h now   -- Shutdown now and halt&lt;br /&gt;
&lt;br /&gt;
          # shutdown -c    -- Cancel shutdown&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 148:&lt;br /&gt;
&lt;br /&gt;
      ac -  print statistics about users connect time&lt;br /&gt;
&lt;br /&gt;
          $ ac -p    -- print hour usage by user (individual)&lt;br /&gt;
          $ ac -dy   -- print daily usage&lt;br /&gt;
&lt;br /&gt;
       Options can also be combined&lt;br /&gt;
&lt;br /&gt;
          $ ac -dyp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 149:&lt;br /&gt;
&lt;br /&gt;
      Smart Monitoring Tools:&lt;br /&gt;
      Disk failing? Or want to know the temperature of your hard-drive?&lt;br /&gt;
&lt;br /&gt;
         http://smartmontools.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
      For a good, quick tutorial, see the Linux Journal article&lt;br /&gt;
        http://www.linuxjournal.com/article/6983&lt;br /&gt;
&lt;br /&gt;
      Below are some common commands:&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -i /dev/hda&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -Hc /dev/hda&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -A /dev/hda&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 150:&lt;br /&gt;
&lt;br /&gt;
      Monitor dhcp trafic - dhcpdump and tcpdump.&lt;br /&gt;
&lt;br /&gt;
      Download dhcpdump&lt;br /&gt;
&lt;br /&gt;
         $ wget  http://voxel.dl.sourceforge.net/sourceforge/mavetju/dhcpdump-1.5.tar.gz&lt;br /&gt;
         $ ./configure&lt;br /&gt;
         $ make &amp;amp;&amp;amp; make install&lt;br /&gt;
&lt;br /&gt;
     Once it's installed, you can monitor all dhcp traffic as follows, if done with root.&lt;br /&gt;
&lt;br /&gt;
         $ tcpdump -lenx -i eth0 -s 1500 port bootps or port bootpc| dhcpdump&lt;br /&gt;
&lt;br /&gt;
     The above assumes you are using eth0 (ethernet port 0).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 151:&lt;br /&gt;
&lt;br /&gt;
      Breaking Firewalls with ssh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      A sample .ssh/config file (note this must have chmod 600 rights)&lt;br /&gt;
&lt;br /&gt;
           ## Server1 ##&lt;br /&gt;
           Host 130.21.19.227&lt;br /&gt;
               LocalForward 20000 192.168.0.66:80&lt;br /&gt;
               LocalForward 22000 192.168.0.66:22&lt;br /&gt;
&lt;br /&gt;
      With the above &amp;quot;~/.ssh/config&amp;quot; file, after sshing into 130.21.19.227 it&lt;br /&gt;
      is then possible to ssh into nearby computers directly.&lt;br /&gt;
&lt;br /&gt;
         $ ssh -l mchirico 130.21.19.227&lt;br /&gt;
         $ scp -P 22000 authorized_keys* mchirico@localhost:.&lt;br /&gt;
         $ ssh -l mchirico localhost -p 22000&lt;br /&gt;
&lt;br /&gt;
      For the complete article reference the following link:&lt;br /&gt;
        http://souptonuts.sourceforge.net/sshtips.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 152:&lt;br /&gt;
&lt;br /&gt;
      Renaming files - suppose you want to rename all the &amp;quot;.htm&amp;quot; files to &amp;quot;.html&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          $ rename .htm .html *.htm&lt;br /&gt;
&lt;br /&gt;
      Or, suppose you files file1, file2, file3 ...&lt;br /&gt;
&lt;br /&gt;
          $ touch file1 file2 file3 file4 file5 file6&lt;br /&gt;
          $ rename file file. file*&lt;br /&gt;
&lt;br /&gt;
      The above command will give you &amp;quot;file.1&amp;quot;, &amp;quot;file.2&amp;quot; ... &amp;quot;file.6&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 153:&lt;br /&gt;
&lt;br /&gt;
      Renaming files with Perl - this is taken from &amp;quot;Programming Perl 3rd Edition&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          # rename - change filenames&lt;br /&gt;
          $op = shift;&lt;br /&gt;
          for (@ARGV) {&lt;br /&gt;
              $was = $_;&lt;br /&gt;
              eval $op;&lt;br /&gt;
              die if $@;&lt;br /&gt;
              # next line calls built-in function, not the script&lt;br /&gt;
              rename($was,$_) unless $was eq $_;&lt;br /&gt;
           }&lt;br /&gt;
&lt;br /&gt;
      The above Perl program can be used as follows:&lt;br /&gt;
&lt;br /&gt;
           $ rename 's/\.orig$//'    *.orig&lt;br /&gt;
           $ rename 'y/A-Z/a-z/ unless /^Make/' *&lt;br /&gt;
&lt;br /&gt;
      Also reference:&lt;br /&gt;
           http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 154:&lt;br /&gt;
&lt;br /&gt;
      R project (http://www.r-project.org)&lt;br /&gt;
&lt;br /&gt;
      To start R, just type &amp;quot;R&amp;quot; at the command prompt and &amp;quot;q()&amp;quot; to quit. Below&lt;br /&gt;
      2 is raised to powers 0 through 6 and thrown into an array.&lt;br /&gt;
&lt;br /&gt;
           $ R&lt;br /&gt;
           &amp;gt; N &amp;lt;- 2^(0:6)&lt;br /&gt;
           &amp;gt; N&lt;br /&gt;
           [1]  1  2  4  8 16 32 64&lt;br /&gt;
           &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      There is a summary summary() command.&lt;br /&gt;
&lt;br /&gt;
           &amp;gt; summary(N)&lt;br /&gt;
           Min. 1st Qu.  Median    Mean 3rd Qu.    Max.&lt;br /&gt;
           1.00    3.00    8.00   18.14   24.00   64.00&lt;br /&gt;
&lt;br /&gt;
      Note that the array begins as 1 and not 0&lt;br /&gt;
&lt;br /&gt;
           &amp;gt; N[1:3]&lt;br /&gt;
           [1] 1 2 4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 155:&lt;br /&gt;
&lt;br /&gt;
      ls - listing files by size, with the biggest file listed last&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           $ ls --sort=size -lhr&lt;br /&gt;
&lt;br /&gt;
      The above command sorts files by size, listing the contents in&lt;br /&gt;
      &amp;quot;h&amp;quot; human readable format in reverse order.&lt;br /&gt;
&lt;br /&gt;
      Note the options:  --sort={none,time,size,extension}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 156:&lt;br /&gt;
&lt;br /&gt;
     Perl - program to clean up old versions of files&lt;br /&gt;
&lt;br /&gt;
       #!/usr/bin/perl&lt;br /&gt;
       #   Copyright (c) GPL 2005 Mike Chirico&lt;br /&gt;
       # This program deletes old files from several directories&lt;br /&gt;
       # and within each directory there must be x number of copies&lt;br /&gt;
       # each y number of bytes&lt;br /&gt;
       #&lt;br /&gt;
&lt;br /&gt;
       sub delete_old_ones {&lt;br /&gt;
           $directory_and_file=$_[0];&lt;br /&gt;
           $save_count=$_[1];&lt;br /&gt;
           $bytes_in_file=$_[2];&lt;br /&gt;
         # Don't change setting here of '-lt'&lt;br /&gt;
           $pid = open $readme, &amp;quot;ls -lt $directory_and_file|&amp;quot; or die &amp;quot;Could not execute\n&amp;quot;;&lt;br /&gt;
           while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
               my @fields = split;&lt;br /&gt;
              # Make sure we have $save_count good ones with data&lt;br /&gt;
               if ($fields[4] &amp;gt; $bytes_in_file &amp;amp;&amp;amp; $save_count &amp;gt; 0) {&lt;br /&gt;
                   $save_count--;&lt;br /&gt;
                   print &amp;quot;Kept files: $fields[4] $fields[8]\n&amp;quot;;&lt;br /&gt;
               }&lt;br /&gt;
              # delete the old ones&lt;br /&gt;
              if ($save_count &amp;lt;= 0 )&lt;br /&gt;
              {&lt;br /&gt;
                  print &amp;quot;Deleted files: $fields[4] $fields[8]\n&amp;quot;;&lt;br /&gt;
                  unlink $fields[8];&lt;br /&gt;
              }&lt;br /&gt;
           }&lt;br /&gt;
           close $readme;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       @AofA = (&lt;br /&gt;
          [ &amp;quot;/home/cvs/backups/*.gz&amp;quot;, &amp;quot;6&amp;quot;,196621 ],&lt;br /&gt;
          [ &amp;quot;/home/mail/backups/*.gz&amp;quot;,&amp;quot;5&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/snort/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/server1/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/actserver/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/server2/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
                );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       foreach( @AofA ) {&lt;br /&gt;
           &amp;amp;delete_old_ones($_-&amp;gt;[0],$_-&amp;gt;[1],$_-&amp;gt;[2]);&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
     Reference TIP 170 and the following link:&lt;br /&gt;
       http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 157:&lt;br /&gt;
&lt;br /&gt;
     Graphics and Visualization Software that runs on Linux&lt;br /&gt;
        http://www.tldp.org/HOWTO/Scientific-Computing-with-GNU-Linux/graphvis.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 158:&lt;br /&gt;
&lt;br /&gt;
     Keeping files in sync going both ways. Unlike rsync, this is not a one way mirror&lt;br /&gt;
     option.&lt;br /&gt;
&lt;br /&gt;
     You will need ocaml installed first.&lt;br /&gt;
&lt;br /&gt;
       $ wget http://caml.inria.fr/pub/distrib/ocaml-3.08/ocaml-3.08.3.tar.gz&lt;br /&gt;
       $ tar -xzf ocaml-3.08.3.tar.gz&lt;br /&gt;
       $ cd ocaml-3.08.3&lt;br /&gt;
&lt;br /&gt;
       $ ./configure&lt;br /&gt;
       $ make world&lt;br /&gt;
       $ make opt&lt;br /&gt;
       $ make install&lt;br /&gt;
&lt;br /&gt;
     Next, get unison and put it in a different directory.&lt;br /&gt;
     [http://www.cis.upenn.edu/~bcpierce/unison/]&lt;br /&gt;
&lt;br /&gt;
       $ wget http://www.cis.upenn.edu/~bcpierce/unison/download/stable/latest/unison-2.10.2.tar.gz&lt;br /&gt;
       $ tar -xzf unison-2.10.2.tar.gz&lt;br /&gt;
       $ cd unison-2.10.2&lt;br /&gt;
       $ make UISTYLE=text&lt;br /&gt;
       $ su&lt;br /&gt;
       # cp unison /usr/local/bin/.&lt;br /&gt;
&lt;br /&gt;
     Note, you have to copy the file manually.&lt;br /&gt;
&lt;br /&gt;
     See the following article [http://www.linuxjournal.com/article/7712]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 159:&lt;br /&gt;
&lt;br /&gt;
     Dump ext2/ext3 filesystem information with &amp;quot;dumpe2fs&amp;quot;. Perform the mount command&lt;br /&gt;
     and query away.&lt;br /&gt;
&lt;br /&gt;
       $ dumpe2fs /dev/sda1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 160:&lt;br /&gt;
&lt;br /&gt;
     sysreport - a script that generates an HTML report on the system configuration. It&lt;br /&gt;
     gathers information about the hardware and is somewhat redhat specific. The utility&lt;br /&gt;
     should be run as root.&lt;br /&gt;
&lt;br /&gt;
       $ /usr/sbin/sysreport&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 161:&lt;br /&gt;
&lt;br /&gt;
     Key Bindings Using bind.  You can bind, say, ctl-t to a command.&lt;br /&gt;
&lt;br /&gt;
     Add the following to you &amp;quot;~/.inputrc&amp;quot; file, just as it is typed below with quotes.&lt;br /&gt;
&lt;br /&gt;
           &amp;quot;\C-t&amp;quot;: ls -l&lt;br /&gt;
&lt;br /&gt;
     Next, run the command&lt;br /&gt;
&lt;br /&gt;
           $ bind -f .inputrc&lt;br /&gt;
&lt;br /&gt;
     Or, you can do everything on the command line; however, it won't be there the next time&lt;br /&gt;
     you log in. Below is the way to do everything on the command line.&lt;br /&gt;
&lt;br /&gt;
           $ bind -x '&amp;quot;\C-t&amp;quot;:ls -l'&lt;br /&gt;
&lt;br /&gt;
     To unbind use the &amp;quot;-r&amp;quot; option. Single quotes are not needed.&lt;br /&gt;
&lt;br /&gt;
           $ bind -r &amp;quot;\C-t&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Getting a list of all bindings can be done as follows, and not this can be redirected&lt;br /&gt;
     to the &amp;quot;.inputrc&amp;quot; file for further editing.&lt;br /&gt;
&lt;br /&gt;
           $ bind -p &amp;gt; .inputrc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 162:&lt;br /&gt;
&lt;br /&gt;
     awk - common awk commands.&lt;br /&gt;
&lt;br /&gt;
     Find device names &amp;quot;sd&amp;quot; or with major number 4 and device name &amp;quot;tty&amp;quot;. Print the&lt;br /&gt;
     record number NR, plus the major number and minor number.&lt;br /&gt;
&lt;br /&gt;
          $ awk '$2 == &amp;quot;sd&amp;quot;||$1 == 4 &amp;amp;&amp;amp; $2 == &amp;quot;tty&amp;quot; { print NR,$1,$2}' /proc/devices&lt;br /&gt;
&lt;br /&gt;
     Find device name equal to &amp;quot;sound&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ awk '/sound/{print NR,$1,$2}' /proc/devices&lt;br /&gt;
&lt;br /&gt;
     Print the 5th record, first field, in file test&lt;br /&gt;
&lt;br /&gt;
          $ awk 'NR==5{print $1}' test&lt;br /&gt;
&lt;br /&gt;
     Print a record, skip 4 records, print a record etc from file1&lt;br /&gt;
&lt;br /&gt;
          $ awk '(NR-1) % 4 == 0 {print $1}' file1&lt;br /&gt;
&lt;br /&gt;
     Print all records except the last one from file1&lt;br /&gt;
&lt;br /&gt;
          $ tac file1|awk 'NR &amp;gt; 1 {print $0}'|tac&lt;br /&gt;
&lt;br /&gt;
     Print A,B,C ..Z on each line, cycling back to A if greater than 26 lines&lt;br /&gt;
&lt;br /&gt;
          $ awk '{ print substr(&amp;quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&amp;quot;,(NR-1)%26+1,1),$0}' file1&lt;br /&gt;
&lt;br /&gt;
     Number of bytes in a directory.&lt;br /&gt;
&lt;br /&gt;
          $ ls -l|awk 'BEGIN{ c=0}{ c+=$5} END{ print c}'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 163:&lt;br /&gt;
&lt;br /&gt;
     Configuring Remote Logging.  If you have several servers on 192.168.1.0, you can setup remote logging&lt;br /&gt;
     as follows.&lt;br /&gt;
&lt;br /&gt;
     MAIN LOG SERVER (192.168.1.81):&lt;br /&gt;
&lt;br /&gt;
        Firewall - allow UDP port 514 on the main server that will receive the logs.&lt;br /&gt;
&lt;br /&gt;
          $ iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 514 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        Edit &amp;quot;/etc/sysconfig/syslog&amp;quot; and add the &amp;quot;-r&amp;quot; option to SYSLOGD_OPTIONS as shown below.&lt;br /&gt;
&lt;br /&gt;
          SYSLOGD_OPTIONS=&amp;quot;-r -m -0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Note, the &amp;quot;-r&amp;quot; is to allow remote logging and  &amp;quot;-m 0&amp;quot; specifies that that the syslog process should&lt;br /&gt;
        not write regular timestamps.  I prefer to only write timestamps for the clients.&lt;br /&gt;
&lt;br /&gt;
        Next, restart the logging process&lt;br /&gt;
&lt;br /&gt;
          $ service syslog restart&lt;br /&gt;
&lt;br /&gt;
     CLIENT LOG SERVER:&lt;br /&gt;
&lt;br /&gt;
        Edit &amp;quot;/etc/syslog.conf&amp;quot; and add the ip address of the log server, or put in the hostname.&lt;br /&gt;
&lt;br /&gt;
            *.* @192.168.1.81&lt;br /&gt;
&lt;br /&gt;
        Next, restart the logging process&lt;br /&gt;
&lt;br /&gt;
          $ service syslog restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 164:&lt;br /&gt;
&lt;br /&gt;
     kudzu - hardware on your system. To probe the hardware on your system without doing&lt;br /&gt;
             anything, issue the following command.&lt;br /&gt;
&lt;br /&gt;
          $ kudzu -p&lt;br /&gt;
&lt;br /&gt;
      But wait, a lot of this information is already recorded in the following file&lt;br /&gt;
&lt;br /&gt;
            /etc/sysconfig/hwconf&lt;br /&gt;
&lt;br /&gt;
      You can also use lspci to list all PCI devices.&lt;br /&gt;
&lt;br /&gt;
          $ lspci&lt;br /&gt;
&lt;br /&gt;
      Also, take a look at the script /etc/sbin/sysreport, since this script has a lot of&lt;br /&gt;
      info gathering commands. You can pick and choose what you want, or run the complete&lt;br /&gt;
      report.&lt;br /&gt;
&lt;br /&gt;
      If you just want information on the NIC&lt;br /&gt;
&lt;br /&gt;
          $ ip link show eth0&lt;br /&gt;
          2: eth0: &amp;lt;BROADCAST,MULTICAST,UP&amp;gt; mtu 1500 qdisc pfifo_fast qlen 1000&lt;br /&gt;
          link/ether 00:11:11:8a:be:3f brd ff:ff:ff:ff:ff:ff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 165:&lt;br /&gt;
&lt;br /&gt;
     cfengine - a very power agent for monitoring and administrating both a single computer&lt;br /&gt;
              and or multiple computers. [ http://www.cfengine.org/ ]&lt;br /&gt;
&lt;br /&gt;
     The following is a quick example on downloading and installing cfengine.&lt;br /&gt;
&lt;br /&gt;
          $ ncftpget ftp://ftp.iu.hio.no/pub/cfengine/cfengine-2.1.15.tar.gz&lt;br /&gt;
          $ md5sum cfengine-2.1.15.tar.gz&lt;br /&gt;
          f03de82709f84c3d6d916b6e557321f9  cfengine-2.1.15.tar.gz&lt;br /&gt;
&lt;br /&gt;
          $ tar -xzf cfengine-2.1.15.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You need to have a current version of BerkeleyDB (http://downloads.sleepycat.com/db-4.3.28.tar.gz).&lt;br /&gt;
     Note that BerkeleyDB has a funny install. You cd to the &amp;quot;build_unix&amp;quot; directory, then,&lt;br /&gt;
&lt;br /&gt;
          Installing BerkeleyDB if needed:&lt;br /&gt;
                 $ wget http://downloads.sleepycat.com/db-4.3.28.tar.gz&lt;br /&gt;
                 $ tar -xzf db-4.3.28.tar.gz&lt;br /&gt;
                 $ cd db-4.3.28/build_unix/&lt;br /&gt;
                 $ ../dist/configure&lt;br /&gt;
                 make&lt;br /&gt;
                 make install&lt;br /&gt;
&lt;br /&gt;
     You also need a current version of OpenSSL. For instructions on how to install OpenSSL see&lt;br /&gt;
     (http://souptonuts.sourceforge.net/postfix_tutorial.html).&lt;br /&gt;
&lt;br /&gt;
     See (TIP 49) on putting &amp;quot;/usr/local/BerkeleyDB.4.3/lib&amp;quot; in the &amp;quot;/etc/ld.so.conf&amp;quot; file. Or&lt;br /&gt;
     once BerkeleyDB is installed, you can put the location on the command line as follows:&lt;br /&gt;
&lt;br /&gt;
     Configuring cfengine with direct reference to BerkeleyDB.4.3.  First cd to the cfengine source.&lt;br /&gt;
&lt;br /&gt;
          $ ./configure --with-berkeleydb=/usr/local/BerkeleyDB.4.3/lib&lt;br /&gt;
          $ make&lt;br /&gt;
          $ make install&lt;br /&gt;
&lt;br /&gt;
     Next create the following directories:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /var/cfengine/bin&lt;br /&gt;
          $ mkdir -p /var/cfengine/inputs&lt;br /&gt;
&lt;br /&gt;
     Copy needed files (cfagent, cfdoc, cfenvd, cfenvgraph, cfexecd, cfkey, cfrun, cfservd, cfshow):&lt;br /&gt;
&lt;br /&gt;
          $ cp /usr/local/sbin/cf* /var/cfengine/bin&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You'll also need to generate keys. As root, execute the following:&lt;br /&gt;
&lt;br /&gt;
          $ cfkey&lt;br /&gt;
&lt;br /&gt;
     The command above will write the public and private keys in&lt;br /&gt;
     &amp;quot;/var/cfengine/ppkeys&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You probably want (cfexecd, cfservd, and cfenvd) running on all servers. If you&lt;br /&gt;
     add the following to &amp;quot;/etc/rc.local&amp;quot; these daemons will start on reboot.&lt;br /&gt;
&lt;br /&gt;
           # Lines in /etc/rc.local&lt;br /&gt;
           /usr/local/sbin/cfexecd&lt;br /&gt;
           /usr/local/sbin/cfservd&lt;br /&gt;
           /usr/local/sbin/cfenvd&lt;br /&gt;
&lt;br /&gt;
     Also, make sure you run each command now as follows:&lt;br /&gt;
&lt;br /&gt;
          $ /usr/local/sbin/cfexecd&lt;br /&gt;
          $ /usr/local/sbin/cfservd&lt;br /&gt;
          $ /usr/local/sbin/cfenvd&lt;br /&gt;
&lt;br /&gt;
     Firewall settings must be adjusted to allows 5308 for tcp/udp. My local network&lt;br /&gt;
     is 192.168.1.0, so I'm opening it up for all my computers.&lt;br /&gt;
&lt;br /&gt;
          $ iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 5308 -j ACCEPT&lt;br /&gt;
          $ iptables -A INPUT -p tcp -s 192.168.1.0/24  --dport 5308 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
     A set of keys needs to be on the server and hosts. For example, my key on &amp;quot;tape.squeezel.com&amp;quot;&lt;br /&gt;
     should be copied over to the server &amp;quot;squeezel.squeezel.com&amp;quot; as follows:&lt;br /&gt;
&lt;br /&gt;
     This is done from tape.squeezel.com&lt;br /&gt;
&lt;br /&gt;
          $ scp /var/cfengine/ppkeys/localhost.pub  root@squeezel.squeezel.com:/var/cfengine/ppkeys/root-tape.squeezel.com.pub&lt;br /&gt;
          $ scp root@squeezel.squeezel.com:/var/cfengine/ppkeys/localhost.pub /var/cfengine/ppkeys/root-squeezel.squeezel.com.pub&lt;br /&gt;
&lt;br /&gt;
     Also, &amp;quot;/var/cfengine/inputs/cfrun.hosts&amp;quot; on the server &amp;quot;squeezel.squeezel.com&amp;quot; must contain&lt;br /&gt;
     all the computers that will get updated. This is &amp;quot;cfrun.hosts&amp;quot; on &amp;quot;squeezel.squeezel.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          closet.squeezel.com&lt;br /&gt;
          tape.squeezel.com&lt;br /&gt;
&lt;br /&gt;
     Once I'm done, from &amp;quot;tape.squeezel.com&amp;quot; I can run the following test:&lt;br /&gt;
&lt;br /&gt;
          $ cfrun squeezel.squeezel.com -v&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 166:&lt;br /&gt;
&lt;br /&gt;
     cfengine - a quick example. This example will be run as root. You create the file &amp;quot;cfagent.conf&amp;quot; in&lt;br /&gt;
     &amp;quot;/var/cfengine/inputs/&amp;quot;. The example below will checksum all the files in /home/chirico/deleteme/tripwire,&lt;br /&gt;
     it will also comment out the line &amp;quot;finger&amp;quot; in any file located in /tmp/testdir/stuff, also appending&lt;br /&gt;
     the command in this file &amp;quot; Edit change with cfengine&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          # /var/cfengine/inputs/cfagent.conf&lt;br /&gt;
          #&lt;br /&gt;
          # You run this with the following:&lt;br /&gt;
          #   cfagent -vK&lt;br /&gt;
        &lt;br /&gt;
          control:&lt;br /&gt;
                 actionsequence = ( files tidy editfiles )&lt;br /&gt;
                 ChecksumDatabase = ( /var/cfengine/cache.db )&lt;br /&gt;
                 # Below, true to update md5&lt;br /&gt;
                 ChecksumUpdates = ( true )&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
          files:&lt;br /&gt;
                 /home/chirico/deleteme/tripwire checksum=md5 recurse=inf&lt;br /&gt;
                 /home/chirico/deleteme/tripwire/moredata checksum=md5 recurse=inf&lt;br /&gt;
                 #/home/chirico/deleteme/tripwire/compress  recurse=inf include=*.txt acti on=compress&lt;br /&gt;
                   # If the database isn't secure, nothing is secure...&lt;br /&gt;
                 /var/cfengine/cache.db  mode=600 owner=root action=fixall&lt;br /&gt;
        &lt;br /&gt;
          tidy:&lt;br /&gt;
                 /home/chirico/deleteme/tripwire pattern=*~ recurse=inf age=0&lt;br /&gt;
                 # You must put an age. 0 runs now.&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
          editfiles:&lt;br /&gt;
        &lt;br /&gt;
                {  /tmp/testdir/stuff&lt;br /&gt;
&lt;br /&gt;
                   HashCommentLinesContaining &amp;quot;finger&amp;quot;&lt;br /&gt;
                   AppendIfNoSuchLine &amp;quot;# Edit Change with cfengine &amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     A few further notes on the above. The command &amp;quot;actionsequence = ( files tidy editfiles) tells the order&lt;br /&gt;
     of what to execute. The heading &amp;quot;tidy:&amp;quot; deletes files, and of course, &amp;quot;editfiles&amp;quot; does the editing of files.&lt;br /&gt;
&lt;br /&gt;
     To run the example, execute the following command. The  &amp;quot;-K&amp;quot; causes the lock file to be ignored.&lt;br /&gt;
&lt;br /&gt;
            $ cfagent -vK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 167:&lt;br /&gt;
&lt;br /&gt;
     Implementing Disk Quotas - a quick example that can easily be done on a live system for testing. There&lt;br /&gt;
     is no need to reboot, since you'll be creating a virtual filesystem.&lt;br /&gt;
&lt;br /&gt;
     Do the following as root. First create a mount point.&lt;br /&gt;
&lt;br /&gt;
            # mkdir -p /quota&lt;br /&gt;
&lt;br /&gt;
     Next, create 20M file. Since I have many of these files, I created a special directory &amp;quot;/usr/disk-img&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            # mkdir -p /usr/disk-img&lt;br /&gt;
            # dd if=/dev/zero of=/usr/disk-img/disk-quota.ext3 count=40960&lt;br /&gt;
&lt;br /&gt;
     The dd command above create a 20 MB file because, by default, dd uses a block size of 512 bytes. That makes&lt;br /&gt;
     the size: 40960*512=20971520.&lt;br /&gt;
&lt;br /&gt;
     Next, format this as an ext3 filesystem&lt;br /&gt;
&lt;br /&gt;
            # /sbin/mkfs -t ext3 -q /usr/disk-img/disk-quota.ext3 -F&lt;br /&gt;
&lt;br /&gt;
     Add the following line to &amp;quot;/etc/fstab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            /usr/disk-img/disk-quota.ext3    /quota ext3    rw,loop,usrquota,grpquota  0 0&lt;br /&gt;
&lt;br /&gt;
     Now, mount this filesystem&lt;br /&gt;
&lt;br /&gt;
            # mount /quota&lt;br /&gt;
&lt;br /&gt;
     Take a look at it:&lt;br /&gt;
&lt;br /&gt;
            # ls -l /quota&lt;br /&gt;
            lost+found&lt;br /&gt;
&lt;br /&gt;
     Now, run &amp;quot;quotacheck&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            # quotacheck -vug /quota&lt;br /&gt;
&lt;br /&gt;
     You'll get errors the first time this is run, because you have no quota files.&lt;br /&gt;
     But, run it a second time and you'll see something similiar to the following:&lt;br /&gt;
&lt;br /&gt;
            # quotacheck -vug /quota&lt;br /&gt;
            quotacheck: Scanning /dev/loop2 [/quota] done&lt;br /&gt;
            quotacheck: Checked 3 directories and 4 files&lt;br /&gt;
&lt;br /&gt;
     Now take a look at the files:&lt;br /&gt;
&lt;br /&gt;
            # ls -l /quota&lt;br /&gt;
            total 26&lt;br /&gt;
            -rw-------  1 root root  6144 Jun 14 12:23 aquota.group&lt;br /&gt;
            -rw-------  1 root root  6144 Jun 14 12:23 aquota.user&lt;br /&gt;
            drwx------  2 root root 12288 Jun 14 12:18 lost+found&lt;br /&gt;
&lt;br /&gt;
     Next use &amp;quot;edquota&amp;quot; to grant the user &amp;quot;chirico&amp;quot; a certain quota&lt;br /&gt;
&lt;br /&gt;
            # edquota -f /quota chirico&lt;br /&gt;
&lt;br /&gt;
     This will bring up a menu, and here I have edited so that user &amp;quot;chirico&amp;quot;&lt;br /&gt;
     has a soft limit of 120*512=61K, and a soft limit of 2 inodes and a hard limit of 5.&lt;br /&gt;
&lt;br /&gt;
             Disk quotas for user chirico (uid 500):&lt;br /&gt;
             Filesystem                   blocks       soft       hard     inodes     soft     hard&lt;br /&gt;
             /dev/loop2                        2        120        150         1        2         3&lt;br /&gt;
&lt;br /&gt;
     Next, turn quotas on with the following command:&lt;br /&gt;
&lt;br /&gt;
             $ quotaon /quota&lt;br /&gt;
&lt;br /&gt;
     If you need to turn off quotas, the command is &amp;quot;quotaoff -a&amp;quot; for all filesystems. You'll run into&lt;br /&gt;
     errors if you try to run quotacheck, say &amp;quot;quotacheck -avug&amp;quot; because this tries to unmount and mount&lt;br /&gt;
     the filesystem. You need to turn off quotas first &amp;quot;quotaoff /quota&amp;quot;. Note you only need to run&lt;br /&gt;
     quotacheck once, or when doing maintenance after a system crash.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      To get a report on the quote, runn &amp;quot;repquota&amp;quot; as follows:&lt;br /&gt;
&lt;br /&gt;
           $ repquota /quota&lt;br /&gt;
            *** Report for user quotas on device /dev/loop0&lt;br /&gt;
            Block grace time: 7days; Inode grace time: 7days&lt;br /&gt;
                                    Block limits                File limits&lt;br /&gt;
            User            used    soft    hard  grace    used  soft  hard  grace&lt;br /&gt;
            ----------------------------------------------------------------------&lt;br /&gt;
            root      --    1189       0       0              2     0     0&lt;br /&gt;
            chirico   -+      93       0       0              4     2     5  6days&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Note above that user &amp;quot;chirico&amp;quot; has used 4 on the file limits. This user has a hard&lt;br /&gt;
      limit of 5. So when this user tries to create 2 more files (bring this over the limit of 5)&lt;br /&gt;
      then he will get the following error as demonstrated below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           [chirico@squeezel chirico]$ touch one&lt;br /&gt;
           [chirico@squeezel chirico]$ touch two&lt;br /&gt;
           loop0: write failed, user file limit reached.&lt;br /&gt;
           touch: cannot touch `two': Disk quota exceeded&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Now, if repquota (run by root) is executed it shows the following:&lt;br /&gt;
&lt;br /&gt;
           $ repquota /quota&lt;br /&gt;
           *** Report for user quotas on device /dev/loop0&lt;br /&gt;
           Block grace time: 7days; Inode grace time: 7days&lt;br /&gt;
                                   Block limits                File limits&lt;br /&gt;
           User            used    soft    hard  grace    used  soft  hard  grace&lt;br /&gt;
           ----------------------------------------------------------------------&lt;br /&gt;
           root      --    1189       0       0              2     0     0&lt;br /&gt;
           chirico   -+      94       0       0              5     2     5  6days&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Note the &amp;quot;+&amp;quot; sign above. User &amp;quot;chirico&amp;quot; is above the File soft limits, and in this case&lt;br /&gt;
      above the hard limits.&lt;br /&gt;
&lt;br /&gt;
      To warn user by sending email to them, run &amp;quot;warnquota&amp;quot;, but you need check that&lt;br /&gt;
      &amp;quot;/etc/warnquota.conf&amp;quot; is setup correctly. For the example above, this file should&lt;br /&gt;
      look as follows:&lt;br /&gt;
&lt;br /&gt;
            $ cat /etc/quotatab&lt;br /&gt;
            #&lt;br /&gt;
            #  This is sample quotatab (/etc/quotatab)&lt;br /&gt;
            #  Here you can specify description of each device for user&lt;br /&gt;
            #&lt;br /&gt;
            #  Comments begin with hash in the beginning of the line&lt;br /&gt;
&lt;br /&gt;
            # Example of description&lt;br /&gt;
            /dev/loop0: This is loopback device&lt;br /&gt;
&lt;br /&gt;
      Just run the following as root:&lt;br /&gt;
&lt;br /&gt;
            $ warnquota&lt;br /&gt;
&lt;br /&gt;
      By the way, if you want to change the grace period, it can only be done on a filesystem&lt;br /&gt;
      basis. Not per user.&lt;br /&gt;
&lt;br /&gt;
            $  edquota -t&lt;br /&gt;
&lt;br /&gt;
      Users can run &amp;quot;quota&amp;quot; to see their usage as follows:&lt;br /&gt;
&lt;br /&gt;
            [chirico@squeezel ~]$ quota&lt;br /&gt;
            Disk quotas for user chirico (uid 500):&lt;br /&gt;
                 Filesystem  blocks   quota   limit   grace   files   quota   limit   grace&lt;br /&gt;
                 /dev/loop0      94       0       0               5      10      50&lt;br /&gt;
&lt;br /&gt;
      As you can see from above, I changed my inode limit to 50.&lt;br /&gt;
&lt;br /&gt;
      What about running this on the whole filesystem? Yes, below is an example where I'm running&lt;br /&gt;
      this on FC3, on the root of the filesystem &amp;quot;/&amp;quot;. This assumes that you have installed the&lt;br /&gt;
      quota package. Try doing &amp;quot;rpm -q quota&amp;quot; to see if this package is installed.&lt;br /&gt;
&lt;br /&gt;
        Step 1:&lt;br /&gt;
&lt;br /&gt;
           Check to make sure the quota software is installed. You can either do a &amp;quot;whereis quota&amp;quot;,&lt;br /&gt;
           or check for the rpm package.&lt;br /&gt;
&lt;br /&gt;
             $ whereis quota&lt;br /&gt;
             whereis quota&lt;br /&gt;
             quota: /usr/bin/quota /usr/share/man/man1/quota.1.gz&lt;br /&gt;
&lt;br /&gt;
           Checking for the rpm package.&lt;br /&gt;
&lt;br /&gt;
            $ rpm -q quota&lt;br /&gt;
            quota-3.12-5&lt;br /&gt;
&lt;br /&gt;
        Step 2:&lt;br /&gt;
&lt;br /&gt;
           Edit /etc/fstab and add usrquota and grpquota options for &amp;quot;/dev/VolGroup00/LogVol00&amp;quot;,&lt;br /&gt;
           which is shown on the first line below:&lt;br /&gt;
&lt;br /&gt;
             /dev/VolGroup00/LogVol00 /                      ext3    defaults,usrquota,grpquota        1 1&lt;br /&gt;
             LABEL=/boot             /boot                   ext3    defaults        1 2&lt;br /&gt;
             none                    /dev/pts                devpts  gid=5,mode=620  0 0&lt;br /&gt;
             none                    /dev/shm                tmpfs   defaults        0 0&lt;br /&gt;
             none                    /proc                   proc    defaults        0 0&lt;br /&gt;
             none                    /sys                    sysfs   defaults        0 0&lt;br /&gt;
             /dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0&lt;br /&gt;
&lt;br /&gt;
        Step 3:&lt;br /&gt;
&lt;br /&gt;
           Remount the filesystem as follows:&lt;br /&gt;
&lt;br /&gt;
             $ mount -o remount /&lt;br /&gt;
&lt;br /&gt;
        Step 4:&lt;br /&gt;
&lt;br /&gt;
           Run quotacheck with the &amp;quot;-m&amp;quot; option. Like the above statement, this will have to be run with&lt;br /&gt;
           root priviliges. This creates the quota database files, and it can take a long time if it is&lt;br /&gt;
           a large full filesystem.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             $ quotacheck -cugm /&lt;br /&gt;
&lt;br /&gt;
        Step 5:&lt;br /&gt;
&lt;br /&gt;
           This step is optional, but it's good to know if you need to recalculate quotas because of a&lt;br /&gt;
           system crash. It's demonstrated here, because at this point quota's have not been turned on.&lt;br /&gt;
           Again, note the &amp;quot;m&amp;quot; option below.&lt;br /&gt;
&lt;br /&gt;
             $ quotacheck -avumg&lt;br /&gt;
&lt;br /&gt;
        Step 6:&lt;br /&gt;
&lt;br /&gt;
           Set limits for specific users or groups using the &amp;quot;edquota&amp;quot; command. Shown below is the command&lt;br /&gt;
           to setup quotas for user &amp;quot;chirico&amp;quot;. Shown below this user has used 161560 blocks, he has a soft&lt;br /&gt;
           limit of 1161560 and a hard limit of 900000. He has used 3085 inodes and has a soft limit of 10000&lt;br /&gt;
           and a hard limit of 12000.&lt;br /&gt;
&lt;br /&gt;
             $ edquota -f / chirico&lt;br /&gt;
&lt;br /&gt;
             Disk quotas for user chirico (uid 500):&lt;br /&gt;
               Filesystem                   blocks       soft       hard     inodes     soft     hard&lt;br /&gt;
               /dev/mapper/VolGroup00-LogVol00     161560    1161560     900000       3085    10000    12000&lt;br /&gt;
&lt;br /&gt;
           You can put quotas on groups as well. The following is done as root. See (TIP 186 and TIP 6) for creating&lt;br /&gt;
           groups and adding users to groups.&lt;br /&gt;
&lt;br /&gt;
             $ edquota -g share&lt;br /&gt;
&lt;br /&gt;
           If you create a sharable directory for anyone in the group &amp;quot;share&amp;quot; (TIP 6), quota restrictions against&lt;br /&gt;
           group &amp;quot;share&amp;quot; will only apply to files added in the &amp;quot;/home/share&amp;quot; directory. When user &amp;quot;chirico&amp;quot; creates&lt;br /&gt;
           files in &amp;quot;/home/share&amp;quot; they also go against this user quota as well. However, when files are created in&lt;br /&gt;
           his home directory they do not go against the &amp;quot;share&amp;quot; group.&lt;br /&gt;
&lt;br /&gt;
           Note - if you get errors when trying to run &amp;quot;edquota -g share&amp;quot;, turn quotas off &amp;quot;quotaoff /&amp;quot; and&lt;br /&gt;
                  run &amp;quot;quotacheck -avugm&amp;quot;. Then, turn the quotas back on &amp;quot;quotaon /&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           You can see the status of the group quota with the following command:&lt;br /&gt;
&lt;br /&gt;
             $ quota -g share&lt;br /&gt;
&lt;br /&gt;
        Step 7:&lt;br /&gt;
&lt;br /&gt;
           Turn on quotas with the &amp;quot;qutoaon&amp;quot; command. This command needs to be done with root privileges.&lt;br /&gt;
&lt;br /&gt;
             $ quotaon /&lt;br /&gt;
&lt;br /&gt;
        Step 8:&lt;br /&gt;
&lt;br /&gt;
           Check &amp;quot;/etc/quotatab&amp;quot; file for the correct entries. Note that when you do the &amp;quot;mount&amp;quot; command&lt;br /&gt;
           the filesystem returned needs to match what is in the &amp;quot;quotatab&amp;quot; file. I have noticed that this&lt;br /&gt;
           is not the case by default.&lt;br /&gt;
&lt;br /&gt;
             $ mount&lt;br /&gt;
             /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw,usrquota,grpquota)&lt;br /&gt;
&lt;br /&gt;
           So the &amp;quot;/etc/quotatab&amp;quot; must contain the following line.&lt;br /&gt;
&lt;br /&gt;
             /dev/mapper/VolGroup00-LogVol00: This is the Volume group&lt;br /&gt;
&lt;br /&gt;
        Step 9:&lt;br /&gt;
&lt;br /&gt;
           Run &amp;quot;warnquota&amp;quot; as a check that the &amp;quot;/etc/quotatab&amp;quot; files is setup correctly.&lt;br /&gt;
&lt;br /&gt;
              $ warnquota&lt;br /&gt;
&lt;br /&gt;
        Step 10:&lt;br /&gt;
&lt;br /&gt;
           Setup a daily cron job for running &amp;quot;warnquota&amp;quot;. The following should be placed&lt;br /&gt;
           in &amp;quot;/etc/cron.daily&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              #!/bin/sh&lt;br /&gt;
              # Place this file in /etc/cron.daily&lt;br /&gt;
              # with rights 0755&lt;br /&gt;
              /usr/sbin/warnquota&lt;br /&gt;
              EXITVALUE=$?&lt;br /&gt;
              if [ $EXITVALUE != 0 ]; then&lt;br /&gt;
                 /usr/bin/logger -t warnquota &amp;quot;ALERT exited abnormally with [$EXITVALUE]&amp;quot;&lt;br /&gt;
              fi&lt;br /&gt;
              exit 0&lt;br /&gt;
&lt;br /&gt;
      References:&lt;br /&gt;
        http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/sysadmin-guide/ch-disk-quotas.html&lt;br /&gt;
        (TIP 6, TIP 186, and TIP 205)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 168:&lt;br /&gt;
&lt;br /&gt;
     rdist - remote file distribution client program. You can use this program in combination with&lt;br /&gt;
     ssh. This program does more than just copy files. Once a file has been copied, you can dictate&lt;br /&gt;
     other actions to be performed. Or you can hold off copying all together if the destination is&lt;br /&gt;
     running low on inodes, or disk space.&lt;br /&gt;
&lt;br /&gt;
     For the purpose of this example, all commands will been run on &amp;quot;squeezel.squeezel.com&amp;quot;, and the&lt;br /&gt;
     computers that will be updated are &amp;quot;tape.squeezel.com&amp;quot; and &amp;quot;closet.squeezel.com&amp;quot;. Obviously, you&lt;br /&gt;
     would substitute your computer names.&lt;br /&gt;
&lt;br /&gt;
     It helps to setup ssh keys on each computer first. Reference [http://souptonuts.sourceforge.net/sshtips.htm]&lt;br /&gt;
     and (TIP 12).&lt;br /&gt;
&lt;br /&gt;
     Step 1: Create the Configuration file myDistfile&lt;br /&gt;
&lt;br /&gt;
       Below is my sample &amp;quot;myDistfile&amp;quot;. This file will access hosts &amp;quot;tape.squeezel.com&amp;quot; using username chirico&lt;br /&gt;
       and &amp;quot;closet.squeezel.com&amp;quot; with the username running this command, and copy the&lt;br /&gt;
       files &amp;quot;/home/chirico/file1&amp;quot; and &amp;quot;/home/chirico/file2&amp;quot; to the these two servers creating the&lt;br /&gt;
       directory ~/tmpdir if it doesn't exist. Once these files are updated, a mail check (&amp;quot;sendmail -bv&amp;quot;)&lt;br /&gt;
       will be performed, and mail will be sent to &amp;quot;chirico@squeezel&amp;quot;. This happens twice, once for each file.&lt;br /&gt;
&lt;br /&gt;
       Note, the line &amp;quot;/home/chirico/file2 -&amp;gt; tape.squeezel.com&amp;quot; which moves the file &amp;quot;file2&amp;quot; to&lt;br /&gt;
       tape.squeezel.com renaming the file to &amp;quot;tapedest&amp;quot; in the directory &amp;quot;/home/chirico&amp;quot;. Once this file&lt;br /&gt;
       is copied, the rights are modified to &amp;quot;chmod +r&amp;quot;.  Likewise, &amp;quot;/home/chirico/file2 -&amp;gt; closet.squeezel.com&amp;quot;&lt;br /&gt;
       copies the file file2, which is renamed as closetdest.&lt;br /&gt;
&lt;br /&gt;
                 # Contents of myDistfile&lt;br /&gt;
                 HOSTS = ( chirico@tape.squeezel.com closet.squeezel.com )&lt;br /&gt;
&lt;br /&gt;
                 FILES = ( /home/chirico/file1 /home/chirico/file2 )&lt;br /&gt;
&lt;br /&gt;
                 ${FILES} -&amp;gt; ${HOSTS}&lt;br /&gt;
                    # Directory tmpdir will be created if it doesn't exist&lt;br /&gt;
                    install tmpdir ;&lt;br /&gt;
                    special /home/chirico/file1  &amp;quot;/usr/sbin/sendmail -bv mchirico@gmail.com&amp;quot;;&lt;br /&gt;
                    notify chirico@squeezel;&lt;br /&gt;
&lt;br /&gt;
                 /home/chirico/file2 -&amp;gt; tape.squeezel.com&lt;br /&gt;
                    install  /home/chirico/tapedest;&lt;br /&gt;
                    special  /home/chirico/tapedest &amp;quot;chmod +r /home/chirico/tapedest&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
                 /home/chirico/file2 -&amp;gt; closet.squeezel.com&lt;br /&gt;
                    install /home/chirico/closetdest;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 2: Command from squeezel.squeezel.com to run myDistfile above&lt;br /&gt;
&lt;br /&gt;
       Below is the command that will execute the contents in &amp;quot;myDistfile&amp;quot;. This command is run from the&lt;br /&gt;
       computer &amp;quot;squeezel.squeezel.com&amp;quot;. All output will go in the file &amp;quot;cmd1rdist.log&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ rdist -P /usr/local/bin/ssh -f ./myDistfile -l file=./cmd1rdist.log=all&lt;br /&gt;
&lt;br /&gt;
       Obviously you want a secure copy (using scp), so the -P option uses ssh as your secure&lt;br /&gt;
       transport mechanism.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 169:&lt;br /&gt;
&lt;br /&gt;
     Restricting root logins (/etc/securetty). ctl-alt-F4 will give you a prompt for tty3. Note&lt;br /&gt;
     that it is one number less. Take a look at the contents of &amp;quot;/etc/securetty&amp;quot;. To prevent&lt;br /&gt;
     root from logging in on this device, take out tty3 from this listing. Note, you can always&lt;br /&gt;
     login as another user, then, su to root.  Below is an example of the default&lt;br /&gt;
     &amp;quot;/etc/securetty&amp;quot; that allows root to login to everything.&lt;br /&gt;
&lt;br /&gt;
         [root@squeezel ~]# cat /etc/securetty&lt;br /&gt;
         console&lt;br /&gt;
         vc/1&lt;br /&gt;
         vc/2&lt;br /&gt;
         vc/3&lt;br /&gt;
         vc/4&lt;br /&gt;
         vc/5&lt;br /&gt;
         vc/6&lt;br /&gt;
         vc/7&lt;br /&gt;
         vc/8&lt;br /&gt;
         vc/9&lt;br /&gt;
         vc/10&lt;br /&gt;
         vc/11&lt;br /&gt;
         tty1&lt;br /&gt;
         tty2&lt;br /&gt;
         tty3&lt;br /&gt;
         tty4&lt;br /&gt;
         tty5&lt;br /&gt;
         tty6&lt;br /&gt;
         tty7&lt;br /&gt;
         tty8&lt;br /&gt;
         tty9&lt;br /&gt;
         tty10&lt;br /&gt;
         tty11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 170:&lt;br /&gt;
&lt;br /&gt;
     Perl map function. Try the following to get a quick take on this function,&lt;br /&gt;
     which increments each value in the array a;&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map {$_++} @a;&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot; } @a;&lt;br /&gt;
&lt;br /&gt;
     or&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     And you can easily make modifications, like reversing the order&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     Plus there is a grep() function that works on each element as well&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse grep{ $_ &amp;gt; 3} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     To get only odd numbers in reverse order:&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse grep{ !($_ % 2)} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference: http://www-128.ibm.com/developerworks/linux/library/l-road4.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 171:&lt;br /&gt;
&lt;br /&gt;
     Perl - subroutine call and shifting through variables. A simple and useful&lt;br /&gt;
     technique.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          sub test {&lt;br /&gt;
            local $mval;&lt;br /&gt;
            while( $mval = shift ) {&lt;br /&gt;
              print &amp;quot; $mval\n&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          test(&amp;quot;one&amp;quot;,&amp;quot;two&amp;quot;,&amp;quot;three&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 172:&lt;br /&gt;
&lt;br /&gt;
     Tcp wrappers - First &amp;quot;/etc/hosts.allow&amp;quot; is check, and if there is an entry in this file, no more&lt;br /&gt;
     checking it done.  If are no matches in &amp;quot;/etc/hosts.allow&amp;quot;, the &amp;quot;/etc/hosts.deny&amp;quot; file is checked&lt;br /&gt;
     and if a match is found, that service is blocked for that host.&lt;br /&gt;
&lt;br /&gt;
     Example &amp;quot;/etc/hosts.deny&amp;quot; file:&lt;br /&gt;
&lt;br /&gt;
         sshd: 192.168.1.171&lt;br /&gt;
&lt;br /&gt;
     The above file blocks access to computer 192.168.1.171. It's also possible to run commands when&lt;br /&gt;
     someone from this computer tries to ssh in. This example sends mail.&lt;br /&gt;
&lt;br /&gt;
         sshd: 192.168.1.171: spawn (echo -e &amp;quot;%d %h %H %u&amp;quot;| /bin/mail -s 'hosts.deny entry' root)&lt;br /&gt;
&lt;br /&gt;
     Of course, you can also run commands in the &amp;quot;/etc/hosts.allow&amp;quot; if you wanted mail sent for a successful&lt;br /&gt;
     login.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 173:&lt;br /&gt;
&lt;br /&gt;
     pgrep, pkill - look up or signal process based on name and other attributes.&lt;br /&gt;
&lt;br /&gt;
     To quick find all instances of ssh running, for user root, execute the following&lt;br /&gt;
     command:&lt;br /&gt;
&lt;br /&gt;
           $ pgrep -u root -l ssh&lt;br /&gt;
&lt;br /&gt;
     To kill a process, or send a signal use the &amp;quot;pkill&amp;quot; option. For example, to&lt;br /&gt;
     make syslog reread its configuration file:&lt;br /&gt;
&lt;br /&gt;
           $ pkill -HUP syslogd&lt;br /&gt;
&lt;br /&gt;
     Another command command is &amp;quot;pidof&amp;quot; that can tell you how many processes are running.&lt;br /&gt;
     This can be useful for detecting DOS attacks.&lt;br /&gt;
&lt;br /&gt;
           $ pidof sshd&lt;br /&gt;
           4783 4781 30008 30006 29888 29886 2246&lt;br /&gt;
&lt;br /&gt;
     Above there are 7 sshd's running. Reference &amp;quot;Tcpdump, Raw Socket and Libpap Tutorial&amp;quot;&lt;br /&gt;
     at [http://souptonuts.sourceforge.net/tcpdump_tutorial.html].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 174:&lt;br /&gt;
&lt;br /&gt;
     Password Cracking - tools to check your users passwords:&lt;br /&gt;
&lt;br /&gt;
      John The Ripper&lt;br /&gt;
        http://www.openwall.com/john/&lt;br /&gt;
&lt;br /&gt;
      Crack&lt;br /&gt;
        http://www.crypticide.com/users/alecm/&lt;br /&gt;
&lt;br /&gt;
      Slurpie&lt;br /&gt;
        http://www.ussrback.com/distributed.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 175:&lt;br /&gt;
&lt;br /&gt;
     Password Aging - setting the number of days a password is valid.&lt;br /&gt;
&lt;br /&gt;
         $ chage -M 90 &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 176:&lt;br /&gt;
&lt;br /&gt;
     Kernel Performance Tuning - /Documentation/sysctl/vm.txt documents kernel settings to&lt;br /&gt;
     improve performance. Below are some examples.&lt;br /&gt;
&lt;br /&gt;
       overcommit_memory:  0 -- default estimates the amount of memory for malloc&lt;br /&gt;
                           1 -- kernel pretends there is always enough memory until it runs out&lt;br /&gt;
                           3 -- never overcommit&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/overcommit_memory&lt;br /&gt;
          0&lt;br /&gt;
&lt;br /&gt;
       page-cluster:&lt;br /&gt;
            The Linux VM subsystem avoids excessive disk seeks by reading&lt;br /&gt;
            multiple pages on a page fault. The number of pages it reads&lt;br /&gt;
            is dependent on the amount of memory in your machine.&lt;br /&gt;
        &lt;br /&gt;
            The number of pages the kernel reads in at once is equal to&lt;br /&gt;
            2 ^ page-cluster. Values above 2 ^ 5 don't make much sense&lt;br /&gt;
            for swap because we only cluster swap data in 32-page groups.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/page-cluster&lt;br /&gt;
          3&lt;br /&gt;
&lt;br /&gt;
       min_free_kbytes:&lt;br /&gt;
            This is used to force the Linux VM to keep a minimum number&lt;br /&gt;
            of kilobytes free.  The VM uses this number to compute a pages_min&lt;br /&gt;
            value for each lowmem zone in the system.  Each lowmem zone gets&lt;br /&gt;
            a number of reserved free pages based proportionally on its size.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/min_free_kbytes&lt;br /&gt;
          3831&lt;br /&gt;
&lt;br /&gt;
       max_map_count:&lt;br /&gt;
            This file contains the maximum number of memory map areas a process&lt;br /&gt;
            may have. Memory map areas are used as a side-effect of calling&lt;br /&gt;
            malloc, directly by mmap and mprotect, and also when loading shared&lt;br /&gt;
            libraries.&lt;br /&gt;
&lt;br /&gt;
            While most applications need less than a thousand maps, certain&lt;br /&gt;
            programs, particularly malloc debuggers, may consume lots of them,&lt;br /&gt;
            e.g., up to one or two maps per allocation.&lt;br /&gt;
&lt;br /&gt;
            The default value is 65536.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/max_map_count&lt;br /&gt;
          65536&lt;br /&gt;
&lt;br /&gt;
        Also see http://people.redhat.com/alikins/system_tuning.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 177:&lt;br /&gt;
&lt;br /&gt;
     IO Scheduler - /Documentation/block/as-iosched.txt documents kernel settings for disk&lt;br /&gt;
     performance.&lt;br /&gt;
&lt;br /&gt;
     If you're not sure what partitions you have &amp;quot;$ cat /proc/partitions&amp;quot;. This example&lt;br /&gt;
     assumes hda, and you can see some of the kernel settings:&lt;br /&gt;
&lt;br /&gt;
          $ ls /sys/block/hda/queue/iosched&lt;br /&gt;
          back_seek_max  back_seek_penalty  clear_elapsed  fifo_batch_expire  fifo_expire_async&lt;br /&gt;
           fifo_expire_sync  find_best_crq  key_type  quantum  queued&lt;br /&gt;
&lt;br /&gt;
     References: http://lwn.net/Articles/102505/&lt;br /&gt;
                 http://bhhdoa.org.au/pipermail/ck/2004-September/000961.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 178:&lt;br /&gt;
&lt;br /&gt;
     iozone -- getting data on disk performance (http://www.iozone.org/). This is a very&lt;br /&gt;
     comprehensive package.&lt;br /&gt;
&lt;br /&gt;
           $ wget http://www.iozone.org/src/current/iozone3_242.tar&lt;br /&gt;
           $ tar -xf iozone3_242.tar&lt;br /&gt;
           $ cd iozone3_242/src/current&lt;br /&gt;
           $ make linux&lt;br /&gt;
&lt;br /&gt;
     At this point you should read the documentation. There is no &amp;quot;make install&amp;quot;. You&lt;br /&gt;
     copy it to each filesystem you want to run this program on. Below are some quick&lt;br /&gt;
     start commands.&lt;br /&gt;
&lt;br /&gt;
       Good comprehensive test.&lt;br /&gt;
&lt;br /&gt;
           $ iozone -a&lt;br /&gt;
&lt;br /&gt;
       I prefer this for small filesystems. It limits the record size to 10000 and does&lt;br /&gt;
       the output in operations per second (higher numbers mean faster drive).&lt;br /&gt;
&lt;br /&gt;
           $ ./iozone -a -s 10000 -O&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 179:&lt;br /&gt;
&lt;br /&gt;
     history - bash command to get a history of all commands typed. But, here is a way&lt;br /&gt;
     that you can get date and time listed as well.&lt;br /&gt;
&lt;br /&gt;
           $ HISTTIMEFORMAT=&amp;quot;%y/%m/%d %T &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Defining the environment variable above give you the date/time info when you&lt;br /&gt;
     execute history:&lt;br /&gt;
&lt;br /&gt;
           $ history&lt;br /&gt;
              ...&lt;br /&gt;
               175  05/06/30 12:51:46 grep '141.162.' mout &amp;gt; mout2&lt;br /&gt;
               176  05/06/30 12:51:48 e mout2&lt;br /&gt;
               177  05/06/30 12:56:59 ls&lt;br /&gt;
               178  05/06/30 12:57:02 ls&lt;br /&gt;
               179  05/06/30 12:57:39 ls&lt;br /&gt;
               180  05/06/30 12:57:49 ls -l&lt;br /&gt;
               181  05/06/30 13:01:10 history&lt;br /&gt;
               182  05/06/30 13:01:20 HISTTIMEFORMAT=&amp;quot;%y/%m/%d %T &amp;quot;&lt;br /&gt;
               183  05/06/30 13:01:23 history&lt;br /&gt;
              ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 180:&lt;br /&gt;
&lt;br /&gt;
     .config - Fedora Core getting the .config to rebuild the kernel. You can find&lt;br /&gt;
     this file, the &amp;quot;.config&amp;quot; file at the following location:&lt;br /&gt;
&lt;br /&gt;
          $ ls &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Or, to see the contents&lt;br /&gt;
&lt;br /&gt;
          $ cat &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     This can be important, if you're planning to build your own kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 181:&lt;br /&gt;
&lt;br /&gt;
     Listing control key settings.&lt;br /&gt;
&lt;br /&gt;
          $ stty -a&lt;br /&gt;
          speed 38400 baud; rows 0; columns 0; line = 0;&lt;br /&gt;
          intr = ^C; quit = ^\; erase = &amp;lt;undef&amp;gt;; kill = &amp;lt;undef&amp;gt;; eof = ^D; eol = &amp;lt;undef&amp;gt;; eol2 = &amp;lt;undef&amp;gt;; start = ^Q;&lt;br /&gt;
          stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;&lt;br /&gt;
          -parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts&lt;br /&gt;
          -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel&lt;br /&gt;
          opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0&lt;br /&gt;
          isig icanon iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 182:&lt;br /&gt;
&lt;br /&gt;
     iptables DNAT and SNAT. You have a webserver on 192.168.1.71. When people query this webserver, you want them&lt;br /&gt;
     to goto 192.168.1.81, with no indication that they are going to another web server. In fact, they always make&lt;br /&gt;
     their web hits to 192.168.1.71.&lt;br /&gt;
&lt;br /&gt;
     The following is the iptables commands:&lt;br /&gt;
&lt;br /&gt;
        $ echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
        $ iptables -t nat -A PREROUTING -d 192.168.1.71 -p tcp --dport 80 -j DNAT --to 192.168.1.81&lt;br /&gt;
        $ iptables -t nat -A POSTROUTING -d 192.168.1.81 -s 192.168.1.0/24 -p tcp --dport 80 -j SNAT --to 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
     Change 192.168.1.0/24 to whatever source you expect the web browser to come in on. Below is the tcpdump showing&lt;br /&gt;
     all traffic is relayed via 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
         [root@closet iptables]# tcpdump -nN port 80&lt;br /&gt;
&lt;br /&gt;
         17:34:58.790398 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: S 3620106373:3620106373(0) win 16384 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790465 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: S 3620106373:3620106373(0) win 16384 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790703 IP 192.168.1.81.80 &amp;gt; 192.168.1.71.1158: S 1973665156:1973665156(0) ack 3620106374 win 5840 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790720 IP 192.168.1.71.80 &amp;gt; 192.168.1.102.1158: S 1973665156:1973665156(0) ack 3620106374 win 5840 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790951 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: . ack 1 win 17520&lt;br /&gt;
         17:34:58.790965 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: . ack 1 win 17520&lt;br /&gt;
         17:34:58.791451 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: P 1:327(326) ack 1 win 17520&lt;br /&gt;
         17:34:58.791472 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: P 1:327(326) ack 1 win 17520&lt;br /&gt;
         17:34:58.791973 IP 192.168.1.81.80 &amp;gt; 192.168.1.71.1158: . ack 327 win 6432&lt;br /&gt;
&lt;br /&gt;
     Above the web client is on &amp;quot;192.168.1.102&amp;quot;. You can see that the 1st server &amp;quot;192.168.1.71&amp;quot; then goes out to&lt;br /&gt;
     the 2nd server &amp;quot;192.168.1.81&amp;quot; on the second line. The third line shows the 2nd server &amp;quot;192.168.1.81&amp;quot; responding to&lt;br /&gt;
     the 1st server, and the forth line passes this data back to the web client &amp;quot;192.168.1.102&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Note: You can save your current iptables setting with the following command:&lt;br /&gt;
&lt;br /&gt;
         $ iptables-save &amp;gt; iptables_store&lt;br /&gt;
&lt;br /&gt;
       The big advantage is that you can store the counters as well.&lt;br /&gt;
&lt;br /&gt;
         $ iptables-save -c &amp;gt; iptables_store_w_cnts&lt;br /&gt;
&lt;br /&gt;
       To restore the file, use the following:&lt;br /&gt;
&lt;br /&gt;
         $ iptables-restore -c &amp;lt; iptables_store_w_cnts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 183:&lt;br /&gt;
&lt;br /&gt;
     mailstats - display mail statistics. This file reads data from &amp;quot;/var/log/mail/statistics&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         [root@closet ~]# mailstats&lt;br /&gt;
         Statistics from Sat Jun 25 15:59:52 2005&lt;br /&gt;
          M   msgsfr  bytes_from   msgsto    bytes_to  msgsrej msgsdis msgsqur  Mailer&lt;br /&gt;
          4        1          2K        0          0K        0       0       0  esmtp&lt;br /&gt;
          9        0          0K        1          2K        0       0       0  local&lt;br /&gt;
         =====================================================================&lt;br /&gt;
          T        1          2K        1          2K        0       0       0&lt;br /&gt;
          C        1                    0                    0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 184:&lt;br /&gt;
&lt;br /&gt;
     Profiling C Applications - Assume you have the following program p1.c:&lt;br /&gt;
&lt;br /&gt;
         /* Program  p1.c */&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
         t1(int i)&lt;br /&gt;
         {&lt;br /&gt;
                 printf(&amp;quot;t1:%d\n&amp;quot;, i);&lt;br /&gt;
         }&lt;br /&gt;
        &lt;br /&gt;
         t2(int j)&lt;br /&gt;
         {&lt;br /&gt;
                 printf(&amp;quot;t2:%d\n&amp;quot;, j);&lt;br /&gt;
         }&lt;br /&gt;
        &lt;br /&gt;
         int main(void)&lt;br /&gt;
         {&lt;br /&gt;
                 int i, j;&lt;br /&gt;
        &lt;br /&gt;
                 for (i = 0; i &amp;lt; 5; ++i) {&lt;br /&gt;
                         t1(i);&lt;br /&gt;
                         for (j = 0; j &amp;lt; 2; ++j) {&lt;br /&gt;
                                 t2(j);&lt;br /&gt;
                         }&lt;br /&gt;
                 }&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
     Compile the program as follows:&lt;br /&gt;
&lt;br /&gt;
        $ gcc -pg -g -o p1 p1.c&lt;br /&gt;
        $ ./p1&lt;br /&gt;
        t1:0&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:1&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:2&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:3&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:4&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
&lt;br /&gt;
     Next, to get the profile graph.&lt;br /&gt;
&lt;br /&gt;
        $ gprof -p -b p1&lt;br /&gt;
        Flat profile:&lt;br /&gt;
        &lt;br /&gt;
        Each sample counts as 0.01 seconds.&lt;br /&gt;
         no time accumulated&lt;br /&gt;
        &lt;br /&gt;
          %   cumulative   self              self     total&lt;br /&gt;
         time   seconds   seconds    calls  Ts/call  Ts/call  name&lt;br /&gt;
          0.00      0.00     0.00       10     0.00     0.00  t2&lt;br /&gt;
          0.00      0.00     0.00        5     0.00     0.00  t1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Above note the 10 calls to t2 and 5 calls to t1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 185:&lt;br /&gt;
&lt;br /&gt;
     CDPATH - this is a bash variable like PATH that defines a search path&lt;br /&gt;
              for the cd command.&lt;br /&gt;
&lt;br /&gt;
     Suppose you have the following directory structure:&lt;br /&gt;
&lt;br /&gt;
             /home/chirico/stuff&lt;br /&gt;
                               |-- dirA&lt;br /&gt;
                               `-- dirB&lt;br /&gt;
&lt;br /&gt;
     Assume you define CDPATH as follows:&lt;br /&gt;
&lt;br /&gt;
             CDPATH=/home/chirico/stuff&lt;br /&gt;
&lt;br /&gt;
     Now, no matter what directory you are in if you use the cd command below&lt;br /&gt;
     you will automatically move to &amp;quot;/home/chirico/stuff/dirA&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             $ cd dirA&lt;br /&gt;
&lt;br /&gt;
     Note you could be in &amp;quot;/etc&amp;quot; and will move directly to &amp;quot;/home/chirico/stuff/dirA&amp;quot;.&lt;br /&gt;
     This command has the same format as PATH - multiple entries are separated by a colon.&lt;br /&gt;
     If the current directory contain a sub-directory dirA, then, it gets priority.&lt;br /&gt;
&lt;br /&gt;
     The following is part of my .bash_profile&lt;br /&gt;
&lt;br /&gt;
             CDPATH=/work/cpearls/src/posted_on_sf/:/work/souptonuts/documentation/:/home/chirico/deleteme/&lt;br /&gt;
             export PATH CVS_RSH EDITOR JAVA_HOME CDPATH&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 186:&lt;br /&gt;
&lt;br /&gt;
     Groups - add groups and users to groups. The following shows how to create the group &amp;quot;share&amp;quot;&lt;br /&gt;
              and add the user &amp;quot;chirico&amp;quot; to this group. The following should be done as root, and&lt;br /&gt;
              assumes the account &amp;quot;chirico&amp;quot; already exits.&lt;br /&gt;
&lt;br /&gt;
             $ groupadd share&lt;br /&gt;
             $ usermod -G share chirico&lt;br /&gt;
&lt;br /&gt;
     Note the change made to &amp;quot;/etc/group&amp;quot; below:&lt;br /&gt;
&lt;br /&gt;
             $ cat /etc/group|grep 'share'&lt;br /&gt;
             share:x:616:chirico&lt;br /&gt;
&lt;br /&gt;
     If the user chirico is currently logged in, he should run the following&lt;br /&gt;
     command to immediately have group &amp;quot;share&amp;quot; rights. Or, the next time he logs&lt;br /&gt;
     in he will have access to this group.&lt;br /&gt;
&lt;br /&gt;
             $ newgrp share&lt;br /&gt;
&lt;br /&gt;
     Reference the following (TIP 6, TIP 167).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 187:&lt;br /&gt;
&lt;br /&gt;
     oprofile - steps for running oprofile on Fedora.&lt;br /&gt;
&lt;br /&gt;
     Step 1:&lt;br /&gt;
&lt;br /&gt;
       Find out what version of the kernel you are running.&lt;br /&gt;
&lt;br /&gt;
           $ uname -a&lt;br /&gt;
           Linux closet.squeezel.com 2.6.12-1.1398_FC4 #1 Fri Jul 15 00:52:32 EDT 2005 i686 i686 i386 GNU/Linux&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 2:&lt;br /&gt;
&lt;br /&gt;
       Download the source in a chosen directory. Above, I'm running 2.6.12-1, but I'm going to go for 2.6.12.3, since&lt;br /&gt;
       it's a little later. You want the signed file as well.&lt;br /&gt;
&lt;br /&gt;
           $ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.12.3.tar.gz&lt;br /&gt;
           $ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.12.3.tar.gz.sign&lt;br /&gt;
&lt;br /&gt;
       Now, check the signature.&lt;br /&gt;
&lt;br /&gt;
           $ gpg --verify linux-2.6.12.3.tar.gz.sign linux-2.6.12.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 3:&lt;br /&gt;
&lt;br /&gt;
       Unpack the file.&lt;br /&gt;
&lt;br /&gt;
           $ tar -xzf linux-2.6.12.3.tar.gz&lt;br /&gt;
           $ cd cd linux-2.6.12.3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 4:&lt;br /&gt;
&lt;br /&gt;
       Copy the &amp;quot;.config&amp;quot; used to compile your previous kernel. You should find it&lt;br /&gt;
       in the following direcotry &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       Copy it to the linux-2.6.12.3 directory.&lt;br /&gt;
&lt;br /&gt;
           $ cp &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot; .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 5:&lt;br /&gt;
&lt;br /&gt;
       Run make as follows. It will ask for a few questions on &amp;quot;make oldconfig&amp;quot;. The&lt;br /&gt;
       make installs below will have to be done with root privileges.&lt;br /&gt;
&lt;br /&gt;
          $ make oldconfig&lt;br /&gt;
          $ make bzImage&lt;br /&gt;
          $ make modules&lt;br /&gt;
          $ make modules_install&lt;br /&gt;
          $ make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 6:&lt;br /&gt;
&lt;br /&gt;
       Edit the &amp;quot;/boot/grub/grub.conf&amp;quot; and set default = 0  as shown below in this&lt;br /&gt;
       file.&lt;br /&gt;
&lt;br /&gt;
            default=0&lt;br /&gt;
            timeout=5&lt;br /&gt;
            splashimage=(hd0,2)/grub/splash.xpm.gz&lt;br /&gt;
            hiddenmenu&lt;br /&gt;
            title Fedora Core (2.6.12.3)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.12.3 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.12.3.img&lt;br /&gt;
            title Fedora Core (2.6.12-1.1398_FC4)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.12-1.1398_FC4 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.12-1.1398_FC4.img&lt;br /&gt;
            title Fedora Core (2.6.11-1.1369_FC4)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.11-1.1369_FC4 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.11-1.1369_FC4.img&lt;br /&gt;
            title Other&lt;br /&gt;
                    rootnoverify (hd0,1)&lt;br /&gt;
                    chainloader +1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 7:&lt;br /&gt;
&lt;br /&gt;
       Shutdown with the restart option.&lt;br /&gt;
&lt;br /&gt;
           $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 8:&lt;br /&gt;
&lt;br /&gt;
       Run opcontrol. The commands below are done as root.  My kernel was compiled in the following&lt;br /&gt;
       directory &amp;quot;/home/kernel/linux-2.6.12.3/&amp;quot;, so I'll run opcontrol as follows:&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --vmlinux=/home/kernel/linux-2.6.12.3/vmlinux&lt;br /&gt;
&lt;br /&gt;
       Now start.&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --start&lt;br /&gt;
           Using 2.6+ OProfile kernel interface.&lt;br /&gt;
           Reading module info.&lt;br /&gt;
           Using log file /var/lib/oprofile/oprofiled.log&lt;br /&gt;
           Daemon started.&lt;br /&gt;
           Profiler running.&lt;br /&gt;
&lt;br /&gt;
       Shutdown opcontrol.&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --shutdown&lt;br /&gt;
&lt;br /&gt;
       Run report.&lt;br /&gt;
&lt;br /&gt;
           $ opreport&lt;br /&gt;
&lt;br /&gt;
           CPU: CPU with timer interrupt, speed 0 MHz (estimated)&lt;br /&gt;
           Profiling through timer interrupt&lt;br /&gt;
                     TIMER:0|&lt;br /&gt;
             samples|      %|&lt;br /&gt;
           ------------------&lt;br /&gt;
              156088 99.8746 vmlinux&lt;br /&gt;
                  60  0.0384 libc-2.3.5.so&lt;br /&gt;
                  30  0.0192 oprofiled&lt;br /&gt;
                  23  0.0147 libcrypto.so.0.9.7f&lt;br /&gt;
                  13  0.0083 bash&lt;br /&gt;
                  12  0.0077 screen&lt;br /&gt;
                  10  0.0064 sshd&lt;br /&gt;
                   9  0.0058 ssh&lt;br /&gt;
                   6  0.0038 ip_tables&lt;br /&gt;
                   6  0.0038 libncurses.so.5.4&lt;br /&gt;
                   5  0.0032 b44&lt;br /&gt;
                   5  0.0032 ext3&lt;br /&gt;
                   5  0.0032 ld-2.3.5.so&lt;br /&gt;
                   4  0.0026 ip_conntrack&lt;br /&gt;
                   4  0.0026 jbd&lt;br /&gt;
                   2  0.0013 grep&lt;br /&gt;
                   1 6.4e-04 libdns.so.20.0.2&lt;br /&gt;
                   1 6.4e-04 libisc.so.9.1.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Reference the following for more documentation:&lt;br /&gt;
             http://oprofile.sourceforge.net/doc/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 188:&lt;br /&gt;
&lt;br /&gt;
     cyrus-imapd with Postfix using sasldb for authentication. For this example&lt;br /&gt;
     the server is tape.squeezel.com and the user is chirico.&lt;br /&gt;
&lt;br /&gt;
        Step 1:&lt;br /&gt;
        &lt;br /&gt;
                   $ yum install cyrus-imapd&lt;br /&gt;
                   $ yum install cyrus-imapd-utils&lt;br /&gt;
        &lt;br /&gt;
            You need &amp;quot;cyrus-imapd-utils&amp;quot; for cyradm.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 2:&lt;br /&gt;
        &lt;br /&gt;
          Edit /etc/imapd.conf&lt;br /&gt;
        &lt;br /&gt;
               configdirectory: /var/lib/imap&lt;br /&gt;
               partition-default: /var/spool/imap&lt;br /&gt;
               admins: cyrus&lt;br /&gt;
               sievedir: /var/lib/imap/sieve&lt;br /&gt;
               sendmail: /usr/sbin/sendmail&lt;br /&gt;
               hashimapspool: true&lt;br /&gt;
               # Chirico Commented the below line&lt;br /&gt;
               # sasl_pwcheck_method: saslauthd&lt;br /&gt;
               # Because using sasldb&lt;br /&gt;
               sasl_pwcheck_method: auxprop&lt;br /&gt;
               sasl_auxprop_plugin: sasldb&lt;br /&gt;
               #  Chirico end change&lt;br /&gt;
               sasl_mech_list: PLAIN&lt;br /&gt;
               tls_cert_file: /usr/share/ssl/certs/cyrus-imapd.pem&lt;br /&gt;
               tls_key_file: /usr/share/ssl/certs/cyrus-imapd.pem&lt;br /&gt;
               tls_ca_file: /usr/share/ssl/certs/ca-bundle.crt&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 3:&lt;br /&gt;
        &lt;br /&gt;
           Create a user and password:&lt;br /&gt;
        &lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` cyrus&lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` chirico&lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` allmail&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
           This will automatically create the file /etc/sasldb2. But look&lt;br /&gt;
           at the default rights, assuming you ran saslpasswd2 as root:&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /etc/sasldb2&lt;br /&gt;
                 -rw-r-----  1 root root 12288 Jul 31 09:50 /etc/sasldb2&lt;br /&gt;
        &lt;br /&gt;
           We need to correct this in step 4.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 4:&lt;br /&gt;
        &lt;br /&gt;
                 $ chown root.mail /etc/sasldb2&lt;br /&gt;
                 $ ls -l /etc/sasldb2&lt;br /&gt;
                 -rw-r-----  1 root mail 12288 Jul 31 09:50 /etc/sasldb2&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 5:&lt;br /&gt;
        &lt;br /&gt;
            Update &amp;quot;/etc/postfix/main.cf&amp;quot;. Note in /etc/imapd.conf the configdirectory&lt;br /&gt;
            points to /var/lib/imap, and if I look at this directory I see the&lt;br /&gt;
            socket directory. However, after staring /etc/init.d/cyrus-imapd  there&lt;br /&gt;
            will be a socket file &amp;quot;/var/lib/imap/socket/lmtp&amp;quot;. (See step 6).&lt;br /&gt;
        &lt;br /&gt;
                  mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp&lt;br /&gt;
                  mailbox_transport = cyrus&lt;br /&gt;
        &lt;br /&gt;
            Restart postfix.&lt;br /&gt;
        &lt;br /&gt;
                  /etc/init.d/postfix restart&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 6:&lt;br /&gt;
&lt;br /&gt;
            Start cyrus-imapd and look for the socket file.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
                   $ /etc/init.d/cyrus-imapd restart&lt;br /&gt;
                   Shutting down cyrus-imapd:                                 [  OK  ]&lt;br /&gt;
                   Starting cyrus-imapd: preparing databases... done.         [  OK  ]&lt;br /&gt;
        &lt;br /&gt;
            Now you should see the lmtp file:&lt;br /&gt;
        &lt;br /&gt;
                   $ ls -l /var/lib/imap/socket/lmtp&lt;br /&gt;
                   srwxrwxrwx  1 root root 0 Jul 31 10:04 /var/lib/imap/socket/lmtp&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 7:&lt;br /&gt;
        &lt;br /&gt;
            Add users. Note, you may have to go back to step 3 to add them to /etc/sasldb2&lt;br /&gt;
            as well.&lt;br /&gt;
        &lt;br /&gt;
                   $ su - cyrus&lt;br /&gt;
                   $ cyradm tape.squeezel.com&lt;br /&gt;
                   tape.squeezel.com&amp;gt; cm user.chirico&lt;br /&gt;
                   tape.squeezel.com&amp;gt; quit&lt;br /&gt;
        &lt;br /&gt;
            Now got back as root, and check that everything was created correctly.&lt;br /&gt;
        &lt;br /&gt;
                   $ ls /var/spool/imap/c/user/&lt;br /&gt;
                   total 8&lt;br /&gt;
                   drwx------  2 cyrus mail 4096 Jul 31 10:21 chirico&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 8:&lt;br /&gt;
        &lt;br /&gt;
             Run a mail test. We'll do this as root to the chirico account.&lt;br /&gt;
        &lt;br /&gt;
                   $ mail -s 'First test'  chirico&lt;br /&gt;
                   first test&lt;br /&gt;
                   .&lt;br /&gt;
        &lt;br /&gt;
             Now, still as root check the maillog. Normally everything should work.&lt;br /&gt;
        &lt;br /&gt;
                  $ tail /var/log/maillog&lt;br /&gt;
        &lt;br /&gt;
             However, I got the following error below.&lt;br /&gt;
&lt;br /&gt;
                     Jul 31 10:29:03 tape postfix/cleanup[30124]: AE7CB1B34A4: message-id=&amp;lt;20050731142903.AE7CB1B34A4@tape.squeezel.com&amp;gt;&lt;br /&gt;
                     Jul 31 10:29:03 tape postfix/qmgr[30120]: AE7CB1B34A4: from=&amp;lt;root@tape.squeezel.com&amp;gt;, size=315, nrcpt=1 (queue active)&lt;br /&gt;
                     Jul 31 10:29:03 tape pipe[30128]: fatal: pipe_comand: execvp /cyrus/bin/deliver: No such file or directory&lt;br /&gt;
&lt;br /&gt;
             If you get a similiar error, you may need to adjust the settting in /etc/postfix/master.cf&lt;br /&gt;
        &lt;br /&gt;
                 # This is the problem in /etc/postfix/master.cf&lt;br /&gt;
                 cyrus     unix  -       n       n       -       -       pipe&lt;br /&gt;
                   user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}&lt;br /&gt;
        &lt;br /&gt;
             My deliver file is the following&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
                 -rwxr-xr-x  1 root root 846228 Apr  4 18:59 /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
        &lt;br /&gt;
             So I need to change my /etc/postfix/master.cf as follows:&lt;br /&gt;
        &lt;br /&gt;
                 # Fix because by deliver file is under  /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
                 cyrus     unix  -       n       n       -       -       pipe&lt;br /&gt;
                   user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -r ${sender} -m ${extension} ${user}&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
             If changes were needed, like I had to do, restart postfix&lt;br /&gt;
        &lt;br /&gt;
                 $ /etc/init.d/postfix restart&lt;br /&gt;
        &lt;br /&gt;
             Now, if everything works, you should start to see numbers in the spool directory like &amp;quot;1.&amp;quot; and&lt;br /&gt;
             &amp;quot;2.&amp;quot;.&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /var/spool/imap/c/user/chirico/&lt;br /&gt;
                 total 40&lt;br /&gt;
                 -rw-------  1 cyrus mail  545 Jul 31 10:44 1.&lt;br /&gt;
                 -rw-------  1 cyrus mail  547 Jul 31 10:45 2.&lt;br /&gt;
                 -rw-------  1 cyrus mail 1276 Jul 31 10:45 cyrus.cache&lt;br /&gt;
                 -rw-------  1 cyrus mail  153 Jul 31 10:21 cyrus.header&lt;br /&gt;
                 -rw-------  1 cyrus mail  196 Jul 31 10:45 cyrus.index&lt;br /&gt;
&lt;br /&gt;
        Step 9:&lt;br /&gt;
        &lt;br /&gt;
             Local firewall.&lt;br /&gt;
        &lt;br /&gt;
                 # imap&lt;br /&gt;
                iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 143 -j ACCEPT&lt;br /&gt;
                iptables -A INPUT -p tcp -s 192.168.1.0/24  --dport 143 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        Step 10:&lt;br /&gt;
        &lt;br /&gt;
             Configure cyrus-imapd to start for run-level 3 and 5.&lt;br /&gt;
&lt;br /&gt;
                 # chkconfig --level 35 cyrus-imapd on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       HINTS - &lt;br /&gt;
&lt;br /&gt;
        Something to watch out for:&lt;br /&gt;
&lt;br /&gt;
              Something to watch out for: If a user creates a .forward file in their shell account with the&lt;br /&gt;
              following entry, then, mail will not get mail relayed to cyrus.&lt;br /&gt;
&lt;br /&gt;
                  &amp;quot;|exec /usr/bin/procmail&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             The /etc/maillog will show something like this:&lt;br /&gt;
&lt;br /&gt;
                    to=&amp;lt;chirico@squeezel.squeezel.com&amp;gt;, orig_to=&amp;lt;chirico&amp;gt;, relay=local, delay=0,&lt;br /&gt;
                          status=sent (delivered to command: exec /usr/bin/procmail)&lt;br /&gt;
&lt;br /&gt;
             Remove the &amp;quot;.forward&amp;quot; file from their home directory and you'll get the following:&lt;br /&gt;
&lt;br /&gt;
                    to=&amp;lt;chirico@squeezel.squeezel.com&amp;gt;, relay=cyrus, delay=0,&lt;br /&gt;
                          status=sent (squeezel.squeezel.com)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              mutt with IMAP?  (See TIP 190)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 189:&lt;br /&gt;
&lt;br /&gt;
     expand - convert tabs to spaces in a file.&lt;br /&gt;
&lt;br /&gt;
             $ expand How_to_Linux_and_Open_Source.txt &amp;gt; notabs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 190:&lt;br /&gt;
&lt;br /&gt;
     mutt with imap - assume you have setup imap (see tip 188). Now how do you configure&lt;br /&gt;
                      your &amp;quot;.muttrc&amp;quot; file to automatically connect, securely to the IMAP server?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       &lt;br /&gt;
     Below is an example of my &amp;quot;.muttrc&amp;quot; file. For this example, assume my password is &amp;quot;S0m3paSSw0r9&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             $ cat .muttrc&lt;br /&gt;
             set spoolfile = &amp;quot;imaps://chirico:S0m3paSSw0r9@squeezel.squeezel.com/&lt;br /&gt;
             set imap_force_ssl=yes&lt;br /&gt;
             set certificate_file=~/.mutt/certificates/72d31154.0&lt;br /&gt;
&lt;br /&gt;
     Now, you want to copy the certificate as a &amp;quot;file.pem&amp;quot; and run &amp;quot;c_rehash&amp;quot; to convert this&lt;br /&gt;
     file to a number. See the article. See the following article on how to do this under the &lt;br /&gt;
     fetchmail section.&lt;br /&gt;
&lt;br /&gt;
          http://souptonuts.sourceforge.net/postfix_tutorial.html&lt;br /&gt;
&lt;br /&gt;
     This is a quick summary of creating this key.&lt;br /&gt;
&lt;br /&gt;
             $ openssl s_client -connect squeezel.squeezel.com:995 -showcerts &amp;gt; file.pem&lt;br /&gt;
             $ c_rehash ~/.mutt/certificates&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 191:&lt;br /&gt;
&lt;br /&gt;
     Apache - CGI scripts.  There are two ways to enable CGI scripts. The second method is the&lt;br /&gt;
              prefered method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           First way, the easy way. Look for the &amp;quot;http.conf&amp;quot; file. On Fedora Core, this file can be&lt;br /&gt;
           found under &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;. Edit this file as follows to make &lt;br /&gt;
           &amp;quot;http://squeezel.squeezel.com/chirico-cgi/&amp;quot; execute scripts.&lt;br /&gt;
&lt;br /&gt;
                     ScriptAlias /chirico-cgi/ &amp;quot;/home/chirico/cgi-bin/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           Second way, the better way. Instead of doing the above, make the following change in &lt;br /&gt;
           &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                     &amp;lt;Directory /home/chirico/cgi-bin&amp;gt;&lt;br /&gt;
                      Options +ExecCGI&lt;br /&gt;
                      SetHandler chirico-cgi&lt;br /&gt;
                     &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Running a test script. Now copy the following test script into the directory &amp;quot;/home/chirico/cgi-bin&amp;quot;&lt;br /&gt;
        and change the rights to execute for the user running this.&lt;br /&gt;
&lt;br /&gt;
                  #!/bin/sh&lt;br /&gt;
                  # Save as test.cgi&lt;br /&gt;
                  #  chown apache.apache test.cgi&lt;br /&gt;
                  #  chmod 700 test.cgi&lt;br /&gt;
                  echo &amp;quot;Content-Type: text/html&amp;quot;&lt;br /&gt;
                  echo&lt;br /&gt;
                  echo &amp;quot;Hello world from user &amp;lt;b&amp;gt;`whoami`&amp;lt;/b&amp;gt;! &amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 192:&lt;br /&gt;
&lt;br /&gt;
     Bash - using getopts for your bash scripts.&lt;br /&gt;
&lt;br /&gt;
                   #!/bin/bash&lt;br /&gt;
                   while getopts &amp;quot;ab:cd:&amp;quot; Option&lt;br /&gt;
                   # b and d take arguments&lt;br /&gt;
                   #&lt;br /&gt;
                   do&lt;br /&gt;
                     case $Option in&lt;br /&gt;
                       a) echo -e &amp;quot;a = $OPTIND&amp;quot;;;&lt;br /&gt;
                       b) echo -e &amp;quot;b = $OPTIND $OPTARG&amp;quot;;;&lt;br /&gt;
                       c) echo -e &amp;quot;c = $OPTIND&amp;quot;;;&lt;br /&gt;
                       d) echo -e &amp;quot;d = $OPTIND $OPTARG&amp;quot;;;&lt;br /&gt;
                    esac&lt;br /&gt;
                  done&lt;br /&gt;
                  shift $(($OPTIND - 1))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 193:&lt;br /&gt;
&lt;br /&gt;
     Sieve - creating sieve recipes with &amp;quot;sieveshell&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     The following sieve script put all jefferson.edu mail into the &lt;br /&gt;
     folder jefferson. This assumes that I have already created the IMP &lt;br /&gt;
     directory, or mail box (INBOX.jefferson), which can be done in mutt &lt;br /&gt;
     with the &amp;quot;C&amp;quot; command. Below is an example of finding &amp;quot;jefferson.edu&amp;quot;&lt;br /&gt;
     anywhere in the header. &lt;br /&gt;
&lt;br /&gt;
         # This is a file named jefferson.siv&lt;br /&gt;
         require [&amp;quot;fileinto&amp;quot;];&lt;br /&gt;
         if header :contains &amp;quot;Received&amp;quot; &amp;quot;from jefferson.edu&amp;quot; {&lt;br /&gt;
           fileinto &amp;quot;INBOX.jefferson&amp;quot;;&lt;br /&gt;
           stop;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
     Now, from the command propt execute &amp;quot;sieveshell&amp;quot; with the hostname of the&lt;br /&gt;
     imap server. My server is squeezel.squeezel.com, so I would execute the &lt;br /&gt;
     following:&lt;br /&gt;
&lt;br /&gt;
          $ sieveshell squeezel.squeezel.com&lt;br /&gt;
          connecting to squeezel.squeezel.com&lt;br /&gt;
          Please enter your password:****&lt;br /&gt;
          &amp;gt; put jefferson.siv&lt;br /&gt;
          &amp;gt; activate jefferson.siv&lt;br /&gt;
          &amp;gt; list&lt;br /&gt;
          jefferson.siv  &amp;lt;- active script&lt;br /&gt;
          &amp;gt; quit&lt;br /&gt;
&lt;br /&gt;
     Note the put brings in the script. And you need to activiate it.&lt;br /&gt;
&lt;br /&gt;
     You can activate a sieve script for any user on your system if you are&lt;br /&gt;
     root. This is an example of activating a script for user chirico. Assume&lt;br /&gt;
     below the root prompt is &amp;quot;#&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          # sieveshell -a chirico -u chirico squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
     You can also automate everything from a bash script. But note after&lt;br /&gt;
     the -e the commands, and not a file with the commands, follows within&lt;br /&gt;
     quotes. This is the script I use for my home system.&lt;br /&gt;
&lt;br /&gt;
         #!/bin/bash&lt;br /&gt;
         sieveshell -a chirico -u chirico -e 'deactivate&lt;br /&gt;
         delete chirico.siv&lt;br /&gt;
         put chirico.siv&lt;br /&gt;
         activate chirico.siv&lt;br /&gt;
         list&lt;br /&gt;
         '  squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     References:&lt;br /&gt;
         http://wiki.fastmail.fm/index.php/SieveRecipes&lt;br /&gt;
         http://www.cyrusoft.com/sieve/#documents&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 194:&lt;br /&gt;
&lt;br /&gt;
     emacs - editing files remotely with tramp. Tramp comes with the latest version of emacs.&lt;br /&gt;
             That means if you're using Fedora core 4, with emacs, you have tramp. This is &lt;br /&gt;
             ideal for editing files on remote computers that do not use emacs.&lt;br /&gt;
&lt;br /&gt;
             Edit the &amp;quot;.emacs&amp;quot; file and add the following line:&lt;br /&gt;
&lt;br /&gt;
                 (require 'tramp)&lt;br /&gt;
                 (setq tramp-default-method &amp;quot;scp&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
             Now, to edit a file on computer tape.squeezel.com (C-x, C-f) and&lt;br /&gt;
             enter the following in Find file:&lt;br /&gt;
&lt;br /&gt;
                 Find file:/chirico@tape.squeezel.com:test.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             References:&lt;br /&gt;
&lt;br /&gt;
                    http://savannah.gnu.org/projects/tramp/&lt;br /&gt;
&lt;br /&gt;
             &lt;br /&gt;
&lt;br /&gt;
TIP 195:&lt;br /&gt;
&lt;br /&gt;
     trusted X11 forwarding - running gnome and KDE both on one screen, at the same&lt;br /&gt;
             time securely. The following assumes gnome is running on the current&lt;br /&gt;
             computer and &amp;quot;closet.squeezel.com&amp;quot; has KDE&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y  closet.squeezel.com&lt;br /&gt;
              $ startkde&lt;br /&gt;
&lt;br /&gt;
          Or assume you want to run gnome on &amp;quot;closet.squeezel.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y  closet.squeezel.com&lt;br /&gt;
              $ gnome-session&lt;br /&gt;
&lt;br /&gt;
          By default Fedora Core allows ForwardX11 over ssh. Note you want to use&lt;br /&gt;
          the -Y option above and NOT -X. &lt;br /&gt;
&lt;br /&gt;
          Suppose you want a remote &amp;quot;gnome-session&amp;quot; on ctl-alt-F12. Below is an &lt;br /&gt;
          example of getting the remote computer closet.squeezel.com, and you&lt;br /&gt;
          can still have the above configuration.&lt;br /&gt;
&lt;br /&gt;
          First you must allow magic cookies for each server connection.&lt;br /&gt;
             &lt;br /&gt;
              $ MCOOKIE=$(mcookie)&lt;br /&gt;
              $ xauth add $(hostname)/unix:1 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
              $ xauth add localhost/unix:1 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
  &lt;br /&gt;
          Again, note that you have to add this for EACH connection. So if you wanted 2 as well&lt;br /&gt;
&lt;br /&gt;
              $ MCOOKIE=$(mcookie)&lt;br /&gt;
              $ xauth add $(hostname)/unix:2 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
              $ xauth add localhost/unix:2 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
&lt;br /&gt;
          On squeezel.squeezel.com create a new xterm. If :1 is take below&lt;br /&gt;
          try :2. The vt12 is for switching to ctl-alt-F12.&lt;br /&gt;
&lt;br /&gt;
              $ xinit -- :1 vt12&lt;br /&gt;
&lt;br /&gt;
          Note, if you do not add the above cookies, you will get the follow error:&lt;br /&gt;
         &lt;br /&gt;
               Xlib: connection to &amp;quot;:1.0&amp;quot; refused by server&lt;br /&gt;
               Xlib: No protocol specified&lt;br /&gt;
&lt;br /&gt;
          The screen may be hard to read. At this point ssh -Y to the remote computer.&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y closet.squeezel.com&lt;br /&gt;
              $ gnome-session&lt;br /&gt;
&lt;br /&gt;
          Yes, you will get errors about sound and some custom drivers is the remove &lt;br /&gt;
          computer has different hardware. After is loads, you can switch back and&lt;br /&gt;
          forth between session with (ctl-alt-F12)  and (ctl-alt-F7)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 196:&lt;br /&gt;
&lt;br /&gt;
     Suspend ssh session - you have just sshed into a computer &amp;quot;ssh -l user example.com&amp;quot;, and you&lt;br /&gt;
          want to get back to the terminal prompt of the computer you started with. Escapte, by &lt;br /&gt;
          default with ssh is &amp;quot;~&amp;quot;, so enter &amp;quot;~&amp;quot; followed by &amp;quot;ctl-z&amp;quot; to suspend.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 197:&lt;br /&gt;
&lt;br /&gt;
     Quick way to send a text file &lt;br /&gt;
&lt;br /&gt;
              $ sendmail -f mike.chirico@gmail.com mchirico@comcast.net &amp;lt; /etc/fstab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 198:&lt;br /&gt;
&lt;br /&gt;
     size - determining the size of the text segment, data segment, and &amp;quot;bss&amp;quot; or uninitialized data segment.&lt;br /&gt;
&lt;br /&gt;
              $ size /bin/sh /bin/bash&lt;br /&gt;
               text        data     bss     dec     hex filename&lt;br /&gt;
              586946      22444   18784  628174   995ce /bin/sh&lt;br /&gt;
              586946      22444   18784  628174   995ce /bin/bash&lt;br /&gt;
&lt;br /&gt;
          Note above that &amp;quot;/bin/sh&amp;quot; and &amp;quot;/bin/bash&amp;quot; have equal text,data and bss numbers. It's&lt;br /&gt;
          highly likely that these are the same programs.&lt;br /&gt;
&lt;br /&gt;
              $ ls -l /bin/sh&lt;br /&gt;
               lrwxrwxrwx  1 root root 4 Jan 14  2005 /bin/sh -&amp;gt; bash&lt;br /&gt;
&lt;br /&gt;
          Yep, it's the same program. Here's a further definition of each segment.&lt;br /&gt;
&lt;br /&gt;
              Text segment: The machine instructions that the CPU executes. This is usually&lt;br /&gt;
                            read only and sharable.&lt;br /&gt;
&lt;br /&gt;
              Data segment: Contains initialized variables in a program. You also know these&lt;br /&gt;
                            as declarations and definitions.&lt;br /&gt;
&lt;br /&gt;
                               int max = 200;&lt;br /&gt;
&lt;br /&gt;
              Uninitialized data segment: Think of this as a declaration only, or data that&lt;br /&gt;
                            is only initialized by the kernel to arithmetic 0 or null pointers&lt;br /&gt;
                            before program execution.&lt;br /&gt;
&lt;br /&gt;
                               char s[10];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 199:&lt;br /&gt;
&lt;br /&gt;
     Using the at command.&lt;br /&gt;
&lt;br /&gt;
       Below is a simple example if running the ls command at 11:42am that&lt;br /&gt;
       will send mail -m to the user that executed it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       We'll execute job1 defined as follows and set to be executable. &lt;br /&gt;
&lt;br /&gt;
           $ cat ./job1&lt;br /&gt;
           #!/bin/bash&lt;br /&gt;
           date &amp;gt;&amp;gt; /tmp/job1&lt;br /&gt;
&lt;br /&gt;
       The at command is listed below. For queue &amp;quot;-q&amp;quot; names you can only&lt;br /&gt;
       specify one letter. Here we're using x. The letter determines the&lt;br /&gt;
       priority with &amp;quot;a&amp;quot; the highest.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x  -f ./job1 -m  11:54am&lt;br /&gt;
           job 3 at 2005-10-04 11:54&lt;br /&gt;
&lt;br /&gt;
       Now, if you execute the atq command, you'll get the following.&lt;br /&gt;
&lt;br /&gt;
           $ atq&lt;br /&gt;
           3       2005-10-04 11:54 x chirico&lt;br /&gt;
&lt;br /&gt;
       It's also possible to execute jobs at the command line entering&lt;br /&gt;
       a ctl-d at the end of the input.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x  -m 12:08pm&lt;br /&gt;
           at&amp;gt; ls -l&lt;br /&gt;
           at&amp;gt; who&lt;br /&gt;
           at&amp;gt; date&lt;br /&gt;
           at&amp;gt; ^D&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Or for a job to execute 1 minute from now.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x -m `date -d '1 minute' +&amp;quot;%H:%M&amp;quot;`&lt;br /&gt;
           at&amp;gt; ls -l&lt;br /&gt;
           at&amp;gt; date&lt;br /&gt;
     &lt;br /&gt;
&lt;br /&gt;
     Important points: The atd daemon must be running. To check if&lt;br /&gt;
      it's running do the following:&lt;br /&gt;
&lt;br /&gt;
            $ /etc/init.d/atd status&lt;br /&gt;
&lt;br /&gt;
      Also, if there is an /etc/at.allow file, then only users in that&lt;br /&gt;
      file will be allowed to execute at.&lt;br /&gt;
&lt;br /&gt;
      If /etc/at.deny exists but is empty and there is no /etc/at.allow,&lt;br /&gt;
      then, everyone can execute the at command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 200:&lt;br /&gt;
&lt;br /&gt;
     lsusb - command will display all USB buses and all devices connected.&lt;br /&gt;
&lt;br /&gt;
        $ lsusb&lt;br /&gt;
        Bus 005 Device 003: ID 413c:2010 Dell Computer Corp.&lt;br /&gt;
        Bus 005 Device 002: ID 413c:1003 Dell Computer Corp.&lt;br /&gt;
        Bus 005 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 004 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 003 Device 003: ID 0fc5:1227 Delcom Engineering&lt;br /&gt;
        Bus 003 Device 002: ID 046d:c016 Logitech, Inc. Optical Mouse&lt;br /&gt;
        Bus 003 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 002 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 001 Device 001: ID 0000:0000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 201:&lt;br /&gt;
&lt;br /&gt;
     Memory fragmentation - if you suspect workload memory fragmentation issues&lt;br /&gt;
     and you want to monitor the current state of you system, then, consider&lt;br /&gt;
     looking at the output from /proc/buddyinfo on recent kernels.&lt;br /&gt;
&lt;br /&gt;
        $ cat /proc/buddyinfo&lt;br /&gt;
      Node 0, zone      DMA    541    218     42      2      0      0      0      1      1      1      0 &lt;br /&gt;
      Node 0, zone   Normal   2508   2614     52      1      5      5      0      1      1      1      0 &lt;br /&gt;
      Node 0, zone  HighMem      0      1      3      0      1      0      0      0      0      0      0 &lt;br /&gt;
&lt;br /&gt;
     The following definition is taken from  ./Documentation/filesystems/proc.txt in the &lt;br /&gt;
     Linux kernel source.&lt;br /&gt;
&lt;br /&gt;
       Each column represents the number of pages of a certain order which are&lt;br /&gt;
       available.  In this case, there are 0 chunks of 2^0*PAGE_SIZE available in&lt;br /&gt;
       ZONE_DMA, 4 chunks of 2^1*PAGE_SIZE in ZONE_DMA, 101 chunks of 2^4*PAGE_SIZE&lt;br /&gt;
       available in ZONE_NORMAL, etc...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 202:&lt;br /&gt;
&lt;br /&gt;
     arp - Linux ARP kernel moduel.  This command implements the Address Resolution Protocol.&lt;br /&gt;
&lt;br /&gt;
     This is an example of the command.&lt;br /&gt;
&lt;br /&gt;
        $ arp&lt;br /&gt;
        Address                  HWtype  HWaddress           Flags Mask            Iface&lt;br /&gt;
        tape.squeezel.com        ether   00:50:DA:60:5B:AD   C                     eth0&lt;br /&gt;
        squeezel.squeezel.com    ether   00:11:11:8A:BE:3F   C                     eth0&lt;br /&gt;
        gw.squeezel.com          ether   00:0F:66:47:15:73   C                     eth0&lt;br /&gt;
&lt;br /&gt;
       &lt;br /&gt;
TIP 203:&lt;br /&gt;
&lt;br /&gt;
     dbench - performance monitoring. &lt;br /&gt;
&lt;br /&gt;
     So, how does your system react when the load average is above 600. Have you even seen a &lt;br /&gt;
     computer with a load average of 600? Well, this could be your chance. &lt;br /&gt;
&lt;br /&gt;
         Reference: http://freshmeat.net/projects/dbench/&lt;br /&gt;
&lt;br /&gt;
     The following gives a load average of 10 on my system.&lt;br /&gt;
&lt;br /&gt;
        $ dbench 34&lt;br /&gt;
&lt;br /&gt;
     If you want a higher load, just increase the number.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 204:&lt;br /&gt;
&lt;br /&gt;
     /etc guide - a listing of common files in the /etc directory.&lt;br /&gt;
&lt;br /&gt;
        /etc/exports: this file is used to configure NFS.&lt;br /&gt;
&lt;br /&gt;
        /etc/ftpusers: the users on your system who are restricted from FTP login.&lt;br /&gt;
&lt;br /&gt;
        /etc/motd: message of the day, which users see after login.&lt;br /&gt;
&lt;br /&gt;
        /etc/named.conf: DNS config file.&lt;br /&gt;
&lt;br /&gt;
        /etc/profile: common user information.&lt;br /&gt;
&lt;br /&gt;
        /etc/inittab: this file contains runlevel start information.&lt;br /&gt;
&lt;br /&gt;
        /etc/services: the services and their respective ports.&lt;br /&gt;
&lt;br /&gt;
        /etc/shells: this contains the names of all shells installed on the system.&lt;br /&gt;
&lt;br /&gt;
        /etc/passwd: this file contains user information.&lt;br /&gt;
&lt;br /&gt;
        /etc/group: security group rights.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
TIP 205: &lt;br /&gt;
&lt;br /&gt;
     logger - is a bash command utility for writing to /var/log/messages or the&lt;br /&gt;
            other files defined in /etc/syslog.conf.&lt;br /&gt;
&lt;br /&gt;
            $ logger -t TEST more of a test here&lt;br /&gt;
&lt;br /&gt;
         This is what shows up in /var/log/messages&lt;br /&gt;
  &lt;br /&gt;
            Oct 28 07:15:50 squeezel TEST: more of a test here&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
TIP 206: &lt;br /&gt;
&lt;br /&gt;
     accton, lastcomm - accouting on and last command. This is &lt;br /&gt;
         a way to monitor users on your system. As root, you &lt;br /&gt;
         would implement this as follows:&lt;br /&gt;
&lt;br /&gt;
           $ accton -h&lt;br /&gt;
            Usage: accton [-hV] [file]&lt;br /&gt;
            [--help] [--version]&lt;br /&gt;
&lt;br /&gt;
            The system's default process accounting file is /var/account/pacct.&lt;br /&gt;
&lt;br /&gt;
         Note the default file location is /var/account/pacct so we'll turn&lt;br /&gt;
         it on system wide with the following command.&lt;br /&gt;
&lt;br /&gt;
           $ accton /var/account/pacct&lt;br /&gt;
&lt;br /&gt;
         Now take a look at this file. It will grow. To see command that&lt;br /&gt;
         are executed, use the lastcomm command.&lt;br /&gt;
&lt;br /&gt;
           $ lastcomm&lt;br /&gt;
&lt;br /&gt;
         The above command gives output for all users. To get the data&lt;br /&gt;
         for user &amp;quot;chirico&amp;quot; execute the following command:&lt;br /&gt;
&lt;br /&gt;
           $ lastcomm --user chirico&lt;br /&gt;
&lt;br /&gt;
         You can also get a summary of commands with sa.&lt;br /&gt;
&lt;br /&gt;
           [chirico@big ~]$ sa&lt;br /&gt;
           30       5.23re       0.00cp    10185k&lt;br /&gt;
           11       4.83re       0.00cp     8961k   ***other&lt;br /&gt;
            8       0.13re       0.00cp    19744k   nagios*&lt;br /&gt;
            4       0.00re       0.00cp     2542k   automount*&lt;br /&gt;
            3       0.00re       0.00cp      680k   sa&lt;br /&gt;
            2       0.13re       0.00cp    17424k   check_ping&lt;br /&gt;
            2       0.13re       0.00cp      978k   ping&lt;br /&gt;
&lt;br /&gt;
         To turn off accounting, execute accton without a filename.&lt;br /&gt;
&lt;br /&gt;
           $ accton&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 207:&lt;br /&gt;
&lt;br /&gt;
     CPU Temperature on a laptop. The following is the temperature&lt;br /&gt;
       of my Dell laptop. &lt;br /&gt;
&lt;br /&gt;
           $ cat /proc/acpi/thermal_zone/THM/temperature&lt;br /&gt;
           temperature:             58 C&lt;br /&gt;
&lt;br /&gt;
      &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 208:&lt;br /&gt;
&lt;br /&gt;
     script -f with mkfifo to allow another user to view what you type&lt;br /&gt;
          in real-time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Step 1.  Create a fifo (first in first out) file that the other&lt;br /&gt;
              user can view. For this example create the file /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
               [chirico@laptop ~]$ mkfifo /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
        Step 2.  Have the second user, voyeur user, cat this file. Output will block&lt;br /&gt;
              for them until you complete step 3. The other user, voyer,&lt;br /&gt;
              is executing the command below.&lt;br /&gt;
 &lt;br /&gt;
               [voyeur@laptop ~]$ cat /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
        Step 3.  The original user runs the following command.&lt;br /&gt;
&lt;br /&gt;
               [chirico@laptop ~]$ script -f  /tmp/scriptout&lt;br /&gt;
               Script started, file is /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
             Now anything typed, including a vi session, will be displayed to the&lt;br /&gt;
             voyeur user in step 2. &lt;br /&gt;
&lt;br /&gt;
        See TIP 46.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 209:&lt;br /&gt;
&lt;br /&gt;
     fsck forced on next reboot.  To do this, as root issue the following commands.&lt;br /&gt;
&lt;br /&gt;
            $ cd /&lt;br /&gt;
            $ touch forcefsck&lt;br /&gt;
&lt;br /&gt;
          Now reboot the system, and when it comes up fsck will be forced on the system.&lt;br /&gt;
&lt;br /&gt;
            $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 210:&lt;br /&gt;
&lt;br /&gt;
     /dev/random and /dev/urandom differ in their random generating properties. /dev/random&lt;br /&gt;
        only returns bytes when enough noise has been generated from the entropy pool. In&lt;br /&gt;
        contrast /dev/urandom will always return bytes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference: http://sourceforge.net/direct-dl/mchirico/cpearls/simple_but_common.tar.gz (rand.c)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 211:&lt;br /&gt;
&lt;br /&gt;
     Want to find out the speed of your NIC?  (Full Duplex or Half), then use ethtool.&lt;br /&gt;
&lt;br /&gt;
               [root@squeezel ~]# ethtool eth0&lt;br /&gt;
               Settings for eth0:&lt;br /&gt;
                       Supported ports: [ MII ]&lt;br /&gt;
                       Supported link modes:   10baseT/Half 10baseT/Full&lt;br /&gt;
                                               100baseT/Half 100baseT/Full&lt;br /&gt;
                                               1000baseT/Half 1000baseT/Full&lt;br /&gt;
                       Supports auto-negotiation: Yes&lt;br /&gt;
                       Advertised link modes:  10baseT/Half 10baseT/Full&lt;br /&gt;
                                               100baseT/Half 100baseT/Full&lt;br /&gt;
                                               1000baseT/Half 1000baseT/Full&lt;br /&gt;
                       Advertised auto-negotiation: Yes&lt;br /&gt;
                       Speed: 100Mb/s&lt;br /&gt;
                       Duplex: Full&lt;br /&gt;
                       Port: Twisted Pair&lt;br /&gt;
                       PHYAD: 1&lt;br /&gt;
                       Transceiver: internal&lt;br /&gt;
                       Auto-negotiation: on&lt;br /&gt;
                       Supports Wake-on: g&lt;br /&gt;
                       Wake-on: d&lt;br /&gt;
                       Current message level: 0x000000ff (255)&lt;br /&gt;
                       Link detected: yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 212:&lt;br /&gt;
&lt;br /&gt;
     rpm install hang? You might need to delete the lock state information. &lt;br /&gt;
&lt;br /&gt;
        $ nl /etc/rc.d/rc.sysinit | grep rpm&lt;br /&gt;
        720   rm -f /var/lib/rpm/__db* &amp;amp;&amp;gt; /dev/null&lt;br /&gt;
&lt;br /&gt;
     Note the command &lt;br /&gt;
&lt;br /&gt;
        $ rm -f /var/lib/rpm/__db*&lt;br /&gt;
&lt;br /&gt;
     Because sometimes you will run &amp;quot;rpm -ivh somerpm&amp;quot; and it will just sit&lt;br /&gt;
     there.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 213:&lt;br /&gt;
&lt;br /&gt;
     Apache - limit access to certain directories based on IP address in the&lt;br /&gt;
         httpd.conf file.&lt;br /&gt;
&lt;br /&gt;
          You can do this completely from /etc/httpd/conf/httpd.conf which&lt;br /&gt;
          are shown below for multiple IP addresses. Note that all 3 setting&lt;br /&gt;
          are the same.&lt;br /&gt;
&lt;br /&gt;
                10.0.0.0/255.0.0.0&lt;br /&gt;
                10.0.0.0/8&lt;br /&gt;
                10&lt;br /&gt;
&lt;br /&gt;
          However, the following is different&lt;br /&gt;
&lt;br /&gt;
                10.0.0.0/24   only allows 10.0.0.1 to 10.0.0.254&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Some complete settings in /etc/httpd/conf/httpd.conf &lt;br /&gt;
&lt;br /&gt;
             &amp;lt;Directory /var/www/html/chirico/&amp;gt;&lt;br /&gt;
                 Order allow,deny&lt;br /&gt;
                 Allow from 10.0.0.0/8      # All 10.&lt;br /&gt;
                 Allow from 192.168.0.0/16  # All 192.168&lt;br /&gt;
                 Allow from 127             # All 127.&lt;br /&gt;
             &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          Don't forget to reload httpd with the following command.&lt;br /&gt;
        &lt;br /&gt;
             $ /etc/init.d/httpd reload&lt;br /&gt;
&lt;br /&gt;
          &lt;br /&gt;
&lt;br /&gt;
TIP 214:&lt;br /&gt;
&lt;br /&gt;
     Open Files - determining how many files are currently open.&lt;br /&gt;
&lt;br /&gt;
             $ cat /proc/sys/fs/file-nr&lt;br /&gt;
             2030    263     104851&lt;br /&gt;
              |       |        \- maximum open file descriptors &lt;br /&gt;
              |       |         &lt;br /&gt;
              |       \- total free allocated file descriptors&lt;br /&gt;
              |&lt;br /&gt;
              (Total allocated file descriptors since boot)&lt;br /&gt;
&lt;br /&gt;
        Note the maximum number can be set or changed.&lt;br /&gt;
&lt;br /&gt;
              $ cat /proc/sys/fs/file-max&lt;br /&gt;
              104851&lt;br /&gt;
&lt;br /&gt;
        To change this&lt;br /&gt;
&lt;br /&gt;
              $ echo &amp;quot;804854&amp;quot; &amp;gt; /proc/sys/fs/file-max&lt;br /&gt;
 &lt;br /&gt;
        Note lsof | wc -l will report higher numbers because this includes&lt;br /&gt;
        open files that are not using file descriptors such as directories,&lt;br /&gt;
        memory mapped files, and executable text files.&lt;br /&gt;
&lt;br /&gt;
        (Reference http://www.netadmintools.com/art295.html&lt;br /&gt;
         and also see the man page for this: man 5 proc )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 215:&lt;br /&gt;
&lt;br /&gt;
     Ctrl-Alt-Del will cause an immediate reboot, without syncing dirty buffers by&lt;br /&gt;
     setting the value &amp;gt; 0 in /proc/sys/kernel/ctrl-alt-del.&lt;br /&gt;
&lt;br /&gt;
               $ echo 1 &amp;gt; /proc/sys/kernel/ctrl-alt-del&lt;br /&gt;
       &lt;br /&gt;
&lt;br /&gt;
        (Reference: man 5 proc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 216:&lt;br /&gt;
&lt;br /&gt;
     Redefining keys in X using xev and xmodmap.  The program xev, used in an X window &lt;br /&gt;
     terminal screen will display information on mouse movements, keys pressed and &lt;br /&gt;
     released.&lt;br /&gt;
&lt;br /&gt;
        $ xev&lt;br /&gt;
&lt;br /&gt;
     Now type shift-4 and you'll notice the event details below:&lt;br /&gt;
&lt;br /&gt;
        KeyPress event, serial 29, synthetic NO, window 0x3800001,&lt;br /&gt;
            root 0x60, subw 0x0, time 55307049, (418,242), root:(428,339),&lt;br /&gt;
            state 0x1, keycode 13 (keysym 0x24, dollar), same_screen YES,&lt;br /&gt;
            XLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
            XmbLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
            XFilterEvent returns: False&lt;br /&gt;
        &lt;br /&gt;
        KeyRelease event, serial 29, synthetic NO, window 0x3800001,&lt;br /&gt;
            root 0x60, subw 0x0, time 55307184, (418,242), root:(428,339),&lt;br /&gt;
            state 0x1, keycode 13 (keysym 0x24, dollar), same_screen YES,&lt;br /&gt;
            XLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
       &lt;br /&gt;
     So, if you want to redefine this key to say copyright, see (/usr/X11R6/include/X11/keysymdef.h)&lt;br /&gt;
     you would type the following.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 copyright'&lt;br /&gt;
&lt;br /&gt;
     To get the key back to the dollar, issue the following command.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 dollar'&lt;br /&gt;
&lt;br /&gt;
     By the way it's possible to define multiple key codes for a sigle key. You'll need&lt;br /&gt;
     to have a key defined as the Mode_switch. Perhaps you'd like to use the Windows key,&lt;br /&gt;
     or the key with the Microsoft logo on it, since you're using Linux. This key is&lt;br /&gt;
     keycode 115&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 115 = Mode_switch'&lt;br /&gt;
&lt;br /&gt;
     Now you could define 3 values to the shift-4. For this example use ld, Yen and dollar.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 dollar sterling yen'&lt;br /&gt;
&lt;br /&gt;
     So pressing the keys gives you the following:&lt;br /&gt;
&lt;br /&gt;
          shift-$          (dollar sign)&lt;br /&gt;
          Windows-$        (lb sign)&lt;br /&gt;
          Windows-shift-$  (Yen sign)&lt;br /&gt;
&lt;br /&gt;
     You could go crazy and redefine all you keys.&lt;br /&gt;
&lt;br /&gt;
     (Thanks to hisham for this tip).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 217:&lt;br /&gt;
&lt;br /&gt;
     Threads - which version of threads are you using?&lt;br /&gt;
&lt;br /&gt;
          $ getconf GNU_LIBPTHREAD_VERSION&lt;br /&gt;
          NPTL 2.3.90&lt;br /&gt;
&lt;br /&gt;
     For a history on threads used with gcc reference the following:&lt;br /&gt;
          &lt;br /&gt;
          http://en.wikipedia.org/wiki/NPTL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 218:&lt;br /&gt;
&lt;br /&gt;
     Screenshots using ImageMagick. &lt;br /&gt;
&lt;br /&gt;
        If you want the entire screen, execute the following:&lt;br /&gt;
&lt;br /&gt;
            $ import -window root screen.png&lt;br /&gt;
&lt;br /&gt;
        Or to crosshair select the region with your mouse, execute &lt;br /&gt;
        the following instead.&lt;br /&gt;
&lt;br /&gt;
            $ import screen.png&lt;br /&gt;
&lt;br /&gt;
        KDE has the ability to take screenshots with the command below.&lt;br /&gt;
&lt;br /&gt;
            $ ksnapshot&lt;br /&gt;
&lt;br /&gt;
        GNOME likewise has a command too.&lt;br /&gt;
&lt;br /&gt;
            $ gnome-panel-screenshot --delay 6&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Visting ImageMagick again, the xwininfo command give window information and the id can be&lt;br /&gt;
        used to capture images with the import command.&lt;br /&gt;
&lt;br /&gt;
            $ xwininfo&lt;br /&gt;
&lt;br /&gt;
          xwininfo: Please select the window about which you&lt;br /&gt;
          would like information by clicking the&lt;br /&gt;
          mouse in that window.&lt;br /&gt;
&lt;br /&gt;
          xwininfo: Window id: 0x1e00007 &amp;quot;chirico@squeezel:/work/svn/souptonuts - Shell - Konsole&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          Absolute upper-left X:  4&lt;br /&gt;
          Absolute upper-left Y:  21&lt;br /&gt;
          Relative upper-left X:  0&lt;br /&gt;
          Relative upper-left Y:  0&lt;br /&gt;
          Width: 880&lt;br /&gt;
          Height: 510&lt;br /&gt;
          Depth: 24&lt;br /&gt;
          Visual Class: TrueColor&lt;br /&gt;
          Border width: 0&lt;br /&gt;
          Class: InputOutput&lt;br /&gt;
          Colormap: 0x20 (installed)&lt;br /&gt;
          Bit Gravity State: NorthWestGravity&lt;br /&gt;
          Window Gravity State: NorthWestGravity&lt;br /&gt;
          Backing Store State: NotUseful&lt;br /&gt;
          Save Under State: no&lt;br /&gt;
          Map State: IsViewable&lt;br /&gt;
          Override Redirect State: no&lt;br /&gt;
          Corners:  +4+21  -396+21  -396-493  +4-493&lt;br /&gt;
          -geometry 880x510+0+0&lt;br /&gt;
&lt;br /&gt;
        Now use the import command with the Window id. My example is shown below.&lt;br /&gt;
&lt;br /&gt;
             $ import -window 0x1e00007  id.miff&lt;br /&gt;
&lt;br /&gt;
        And to quickly display this image that you just saved, use the display command.&lt;br /&gt;
&lt;br /&gt;
             $ display id.miff &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 219:&lt;br /&gt;
&lt;br /&gt;
     File Access over SSH using FUSE (Filesystem in USErspace). This is a very good way to &lt;br /&gt;
     mount a remote filesystem locally. It's  like a secure NFS mount, but you don't require &lt;br /&gt;
     admin privileges on the remote computer. You do need to have fuse-sshfs installed on &lt;br /&gt;
     the local computer that will perform the filesystem mount.&lt;br /&gt;
&lt;br /&gt;
     The following works with Fedora Core 5. Only the users added to the fuse group can mout &lt;br /&gt;
     external drives. Below the user chirico is being added to the group fuse.&lt;br /&gt;
&lt;br /&gt;
             $ yum install fuse-sshfs&lt;br /&gt;
             $ usermod -a -G fuse chirico&lt;br /&gt;
     &lt;br /&gt;
     You'll need to reboot.&lt;br /&gt;
&lt;br /&gt;
             $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
             &lt;br /&gt;
     Next I'm going to mount the remote filesystem v0.squeezel.com. This is done as user chirico&lt;br /&gt;
     on the local computer. I'm using root on the remote computer v0.squeezel.com because I&lt;br /&gt;
     want to mount the complete drive.&lt;br /&gt;
&lt;br /&gt;
             $ mkdir v0&lt;br /&gt;
             $ sshfs root@v0.squeezel.com:/  v0&lt;br /&gt;
             $ cd v0&lt;br /&gt;
             $ ls -l&lt;br /&gt;
               bin   dev  home  lost+found     media  mnt  opt   q     sbin     srv  tmp  var&lt;br /&gt;
               boot  etc  lib   master_backup  misc   net  proc  root  selinux  sys  usr&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
     Now to unmount the filesystem&lt;br /&gt;
&lt;br /&gt;
             $ fusermount -u /home/chirico/v0&lt;br /&gt;
&lt;br /&gt;
     Yes, you can mount the filesystem on boot. Below shows an example entry for /etc/fstab, but&lt;br /&gt;
     this only allows user on the current system to view what is is /mnt/v0. &lt;br /&gt;
&lt;br /&gt;
             sshfs#root@v0.squeezel.com:/var/log             /mnt/v0 fuse defaults    0 0&lt;br /&gt;
&lt;br /&gt;
     References:&lt;br /&gt;
        (http://fuse.sourceforge.net/sshfs.html)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 220:&lt;br /&gt;
&lt;br /&gt;
     OpenVPN - A full-featured SSL VPN solution. The following demonstrates&lt;br /&gt;
               a very simple OpenVPN setup between two Fedora Core 5 computers&lt;br /&gt;
               big.squeezel.com 192.168.1.12 and tape.squeezel.com 192.168.1.155&lt;br /&gt;
&lt;br /&gt;
               As root install the package on both computers.&lt;br /&gt;
&lt;br /&gt;
                  $ yum -y install openvpn&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Setup on big.squeezel.com 192.168.1.12&lt;br /&gt;
&lt;br /&gt;
                  $ iptables -A INPUT -p udp -s 192.168.1.155  --dport 1194 -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tun+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A FORWARD -i tap+ -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
             Note - make sure you have commented out the following line &lt;br /&gt;
                    in /etc/sysconfig/iptables&lt;br /&gt;
&lt;br /&gt;
                  # -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
&lt;br /&gt;
             Now from continuting with the commands that need to be executed on &lt;br /&gt;
             big.squeezel.com 192.168.1.12 do one of the following&lt;br /&gt;
           &lt;br /&gt;
                  $ openvpn --remote tape.squeezel.com  --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 --verb 9&lt;br /&gt;
&lt;br /&gt;
             The above statement gives lots of errors. Once it's working you may want&lt;br /&gt;
             the following statement without the --verb 9 option.&lt;br /&gt;
&lt;br /&gt;
                  $ openvpn --remote tape.squeezel.com  --dev tun1 --ifconfig 10.4.0.1 10.4.0.2&lt;br /&gt;
&lt;br /&gt;
             After you finish the setup commands for tape.squeezel.com immediately below, you'll be&lt;br /&gt;
             able to access tape.squeezel.com as 10.4.0.2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Setup on tape.squeezel.com 192.168.1.155&lt;br /&gt;
&lt;br /&gt;
                  $ iptables -A INPUT -p udp -s 192.168.1.12  --dport 1194 -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tun+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A FORWARD -i tap+ -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
             Note - again, make sure you have commented out the following line &lt;br /&gt;
                    in /etc/sysconfig/iptables&lt;br /&gt;
&lt;br /&gt;
                  # -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
&lt;br /&gt;
             The openvpn commands are tape.squeezel.com are reversed from what is shown&lt;br /&gt;
             above.&lt;br /&gt;
&lt;br /&gt;
                  $ openvpn --remote big.squeezel.com --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 --verb 9&lt;br /&gt;
&lt;br /&gt;
             Or&lt;br /&gt;
                  $ openvpn --remote big.squeezel.com --dev tun1 --ifconfig 10.4.0.2 10.4.0.1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             Now you can access all services and ports from big.squeezel.com on 10.4.0.1 for &lt;br /&gt;
             such services as MySQL, secure Web, imap, etc. A quick test is nmap as follows:&lt;br /&gt;
&lt;br /&gt;
                  $ nmap -A -T4 10.4.0.1&lt;br /&gt;
&lt;br /&gt;
                  Starting Nmap 4.03 ( http://www.insecure.org/nmap/ ) at 2006-05-20 13:54 EDT&lt;br /&gt;
                  Interesting ports on 10.4.0.1:&lt;br /&gt;
                  (The 1671 ports scanned but not shown below are in state: closed)&lt;br /&gt;
                  PORT     STATE SERVICE VERSION&lt;br /&gt;
                  22/tcp   open  ssh     OpenSSH 4.3 (protocol 2.0)&lt;br /&gt;
                  111/tcp  open  rpcbind  2 (rpc #100000)&lt;br /&gt;
                  3306/tcp open  mysql   MySQL (unauthorized)&lt;br /&gt;
&lt;br /&gt;
                  Nmap finished: 1 IP address (1 host up) scanned in 7.116 seconds&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 221:&lt;br /&gt;
&lt;br /&gt;
     openssl - Some common commands.&lt;br /&gt;
&lt;br /&gt;
             Finding the openssldir (Directory for OpenSSL files).&lt;br /&gt;
&lt;br /&gt;
                  $ openssl version -a|grep OPENSSLDIR&lt;br /&gt;
                  OPENSSLDIR: &amp;quot;/etc/pki/tls&amp;quot;&lt;br /&gt;
&lt;br /&gt;
             Connect to a secure SMTP server with STARTTLS, assuming the server name is&lt;br /&gt;
             squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
                  $ openssl s_client -connect squeezel.squeezel.com:25 -starttls&lt;br /&gt;
&lt;br /&gt;
         &lt;br /&gt;
&lt;br /&gt;
      Reference (http://www.madboa.com/geek/openssl/)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 222:&lt;br /&gt;
&lt;br /&gt;
     Bash functions. This is easy, and I find it very useful to create bash functions&lt;br /&gt;
     for repeated commands. For example, suppose you want to create a quick bash function&lt;br /&gt;
     to cd to /var/log, tail messages and tail secure. You can create this function as&lt;br /&gt;
     follows:&lt;br /&gt;
&lt;br /&gt;
                  [root@v5 log]# m()&lt;br /&gt;
                  m()&lt;br /&gt;
                  &amp;gt; { cd /var/log&lt;br /&gt;
                  { cd /var/log&lt;br /&gt;
                  &amp;gt; tail messages&lt;br /&gt;
                  tail messages&lt;br /&gt;
                  &amp;gt; tail secure&lt;br /&gt;
                  tail secure&lt;br /&gt;
                  &amp;gt; }&lt;br /&gt;
                  }&lt;br /&gt;
                  &lt;br /&gt;
     Above I'm typing m() then hitting return. Note the echo on the next line followed&lt;br /&gt;
     by the prompt &amp;gt;. I then enter {. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 223:&lt;br /&gt;
&lt;br /&gt;
     Stats on DNS Server. You can get stats on your DNS server. &lt;br /&gt;
&lt;br /&gt;
       The following works for BIND 9:&lt;br /&gt;
&lt;br /&gt;
                  $ rndc stats&lt;br /&gt;
&lt;br /&gt;
         On my system I see the output in &amp;quot;/var/named/chroot/var/named/data/named_stats.txt&amp;quot;, which&lt;br /&gt;
         if an FC4 system. By the way, if you're using BIND 8, the command is &amp;quot;ndc stats&amp;quot;, but that&lt;br /&gt;
         has a completely different format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Format of the output&lt;br /&gt;
&lt;br /&gt;
            +++ Statistics Dump +++ (1153791199)&lt;br /&gt;
            success 297621&lt;br /&gt;
            referral 32&lt;br /&gt;
            nxrrset 21953&lt;br /&gt;
            nxdomain 33742&lt;br /&gt;
            recursion 28243&lt;br /&gt;
            failure 54&lt;br /&gt;
            --- Statistics Dump --- (1153791199)&lt;br /&gt;
&lt;br /&gt;
      The number (1153791199) can be converted with the date command.&lt;br /&gt;
&lt;br /&gt;
                  $ date -d '1970-01-01 1153791199 sec'&lt;br /&gt;
                  Tue Jul 25 02:33:19 EDT 2006&lt;br /&gt;
&lt;br /&gt;
      That's 1153791199 seconds since 1970-01-01 UCT. Which is 4 hours fast,&lt;br /&gt;
      from EDT.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 224:&lt;br /&gt;
&lt;br /&gt;
     snmp - simple network monitoring protocol. The following steps setup snmp on Fedora Core 5.&lt;br /&gt;
&lt;br /&gt;
                  $ yum install net-snmp*&lt;br /&gt;
&lt;br /&gt;
         Next add the following line in &amp;quot;/etc/snmp/snmpd.conf&amp;quot; at the bottom.&lt;br /&gt;
&lt;br /&gt;
                  rocommunity pA33worD&lt;br /&gt;
&lt;br /&gt;
         Start the snmp service.&lt;br /&gt;
&lt;br /&gt;
                  $ /etc/init.d/snmpd restart&lt;br /&gt;
&lt;br /&gt;
         Once started, from the command prompt, it's possible to get stats on the computer.&lt;br /&gt;
&lt;br /&gt;
                  $ snmpwalk -v 1 -c pA33worD localhost system&lt;br /&gt;
         Or&lt;br /&gt;
                  $ snmpwalk -v 1 -c pA33worD localhost interface&lt;br /&gt;
&lt;br /&gt;
         Or&lt;br /&gt;
                  $ snmpgetnext -v 1 -c pA33worD localhost sysUpTime&lt;br /&gt;
                  DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (26452) 0:04:24.52&lt;br /&gt;
&lt;br /&gt;
         Note the Timeticks is in 100th of a second. So the computer above has been running&lt;br /&gt;
         for 264.52 seconds.&lt;br /&gt;
&lt;br /&gt;
         Reference( TIP 225 shows how to use MRTG for gathering snmp stats).&lt;br /&gt;
                  http://www.net-snmp.org/tutorial/tutorial-5/commands/snmpv3.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 225:&lt;br /&gt;
&lt;br /&gt;
     MRTG - Multi Router Traffic Grapher.  &lt;br /&gt;
&lt;br /&gt;
                  $ cfgmaker --output=/etc/mrtg/v5.squeezel.com \&lt;br /&gt;
                    ifref=ip --global &amp;quot;workdir:/var/www/html/mrtg/stats&amp;quot;\&lt;br /&gt;
                    pA33worD@v5.squeezel.com&lt;br /&gt;
&lt;br /&gt;
        Reference: http://www.chinalinuxpub.com/doc/www.siliconvalleyccie.com/linux-hn/mrtg.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 226:&lt;br /&gt;
&lt;br /&gt;
     Back Trace - This is a method of getting a back trace for all processes on the system.&lt;br /&gt;
                  it assumes the following: a. Kernel was build with CONFIG_MAGIC_SYS-REQ &lt;br /&gt;
                  enabled (which Fedora 5 kernels are) b. You can get direct access to the &lt;br /&gt;
                  monitor.&lt;br /&gt;
&lt;br /&gt;
             Step 1.&lt;br /&gt;
&lt;br /&gt;
                  Ctl-Alt-F1 (This brings you to the text console)&lt;br /&gt;
&lt;br /&gt;
             Step 2.&lt;br /&gt;
&lt;br /&gt;
                  Alt-ScrollLock &lt;br /&gt;
                  Ctl-ScrollLock&lt;br /&gt;
          &lt;br /&gt;
                  Note above that's Alt-ScrollLock followed by Ctl-ScrollLock. You should see&lt;br /&gt;
                  a lot of text on the screen. To fast to read, but don't worry the text will&lt;br /&gt;
                  be in /var/log/messages at the end.&lt;br /&gt;
&lt;br /&gt;
                  On my system the ScrollLock key is next to the NumLock key. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 227:&lt;br /&gt;
&lt;br /&gt;
     Ext3 Tuning - One advantage of Ext3 over Ext2 is directory indexing, which  imporves file&lt;br /&gt;
                  access in directories containing large files or when the directory contains&lt;br /&gt;
                  many files. Directory indexing improves performance by using hashed binary &lt;br /&gt;
                  trees. &lt;br /&gt;
&lt;br /&gt;
                  There are two ways to enable dir_index. First, find the device using the mount&lt;br /&gt;
                  command.&lt;br /&gt;
&lt;br /&gt;
                      $ mount&lt;br /&gt;
&lt;br /&gt;
                      /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)&lt;br /&gt;
                      proc on /proc type proc (rw)&lt;br /&gt;
                      sysfs on /sys type sysfs (rw)&lt;br /&gt;
                      devpts on /dev/pts type devpts (rw,gid=5,mode=620)&lt;br /&gt;
                      /dev/sda1 on /boot type ext3 (rw) &amp;lt;--- This is the one you want&lt;br /&gt;
                      tmpfs on /dev/shm type tmpfs (rw)&lt;br /&gt;
                      none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)&lt;br /&gt;
                      sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)&lt;br /&gt;
                      automount(pid2001) on /net type autofs (rw,fd=4,pgrp=2001,minproto=2,maxproto=4)                   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                  From the above command, the device used is /dev/sda1.  Using the tune2fs command,&lt;br /&gt;
                  directory indexing will only apply to directories created after running the &lt;br /&gt;
                  command below.               &lt;br /&gt;
&lt;br /&gt;
                       $ tune2fs -O dir_index /dev/sda1&lt;br /&gt;
&lt;br /&gt;
                  However, if you want it to apply to all directories, use the e2fsck command as  &lt;br /&gt;
                  shown below:&lt;br /&gt;
&lt;br /&gt;
                       $ e2fsck -D -f /dev/sda1&lt;br /&gt;
&lt;br /&gt;
                  You'll need to bypass the warning message.&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
     Reference: &amp;quot;Tuning Journaling File Systems: A small amount of effort an dtime can yield big&lt;br /&gt;
                results&amp;quot;,by Steve Best. Linux Magazine, September 10, 2006. This author as has&lt;br /&gt;
                a very good book titled: &amp;quot;Linux Debugging and Performance Tuning.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 228:&lt;br /&gt;
&lt;br /&gt;
     NIC bonding - binding two or more NICs to one IP address to improve performance. The following&lt;br /&gt;
                instructions were done on Fedora Core 5.&lt;br /&gt;
&lt;br /&gt;
         Step 1.&lt;br /&gt;
             &lt;br /&gt;
            Create the file ifcfg-bond0 with the IP address, netmask and gateway. Shown&lt;br /&gt;
            below is my file.&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-bond0&lt;br /&gt;
&lt;br /&gt;
                   DEVICE=bond0&lt;br /&gt;
                   IPADDR=192.168.1.12&lt;br /&gt;
                   NETMASK=255.255.255.0&lt;br /&gt;
                   GATEWAY=192.168.1.1&lt;br /&gt;
                   USERCTL=no&lt;br /&gt;
                   BOOTPROTO=none&lt;br /&gt;
                   ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
         Step 2.&lt;br /&gt;
&lt;br /&gt;
            Modify eth0, eth1 and eth2. Shown below are each one of my files. Note that&lt;br /&gt;
            you must comment out, or remove the ip address, netmask, gateway and hardware&lt;br /&gt;
            address from each one of these files, since settings should only come from&lt;br /&gt;
            the ifcfg-bond0 file above. I've chosen to comment out the lines, instead of &lt;br /&gt;
            removing, should I decide to unbond my NICS sometime in the future.&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth0&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:9D&lt;br /&gt;
                  #IPADDR=192.168.1.12&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  #GATEWAY=192.168.1.1&lt;br /&gt;
                  #USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  # Settings for Bond&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth1&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth1&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:C9&lt;br /&gt;
                  #IPADDR=192.168.1.13&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  #&lt;br /&gt;
                  # Settings for bonding&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth2&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth2&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:9D&lt;br /&gt;
                  #IPADDR=192.168.1.12&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  #GATEWAY=192.168.1.1&lt;br /&gt;
                  #USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
         Step 3.&lt;br /&gt;
&lt;br /&gt;
            Set the load parameters for bond0 bonding kernel module. Append the&lt;br /&gt;
            following lines to /etc/modprobe.conf &lt;br /&gt;
&lt;br /&gt;
                 # bonding commands &lt;br /&gt;
                 alias bond0 bonding&lt;br /&gt;
                 options bond0 mode=balance-alb miimon=100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Step 4.&lt;br /&gt;
&lt;br /&gt;
            Load the bond driver module from the command prompt.&lt;br /&gt;
&lt;br /&gt;
                 $ modprobe bonding&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Step 5.&lt;br /&gt;
&lt;br /&gt;
            Restart the network, or restart the computer. Note I restarted to computer,&lt;br /&gt;
            since my NICs above had MAC assignments.&lt;br /&gt;
&lt;br /&gt;
                 $ service network restart   # Or restart computer&lt;br /&gt;
&lt;br /&gt;
             Take a look at the proc settings. &lt;br /&gt;
&lt;br /&gt;
                 $ cat /proc/net/bonding/bond0 &lt;br /&gt;
                 Ethernet Channel Bonding Driver: v3.0.3 (March 23, 2006)&lt;br /&gt;
&lt;br /&gt;
                 Bonding Mode: adaptive load balancing&lt;br /&gt;
                 Primary Slave: None&lt;br /&gt;
                 Currently Active Slave: eth2&lt;br /&gt;
                 MII Status: up&lt;br /&gt;
                 MII Polling Interval (ms): 100&lt;br /&gt;
                 Up Delay (ms): 0&lt;br /&gt;
                 Down Delay (ms): 0&lt;br /&gt;
&lt;br /&gt;
                 Slave Interface: eth2&lt;br /&gt;
                 MII Status: up&lt;br /&gt;
                 Link Failure Count: 0&lt;br /&gt;
                 Permanent HW addr: 00:13:72:80:62:f0&lt;br /&gt;
            &lt;br /&gt;
     References:&lt;br /&gt;
&lt;br /&gt;
         http://www.cyberciti.biz/nixcraft/vivek/blogger/2006/04/linux-bond-or-team-multiple-network.php&lt;br /&gt;
          Good, well written article describing the steps above.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=24692&amp;amp;package_id=146474&lt;br /&gt;
          Documentation for bonding that can also be found in the kernel&lt;br /&gt;
          ./Documentation/networking/bonding.txt&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 229:&lt;br /&gt;
&lt;br /&gt;
     /etc/nsswitch.conf - System Databases and Name Service Switch configuration file. &lt;br /&gt;
&lt;br /&gt;
         This file determines lookup order of services. For example, to match a name&lt;br /&gt;
         to an IP address, an entry can be put into the /etc/hosts file. Or a DNS query&lt;br /&gt;
         can be made. What's the order?  Normally, it's the entry in the /etc/hosts file.&lt;br /&gt;
         because /etc/nsswitch.conf contains the following setting&lt;br /&gt;
        &lt;br /&gt;
            hosts:      files dns&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	 See man nsswitch.conf for more settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
THE FOLLOWING SECTIONS STARTS THE PROGRAMMING TIPS&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 1:&lt;br /&gt;
&lt;br /&gt;
     Simple open command that restarts the close if a signal&lt;br /&gt;
     occurs.  Also note, the POSIX standards committee decided&lt;br /&gt;
     all new functions would not use errno and would instead&lt;br /&gt;
     directly return the error number in the function.&lt;br /&gt;
&lt;br /&gt;
     A lot of functions return -1 on an error condition, then,&lt;br /&gt;
     set errno to the value of the error.  This will still work&lt;br /&gt;
     for all the well known functions; but, it's changing.&lt;br /&gt;
&lt;br /&gt;
     /* start of code open.c&lt;br /&gt;
        Compile gcc -o open open.c&lt;br /&gt;
&lt;br /&gt;
        Reference (Look for simple_but_common_x.x.x.tar.gz):&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79066&lt;br /&gt;
&lt;br /&gt;
                             */&lt;br /&gt;
     #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     #include &amp;lt;string.h&amp;gt;             /* for strerror(int errno) */&lt;br /&gt;
     #include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     #define BUFLEN 100&lt;br /&gt;
     extern int errno;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     int&lt;br /&gt;
     main (void)&lt;br /&gt;
     {&lt;br /&gt;
       int fp,error;&lt;br /&gt;
       char buf[BUFLEN+1];&lt;br /&gt;
&lt;br /&gt;
       if ((fp = open (&amp;quot;data&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1)&lt;br /&gt;
         {&lt;br /&gt;
           fprintf (stderr, &amp;quot;Can't open data: %s\n&amp;quot;, strerror (errno));&lt;br /&gt;
           return 1;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
       snprintf (buf, BUFLEN, &amp;quot;123&amp;quot;);&lt;br /&gt;
       write (fp, buf, strlen (buf));&lt;br /&gt;
&lt;br /&gt;
       // Restart close should a signal occur */&lt;br /&gt;
       while((( error = close (fp) ) == -1) &amp;amp;&amp;amp; (errno == EINTR));&lt;br /&gt;
       if(error == -1)&lt;br /&gt;
         perror(&amp;quot;Failed to close the file\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
       return 0;&lt;br /&gt;
      }&lt;br /&gt;
     /* end of open.c */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 2:&lt;br /&gt;
&lt;br /&gt;
     Example of setting the effective UID on a file&lt;br /&gt;
&lt;br /&gt;
     /*  start of code&lt;br /&gt;
       gcc uid_open.c -o uid_open&lt;br /&gt;
       su&lt;br /&gt;
       chown root.chirico uid_open&lt;br /&gt;
       chmod u+s uid_open&lt;br /&gt;
       exit&lt;br /&gt;
&lt;br /&gt;
       Now you can run this as chirico and write to the&lt;br /&gt;
       root directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     */&lt;br /&gt;
     #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;string.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     int main()&lt;br /&gt;
     {&lt;br /&gt;
             int fd;&lt;br /&gt;
&lt;br /&gt;
             if ((fd = open(&amp;quot;/root/datajunk&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1) {&lt;br /&gt;
                     fprintf(stderr, &amp;quot;Can't open file \n&amp;quot;);&lt;br /&gt;
                     return 1;&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
             write(fd, &amp;quot;0123456&amp;quot;, strlen(&amp;quot;0123456&amp;quot;));&lt;br /&gt;
             close(fd);&lt;br /&gt;
             return 0;&lt;br /&gt;
     }&lt;br /&gt;
&lt;br /&gt;
     /* end of code */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 3:&lt;br /&gt;
&lt;br /&gt;
     Writing a C http post.&lt;br /&gt;
&lt;br /&gt;
     For downloads reference:&lt;br /&gt;
      http://prdownloads.sourceforge.net/cpearls/spider.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 4:&lt;br /&gt;
&lt;br /&gt;
     Writing a 2.6.x Kernel Module:&lt;br /&gt;
&lt;br /&gt;
       Look for the latest version of &amp;quot;procreadwrite&amp;quot;.  This is a 2.6 kernel&lt;br /&gt;
       modules that demonstrates how to create /proc entires and write directly&lt;br /&gt;
       to user-land via tty.  It's updated to reflect replacement of &amp;quot;current-&amp;gt;tty&amp;quot;&lt;br /&gt;
       with &amp;quot;current-&amp;gt;signal-&amp;gt;tty&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79066&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 5:&lt;br /&gt;
&lt;br /&gt;
     Creating a filename with '\n'.  This goes with (TIP 71)&lt;br /&gt;
&lt;br /&gt;
         /**** topen.c ***********************************************************&lt;br /&gt;
           Filenames can be created with any character except the null character&lt;br /&gt;
           and a slash.&lt;br /&gt;
&lt;br /&gt;
           This example creates a file with returns '\n\n'&lt;br /&gt;
&lt;br /&gt;
           There's a way to remove a file by inode:&lt;br /&gt;
&lt;br /&gt;
               $ ls -libt *&lt;br /&gt;
&lt;br /&gt;
           And, once you know the inode&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec mv '{}' goodstuff \;&lt;br /&gt;
&lt;br /&gt;
           or&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec rm '{}' goodstuff \;&lt;br /&gt;
&lt;br /&gt;
           or&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec cat '{}' \;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Compile:&lt;br /&gt;
&lt;br /&gt;
             gcc -o topen -Wall -W -O2 -s -pipe  topen.c&lt;br /&gt;
&lt;br /&gt;
         Reference:&lt;br /&gt;
           http://prdownloads.sourceforge.net/cpearls/simple_but_common_0.0.14.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
         */&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         #include &amp;lt;string.h&amp;gt;             /* for strerror(int errno) */&lt;br /&gt;
         #include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         #define BUFLEN 100&lt;br /&gt;
         extern int errno;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         int&lt;br /&gt;
         main (void)&lt;br /&gt;
         {&lt;br /&gt;
           int fp,error;&lt;br /&gt;
           char buf[BUFLEN+1];&lt;br /&gt;
&lt;br /&gt;
           if ((fp = open (&amp;quot;\n\n\n\n\n\n\n\n\n&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1)&lt;br /&gt;
             {&lt;br /&gt;
               fprintf (stderr, &amp;quot;Can't open data: %s\n&amp;quot;, strerror (errno));&lt;br /&gt;
               return 1;&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
           snprintf (buf, BUFLEN, &amp;quot;123&amp;quot;);&lt;br /&gt;
           write (fp, buf, strlen (buf));&lt;br /&gt;
&lt;br /&gt;
           // Restart close should a signal occur */&lt;br /&gt;
           while((( error = close (fp) ) == -1) &amp;amp;&amp;amp; (errno == EINTR));&lt;br /&gt;
           if(error == -1)&lt;br /&gt;
             perror(&amp;quot;Failed to close the file\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
           return 0;&lt;br /&gt;
&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  **Note, if you want email notification after every 50 new tips have been&lt;br /&gt;
    added, then, click on the following link:&lt;br /&gt;
&lt;br /&gt;
     https://sourceforge.net/project/filemodule_monitor.php?filemodule_id=120838&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 6:&lt;br /&gt;
&lt;br /&gt;
     Working With The Lemon Parser Generator.&lt;br /&gt;
     http://prdownloads.sourceforge.net/souptonuts/lemon_examples.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 7:&lt;br /&gt;
&lt;br /&gt;
     copy command for std container output.&lt;br /&gt;
&lt;br /&gt;
        #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
        #include &amp;lt;list&amp;gt;&lt;br /&gt;
        #include &amp;lt;vector&amp;gt;&lt;br /&gt;
        #include &amp;lt;iterator&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        using namespace std;&lt;br /&gt;
        int main(void)&lt;br /&gt;
        {&lt;br /&gt;
          vector&amp;lt;int&amp;gt; v;&lt;br /&gt;
          list&amp;lt;int&amp;gt; l;&lt;br /&gt;
&lt;br /&gt;
          v.push_back(1);&lt;br /&gt;
          v.push_back(2);&lt;br /&gt;
          copy(v.begin(),v.end(),ostream_iterator&amp;lt;int&amp;gt;(cout,&amp;quot;\n&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          l.push_back(23);&lt;br /&gt;
          l.push_back(12);&lt;br /&gt;
          copy(l.begin(),l.end(),ostream_iterator&amp;lt;int&amp;gt;(cout,&amp;quot;\n&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 8:&lt;br /&gt;
&lt;br /&gt;
  /* Copyright (c) 2005 Mike Chirico mchirico@comcast.net mchirico@users.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Example of using virtual functions. Note the use of &amp;quot;initialization lists&amp;quot;&lt;br /&gt;
              for assinging the variable first and last.&lt;br /&gt;
&lt;br /&gt;
      Compile:&lt;br /&gt;
        g++ -o virtualfunc -Wall -W -O2 -s -pipe  virtual_function.cc&lt;br /&gt;
&lt;br /&gt;
      Download:&lt;br /&gt;
        http://prdownloads.sourceforge.net/cpearls/simple_but_common_cpp.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  */&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
  #include &amp;lt;string&amp;gt;&lt;br /&gt;
  #include &amp;lt;list&amp;gt;&lt;br /&gt;
  #include &amp;lt;algorithm&amp;gt;&lt;br /&gt;
  #include &amp;lt;iterator&amp;gt;&lt;br /&gt;
  #include &amp;lt;functional&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  using namespace std;&lt;br /&gt;
&lt;br /&gt;
  class Employee {&lt;br /&gt;
  string first,last;&lt;br /&gt;
  public:&lt;br /&gt;
    Employee(const string&amp;amp; fn=&amp;quot;John&amp;quot;,const  string&amp;amp; ln=&amp;quot;Smith&amp;quot;): first(fn),last(ln) {}&lt;br /&gt;
    virtual void print() const {&lt;br /&gt;
    cout &amp;lt;&amp;lt; &amp;quot;First name: &amp;quot; &amp;lt;&amp;lt; first &amp;lt;&amp;lt; &amp;quot;, Last name: &amp;quot; &amp;lt;&amp;lt; last &amp;lt;&amp;lt; endl;&lt;br /&gt;
    }&lt;br /&gt;
    virtual ~Employee() {}&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  class Manager : public Employee {&lt;br /&gt;
    int level;&lt;br /&gt;
    list&amp;lt;Employee*&amp;gt; subordinates;&lt;br /&gt;
  public:&lt;br /&gt;
    Manager(const string&amp;amp; fn=&amp;quot;Ivan&amp;quot;,const string&amp;amp; ln=&amp;quot;Stedwick&amp;quot;, int lvl=1): Employee(fn,ln), level(lvl) {}&lt;br /&gt;
    void print() {&lt;br /&gt;
      cout &amp;lt;&amp;lt; &amp;quot;Manager level: &amp;quot; &amp;lt;&amp;lt; level &amp;lt;&amp;lt; &amp;quot;  &amp;quot;;&lt;br /&gt;
      Employee::print();&lt;br /&gt;
      cout &amp;lt;&amp;lt; &amp;quot;Supervises:&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
      for_each(subordinates.begin(),subordinates.end(),mem_fun(&amp;amp;Employee::print));&lt;br /&gt;
      cout &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; endl;&lt;br /&gt;
    }&lt;br /&gt;
    void addstaff(Employee&amp;amp; staff){&lt;br /&gt;
      subordinates.push_front(&amp;amp;staff);&lt;br /&gt;
    }&lt;br /&gt;
    void addstaff(Employee* staff){&lt;br /&gt;
      subordinates.push_front(staff);&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   int main()&lt;br /&gt;
   {&lt;br /&gt;
     Employee p0(&amp;quot;Lisa&amp;quot;,&amp;quot;Payne&amp;quot;);&lt;br /&gt;
     Manager m0;&lt;br /&gt;
&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Zoe&amp;quot;,&amp;quot;Bear&amp;quot;)); /* uses void addstaff(Employee* staff) */&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Leah&amp;quot;,&amp;quot;Bopper&amp;quot;));&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Abby&amp;quot;,&amp;quot;Chicken&amp;quot;));&lt;br /&gt;
     m0.addstaff(p0);  /* void addstaff(Employee&amp;amp; staff)  needed for this one */&lt;br /&gt;
     m0.addstaff(new Employee());&lt;br /&gt;
     m0.print();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     return 0;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 9:&lt;br /&gt;
&lt;br /&gt;
   /*  Named Constructor Idiom.&lt;br /&gt;
       Reference: http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.6&lt;br /&gt;
&lt;br /&gt;
   */&lt;br /&gt;
   #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
   #include &amp;lt;cmath&amp;gt;&lt;br /&gt;
   using namespace std;&lt;br /&gt;
&lt;br /&gt;
   class Point {&lt;br /&gt;
&lt;br /&gt;
   public:&lt;br /&gt;
     static Point rectangular(float x, float y);&lt;br /&gt;
     static Point polar(float radius, float angle);&lt;br /&gt;
     float get_x() { return x_; }&lt;br /&gt;
     float get_y() { return y_; }&lt;br /&gt;
&lt;br /&gt;
   private:&lt;br /&gt;
     Point(float x, float y);&lt;br /&gt;
     float x_, y_;&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
   inline Point::Point(float x, float y)&lt;br /&gt;
     : x_(x), y_(y) {}&lt;br /&gt;
&lt;br /&gt;
   inline Point Point::rectangular(float x, float y)&lt;br /&gt;
   { return Point(x,y); }&lt;br /&gt;
&lt;br /&gt;
   inline Point Point::polar(float radius, float angle)&lt;br /&gt;
   { return Point(radius*cos(angle),radius*sin(angle)); }&lt;br /&gt;
&lt;br /&gt;
   int main(void)&lt;br /&gt;
   {&lt;br /&gt;
     Point p1 = Point::rectangular(5.7,1.2);&lt;br /&gt;
     Point p2 = Point::polar(5.7,1.2);&lt;br /&gt;
&lt;br /&gt;
     cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; p1.get_x() &amp;lt;&amp;lt; &amp;quot;, &amp;quot; &amp;lt;&amp;lt; p1.get_y() &amp;lt;&amp;lt; &amp;quot;)&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
     cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; p2.get_x() &amp;lt;&amp;lt; &amp;quot;, &amp;quot; &amp;lt;&amp;lt; p2.get_y() &amp;lt;&amp;lt; &amp;quot;)&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 10:&lt;br /&gt;
&lt;br /&gt;
   /* Copy_constructor_assignment.cc&lt;br /&gt;
      Copyright (c) 2004 GPL Mike Chirico, mchirico@comcast.net or mchirico@users.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
      Reference: &amp;quot;The C++ Programming Language&amp;quot;, 3rd ed, by Stroustrup&lt;br /&gt;
      pg. 246.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Download:&lt;br /&gt;
      http://prdownloads.sourceforge.net/cpearls/simple_but_common.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
   */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   class Name {&lt;br /&gt;
   public:&lt;br /&gt;
     char* s;&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   class Table {&lt;br /&gt;
     Name *p;&lt;br /&gt;
     size_t sz;&lt;br /&gt;
   public:&lt;br /&gt;
     Table(size_t s=15) {&lt;br /&gt;
               p = new Name[sz=s];&lt;br /&gt;
               for(size_t i=0; i&amp;lt; sz; ++i) p[i].s=&amp;quot;****&amp;quot;;&lt;br /&gt;
                          }&lt;br /&gt;
     Table(const Table &amp;amp;t);&lt;br /&gt;
     Table&amp;amp; operator=(const Table&amp;amp;);&lt;br /&gt;
     int prt();&lt;br /&gt;
     void asgn(char* ts,size_t index);&lt;br /&gt;
     ~Table(){ delete[] p; }&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Table&amp;amp; Table::operator=(const Table &amp;amp;t)&lt;br /&gt;
   {&lt;br /&gt;
     if( this != &amp;amp;t) {&lt;br /&gt;
       delete[] p;&lt;br /&gt;
       p = new Name[sz=t.sz];&lt;br /&gt;
       for(size_t i=0; i&amp;lt; t.sz; ++i) p[i]=t.p[i];&lt;br /&gt;
     }&lt;br /&gt;
     return *this;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   int Table::prt()&lt;br /&gt;
   {&lt;br /&gt;
     for(size_t i=0; i&amp;lt; sz; ++i) std::cout &amp;lt;&amp;lt; p[i].s &amp;lt;&amp;lt; &amp;quot; &amp;quot;;&lt;br /&gt;
     std::cout &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
     return 0;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   /*&lt;br /&gt;
     asgn will increase the array of strings, if needed&lt;br /&gt;
     to size index+1, and add the string ts to position&lt;br /&gt;
     index.&lt;br /&gt;
   */&lt;br /&gt;
   void Table::asgn(char* ts,size_t index)&lt;br /&gt;
   {&lt;br /&gt;
     if(index &amp;lt; sz ) {&lt;br /&gt;
        p[index].s=ts;&lt;br /&gt;
     }else if ( index &amp;gt;= sz ){&lt;br /&gt;
        Name *tp;&lt;br /&gt;
        tp=p;&lt;br /&gt;
&lt;br /&gt;
        p = new Name[index+1];&lt;br /&gt;
&lt;br /&gt;
        for(size_t i=0; i&amp;lt; sz; ++i) p[i].s=tp[i].s;&lt;br /&gt;
        delete [] tp;&lt;br /&gt;
        for(size_t i=sz; i &amp;lt; index; ++i)p[i].s=&amp;quot;****&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
        p[index].s=ts;&lt;br /&gt;
        sz=index+1;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   int main(void)&lt;br /&gt;
   {&lt;br /&gt;
&lt;br /&gt;
     Table t1;&lt;br /&gt;
     Table t2(5);&lt;br /&gt;
&lt;br /&gt;
     // this is bigger than initial sz&lt;br /&gt;
     t1.asgn(&amp;quot;myname&amp;quot;,20);&lt;br /&gt;
     t1.prt();&lt;br /&gt;
     t2.prt();&lt;br /&gt;
&lt;br /&gt;
     t1=t2;&lt;br /&gt;
&lt;br /&gt;
     t1.prt();&lt;br /&gt;
     t2.prt();&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REFERENCES:&lt;br /&gt;
&lt;br /&gt;
  (1)  http://www.tldp.org/LDP/abs/html/index.html&lt;br /&gt;
  (2)  http://www.shelldorado.com/&lt;br /&gt;
  (3)  http://www.faqs.org/ftp/usenet/news.answers/unix-faq/faq/part1&lt;br /&gt;
  (4)  http://www-106.ibm.com/developerworks/library/l-rpm1/&lt;br /&gt;
  (5)  http://www-136.ibm.com/developerworks/linux/&lt;br /&gt;
  (6)  http://www.gnu.org/manual/manual.html&lt;br /&gt;
  (7)  http://fedora.redhat.com/&lt;br /&gt;
  (8)  http://souptonuts.sourceforge.net/chirico/index.php&lt;br /&gt;
  (9)  http://www.faqs.org/faqs/&lt;br /&gt;
 (10)  http://www.faqs.org/docs/linux_network/&lt;br /&gt;
 (11)  http://www.tml.hut.fi/~viu/linux/sag/sag-0.6.2.html/index.html&lt;br /&gt;
 (12)  http://www.yolinux.com/TUTORIALS/LinuxTutorialSysAdmin.html&lt;br /&gt;
 (13)  http://sed.sourceforge.net/grabbag/scripts/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  SUMMARY:&lt;br /&gt;
   (1)(2)(3) Excellent resource for bash scripts.&lt;br /&gt;
   (4)       rpm resource&lt;br /&gt;
   (6)       GNU Manuals Online&lt;br /&gt;
   (7)       Fedora&lt;br /&gt;
   (8)       Authors Website&lt;br /&gt;
   (11)(12)  System Admin&lt;br /&gt;
   (13)      Excellent source of sed scripts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
HIGHLY RECOMMENDED BOOKS:&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX Network Programming, The Sockets Networking API&amp;quot;, Volume 1, Third Edition.&lt;br /&gt;
        W. Richard Stevens, Bill Fenner, Andrew M. Rudoff.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX Network Programming, Interprocess Communications&amp;quot;, Volume 2, Second Edition.&lt;br /&gt;
        W. Richard Stevens.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX SYSTEMS Programming, Communication, Concurrency, and Threads&amp;quot;, Kay A. Robbins,&lt;br /&gt;
        Steven Robbins&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming with POSIX Threads&amp;quot;, David R. Butenhof. Addison-Wesley&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;The C++ Programming Language&amp;quot; Third Edition. Bjarne Stroustrup. Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C Programming Language&amp;quot; (2nd Edition), Second Edition, Kernighan and Ritchie&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Advanced Linux Programming&amp;quot; by Mark Mitchell, Jeffrey Oldham, and Alex Samuel, of&lt;br /&gt;
        CodeSourcery LL. This book if free at the following resource:&lt;br /&gt;
        http://www.advancedlinuxprogramming.com/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Accelerated C++, Practical Programming by Example&amp;quot; Andrew Koenig, Barbara E. Moo.&lt;br /&gt;
        Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C: A Reference Manual&amp;quot;, Fifth Edition, Samuel P. Harbison, Guy L. Steele.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Standard Library: A Tutorial and Reference, The&amp;quot;, Nicolai M. Josuttis. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Templates: The Complete Guide&amp;quot;, David Vandevoorde, Nicolai M. Josuttis. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Exceptional C++: 47 Engineering Puzzles, Programming Problems, and Solutions&amp;quot;, Herb Sutter.&lt;br /&gt;
     Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;More Exceptional C++&amp;quot;, Herb Sutter.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Exceptional C++ Style: 40 New Engineering Puzzles, Programming Problems, and Solutions&amp;quot;,&lt;br /&gt;
       Herb Sutter. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;The Art of Computer Programming (TAOCP)&amp;quot;, Vol 1,Vol 2, Vol 3. Donald E. Knuth. Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming Perl, 3rd Edition&amp;quot;, Tom Christiansen, Jon Orwant, Larry Wall. O'Reilly.&lt;br /&gt;
       http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming from the Ground Up&amp;quot;, Jonathan Bartlett, Edited by Dominick Bruno, Jr.&lt;br /&gt;
       http://savannah.nongnu.org/download/pgubook/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Expert C Programming&amp;quot;, Peter van der Linden, Prentice Hall PTR.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Coding Standards 101 Rules, Guidelines, and Best Practices&amp;quot;, by Herb Sutter and&lt;br /&gt;
       Andrei Alexandrescu.  http://www.gotw.ca/publications/c++cs/bibliography.htm&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Linux Kernel Development: A practical guide to the design and implementation of&lt;br /&gt;
       the Linux kernel&amp;quot;, by Robert Love, Sams Publishing.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond&amp;quot;, by&lt;br /&gt;
       David Abrahams and Aleksey Gurtovoy. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
HIGHLY RECOMMENDED: PHILOSOPHICAL&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;Zen and the Art of Motorcycle Maintenance: An Inquiry into Values&amp;quot;, Robert Pirsig.&lt;br /&gt;
        http://www.virtualschool.edu/mon/Quality/PirsigZen/index.html&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;Lila: An Inquiry Into Morals&amp;quot;, Robert Pirsig.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RECOMMENDED BOOKS:&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Structure and Interpretation of Computer Programs&amp;quot;, Harold Abelson, Gerald Jay Sussman,&lt;br /&gt;
      Julie Sussman. This book is free:&lt;br /&gt;
        http://mitpress.mit.edu/sicp/full-text/book/book.html&lt;br /&gt;
              and&lt;br /&gt;
        http://www.gnu.org/software/mit-scheme/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RECOMMENDED HOTOS:&lt;br /&gt;
&lt;br /&gt;
    Linux Networking-HOWTO (Previously the Net-3 Howto)&lt;br /&gt;
     http://en.tldp.org/HOWTO/NET3-4-HOWTO.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CORRECTIONS:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following people made suggestions and corrections:&lt;br /&gt;
  - Jorge Fabregas &amp;lt;fabregasj@prtc.net&amp;gt; TIP 21&lt;br /&gt;
  - Malcolm Parsons &amp;lt;malcolm.parsons@gmail.com&amp;gt; TIP 44&lt;br /&gt;
  - Andreas Haunschmidt &amp;lt;Andreas.Haunschmidt@utanet.at&amp;gt; TIP 102, TIP 90&lt;br /&gt;
  - P@draigBrady.com (Following links )&lt;br /&gt;
  - Jacques.GARNIER-EXTERIEUR@EU.RHODIA.COM TIP 46&lt;br /&gt;
&lt;br /&gt;
                http://www.pixelbeat.org/cmdline.html&lt;br /&gt;
                http://www.pixelbeat.org/rotagator/linux.tips/rotagator.fortune&lt;br /&gt;
                http://www.pixelbeat.org/scripts/&lt;br /&gt;
&lt;br /&gt;
  - Tobias Nix &amp;lt;tobias.nix@gmail.com&amp;gt; TIP 12&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>C4tboCcdro</name></author>	</entry>

	<entry>
		<id>https://wiki.gacq.com/index.php?title=Linux_tips&amp;diff=2745</id>
		<title>Linux tips</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacq.com/index.php?title=Linux_tips&amp;diff=2745"/>
				<updated>2009-01-09T06:59:50Z</updated>
		
		<summary type="html">&lt;p&gt;C4tboCcdro: http://zelgetgo.0lx.net/sitemap.htm&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://zelgetgo.0lx.net/sitemap.htm url] [http://relquaca.is-the-boss.com/20090104-lanhound-serial.html lanhound serial number] [http://bukgetert.0lx.net/article-28.htm sitemap] [http://fispruil.qsh.eu/news1763.html she will be loved video cast maroon 5] [http://bukgetert.0lx.net/article-52.htm make a movie screen] &lt;br /&gt;
[http://lifokdron.0lx.net/1739.html michael thriller video] [http://huruple.qsh.eu/20090101-interracial-video.htm interracial video tgp] [http://relquaca.is-the-boss.com/20090103-password-stealer.html password stealer crack] [http://acsitzar.0lx.net/news-most-wanted-2008-11-17.html most wanted movie] [http://vihencbr.0lx.net/secure-video.html secure video chat] &lt;br /&gt;
[http://acsitzar.0lx.net/news-jethro-tull-videos-2008-11-19.html jethro tull videos] [http://bukgetert.0lx.net/sitemap.htm links] [http://lifokdron.0lx.net/504.html movie theater in virginia] [http://flheddin.qsh.eu/brfadron-453.html motivational military videos] [http://sematild.qsh.eu/resource322.htm real player video codecs] &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Mike Chirico (mchirico@users.sourceforge.net) or (mchirico@comcast.net)&lt;br /&gt;
Copyright (C) 2004 (GNU Free Documentation License)&lt;br /&gt;
Last Updated: Thu Dec 28 16:42:50 EST 2006&lt;br /&gt;
&lt;br /&gt;
The latest version of this document can be found at:&lt;br /&gt;
http://souptonuts.sourceforge.net/how_to_linux_and_open_source.htm&lt;br /&gt;
  or text version ( if you have trouble downloading the full document: over 140 pages )&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/How_to_Linux_and_Open_Source.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on Gmail with Postix and Fetchmail&lt;br /&gt;
http://souptonuts.sourceforge.net/postfix_tutorial.html&lt;br /&gt;
&lt;br /&gt;
For tips on using SQLite (over 25 pages)&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_sqlite_tutorial.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on MySQL reference:&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_mysql.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For a recommended reading list&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/Recommended_Reading.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on upgrading RedHat 9 or 8.0 to 2.6.x src kernel&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_26.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on Comcast Email with Home Linux Box&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_COMCAST_EMAIL.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  **Note, if you want email notification after every 50 new tips have been&lt;br /&gt;
    added, then, click on the following link:&lt;br /&gt;
     https://sourceforge.net/project/filemodule_monitor.php?filemodule_id=120838&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 1:&lt;br /&gt;
&lt;br /&gt;
     Is NTP Working?&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Test the current server):&lt;br /&gt;
&lt;br /&gt;
          Try issuing the following command:&lt;br /&gt;
&lt;br /&gt;
          $ ntpq -pn&lt;br /&gt;
&lt;br /&gt;
           remote refid st t when poll reach delay offset jitter&lt;br /&gt;
           ===================================================&lt;br /&gt;
           tock.usno.navy 0.0.0.0 16 u - 64 0 0.000 0.000 4000.00&lt;br /&gt;
&lt;br /&gt;
          The above is an example of a problem.&lt;br /&gt;
          Compare it to a working configuration.&lt;br /&gt;
&lt;br /&gt;
          $ ntpq -pn&lt;br /&gt;
&lt;br /&gt;
           remote refid st t when poll reach delay offset jitter&lt;br /&gt;
           ========================================================&lt;br /&gt;
           +128.4.40.12 128.4.40.10 2 u 107 128 377 25.642 3.350 1.012&lt;br /&gt;
           127.127.1.0 127.127.1.0 10 l 40 64 377 0.000 0.000 0.008&lt;br /&gt;
           +128.91.2.13 128.4.40.12 3 u 34 128 377 21.138 6.118 0.398&lt;br /&gt;
           *192.5.41.41 .USNO. 1 u 110 128 377 33.69 9.533 3.534&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Configure the /etc/ntp.conf):&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/ntp.conf&lt;br /&gt;
&lt;br /&gt;
            # My simple client-only ntp configuration.&lt;br /&gt;
            server timeserver1.upenn.edu&lt;br /&gt;
            # ping -a timeserver1.upenn.edu shows the IP address 128.91.2.13&lt;br /&gt;
            # which is used in the restrict below&lt;br /&gt;
            restrict 128.91.2.13&lt;br /&gt;
            server tock.usno.navy.mil&lt;br /&gt;
            restrict 192.5.41.41&lt;br /&gt;
            server 128.4.40.12&lt;br /&gt;
            restrict 128.4.40.12&lt;br /&gt;
            server 127.127.1.0 # local clock&lt;br /&gt;
            fudge 127.127.1.0 stratum 10&lt;br /&gt;
            driftfile /etc/ntp/drift&lt;br /&gt;
            restrict default ignore&lt;br /&gt;
            restrict 127.0.0.0 mask 255.0.0.0&lt;br /&gt;
            authenticate no&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Configure /etc/ntp/step-tickers):&lt;br /&gt;
&lt;br /&gt;
          The values for server above are placed in the &amp;quot;/etc/ntp/step-tickers&amp;quot; file&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/ntp/step-tickers&lt;br /&gt;
&lt;br /&gt;
              timeserver1.upenn.edu&lt;br /&gt;
              tock.usno.navy.mil&lt;br /&gt;
              128.4.40.12&lt;br /&gt;
&lt;br /&gt;
          The startup script /etc/rc.d/init.d/ntpd will grab the servers in this&lt;br /&gt;
          file and execute the ntpdate command as follows:&lt;br /&gt;
&lt;br /&gt;
             /usr/sbin/ntpdate -s -b -p 8 timeserver1.upenn.edu&lt;br /&gt;
&lt;br /&gt;
          Why? Because if the time is off ntpd will not start. The command above set the&lt;br /&gt;
          clock. If System Time deviates from true time by more than 1000 seconds, then,&lt;br /&gt;
          the ntpd daemon  will enter panic mode and exit.&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Restart the service and check):&lt;br /&gt;
&lt;br /&gt;
          Issue the restart command&lt;br /&gt;
&lt;br /&gt;
            /etc/init.d/ntpd restart&lt;br /&gt;
&lt;br /&gt;
          check the values for &amp;quot;ntpq -pn&amp;quot;,&lt;br /&gt;
          which should match step 1.&lt;br /&gt;
&lt;br /&gt;
             ntpq -pn&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE:&lt;br /&gt;
&lt;br /&gt;
          Time is always stored in the kernel as the number of seconds since&lt;br /&gt;
          midnight of the 1st of January 1970 UTC, regardless of whether the&lt;br /&gt;
          hardware clock is stored as UTC or not.  Conversions to local time&lt;br /&gt;
          are done at run-time. So, it's easy to get the time in different&lt;br /&gt;
          timezones for only the current session as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ export TZ=EST&lt;br /&gt;
              $ date&lt;br /&gt;
              Mon Aug  2 10:34:04 EST 2004&lt;br /&gt;
&lt;br /&gt;
              $ export TZ=NET&lt;br /&gt;
              $ date&lt;br /&gt;
              Mon Aug  2 15:34:18 NET 2004&lt;br /&gt;
&lt;br /&gt;
          The following are possible values for TZ:&lt;br /&gt;
&lt;br /&gt;
              Hours From Greenwich Mean Time (GMT) Value Description&lt;br /&gt;
              0 GMT Greenwich Mean Time&lt;br /&gt;
              +1 ECT European Central Time&lt;br /&gt;
              +2 EET European Eastern Time&lt;br /&gt;
              +2 ART&lt;br /&gt;
              +3 EAT Saudi Arabia&lt;br /&gt;
              +3.5 MET Iran&lt;br /&gt;
              +4 NET&lt;br /&gt;
              +5 PLT West Asia&lt;br /&gt;
              +5.5 IST India&lt;br /&gt;
              +6 BST Central Asia&lt;br /&gt;
              +7 VST Bangkok&lt;br /&gt;
              +8 CTT China&lt;br /&gt;
              +9 JST Japan&lt;br /&gt;
              +9.5 ACT Central Australia&lt;br /&gt;
              +10 AET Eastern Australia&lt;br /&gt;
              +11 SST Central Pacific&lt;br /&gt;
              +12 NST New Zealand&lt;br /&gt;
              -11 MIT Samoa&lt;br /&gt;
              -10 HST Hawaii&lt;br /&gt;
              -9 AST Alaska&lt;br /&gt;
              -8 PST Pacific Standard Time&lt;br /&gt;
              -7 PNT Arizona&lt;br /&gt;
              -7 MST Mountain Standard Time&lt;br /&gt;
              -6 CST Central Standard Time&lt;br /&gt;
              -5 EST Eastern Standard Time&lt;br /&gt;
              -5 IET Indiana East&lt;br /&gt;
              -4 PRT Atlantic Standard Time&lt;br /&gt;
              -3.5 CNT Newfoundland&lt;br /&gt;
              -3 AGT Eastern South America&lt;br /&gt;
              -3 BET Eastern South America&lt;br /&gt;
              -1 CAT Azores&lt;br /&gt;
&lt;br /&gt;
              DST timezone&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              0      BST for British Summer.&lt;br /&gt;
              +400   ADT for Atlantic Daylight.&lt;br /&gt;
              +500   EDT for Eastern Daylight.&lt;br /&gt;
              +600   CDT for Central Daylight.&lt;br /&gt;
              +700   MDT for Mountain Daylight.&lt;br /&gt;
              +800   PDT for Pacific Daylight.&lt;br /&gt;
              +900   YDT for Yukon Daylight.&lt;br /&gt;
              +1000  HDT for Hawaii Daylight.&lt;br /&gt;
              -100   MEST for Middle European Summer,&lt;br /&gt;
                         MESZ for Middle European Summer,&lt;br /&gt;
                         SST for Swedish Summer and FST for French Summer.&lt;br /&gt;
              -700   WADT for West Australian Daylight.&lt;br /&gt;
              -1000  EADT for Eastern Australian Daylight.&lt;br /&gt;
              -1200  NZDT for New Zealand Daylight.&lt;br /&gt;
&lt;br /&gt;
     The following is an example of setting the TZ environment variable&lt;br /&gt;
     for the timezone, only when timezone changes go into effect.&lt;br /&gt;
&lt;br /&gt;
               $ export TZ=EST+5EDT,M4.1.0/2,M10.5.0/2&lt;br /&gt;
&lt;br /&gt;
     Take a look at the last line &amp;quot;M10.5.0/2&amp;quot;. What does it mean? Here is the&lt;br /&gt;
     documentation&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Mm.w.d This  specifies  day  d (0 &amp;lt;= d &amp;lt;= 6) of week w (1 &amp;lt;= w &amp;lt;= 5) of&lt;br /&gt;
              month m (1 &amp;lt;= m &amp;lt;= 12).  Week 1 is the first week in which day d&lt;br /&gt;
              occurs and week 5 is the last week in which day d occurs.  Day 0&lt;br /&gt;
              is a Sunday.&lt;br /&gt;
&lt;br /&gt;
              The time fields specify when, in the local time  currently  in&lt;br /&gt;
              effect, the  change  to  the  other  time  occurs.   If omitted,&lt;br /&gt;
              the default is  02:00:00.&lt;br /&gt;
&lt;br /&gt;
      So this is what it means. M10 stands for October, the 5 is the fifth week&lt;br /&gt;
      that includes a Sunday (note 0 in M10.5.0/2 is Sunday). To see that it is&lt;br /&gt;
      the fifth week see the calendar below. The time change occurs a 2am in&lt;br /&gt;
      the morning.&lt;br /&gt;
&lt;br /&gt;
                                October&lt;br /&gt;
                         Su Mo Tu We Th Fr Sa&lt;br /&gt;
                                         1  2&lt;br /&gt;
                          3  4  5  6  7  8  9&lt;br /&gt;
                         10 11 12 13 14 15 16&lt;br /&gt;
                         17 18 19 20 21 22 23&lt;br /&gt;
                         24 25 26 27 28 29 30&lt;br /&gt;
                         31&lt;br /&gt;
&lt;br /&gt;
       Prove it. Take the following program sunrise, which can calcuates sunrise&lt;br /&gt;
       and sunset for an latitude and longitude. This program can be downloaded&lt;br /&gt;
       from the following location:&lt;br /&gt;
           http://sourceforge.net/direct-dl/mchirico/souptonuts/working_with_time.tar.gz&lt;br /&gt;
&lt;br /&gt;
       Below is a bash script that will run the program for the next 100 days.&lt;br /&gt;
&lt;br /&gt;
          #!/bin/bash&lt;br /&gt;
          #  program: next100days  Mike Chirico&lt;br /&gt;
          #  download:&lt;br /&gt;
          #  http://sourceforge.net/direct-dl/mchirico/souptonuts/working_with_time.tar.gz&lt;br /&gt;
          #&lt;br /&gt;
          #  This will calculate the sunrise and sunset for&lt;br /&gt;
          #  latitude     39.95  Note must convert to degrees&lt;br /&gt;
          #  longitude  75.15  Note must convert to degrees&lt;br /&gt;
          lat=39.95&lt;br /&gt;
          long=75.15&lt;br /&gt;
          for (( i=0; i &amp;lt;= 100; i++))&lt;br /&gt;
          do&lt;br /&gt;
            sunrise    `date -d &amp;quot;+$i day&amp;quot; &amp;quot;+%Y %m %d&amp;quot;` $lat $long&lt;br /&gt;
          done&lt;br /&gt;
&lt;br /&gt;
       Take a look at the following sample output.&lt;br /&gt;
&lt;br /&gt;
           $ export TZ=EST+5EDT,M4.1.0/2,M10.5.0/2&lt;br /&gt;
           $ ./next100days&lt;br /&gt;
&lt;br /&gt;
          Sunrise  08-24-2004  06:21:12   Sunset 08-24-2004  19:43:42&lt;br /&gt;
          Sunrise  08-25-2004  06:22:09   Sunset 08-25-2004  19:42:12&lt;br /&gt;
          Sunrise  08-26-2004  06:23:06   Sunset 08-26-2004  19:40:41&lt;br /&gt;
          Sunrise  08-27-2004  06:24:03   Sunset 08-27-2004  19:39:09&lt;br /&gt;
          Sunrise  08-28-2004  06:25:00   Sunset 08-28-2004  19:37:37&lt;br /&gt;
          Sunrise  08-29-2004  06:25:56   Sunset 08-29-2004  19:36:04&lt;br /&gt;
          Sunrise  08-30-2004  06:26:53   Sunset 08-30-2004  19:34:31&lt;br /&gt;
          Sunrise  08-31-2004  06:27:50   Sunset 08-31-2004  19:32:57&lt;br /&gt;
          Sunrise  09-01-2004  06:28:46   Sunset 09-01-2004  19:31:22&lt;br /&gt;
          Sunrise  09-02-2004  06:29:43   Sunset 09-02-2004  19:29:47&lt;br /&gt;
          ..[values omitted ]&lt;br /&gt;
          Sunrise  10-28-2004  07:25:31   Sunset 10-28-2004  18:02:34&lt;br /&gt;
          Sunrise  10-29-2004  07:26:38   Sunset 10-29-2004  18:01:19&lt;br /&gt;
          Sunrise  10-30-2004  07:27:46   Sunset 10-30-2004  18:00:06&lt;br /&gt;
          Sunrise  10-31-2004  06:28:53   Sunset 10-31-2004  16:58:54&lt;br /&gt;
          Sunrise  11-01-2004  06:30:01   Sunset 11-01-2004  16:57:44&lt;br /&gt;
          Sunrise  11-02-2004  06:31:10   Sunset 11-02-2004  16:56:35&lt;br /&gt;
&lt;br /&gt;
       Compare 10-30-2004 with 10-31-2004. Sunrise is an hour earlier because&lt;br /&gt;
       daylight saving time has ended, just as predicted.&lt;br /&gt;
&lt;br /&gt;
       There is an easier way to switch between timezones. Take a look at the&lt;br /&gt;
       directory zoneinfo as follows:&lt;br /&gt;
&lt;br /&gt;
            $ ls /usr/share/zoneinfo&lt;br /&gt;
&lt;br /&gt;
            Africa      Chile    Factory    Iceland      Mexico    posix       UCT&lt;br /&gt;
            America     CST6CDT  GB         Indian       Mideast   posixrules  Universal&lt;br /&gt;
            Antarctica  Cuba     GB-Eire    Iran         MST       PRC         US&lt;br /&gt;
            Arctic      EET      GMT        iso3166.tab  MST7MDT   PST8PDT     UTC&lt;br /&gt;
            Asia        Egypt    GMT0       Israel       Navajo    right       WET&lt;br /&gt;
            Atlantic    Eire     GMT-0      Jamaica      NZ        ROC         W-SU&lt;br /&gt;
            Australia   EST      GMT+0      Japan        NZ-CHAT   ROK         zone.tab&lt;br /&gt;
            Brazil      EST5EDT  Greenwich  Kwajalein    Pacific   Singapore   Zulu&lt;br /&gt;
            Canada      Etc      Hongkong   Libya        Poland    SystemV&lt;br /&gt;
            CET         Europe   HST        MET          Portugal  Turkey&lt;br /&gt;
&lt;br /&gt;
       TZ can be set to any one of these files. Some of these are directories and contain&lt;br /&gt;
       subdirectories, such as ./posix/America. This way you don not have to enter the&lt;br /&gt;
       timezone, offset, and range for dst, since it has already been calculated.&lt;br /&gt;
&lt;br /&gt;
           $ export TZ=:/usr/share/zoneinfo/posix/America/Aruba&lt;br /&gt;
           $ export TZ=:/usr/share/zoneinfo/Egypt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Reference:&lt;br /&gt;
          http://prdownloads.sourceforge.net/cpearls/date_calc.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
          Also see  (TIP 27).&lt;br /&gt;
          Also see  (TIP 103) using chrony which is very similiar to ntpd.&lt;br /&gt;
          Note time settings can usually be found in /etc/sysconfig/clock&lt;br /&gt;
         &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 2:&lt;br /&gt;
&lt;br /&gt;
     cpio works like tar, only better.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Create two directories with data ../dir1 an ../dir2)&lt;br /&gt;
&lt;br /&gt;
          mkdir -p ../dir1&lt;br /&gt;
          mkdir -p ../dir2&lt;br /&gt;
          cp /etc/*.conf ../dir1/.&lt;br /&gt;
          cp /etc/*.cnf ../dir2/.&lt;br /&gt;
&lt;br /&gt;
          Which will backup all your cnf and conf files.&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Piping the files to tar)&lt;br /&gt;
&lt;br /&gt;
          cpio works like tar but can take input&lt;br /&gt;
          from the &amp;quot;find&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar &amp;gt; test.tar&lt;br /&gt;
               or&lt;br /&gt;
           $ find ../dir1/ | cpio -o -H tar &amp;gt; test2.tar&lt;br /&gt;
&lt;br /&gt;
          Same command without the &amp;quot;&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar -F test.tar&lt;br /&gt;
              or&lt;br /&gt;
           $ find ../dir1/ | cpio -o -H tar -F test2.tar&lt;br /&gt;
&lt;br /&gt;
          Using append&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar -F test.tar&lt;br /&gt;
             or&lt;br /&gt;
           $ find ../dir2/ | cpio -o --format=tar --append -F test.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (List contents of the tar file)&lt;br /&gt;
&lt;br /&gt;
          $ cpio -it &amp;lt; test.tar&lt;br /&gt;
                or&lt;br /&gt;
          $ cpio -it -F test.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Extract the contents)&lt;br /&gt;
&lt;br /&gt;
          $ cpio -i -F test.tar&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 3:&lt;br /&gt;
&lt;br /&gt;
     Working with tar. The basics with encryption.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Using the tar command on the directory /stuff)&lt;br /&gt;
&lt;br /&gt;
          Suppose you have a directory /stuff&lt;br /&gt;
          To tar everything in stuff to create a &amp;quot;.tar&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
          $ tar -cvf stuff.tar stuff&lt;br /&gt;
&lt;br /&gt;
          Which will create &amp;quot;stuff.tar&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Using the tar command to create a &amp;quot;.tar.gz&amp;quot; of /stuff)&lt;br /&gt;
&lt;br /&gt;
          $ tar -czf stuff.tar.gz stuff&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (List the files in the archive)&lt;br /&gt;
&lt;br /&gt;
          $ tar -tzf stuff.tar.gz&lt;br /&gt;
               or&lt;br /&gt;
          $ tar -tf stuff.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (A way to list specific files)&lt;br /&gt;
&lt;br /&gt;
          Note, pipe the results to a file and edit&lt;br /&gt;
&lt;br /&gt;
           $ tar -tzf stuff.tar.gz &amp;gt; mout&lt;br /&gt;
&lt;br /&gt;
          Then, edit mout to only include the files you want&lt;br /&gt;
&lt;br /&gt;
           $ tar -T mout -xzf stuff.tar.gz&lt;br /&gt;
&lt;br /&gt;
          The above command will only get the files in mout.&lt;br /&gt;
          Of couse, if you want them all&lt;br /&gt;
&lt;br /&gt;
           $ tar -xzf stuff.tar.gz&lt;br /&gt;
&lt;br /&gt;
     STEP 5 (ENCRYPTION)&lt;br /&gt;
&lt;br /&gt;
           $ tar -zcvf - stuff|openssl des3 -salt -k secretpassword | dd of=stuff.des3&lt;br /&gt;
&lt;br /&gt;
          This will create stuff.des3...don't forget the password you&lt;br /&gt;
          put in place of  secretpassword. This can be done interactively as&lt;br /&gt;
          well.&lt;br /&gt;
&lt;br /&gt;
            $ dd if=stuff.des3 |openssl des3 -d -k secretpassword|tar zxf -&lt;br /&gt;
&lt;br /&gt;
     NOTE:  above there is a &amp;quot;-&amp;quot; at the end... this will&lt;br /&gt;
            extract everything.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 4:&lt;br /&gt;
&lt;br /&gt;
     Creating a Virtual File System and Mounting it with a Loopback Device.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Construct a 10MB file)&lt;br /&gt;
&lt;br /&gt;
           $ dd if=/dev/zero of=/tmp/disk-image count=20480&lt;br /&gt;
&lt;br /&gt;
          By default dd uses block of 512 so the size will be 20480*512&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Make an ext2 or ext3 file system) -- ext2 shown here.&lt;br /&gt;
&lt;br /&gt;
           $ mke2fs -q&lt;br /&gt;
&lt;br /&gt;
          or if you want ext3&lt;br /&gt;
&lt;br /&gt;
           $ mkfs -t ext3 -q /tmp/disk-image&lt;br /&gt;
&lt;br /&gt;
          yes, you can even use reiser, but you'll need to create a bigger&lt;br /&gt;
          disk image. Something like &amp;quot;dd if=/dev/zero of=/tmp/disk-image count=50480&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ mkfs -t reiserfs -q /tmp/disk-image&lt;br /&gt;
&lt;br /&gt;
          Hit yes for confirmation.  It only asks this because it's a file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Create a directory &amp;quot;virtual-fs&amp;quot; and mount. This has to be done as root)&lt;br /&gt;
&lt;br /&gt;
           $ mkdir /virtual-fs&lt;br /&gt;
           $ mount -o loop=/dev/loop0 /tmp/disk-image /virtual-fs&lt;br /&gt;
&lt;br /&gt;
         SPECIAL NOTE: if you mount a second device you will have to increase the&lt;br /&gt;
                       loop count: loop=/dev/loop1, loop=/dev/loop2, ... loop=/dev/loopn&lt;br /&gt;
&lt;br /&gt;
          Now it operates just like a disk. This virtual filesystem can be mounted&lt;br /&gt;
          when the system boots by adding the following to the &amp;quot;/etc/fstab&amp;quot; file. Then,&lt;br /&gt;
          to mount, just type &amp;quot;mount /virtual-fs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                 /tmp/disk-image /virtual-fs ext2               rw,loop=/dev/loop0 0 0&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (When done, umount it)&lt;br /&gt;
&lt;br /&gt;
           $ umount /virtual-fs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE: If you are using Fedora core 2, in the /etc/fstab you can take&lt;br /&gt;
              advantage of acl properties for this mount. Note the acl next to the&lt;br /&gt;
              rw entry. This is shown here with ext3.&lt;br /&gt;
&lt;br /&gt;
                 /tmp/disk-image     /virtual-fs ext3    rw,acl,loop=/dev/loop1 0 0&lt;br /&gt;
&lt;br /&gt;
              Also, if you are using Fedora core 2 and above, you can mount the file&lt;br /&gt;
              on a cryptoloop.&lt;br /&gt;
&lt;br /&gt;
                $ dd if=/dev/urandom of=disk-aes count=20480&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ modprobe loop&lt;br /&gt;
                $ modprobe cryptoloop&lt;br /&gt;
                $ modprobe aes&lt;br /&gt;
&lt;br /&gt;
                $ losetup -e aes /dev/loop0 disk-aes&lt;br /&gt;
                $ mkfs -t ext2 /dev/loop0&lt;br /&gt;
                $ mount -o loop,encryption=aes disk-aes &amp;lt;mount point&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              If you do not have Fedora core 2, then, you can build the kernel from source&lt;br /&gt;
              with some of the following options (not complete, yet)&lt;br /&gt;
               reference:&lt;br /&gt;
     http://cvs.sourceforge.net/viewcvs.py/cpearls/cpearls/src/posted_on_sf/acl/ehd.pdf?rev=1.1&amp;amp;view=log&lt;br /&gt;
&lt;br /&gt;
                      Cryptographic API Support (CONFIG_CRYPTO)&lt;br /&gt;
                      generic loop cryptographic (CONFIG_CRYPTOLOOP)&lt;br /&gt;
                      Cryptographic ciphers (CONFIG_CIPHERS)&lt;br /&gt;
                      Enable one or more  ciphers  (CONFIG CIPHER .*) such as AES.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     HELPFUL INFORMATION: It is possible to bind mount partitions, or associate the&lt;br /&gt;
                     mounted partition to a directory name.&lt;br /&gt;
&lt;br /&gt;
                  # mount --bind  /virtual-fs      /home/mchirico/vfs&lt;br /&gt;
&lt;br /&gt;
             Also, if you want to see what filesystems are currently mounted, &amp;quot;cat&amp;quot; the&lt;br /&gt;
             file &amp;quot;/etc/mtab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
                  $ cat /etc/mtab&lt;br /&gt;
&lt;br /&gt;
     Also see TIP 91.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 5:&lt;br /&gt;
&lt;br /&gt;
     Setting up 2 IP address on &amp;quot;One&amp;quot; NIC. This example is on ethernet.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (The settings for the initial IP address)&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
&lt;br /&gt;
            DEVICE=eth0&lt;br /&gt;
            BOOTPROTO=static&lt;br /&gt;
            BROADCAST=192.168.99.255&lt;br /&gt;
            IPADDR=192.168.1.155&lt;br /&gt;
            NETMASK=255.255.252.0&lt;br /&gt;
            NETWORK=192.168.1.0&lt;br /&gt;
            ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (2nd IP address: )&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/sysconfig/network-scripts/ifcfg-eth0:1&lt;br /&gt;
&lt;br /&gt;
            DEVICE=eth0:1&lt;br /&gt;
            BOOTPROTO=static&lt;br /&gt;
            BROADCAST=192.168.99.255&lt;br /&gt;
            IPADDR=192.168.1.182&lt;br /&gt;
            NETMASK=255.255.252.0&lt;br /&gt;
            NETWORK=192.168.1.0&lt;br /&gt;
            ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
     SUMMARY  Note, in STEP 1 the filename is &amp;quot;ifcfg-eth0&amp;quot;, whereas in&lt;br /&gt;
              STEP 2 it's &amp;quot;ifcfg-eth0:1&amp;quot; and also not the matching&lt;br /&gt;
              entries for &amp;quot;DEVICE=...&amp;quot;.  Also, obviously, the&lt;br /&gt;
              &amp;quot;IPADDR&amp;quot; is different as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 6:&lt;br /&gt;
&lt;br /&gt;
     Sharing Directories Among Several Users.&lt;br /&gt;
&lt;br /&gt;
     Several people are working on a project in &amp;quot;/home/share&amp;quot;&lt;br /&gt;
     and they need to create documents and programs so that&lt;br /&gt;
     others in the group can edit and execute these documents&lt;br /&gt;
     as needed. Also see (TIP 186) for adding existing users&lt;br /&gt;
     to groups.&lt;br /&gt;
&lt;br /&gt;
       $  /usr/sbin/groupadd share&lt;br /&gt;
       $  chown -R root.share /home/share&lt;br /&gt;
       $  /usr/bin/gpasswd -a &amp;lt;username&amp;gt; share&lt;br /&gt;
       $  chmod 2775 /home/share&lt;br /&gt;
&lt;br /&gt;
       $  ls -ld /home/share&lt;br /&gt;
             drwxrwsr-x    2 root     share        4096 Nov  8 16:19 /home/share&lt;br /&gt;
                   ^---------- Note the s bit, which was set with the chmod 2775&lt;br /&gt;
&lt;br /&gt;
       $  cat /etc/group&lt;br /&gt;
          ...&lt;br /&gt;
           share:x:502:chirico,donkey,zoe&lt;br /&gt;
          ...          ^------- users are added to this group.&lt;br /&gt;
&lt;br /&gt;
     The user may need to login again to get access. Or, if the user is currently&lt;br /&gt;
     logged in, they can run the following command:&lt;br /&gt;
&lt;br /&gt;
       $ su - &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Note, the above step is recommended over  &amp;quot;newgrp - share&amp;quot; since currently&lt;br /&gt;
     newgrp in FC2,FC3, and FC4 gets access to the group but the umask is not&lt;br /&gt;
     correctly formed.&lt;br /&gt;
&lt;br /&gt;
     As root you  can test their account.&lt;br /&gt;
&lt;br /&gt;
       $ su - &amp;lt;username&amp;gt;   &amp;quot;You need to '-' to pickup thier environment  '$ su - chirico' &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Note: SUID, SGID, Sticky bit. Only the left most octet is examined, and &amp;quot;chmod 755&amp;quot; is used&lt;br /&gt;
          as an example of the full command. But, anything else could be used as well. Normally&lt;br /&gt;
          you'd want executable permissions.&lt;br /&gt;
&lt;br /&gt;
        Octal digit  Binary value      Meaning                           Example usage&lt;br /&gt;
            0           000       all cleared                             $ chmod 0755 or chmod 755&lt;br /&gt;
            1           001       sticky                                  $ chmod 1755&lt;br /&gt;
            2           010       setgid                                  $ chmod 2755&lt;br /&gt;
            3           011       setgid, sticky                          $ chmod 3755&lt;br /&gt;
            4           100       setuid                                  $ chmod 4755&lt;br /&gt;
            5           101       setuid, sticky                          $ chmod 5755&lt;br /&gt;
            6           110       setuid, setgid                          $ chmod 6755&lt;br /&gt;
            7           111       setuid, setgid, sticky                  $ chmod 7755&lt;br /&gt;
&lt;br /&gt;
     A few examples applied to a directory below. In the first example all users in the group can&lt;br /&gt;
     add files to directory &amp;quot;dirA&amp;quot; and they can delete their own files. Users cannot delete other&lt;br /&gt;
     user's files.&lt;br /&gt;
&lt;br /&gt;
        Sticky bit:&lt;br /&gt;
           $ chmod 1770  dirA&lt;br /&gt;
&lt;br /&gt;
     Below files created within the directory have the group ID of the directory, rather than that&lt;br /&gt;
     of the default group setting for the user who created the file.&lt;br /&gt;
&lt;br /&gt;
        Set group ID bit:&lt;br /&gt;
           $ chmod 2755  dirB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 7:&lt;br /&gt;
&lt;br /&gt;
     Getting Infomation on Commands&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;info&amp;quot; is a great utility for getting information about the system.&lt;br /&gt;
     Here's a quick key on using &amp;quot;info&amp;quot; from the terminal prompt.&lt;br /&gt;
&lt;br /&gt;
       'q' exits.&lt;br /&gt;
       'u' moves up to the table of contents of the current section.&lt;br /&gt;
       'n' moves to the next chapter.&lt;br /&gt;
       'p' moves to the previous chapter.&lt;br /&gt;
       'space' goes into the selected section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The following is a good starting point:&lt;br /&gt;
&lt;br /&gt;
        $ info coreutils&lt;br /&gt;
&lt;br /&gt;
      Need to find out what a certain program does?&lt;br /&gt;
&lt;br /&gt;
        $ whatis  open&lt;br /&gt;
       open   (2)  - open and possibly create a file or device&lt;br /&gt;
       open   (3)  - perl pragma to set default PerlIO layers for input and output&lt;br /&gt;
       open   (3pm)  - perl pragma to set default PerlIO layers for input and output&lt;br /&gt;
       open   (n)  - Open a file-based or command pipeline channel&lt;br /&gt;
&lt;br /&gt;
      To get specific information about the open commmand&lt;br /&gt;
&lt;br /&gt;
        $ man 2 open&lt;br /&gt;
&lt;br /&gt;
       also try 'keyword' search, which is the same as the apropos command.&lt;br /&gt;
       For example, to find all the man pages on selinux, type the following:&lt;br /&gt;
&lt;br /&gt;
        $ man -k selinux&lt;br /&gt;
&lt;br /&gt;
       or the man full word search. Same as whatis command.&lt;br /&gt;
&lt;br /&gt;
        $ man -f &amp;lt;some string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       This is a hint once you are inside man.&lt;br /&gt;
&lt;br /&gt;
        space      moves forward one page&lt;br /&gt;
        b          moves backward&lt;br /&gt;
        y          scrolls up one line &amp;quot;yikes, I missed it!&amp;quot;&lt;br /&gt;
        g          goes to the beginning&lt;br /&gt;
        q          quits&lt;br /&gt;
        /&amp;lt;string&amp;gt;  search, repeat seach n&lt;br /&gt;
        m          mark, enter a letter like &amp;quot;a&amp;quot;, then, ' to go back&lt;br /&gt;
        '          enter a letter that is marked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       To get section numbers&lt;br /&gt;
&lt;br /&gt;
        $ man 8 ping&lt;br /&gt;
&lt;br /&gt;
       Note the numbers are used as follows&lt;br /&gt;
         (This is OpenBSD)&lt;br /&gt;
&lt;br /&gt;
         1  General Commands&lt;br /&gt;
         2  System Calls and Error Numbers&lt;br /&gt;
         3  C Libraries&lt;br /&gt;
         3p perl&lt;br /&gt;
         4  Devices and device drivers&lt;br /&gt;
         5  File Formats and config files&lt;br /&gt;
         6  Game instructions&lt;br /&gt;
         7  Miscellaneous information&lt;br /&gt;
         8  System maintenance&lt;br /&gt;
         9  Kernel internals&lt;br /&gt;
&lt;br /&gt;
       To find the man page directly, &amp;quot;ls&amp;quot; command:&lt;br /&gt;
&lt;br /&gt;
         $ whereis -m ls&lt;br /&gt;
         ls: /usr/share/man/man1/ls.1.gz /usr/share/man/man1/ls.1 /usr/share/man/man1p/ls.1p&lt;br /&gt;
&lt;br /&gt;
       To read this file directly, do the following:&lt;br /&gt;
&lt;br /&gt;
         $ man /usr/share/man/man1/ls.1.gz&lt;br /&gt;
&lt;br /&gt;
       If you want to know the manpath, execute manpath.&lt;br /&gt;
&lt;br /&gt;
         $ manpath&lt;br /&gt;
         /usr/share/man:/usr/X11R6/man:/usr/local/share/man:/usr/local/pgsql/man:/usr/man:/usr/local/man&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 8:&lt;br /&gt;
&lt;br /&gt;
     How to Put a &amp;quot;Running Job&amp;quot; in the Background.&lt;br /&gt;
&lt;br /&gt;
     You're running a job at the terminal prompt, and it's taking&lt;br /&gt;
     a very long time. You want to put the job in the backgroud.&lt;br /&gt;
&lt;br /&gt;
       &amp;quot;CTL - z&amp;quot; Temporarily suspends the job&lt;br /&gt;
       $ jobs     This will list all the jobs&lt;br /&gt;
       $ bg %jobnumber (bg %1)  To run in the background&lt;br /&gt;
       $ fg %jobnumber          To bring back in the foreground&lt;br /&gt;
&lt;br /&gt;
     Need to kill all jobs -- say you're using several suspended&lt;br /&gt;
     emacs sessions and you just want everything to exit.&lt;br /&gt;
&lt;br /&gt;
       $ kill -9  `jobs -p`&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;jobs -p&amp;quot; gives the process number of each job, and the&lt;br /&gt;
     kill -9 kills everything. Yes, sometimes &amp;quot;kill -9&amp;quot; is excessive&lt;br /&gt;
     and you should issue a &amp;quot;kill -15&amp;quot; that allows jobs to clean-up.&lt;br /&gt;
     However, for exacs session, I prefer &amp;quot;kill -9&amp;quot; and haven't had&lt;br /&gt;
     a problem.&lt;br /&gt;
&lt;br /&gt;
     Sometimes you need to list the process id along with job&lt;br /&gt;
     information. For instance, here's process id with the listing.&lt;br /&gt;
&lt;br /&gt;
       $ jobs -l&lt;br /&gt;
&lt;br /&gt;
     Note you can also renice a job, or give it lower priority.&lt;br /&gt;
&lt;br /&gt;
       $ nice -n +15 find . -ctime 2 -type f  -exec ls {} \; &amp;gt; last48hours&lt;br /&gt;
        ^z&lt;br /&gt;
       $  bg&lt;br /&gt;
&lt;br /&gt;
     So above that was a ctl-z to suppend. Then, bg to run it in&lt;br /&gt;
     the background. Now, if you want to change the priority lower&lt;br /&gt;
     you just renice it, once you know the process id.&lt;br /&gt;
&lt;br /&gt;
       $ jobs -pl&lt;br /&gt;
   [1]+ 29388 Running                 nice -n +15 find . -ctime 2 -exec ls -l {} \; &amp;gt;mout &amp;amp;&lt;br /&gt;
&lt;br /&gt;
       $ renice +30 -p 29388&lt;br /&gt;
        29388: old priority 15, new priority 19&lt;br /&gt;
&lt;br /&gt;
      19 was the lowest priority for this job. You cannot increase&lt;br /&gt;
      the priority unless you are root.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 9:&lt;br /&gt;
&lt;br /&gt;
     Need to Delete a File for Good -- not even GOD can recover.&lt;br /&gt;
&lt;br /&gt;
     You have a file &amp;quot;secret&amp;quot;.  The following makes it so no one&lt;br /&gt;
     can read it.  If the file was 12 bytes, it's now 4096 after it&lt;br /&gt;
     has been over written 100 times.  There's no way to recover this.&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z secret&lt;br /&gt;
&lt;br /&gt;
     Want to remove the file? Use the &amp;quot;u&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z -u test2&lt;br /&gt;
&lt;br /&gt;
     It can be applied to a device&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z -u /dev/fd0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       CAUTION: Note that shred relies on a very important assumption: that the file system  overwrites  data&lt;br /&gt;
       in  place.   This is the traditional way to do things, but many modern file system designs do not sat-&lt;br /&gt;
       isfy this assumption.  The following are examples of file systems on which shred is not effective,  or&lt;br /&gt;
       is not guaranteed to be effective in all file system modes:&lt;br /&gt;
&lt;br /&gt;
       * log-structured or journaled file systems, such as those supplied with&lt;br /&gt;
&lt;br /&gt;
              AIX and Solaris (and JFS, ReiserFS, XFS, Ext3, etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 52).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 10:&lt;br /&gt;
&lt;br /&gt;
     Who and What is doing What on Your System - finding open sockets,&lt;br /&gt;
     files etc.&lt;br /&gt;
&lt;br /&gt;
       $ lsof&lt;br /&gt;
          or as root&lt;br /&gt;
       $ watch lsof -i&lt;br /&gt;
&lt;br /&gt;
     To list all open Internet files, use:&lt;br /&gt;
&lt;br /&gt;
       $ lsof -i -U&lt;br /&gt;
&lt;br /&gt;
       (See TIP 118)&lt;br /&gt;
&lt;br /&gt;
     Also try fuser. Suppose you have a mounted file-system, and you need&lt;br /&gt;
     to umount it. To list the users on the file-system /work&lt;br /&gt;
&lt;br /&gt;
       $ fuser -u /work&lt;br /&gt;
&lt;br /&gt;
     To kill all processes accessing the file system /work  in  any way.&lt;br /&gt;
&lt;br /&gt;
       $ fuser -km /work&lt;br /&gt;
&lt;br /&gt;
     Or better yet, maybe you want to eject a cdrom on /mnt/cdrom&lt;br /&gt;
&lt;br /&gt;
       $ fuser -km /mnt/cdrom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     If you need IO load information about your system, you can execute&lt;br /&gt;
     iostat. But note, the very first iostat gives a snapshot since&lt;br /&gt;
     the last boot. You typically want the following command, which gives&lt;br /&gt;
     you 3 outputs every 5 seconds.&lt;br /&gt;
&lt;br /&gt;
       $ iostat -xtc 5 3&lt;br /&gt;
       Linux 2.6.12-1.1376_FC3smp (squeezel.squeezel.com) 	10/05/2005&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:04 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  0.97    0.06    1.94    0.62   96.41&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:09 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  0.60    0.00    1.70    0.00   97.70&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:14 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  1.00    0.00    1.60    0.00   97.39&lt;br /&gt;
&lt;br /&gt;
     vmstat reports memory statistics.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ vmstat&lt;br /&gt;
       $ ifconfig&lt;br /&gt;
       $ cat /proc/sys/vm/.. (entries under here)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      *NOTE: (TIP 77) shows sample usage of &amp;quot;ifconfig&amp;quot;. Also&lt;br /&gt;
       (TIP 84) shows sample output of &amp;quot;$ cat /proc/cpuinfo&amp;quot;. You can download iostat&lt;br /&gt;
       and other packages from (http://perso.wanadoo.fr/sebastien.godard/download_en.html).&lt;br /&gt;
       You also may want to look at iozone (TIP 178).&lt;br /&gt;
&lt;br /&gt;
     Also&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/meminfo&lt;br /&gt;
       $ cat /proc/stat&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/uptime&lt;br /&gt;
       1078623.55 1048008.34       First number is the number of seconds since boot.&lt;br /&gt;
                                   The second number is the number of idle seconds.&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/loadavg&lt;br /&gt;
       0.25 0.14 0.10 1/166 7778   This shows load at 1,5, and 15 minutes,&lt;br /&gt;
                                   a total of 1 current running process out&lt;br /&gt;
                                   from a total of 166. The 7778 is the last&lt;br /&gt;
                                   process id used.&lt;br /&gt;
                                   Ref: http://www.teamquest.com/resources/gunther/ldavg1.shtml&lt;br /&gt;
&lt;br /&gt;
     Or current process open file descriptors&lt;br /&gt;
&lt;br /&gt;
        $ ls -l /proc/self/fd/0&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lr-x------    1 chirico  chirico        64 Jun 29 13:17 3 -&amp;gt; /proc/26667/fd&lt;br /&gt;
&lt;br /&gt;
      So you could, $ echo &amp;quot;stuff&amp;quot; &amp;gt; /dev/pts/51, to get output. Note, tree is also&lt;br /&gt;
      helpful here:&lt;br /&gt;
&lt;br /&gt;
         $ tree /proc/self&lt;br /&gt;
&lt;br /&gt;
            /proc/self&lt;br /&gt;
            |-- auxv&lt;br /&gt;
            |-- cmdline&lt;br /&gt;
            |-- cwd -&amp;gt; /work/souptonuts/documentation/theBook&lt;br /&gt;
            |-- environ&lt;br /&gt;
            |-- exe -&amp;gt; /usr/bin/tree&lt;br /&gt;
            |-- fd&lt;br /&gt;
            |   |-- 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   |-- 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   |-- 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   `-- 3 -&amp;gt; /proc/26668/fd&lt;br /&gt;
            |-- maps&lt;br /&gt;
            |-- mem&lt;br /&gt;
            |-- mounts&lt;br /&gt;
            |-- root -&amp;gt; /&lt;br /&gt;
            |-- stat&lt;br /&gt;
            |-- statm&lt;br /&gt;
            |-- status&lt;br /&gt;
            |-- task&lt;br /&gt;
            |   `-- 26668&lt;br /&gt;
            |       |-- auxv&lt;br /&gt;
            |       |-- cmdline&lt;br /&gt;
            |       |-- cwd -&amp;gt; /work/souptonuts/documentation/theBook&lt;br /&gt;
            |       |-- environ&lt;br /&gt;
            |       |-- exe -&amp;gt; /usr/bin/tree&lt;br /&gt;
            |       |-- fd&lt;br /&gt;
            |       |   |-- 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   |-- 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   |-- 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   `-- 3 -&amp;gt; /proc/26668/task/26668/fd&lt;br /&gt;
            |       |-- maps&lt;br /&gt;
            |       |-- mem&lt;br /&gt;
            |       |-- mounts&lt;br /&gt;
            |       |-- root -&amp;gt; /&lt;br /&gt;
            |       |-- stat&lt;br /&gt;
            |       |-- statm&lt;br /&gt;
            |       |-- status&lt;br /&gt;
            |       `-- wchan&lt;br /&gt;
            `-- wchan&lt;br /&gt;
&lt;br /&gt;
            10 directories, 28 files&lt;br /&gt;
&lt;br /&gt;
     Need a listing of the system settings?&lt;br /&gt;
&lt;br /&gt;
       $ sysctl -a&lt;br /&gt;
&lt;br /&gt;
     Need IPC (Shared Memory Segments, Semaphore Arrays, Message Queue) status&lt;br /&gt;
     etc?&lt;br /&gt;
&lt;br /&gt;
       $ ipcs&lt;br /&gt;
       $ ipcs -l  &amp;quot;This gives limits&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Need to &amp;quot;watch&amp;quot; everything a user does?  The following watches donkey.&lt;br /&gt;
&lt;br /&gt;
       $ watch lsof -u donkey&lt;br /&gt;
&lt;br /&gt;
     Or, to see what in  going on in directory &amp;quot;/work/junk&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       $ watch lsof +D /work/junk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 11:&lt;br /&gt;
&lt;br /&gt;
     How to make a File &amp;quot;immutable&amp;quot; or &amp;quot;unalterable&amp;quot; -- it cannot be changed&lt;br /&gt;
     or deleted even by root. Note this works on (ext2/ext3) filesystems.&lt;br /&gt;
     And, yes, root can delete after it's changed back.&lt;br /&gt;
&lt;br /&gt;
     As root:&lt;br /&gt;
&lt;br /&gt;
       $ chattr +i filename&lt;br /&gt;
&lt;br /&gt;
     And to change it back:&lt;br /&gt;
&lt;br /&gt;
       $ chattr -i filename&lt;br /&gt;
&lt;br /&gt;
     List attributes&lt;br /&gt;
&lt;br /&gt;
       $ lsattr filename&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 12:&lt;br /&gt;
&lt;br /&gt;
     SSH - How to Generate the Key Pair.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     On the local server&lt;br /&gt;
&lt;br /&gt;
       $  ssh-keygen -t dsa -b 2048&lt;br /&gt;
&lt;br /&gt;
     This will create the two files:&lt;br /&gt;
&lt;br /&gt;
            .ssh/id_dsa (Private key)&lt;br /&gt;
            .ssh/id_dsa.pub  (Public key you can share)&lt;br /&gt;
&lt;br /&gt;
     Next insert &amp;quot;.ssh/id_dsa.pub&amp;quot; on the remote server&lt;br /&gt;
     in the file  &amp;quot;.ssh/authorized_keys&amp;quot; and &amp;quot;.ssh/authorized_keys2&amp;quot;&lt;br /&gt;
     and change the  permission of each file to (chmod 600). Plus, make&lt;br /&gt;
     sure the directory &amp;quot;.ssh&amp;quot; exists on the remote computer with 700 rights.&lt;br /&gt;
     Ok, assuming  192.168.1.155 is the remote server and &amp;quot;donkey&amp;quot; is the&lt;br /&gt;
     account on that remote server.&lt;br /&gt;
&lt;br /&gt;
       $ ssh donkey@192.168.1.155 &amp;quot;mkdir -p .ssh&amp;quot;&lt;br /&gt;
       $ ssh donkey@192.168.1.155 &amp;quot;chmod 700 .ssh&amp;quot;&lt;br /&gt;
       $ scp ./.ssh/id_dsa.pub  donkey@192.168.1.155:.ssh/newkey.pub&lt;br /&gt;
&lt;br /&gt;
     Now connect to that remote server &amp;quot;192.168.1.155&amp;quot; and add .ssh/newkey.pub&lt;br /&gt;
     to both &amp;quot;authorized_keys&amp;quot; and &amp;quot;authorized_keys2&amp;quot;.  When done, the permission&lt;br /&gt;
     on&lt;br /&gt;
       (This is on the remote server)&lt;br /&gt;
&lt;br /&gt;
        $chmod 600 .ssh/authorized_key*&lt;br /&gt;
&lt;br /&gt;
     Next, go back to the local server and issue the following:&lt;br /&gt;
&lt;br /&gt;
        $ ssh-agent $SHELL&lt;br /&gt;
        $ ssh-add&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;ssh-add&amp;quot; will allow you to enter the passphrase and it will&lt;br /&gt;
     save it for the current login session.&lt;br /&gt;
&lt;br /&gt;
     You don't have to enter a password when running &amp;quot;ssh-keygen&amp;quot; above. But,&lt;br /&gt;
     remember anyone with root access can &amp;quot;su - &amp;lt;username&amp;gt;&amp;quot; and then connect&lt;br /&gt;
     to your computers.  It's harder, however, not impossible, for root to do&lt;br /&gt;
     this if  you have a password.&lt;br /&gt;
&lt;br /&gt;
     (Reference TIP 151)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 13:&lt;br /&gt;
&lt;br /&gt;
     Securing the System: Don't allow root to login remotely.  Instead,&lt;br /&gt;
     the admin could login as another account, then, &amp;quot;su -&amp;quot;.  However,&lt;br /&gt;
     root can still login &amp;quot;from the local terminal&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     In the &amp;quot;/etc/ssh/sshd_config&amp;quot; file change the following lines:&lt;br /&gt;
&lt;br /&gt;
        Protocol 2&lt;br /&gt;
        PermitRootLogin no&lt;br /&gt;
        PermitEmptyPasswords no&lt;br /&gt;
&lt;br /&gt;
     Then, restart ssh&lt;br /&gt;
&lt;br /&gt;
        /etc/init.d/sshd restart&lt;br /&gt;
&lt;br /&gt;
     Why would you want to do this?  It's not possible for anyone to guess&lt;br /&gt;
     or keep trying the root account.  This is especially good for computers&lt;br /&gt;
     on the Internet. So, even if the &amp;quot;root&amp;quot; passwords is known, they can't&lt;br /&gt;
     get access to the system remotely.  Only from the terminal, which is locked&lt;br /&gt;
     in your computer room. However, if anyone has a account on the server,&lt;br /&gt;
     then, they can login under their  account then &amp;quot;su -&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Suppose you only want a limited number of users:  &amp;quot;mchirico&amp;quot; and &amp;quot;donkey&amp;quot;.&lt;br /&gt;
     Add the following line to &amp;quot;/etc/ssh/sshd_config&amp;quot;. Note, this allows access&lt;br /&gt;
     for chirico and donkey, but everyone else is denied.&lt;br /&gt;
&lt;br /&gt;
         #  Once you add AllowUsers - everyone else is denied.&lt;br /&gt;
         AllowUsers mchirico donkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 14:&lt;br /&gt;
&lt;br /&gt;
     Keep Logs Longer with Less Space.&lt;br /&gt;
&lt;br /&gt;
     Normally logs rotate monthly, over writing all the old data.  Here's a&lt;br /&gt;
     sample &amp;quot;/etc/logrotate.conf&amp;quot; that will keep 12 months of backup&lt;br /&gt;
     compressing the logfiles&lt;br /&gt;
&lt;br /&gt;
       $ cat /etc/logrotate.conf&lt;br /&gt;
&lt;br /&gt;
             # see &amp;quot;man logrotate&amp;quot; for details&lt;br /&gt;
             # rotate log files weekly&lt;br /&gt;
             #chirico changes to monthly&lt;br /&gt;
             monthly&lt;br /&gt;
&lt;br /&gt;
             # keep 4 weeks worth of backlogs&lt;br /&gt;
             # keep 12 months of backup&lt;br /&gt;
             rotate 12&lt;br /&gt;
&lt;br /&gt;
             # create new (empty) log files after rotating old ones&lt;br /&gt;
             create&lt;br /&gt;
&lt;br /&gt;
             # uncomment this if you want your log files compressed&lt;br /&gt;
             compress&lt;br /&gt;
&lt;br /&gt;
             # RPM packages drop log rotation information into this directory&lt;br /&gt;
             include /etc/logrotate.d&lt;br /&gt;
&lt;br /&gt;
             # no packages own wtmp -- we'll rotate them here&lt;br /&gt;
             /var/log/wtmp {&lt;br /&gt;
                 monthly&lt;br /&gt;
                 create 0664 root utmp&lt;br /&gt;
                 rotate 1&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
             # system-specific logs may be also be configured here.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Note: see tip 1. The clock should always be correctly set.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 15:&lt;br /&gt;
&lt;br /&gt;
     What Network Services are Running?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -atup&lt;br /&gt;
&lt;br /&gt;
     or&lt;br /&gt;
&lt;br /&gt;
          $ netstat -ap|grep LISTEN|less&lt;br /&gt;
&lt;br /&gt;
     This can be helpful to determine the services running.&lt;br /&gt;
&lt;br /&gt;
     Need stats on dropped UDP packets?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s -u&lt;br /&gt;
&lt;br /&gt;
     or TCP&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s -t&lt;br /&gt;
&lt;br /&gt;
     or summary of everything&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s&lt;br /&gt;
&lt;br /&gt;
     or looking for error rates on the interface?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -i&lt;br /&gt;
&lt;br /&gt;
     Listening interfaces?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -l&lt;br /&gt;
&lt;br /&gt;
     (Tip above provided by Amos Shapira)&lt;br /&gt;
&lt;br /&gt;
     Also see TIP 77.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 16:&lt;br /&gt;
&lt;br /&gt;
     Apache: Creating and Using an &amp;quot;.htaccess&amp;quot; File&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Below is a sample &amp;quot;.htaccess&amp;quot; file which goes in&lt;br /&gt;
     &amp;quot;/usr/local/apache/htdocs/chirico/alpha/.htaccess&amp;quot; for this&lt;br /&gt;
     example&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         AuthUserFile /usr/local/apache/htdocs/chirico/alpha/.htpasswd&lt;br /&gt;
         AuthGroupFile /dev/null&lt;br /&gt;
         AuthName &amp;quot;Your Name and regular password required&amp;quot;&lt;br /&gt;
         AuthType Basic&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;Limit GET POST&amp;gt;&lt;br /&gt;
         require valid-user&lt;br /&gt;
         &amp;lt;/Limit&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    In order for this to work /usr/local/apache/conf/httpd.conf must&lt;br /&gt;
    have the following line in it:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       #&lt;br /&gt;
       &amp;lt;Directory /usr/local/apache/htdocs/chirico/alpha&amp;gt;&lt;br /&gt;
           AllowOverride FileInfo AuthConfig Limit&lt;br /&gt;
           Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec&lt;br /&gt;
           &amp;lt;Limit GET POST OPTIONS PROPFIND&amp;gt;&lt;br /&gt;
               Order allow,deny&lt;br /&gt;
               Allow from all&lt;br /&gt;
           &amp;lt;/Limit&amp;gt;&lt;br /&gt;
           &amp;lt;LimitExcept GET POST OPTIONS PROPFIND&amp;gt;&lt;br /&gt;
               Order deny,allow&lt;br /&gt;
               Deny from all&lt;br /&gt;
           &amp;lt;/LimitExcept&amp;gt;&lt;br /&gt;
       &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Also, a password file must be created&lt;br /&gt;
&lt;br /&gt;
      $ /usr/local/apache/bin/htpasswd -c .htpasswd chirico&lt;br /&gt;
&lt;br /&gt;
    And enter the user names and passwords.&lt;br /&gt;
&lt;br /&gt;
    Next Reload Apache:&lt;br /&gt;
&lt;br /&gt;
      $ /etc/init.d/httpd reload&lt;br /&gt;
&lt;br /&gt;
    (Reference TIP 213 limit access to certain directories based on IP address).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 17:&lt;br /&gt;
&lt;br /&gt;
     Working with &amp;quot;mt&amp;quot; Commands: reading and writing to tape.&lt;br /&gt;
&lt;br /&gt;
     The following assumes the tape device is &amp;quot;/dev/st0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     STEP 1 ( rewind the tape)&lt;br /&gt;
&lt;br /&gt;
          # mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (check to see if you are at block 0)&lt;br /&gt;
&lt;br /&gt;
          # mt -f /dev/nst0 tell&lt;br /&gt;
            At block 0.&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Backup &amp;quot;tar compress&amp;quot;  directories &amp;quot;one&amp;quot;  and &amp;quot;two&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
          # tar -czf /dev/nst0 one two&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Check to see what block you are at)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
&lt;br /&gt;
       You should get something like block 2 at this point.&lt;br /&gt;
&lt;br /&gt;
     STEP 5 (Rewind the tape)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
     STEP 6 (List the files)&lt;br /&gt;
&lt;br /&gt;
           # tar -tzf /dev/nst0&lt;br /&gt;
              one/&lt;br /&gt;
              one/test&lt;br /&gt;
              two/&lt;br /&gt;
&lt;br /&gt;
     STEP 7 (Restore directory &amp;quot;one&amp;quot;  into directory &amp;quot;junk&amp;quot;).  Note, you&lt;br /&gt;
          have to first rewind the tape, since the last operation moved&lt;br /&gt;
          ahead 2 blocks. Check this with &amp;quot;mt -f /dev/nst0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           # cd junk&lt;br /&gt;
           # mt -f /dev/nst0 rewind&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
              At block 0.&lt;br /&gt;
           # tar -xzf /dev/nst0 one&lt;br /&gt;
&lt;br /&gt;
     STEP 8 (Next, take a look to see what block the tape is at)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
              At block 2.&lt;br /&gt;
&lt;br /&gt;
     STEP 9 (Now backup directories three  and four)&lt;br /&gt;
&lt;br /&gt;
           # tar -czf /dev/nst0 three four&lt;br /&gt;
&lt;br /&gt;
       After backing up the files, the tape should be past block 2.&lt;br /&gt;
       Check this.&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
             At block 4.&lt;br /&gt;
&lt;br /&gt;
          Currently the following exist:&lt;br /&gt;
&lt;br /&gt;
                At block 1:&lt;br /&gt;
                     one/&lt;br /&gt;
                    one/test&lt;br /&gt;
                    two/&lt;br /&gt;
&lt;br /&gt;
                At block 2:&lt;br /&gt;
                    three/&lt;br /&gt;
                    three/samplehere&lt;br /&gt;
                    four/&lt;br /&gt;
&lt;br /&gt;
                At block 4:&lt;br /&gt;
                    (* This is empty *)&lt;br /&gt;
&lt;br /&gt;
     A few notes. You can set the blocking factor and a label&lt;br /&gt;
     with tar. For example:&lt;br /&gt;
&lt;br /&gt;
      $ tar --label=&amp;quot;temp label&amp;quot; --create  --blocking-factor=128 --file=/dev/nst0 Notes&lt;br /&gt;
&lt;br /&gt;
     But note if you try to read it with the default, incorrect blocking&lt;br /&gt;
     factor, then, you will get the following error:&lt;br /&gt;
&lt;br /&gt;
        $ tar -t   --file=/dev/nst0&lt;br /&gt;
        tar: /dev/nst0: Cannot read: Cannot allocate memory&lt;br /&gt;
        tar: At beginning of tape, quitting now&lt;br /&gt;
        tar: Error is not recoverable: exiting now&lt;br /&gt;
&lt;br /&gt;
     However this is easily fixed with the correct blocking factor&lt;br /&gt;
&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ tar -t --blocking-factor=128 --file=/dev/nst0&lt;br /&gt;
         temp label&lt;br /&gt;
         Notes&lt;br /&gt;
&lt;br /&gt;
     Take advantage of the label command.&lt;br /&gt;
&lt;br /&gt;
         $ MYCOMMENTS=&amp;quot;Big_important_tape&amp;quot;&lt;br /&gt;
         $ tar --label=&amp;quot;$(date +%F)&amp;quot;+&amp;quot;${MYCOMMENTS}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Writing to tape on a remote 192.168.1.155 computer&lt;br /&gt;
&lt;br /&gt;
         $ tar cvzf - ./tmp | ssh -l chirico 192.168.1.155 '(mt -f /dev/nst0 rewind; dd of=/dev/st0 )'&lt;br /&gt;
&lt;br /&gt;
     Restoring the contents from tape on a remote computer&lt;br /&gt;
&lt;br /&gt;
         $ ssh -l chirico 192.168.1.155 '(mt -f /dev/nst0 rewind; dd if=/dev/st0  )'|tar xzf -&lt;br /&gt;
&lt;br /&gt;
     Getting data off of tape with dd command with odd blocking factor. Just set ibs very high&lt;br /&gt;
&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ tar --label=&amp;quot;Contenets of Notes&amp;quot; --create  --blocking-factor=128 --file=/dev/nst0 Notes&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ dd ibs=1048576 if=/dev/st0 of=notes.tar&lt;br /&gt;
&lt;br /&gt;
     The above will probably work with ibs=64k as well&lt;br /&gt;
&lt;br /&gt;
        (Also see TIP 136)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 18:&lt;br /&gt;
&lt;br /&gt;
     Encrypting Data to Tape using &amp;quot;tar&amp;quot; and &amp;quot;openssl&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     The following shows an example of writing the contents of &amp;quot;tapetest&amp;quot; to tape:&lt;br /&gt;
&lt;br /&gt;
        $ tar zcvf - tapetest|openssl des3 -salt  -k secretpassword | dd of=/dev/st0&lt;br /&gt;
&lt;br /&gt;
     Reading the data back:&lt;br /&gt;
&lt;br /&gt;
        $ dd if=/dev/st0|openssl des3 -d -k secretpassword|tar xzf -&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 19:&lt;br /&gt;
&lt;br /&gt;
     Mounting an ISO Image as a Filesystem -- this is great if you don't have the DVD&lt;br /&gt;
         hardware, but, need to get at the data.  The following show an example of&lt;br /&gt;
         mounting the Fedora core 2 as a file.&lt;br /&gt;
&lt;br /&gt;
         $ mkdir /iso0&lt;br /&gt;
         $ mount -o loop -t iso9660 /FC2-i386-DVD.iso  /iso0&lt;br /&gt;
&lt;br /&gt;
     Or to mount automatically at boot, add the following to &amp;quot;/etc/fstab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         /FC2-i386-DVD.iso /iso0     iso9660 rw,loop  0 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Reference: http://umn.dl.sourceforge.net/sourceforge/souptonuts/README_fedora.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 20:&lt;br /&gt;
&lt;br /&gt;
     Getting Information about the Hard drive and list all PCI devices.&lt;br /&gt;
&lt;br /&gt;
                $ hdparm /dev/hda&lt;br /&gt;
&lt;br /&gt;
                  /dev/hda:&lt;br /&gt;
                   multcount    = 16 (on)&lt;br /&gt;
                   IO_support   =  0 (default 16-bit)&lt;br /&gt;
                   unmaskirq    =  0 (off)&lt;br /&gt;
                   using_dma    =  1 (on)&lt;br /&gt;
                   keepsettings =  0 (off)&lt;br /&gt;
                   readonly     =  0 (off)&lt;br /&gt;
                   readahead    = 256 (on)&lt;br /&gt;
                   geometry     = 16383/255/63, sectors = 234375000, start = 0&lt;br /&gt;
&lt;br /&gt;
            or for SCSI&lt;br /&gt;
&lt;br /&gt;
                $ hdparm /dev/sda&lt;br /&gt;
&lt;br /&gt;
            Try it with the -i option for information&lt;br /&gt;
&lt;br /&gt;
                $ hdparm -i /dev/hda&lt;br /&gt;
&lt;br /&gt;
                /dev/hda:&lt;br /&gt;
&lt;br /&gt;
                Model=IC35L120AVV207-1, FwRev=V24OA66A, SerialNo=VNVD09G4CZ6E0T&lt;br /&gt;
                Config={ HardSect NotMFM HdSw&amp;gt;15uSec Fixed DTR&amp;gt;10Mbs }&lt;br /&gt;
                RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=52&lt;br /&gt;
                BuffType=DualPortCache, BuffSize=7965kB, MaxMultSect=16, MultSect=16&lt;br /&gt;
                CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=234375000&lt;br /&gt;
                IORDY=on/off, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}&lt;br /&gt;
                PIO modes:  pio0 pio1 pio2 pio3 pio4&lt;br /&gt;
                DMA modes:  mdma0 mdma1 mdma2&lt;br /&gt;
                UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5&lt;br /&gt;
                AdvancedPM=yes: disabled (255) WriteCache=enabled&lt;br /&gt;
                Drive conforms to: ATA/ATAPI-6 T13 1410D revision 3a:  2 3 4 5 6&lt;br /&gt;
&lt;br /&gt;
            How fast is your drive?&lt;br /&gt;
&lt;br /&gt;
                $ hdparm -tT /dev/hda&lt;br /&gt;
&lt;br /&gt;
                /dev/hda:&lt;br /&gt;
                Timing buffer-cache reads:   128 MB in  0.41 seconds =315.32 MB/sec&lt;br /&gt;
                Timing buffered disk reads:  64 MB in  1.19 seconds = 53.65 MB/sec&lt;br /&gt;
&lt;br /&gt;
            Need to find your device?&lt;br /&gt;
&lt;br /&gt;
                $ mount&lt;br /&gt;
                   or&lt;br /&gt;
                $ cat /proc/partitions&lt;br /&gt;
                   or&lt;br /&gt;
                $ dmesg | egrep '^(s|h)d'&lt;br /&gt;
&lt;br /&gt;
                   which for my system lists:&lt;br /&gt;
&lt;br /&gt;
                      hda: IC35L120AVV207-1, ATA DISK drive&lt;br /&gt;
                      hdc: Lite-On LTN486S 48x Max, ATAPI CD/DVD-ROM drive&lt;br /&gt;
                      hda: max request size: 1024KiB&lt;br /&gt;
                      hda: 234375000 sectors (120000 MB) w/7965KiB Cache, CHS=16383/255/63, UDMA(100)&lt;br /&gt;
&lt;br /&gt;
             By the way, if you want to turn on dma&lt;br /&gt;
&lt;br /&gt;
                 $ hdparm -d1 /dev/hda&lt;br /&gt;
                   setting using_dma to 1 (on)&lt;br /&gt;
                   using_dma    =  1 (on)&lt;br /&gt;
&lt;br /&gt;
         (Also see TIP 122 )&lt;br /&gt;
&lt;br /&gt;
     List all PCI devices&lt;br /&gt;
&lt;br /&gt;
                $ lspci -v&lt;br /&gt;
&lt;br /&gt;
          00:00.0 Host bridge: Intel Corp. 82845G/GL [Brookdale-G] Chipset Host Bridge (rev&lt;br /&gt;
                  Subsystem: Dell Computer Corporation: Unknown device 0160&lt;br /&gt;
                  Flags: bus master, fast devsel, latency 0&lt;br /&gt;
                  Memory at f0000000 (32-bit, prefetchable) [size=128M]&lt;br /&gt;
                  Capabilities: &amp;lt;available only to root&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              ... lots more ...&lt;br /&gt;
&lt;br /&gt;
           Note, there is also lspci -vv for even more information.&lt;br /&gt;
&lt;br /&gt;
          (Also see TIP 200)&lt;br /&gt;
&lt;br /&gt;
TIP 21:&lt;br /&gt;
&lt;br /&gt;
     Setting up &amp;quot;cron&amp;quot; Jobs.&lt;br /&gt;
&lt;br /&gt;
     If you want to use the emacs editor for editing cron jobs, then,&lt;br /&gt;
     set the following in your &amp;quot;/home/user/.bash_profile&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        EDITOR=emacs&lt;br /&gt;
&lt;br /&gt;
     Then, to edit cron jobs&lt;br /&gt;
&lt;br /&gt;
        $ crontab -e&lt;br /&gt;
&lt;br /&gt;
     You may want to put in the following header&lt;br /&gt;
&lt;br /&gt;
        #MINUTE(0-59) HOUR(0-23) DAYOFMONTH(1-31) MONTHOFYEAR(1-12) DAYOFWEEK(0-6) Note 0=Sun and 7=Sun&lt;br /&gt;
        #&lt;br /&gt;
        #14,15 10 * * 0   /usr/bin/somecommmand  &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     The sample &amp;quot;commented out command&amp;quot; will run at 10:14 and 10:15 every Sunday.  There will&lt;br /&gt;
     be no &amp;quot;mail&amp;quot; sent to the user because of the &amp;quot;&amp;gt;/dev/null 2&amp;gt;&amp;amp;1&amp;quot; entry.&lt;br /&gt;
&lt;br /&gt;
        $ crontab -l&lt;br /&gt;
&lt;br /&gt;
     The above will list all cron jobs. Or if you're root&lt;br /&gt;
&lt;br /&gt;
        $ crontab -l -u &amp;lt;username&amp;gt;&lt;br /&gt;
        $ crontab -e -u &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Reference &amp;quot;man 5 crontab&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
        The time and date fields are:&lt;br /&gt;
&lt;br /&gt;
                     field          allowed values&lt;br /&gt;
                     -----          --------------&lt;br /&gt;
                     minute         0-59&lt;br /&gt;
                     hour           0-23&lt;br /&gt;
                     day of month   1-31&lt;br /&gt;
                     month          1-12 (or names, see below)&lt;br /&gt;
                     day of week    0-7 (0 or 7 is Sun, or use names)&lt;br /&gt;
&lt;br /&gt;
              A field may be an asterisk (*), which always stands for ``first-last''.&lt;br /&gt;
&lt;br /&gt;
              Ranges of numbers are allowed.  Ranges are two numbers separated with a&lt;br /&gt;
              hyphen.   The  specified  range is inclusive.  For example, 8-11 for an&lt;br /&gt;
              ``hours'' entry specifies execution at hours 8, 9, 10 and 11.&lt;br /&gt;
&lt;br /&gt;
              Lists are allowed.  A list is a set of numbers (or ranges) separated by&lt;br /&gt;
              commas.  Examples: ``1,2,5,9'', ``0-4,8-12''.&lt;br /&gt;
&lt;br /&gt;
              Ranges can include &amp;quot;steps&amp;quot;, so &amp;quot;1-9/2&amp;quot; is the same as &amp;quot;1,3,5,7,9&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Note, you can run just every 5 minutes as follows:&lt;br /&gt;
&lt;br /&gt;
              */5 * * * * /etc/mrtg/domrtg  &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     To run jobs hourly,daily,weekly or monthly you can add shell scripts into the&lt;br /&gt;
     appropriate directory:&lt;br /&gt;
&lt;br /&gt;
             /etc/cron.hourly/&lt;br /&gt;
             /etc/cron.daily/&lt;br /&gt;
             /etc/cron.weekly/&lt;br /&gt;
             /etc/cron.monthly/&lt;br /&gt;
&lt;br /&gt;
     Note that the above are pre-configured schedules set in &amp;quot;/etc/crontab&amp;quot;, so&lt;br /&gt;
     if you want, you can change the schedule. Below is my /etc/crontab:&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/crontab&lt;br /&gt;
           SHELL=/bin/bash&lt;br /&gt;
           PATH=/sbin:/bin:/usr/sbin:/usr/bin&lt;br /&gt;
           MAILTO=root&lt;br /&gt;
           HOME=/&lt;br /&gt;
&lt;br /&gt;
           # run-parts&lt;br /&gt;
           01 * * * * root run-parts /etc/cron.hourly&lt;br /&gt;
           02 4 * * * root run-parts /etc/cron.daily&lt;br /&gt;
           22 4 * * 0 root run-parts /etc/cron.weekly&lt;br /&gt;
           42 4 1 * * root run-parts /etc/cron.monthly&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 22:&lt;br /&gt;
&lt;br /&gt;
     Keeping Files in Sync Between Servers.&lt;br /&gt;
&lt;br /&gt;
     The remote computer is &amp;quot;192.168.1.171&amp;quot; and has the account &amp;quot;donkey&amp;quot;.  You want&lt;br /&gt;
     to &amp;quot;keep in sync&amp;quot; the files under &amp;quot;/home/cu2000/Logs&amp;quot; on the remote computer&lt;br /&gt;
     with files on &amp;quot;/home/chirico/dev/MEDIA_Server&amp;quot; on the local computer.&lt;br /&gt;
&lt;br /&gt;
       $ rsync  -Lae ssh  donkey@192.168.1.171:/home/cu2000/Logs /home/chirico/dev/MEDIA_Server&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;rsync&amp;quot; is a convient command for keeping files in sync, and as shown here will work&lt;br /&gt;
     through ssh.  The -L option tells rsync to treat symbolic links like ordinary files.&lt;br /&gt;
&lt;br /&gt;
        Also see [http://www.rsnapshot.org/]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 23:&lt;br /&gt;
&lt;br /&gt;
     Looking up the Spelling of a Word.&lt;br /&gt;
&lt;br /&gt;
        $ look &amp;lt;partial spelling&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     so the following will list all words that&lt;br /&gt;
     start with stuff&lt;br /&gt;
&lt;br /&gt;
        $ look stuff&lt;br /&gt;
           stuff&lt;br /&gt;
           stuffage&lt;br /&gt;
           stuffata&lt;br /&gt;
           stuffed&lt;br /&gt;
           stuffender&lt;br /&gt;
           stuffer&lt;br /&gt;
           stuffers&lt;br /&gt;
           stuffgownsman&lt;br /&gt;
           stuffier&lt;br /&gt;
           stuffiest&lt;br /&gt;
           stuffily&lt;br /&gt;
           stuffiness&lt;br /&gt;
           stuffinesses&lt;br /&gt;
           stuffiness's&lt;br /&gt;
           stuffing&lt;br /&gt;
           stuffings&lt;br /&gt;
           stuffing's&lt;br /&gt;
           stuffless&lt;br /&gt;
           stuffs&lt;br /&gt;
           stuffy&lt;br /&gt;
&lt;br /&gt;
     It helps to have a large &amp;quot;linuxwords&amp;quot; dictionary.  You can download&lt;br /&gt;
     a much bigger dictionary from the following:&lt;br /&gt;
&lt;br /&gt;
              http://prdownloads.sourceforge.net/souptonuts/linuxwords.1.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
     Note: vim users can setup the .vimrc file with the following. Now when you type &lt;br /&gt;
       CTL-X CTL-T in insert mode, you'll get a thesaurus lookup.&lt;br /&gt;
&lt;br /&gt;
           set dictionary+=/usr/share/dict/words&lt;br /&gt;
           set thesaurus+=/usr/share/dict/words&lt;br /&gt;
&lt;br /&gt;
     Or, you can call aspell with the F6 command after putting the folling entry in your&lt;br /&gt;
     .vimrc file&lt;br /&gt;
&lt;br /&gt;
           :nmap &amp;lt;F6&amp;gt; :w&amp;lt;CR&amp;gt;:!aspell -e -c %&amp;lt;CR&amp;gt;:e&amp;lt;CR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Now, hit F6 when you're in vim, and you'll get a spell checker.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     There is also an X Windows dictionary that runs with the following command.&lt;br /&gt;
&lt;br /&gt;
           $ gnome-dictionary&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 24:&lt;br /&gt;
&lt;br /&gt;
     Find out if a Command is Aliased.&lt;br /&gt;
&lt;br /&gt;
         $ type -all &amp;lt;command&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Example:&lt;br /&gt;
&lt;br /&gt;
         $ type -all ls&lt;br /&gt;
            ls is aliased to `ls --color=tty'&lt;br /&gt;
            ls is /bin/ls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 25:&lt;br /&gt;
&lt;br /&gt;
     Create a Terminal Calculator&lt;br /&gt;
&lt;br /&gt;
      Put the following in your .bashrc file&lt;br /&gt;
&lt;br /&gt;
            function calc&lt;br /&gt;
            {&lt;br /&gt;
             echo &amp;quot;${1}&amp;quot;|bc -l;&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
      Or, run it at the shell prompt. Now&lt;br /&gt;
      &amp;quot;calc&amp;quot; from the shell will work as follows:&lt;br /&gt;
&lt;br /&gt;
            $ calc 3+45&lt;br /&gt;
               48&lt;br /&gt;
&lt;br /&gt;
      All functions  with a &amp;quot;(&amp;quot; or &amp;quot;)&amp;quot; must be enclosed&lt;br /&gt;
      in quotes.  For instance, to get the sin of .4&lt;br /&gt;
&lt;br /&gt;
            $ calc &amp;quot;s(.4)&amp;quot;&lt;br /&gt;
              .38941834230865049166&lt;br /&gt;
&lt;br /&gt;
          (See TIP 115 using the expr command)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 26:&lt;br /&gt;
&lt;br /&gt;
     Kill a User and All Their Current Processes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        #  This program will kill all processes from a&lt;br /&gt;
        #  user.  The user name is read from the command line.&lt;br /&gt;
        #&lt;br /&gt;
        #  This program also demonstrates reading a bash variable&lt;br /&gt;
        #  into an awk script.&lt;br /&gt;
        #&lt;br /&gt;
        #  Usage: kill9user &amp;lt;user&amp;gt;&lt;br /&gt;
        #&lt;br /&gt;
        kill -9 `ps aux|awk -v var=$1 '$1==var { print $2 }'`&lt;br /&gt;
&lt;br /&gt;
    or if you want want to create the above script the command&lt;br /&gt;
    below will kill the user &amp;quot;donkey&amp;quot; and all of his processes.&lt;br /&gt;
&lt;br /&gt;
        $ kill -9 `ps aux|awk -v var=&amp;quot;donkey&amp;quot; '$1==var { print $2 }'`&lt;br /&gt;
&lt;br /&gt;
    Check their cron jobs and &amp;quot;at&amp;quot; jobs, if you have a security issue.&lt;br /&gt;
&lt;br /&gt;
          $ crontab -u &amp;lt;user&amp;gt; -e&lt;br /&gt;
&lt;br /&gt;
    Lock the account:&lt;br /&gt;
&lt;br /&gt;
          $ passwd -l &amp;lt;user&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Remove all authorized_keys&lt;br /&gt;
&lt;br /&gt;
          $ rm /home/user/.shosts&lt;br /&gt;
          $ rm /home/user/.rhosts&lt;br /&gt;
          $ rm -rf /home/user/.ssh&lt;br /&gt;
          $ rm /home/user/.forward&lt;br /&gt;
&lt;br /&gt;
      or consider&lt;br /&gt;
&lt;br /&gt;
          $ mv /home/user  /home/safeuser&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Change the shell&lt;br /&gt;
&lt;br /&gt;
          $ chsh -s /bin/true &amp;lt;user&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Do an inventory&lt;br /&gt;
&lt;br /&gt;
          $ find / -user &amp;lt;user&amp;gt;  &amp;gt; list_of_user_files&lt;br /&gt;
&lt;br /&gt;
    NOTE: Also see (TIP 10).&lt;br /&gt;
&lt;br /&gt;
    To see all users, except the current user. Do not use the&lt;br /&gt;
    dash &amp;quot;ps -aux&amp;quot; is wrong but the following is correct:&lt;br /&gt;
&lt;br /&gt;
          $ ps aux| awk '!/'${USER}'/{printf(&amp;quot;%s \n&amp;quot;,$0)}'&lt;br /&gt;
&lt;br /&gt;
     or (ww = wide, wide output)&lt;br /&gt;
&lt;br /&gt;
          $ ps auwwx| awk '!/'${USER}'/{printf(&amp;quot;%s \n&amp;quot;,$0)}'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    The following codes may be useful:&lt;br /&gt;
&lt;br /&gt;
       D    Uninterruptible sleep (usually IO)&lt;br /&gt;
       R    Running or runnable (on run queue)&lt;br /&gt;
       S    Interruptible sleep (waiting for an event to complete)&lt;br /&gt;
       T    Stopped, either by a job control signal or because it is being traced.&lt;br /&gt;
       W    paging (not valid since the 2.6.xx kernel)&lt;br /&gt;
       X    dead (should never be seen)&lt;br /&gt;
       Z    Defunct (&amp;quot;zombie&amp;quot;) process, terminated but not reaped by its parent.&lt;br /&gt;
&lt;br /&gt;
    For BSD formats and when the stat keyword is used, additional&lt;br /&gt;
       characters may be displayed:&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;    high-priority (not nice to other users)&lt;br /&gt;
       N    low-priority (nice to other users)&lt;br /&gt;
       L    has pages locked into memory (for real-time and custom IO)&lt;br /&gt;
       s    is a session leader&lt;br /&gt;
       l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)&lt;br /&gt;
       +    is in the foreground process group&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Also see TIP 28. and TIP 89.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 27:&lt;br /&gt;
&lt;br /&gt;
     Format Dates for Logs and Files&lt;br /&gt;
&lt;br /&gt;
         $ date &amp;quot;+%m%d%y %A,%B %d %Y %X&amp;quot;&lt;br /&gt;
             061704 Thursday,June 17 2004 07:13:40 PM&lt;br /&gt;
&lt;br /&gt;
         $ date &amp;quot;+%m%d%Y&amp;quot;&lt;br /&gt;
             06172004&lt;br /&gt;
&lt;br /&gt;
         $ date -d '1 day ago' &amp;quot;+%m%d%Y&amp;quot;&lt;br /&gt;
             06162004&lt;br /&gt;
&lt;br /&gt;
         $ date -d '3 months 1 day  2 hour  15 minutes 2 seconds ago'&lt;br /&gt;
&lt;br /&gt;
      or to go into the future remove the &amp;quot;ago&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         $ date -d '3 months 1 day  2 hour  15 minutes 2 seconds '&lt;br /&gt;
&lt;br /&gt;
            Also the following works:&lt;br /&gt;
&lt;br /&gt;
                $ date -d '+2 year +1 month -1 week  +3 day -8 hour +2 min -5 seconds'&lt;br /&gt;
&lt;br /&gt;
      Quick question: If there are 100,000,000 stars in the visible sky, and you can&lt;br /&gt;
      count them, round the clock, at a rate of a star per second starting now, when&lt;br /&gt;
      would you finish counting?  Would you still be alive?&lt;br /&gt;
&lt;br /&gt;
                $ date -d '+100000000 seconds'&lt;br /&gt;
&lt;br /&gt;
      Sooner than you think!&lt;br /&gt;
&lt;br /&gt;
      This can be assigned to variables&lt;br /&gt;
&lt;br /&gt;
         $ mdate=`date -d '3 months 1 day  2 hour  15 minutes 2 seconds ' &amp;quot;+%m%d%Y_%A_%B_%D_%Y_%X&amp;quot;  `&lt;br /&gt;
         $ echo $mdate&lt;br /&gt;
             09182004_Saturday_September_09/18/04_2004_09:40:41 PM&lt;br /&gt;
             ^---- Easy to sort   ^-------^----- Easy to read&lt;br /&gt;
&lt;br /&gt;
      See TIP 28 below.&lt;br /&gt;
&lt;br /&gt;
      See TIP 87 when working with large delta time changes -40 years, or -200 years ago, or even&lt;br /&gt;
      1,000,000 days into the future.&lt;br /&gt;
&lt;br /&gt;
      Also see (TIP 1) for working with time zones.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 28:&lt;br /&gt;
&lt;br /&gt;
     Need Ascii Codes? For instance, for printing quotes:&lt;br /&gt;
&lt;br /&gt;
                         awk 'BEGIN { msg = &amp;quot;Don\047t Panic!&amp;quot;; printf &amp;quot;%s \n&amp;quot;,msg }'&lt;br /&gt;
              or&lt;br /&gt;
                         awk 'BEGIN { msg = &amp;quot;Don\x027t Panic!&amp;quot;; printf &amp;quot;%s \n&amp;quot;,msg }'&lt;br /&gt;
&lt;br /&gt;
     It's better to use \047, because certain characters that follow \x027 may cause problems.&lt;br /&gt;
&lt;br /&gt;
     For example, take a look at the following two lines. The first line prints a &amp;quot;}&amp;quot; caused&lt;br /&gt;
     by the extra D in \x027D. The the line immediately below does not work as expected.&lt;br /&gt;
&lt;br /&gt;
                      awk 'BEGIN {printf(&amp;quot;The D causes problems \x027D\n&amp;quot;)}'&lt;br /&gt;
&lt;br /&gt;
            However, the line below works fine:&lt;br /&gt;
&lt;br /&gt;
                      awk 'BEGIN {printf(&amp;quot;The D does not cause problems \047D\n&amp;quot;)}'&lt;br /&gt;
&lt;br /&gt;
     Or if you wanted to use the date command in &amp;quot;awk&amp;quot; to print date.time.nanosecond.timezone for&lt;br /&gt;
     each line of a file &amp;quot;test&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     The following date can be used in awk because the single quotes are enclosed within the&lt;br /&gt;
     double quotes.&lt;br /&gt;
&lt;br /&gt;
             date '+%m%d%Y.%H%M%S.%N%z'&lt;br /&gt;
&lt;br /&gt;
       $ awk 'BEGIN { &amp;quot;date '+%m%d%Y.%H%M%S.%N%z'&amp;quot; | getline MyDate  } { print MyDate,$0 }' &amp;lt; data&lt;br /&gt;
&lt;br /&gt;
     But it's also possible to replace  &amp;quot;+&amp;quot;  with  \x2B,  &amp;quot;%&amp;quot; with \x25, and &amp;quot;d&amp;quot; with \x64 as follows:&lt;br /&gt;
&lt;br /&gt;
       $ awk 'BEGIN { &amp;quot;date \x27\x2B\x25m\x25\x64\x25Y.\x25H\x25M\x25S.\x25N\x25z\x27&amp;quot; | getline MyDate  } { print MyDate,$0 }' &amp;lt; test&lt;br /&gt;
&lt;br /&gt;
             07062004.113820.346033000-0400 bob 71&lt;br /&gt;
             07062004.113820.346033000-0400 tom 43&lt;br /&gt;
             07062004.113820.346033000-0400 sal 34&lt;br /&gt;
             07062004.113820.346033000-0400 bob 89&lt;br /&gt;
             07062004.113820.346033000-0400 tom 66&lt;br /&gt;
             07062004.113820.346033000-0400 sal 99&lt;br /&gt;
&lt;br /&gt;
     For this example it's not needed because single quotes are used inside of double quotes; however, there may be times when&lt;br /&gt;
     hex replacement is easier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ man ascii&lt;br /&gt;
&lt;br /&gt;
        Oct   Dec   Hex   Char           Oct   Dec   Hex   Char&lt;br /&gt;
            -----------------------------------------------------------&lt;br /&gt;
            000   0     00    NUL '\0'       100   64    40    @&lt;br /&gt;
            001   1     01    SOH            101   65    41    A&lt;br /&gt;
            002   2     02    STX            102   66    42    B&lt;br /&gt;
            003   3     03    ETX            103   67    43    C&lt;br /&gt;
            004   4     04    EOT            104   68    44    D&lt;br /&gt;
            005   5     05    ENQ            105   69    45    E&lt;br /&gt;
            006   6     06    ACK            106   70    46    F&lt;br /&gt;
            007   7     07    BEL '\a'       107   71    47    G&lt;br /&gt;
            010   8     08    BS  '\b'       110   72    48    H&lt;br /&gt;
            011   9     09    HT  '\t'       111   73    49    I&lt;br /&gt;
            012   10    0A    LF  '\n'       112   74    4A    J&lt;br /&gt;
            013   11    0B    VT  '\v'       113   75    4B    K&lt;br /&gt;
            014   12    0C    FF  '\f'       114   76    4C    L&lt;br /&gt;
            015   13    0D    CR  '\r'       115   77    4D    M&lt;br /&gt;
            016   14    0E    SO             116   78    4E    N&lt;br /&gt;
            017   15    0F    SI             117   79    4F    O&lt;br /&gt;
            020   16    10    DLE            120   80    50    P&lt;br /&gt;
            021   17    11    DC1            121   81    51    Q&lt;br /&gt;
            022   18    12    DC2            122   82    52    R&lt;br /&gt;
            023   19    13    DC3            123   83    53    S&lt;br /&gt;
            024   20    14    DC4            124   84    54    T&lt;br /&gt;
            025   21    15    NAK            125   85    55    U&lt;br /&gt;
            026   22    16    SYN            126   86    56    V&lt;br /&gt;
            027   23    17    ETB            127   87    57    W&lt;br /&gt;
            030   24    18    CAN            130   88    58    X&lt;br /&gt;
            031   25    19    EM             131   89    59    Y&lt;br /&gt;
            032   26    1A    SUB            132   90    5A    Z&lt;br /&gt;
            033   27    1B    ESC            133   91    5B    [&lt;br /&gt;
            034   28    1C    FS             134   92    5C    \   '\\'&lt;br /&gt;
            035   29    1D    GS             135   93    5D    ]&lt;br /&gt;
            036   30    1E    RS             136   94    5E    ^&lt;br /&gt;
            037   31    1F    US             137   95    5F    _&lt;br /&gt;
            040   32    20    SPACE          140   96    60    `&lt;br /&gt;
            041   33    21    !              141   97    61    a&lt;br /&gt;
            042   34    22    &amp;quot;              142   98    62    b&lt;br /&gt;
            043   35    23    #              143   99    63    c&lt;br /&gt;
            044   36    24    $              144   100   64    d&lt;br /&gt;
            045   37    25    %              145   101   65    e&lt;br /&gt;
            046   38    26    &amp;amp;              146   102   66    f&lt;br /&gt;
            047   39    27    '              147   103   67    g&lt;br /&gt;
            050   40    28    (              150   104   68    h&lt;br /&gt;
            051   41    29    )              151   105   69    i&lt;br /&gt;
            052   42    2A    *              152   106   6A    j&lt;br /&gt;
            053   43    2B    +              153   107   6B    k&lt;br /&gt;
            054   44    2C    ,              154   108   6C    l&lt;br /&gt;
            055   45    2D    -              155   109   6D    m&lt;br /&gt;
            056   46    2E    .              156   110   6E    n&lt;br /&gt;
            057   47    2F    /              157   111   6F    o&lt;br /&gt;
            060   48    30    0              160   112   70    p&lt;br /&gt;
            061   49    31    1              161   113   71    q&lt;br /&gt;
            062   50    32    2              162   114   72    r&lt;br /&gt;
            063   51    33    3              163   115   73    s&lt;br /&gt;
            064   52    34    4              164   116   74    t&lt;br /&gt;
            065   53    35    5              165   117   75    u&lt;br /&gt;
            066   54    36    6              166   118   76    v&lt;br /&gt;
            067   55    37    7              167   119   77    w&lt;br /&gt;
            070   56    38    8              170   120   78    x&lt;br /&gt;
            071   57    39    9              171   121   79    y&lt;br /&gt;
            072   58    3A    :              172   122   7A    z&lt;br /&gt;
            073   59    3B    ;              173   123   7B    {&lt;br /&gt;
            074   60    3C    &amp;lt;              174   124   7C    |&lt;br /&gt;
            075   61    3D    =              175   125   7D    }&lt;br /&gt;
            076   62    3E    &amp;gt;              176   126   7E    ~&lt;br /&gt;
            077   63    3F    ?              177   127   7F    DEL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 29:&lt;br /&gt;
&lt;br /&gt;
     Need a WWW Browser for the Terminal Session? Try lynx or elinks.&lt;br /&gt;
&lt;br /&gt;
         $ lynx&lt;br /&gt;
&lt;br /&gt;
     Or to read all these tips, with the latest updates&lt;br /&gt;
&lt;br /&gt;
      $ lynx http://umn.dl.sourceforge.net/sourceforge/souptonuts/How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Or, better yet elinks.&lt;br /&gt;
&lt;br /&gt;
         $ elinks http://somepage.&lt;br /&gt;
&lt;br /&gt;
     You can get elinks at the following site:&lt;br /&gt;
&lt;br /&gt;
             http://elinks.or.cz/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 30:&lt;br /&gt;
&lt;br /&gt;
    screen - screen manager with VT100/ANSI terminal emulation&lt;br /&gt;
&lt;br /&gt;
         This is an excellent utility. But if you work a lot in Emacs,&lt;br /&gt;
         then, you should place the following in your ~./.bashrc&lt;br /&gt;
&lt;br /&gt;
             alias s='screen -e^Pa -D -R'&lt;br /&gt;
&lt;br /&gt;
         After loging in again (or source .bashrc) ,&lt;br /&gt;
         type the following to load &amp;quot;screen&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
             $ s&lt;br /&gt;
&lt;br /&gt;
         If you're using the not using the alias command above, substitute&lt;br /&gt;
         CTL-a for CTL-p below. :&lt;br /&gt;
&lt;br /&gt;
             CTL-p CTL-C       To get a new session&lt;br /&gt;
             CTL-p  &amp;quot;           To list sessions, and arrow keys to move&lt;br /&gt;
             CTL-p SHFT-A      To name sessions&lt;br /&gt;
             CTL-p S            To split screens&lt;br /&gt;
             CLT-p Q            To unsplit screens&lt;br /&gt;
             CLT-p TAB          To switch between screens&lt;br /&gt;
             CLT-p :resize n    To resize screen to n rows, on split screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Screen is very powerful.  Should you become disconneced, you can&lt;br /&gt;
         still resume work after loggin in.&lt;br /&gt;
&lt;br /&gt;
             $ man screen&lt;br /&gt;
&lt;br /&gt;
         The above command will give you more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 31:&lt;br /&gt;
&lt;br /&gt;
     Need to Find the Factors of a Number?&lt;br /&gt;
&lt;br /&gt;
           $ factor 2345678992&lt;br /&gt;
                2345678992: 2 2 2 2 6581 22277&lt;br /&gt;
&lt;br /&gt;
     It's a quick way to find out if a number is prime&lt;br /&gt;
&lt;br /&gt;
           $ factor 7867&lt;br /&gt;
                7867: 7867&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 32:&lt;br /&gt;
&lt;br /&gt;
     Less is More -- piping to less to scroll backword and forward&lt;br /&gt;
&lt;br /&gt;
      For large &amp;quot;ls&amp;quot; listings try the followin, then, use the arrow key&lt;br /&gt;
      to move up and down the list.&lt;br /&gt;
&lt;br /&gt;
           $ ls /some_large_dir/ | less&lt;br /&gt;
&lt;br /&gt;
                 or&lt;br /&gt;
&lt;br /&gt;
           $ cat some_large_file | less&lt;br /&gt;
&lt;br /&gt;
                 or&lt;br /&gt;
&lt;br /&gt;
           $ less some_large_file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 33:&lt;br /&gt;
&lt;br /&gt;
     C &amp;quot;indent&amp;quot; Settings for Kernel Development&lt;br /&gt;
&lt;br /&gt;
           $ indent -kr -i8  program.c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 34:&lt;br /&gt;
&lt;br /&gt;
     FTP auto-login.  &amp;quot;ftp&amp;quot; to a site and have the password stored.&lt;br /&gt;
&lt;br /&gt;
     For instance, here's a sample &amp;quot;.net&amp;quot; file in a user's home&lt;br /&gt;
     directory for uploading to sourceforge. Note, sourceforge will&lt;br /&gt;
     take any password, so m@temp.com is used here for login &amp;quot;anonymous&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ cat ~/.netrc&lt;br /&gt;
               machine upload.sourceforge.net login anonymous password m@temp.com&lt;br /&gt;
               default login anonymous password user@site&lt;br /&gt;
&lt;br /&gt;
     It might be a good idea to change the rights on this file&lt;br /&gt;
&lt;br /&gt;
           $ chmod 0400 ~/.netrc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         #!/bin/bash&lt;br /&gt;
         #&lt;br /&gt;
         #  Sample ftp automated script to download&lt;br /&gt;
         #  file to ${dwnld}&lt;br /&gt;
         #&lt;br /&gt;
         dwnld=&amp;quot;/work/faq/unix-faq&amp;quot;&lt;br /&gt;
         cd ${dwnld}&lt;br /&gt;
         ftp &amp;lt;&amp;lt; FTPSTRING&lt;br /&gt;
         prompt off&lt;br /&gt;
         open rtfm.mit.edu&lt;br /&gt;
         cd /pub/usenet-by-group/news.answers/unix-faq/faq&lt;br /&gt;
         mget contents&lt;br /&gt;
         mget diff&lt;br /&gt;
         mget part*&lt;br /&gt;
         bye&lt;br /&gt;
         FTPSTRING&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      (Also see TIP 114 for ncftpget, which is a very powerful restarting&lt;br /&gt;
                            ftp program)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 35:&lt;br /&gt;
&lt;br /&gt;
     Bash Brace Expansion&lt;br /&gt;
&lt;br /&gt;
           $ echo f{ee,ie,oe,um}&lt;br /&gt;
                fee fie foe fum&lt;br /&gt;
&lt;br /&gt;
     This works with almost any command&lt;br /&gt;
&lt;br /&gt;
           $ mkdir -p /work/junk/{one,two,three,four}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 36:&lt;br /&gt;
&lt;br /&gt;
     Getting a List of Users on the System&lt;br /&gt;
&lt;br /&gt;
           $ cut -d: -f1 /etc/passwd | sort&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 37:&lt;br /&gt;
&lt;br /&gt;
     Editing a Bash Command&lt;br /&gt;
&lt;br /&gt;
      Try typing a long command say, then, type &amp;quot;fc&amp;quot; for an easy way&lt;br /&gt;
      to edit the command.&lt;br /&gt;
&lt;br /&gt;
           $ find /etc -iname '*.cnf' -exec grep -H 'log' {} \;&lt;br /&gt;
           $ fc&lt;br /&gt;
&lt;br /&gt;
      &amp;quot;fc&amp;quot; will bring the last command typed into an editor, &amp;quot;emacs&amp;quot; if&lt;br /&gt;
      that's the default editor. Type &amp;quot;fc -l&amp;quot; to list last few commands.&lt;br /&gt;
&lt;br /&gt;
      To seach for a command, try typing &amp;quot;CTL-r&amp;quot; at the shell prompt for&lt;br /&gt;
      searching. &amp;quot;CTL-t&amp;quot; to transpose, say &amp;quot;sl&amp;quot; was typed by you want &amp;quot;ls&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Hints when using &amp;quot;fc: in emacs:&lt;br /&gt;
&lt;br /&gt;
           ESC-b     move one word backward&lt;br /&gt;
           ESC-f     move one word forward&lt;br /&gt;
           ESC-DEL   kill one word backward&lt;br /&gt;
           CTL-k     kill point to end&lt;br /&gt;
           CTL-y     un-yank killed region at point&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 38:&lt;br /&gt;
&lt;br /&gt;
     Moving around Directories.&lt;br /&gt;
&lt;br /&gt;
     Change to the home directory:&lt;br /&gt;
          $ cd ~&lt;br /&gt;
            or&lt;br /&gt;
          $ cd&lt;br /&gt;
&lt;br /&gt;
     To go back to the last directory&lt;br /&gt;
          $ cd -&lt;br /&gt;
&lt;br /&gt;
     Instead of &amp;quot;cd&amp;quot; to a directory try &amp;quot;pushd&amp;quot; and look&lt;br /&gt;
     at the heading...you can see a list of directories.&lt;br /&gt;
&lt;br /&gt;
          $ pushd /etc&lt;br /&gt;
          $ pushd /usr/local&lt;br /&gt;
&lt;br /&gt;
      Then, to get back &amp;quot;popd&amp;quot; or &amp;quot;popd 1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      To list all the directories pushed on the stack&lt;br /&gt;
      use the &amp;quot;dirs -v&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
          $ dirs -v&lt;br /&gt;
           0  /usr/local&lt;br /&gt;
           1  /etc&lt;br /&gt;
           2  /work/souptonuts/documentation/theBook&lt;br /&gt;
&lt;br /&gt;
      Now, if you &amp;quot;pushd +1&amp;quot; you will be moved to &amp;quot;/etc&amp;quot;, since&lt;br /&gt;
      is number &amp;quot;1&amp;quot; on the stack, and this directory will become&lt;br /&gt;
      &amp;quot;0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ pwd&lt;br /&gt;
           /usr/local&lt;br /&gt;
          $ pushd +1&lt;br /&gt;
          $ pwd&lt;br /&gt;
           /etc&lt;br /&gt;
&lt;br /&gt;
          $ dirs -v&lt;br /&gt;
           0  /etc&lt;br /&gt;
           1  /work/souptonuts/documentation/theBook&lt;br /&gt;
           2  /usr/local&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 39:&lt;br /&gt;
&lt;br /&gt;
     Need an Underscore after a Variable?&lt;br /&gt;
&lt;br /&gt;
       Enclose the variable in &amp;quot;{}&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $echo ${UID}_&lt;br /&gt;
&lt;br /&gt;
       Compare to&lt;br /&gt;
&lt;br /&gt;
          $echo $UID_&lt;br /&gt;
&lt;br /&gt;
       Also try the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ m=&amp;quot;my stuff here&amp;quot;&lt;br /&gt;
                $ echo -e ${m// /'\n'}&lt;br /&gt;
                        my&lt;br /&gt;
                        stuff&lt;br /&gt;
                        here&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 40:&lt;br /&gt;
&lt;br /&gt;
     Bash Variable Offset and String Operators&lt;br /&gt;
&lt;br /&gt;
        $ r=&amp;quot;this is stuff&amp;quot;&lt;br /&gt;
        $ echo ${r:3}&lt;br /&gt;
        $ echo ${r:5:2}&lt;br /&gt;
&lt;br /&gt;
      Note, ${varname:offset:length}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         ${varname:?message}  If varname exist and isn't null return value, else,&lt;br /&gt;
                              print var and message.&lt;br /&gt;
&lt;br /&gt;
           $ r=&amp;quot;new stuff&amp;quot;&lt;br /&gt;
           $ echo ${r:? &amp;quot;that's r for you&amp;quot;}&lt;br /&gt;
               new stuff&lt;br /&gt;
           $ unset r&lt;br /&gt;
           $ echo ${r:? &amp;quot;that's r for you&amp;quot;}&lt;br /&gt;
               bash: r:  that's r for you&lt;br /&gt;
&lt;br /&gt;
         ${varname:+word}    If varname exist and not null return word. Else, return null.&lt;br /&gt;
&lt;br /&gt;
         ${varname:-word}    If varname exist and not null return value. Else, return word.&lt;br /&gt;
&lt;br /&gt;
      Working with arrays in bash - bash arrays.&lt;br /&gt;
&lt;br /&gt;
           $ unset p&lt;br /&gt;
           $ p=(one two three)&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[@]}&amp;quot;&lt;br /&gt;
           one two three&lt;br /&gt;
&lt;br /&gt;
      or&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[*]}&amp;quot;&lt;br /&gt;
           one two three&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${#p[@]}&amp;quot;&lt;br /&gt;
           3&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[0]}&amp;quot;&lt;br /&gt;
           one&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[1]}&amp;quot;&lt;br /&gt;
           two&lt;br /&gt;
&lt;br /&gt;
            Also see (TIP 95)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 41:&lt;br /&gt;
&lt;br /&gt;
     Loops in Bash&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The command below loops through directories listed in $PATH.&lt;br /&gt;
&lt;br /&gt;
          $ path=$PATH:&lt;br /&gt;
          $ while [ $path ]; do echo &amp;quot; ${path%%:*} &amp;quot;; path=${path#*:}; done&lt;br /&gt;
&lt;br /&gt;
       The command below will also loop through directories in your path.&lt;br /&gt;
&lt;br /&gt;
          $IFS=:&lt;br /&gt;
          $ for dir in $PATH&lt;br /&gt;
          &amp;gt; do&lt;br /&gt;
          &amp;gt; ls -ld $dir&lt;br /&gt;
          &amp;gt; done&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Jun 10 20:16 /usr/local/bin&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Jun 13 23:12 /bin&lt;br /&gt;
              drwxr-xr-x    3 root     root        40960 Jun 12 08:00 /usr/bin&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Feb 14 03:12 /usr/X11R6/bin&lt;br /&gt;
              drwxrwxr-x    2 chirico  chirico      4096 Jun  6 13:06 /home/chirico/bin&lt;br /&gt;
&lt;br /&gt;
     Other ways of doing loops:&lt;br /&gt;
&lt;br /&gt;
        for (( i=1; i &amp;lt;= 20; i++))&lt;br /&gt;
                do&lt;br /&gt;
                        echo -n &amp;quot;$i &amp;quot;&lt;br /&gt;
                done&lt;br /&gt;
&lt;br /&gt;
     Note, to do it all on one line, do the following:&lt;br /&gt;
&lt;br /&gt;
        $ for (( i=1; i &amp;lt;= 20; i++)); do echo -n &amp;quot;$i&amp;quot;; done&lt;br /&gt;
&lt;br /&gt;
     Below, is an example of declaring i an integer so that you do not&lt;br /&gt;
     have to preface with let.&lt;br /&gt;
&lt;br /&gt;
          $ declare -i i&lt;br /&gt;
          $ i=5;&lt;br /&gt;
          $ while (( $i &amp;gt; 1 )); do&lt;br /&gt;
          &amp;gt; i=i-1&lt;br /&gt;
          &amp;gt; echo $i&lt;br /&gt;
          &amp;gt; done&lt;br /&gt;
          4&lt;br /&gt;
          3&lt;br /&gt;
          2&lt;br /&gt;
&lt;br /&gt;
     You can also use &amp;quot;while [ $i -gt 1 ]; do&amp;quot;  in place of &amp;quot;while (( $i &amp;gt; 1 )); do&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     To get a listing of all declared values&lt;br /&gt;
&lt;br /&gt;
          $ declare -i&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Try putting a few words in the file &amp;quot;test&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         $ while read filename; do echo  &amp;quot;- $filename &amp;quot;; done &amp;lt; test |nl -w1&lt;br /&gt;
&lt;br /&gt;
     Or, using an array&lt;br /&gt;
&lt;br /&gt;
                declare -a Array&lt;br /&gt;
                Array[0]=&amp;quot;zero&amp;quot;&lt;br /&gt;
                Array[1]=&amp;quot;one&amp;quot;&lt;br /&gt;
                Array[2]=&amp;quot;two&amp;quot;&lt;br /&gt;
                for i in `seq ${#Array[@]}`&lt;br /&gt;
                do&lt;br /&gt;
                  echo $Array[$i-1]&lt;br /&gt;
                done&lt;br /&gt;
&lt;br /&gt;
         Also see (TIP 95 and TIP 133).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 42:&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;diff&amp;quot; and &amp;quot;patch&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
        You have created a program &amp;quot;prog.c&amp;quot;, saved as this name and also copied&lt;br /&gt;
        to  &amp;quot;prog.c.old&amp;quot;. You post &amp;quot;prog.c&amp;quot; to users.  Next, you make changes&lt;br /&gt;
        to prog.c&lt;br /&gt;
&lt;br /&gt;
          $ diff -c prog.c.old prog.c &amp;gt; prog.patch&lt;br /&gt;
&lt;br /&gt;
        Now, users can get the latest updates by running.&lt;br /&gt;
&lt;br /&gt;
          $ patch &amp;lt; prog.patch&lt;br /&gt;
&lt;br /&gt;
        By the way, you can make backups of your data easily.&lt;br /&gt;
&lt;br /&gt;
          $ cp /etc/fstab{,.bak}&lt;br /&gt;
&lt;br /&gt;
        Now, you do your edits to &amp;quot;/etc/fstab&amp;quot; and if you need&lt;br /&gt;
        to go back to the original, you can find it at&lt;br /&gt;
        &amp;quot;/etc/fstab.bak&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 43:&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;cat&amp;quot; the Contents of Files Listed in a File, in That Order.&lt;br /&gt;
&lt;br /&gt;
       SETUP (Assume you have the following)&lt;br /&gt;
&lt;br /&gt;
              $ cat file_of_files&lt;br /&gt;
                  file1&lt;br /&gt;
                  file2&lt;br /&gt;
&lt;br /&gt;
              $ cat file1&lt;br /&gt;
                  This is the data in file1&lt;br /&gt;
&lt;br /&gt;
              $ cat file 2&lt;br /&gt;
                  This is the data in file2&lt;br /&gt;
&lt;br /&gt;
       So there are 3 files here &amp;quot;file_of_files&amp;quot; which contains the name of&lt;br /&gt;
       other files.  In this case &amp;quot;file1&amp;quot; and &amp;quot;file2&amp;quot;. And the contents of&lt;br /&gt;
       &amp;quot;file1&amp;quot; and &amp;quot;file2&amp;quot; is shown above.&lt;br /&gt;
&lt;br /&gt;
               $ cat file_of_files|xargs cat&lt;br /&gt;
                    This is the data in  file1&lt;br /&gt;
                    This is the data in  file2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 44:&lt;br /&gt;
&lt;br /&gt;
     Columns and Rows -- getting anything you want.&lt;br /&gt;
&lt;br /&gt;
     Assume you have the following file.&lt;br /&gt;
&lt;br /&gt;
        $ cat data&lt;br /&gt;
           1 2 3&lt;br /&gt;
           4 5&lt;br /&gt;
           6 7 8 9 10&lt;br /&gt;
           11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
     How to you get everything in  2 columns?&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l2&lt;br /&gt;
           1 2&lt;br /&gt;
           3 4&lt;br /&gt;
           5 6&lt;br /&gt;
           7 8&lt;br /&gt;
           9 10&lt;br /&gt;
           11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
    Three columns?&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l3&lt;br /&gt;
           1 2 3&lt;br /&gt;
           4 5 6&lt;br /&gt;
           7 8 9&lt;br /&gt;
           10 11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
    What's the row sum of the &amp;quot;three columns?&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
           6&lt;br /&gt;
           15&lt;br /&gt;
           24&lt;br /&gt;
           33&lt;br /&gt;
           27&lt;br /&gt;
&lt;br /&gt;
    or&lt;br /&gt;
&lt;br /&gt;
        $ tr ' ' '\n' &amp;lt; data |xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
&lt;br /&gt;
    NOTE &amp;quot;Steven Heiner's rule&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
             cat one_file | program&lt;br /&gt;
&lt;br /&gt;
           can always be rewritten as&lt;br /&gt;
&lt;br /&gt;
             program &amp;lt; one_file&lt;br /&gt;
&lt;br /&gt;
   Note: thanks to Steven Heiner (http://www.shelldorado.com/) the above can be&lt;br /&gt;
       shortened as follows:&lt;br /&gt;
&lt;br /&gt;
               $ tr ' ' '\n' &amp;lt; data|xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
&lt;br /&gt;
          Need to &amp;quot;tr&amp;quot; from the stdin?&lt;br /&gt;
&lt;br /&gt;
               $ tr &amp;quot;xy&amp;quot; &amp;quot;yx&amp;quot;| ... | ...&lt;br /&gt;
&lt;br /&gt;
       But there is a the &amp;quot;Stephane CHAZELAS&amp;quot; condition here&lt;br /&gt;
&lt;br /&gt;
         &amp;quot;Note that tr, sed, and awk mail fail on files containing '\0'&lt;br /&gt;
          sed and awk have unspecified behaviors if the input&lt;br /&gt;
          doesn't end in a '\n' (or to sum up, cat works for&lt;br /&gt;
          binary and text files, text utilities such as sed or awk&lt;br /&gt;
          work only for text files).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 45:&lt;br /&gt;
&lt;br /&gt;
     Auto Directory Spelling Corrections.&lt;br /&gt;
&lt;br /&gt;
      To turn this on:&lt;br /&gt;
&lt;br /&gt;
           $ shopt -s cdspell&lt;br /&gt;
&lt;br /&gt;
      Now mispell a directory in the cd command.&lt;br /&gt;
&lt;br /&gt;
           $ cd /usk/local&lt;br /&gt;
                   ^-------- still gets you to --&lt;br /&gt;
                                                |&lt;br /&gt;
                                            /usr/local&lt;br /&gt;
&lt;br /&gt;
      What other options can you set? The following will list&lt;br /&gt;
      all the options:&lt;br /&gt;
&lt;br /&gt;
           $ shopt -p&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 46:&lt;br /&gt;
&lt;br /&gt;
     Record Eveything Printed on Your Terminal Screen.&lt;br /&gt;
&lt;br /&gt;
            $ script -a &amp;lt;filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Now start doing stuff and &amp;quot;everything&amp;quot; is appended to &amp;lt;filename&amp;gt;.&lt;br /&gt;
     For example&lt;br /&gt;
&lt;br /&gt;
            $ script installation&lt;br /&gt;
&lt;br /&gt;
            $ (command)&lt;br /&gt;
&lt;br /&gt;
            $ (result)&lt;br /&gt;
&lt;br /&gt;
            $ ...&lt;br /&gt;
&lt;br /&gt;
            $ ...&lt;br /&gt;
&lt;br /&gt;
            $ (command)&lt;br /&gt;
&lt;br /&gt;
            $ (result)&lt;br /&gt;
&lt;br /&gt;
            $ exit&lt;br /&gt;
&lt;br /&gt;
     The whole session log is in the installation file that you can later&lt;br /&gt;
     read and/or cleanup and add to a documentation.&lt;br /&gt;
&lt;br /&gt;
     This command can also be used to redirect the contents to another user,&lt;br /&gt;
     but you must be root to do this.&lt;br /&gt;
&lt;br /&gt;
     Step 1 - find out what pts they are using.&lt;br /&gt;
&lt;br /&gt;
            $ w&lt;br /&gt;
&lt;br /&gt;
     Step 2 - Run script on that pts. After running this command below&lt;br /&gt;
              everything you type will appear on their screen.&lt;br /&gt;
&lt;br /&gt;
            $ script /dev/pts/4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Thanks to Jacques.GARNIER-EXTERIEUR@EU.RHODIA.COM for his contribution&lt;br /&gt;
     to this tip.&lt;br /&gt;
&lt;br /&gt;
     Also reference TIP 208.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 47:&lt;br /&gt;
&lt;br /&gt;
     Monitor all Network Traffic Except Your Current ssh Connection.&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX -s 1500 port not 22&lt;br /&gt;
&lt;br /&gt;
       Or to filter out port 123 as well getting the full length of the packet&lt;br /&gt;
       (-s 0), use the following:&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX -s 0 port not 22  and port not 123&lt;br /&gt;
&lt;br /&gt;
       Or to filter only a certain host say 81.169.158.205&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX  port not 22 and host 81.169.158.205&lt;br /&gt;
&lt;br /&gt;
     Just want ip addresses and a little bit of data, then,&lt;br /&gt;
     use this. The &amp;quot;-c 20&amp;quot; is to stop after 20 packets.&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN  -s 1500 port not 22 -c 20&lt;br /&gt;
&lt;br /&gt;
     If you're looking for sign of DOS attacks, the following show just the SYN&lt;br /&gt;
     packets on all interfaces:&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump 'tcp[13] &amp;amp; 2 == 2'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 48:&lt;br /&gt;
&lt;br /&gt;
     Where are the GNU Reference Manuals?&lt;br /&gt;
&lt;br /&gt;
           http://www.gnu.org/manual/manual.html&lt;br /&gt;
&lt;br /&gt;
     Also worth a look the &amp;quot;Linux Documentation Project&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           http://en.tldp.org/&lt;br /&gt;
&lt;br /&gt;
     and Red Hat manuals&lt;br /&gt;
&lt;br /&gt;
           http://www.redhat.com/docs/manuals/enterprise/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 49:&lt;br /&gt;
&lt;br /&gt;
     Setting or Changing the Library Path.&lt;br /&gt;
&lt;br /&gt;
     The following contains the settings to be added or deleted&lt;br /&gt;
&lt;br /&gt;
           /etc/ld.so.conf&lt;br /&gt;
&lt;br /&gt;
     After this file is edited, you must run the following:&lt;br /&gt;
&lt;br /&gt;
           $ ldconfig&lt;br /&gt;
&lt;br /&gt;
     See &amp;quot;man ldconfig&amp;quot; for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 50:&lt;br /&gt;
&lt;br /&gt;
     Working with Libraries in C&lt;br /&gt;
&lt;br /&gt;
     Assume the following 3 programs:&lt;br /&gt;
&lt;br /&gt;
      $ cat ./src/test.c&lt;br /&gt;
&lt;br /&gt;
         int test(int t)&lt;br /&gt;
         {&lt;br /&gt;
           printf(&amp;quot;%d\n&amp;quot;,t);&lt;br /&gt;
           return t;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      $ cat ./src/prog1.c&lt;br /&gt;
&lt;br /&gt;
         /*&lt;br /&gt;
          program: prog1.c&lt;br /&gt;
          dependences: test.c&lt;br /&gt;
&lt;br /&gt;
          compiling this program:&lt;br /&gt;
          gcc -o prog test.c prog1.c&lt;br /&gt;
&lt;br /&gt;
          Note the libpersonal include&lt;br /&gt;
          should be remove if NOT using the&lt;br /&gt;
          library&lt;br /&gt;
         */&lt;br /&gt;
&lt;br /&gt;
         #include &amp;lt;libpersonal.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         int&lt;br /&gt;
         main(int argc, char **argv)&lt;br /&gt;
         {&lt;br /&gt;
           test(45);&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
      $ cat ./include/libpersonal.h&lt;br /&gt;
&lt;br /&gt;
         extern int test(int);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Prog1.c needs the test function in  test.c&lt;br /&gt;
     To compile, so that both programs work together, do the following:&lt;br /&gt;
&lt;br /&gt;
          $ cd src&lt;br /&gt;
          $ gcc -o prog test.c prog1.c -I../include&lt;br /&gt;
&lt;br /&gt;
     However, if you want to create your own static library, then, run the following:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p ../lib&lt;br /&gt;
          $ gcc -c test.c  -o ../lib/test.o&lt;br /&gt;
          $ cd ../lib&lt;br /&gt;
          $ ar r libpersonal.a test.o&lt;br /&gt;
          $ ranlib libpersonal.a&lt;br /&gt;
&lt;br /&gt;
     or, the ar and ranlib command can be combined as follows:&lt;br /&gt;
&lt;br /&gt;
          $ ar rs libpersonal.a test.o&lt;br /&gt;
&lt;br /&gt;
     To compile the program with the static library:&lt;br /&gt;
&lt;br /&gt;
          $ cd ../src&lt;br /&gt;
          $ gcc -I../include -L../lib -o prog1 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     The -I../include  tells  gcc to look in the ../include directory for&lt;br /&gt;
     libpersonal.h. and -L../lib, tells gcc to look for the&lt;br /&gt;
     &amp;quot;libpersonal.a&amp;quot; library.&lt;br /&gt;
&lt;br /&gt;
           $ cd ..&lt;br /&gt;
           $ tree src lib include&lt;br /&gt;
           src&lt;br /&gt;
           |-- prog&lt;br /&gt;
           |-- prog1&lt;br /&gt;
           |-- prog1.c&lt;br /&gt;
           `-- test.c&lt;br /&gt;
           lib&lt;br /&gt;
           |-- libpersonal.a&lt;br /&gt;
           `-- test.o&lt;br /&gt;
           include&lt;br /&gt;
           `-- libpersonal.h&lt;br /&gt;
&lt;br /&gt;
     This was a STATIC library. Often times you will want to use a SHARED&lt;br /&gt;
     or dynamic library.&lt;br /&gt;
&lt;br /&gt;
     SHARED LIBRARY:&lt;br /&gt;
&lt;br /&gt;
     You must recompile test.c with -fpic option.&lt;br /&gt;
&lt;br /&gt;
          $ cd ../lib&lt;br /&gt;
          $ gcc -c -fpic ../src/test.c -o test.o&lt;br /&gt;
&lt;br /&gt;
     Next create the libpersonal.so file.&lt;br /&gt;
&lt;br /&gt;
          $ gcc -shared -o libpersonal.so test.o&lt;br /&gt;
&lt;br /&gt;
     Now, compile the source prog1.c as follows:&lt;br /&gt;
&lt;br /&gt;
          $ cd ../src&lt;br /&gt;
          $ gcc -Wl,-R../lib -L../lib -I../include -o prog2 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
     This should work fine. But, take a look at prog2 using the ldd command.&lt;br /&gt;
&lt;br /&gt;
          $ ldd prog2&lt;br /&gt;
&lt;br /&gt;
        libpersonal.so =&amp;gt; ../lib/libpersonal.so (0x40017000)&lt;br /&gt;
        libc.so.6 =&amp;gt; /lib/tls/libc.so.6 (0x42000000)&lt;br /&gt;
        /lib/ld-linux.so.2 =&amp;gt; /lib/ld-linux.so.2 (0x40000000)&lt;br /&gt;
&lt;br /&gt;
     If you move the program prog2 to a different location, it will not run.&lt;br /&gt;
     Instead you will get the following error:&lt;br /&gt;
&lt;br /&gt;
           prog2: error while loading shared libraries: libpersonal.so:&lt;br /&gt;
                     cannot open shared object file: No such file or directory&lt;br /&gt;
&lt;br /&gt;
     To fix this, you should specify the direct path to the library. And in my&lt;br /&gt;
     case it is rather long&lt;br /&gt;
&lt;br /&gt;
      $  gcc -Wl,-R/work/souptonuts/documentation/theBook/lib -L../lib -I../include -o prog2 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE: The -R must always follow the -Wl.  (-Wl,-R&amp;lt;directory&amp;gt;) They always go together&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 51:&lt;br /&gt;
&lt;br /&gt;
     Actively Monitor a File and Send Email when Expression Occurs.&lt;br /&gt;
&lt;br /&gt;
     This is a way to monitor &amp;quot;/var/log/messages&amp;quot; or any file for certain changes.&lt;br /&gt;
     The example below actively monitors &amp;quot;stuff&amp;quot; for the work &amp;quot;now&amp;quot; and as soon as&lt;br /&gt;
     &amp;quot;now&amp;quot; is added to the file, the contents of msg are sent to the user&lt;br /&gt;
     mikechirico@hotmail.com&lt;br /&gt;
&lt;br /&gt;
          $ tail -f stuff | \&lt;br /&gt;
              awk ' /now/ { system(&amp;quot;mail -s \&amp;quot;This is working\&amp;quot;  mikechirico@hotmail.com &amp;lt; msg&amp;quot;) }'&lt;br /&gt;
&lt;br /&gt;
     Or, you can run a program, say get headings on slashdot from the program &amp;quot;getslash.php&amp;quot; which&lt;br /&gt;
     runs on  &amp;quot;192.168.1.155&amp;quot; with account &amp;quot;chirico&amp;quot;. Assuming you have ssh keys setup, then, the following&lt;br /&gt;
     will send mail from the output:&lt;br /&gt;
&lt;br /&gt;
          $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;|mail -s &amp;quot;Slash cron Headlines&amp;quot;  mchirico@comcast.net&lt;br /&gt;
&lt;br /&gt;
     See (TIP 80) for scraping the headings on slash dot and how to get a copy of &amp;quot;getslash.php&amp;quot;.  If you still&lt;br /&gt;
     want to use awk:&lt;br /&gt;
&lt;br /&gt;
           $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;| \&lt;br /&gt;
                      awk '{ print $0 | &amp;quot;mail -s \x27 Slash Topics \x27 mchirico@comcast.net &amp;quot;}'&lt;br /&gt;
&lt;br /&gt;
     Note the &amp;quot;\x27&amp;quot; is a quote.  Maybe you only want articles dealing with &amp;quot;Linux&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
           $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;| \&lt;br /&gt;
                      awk '/Linux/{ print $0 | &amp;quot;mail -s \x27 Slash Topics \x27 mchirico@comcast.net &amp;quot;}'&lt;br /&gt;
&lt;br /&gt;
     For $60, you can get a numeric display from &amp;quot;delcom engineering&amp;quot; that you can send messages and&lt;br /&gt;
     data to.  I get weather information off the internet and send it to this device.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/projects/delcom/&lt;br /&gt;
&lt;br /&gt;
     (Reference TIP 151 for ssh tips)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 52:&lt;br /&gt;
&lt;br /&gt;
     Need to Keep Secrets? Encrypt it.&lt;br /&gt;
&lt;br /&gt;
      To Encrypt:&lt;br /&gt;
&lt;br /&gt;
            $ openssl des3 -salt -in file.txt -out file.des3&lt;br /&gt;
&lt;br /&gt;
      The above will prompt for a password, or you can put it in&lt;br /&gt;
      with a -k option, assuming you're on a trusted server.&lt;br /&gt;
&lt;br /&gt;
      To Decrypt&lt;br /&gt;
&lt;br /&gt;
            $  openssl des3 -d -salt -in file.des3 -out file.txt -k mypassword&lt;br /&gt;
&lt;br /&gt;
      Need to encrypt what you type? Enter the following, then start typing&lt;br /&gt;
      and  ^D to end.&lt;br /&gt;
&lt;br /&gt;
            $ openssl des3 -salt -out stuff.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 53:&lt;br /&gt;
&lt;br /&gt;
     Check that a File has Not Been Tampered With: Use Cryptographic Hashing Function.&lt;br /&gt;
&lt;br /&gt;
     The md5sum is popular but dated&lt;br /&gt;
&lt;br /&gt;
              $ md5sum file&lt;br /&gt;
&lt;br /&gt;
     Instead, use one of the following;&lt;br /&gt;
&lt;br /&gt;
              $ openssl dgst -sha1 -c file&lt;br /&gt;
&lt;br /&gt;
              $ openssl dgst -ripemd160 -c  file&lt;br /&gt;
&lt;br /&gt;
     All calls give a fixed length string or &amp;quot;message digest&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 54:&lt;br /&gt;
&lt;br /&gt;
     Need to View Information About a Secure Web Server? A SSL/TLS test.&lt;br /&gt;
&lt;br /&gt;
           $ openssl s_client -connect www.sourceforge.net:443&lt;br /&gt;
&lt;br /&gt;
     Above will give a long listing of certificates.&lt;br /&gt;
&lt;br /&gt;
     Note, it is also possible to get certificate information about a mail server&lt;br /&gt;
&lt;br /&gt;
           $ openssl s_client -connect mail.comcast.net:995 -showcerts&lt;br /&gt;
&lt;br /&gt;
     When you do the above command you get two certificates. If you copy&lt;br /&gt;
     past both certificates by taking the following contents include the&lt;br /&gt;
     begin and end show below:&lt;br /&gt;
&lt;br /&gt;
                 -----BEGIN CERTIFICATE-----&lt;br /&gt;
                 ....&lt;br /&gt;
                 -----END CERTIFICATE-----&lt;br /&gt;
&lt;br /&gt;
     Then create files &amp;quot;comcast0.pem&amp;quot; and &amp;quot;comcast1.pem&amp;quot; out of these certificaties and&lt;br /&gt;
     put them in a directory &amp;quot;/home/donkey/.certs&amp;quot;, then, with the openssl src package, in&lt;br /&gt;
     the &amp;quot;./tools/c_rehash&amp;quot; run&lt;br /&gt;
&lt;br /&gt;
            $ c_rehash .certs&lt;br /&gt;
            Doing .certs&lt;br /&gt;
            comcast0.pem =&amp;gt; 72f90dc0.0&lt;br /&gt;
            comcast1.pem =&amp;gt; f73e89fd.0&lt;br /&gt;
&lt;br /&gt;
     Now it's possible to have fetchmail work with these certs.&lt;br /&gt;
&lt;br /&gt;
       #&lt;br /&gt;
       #&lt;br /&gt;
       # Sample .fetchmailrc file for Comcast&lt;br /&gt;
       #&lt;br /&gt;
       # Check mail every 90 seconds&lt;br /&gt;
       set daemon 90&lt;br /&gt;
       set syslog&lt;br /&gt;
       set postmaster donkey&lt;br /&gt;
       #set bouncemail&lt;br /&gt;
       #&lt;br /&gt;
       # Comcast email is zdonkey but computer account is  just donkey&lt;br /&gt;
       #&lt;br /&gt;
       poll mail.comcast.net with proto POP3 and options no dns&lt;br /&gt;
              user 'zdonkey' with pass &amp;quot;somethin35&amp;quot;  is 'donkey' here options ssl sslcertck sslcertpath '/home/donkey/.certs'&lt;br /&gt;
              smtphost comcast.net&lt;br /&gt;
       # currently not used&lt;br /&gt;
       mda '/usr/bin/procmail -d %T'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     REFERENCE: http://www.openssl.org/&lt;br /&gt;
                http://www.catb.org/~esr/fetchmail/fetchmail-6.2.5.tar.gz&lt;br /&gt;
                http://www.madboa.com/geek/openssl/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 55:&lt;br /&gt;
&lt;br /&gt;
     cp --parents. What does this option do?&lt;br /&gt;
&lt;br /&gt;
     Assume you have the following directory structure&lt;br /&gt;
&lt;br /&gt;
            .&lt;br /&gt;
            |-- a&lt;br /&gt;
            |   `-- b&lt;br /&gt;
            |       `-- c&lt;br /&gt;
            |           `-- d&lt;br /&gt;
            |               |-- file1&lt;br /&gt;
            |               `-- file2&lt;br /&gt;
            `-- newdir&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Issue the following command:&lt;br /&gt;
&lt;br /&gt;
         $ cp --parents ./a/b/c/d/* ./newdir/&lt;br /&gt;
&lt;br /&gt;
     Now you have the following:&lt;br /&gt;
&lt;br /&gt;
            .&lt;br /&gt;
            |-- a&lt;br /&gt;
            |   `-- b&lt;br /&gt;
            |       `-- c&lt;br /&gt;
            |           `-- d&lt;br /&gt;
            |               |-- file1&lt;br /&gt;
            |               `-- file2&lt;br /&gt;
            `-- newdir&lt;br /&gt;
                `-- a&lt;br /&gt;
                    `-- b&lt;br /&gt;
                        `-- c&lt;br /&gt;
                            `-- d&lt;br /&gt;
                                |-- file1&lt;br /&gt;
                                `-- file2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 56:&lt;br /&gt;
&lt;br /&gt;
     Quickly Locating files.&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;locate&amp;quot; command quickly searches the indexed database for files.  It just&lt;br /&gt;
     gives the name of the files; but, if you need more information use it as follows&lt;br /&gt;
&lt;br /&gt;
         $ locate document|xargs ls -l&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;locate&amp;quot; database may only get updated every 24 hours.  For more recent finds,&lt;br /&gt;
     use the &amp;quot;find&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 57:&lt;br /&gt;
&lt;br /&gt;
     Using the &amp;quot;find&amp;quot; Command.&lt;br /&gt;
&lt;br /&gt;
     List only directories, max 2 nodes down that have &amp;quot;net&amp;quot; in the name&lt;br /&gt;
&lt;br /&gt;
       $ find /proc -type d -maxdepth 2 -iname '*net*'&lt;br /&gt;
&lt;br /&gt;
     Find all *.c and *.h files starting from the current &amp;quot;.&amp;quot; position.&lt;br /&gt;
&lt;br /&gt;
       $ find . \( -iname '*.c'  -o -iname '*.h' \) -print&lt;br /&gt;
&lt;br /&gt;
     Find all, but skip what's in &amp;quot;/CVS&amp;quot; and &amp;quot;/junk&amp;quot;. Start from &amp;quot;/work&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ find /work \( -iregex '.*/CVS'  -o -iregex '.*/junk' \)  -prune -o -print&lt;br /&gt;
&lt;br /&gt;
     Note -regex and -iregex work on the directory as well, which means&lt;br /&gt;
     you must consider the &amp;quot;./&amp;quot; that comes before all listings.&lt;br /&gt;
&lt;br /&gt;
     Here is another example. Find all files except what is under the CVS, including&lt;br /&gt;
     CVS listings. Also exclude &amp;quot;#&amp;quot; and &amp;quot;~&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       $ find . -regex '.*' ! \( -regex '.*CVS.*'  -o -regex '.*[#|~].*' \)&lt;br /&gt;
&lt;br /&gt;
     Find a *.c file, then run grep on it looking for &amp;quot;stdio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       $ find . -iname '*.c' -exec grep -H 'stdio.h' {} \;&lt;br /&gt;
         sample output --&amp;gt;  ./prog1.c:#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
                            ./test.c:#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Looking for the disk-hog on the whole system?&lt;br /&gt;
&lt;br /&gt;
       $ find /  -size +10000k 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
     Looking for files changed in the last 24 hours? Make sure you add the&lt;br /&gt;
     minus sign &amp;quot;-1&amp;quot;, otherwise, you will only find files changed exactly&lt;br /&gt;
     24 hours from now. With the &amp;quot;-1&amp;quot; you get files changed from now to 24&lt;br /&gt;
     hours.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ find  . -ctime -1  -printf &amp;quot;%a %f\n&amp;quot;&lt;br /&gt;
       Wed Oct  6 12:51:56 2004 .&lt;br /&gt;
       Wed Oct  6 12:35:16 2004 How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
     Or if you just want files.&lt;br /&gt;
&lt;br /&gt;
       $ find . -type f -ctime -1  -printf &amp;quot;%a %f\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Details on file status change in the last 48 hours, current directory. Also note &amp;quot;-atime -2&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
       $ find . -ctime -2 -type f -exec ls -l {} \;&lt;br /&gt;
&lt;br /&gt;
             NOTE: if you don't use -type f, you make get &amp;quot;.&amp;quot; returned, which&lt;br /&gt;
             when run through ls &amp;quot;ls .&amp;quot; may list more than what you want.&lt;br /&gt;
&lt;br /&gt;
             Also you may only want the current directory&lt;br /&gt;
&lt;br /&gt;
       $ find . -ctime -2 -type f -maxdepth 1 -exec ls -l {} \;&lt;br /&gt;
&lt;br /&gt;
     To find files modified within the last 5 to 10 minutes&lt;br /&gt;
&lt;br /&gt;
       $ find . -mmin +5 -mmin -10 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     For more example &amp;quot;find&amp;quot; commands, reference the following looking&lt;br /&gt;
     for the latest version of &amp;quot;bashscripts.x.x.x.tar.gz&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79320&amp;amp;package_id=80711&lt;br /&gt;
&lt;br /&gt;
     See &amp;quot;TIP 71&amp;quot; for examples of find using the inode feature. &amp;quot; $ find . -inum &amp;lt;inode&amp;gt; -exec rm -- '{}' \; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     If you don't want error messages, or need to redirect error messages &amp;quot;&amp;gt; /dev/null 2&amp;gt;&amp;amp;1&amp;quot;, or see&lt;br /&gt;
     &amp;quot;TIP 81&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 58:&lt;br /&gt;
&lt;br /&gt;
     Using the &amp;quot;rm&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
     How do you remove a file that has the name &amp;quot;-&amp;quot;.  For instance, if you run the command&lt;br /&gt;
     &amp;quot;$ cat &amp;gt; - &amp;quot; and type some text followed by ^d, how does the &amp;quot;-&amp;quot; file get deleted?&lt;br /&gt;
&lt;br /&gt;
        $ rm -- -&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;--&amp;quot; nullifies any rm options.&lt;br /&gt;
&lt;br /&gt;
     How do you delete the directory &amp;quot;one&amp;quot;, all it's sub-directories, and any data?&lt;br /&gt;
&lt;br /&gt;
        $ rm -rf ./one&lt;br /&gt;
&lt;br /&gt;
     Note, to selectively delete stuff on a directory, use the find command &amp;quot;TIP 57&amp;quot;.&lt;br /&gt;
     To delete by inode, see &amp;quot;TIP 71&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 59:&lt;br /&gt;
&lt;br /&gt;
     Giving ownership.&lt;br /&gt;
&lt;br /&gt;
     How do you give the user &amp;quot;donkey&amp;quot; ownership to all directories and files under&lt;br /&gt;
     &amp;quot;./fordonkey&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          $ chown -R donkey ./fordonkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 60:&lt;br /&gt;
&lt;br /&gt;
     Only Permit root login -- give others a message when they try to login.&lt;br /&gt;
&lt;br /&gt;
     Create the file &amp;quot;/etc/nologin&amp;quot; with &amp;quot;nologin&amp;quot; containing the contents&lt;br /&gt;
     of the message.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 61:&lt;br /&gt;
&lt;br /&gt;
     Limits: file size, open files, pipe size, stack size, max memory size&lt;br /&gt;
             cpu time, plus others.&lt;br /&gt;
&lt;br /&gt;
     To get a listing of current limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -a&lt;br /&gt;
             core file size        (blocks, -c) 0&lt;br /&gt;
             data seg size         (kbytes, -d) unlimited&lt;br /&gt;
             file size             (blocks, -f) unlimited&lt;br /&gt;
             max locked memory     (kbytes, -l) unlimited&lt;br /&gt;
             max memory size       (kbytes, -m) unlimited&lt;br /&gt;
             open files                    (-n) 1024&lt;br /&gt;
             pipe size          (512 bytes, -p) 8&lt;br /&gt;
             stack size            (kbytes, -s) 8192&lt;br /&gt;
             cpu time             (seconds, -t) unlimited&lt;br /&gt;
             max user processes            (-u) 8179&lt;br /&gt;
             virtual memory        (kbytes, -v) unlimited&lt;br /&gt;
&lt;br /&gt;
     Note as a user you can decrease your limits in the current&lt;br /&gt;
     shell session; but, you cannot increase.  This can be ideal&lt;br /&gt;
     for testing programs.  But, first you may want to create&lt;br /&gt;
     another shell &amp;quot;sh&amp;quot; so that you can &amp;quot;go back to where started&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -f 10&lt;br /&gt;
&lt;br /&gt;
     Now try&lt;br /&gt;
&lt;br /&gt;
          $ yes &amp;gt;&amp;gt; out&lt;br /&gt;
             File size limit exceeded&lt;br /&gt;
&lt;br /&gt;
     To set limits on users, make changes to &amp;quot;/etc/security/limits.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           bozo   - maxlogins 1&lt;br /&gt;
&lt;br /&gt;
     Will keep bozo from loging in more than once.&lt;br /&gt;
&lt;br /&gt;
     To list hard limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -Ha&lt;br /&gt;
&lt;br /&gt;
     To list soft limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -Sa&lt;br /&gt;
&lt;br /&gt;
     To restrict user access by time, day make changes to&lt;br /&gt;
             &amp;quot;/etc/security/time.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Also take a look at &amp;quot;/etc/profile&amp;quot; to see what other changes&lt;br /&gt;
     can be made, plus take a look under &amp;quot;/etc/security/*.conf&amp;quot; for&lt;br /&gt;
     other configuration files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 62:&lt;br /&gt;
&lt;br /&gt;
     Stupid &amp;quot;cat&amp;quot; Tricks.&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 43).&lt;br /&gt;
&lt;br /&gt;
     If you have multiple blank lines, squeeze these lines down to one,&lt;br /&gt;
     then, try the following:&lt;br /&gt;
&lt;br /&gt;
          $ cat -s &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to number the lines?&lt;br /&gt;
&lt;br /&gt;
          $ cat -n &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to show tabs?&lt;br /&gt;
&lt;br /&gt;
          $ cat -t &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Need to mark end of lines by &amp;quot;$&amp;quot;? The following was suggested by  (Amos Shapira)&lt;br /&gt;
&lt;br /&gt;
          $ cat -e &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to see all the ctl characters?&lt;br /&gt;
&lt;br /&gt;
          /* ctlgen.c&lt;br /&gt;
            Program to generate ctl characters.&lt;br /&gt;
&lt;br /&gt;
            Compile:&lt;br /&gt;
&lt;br /&gt;
               gcc -o ctlgen ctlgen.c&lt;br /&gt;
&lt;br /&gt;
            Run:&lt;br /&gt;
&lt;br /&gt;
               ./ctlgen &amp;gt; mout&lt;br /&gt;
&lt;br /&gt;
            Now see the characters:&lt;br /&gt;
&lt;br /&gt;
               cat -v mout&lt;br /&gt;
&lt;br /&gt;
            Here's a sample output:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               $ cat -v mout|tail&lt;br /&gt;
                   test M-v&lt;br /&gt;
                   test M-w&lt;br /&gt;
                   test M-x&lt;br /&gt;
                   test M-y&lt;br /&gt;
                   test M-z&lt;br /&gt;
                   test M-{&lt;br /&gt;
                   test M-|&lt;br /&gt;
                   test M-}&lt;br /&gt;
                   test M-~&lt;br /&gt;
                   test M-^?&lt;br /&gt;
&lt;br /&gt;
          */&lt;br /&gt;
          #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
          #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
          int main()&lt;br /&gt;
          {&lt;br /&gt;
            int i;&lt;br /&gt;
&lt;br /&gt;
            for(i=0; i &amp;lt; 256; ++i)&lt;br /&gt;
              printf(&amp;quot;test %c \n&amp;quot;,i);&lt;br /&gt;
&lt;br /&gt;
            return 0;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 63:&lt;br /&gt;
&lt;br /&gt;
     Guard against SYN attacks and &amp;quot;ping&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     As root do the following:&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/tcp_syncookies&lt;br /&gt;
&lt;br /&gt;
     Want to disable &amp;quot;ping&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_all&lt;br /&gt;
&lt;br /&gt;
     Disable broadcast/multicast &amp;quot;ping&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts&lt;br /&gt;
&lt;br /&gt;
     And to enable again:&lt;br /&gt;
&lt;br /&gt;
          echo 0 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_all&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 64:&lt;br /&gt;
&lt;br /&gt;
     Make changes to .bash_profile and need to update the current session?&lt;br /&gt;
&lt;br /&gt;
       $ source .bash_profile&lt;br /&gt;
&lt;br /&gt;
     With the above command, the user does not have to logout.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 65:&lt;br /&gt;
&lt;br /&gt;
     What are the Special Shell Variables?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        $#   The number of arguments.&lt;br /&gt;
        $@   All arguments, as separate words.&lt;br /&gt;
        $*   All arguments, as one word.&lt;br /&gt;
        $$   ID of the current process.&lt;br /&gt;
        $?   Exit status of the last command.&lt;br /&gt;
        $0,$1,..$9,${10},${11}...${N}    Positional parameters. After &amp;quot;9&amp;quot; you must use the ${k} syntax.&lt;br /&gt;
&lt;br /&gt;
     Note that 0 is true. For example if you execute the following, which is true you get zero.&lt;br /&gt;
&lt;br /&gt;
         $  [[ -f /etc/passwd ]]&lt;br /&gt;
         $  echo $?&lt;br /&gt;
         0&lt;br /&gt;
     And the following is false, which returns a 1.&lt;br /&gt;
&lt;br /&gt;
         $  [[ -f /etc/passwdjabberwisnohere ]]&lt;br /&gt;
         $  echo $?&lt;br /&gt;
         1&lt;br /&gt;
&lt;br /&gt;
     So true=0 and false=1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Sample program &amp;quot;mdo&amp;quot;  to show the difference between &amp;quot;$@&amp;quot; and &amp;quot;$*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        function myarg&lt;br /&gt;
        {&lt;br /&gt;
            echo &amp;quot;$# in myarg function&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
        echo -e &amp;quot;$# parameters on the cmd line\n&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;calling: myarg \&amp;quot;\$@\&amp;quot; and myarg \&amp;quot;\$*\&amp;quot;\n&amp;quot;&lt;br /&gt;
        myarg &amp;quot;$@&amp;quot;&lt;br /&gt;
        myarg &amp;quot;$*&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;\ncalling: myarg \$@ and myarg \$* without quotes\n&amp;quot;&lt;br /&gt;
        myarg $@&lt;br /&gt;
        myarg $*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The result of running &amp;quot;./mdo one two&amp;quot;. Note that when quoted, myarg &amp;quot;$*&amp;quot;,&lt;br /&gt;
      returns 1 ... all parameters are smushed together as one word.&lt;br /&gt;
&lt;br /&gt;
            [chirico@third-fl-71 theBook]$ ./mdo one two&lt;br /&gt;
            2 parameters on the cmd line&lt;br /&gt;
&lt;br /&gt;
            calling: myarg &amp;quot;$@&amp;quot; and myarg &amp;quot;$*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
            1 in myarg function&lt;br /&gt;
&lt;br /&gt;
            calling: myarg $@ and myarg $* without quotes&lt;br /&gt;
&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
&lt;br /&gt;
      Example program &amp;quot;mdo2&amp;quot; shows how the input separator can be changed.&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        IFS=|&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=,&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=\;&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=$1&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            [chirico@third-fl-71 theBook]$ ./mdo2 one two three four five&lt;br /&gt;
            one two three four five&lt;br /&gt;
&lt;br /&gt;
            one,two,three,four,five&lt;br /&gt;
&lt;br /&gt;
            one;two;three;four;five&lt;br /&gt;
&lt;br /&gt;
            oneotwoothreeofourofive&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 66:&lt;br /&gt;
&lt;br /&gt;
     Replace all &amp;quot;x&amp;quot; with &amp;quot;y&amp;quot; and all &amp;quot;y&amp;quot; with &amp;quot;x&amp;quot; in file data.&lt;br /&gt;
&lt;br /&gt;
        $ cata data&lt;br /&gt;
          x y&lt;br /&gt;
          y x&lt;br /&gt;
&lt;br /&gt;
        $ tr &amp;quot;xy&amp;quot;  &amp;quot;yx&amp;quot; &amp;lt; data&lt;br /&gt;
          y x&lt;br /&gt;
          x y&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 67:&lt;br /&gt;
&lt;br /&gt;
     On a Linux 2.6.x Kernel, how do you directly measure disk activity,&lt;br /&gt;
     and where is this information documented?&lt;br /&gt;
&lt;br /&gt;
          o The information is documented in the kernel source&lt;br /&gt;
               ./Documentation/iostats.txt&lt;br /&gt;
&lt;br /&gt;
          o The new way of getting this info in 2.6.x is&lt;br /&gt;
              $ cat /sys/block/hda/stat&lt;br /&gt;
            151121 5694 1932358 796675 37867 76770 916994 8353762 0 800672 9150437&lt;br /&gt;
&lt;br /&gt;
             Field  1 -- # of reads issued&lt;br /&gt;
                 This is the total number of reads completed successfully.&lt;br /&gt;
             Field  2 -- # of reads merged, field 6 -- # of writes merged&lt;br /&gt;
                 Reads and writes which are adjacent to each other may be merged for&lt;br /&gt;
                 efficiency.  Thus two 4K reads may become one 8K read before it is&lt;br /&gt;
                 ultimately handed to the disk, and so it will be counted (and queued)&lt;br /&gt;
                 as only one I/O.  This field lets you know how often this was done.&lt;br /&gt;
             Field  3 -- # of sectors read&lt;br /&gt;
                 This is the total number of sectors read successfully.&lt;br /&gt;
             Field  4 -- # of milliseconds spent reading&lt;br /&gt;
                 This is the total number of milliseconds spent by all reads (as&lt;br /&gt;
                 measured from __make_request() to end_that_request_last()).&lt;br /&gt;
             Field  5 -- # of writes completed&lt;br /&gt;
                 This is the total number of writes completed successfully.&lt;br /&gt;
             Field  7 -- # of sectors written&lt;br /&gt;
                 This is the total number of sectors written successfully.&lt;br /&gt;
             Field  8 -- # of milliseconds spent writing&lt;br /&gt;
                 This is the total number of milliseconds spent by all writes (as&lt;br /&gt;
                 measured from __make_request() to end_that_request_last()).&lt;br /&gt;
             Field  9 -- # of I/Os currently in progress&lt;br /&gt;
                 The only field that should go to zero. Incremented as requests are&lt;br /&gt;
                 given to appropriate request_queue_t and decremented as they finish.&lt;br /&gt;
             Field 10 -- # of milliseconds spent doing I/Os&lt;br /&gt;
                 This field is increases so long as field 9 is nonzero.&lt;br /&gt;
             Field 11 -- weighted # of milliseconds spent doing I/Os&lt;br /&gt;
                 This field is incremented at each I/O start, I/O completion, I/O&lt;br /&gt;
                 merge, or read of these stats by the number of I/Os in progress&lt;br /&gt;
                 (field 9) times the number of milliseconds spent doing I/O since the&lt;br /&gt;
                 last update of this field.  This can provide an easy measure of both&lt;br /&gt;
                 I/O completion time and the backlog that may be accumulating.&lt;br /&gt;
&lt;br /&gt;
       Note, this is device specific.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 68:&lt;br /&gt;
&lt;br /&gt;
     Passing Outbound Mail, plus Masquerading User and Hostname.&lt;br /&gt;
&lt;br /&gt;
     Here's a specific example:&lt;br /&gt;
&lt;br /&gt;
         How does one send and receive Comcast email from a home Linux box,&lt;br /&gt;
         which uses Comcast as the ISP, if the local account on the Linux&lt;br /&gt;
         box is different from the Comcast email.  For instance, the&lt;br /&gt;
         account on the Linux box is &amp;quot;chirico@third-fl-71&amp;quot; and the Comcast&lt;br /&gt;
         email account is &amp;quot;mchirico@comcast.net&amp;quot;.  Note both the hostname and&lt;br /&gt;
         username are different.&lt;br /&gt;
&lt;br /&gt;
         So, the user &amp;quot;chirico&amp;quot; using &amp;quot;mutt&amp;quot;, &amp;quot;elm&amp;quot; or any email program would&lt;br /&gt;
         like to send out email to say &amp;quot;donkey@comcast.net&amp;quot;; yet, donkey would&lt;br /&gt;
         see the email from &amp;quot;mchirico@comcast.net&amp;quot; and not &amp;quot;chirico@third-fl-71&amp;quot;&lt;br /&gt;
         but chirico@third-fl-71 would get the replies.&lt;br /&gt;
&lt;br /&gt;
         For a full description of how to solve this problem, including related&lt;br /&gt;
         &amp;quot;sendmail.mc&amp;quot;, &amp;quot;site.config.m4&amp;quot;, &amp;quot;genericstable&amp;quot;, &amp;quot;genericsdomain&amp;quot;,&lt;br /&gt;
         &amp;quot;.procmailrc&amp;quot;, and &amp;quot;.forward&amp;quot; files,  reference the following:&lt;br /&gt;
&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/README_COMCAST_EMAIL.txt?download&lt;br /&gt;
&lt;br /&gt;
         Included in the above link are instructions for building sendmail with&lt;br /&gt;
         &amp;quot;SASL&amp;quot; and &amp;quot;STARTTLS&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 69:&lt;br /&gt;
&lt;br /&gt;
     How do you remove just the last 2 lines from a file and save the result?&lt;br /&gt;
&lt;br /&gt;
         $ sed  '$d' file | sed '$d' &amp;gt; savefile&lt;br /&gt;
&lt;br /&gt;
     Or, as Amos Shapira pointed out, it's much easier with the head command.&lt;br /&gt;
&lt;br /&gt;
         $ head -2 file&lt;br /&gt;
&lt;br /&gt;
      And, of course, removing just the last line&lt;br /&gt;
&lt;br /&gt;
         $ sed '$d' file &amp;gt; savefile&lt;br /&gt;
&lt;br /&gt;
         (See REFERENCES (13))&lt;br /&gt;
&lt;br /&gt;
     How do you remove extra spaces at the end of a line?&lt;br /&gt;
&lt;br /&gt;
         $ sed 's/[ ]*$//g'&lt;br /&gt;
&lt;br /&gt;
     How do you remove blank lines, or lines with just spaces and tabs,&lt;br /&gt;
     saving the origional file as file.backup?&lt;br /&gt;
&lt;br /&gt;
         $ perl -pi.backup -e &amp;quot;s/^(\s)*\n//&amp;quot;  file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 70:&lt;br /&gt;
&lt;br /&gt;
     Generating Random Numbers.&lt;br /&gt;
&lt;br /&gt;
         $ od -vAn -N4 -tu4 &amp;lt; /dev/urandom&lt;br /&gt;
             3905158199&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 71:&lt;br /&gt;
&lt;br /&gt;
     Deleting a File by it's Inode Value.&lt;br /&gt;
&lt;br /&gt;
       See (PROGRAMMING TIP 5) for creating the file, or&lt;br /&gt;
&lt;br /&gt;
       $ cat &amp;gt; '\n\n\n\n\n\n\n'&lt;br /&gt;
         type some text&lt;br /&gt;
         ^D&lt;br /&gt;
&lt;br /&gt;
     To list the inode and display the characters.&lt;br /&gt;
&lt;br /&gt;
       $ ls -libt *&lt;br /&gt;
&lt;br /&gt;
     To remove by inode. Note the &amp;quot;--&amp;quot; option.  This&lt;br /&gt;
     will keep any special characters in the file from being&lt;br /&gt;
     interpreted at &amp;quot;rm&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
       $ find . -inum &amp;lt;inode&amp;gt; -exec rm -- '{}' \;&lt;br /&gt;
&lt;br /&gt;
     Or to check contents&lt;br /&gt;
&lt;br /&gt;
       $ find . -inum &amp;lt;inode&amp;gt; -exec cat '{}' \;&lt;br /&gt;
&lt;br /&gt;
     Reference:&lt;br /&gt;
         http://www.faqs.org/ftp/usenet/news.answers/unix-faq/faq/part2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 72:&lt;br /&gt;
&lt;br /&gt;
     Sending Attachments Using Mutt -- On the Command Line.&lt;br /&gt;
&lt;br /&gt;
        $ mutt -s &amp;quot;See Attachment&amp;quot; -a file.doc user@domain.net &amp;lt; message.txt&lt;br /&gt;
&lt;br /&gt;
          or just the message:&lt;br /&gt;
&lt;br /&gt;
        $ echo | mutt -a sample.tar.gz user@domain.net&lt;br /&gt;
&lt;br /&gt;
      Reference:&lt;br /&gt;
          http://www.shelldorado.com/articles/mailattachments.html&lt;br /&gt;
&lt;br /&gt;
        Also see (TIP 51).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 73:&lt;br /&gt;
&lt;br /&gt;
     Want to find out what functions a program calls?&lt;br /&gt;
&lt;br /&gt;
         $ strace &amp;lt;program&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Try this with &amp;quot;topen.c&amp;quot; (see PROGRAMMING TIP 5)&lt;br /&gt;
&lt;br /&gt;
         $ strace  ./topen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 74:&lt;br /&gt;
&lt;br /&gt;
     RPM Usage Summary.&lt;br /&gt;
&lt;br /&gt;
     Install. Full filename is needed.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -ivh Fedora/RPMS/postgresql-libs-7.4.2-1.i386.rpm&lt;br /&gt;
&lt;br /&gt;
     To view list of files installed with a particular package.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -ql postgresql-libs&lt;br /&gt;
                /usr/lib/libecpg.so.4&lt;br /&gt;
                /usr/lib/libecpg.so.4.1&lt;br /&gt;
                /usr/lib/libecpg_compat.so.1&lt;br /&gt;
                /usr/lib/libecpg_compat.so.1.1&lt;br /&gt;
                /usr/lib/libpgtypes.so.1&lt;br /&gt;
                ...&lt;br /&gt;
&lt;br /&gt;
     Or, to get the file listing from a package that is not installed use the&lt;br /&gt;
     &amp;quot;-p&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -pql /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/CHANGES&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/LICENSE&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/README&lt;br /&gt;
               /usr/share/man/man3/pcap.3.gz&lt;br /&gt;
&lt;br /&gt;
     For dependencies listing, use the &amp;quot;R&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qpR /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /sbin/ldconfig&lt;br /&gt;
               /sbin/ldconfig&lt;br /&gt;
               kernel &amp;gt;= 2.2.0&lt;br /&gt;
               libc.so.6&lt;br /&gt;
               libc.so.6(GLIBC_2.0)&lt;br /&gt;
               libc.so.6(GLIBC_2.1)&lt;br /&gt;
               libc.so.6(GLIBC_2.1.3)&lt;br /&gt;
               libc.so.6(GLIBC_2.3)&lt;br /&gt;
               openssl&lt;br /&gt;
               rpmlib(CompressedFileNames) &amp;lt;= 3.0.4-1&lt;br /&gt;
               rpmlib(PayloadFilesHavePrefix) &amp;lt;= 4.0-1&lt;br /&gt;
&lt;br /&gt;
     To check the integrity, use the &amp;quot;-K&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -K /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm: (sha1) dsa sha1 md5 gpg OK&lt;br /&gt;
&lt;br /&gt;
     To list all packages installed.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qa&lt;br /&gt;
&lt;br /&gt;
     To find out which file a package belongs to.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qf /usr/lib/libecpg.so.4.1&lt;br /&gt;
&lt;br /&gt;
     To uninstall a package&lt;br /&gt;
&lt;br /&gt;
         $ rpm -e&lt;br /&gt;
&lt;br /&gt;
     For building rpm packages reference the following:&lt;br /&gt;
       http://www-106.ibm.com/developerworks/library/l-rpm1/&lt;br /&gt;
&lt;br /&gt;
     To verify md5 sum so that you know it downloaded ok&lt;br /&gt;
&lt;br /&gt;
         $ rpm -K  *.rpm&lt;br /&gt;
&lt;br /&gt;
     The following is a good reference:&lt;br /&gt;
        http://www.rpm.org/max-rpm/s1-rpm-install-additional-options.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 75:&lt;br /&gt;
&lt;br /&gt;
     Listing Output from a Bash Script.&lt;br /&gt;
&lt;br /&gt;
     Add &amp;quot;set -x&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          #!/bin/bash&lt;br /&gt;
          set -x&lt;br /&gt;
          ls&lt;br /&gt;
          date&lt;br /&gt;
&lt;br /&gt;
     Will list the files and output as follows:&lt;br /&gt;
&lt;br /&gt;
           + ls&lt;br /&gt;
           ChangeLog  CVS  data  test&lt;br /&gt;
           + date&lt;br /&gt;
           Thu Jul  1 20:41:04 EDT 2004&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 76:&lt;br /&gt;
&lt;br /&gt;
     Using wget.&lt;br /&gt;
&lt;br /&gt;
     Grap a webpage and pipe it to less. For example suppose you wanted to pipe the&lt;br /&gt;
     contents of all these tips, directly from the web.&lt;br /&gt;
&lt;br /&gt;
      $ wget -O - http://sourceforge.net/direct-dl/mchirico/souptonuts/How_to_Linux_and_Open_Source.txt|less&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 77:&lt;br /&gt;
&lt;br /&gt;
     Finding IP address and MAC address.&lt;br /&gt;
&lt;br /&gt;
       $ /sbin/ifconfig&lt;br /&gt;
&lt;br /&gt;
     Note the following output &amp;quot;eth0&amp;quot; and &amp;quot;eth0:1&amp;quot; which means&lt;br /&gt;
     two IP addresses are tied to 1 NIC (Network Interface Card).&lt;br /&gt;
&lt;br /&gt;
             eth0      Link encap:Ethernet  HWaddr 00:50:DA:60:5B:AD&lt;br /&gt;
                       inet addr:192.168.1.155  Bcast:192.168.99.255  Mask:255.255.252.0&lt;br /&gt;
                       UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
                       RX packets:982757 errors:116 dropped:0 overruns:0 frame:116&lt;br /&gt;
                       TX packets:439297 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:1000&lt;br /&gt;
                       RX bytes:693529078 (661.4 Mb)  TX bytes:78400296 (74.7 Mb)&lt;br /&gt;
                       Interrupt:10 Base address:0xa800&lt;br /&gt;
&lt;br /&gt;
             eth0:1    Link encap:Ethernet  HWaddr 00:50:DA:60:5B:AD&lt;br /&gt;
                       inet addr:192.168.1.182  Bcast:192.168.3.255  Mask:255.255.252.0&lt;br /&gt;
                       UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
                       RX packets:982757 errors:116 dropped:0 overruns:0 frame:116&lt;br /&gt;
                       TX packets:439299 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:1000&lt;br /&gt;
                       RX bytes:693529078 (661.4 Mb)  TX bytes:78400636 (74.7 Mb)&lt;br /&gt;
                       Interrupt:10 Base address:0xa800&lt;br /&gt;
&lt;br /&gt;
             lo        Link encap:Local Loopback&lt;br /&gt;
                       inet addr:127.0.0.1  Mask:255.0.0.0&lt;br /&gt;
                       UP LOOPBACK RUNNING  MTU:16436  Metric:1&lt;br /&gt;
                       RX packets:785 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
                       TX packets:785 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:0&lt;br /&gt;
                       RX bytes:2372833 (2.2 Mb)  TX bytes:2372833 (2.2 Mb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 78:&lt;br /&gt;
&lt;br /&gt;
     DOS to UNIX and UNIX to DOS.&lt;br /&gt;
&lt;br /&gt;
        $ dos2unix file.txt&lt;br /&gt;
&lt;br /&gt;
     And to go the other way from UNIX to DOS&lt;br /&gt;
&lt;br /&gt;
        $ unix2dos unixfile&lt;br /&gt;
&lt;br /&gt;
     See the man page, since there are MAC options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     NOTE: If you're working file DOS files, you'll probably want to use&lt;br /&gt;
           &amp;quot;zip&amp;quot; instead of &amp;quot;gzip&amp;quot; so users on Windows can unzip them.&lt;br /&gt;
&lt;br /&gt;
              $ zip test.zip test.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 79:&lt;br /&gt;
&lt;br /&gt;
     Need to Run Interactive Commands? Try &amp;quot;expect&amp;quot;.&lt;br /&gt;
       http://expect.nist.gov/expect.tar.gz&lt;br /&gt;
&lt;br /&gt;
     This simple example waits for the input &amp;quot;hi&amp;quot;, in some form before&lt;br /&gt;
     returning, immediately, &amp;quot;hello there!&amp;quot;. Otherwise, it will wait for&lt;br /&gt;
     60 seconds, then, return &amp;quot;hello there!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/expect&lt;br /&gt;
          set timeout 60&lt;br /&gt;
          expect &amp;quot;hi\n&amp;quot;&lt;br /&gt;
          send &amp;quot;hello there!\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference:&lt;br /&gt;
        http://www.oreilly.com/catalog/expect/chapter/ch03.html&lt;br /&gt;
&lt;br /&gt;
        http://www.cotse.com/dlf/man/expect/bulletproof1.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 80:&lt;br /&gt;
&lt;br /&gt;
     Using PHP as a Command Line Scripting Language.&lt;br /&gt;
&lt;br /&gt;
     The following will grab the complete file from slashdot.&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/php -q&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;?php&lt;br /&gt;
         $fileName = &amp;quot;http://slashdot.org/slashdot.xml&amp;quot;;&lt;br /&gt;
         $rss = file($fileName) or die (&amp;quot;Cannot open file $fileName\n&amp;quot;);&lt;br /&gt;
         for ($index=0; $index &amp;lt; count($rss); $index++)&lt;br /&gt;
              {&lt;br /&gt;
              echo $rss[$index];&lt;br /&gt;
              }&lt;br /&gt;
         ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       Note, if you want an example that parses the XML of&lt;br /&gt;
       slashdot, then, download the following:&lt;br /&gt;
&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/php_scripts.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 81:&lt;br /&gt;
&lt;br /&gt;
     Discarding all output -- including stderr messages.&lt;br /&gt;
&lt;br /&gt;
         $ ls  &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     Or sending all output to a file&lt;br /&gt;
&lt;br /&gt;
         $ someprog &amp;gt; /tmp/file 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     Sometimes, find displays a lot of errors when searching through&lt;br /&gt;
     directories that the user doesn't have access to. To discard&lt;br /&gt;
     error messages &amp;quot;stderr&amp;quot;, which is normally file descripter &amp;quot;2&amp;quot;&lt;br /&gt;
     work the following:&lt;br /&gt;
&lt;br /&gt;
         $ find / -iname 'stuff' 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
          or to pipe results elsewhere&lt;br /&gt;
&lt;br /&gt;
         $ find / -iname 'stuff' &amp;gt; /tmp/results_of_find  2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 118).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 82:&lt;br /&gt;
&lt;br /&gt;
     Using MIX.  D. Knuth's  assembly language/machine-code instruction set used in&lt;br /&gt;
     his books to illustrate his algorithms.&lt;br /&gt;
&lt;br /&gt;
     Download the source:&lt;br /&gt;
&lt;br /&gt;
       http://sourceforge.net/project/showfiles.php?group_id=13897&lt;br /&gt;
&lt;br /&gt;
       $ ./configure&lt;br /&gt;
       $ make&lt;br /&gt;
       $ make install&lt;br /&gt;
&lt;br /&gt;
     Documentation can be found at the following link. The link on&lt;br /&gt;
     sourceforge is not correct, but, the one below works.&lt;br /&gt;
&lt;br /&gt;
       http://www.gnu.org/software/mdk/manual/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 83:&lt;br /&gt;
&lt;br /&gt;
     Gnuplot [ http://sourceforge.net/projects/gnuplot/ ].&lt;br /&gt;
&lt;br /&gt;
     This software is ideal for printing graphs.&lt;br /&gt;
&lt;br /&gt;
         gnuplot&amp;gt; set term png&lt;br /&gt;
         gnuplot&amp;gt; set output 'testcos.png'&lt;br /&gt;
         gnuplot&amp;gt; plot cos(x)*sin(x)&lt;br /&gt;
         gnuplot&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
     Or the following command can be put into &amp;quot;file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            $ cat &amp;gt; file&lt;br /&gt;
            set term png&lt;br /&gt;
            set output 'testcos.png'&lt;br /&gt;
            plot cos(x)*sin(x)&lt;br /&gt;
            exit&lt;br /&gt;
            ^D&lt;br /&gt;
&lt;br /&gt;
     Then, run as follows:&lt;br /&gt;
&lt;br /&gt;
            $ gnuplot file&lt;br /&gt;
&lt;br /&gt;
     Or, suppose you have the following file &amp;quot;/home/chirico/data&amp;quot;. Comments&lt;br /&gt;
     with &amp;quot;#&amp;quot; are not read by gnuplot.&lt;br /&gt;
&lt;br /&gt;
            # File /home/chirico/data&lt;br /&gt;
            #&lt;br /&gt;
            2005-07-26  1    2.3    3&lt;br /&gt;
            2005-07-27  2    3.4    5&lt;br /&gt;
            2005-07-28  3    4    6.6&lt;br /&gt;
            2005-07-29  4    6    2.5&lt;br /&gt;
&lt;br /&gt;
     And you have the following new &amp;quot;file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            set term png&lt;br /&gt;
            set xdata time&lt;br /&gt;
            set timefmt &amp;quot;%Y-%m-%d &amp;quot;&lt;br /&gt;
            set format x &amp;quot;%Y/%m/%d&amp;quot;&lt;br /&gt;
            set output '/var/www/html/chirico/gnuplot/data.png'&lt;br /&gt;
            plot '/home/chirico/data' using 1:2 w linespoints  title '1st col', \&lt;br /&gt;
             '/home/chirico/data' using 1:3 w linespoints  title '2nd col', \&lt;br /&gt;
             '/home/chirico/data' using 1:4 w linespoints  title '3rd col'&lt;br /&gt;
            exit&lt;br /&gt;
&lt;br /&gt;
     You can now get a graph of this data running the following:&lt;br /&gt;
&lt;br /&gt;
            $ gnuplot file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 84:&lt;br /&gt;
&lt;br /&gt;
     CPU Information - speed, processor, cache.&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/cpuinfo&lt;br /&gt;
&lt;br /&gt;
               processor       : 0&lt;br /&gt;
               vendor_id       : GenuineIntel&lt;br /&gt;
               cpu family      : 15&lt;br /&gt;
               model           : 2&lt;br /&gt;
               model name      : Intel(R) Pentium(R) 4 CPU 2.20GHz&lt;br /&gt;
               stepping        : 9&lt;br /&gt;
               cpu MHz         : 2193.221&lt;br /&gt;
               cache size      : 512 KB&lt;br /&gt;
               fdiv_bug        : no&lt;br /&gt;
               hlt_bug         : no&lt;br /&gt;
               f00f_bug        : no&lt;br /&gt;
               coma_bug        : no&lt;br /&gt;
               fpu             : yes&lt;br /&gt;
               fpu_exception   : yes&lt;br /&gt;
               cpuid level     : 2&lt;br /&gt;
               wp              : yes&lt;br /&gt;
               flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr&lt;br /&gt;
               bogomips        : 4325.37&lt;br /&gt;
&lt;br /&gt;
      &amp;quot;bogomips&amp;quot; is a rough but good way to quickly compare two computer speeds. True it's a&lt;br /&gt;
      bogus reading; but, a &amp;quot;good enough&amp;quot; for government work calculation.  See (TIP 10) for&lt;br /&gt;
      &amp;quot;vmstat&amp;quot; and &amp;quot;iostat&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 85:&lt;br /&gt;
&lt;br /&gt;
     POVRAY - Making Animated GIFs&lt;br /&gt;
&lt;br /&gt;
     To see this in action, reference:&lt;br /&gt;
      http://souptonuts.sourceforge.net/povray/orbit.pov.html&lt;br /&gt;
&lt;br /&gt;
     These are the basic command to create:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        $ povray orbit.ini -Iorbit.pov&lt;br /&gt;
        $ convert -delay 20 *.ppm orbit.gif&lt;br /&gt;
&lt;br /&gt;
     By the way, convert is a program from imagemagick, and it can&lt;br /&gt;
     be downloaded from ( http://www.imagemagick.org ).&lt;br /&gt;
&lt;br /&gt;
    The following is &amp;quot;orbit.pov&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          #include &amp;quot;colors.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;finish.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;metals.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;textures.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;stones.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;skies.inc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          camera {&lt;br /&gt;
            location &amp;lt; 2, 3, -8 &amp;gt;&lt;br /&gt;
            look_at  &amp;lt; 0, 0, 0 &amp;gt;&lt;br /&gt;
            focal_point &amp;lt;0, 0, 0&amp;gt;&lt;br /&gt;
            blur_samples 20&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          light_source {&lt;br /&gt;
                  &amp;lt; 0, 10, 0&amp;gt;&lt;br /&gt;
                  color White&lt;br /&gt;
                  area_light &amp;lt;2,0,0&amp;gt;,&amp;lt;0,0,2&amp;gt;, 2, 2&lt;br /&gt;
                  adaptive 1&lt;br /&gt;
                  fade_distance 8&lt;br /&gt;
                  fade_power 1&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          sky_sphere {&lt;br /&gt;
            S_Cloud3&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          plane { &amp;lt;0, 1, 0&amp;gt;, -1&lt;br /&gt;
                  texture {&lt;br /&gt;
                          pigment {&lt;br /&gt;
                                  checker color Blue, color White&lt;br /&gt;
                          }&lt;br /&gt;
                          finish {Phong_Glossy}&lt;br /&gt;
                  }&lt;br /&gt;
          }&lt;br /&gt;
          #declare ball0=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;0.5, 0.5, 0&amp;gt;, 1&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Yellow}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          #declare ball1=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;3, 2, 0&amp;gt;, 0.5&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Blue}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          #declare ball2=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;3, 1, 0&amp;gt;, 1&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Green}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          object {ball0 rotate 360*clock*y}&lt;br /&gt;
          object {ball1 rotate 720*clock*y}&lt;br /&gt;
          object {ball2 rotate 360*(1 - clock)*y}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    And, &amp;quot;orbit.ini&amp;quot; follows:&lt;br /&gt;
&lt;br /&gt;
          Output_File_Type=P&lt;br /&gt;
&lt;br /&gt;
          Width=320&lt;br /&gt;
          Height=240&lt;br /&gt;
&lt;br /&gt;
          Initial_Frame=1&lt;br /&gt;
          Final_Frame=10&lt;br /&gt;
          Antialias=true&lt;br /&gt;
&lt;br /&gt;
          Subset_Start_Frame=1&lt;br /&gt;
          Subset_End_Frame=10&lt;br /&gt;
&lt;br /&gt;
          Cyclic_Animation=on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 86:&lt;br /&gt;
&lt;br /&gt;
     GPG --  GnuPG&lt;br /&gt;
&lt;br /&gt;
        Reference: http://www.gnupg.org/documentation/faqs.html&lt;br /&gt;
                   http://codesorcery.net/mutt/mutt-gnupg-howto&lt;br /&gt;
                   http://www.gnupg.org/(en)/download/index.html&lt;br /&gt;
                   (SCRIPT 4) on following link:&lt;br /&gt;
                   http://prdownloads.sourceforge.net/souptonuts/README_common_script_commands.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Generage key:&lt;br /&gt;
&lt;br /&gt;
        $ gpg --gen-key&lt;br /&gt;
&lt;br /&gt;
     Generate public key ID and fingerprint&lt;br /&gt;
&lt;br /&gt;
        $ gpg --fingerprint&lt;br /&gt;
&lt;br /&gt;
     Get a list of keys:&lt;br /&gt;
&lt;br /&gt;
        $ gpg --list-keys&lt;br /&gt;
&lt;br /&gt;
          pub  1024D/A11C1499 2004-07-15 Mike Chirico &amp;lt;mchirico@comcast.net&amp;gt;&lt;br /&gt;
          sub  1024g/E1A3C2B3 2004-07-15&lt;br /&gt;
&lt;br /&gt;
     Encrypt&lt;br /&gt;
&lt;br /&gt;
        $ gpg -r Mike  --encrypt sample.txt&lt;br /&gt;
&lt;br /&gt;
       This will produce &amp;quot;sample.txt.asc&amp;quot;, which is a binary file.  Note, I can use &amp;quot;Mike&amp;quot; because that's the&lt;br /&gt;
       name on the list of keys. Again, it will be a binary file.&lt;br /&gt;
&lt;br /&gt;
     Encrypt using &amp;quot;ASCII-armored text&amp;quot;  (--armor), which is probably what you want when sending &amp;quot;in&amp;quot; the body of an&lt;br /&gt;
     email, or some document.&lt;br /&gt;
&lt;br /&gt;
        $ gpg  -r Mike  --encrypt --armor sample.txt&lt;br /&gt;
            or&lt;br /&gt;
        $ gpg -r Mike -e -a sample.txt&lt;br /&gt;
            or&lt;br /&gt;
        $ gpg --output somefile.asc --armor -r Mike  --encrypt --armor sample.txt&lt;br /&gt;
&lt;br /&gt;
     The above 3 statements will still produce &amp;quot;sample.txt.asc&amp;quot;, but look at it, or &amp;quot;$ cat sample.txt.asc&amp;quot; without &lt;br /&gt;
     fear, since there are no binary characters. Yes, you could even compile a program &amp;quot;$ g++ -o test test.c&amp;quot; , then,&lt;br /&gt;
     &amp;quot;$ gpg --output test.asc  -r Mike --encrypt --armor test&amp;quot;. However, when decrypting make sure to pipe&lt;br /&gt;
     the results.&lt;br /&gt;
&lt;br /&gt;
            $ gpg --decrypt test.asc &amp;gt; test&lt;br /&gt;
&lt;br /&gt;
     Export &amp;quot;public&amp;quot; key:&lt;br /&gt;
&lt;br /&gt;
           $ gpg --armor --export Mike &amp;gt; m1.asc&lt;br /&gt;
&lt;br /&gt;
     Signing the file &amp;quot;message.txt&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
           $ gpg --clearsign message.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Sending the key to the &amp;quot;key-server&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        First, list the keys.&lt;br /&gt;
&lt;br /&gt;
                $ gpg --list-keys&lt;br /&gt;
                    /home/chirico/.gnupg/pubring.gpg&lt;br /&gt;
                                 v------------------ Use this with &amp;quot;0x&amp;quot; in front -------&lt;br /&gt;
                  pub  1024D/A11C1499 2004-07-15 Mike Chirico  &amp;lt;mchirico@comcast.net&amp;gt;   |&lt;br /&gt;
                  sub  1024g/E1A3C2B3 2004-07-15                                        |&lt;br /&gt;
                                                                                        |&lt;br /&gt;
                                   v----------------------------------------------------&lt;br /&gt;
                $ gpg --send-keys 0xA11C1499&lt;br /&gt;
&lt;br /&gt;
             The above sends it to the keyserver defined in &amp;quot;/home/chirico/.gnupg/gpg.conf&amp;quot;.  Other key servers:&lt;br /&gt;
&lt;br /&gt;
                            wwwkeys.pgp.net&lt;br /&gt;
                            search.keyserver.net&lt;br /&gt;
                            pgp.ai.mit.edu&lt;br /&gt;
&lt;br /&gt;
             When you go to your user-group meetings, you need to bring 2 forms of ID, and&lt;br /&gt;
             list your Key fingerprint. Shown below is the command for getting this fingerprint.&lt;br /&gt;
&lt;br /&gt;
                $ gpg --fingerprint mchirico@comcast.net&lt;br /&gt;
                 pub   1024D/A11C1499 2004-07-15&lt;br /&gt;
                 Key fingerprint = 9D7F C80D BB7B 4BAB CCA4  1BE9 9056 5BEC A11C 1499&lt;br /&gt;
                 uid   Mike Chirico (http://souptonuts.sourceforge.net/chirico/index.php) &amp;lt;mchirico@comcast.net&amp;gt;&lt;br /&gt;
                 sub   1024g/E1A3C2B3 2004-07-15&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Receving keys:&lt;br /&gt;
&lt;br /&gt;
        The following will retrieve my mchirico@comcast.net key&lt;br /&gt;
&lt;br /&gt;
               $ gpg --recv-keys 0xA11C1499&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Special Note: If you get the following error &amp;quot;GPG: Warning: Using Insecure Memory&amp;quot; , then,&lt;br /&gt;
                   &amp;quot; chmod 4755 /path/to/gpg&amp;quot;  to setuid(root) permissioins on the gpg binary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     NOTE: If using mutt, just before sending with the &amp;quot;y&amp;quot; option, hit &amp;quot;p&amp;quot; to sign or encrypt.&lt;br /&gt;
&lt;br /&gt;
     It's possible to create a gpg/pgp email from the command line. For a tutorial on this,&lt;br /&gt;
     reference (SCRIPT 4) at the following link:&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/README_common_script_commands.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 87:&lt;br /&gt;
&lt;br /&gt;
     Working with Dates: Steffen Beyer has developed a Perl and C module for working with dates&lt;br /&gt;
&lt;br /&gt;
     This softare can be downloaded from the following location:&lt;br /&gt;
        http://www.engelschall.com/u/sb/download/pkg/Date-Calc-5.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
         $ wget http://www.engelschall.com/u/sb/download/pkg/Date-Calc-5.3.tar.gz&lt;br /&gt;
         $ tar -xzvf Date-Calc-5.3.tar.gz&lt;br /&gt;
         $ cd Date-Calc-5.3&lt;br /&gt;
         $ cp ./examples/cal.c .&lt;br /&gt;
         $ gcc cal.c DateCalc.c -o mcal&lt;br /&gt;
&lt;br /&gt;
     The file cal.c contains sample function calls from DateCalc.c.  Note, &amp;quot;DateCalc.c&amp;quot;&lt;br /&gt;
     is just a list of functions and includes for &amp;quot;DateCalc.h&amp;quot; and &amp;quot;ToolBox.h&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Or, and this may be easier, just download the following:&lt;br /&gt;
         http://prdownloads.sourceforge.net/cpearls/date_calc.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
     The above link contains a few examples.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 88:&lt;br /&gt;
&lt;br /&gt;
     Color patterns for mutt.&lt;br /&gt;
&lt;br /&gt;
     The colors can be changed in the /home/user/.muttrc file. The first field begins with&lt;br /&gt;
     color, the second field is the foreground color, and the third field is the background&lt;br /&gt;
     color, or default.&lt;br /&gt;
&lt;br /&gt;
     An example .muttrc for colors:&lt;br /&gt;
&lt;br /&gt;
       # color patterns for mutt&lt;br /&gt;
       color normal     white          black # normal text&lt;br /&gt;
       color indicator  black          yellow  # actual message&lt;br /&gt;
       color tree       brightmagenta  default # thread arrows&lt;br /&gt;
       color status     brightyellow         default # status line&lt;br /&gt;
       color error      brightred      default # errors&lt;br /&gt;
       color message    magenta        default # info messages&lt;br /&gt;
       color signature  magenta        default # signature&lt;br /&gt;
       color attachment brightyellow   red     # MIME attachments&lt;br /&gt;
       color search     brightyellow   red     # search matches&lt;br /&gt;
       color tilde      brightmagenta  default # ~ at bottom of msg&lt;br /&gt;
       color markers    red            default # + at beginning of wrapped lines&lt;br /&gt;
       color hdrdefault cyan           default # default header lines&lt;br /&gt;
       color bold       red            default # hiliting bold patterns in body&lt;br /&gt;
       color underline  green          default # hiliting underlined patterns in body&lt;br /&gt;
       color quoted     cyan           default # quoted text&lt;br /&gt;
       color quoted1    magenta        default&lt;br /&gt;
       color quoted2    red            default&lt;br /&gt;
       color quoted3    green          default&lt;br /&gt;
       color quoted4    magenta           default&lt;br /&gt;
       color quoted5    cyan           default&lt;br /&gt;
       color quoted6    magenta        default&lt;br /&gt;
       color quoted7    red            default&lt;br /&gt;
       color quoted8    green          default&lt;br /&gt;
       color quoted9    cyan           default&lt;br /&gt;
       color body   cyan  default  &amp;quot;((ftp|http|https)://|news:)[^ &amp;gt;)\&amp;quot;\t]+&amp;quot;&lt;br /&gt;
       color body   cyan  default  &amp;quot;[-a-z_0-9.+]+@[-a-z_0-9.]+&amp;quot;&lt;br /&gt;
       color body   red   default  &amp;quot;(^| )\\*[-a-z0-9*]+\\*[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color body   green default  &amp;quot;(^| )_[-a-z0-9_]+_[,.?]?[\n]&amp;quot;&lt;br /&gt;
       color body   red   default  &amp;quot;(^| )\\*[-a-z0-9*]+\\*[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color body   green default  &amp;quot;(^| )_[-a-z0-9_]+_[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color index  cyan  default  ~F         # Flagged&lt;br /&gt;
       color index  red   default  ~N         # New&lt;br /&gt;
       color index  magenta    default  ~T         # Tagged&lt;br /&gt;
       color index  cyan       default  ~D         # Deleted&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 190)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 89:&lt;br /&gt;
&lt;br /&gt;
     ps command in detail&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Here are the possible codes when using state &amp;quot;$ ps -e -o state,cmd&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             PROCESS STATE CODES&lt;br /&gt;
                  D   uninterruptible sleep (usually IO)&lt;br /&gt;
                  R   runnable (on run queue)&lt;br /&gt;
                  S   sleeping&lt;br /&gt;
                  T   traced or stopped&lt;br /&gt;
                  Z   a defunct (&amp;quot;zombie&amp;quot;) process&lt;br /&gt;
&lt;br /&gt;
                  &amp;lt;    high-priority (not nice to other users)&lt;br /&gt;
                  N    low-priority (nice to other users)&lt;br /&gt;
                  L    has pages locked into memory (for real-time and custom IO)&lt;br /&gt;
                  s    is a session leader&lt;br /&gt;
                  l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)&lt;br /&gt;
                  +    is in the foreground process group&lt;br /&gt;
&lt;br /&gt;
    For instance:&lt;br /&gt;
&lt;br /&gt;
     Note that the -o is for user defined, and -e is for select&lt;br /&gt;
     all process.&lt;br /&gt;
&lt;br /&gt;
       $ ps -e -o pid,state,start,time,etime,cmd&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
             9946 S 15:40:45 00:00:00    02:23:29 /bin/bash -i&lt;br /&gt;
             9985 T 15:41:24 00:00:01    02:22:50 emacs mout2&lt;br /&gt;
            10003 T 15:43:59 00:00:00    02:20:15 emacs NOTES&lt;br /&gt;
            10320 T 17:38:42 00:00:00       25:32 emacs stuff.c&lt;br /&gt;
         ...&lt;br /&gt;
&lt;br /&gt;
     You may want to command below, without the -e, which will give the&lt;br /&gt;
     process only under the current terminal.&lt;br /&gt;
&lt;br /&gt;
       $ ps -o pid,state,start,time,etime,cmd&lt;br /&gt;
&lt;br /&gt;
     Want to find what 's impacting your load?&lt;br /&gt;
&lt;br /&gt;
       $ ps -e -o %cpu,pid,state,start,time,etime,%cpu,%mem,cmd|sort -rn|less&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ ps aux&lt;br /&gt;
&lt;br /&gt;
            USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND&lt;br /&gt;
            root         1  0.0  0.0  1380  480 ?        S    Aug04   0:00 init [3]&lt;br /&gt;
            root         2  0.0  0.0     0    0 ?        SWN  Aug04   0:00 [ksoftirqd/0]&lt;br /&gt;
            root         3  0.0  0.0     0    0 ?        SW&amp;lt;  Aug04   0:00 [events/0]&lt;br /&gt;
            root         4  0.0  0.0     0    0 ?        SW&amp;lt;  Aug04   0:00 [khelper]&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     Or, if you want to see the environment add the -e option&lt;br /&gt;
&lt;br /&gt;
       $ ps aeux&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
            chirico   2735  0.0  0.1  4400 1492 pts/0    S    Aug04   0:00 -bash USER=chirico LOGNAME=chirico HOME=/home/chirico PATH=/usr/&lt;br /&gt;
            chirico   2771  0.0  0.0  4328  924 pts/0    S    Aug04   0:00 screen -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm S&lt;br /&gt;
            chirico   2772  0.0  0.6  9476 6352 ?        S    Aug04   0:54 SCREEN -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm S&lt;br /&gt;
            chirico   2773  0.0  0.1  4432 1548 pts/1    S    Aug04   0:10 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            chirico   2797  0.0  0.1  4416 1496 pts/2    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            root      2821  0.0  0.0  4100  952 pts/2    S    Aug04   0:00 su -&lt;br /&gt;
            root      2822  0.0  0.1  4384 1480 pts/2    S    Aug04   0:00 -bash&lt;br /&gt;
            chirico   2862  0.0  0.1  4428 1524 pts/3    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            sporkey   2946  0.0  0.2  6836 2960 ?        S    Aug04   0:15 fetchmail&lt;br /&gt;
            chirico   2952  0.0  0.1  4436 1552 pts/5    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            chirico   3880  0.0  0.1  4416 1496 pts/6    S    Aug05   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            root      3904  0.0  0.0  4100  956 pts/6    S    Aug05   0:00 su - donkey&lt;br /&gt;
            donkey    3905  0.0  0.1  4336 1452 pts/6    S    Aug05   0:00 -bash&lt;br /&gt;
            donkey    3938  0.0  0.2  6732 2856 ?        S    Aug05   0:14 fetchmail&lt;br /&gt;
            chirico   3944  0.0  0.1  4416 1496 pts/7    S    Aug05   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     There is also a -f &amp;quot;forrest&amp;quot; option. Also note below &amp;quot; -bash&amp;quot; is the start of a login shell.&lt;br /&gt;
&lt;br /&gt;
      $ ps aeuxwwf &lt;br /&gt;
     &lt;br /&gt;
     The ww option above gives a wide format with all variables. Use the above command if you plan&lt;br /&gt;
     to parse through a Perl script. Otherwise, it may be easier to do a quick read using the command&lt;br /&gt;
     below, without &amp;quot;ww&amp;quot;.    &lt;br /&gt;
&lt;br /&gt;
      $ ps aeuxf&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
            root      2339  0.0  0.1  3512 1444 ?        S    Dec01   0:00 /usr/sbin/sshd&lt;br /&gt;
            root     25651  0.0  0.1  6764 1980 ?        S    Dec23   0:00  \_ /usr/sbin/sshd&lt;br /&gt;
            chirico  25653  0.0  0.2  6840 2236 ?        S    Dec23   0:14      \_ /usr/sbin/sshd&lt;br /&gt;
            chirico  25654  0.0  0.1  4364 1440 pts/4    S    Dec23   0:00          \_ -bash USER=chirico LOGNAME=chirico HOME=/home/chirico&lt;br /&gt;
            chirico  25690  0.0  0.0  4328  920 pts/4    S    Dec23   0:00              \_ screen -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm&lt;br /&gt;
            root      2355  0.0  0.0  2068  904 ?        S    Dec01   0:00 xinetd -stayalive -pidfile /var/run/xinetd.pid&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     It is also possible to list the process by command line. For example, the following command will only list the emacs&lt;br /&gt;
     processes.&lt;br /&gt;
&lt;br /&gt;
      $ ps -fC emacs&lt;br /&gt;
       UID        PID  PPID  C STIME TTY          TIME CMD&lt;br /&gt;
       chirico   5049  5020  0 May11 pts/13   00:00:00 emacs -nw Notes&lt;br /&gt;
       chirico  12368  5104  0 May12 pts/18   00:00:00 emacs -nw dnotify.c&lt;br /&gt;
       chirico  19792 18028  0 May13 pts/20   00:00:00 emacs -nw hello.c&lt;br /&gt;
       chirico  14034 27367  0 18:52 pts/8    00:00:00 emacs -nw How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
     You may also want to consider using top in batch mode. Here the &amp;quot;-n 1&amp;quot; means refresh once,&lt;br /&gt;
     and the &amp;quot;b&amp;quot; is for batch. The &amp;quot;fmt -s&amp;quot; is to put it in a more readable format.&lt;br /&gt;
&lt;br /&gt;
       $ top -n 1 b |fmt  -s &amp;gt;&amp;gt;statfile&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 90:&lt;br /&gt;
&lt;br /&gt;
     Learning Assembly.&lt;br /&gt;
&lt;br /&gt;
     Once you have written the source, assuming the file is &amp;quot;exit.s&amp;quot;, it can be compiled as follows:&lt;br /&gt;
&lt;br /&gt;
            $ as exit.s -o exit.o&lt;br /&gt;
            $ ld exit.o -o exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Here is the program:&lt;br /&gt;
&lt;br /&gt;
         #&lt;br /&gt;
         #INPUT:  none&lt;br /&gt;
         #&lt;br /&gt;
         #OUTPUT:         returns a status code. This can be viewed&lt;br /&gt;
         # by typing&lt;br /&gt;
         #&lt;br /&gt;
         # echo $?&lt;br /&gt;
         #&lt;br /&gt;
         # after running the program&lt;br /&gt;
         #&lt;br /&gt;
         #VARIABLES:&lt;br /&gt;
         # %eax holds the system call number&lt;br /&gt;
         # (this is always the case)&lt;br /&gt;
         #&lt;br /&gt;
         # %ebx holds the return status&lt;br /&gt;
         #&lt;br /&gt;
                 .section .data&lt;br /&gt;
                 .section .text&lt;br /&gt;
&lt;br /&gt;
                 .globl _start&lt;br /&gt;
         _start:&lt;br /&gt;
                 movl $1, %eax # this is the linux kernel command&lt;br /&gt;
                 # number (system call) for exiting&lt;br /&gt;
                 # a program&lt;br /&gt;
                 movl $0, %ebx # this is the status number we will&lt;br /&gt;
                 # return to the operating system.&lt;br /&gt;
                 # Change this around and it will&lt;br /&gt;
                 # return different things to&lt;br /&gt;
                 # echo $?&lt;br /&gt;
                 int $0x80 # this wakes up the kernel to run&lt;br /&gt;
                 # the exit command&lt;br /&gt;
&lt;br /&gt;
     After running this program, you can get the exit code.&lt;br /&gt;
&lt;br /&gt;
            $ exit $?&lt;br /&gt;
            0&lt;br /&gt;
&lt;br /&gt;
     That is about all it does; but, get the book for more details. The&lt;br /&gt;
     book is free.&lt;br /&gt;
&lt;br /&gt;
          http://savannah.nongnu.org/download/pgubook/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 91:&lt;br /&gt;
&lt;br /&gt;
     Creating a sandbox for reiserfstune,debugreiserfs and ACL.  Also see TIP 4.&lt;br /&gt;
&lt;br /&gt;
     Assume you have a reisers files system created from a disk file, which&lt;br /&gt;
     means you have done something like the following:&lt;br /&gt;
&lt;br /&gt;
          # dd if=/dev/zero of=disk-rfs count=102400&lt;br /&gt;
          # losetup  /dev/loop4 ./disk-rfs&lt;br /&gt;
          # mkfs -t reiserfs /dev/loop4&lt;br /&gt;
          # mkdir /fs2&lt;br /&gt;
          # mount -o loop,acl ./disk-rfs /fs2&lt;br /&gt;
&lt;br /&gt;
     Now, you can run reiserfstune. But, first you will need to umount fs2&lt;br /&gt;
&lt;br /&gt;
          # umount /fs2&lt;br /&gt;
          # reiserfstune ./disk-rfs&lt;br /&gt;
&lt;br /&gt;
     Or you can run the debug command&lt;br /&gt;
&lt;br /&gt;
          # debugreiserfs -J ./disk-rfs&lt;br /&gt;
&lt;br /&gt;
     Now, suppose you run through a lot of the debug options on&lt;br /&gt;
     http://www.namesys.com/ and you destroy this file.&lt;br /&gt;
&lt;br /&gt;
     You can recreate the file and delete the loop device.&lt;br /&gt;
&lt;br /&gt;
          # dd if=/dev/zero of=disk-rfs count=102400&lt;br /&gt;
          # losetup -d /dev/loop4&lt;br /&gt;
          # mount -o loop,acl ./disk-rfs /fs2&lt;br /&gt;
&lt;br /&gt;
     Now, try working with some of the ACL options - you can only do this&lt;br /&gt;
     with the latest kernel and tools -- Fedora Core 2 will work.&lt;br /&gt;
&lt;br /&gt;
     Assume you have 3 users, donkey, chirico and bozo2. You can give&lt;br /&gt;
     everyone rights to this file system as follows:&lt;br /&gt;
&lt;br /&gt;
          # setfacl -R -m d:u:donkey:rwx,d:u:chirico:rwx,d:u:bozo2:rwx /fs2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 92:&lt;br /&gt;
&lt;br /&gt;
     SpamAssassin - Setup.&lt;br /&gt;
&lt;br /&gt;
     Step 1.&lt;br /&gt;
&lt;br /&gt;
           Installing the SpamAssassin CPAN utility. You will need to do this&lt;br /&gt;
           as root.&lt;br /&gt;
        &lt;br /&gt;
              $ su -&lt;br /&gt;
&lt;br /&gt;
           Once you have root privileges invoke cpan.&lt;br /&gt;
        &lt;br /&gt;
              # perl -MCPAN -e shell&lt;br /&gt;
&lt;br /&gt;
              cpan&amp;gt;&lt;br /&gt;
&lt;br /&gt;
           Now install with prerequisites policy set to ask.&lt;br /&gt;
        &lt;br /&gt;
              cpan&amp;gt; o conf prerequisites_policy ask&lt;br /&gt;
        &lt;br /&gt;
              cpan&amp;gt; install Mail::SpamAssassin&lt;br /&gt;
        &lt;br /&gt;
           You will get lots of output as the necessary modules are downloaded and&lt;br /&gt;
           compiled and installed.&lt;br /&gt;
&lt;br /&gt;
     Step 2.&lt;br /&gt;
&lt;br /&gt;
            Configuration.&lt;br /&gt;
&lt;br /&gt;
            Edit the following &amp;quot;/etc/mail/spamassassin/local.cf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            Here is a look at my file&lt;br /&gt;
&lt;br /&gt;
                $ cat /etc/mail/spamassassin/local.cf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                # This is the right place to customize your installation of SpamAssassin.&lt;br /&gt;
                #&lt;br /&gt;
                # See 'perldoc Mail::SpamAssassin::Conf' for details of what can be&lt;br /&gt;
                # tweaked.&lt;br /&gt;
                #&lt;br /&gt;
                ###########################################################################&lt;br /&gt;
                #&lt;br /&gt;
                # rewrite_subject 0&lt;br /&gt;
                # report_safe 1&lt;br /&gt;
                # trusted_networks 212.17.35.&lt;br /&gt;
                #&lt;br /&gt;
                &lt;br /&gt;
                # Below added from book&lt;br /&gt;
                # You may want to set this to 5, then, work your way down.&lt;br /&gt;
                # Currently I have this 3&lt;br /&gt;
                required_hits 3&lt;br /&gt;
                &lt;br /&gt;
                # This determines how spam is reported. Currently safe email is reported&lt;br /&gt;
                # in the message.&lt;br /&gt;
                report_safe 1&lt;br /&gt;
                &lt;br /&gt;
                # The will rewrite the tag of the spam message.&lt;br /&gt;
                rewrite_subject 1&lt;br /&gt;
                &lt;br /&gt;
                # By default, SpamAssassin will run RBL checks.  If your ISP already&lt;br /&gt;
                # does this, set this to 1.&lt;br /&gt;
                skip_rbl_checks 0&lt;br /&gt;
&lt;br /&gt;
     Step 3.&lt;br /&gt;
&lt;br /&gt;
            Update .procmail.&lt;br /&gt;
&lt;br /&gt;
            You should update the .procmail file as follows. Here is my /home/chirico/.procmail file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ cat /home/chirico/.procmailrc&lt;br /&gt;
&lt;br /&gt;
                PATH=/bin:/usr/bin:/usr/local/bin&lt;br /&gt;
                MAILDIR=/var/spool/mail&lt;br /&gt;
                DEFAULT=/var/spool/mail/chirico&lt;br /&gt;
                LOGFILE=/home/chirico/MailBAG&lt;br /&gt;
                MYHOME=/home/chirico&lt;br /&gt;
                #  Must have folder MailTRASH&lt;br /&gt;
                TRASH=/home/chirico/MailTRASH&lt;br /&gt;
                &lt;br /&gt;
                # Will get everything from this mail&lt;br /&gt;
                :0&lt;br /&gt;
                * ^From:.*sporkey@comcast.net&lt;br /&gt;
                        $DEFAULT&lt;br /&gt;
                &lt;br /&gt;
                # Spamassassin&lt;br /&gt;
                :0fw&lt;br /&gt;
                * &amp;lt;300000&lt;br /&gt;
                |/usr/local/bin/spamassassin&lt;br /&gt;
&lt;br /&gt;
      Reference:&lt;br /&gt;
        http://pm-doc.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 93:&lt;br /&gt;
&lt;br /&gt;
     Make Graphs: using dot and neato.&lt;br /&gt;
&lt;br /&gt;
       $ dot -Tpng dotfile -o myout.png&lt;br /&gt;
&lt;br /&gt;
     To see the output reference the following:&lt;br /&gt;
       http://souptonuts.sourceforge.net/code/myout.png&lt;br /&gt;
&lt;br /&gt;
     Where &amp;quot;dotfile&amp;quot; is the following:&lt;br /&gt;
&lt;br /&gt;
       $ cat dotfile&lt;br /&gt;
&lt;br /&gt;
       digraph g&lt;br /&gt;
       {&lt;br /&gt;
               node [shape = record];&lt;br /&gt;
&lt;br /&gt;
               node0 [ label =&amp;quot;&amp;lt;f0&amp;gt; stuff | &amp;lt;f1&amp;gt; J | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node1 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; E | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node4 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; C | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node6 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; I | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node2 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; U | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node5 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; N | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node9 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; Y | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node8 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; W | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node10 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; Z | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node7 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; A | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node3 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; G | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node0&amp;quot;:f0 -&amp;gt; &amp;quot;node1&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node0&amp;quot;:f2 -&amp;gt; &amp;quot;node2&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node1&amp;quot;:f0 -&amp;gt; &amp;quot;node4&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node1&amp;quot;:f2 -&amp;gt; &amp;quot;node6&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node4&amp;quot;:f0 -&amp;gt; &amp;quot;node7&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node4&amp;quot;:f2 -&amp;gt; &amp;quot;node3&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node2&amp;quot;:f0 -&amp;gt; &amp;quot;node5&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node2&amp;quot;:f2 -&amp;gt; &amp;quot;node9&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node9&amp;quot;:f0 -&amp;gt; &amp;quot;node8&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node9&amp;quot;:f2 -&amp;gt; &amp;quot;node10&amp;quot;:f1;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
     Checkout the following article:&lt;br /&gt;
        http://www.linuxjournal.com/article.php?sid=7275&lt;br /&gt;
&lt;br /&gt;
     To download this software&lt;br /&gt;
        http://www.graphviz.org/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 94:&lt;br /&gt;
&lt;br /&gt;
     Makefile: working with conditions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     First note that all the indentations of the file must be&lt;br /&gt;
     a single tab. There cannot be any spaces, or make will&lt;br /&gt;
     not run.&lt;br /&gt;
&lt;br /&gt;
       $ cat Makefile&lt;br /&gt;
&lt;br /&gt;
        # Compiler flags&lt;br /&gt;
        sqliteLIB := $(shell ls /usr/local/lib/libsqlite.so)&lt;br /&gt;
        sqlite3LIB := $(shell ls /usr/local/lib/libsqlite3.so)&lt;br /&gt;
        # all assumes sqlite and sqlite3 are installed&lt;br /&gt;
        #&lt;br /&gt;
&lt;br /&gt;
        test:&lt;br /&gt;
        ifeq (&amp;quot;$(sqlite3LIB)&amp;quot;,&amp;quot;/usr/local/lib/libsqlite3.so&amp;quot;)&lt;br /&gt;
             @echo -e &amp;quot;True -- we found the file&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
             @echo &amp;quot;False -- we did not find the file&amp;quot;&lt;br /&gt;
        endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     So, if I run make I will get the following output.&lt;br /&gt;
&lt;br /&gt;
       $ make&lt;br /&gt;
       True -- we found the file&lt;br /&gt;
&lt;br /&gt;
     This is because I have a file /usr/local/lib/libsqlite3.so on my system.&lt;br /&gt;
     Note how the assignment is made, with the shell command&lt;br /&gt;
&lt;br /&gt;
           sqlite3LIB := $(shell ls /usr/local/lib/libsqlite3.so)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 95:&lt;br /&gt;
&lt;br /&gt;
     Bash: Conditional Expressions&lt;br /&gt;
&lt;br /&gt;
          if [ -e /etc/ntp.conf ]&lt;br /&gt;
            then&lt;br /&gt;
              echo &amp;quot;You have the ntp config file&amp;quot;&lt;br /&gt;
            else&lt;br /&gt;
              echo &amp;quot;You do not have the ntp config file&amp;quot;&lt;br /&gt;
          fi&lt;br /&gt;
&lt;br /&gt;
       Now using an AND condition inside the [ ]. By the way, above, you&lt;br /&gt;
       can put the &amp;quot;then&amp;quot; on the same line as the if &amp;quot;if [ -e /etc/ntp.conf ]; then&amp;quot;&lt;br /&gt;
       as long as you use the &amp;quot;;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           if [ \( -e /etc/ntp.conf \) -a \( -e /etc/ntp/ntpservers \) ]&lt;br /&gt;
             then&lt;br /&gt;
               echo &amp;quot;You have ntp config and ntpservers&amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp.conf ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntp.conf &amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp/ntpservers ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntpservers &amp;quot;&lt;br /&gt;
             else&lt;br /&gt;
               echo &amp;quot; you have neither ntp.conf or ntpservers&amp;quot;&lt;br /&gt;
           fi&lt;br /&gt;
&lt;br /&gt;
        A few things to note above. Else if statement is written as &amp;quot;elif&amp;quot;, and when&lt;br /&gt;
        dealing with &amp;quot;(&amp;quot; you will need to insert &amp;quot;\(&amp;quot;. By the way &amp;quot;-o&amp;quot; can replace &amp;quot;-a&amp;quot;&lt;br /&gt;
        and the &amp;quot;-o&amp;quot; is for OR condition. AND can be done as follows too.&lt;br /&gt;
&lt;br /&gt;
           if [ -e /etc/ntp.conf ] &amp;amp;&amp;amp; [ -e /etc/ntp/ntpservers ]&lt;br /&gt;
             then&lt;br /&gt;
               echo &amp;quot;You have ntp config and ntpservers&amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp.conf ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntp.conf &amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp/ntpservers ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntpservers &amp;quot;&lt;br /&gt;
             else&lt;br /&gt;
               echo &amp;quot; you have neither ntp.conf or ntpservers&amp;quot;&lt;br /&gt;
           fi&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (files).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             -b file      True if file exists and is a block file&lt;br /&gt;
             -c file      True if file exists and is a character device file&lt;br /&gt;
             -d file      True if file exists and is a directory&lt;br /&gt;
             -e file      True if file exists&lt;br /&gt;
             -f file      True if file exists and is a regular file&lt;br /&gt;
             -g file      True if file exists and is set goup id&lt;br /&gt;
             -G file      True if owned by the effective group ID&lt;br /&gt;
&lt;br /&gt;
             -k file      True if &amp;quot;sticky&amp;quot; bit is set and file exists&lt;br /&gt;
             -L file      True if file exists and is a symbolic link&lt;br /&gt;
             -n string    True if string is non-null&lt;br /&gt;
&lt;br /&gt;
             -O file      Ture if file exists and is owned by the effective user ID&lt;br /&gt;
&lt;br /&gt;
             -p file      True if file is a named pipe (FIFO)&lt;br /&gt;
             -r file      True if file is readable&lt;br /&gt;
             -s file      True if file has size &amp;gt; 0&lt;br /&gt;
             -S file      True if file exists and is a socket&lt;br /&gt;
&lt;br /&gt;
             -t file      True if file is open and refers to a terminal.&lt;br /&gt;
             -u file      True if setuid bit is set&lt;br /&gt;
             -w file      True if file exists and is writeable&lt;br /&gt;
             -x file      True if file executable&lt;br /&gt;
             -x dir       True if directory can be searched&lt;br /&gt;
&lt;br /&gt;
             file1 -nt file2     True if file1 modification date newer than file2&lt;br /&gt;
             file1 -ot file2     True if file1 modification date older than file2&lt;br /&gt;
             file1 -ef file2     True if file1 and file2 have same inode&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (Integers).&lt;br /&gt;
&lt;br /&gt;
             -lt  Less than&lt;br /&gt;
             -le  Less than or equal&lt;br /&gt;
             -eq  Equal&lt;br /&gt;
             -ge  Greater than or equal&lt;br /&gt;
             -gt  Greater than&lt;br /&gt;
             -ne  Not equal&lt;br /&gt;
&lt;br /&gt;
          Example usage.&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
             {&lt;br /&gt;
               while read num value; do&lt;br /&gt;
                if [ $num -gt  2 ]; then&lt;br /&gt;
                  echo $value&lt;br /&gt;
                fi&lt;br /&gt;
               done&lt;br /&gt;
             } &amp;lt; somefile&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (Strings).&lt;br /&gt;
&lt;br /&gt;
             str1 = str2      str1 matches str2&lt;br /&gt;
             str1 != str2     str1 does not matches str2&lt;br /&gt;
             str1 &amp;lt; str2      str1 is less than str2&lt;br /&gt;
             str1 &amp;gt;  str2     str1 is greater than str2&lt;br /&gt;
             -n str1          str1 is not null (length greater than 0)&lt;br /&gt;
             -z str1          str1 is null (las length 0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 96:&lt;br /&gt;
&lt;br /&gt;
     CVS: Working with cvs&lt;br /&gt;
&lt;br /&gt;
      INITIAL REPOSITORY:&lt;br /&gt;
&lt;br /&gt;
       To create a repository, and this is normally done by the system admin. This&lt;br /&gt;
       is NOT creating a project to checkout, but the location where everything&lt;br /&gt;
       will be stored! The initial repository!&lt;br /&gt;
&lt;br /&gt;
             cvs -d repository_root_directory init&lt;br /&gt;
&lt;br /&gt;
       Or here is a specific example:&lt;br /&gt;
&lt;br /&gt;
             cvs -d /work/cvsREPOSITORY/   init&lt;br /&gt;
&lt;br /&gt;
       Creating a directory tree from scratch. For a new project, the easiest thing to&lt;br /&gt;
       do is probably to create an empty directory structure, like this:&lt;br /&gt;
&lt;br /&gt;
             $ mkdir sqlite_examples&lt;br /&gt;
             $ mkdir sqlite_examples/man&lt;br /&gt;
             $ mkdir sqlite_examples/testing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       After that, you use the import command to create the&lt;br /&gt;
       corresponding (empty) directory structure inside the repository:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             $ cd &amp;lt;directory&amp;gt;&lt;br /&gt;
             $ cvs -d repository_root_directory import  -m &amp;quot;Created directory structure&amp;quot; yoyodyne/dir yoyo start&lt;br /&gt;
&lt;br /&gt;
       Or, here is a specific example.&lt;br /&gt;
&lt;br /&gt;
             $  cd sqlite_examples&lt;br /&gt;
             $  cvs  -d /work/cvsREPOSITORY/ import -m 'test SQlite'  sqlite_examples sqlite_examples start&lt;br /&gt;
&lt;br /&gt;
       Now, you can delete the directory sqlite_examples, or go to another directory and type&lt;br /&gt;
       the following:&lt;br /&gt;
&lt;br /&gt;
             $ cvs -d /work/cvsREPOSITORY/ co sqlite_examples&lt;br /&gt;
&lt;br /&gt;
     COOL TOOLS:&lt;br /&gt;
&lt;br /&gt;
           1. cvsps&lt;br /&gt;
           2. cvsreport&lt;br /&gt;
&lt;br /&gt;
         cvsps which you can find at http://www.cobite.com/cvsps/cvsps-2.0rc1.tar.gz&lt;br /&gt;
&lt;br /&gt;
             $ cvsps -f README_sqlite_tutorial.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 97:&lt;br /&gt;
&lt;br /&gt;
     Common vi and vim commands&lt;br /&gt;
&lt;br /&gt;
           Command mode ESC&lt;br /&gt;
&lt;br /&gt;
                dd       delete&lt;br /&gt;
                u        undelete&lt;br /&gt;
                y        yank (copy to buffer)&lt;br /&gt;
                p/P      p before cursor/P after cursor&lt;br /&gt;
&lt;br /&gt;
                Ctl-g    show current line number&lt;br /&gt;
                shft-G   end of file&lt;br /&gt;
              n shft-G   move to line n&lt;br /&gt;
&lt;br /&gt;
               /stuff/   search&lt;br /&gt;
                  n   repeat in same direction&lt;br /&gt;
                  N   repeat in opposite direction&lt;br /&gt;
                  /return  repeat seach forward&lt;br /&gt;
                  ?return  repeat seach backward&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;dyy  Yank current line to buffer d&lt;br /&gt;
               &amp;quot;a7yy Yank next 7 lines to buffer a&lt;br /&gt;
                    or&lt;br /&gt;
               :1,7ya a  Yank [ya] lines 1,7 to buffer a&lt;br /&gt;
               :1,7ya b  Yank [ya] lines 1,7 to buffer b&lt;br /&gt;
&lt;br /&gt;
               :5 pu b   Put [pu] buffer b after line 5&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;dP   Put the content of buffer d before cursor&lt;br /&gt;
               &amp;quot;ap   Put the contents of buffer a after cursor&lt;br /&gt;
&lt;br /&gt;
               :1,4 w! file2  Write lines 1,4 to file2&lt;br /&gt;
               :1,3&lt;br /&gt;
&lt;br /&gt;
               :set nu     Display line numbers&lt;br /&gt;
               :set nonum  Turns off display&lt;br /&gt;
&lt;br /&gt;
               :e &amp;lt;filename&amp;gt; Edit a file in a new buffer&lt;br /&gt;
&lt;br /&gt;
            vim&lt;br /&gt;
               :split&lt;br /&gt;
               :split &amp;lt;filename&amp;gt;&lt;br /&gt;
               :sp &amp;lt;filename&amp;gt;&lt;br /&gt;
               :split new&lt;br /&gt;
&lt;br /&gt;
                   ctl-w   To move between windows&lt;br /&gt;
                   ctl-w+&lt;br /&gt;
                   ctl-w-  To change size&lt;br /&gt;
                   ctl+wv  Split windows vertically&lt;br /&gt;
                   ctl-wq  Close window&lt;br /&gt;
&lt;br /&gt;
               :only       To view only 1 window&lt;br /&gt;
&lt;br /&gt;
            vim dictionary - put the following command in ~/.vimrc&lt;br /&gt;
&lt;br /&gt;
                   set dictionary+=/usr/share/dict/words&lt;br /&gt;
                   set thesaurus+=/usr/share/dict/words&lt;br /&gt;
              &lt;br /&gt;
               Now, after you type a word &amp;lt;ctl-x&amp;gt;&amp;lt;ctl-k&amp;gt;&amp;lt;ctl-n&amp;gt; and to &lt;br /&gt;
               go back in the listing &amp;lt;ctl-p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                   butter&amp;lt;ctl-x&amp;gt;&amp;lt;ctl-k&amp;gt;&amp;lt;ctl-n&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 98:&lt;br /&gt;
&lt;br /&gt;
     Using apt-get&lt;br /&gt;
&lt;br /&gt;
          $ apt-get update&lt;br /&gt;
          $ apt-get -s install &amp;lt;pkage&amp;gt;    &amp;lt;---- if everything is ok, then, remove the s&lt;br /&gt;
&lt;br /&gt;
     Note you may want to use dpkg to purge if you have to do a reinstall.&lt;br /&gt;
&lt;br /&gt;
          $ dpkg --purge exim4-base&lt;br /&gt;
          $ dpkg --purge exim4-config&lt;br /&gt;
          $ apt-get install exim4&lt;br /&gt;
&lt;br /&gt;
          $ dpkg-reconfigure exim4-config&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 99:&lt;br /&gt;
&lt;br /&gt;
     Mounting a cdrom on openbsd and installing packages&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /cdrom&lt;br /&gt;
          $ mount /dev/cd0a /cdrom&lt;br /&gt;
          $ cd /cdrom&lt;br /&gt;
&lt;br /&gt;
     To add packages&lt;br /&gt;
&lt;br /&gt;
          $ pkg_add -v  &amp;lt;directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Mounting a cdrom on linux to a user's home sub-directory:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /home/chirico/cdrom&lt;br /&gt;
          $ mount /dev/cdrom /home/chirico/cdrom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 100:&lt;br /&gt;
&lt;br /&gt;
    Creating a boot floppy for knoppix cd:&lt;br /&gt;
&lt;br /&gt;
          $ dd if=/mnt/cdrom/KNOPPIX/boot.img of=/dev/fd0 bs=1440k&lt;br /&gt;
&lt;br /&gt;
    References:&lt;br /&gt;
        http://www.knoppix.net/docs/index.php/BootFloppyHowTo&lt;br /&gt;
&lt;br /&gt;
    For a lot of the knoppix how-to's&lt;br /&gt;
        http://www.knoppix.net/docs/index.php/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 101:&lt;br /&gt;
&lt;br /&gt;
    Diction and Style Tools for Linux  http://ftp.gnu.org/gnu/diction/&lt;br /&gt;
&lt;br /&gt;
        $ diction mytext|less&lt;br /&gt;
&lt;br /&gt;
    Or, this can be done interactively&lt;br /&gt;
&lt;br /&gt;
        $ diction&lt;br /&gt;
        This is more text to read and you can do with it&lt;br /&gt;
        what you want.&lt;br /&gt;
        (stdin):1: This is more text to read and you [can -&amp;gt; (do not confuse with &amp;quot;may&amp;quot;)] do with it what you want.&lt;br /&gt;
&lt;br /&gt;
    DESCRIPTION&lt;br /&gt;
       Diction finds all sentences in a document, that contain phrases from  a&lt;br /&gt;
       database  of  frequently  misused,  bad  or  wordy diction.  It further&lt;br /&gt;
       checks for double words.  If no files are given, the document  is  read&lt;br /&gt;
       from  standard input.  Each found phrase is enclosed in [ ] (brackets).&lt;br /&gt;
       Suggestions and advice, if any, are printed headed by a right arrow -&amp;gt;.&lt;br /&gt;
       A  sentence is a sequence of words, that starts with a capitalised word&lt;br /&gt;
       and ends with a full stop, double colon, question mark or  exclaimation&lt;br /&gt;
       mark.  A single letter followed by a dot is considered an abbreviation,&lt;br /&gt;
       so it does not terminate a sentence.   Various  multi-letter  abbrevia-&lt;br /&gt;
       tions are recognized, they do not terminate a sentence as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 102:&lt;br /&gt;
&lt;br /&gt;
    Using a mail alias.&lt;br /&gt;
&lt;br /&gt;
       Suppose all root mail on your system to go to one root account root@main.com&lt;br /&gt;
&lt;br /&gt;
       In the following file:&lt;br /&gt;
&lt;br /&gt;
             /etc/aliases&lt;br /&gt;
&lt;br /&gt;
       Add this line&lt;br /&gt;
&lt;br /&gt;
             root:    root@main.com&lt;br /&gt;
&lt;br /&gt;
       Next, run newaliases [/usr/bin/newaliases] as follows:&lt;br /&gt;
&lt;br /&gt;
             $ newaliases&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Special note: It's possible to send mail to more than one address. Suppose you want&lt;br /&gt;
                     mail going to root@main.com above, plus you want it going to user donkey&lt;br /&gt;
                     on the local system.&lt;br /&gt;
&lt;br /&gt;
             root:  root@main.com donkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 103:&lt;br /&gt;
&lt;br /&gt;
    Chrony - this service is similiar to ntp. It keeps accurate time&lt;br /&gt;
            on your computer against a very accurate clock in across&lt;br /&gt;
            a network with various time delays.&lt;br /&gt;
&lt;br /&gt;
    Reference: http://go.to/chrony&lt;br /&gt;
&lt;br /&gt;
        In the file &amp;quot;/etc/chrony/chrony.conf&amp;quot; add/replace the following&lt;br /&gt;
&lt;br /&gt;
             server 146.186.218.60&lt;br /&gt;
             server 128.118.25.3&lt;br /&gt;
             server 128.2.129.21&lt;br /&gt;
&lt;br /&gt;
        Next start the chrony service&lt;br /&gt;
&lt;br /&gt;
           $ /etc/init.d/chrony restart&lt;br /&gt;
&lt;br /&gt;
     Next verify that this is working. It may take 20 or 30 minutes to update&lt;br /&gt;
     the clock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Shell command:&lt;br /&gt;
       # chronyc&lt;br /&gt;
       chronyc&amp;gt; sourcestats&lt;br /&gt;
       210 Number of sources = 3&lt;br /&gt;
       Name/IP Address            NP  NR  Span  Frequency   Freq Skew   Std Dev&lt;br /&gt;
       ========================================================================&lt;br /&gt;
       b50.cede.psu.edu            2   0    64       0.000    2000.000  4000ms&lt;br /&gt;
       otc2.psu.edu                2   0    66       0.000    2000.000  4000ms&lt;br /&gt;
       FS3.ECE.CMU.EDU             2   0    64       0.000    2000.000  4000ms&lt;br /&gt;
       chronyc&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    It is probably best to let chrony do its work. However, if you want to&lt;br /&gt;
    set both the hardware and software clock, the following will work:&lt;br /&gt;
&lt;br /&gt;
      Sets the hardware clock&lt;br /&gt;
        # hwclock --set --date=&amp;quot;12/10/04 10:18:05&amp;quot;&lt;br /&gt;
      Sync the hardware clock to software&lt;br /&gt;
        # hwclock --hctosys&lt;br /&gt;
&lt;br /&gt;
    Normally the system keep accurate time with the software clock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 104:&lt;br /&gt;
&lt;br /&gt;
    NFS mount&lt;br /&gt;
&lt;br /&gt;
     SERVER (192.168.1.182)&lt;br /&gt;
&lt;br /&gt;
       Make sure nfs is running on the server&lt;br /&gt;
 &lt;br /&gt;
           $ /etc/init.d/nfs restart&lt;br /&gt;
&lt;br /&gt;
       At the server the contents of /etc/exports for&lt;br /&gt;
       allowing 2 computers (192.168.1.171 and 192.168.1.71)&lt;br /&gt;
       to access the home directory of this server. Note that&lt;br /&gt;
       read write (rw) access is allowed.&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/exports&lt;br /&gt;
         /home   192.168.1.171(rw)&lt;br /&gt;
         /home   192.168.1.71(rw)&lt;br /&gt;
&lt;br /&gt;
       Or, if you have a lot of clients on 192.168.1.* then consider&lt;br /&gt;
       the following:&lt;br /&gt;
&lt;br /&gt;
          /home 192.168.1.0/255.255.252.0(rw)&lt;br /&gt;
&lt;br /&gt;
       Next, still at the server, run the exportfs command&lt;br /&gt;
&lt;br /&gt;
          $ exportfs -rv&lt;br /&gt;
&lt;br /&gt;
       IPTABLES (lokkit). If you're using fedora with default lokkit firewall&lt;br /&gt;
                then you can put the following under &amp;quot;Other ports&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                  Other ports nfs:tcp nfs:udp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       If the above does not work or you are not using lokkit&lt;br /&gt;
        IPTABLES (values in /etc/sysconfig/iptables on SERVER )&lt;br /&gt;
&lt;br /&gt;
        # NFS Need to accept fragmented packets and may not have header&lt;br /&gt;
        #             so you will not know where they are coming from&lt;br /&gt;
        -A INPUT -f -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -m tcp -s 192.168.1.171 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -s 192.168.1.171 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -m udp -s 192.168.1.171 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -s 192.168.1.171 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        &lt;br /&gt;
        -A INPUT -f -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -m tcp -s 192.168.1.71 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -s 192.168.1.71 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -m udp -s 192.168.1.71 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -s 192.168.1.71 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        (Reference: http://nfs.sourceforge.net/nfs-howto/server.html)&lt;br /&gt;
                  and&lt;br /&gt;
        (Reference: http://nfs.sourceforge.net/nfs-howto/security.html)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     CLIENT1 (192.168.1.171)&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /home2&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/fstab&lt;br /&gt;
         192.168.1.182:/home          /home2     nfs     rw 0 0&lt;br /&gt;
&lt;br /&gt;
          $ mount -a -t nfs&lt;br /&gt;
&lt;br /&gt;
        Or to do a one time mounting by hand&lt;br /&gt;
&lt;br /&gt;
          $ mount -t nfs 192.168.1.182:/home  /home2&lt;br /&gt;
&lt;br /&gt;
        Now /home2 on the client will be /home on the server&lt;br /&gt;
&lt;br /&gt;
        Reference:&lt;br /&gt;
          http://nfs.sourceforge.net/nfs-howto/index.html&lt;br /&gt;
&lt;br /&gt;
     MONITOR NFS:&lt;br /&gt;
&lt;br /&gt;
        To monitor the client:&lt;br /&gt;
&lt;br /&gt;
          $ nfsstat -c&lt;br /&gt;
&lt;br /&gt;
           Also note you can &amp;quot;cat /proc/net/rpc/nfs&amp;quot; as well.&lt;br /&gt;
&lt;br /&gt;
       To monitor the server (note the -s instead of the -c).&lt;br /&gt;
&lt;br /&gt;
         $ nfsstat -s&lt;br /&gt;
&lt;br /&gt;
           Also note you can &amp;quot;cat /proc/net/rpc/nfsd&amp;quot; as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       The following &amp;quot;cat&amp;quot; command is done on the NFS server, and shows which&lt;br /&gt;
       clients are mounting. This does not go with examples above. By the way,&lt;br /&gt;
       &amp;quot;root_squash&amp;quot; is the default, and means that root access on the clients is&lt;br /&gt;
       denied. So, how does the client root get access to these filesystems? You have&lt;br /&gt;
       to &amp;quot;su - &amp;lt;someuser&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
              $ cat /proc/fs/nfs/exports&lt;br /&gt;
              # Version 1.1&lt;br /&gt;
              # Path Client(Flags) # IPs&lt;br /&gt;
              /home   192.168.1.102(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   squeezel.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   192.168.1.106(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   livingroom.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   10.8.0.1(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   closet.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
&lt;br /&gt;
     (Reference: http://www.vanemery.com/Linux/NFSv4/NFSv4-no-rpcsec.html#automount )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 105:&lt;br /&gt;
&lt;br /&gt;
      Ports used for Microsoft products&lt;br /&gt;
               http://www.microsoft.com/canada/smallbiz/sgc/articles/ref_net_ports_ms_prod.mspx?pf=true&lt;br /&gt;
          Firewalling?&lt;br /&gt;
               http://www.microsoft.com/technet/prodtechnol/windowsserver2003/library/ServerHelp/428c1bbf-2ceb-4f76-a1ef-0219982eca10.mspx&lt;br /&gt;
&lt;br /&gt;
      To find out common port mappings, take a look at &amp;quot;/etc/services&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 106:&lt;br /&gt;
&lt;br /&gt;
      Man pages: If man pages are formatting incorrectly with PuTTY, try editing&lt;br /&gt;
      the &amp;quot;/etc/man.config&amp;quot; file with the following changes:&lt;br /&gt;
&lt;br /&gt;
           NROFF /usr/bin/groff -Tlatin1 -mandoc&lt;br /&gt;
           NEQN /usr/bin/geqn -Tlatin1&lt;br /&gt;
&lt;br /&gt;
         (Reference TIP 7 for using man)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 107:&lt;br /&gt;
&lt;br /&gt;
      Valgrind: check for memory leaks in your programs. (http://valgrind.org/)&lt;br /&gt;
&lt;br /&gt;
       This is how you can run it on the program &amp;quot;a.out&amp;quot; for valgrind version 2.2.0&lt;br /&gt;
&lt;br /&gt;
         $ valgrind --logfile=valgrind.output   --tool=memcheck ./a.out&lt;br /&gt;
&lt;br /&gt;
       This is how you write the logfile &amp;quot;--log-file&amp;quot; for valgrind-3.0.1&lt;br /&gt;
&lt;br /&gt;
         $ valgrind  --log-file=valgrind --leak-check=yes --tool=memcheck ./a.out&lt;br /&gt;
&lt;br /&gt;
       With C++ programs with gcc 3.4 and later that use STL, export GLIBCXX_FORCE_NEW &lt;br /&gt;
       only when testing to disable memory caching. Remember to enable for production&lt;br /&gt;
       as this will have a performance penalty. Reference  http://valgrind.org/docs/FAQ/ &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 108:&lt;br /&gt;
&lt;br /&gt;
      Runlevel Configuring.&lt;br /&gt;
&lt;br /&gt;
       These two programs, run as root give you a ncurses GUI to what will&lt;br /&gt;
       run on your system on boot.&lt;br /&gt;
&lt;br /&gt;
            # ntsysv&lt;br /&gt;
&lt;br /&gt;
            # chkconfig&lt;br /&gt;
&lt;br /&gt;
       Note, you can also set these manually. For example, normally you will&lt;br /&gt;
       have files in &amp;quot;/etc/init.d/&amp;quot; that will take parameters like &amp;quot;start&amp;quot;,&amp;quot;stop&amp;quot;&lt;br /&gt;
       &amp;quot;restart&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       Take a look at &amp;quot;/etc/init.d/mysql&amp;quot; this file will start and stop the&lt;br /&gt;
       mysql daemon. So, how does know which run levels, and the order it gets&lt;br /&gt;
       loaded in the run level to other programs? By the K&amp;lt;number&amp;gt; and S&amp;lt;number&amp;gt;&lt;br /&gt;
       values.&lt;br /&gt;
&lt;br /&gt;
            $ ls /etc/rc3.d/*mysql&lt;br /&gt;
&lt;br /&gt;
                /etc/rc3.d/K85mysql&lt;br /&gt;
                /etc/rc3.d/S85mysql&lt;br /&gt;
&lt;br /&gt;
       So here on my system the start value is 85. Looking in /etc/rc3.d, which is&lt;br /&gt;
       run level 3, any program with a lower number S84something will get loaded&lt;br /&gt;
       before mysql.&lt;br /&gt;
&lt;br /&gt;
       I manually set the run level as follows for mysql.&lt;br /&gt;
&lt;br /&gt;
            # cd /etc/rc3.d&lt;br /&gt;
            # ln -s ../init.d/mysql S85mysql&lt;br /&gt;
            # ln -s ../init.d/mysql K85mysql&lt;br /&gt;
&lt;br /&gt;
            # cd /etc/rc5.d&lt;br /&gt;
            # ln -s ../init.d/mysql S85mysql&lt;br /&gt;
            # ln -s ../init.d/mysql K85mysql&lt;br /&gt;
&lt;br /&gt;
       Note that I could have chose other numbers as well. &amp;quot;ntsysv&amp;quot; gives&lt;br /&gt;
       you a graphical interface.&lt;br /&gt;
&lt;br /&gt;
       This is a way of doing this with &amp;quot;chkconfig&amp;quot; at the command prompt.&lt;br /&gt;
&lt;br /&gt;
            # chkconfig --list mysqld&lt;br /&gt;
            mysqld          0:off   1:off   2:off   3:on    4:off   5:on    6:off&lt;br /&gt;
&lt;br /&gt;
       Above you can see it's on. Here's how we would have turned this on with chkconfig.&lt;br /&gt;
&lt;br /&gt;
            # chkconfig --level 35 mysqld on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 109:&lt;br /&gt;
&lt;br /&gt;
       File Alteration Monitor - Gamin a FAM replacement&lt;br /&gt;
        http://www.gnome.org/~veillard/gamin/&lt;br /&gt;
        http://www.gnome.org/~veillard/gamin/sources/&lt;br /&gt;
       ******  EXAMPLE NOT COMPLETE *****&lt;br /&gt;
&lt;br /&gt;
       Working with fam  - file alteration monitor.  Mail uses this to signify&lt;br /&gt;
           a change in a file's status.&lt;br /&gt;
&lt;br /&gt;
        Below is the sample C program ftest.c which can be compiled as&lt;br /&gt;
        follows:&lt;br /&gt;
&lt;br /&gt;
              $ gcc -o ftest ftest.c  -lfam&lt;br /&gt;
&lt;br /&gt;
        You will need to work with this as root&lt;br /&gt;
&lt;br /&gt;
              #  ./ftest &amp;lt;somefile absolute path&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Reference:&lt;br /&gt;
            http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?db=man&amp;amp;fname=/usr/share/catman/p_man/cat3x/fam.z&lt;br /&gt;
            http://www.devchannel.org/devtoolschannel/04/05/13/2146252.shtml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 110:&lt;br /&gt;
&lt;br /&gt;
       glibc - this is the main library used by C, and the following&lt;br /&gt;
        link below gives you examples on everything from sockets,math,&lt;br /&gt;
        date and time functions, user environment, and much more.&lt;br /&gt;
&lt;br /&gt;
         http://www.gnu.org/software/libc/manual/html_mono/libc.html&lt;br /&gt;
&lt;br /&gt;
       How do you know which version of glibc you are running?&lt;br /&gt;
&lt;br /&gt;
          #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
          #include &amp;lt;gnu/libc-version.h&amp;gt;&lt;br /&gt;
          int main (void)&lt;br /&gt;
           {&lt;br /&gt;
             puts (gnu_get_libc_version ());&lt;br /&gt;
             return 0;&lt;br /&gt;
           }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 111:&lt;br /&gt;
&lt;br /&gt;
       nslookup and dig - query Internet name servers interactively.&lt;br /&gt;
&lt;br /&gt;
         $ nslookup&lt;br /&gt;
         &amp;gt;chirico.org&lt;br /&gt;
         Server:        68.80.0.6&lt;br /&gt;
         Address:       68.80.0.6#53&lt;br /&gt;
&lt;br /&gt;
         Name: chirico.org&lt;br /&gt;
         Address: 66.35.250.210&lt;br /&gt;
         &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      The nslookup command will query the dns server is &amp;quot;/etc/resolve.conf&amp;quot;&lt;br /&gt;
      However, you can force a certain dns with &amp;quot;- server&amp;quot;.  For example the&lt;br /&gt;
      command below goes to the server named dilbert&lt;br /&gt;
&lt;br /&gt;
         $ nslookup - dilbert&lt;br /&gt;
         &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      dig:&lt;br /&gt;
&lt;br /&gt;
      dig gives you more information. You should probably use dig instead&lt;br /&gt;
      of nslookup.&lt;br /&gt;
&lt;br /&gt;
      Below I am forcing the lookup from DNS 68.80.0.6 of the name chirico.org, and&lt;br /&gt;
      note that the query time is return too.&lt;br /&gt;
&lt;br /&gt;
         $ dig @68.80.0.6  +qr chirico.org&lt;br /&gt;
&lt;br /&gt;
         ; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.2.1 &amp;lt;&amp;lt;&amp;gt;&amp;gt; @68.80.0.6 +qr chirico.org&lt;br /&gt;
         ;; global options:  printcmd&lt;br /&gt;
         ;; Sending:&lt;br /&gt;
         ;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 55908&lt;br /&gt;
         ;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0&lt;br /&gt;
        &lt;br /&gt;
         ;; QUESTION SECTION:&lt;br /&gt;
         ;chirico.org.                   IN      A&lt;br /&gt;
        &lt;br /&gt;
         ;; Got answer:&lt;br /&gt;
         ;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 55908&lt;br /&gt;
         ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
        &lt;br /&gt;
         ;; QUESTION SECTION:&lt;br /&gt;
         ;chirico.org.                   IN      A&lt;br /&gt;
        &lt;br /&gt;
         ;; ANSWER SECTION:&lt;br /&gt;
         chirico.org.            5538    IN      A       66.35.250.210&lt;br /&gt;
        &lt;br /&gt;
         ;; AUTHORITY SECTION:&lt;br /&gt;
         chirico.org.            30599   IN      NS      ns78.worldnic.com.&lt;br /&gt;
         chirico.org.            30599   IN      NS      ns77.worldnic.com.&lt;br /&gt;
        &lt;br /&gt;
         ;; ADDITIONAL SECTION:&lt;br /&gt;
         ns78.worldnic.com.      16022   IN      A       216.168.225.218&lt;br /&gt;
         ns77.worldnic.com.      7       IN      A       216.168.228.41&lt;br /&gt;
        &lt;br /&gt;
         ;; Query time: 155 msec&lt;br /&gt;
         ;; SERVER: 68.80.0.6#53(68.80.0.6)&lt;br /&gt;
         ;; WHEN: Thu Dec 23 07:48:23 2004&lt;br /&gt;
         ;; MSG SIZE  rcvd: 127&lt;br /&gt;
&lt;br /&gt;
      So what if you wanted to know what name the IP address 66.35.250.210&lt;br /&gt;
      resolves to, when using dns 68.80.0.12.&lt;br /&gt;
&lt;br /&gt;
          $ dig @68.80.0.12 -x 66.35.250.210&lt;br /&gt;
          ...&lt;br /&gt;
          ;; ANSWER SECTION:&lt;br /&gt;
          210.250.35.66.in-addr.arpa. 3600 IN   CNAME   210.0/24.250.35.66.in-addr.arpa.&lt;br /&gt;
          210.0/24.250.35.66.in-addr.arpa. 3600 IN PTR  vhost.sourceforge.net.&lt;br /&gt;
&lt;br /&gt;
      Above you can see it resolved to &amp;quot;vhost.sourceforge.net&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      Reference ( http://www.tldp.org/HOWTO/DNS-HOWTO-5.html )&lt;br /&gt;
        Also see TIP 223.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 112:&lt;br /&gt;
&lt;br /&gt;
       Using GNU Autotools - so you can produce the familiar &amp;quot;./configure&amp;quot;  &amp;quot;make&amp;quot;  and &amp;quot;make install&amp;quot;&lt;br /&gt;
                             commands. There is also a &amp;quot;make dist&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                The program sqlite3api.cc and the rest of this code can be found at&lt;br /&gt;
                 http://prdownloads.sourceforge.net/cpearls/autotools.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         A &amp;quot;Makefile.am&amp;quot; is required:&lt;br /&gt;
&lt;br /&gt;
            bin_PROGRAMS = sprog&lt;br /&gt;
            sprog_SOURCES = sqlite3api.cc&lt;br /&gt;
            sprog_LDADD = @INCLUDES@ @SQLIBOBJS@&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         In addition, a &amp;quot;configure.in&amp;quot; file is required. Note, AC_CHECK_LIB will&lt;br /&gt;
         check the &amp;quot;libsqlite3.so&amp;quot; file for the &amp;quot;sqlite3_open&amp;quot; file. Note that&lt;br /&gt;
         &amp;quot;sqlite3&amp;quot;, is a shortcut for &amp;quot;libsqlite3&amp;quot; by convention. If this file&lt;br /&gt;
         is not found, AC_CHECK_FILE looks for &amp;quot;/usr/local/lib/libsqlite3.a&amp;quot;. If&lt;br /&gt;
         this is found, then, &amp;quot;-lsqlite3&amp;quot; is added to the LIBS environment variable.&lt;br /&gt;
         Also, &amp;quot;-I/usr/local/include&amp;quot; and &amp;quot;-L/usr/local/lib&amp;quot; will be added on the&lt;br /&gt;
         command line. This is common when some one does not have the library in&lt;br /&gt;
         the path.  (See TIP 49)&lt;br /&gt;
&lt;br /&gt;
            dnl Process this file with autoconf to produce a configure script.&lt;br /&gt;
            AC_INIT(sqlite3api.cc)&lt;br /&gt;
            AM_INIT_AUTOMAKE(sqliteprog, 1.0)&lt;br /&gt;
            AC_PROG_CXX&lt;br /&gt;
            CXXFLAGS='-Wall -W -O2 -s -pipe'&lt;br /&gt;
            AC_CHECK_LIB(sqlite3,sqlite3_open,[],found=no)&lt;br /&gt;
             if test &amp;quot;$found&amp;quot; = &amp;quot;no&amp;quot;; then&lt;br /&gt;
               AC_CHECK_FILE(/usr/local/lib/libsqlite3.a, found=yes)&lt;br /&gt;
               if test &amp;quot;$found&amp;quot; = &amp;quot;yes&amp;quot;; then&lt;br /&gt;
                 LIBS=&amp;quot;$LIBS -lsqlite3&amp;quot;&lt;br /&gt;
                 INCLUDES=&amp;quot;$INCLUDES -I/usr/local/include&amp;quot;&lt;br /&gt;
                 EXTRALIB='-L/usr/local/lib'&lt;br /&gt;
                else&lt;br /&gt;
                 echo &amp;quot;Are you SURE sqlite3 is installed?&amp;quot;&lt;br /&gt;
               fi&lt;br /&gt;
             fi&lt;br /&gt;
            SQLIBOBJS='-Wl,-R/usr/local/lib'&lt;br /&gt;
            AC_SUBST(INCLUDES)&lt;br /&gt;
            AC_SUBST(SQLIBOBJS)&lt;br /&gt;
            AC_SUBST(EXTRALIB)&lt;br /&gt;
            AC_OUTPUT(Makefile)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         To build the configure file, just run the following:&lt;br /&gt;
&lt;br /&gt;
             $ aclocal&lt;br /&gt;
             $ autoconf&lt;br /&gt;
             $ touch NEWS README AUTHORS ChangeLog&lt;br /&gt;
             $ automake --add-missing&lt;br /&gt;
&lt;br /&gt;
         Now if you want to make a tar.gz file &amp;quot;sqliteprog-1.0.tar.gz&amp;quot;, then&lt;br /&gt;
         all you have to run is the following:&lt;br /&gt;
&lt;br /&gt;
             $ make dist&lt;br /&gt;
&lt;br /&gt;
         Note: did you ever want to save all the output from a ./configure? Well, it&lt;br /&gt;
               is automatically saved in the &amp;quot;config.log&amp;quot; file. In fact, this file may&lt;br /&gt;
               contain a lot more than what you saw on the screen.&lt;br /&gt;
&lt;br /&gt;
               Also, you may need to rerun ./configure. But before you do, delete&lt;br /&gt;
               the &amp;quot;config.cache&amp;quot; file to get a clean build.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 113:&lt;br /&gt;
&lt;br /&gt;
       EMACS - common emacs commands.&lt;br /&gt;
&lt;br /&gt;
         M is the ESC&lt;br /&gt;
         C or c is the Ctl&lt;br /&gt;
&lt;br /&gt;
        Shell - when working in a shell. &amp;quot;M-x rename-uniquely&amp;quot; is good for split screen editing.&lt;br /&gt;
&lt;br /&gt;
          M-x rename-uniquely   Use this for multiple shells (renames buffer so it's not the same shell)&lt;br /&gt;
          C-c C-z               Send job in background (when working in a shell)&lt;br /&gt;
          C-c C-o               commit-kill-output (gets rid of a lot of shell output)&lt;br /&gt;
          C-c C-r               reposition at beginning of output&lt;br /&gt;
          C-c C-e               reposition at end of output&lt;br /&gt;
          M-x send-invisible    Hide passwords - use this before typing a password&lt;br /&gt;
&lt;br /&gt;
         Note: if the shell prompt does not show up correctly, then, you may want to creat a &amp;quot;.emacs_bash&amp;quot;&lt;br /&gt;
               file with the following contents:&lt;br /&gt;
&lt;br /&gt;
                          PS1=&amp;quot;emacs:\W \$ &amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Directories  (C-x d) give you a directory listing. You know all those annoying &amp;quot;~&amp;quot; and &amp;quot;#&amp;quot;&lt;br /&gt;
                     file that you get? You can easily delete these when in &amp;quot;dired&amp;quot; mode by hitting&lt;br /&gt;
                     &amp;quot;~&amp;quot;, then  &amp;quot;d&amp;quot; to flag it for delete. Then, hit &amp;quot;x&amp;quot; to and confirm deletion.&lt;br /&gt;
&lt;br /&gt;
                     These are other command that work on highlighted files in &amp;quot;dired&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
                          R   rename&lt;br /&gt;
                          v   view&lt;br /&gt;
                          Z   compress the file&lt;br /&gt;
                          +   create directory&lt;br /&gt;
&lt;br /&gt;
        Other common commands:&lt;br /&gt;
&lt;br /&gt;
          c-x l          list the line you are on, and how many lines in the document.&lt;br /&gt;
                         You will get something like: Page has 4881 lines (4440 + 442),&lt;br /&gt;
                         which means you are on the 4440 line.&lt;br /&gt;
&lt;br /&gt;
          c-x rm bookmark make&lt;br /&gt;
          c-x rb bookmark bounce&lt;br /&gt;
        &lt;br /&gt;
          c-x rb notes&lt;br /&gt;
          c-x rb emacs&lt;br /&gt;
        &lt;br /&gt;
          c-x / &amp;lt;r&amp;gt; (save position in register &amp;lt;r&amp;gt;)&lt;br /&gt;
          c-x j &amp;lt;r&amp;gt; (jump to position in register &amp;lt;r&amp;gt;)&lt;br /&gt;
          c-x r SPC 1 (mark current point in register 1)&lt;br /&gt;
          c-x r j 1 (jump to marked point in register 1)&lt;br /&gt;
          c-x r t &amp;lt;string&amp;gt;  (insert string into register)&lt;br /&gt;
        &lt;br /&gt;
          c-x r s 1 (save marked region in register 1)&lt;br /&gt;
          c-x r i 1 (insert marked region)&lt;br /&gt;
        &lt;br /&gt;
          c-x c-o (delete all blank lines, except one)&lt;br /&gt;
        &lt;br /&gt;
          c-x z (repeat the last command ... stop with an a)&lt;br /&gt;
          c-x zz (repeat the last command twice)&lt;br /&gt;
&lt;br /&gt;
          rectangle&lt;br /&gt;
          ---------&lt;br /&gt;
          C-SPC&lt;br /&gt;
          goto the next region&lt;br /&gt;
          C-x&lt;br /&gt;
          C-x&lt;br /&gt;
          then, C-x r r &amp;quot;name of register&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
          to insert the register&lt;br /&gt;
          C-x r i &amp;quot;name of register&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
          macros:&lt;br /&gt;
          -------&lt;br /&gt;
          c-x (    start macro&lt;br /&gt;
          c-x )    end macro&lt;br /&gt;
          c-x e    execute macro&lt;br /&gt;
        &lt;br /&gt;
          mail:&lt;br /&gt;
          -----&lt;br /&gt;
          c-x m   mail&lt;br /&gt;
          c-c c-s send&lt;br /&gt;
        &lt;br /&gt;
          C-x C-e&lt;br /&gt;
          (insert &amp;quot;\n\nExtra Line of text&amp;quot;)&lt;br /&gt;
        &lt;br /&gt;
          ;; chirico functions in .emacs&lt;br /&gt;
          ;; This creates an html template&lt;br /&gt;
          (defun my-html ()&lt;br /&gt;
          (interactive)&lt;br /&gt;
          (insert &amp;quot;&amp;lt;html&amp;gt;&lt;br /&gt;
          &amp;lt;head&amp;gt;&lt;br /&gt;
          &amp;lt;META HTTP-EQUIV=\&amp;quot;Pragma\&amp;quot; CONTENT=\&amp;quot;no-cache\&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;META HTTP-EQUIV=\&amp;quot;Expires\&amp;quot; CONTENT=\&amp;quot;-1\&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;/head&amp;gt;&lt;br /&gt;
          &amp;lt;body bgcolor=\&amp;quot;#ffffff\&amp;quot;&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
          &amp;lt;/body&amp;gt;&lt;br /&gt;
          &amp;lt;/html&amp;gt;&amp;quot;)&lt;br /&gt;
          )&lt;br /&gt;
&lt;br /&gt;
     Backspace issues when using &amp;quot;emacs -nw&amp;quot;? They putting the following in your &amp;quot;~/.emacs&amp;quot; file&lt;br /&gt;
&lt;br /&gt;
             (global-set-key &amp;quot;\C-d&amp;quot; 'backward-delete-char)&lt;br /&gt;
             (global-set-key &amp;quot;\C-h&amp;quot; 'backward-delete-char)&lt;br /&gt;
             (global-set-key (kbd &amp;quot;DEL&amp;quot;) 'delete-char)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 114:&lt;br /&gt;
&lt;br /&gt;
        ncftpget - an intelligent ftp client (http://www.ncftp.com/). Also&lt;br /&gt;
                   check your fedora or debian install. This package allows&lt;br /&gt;
                   you to easily download packages from ftp sites.&lt;br /&gt;
&lt;br /&gt;
          This is an example of connect to an ftp site, with a subdirectory, and&lt;br /&gt;
          downloading all in one command.&lt;br /&gt;
&lt;br /&gt;
           $ ncftpget ftp://ftp.gnu.org/pub/gnu/gcc/gcc-3.2.3/gcc-3.2.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
          Of if you want to get the fedora core 3 installs&lt;br /&gt;
&lt;br /&gt;
           $ ncftpget ftp://ftp.linux.ncsu.edu/pub/fedora/linux/core/3/i386/iso/FC3*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 115:&lt;br /&gt;
&lt;br /&gt;
        expr - evaluate expressions. You can use this on the command line&lt;br /&gt;
&lt;br /&gt;
           $ expr 6 + 4&lt;br /&gt;
           10&lt;br /&gt;
&lt;br /&gt;
         Note the spaces. Without spaces, you get the following:&lt;br /&gt;
&lt;br /&gt;
           $ expr 6+4&lt;br /&gt;
           6+4&lt;br /&gt;
&lt;br /&gt;
         If you're using &amp;quot;*&amp;quot;, you'll need a &amp;quot;\&amp;quot; before it&lt;br /&gt;
&lt;br /&gt;
           $ expr 10 \* 10&lt;br /&gt;
           100&lt;br /&gt;
&lt;br /&gt;
         This also works for variables&lt;br /&gt;
&lt;br /&gt;
           $ var1=34&lt;br /&gt;
           $ expr $var1 + 3&lt;br /&gt;
           37&lt;br /&gt;
&lt;br /&gt;
         or&lt;br /&gt;
&lt;br /&gt;
           $ var1=2&lt;br /&gt;
           $ var1=`expr $var1 \* 2`&lt;br /&gt;
           $ echo $var1&lt;br /&gt;
           4&lt;br /&gt;
&lt;br /&gt;
         see (TIP 25) you can get the cosine(.23)&lt;br /&gt;
&lt;br /&gt;
           $ var1=`echo &amp;quot;c(.23)&amp;quot;|bc -l`&lt;br /&gt;
           $ echo $var1&lt;br /&gt;
           .97366639500537483696&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         You can also do substrings:&lt;br /&gt;
&lt;br /&gt;
           $ expr substr &amp;quot;BigBear&amp;quot; 4 4&lt;br /&gt;
           Bear&lt;br /&gt;
&lt;br /&gt;
         And length of strings&lt;br /&gt;
&lt;br /&gt;
           $ mstr=&amp;quot;12345&amp;quot;&lt;br /&gt;
           $ expr length $mstr&lt;br /&gt;
           5&lt;br /&gt;
&lt;br /&gt;
         Regular expressions&lt;br /&gt;
&lt;br /&gt;
           $ expr &amp;quot;a3&amp;quot; : [a-z][1-9]&lt;br /&gt;
           2&lt;br /&gt;
&lt;br /&gt;
         Or you can get a bit fancy&lt;br /&gt;
&lt;br /&gt;
           $ myexpr=&amp;quot;[a-z][1-9]&amp;quot;&lt;br /&gt;
           $ echo $myexpr&lt;br /&gt;
           [a-z][1-9]&lt;br /&gt;
&lt;br /&gt;
           $ expr &amp;quot;a3&amp;quot; : $myexpr&lt;br /&gt;
           2&lt;br /&gt;
&lt;br /&gt;
         This may not be the best way to find out if it is Friday, but&lt;br /&gt;
         it seems to work. It's more of an exercise in xargs.&lt;br /&gt;
&lt;br /&gt;
           $ date&lt;br /&gt;
           Fri Dec 31 16:44:47 EST 2004&lt;br /&gt;
           $ date|xargs -i expr {} : &amp;quot;[Fri]&amp;quot;&lt;br /&gt;
           1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 116:&lt;br /&gt;
&lt;br /&gt;
        eval&lt;br /&gt;
&lt;br /&gt;
           $ mypipe=&amp;quot;|&amp;quot;&lt;br /&gt;
           $ eval ls $mypipe wc&lt;br /&gt;
           6       6     129&lt;br /&gt;
&lt;br /&gt;
        Did you catch that? The above statement is the same as&lt;br /&gt;
&lt;br /&gt;
           $ ls | wc&lt;br /&gt;
&lt;br /&gt;
        Where &amp;quot;|&amp;quot; is put into the variable $mypipe&lt;br /&gt;
&lt;br /&gt;
        (also see TIP 118)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 117:&lt;br /&gt;
&lt;br /&gt;
        lxr, glimpse, patchset - tools for reading the kernel source&lt;br /&gt;
&lt;br /&gt;
          This example puts some of the files in /home/src since my home&lt;br /&gt;
          partition is the largest. Plus, you do not want to over write&lt;br /&gt;
          the source in /usr/src/ If you want to put your files elsewhere&lt;br /&gt;
          just substitute /home/src for your desired directory.&lt;br /&gt;
&lt;br /&gt;
         patchset -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ export SRCDIR=/home/src&lt;br /&gt;
            $ cd $SRCDIR&lt;br /&gt;
            $ wget http://www.csn.ul.ie/~mel/projects/patchset/patchset-0.5.tar.gz&lt;br /&gt;
            $ export PATH=$PATH:$SRCDIR/patchset-0.5/bin&lt;br /&gt;
&lt;br /&gt;
          Now edit &amp;quot;/home/src/patchset-0.5/etc/patchset.conf&amp;quot; and set WWW_USER to&lt;br /&gt;
          whatever your website runs as&lt;br /&gt;
&lt;br /&gt;
                  export WWW_USER=nobody&lt;br /&gt;
&lt;br /&gt;
          Getting kernel source. The last step builds and asks a lot of questions. Enter&lt;br /&gt;
          yes to things that interest you, since this is what you will see in the source&lt;br /&gt;
          code. It is not going to build for booting. The &amp;quot;downlaod -p&amp;quot; is for downloading&lt;br /&gt;
          a patch.&lt;br /&gt;
&lt;br /&gt;
            $ download 2.6.10&lt;br /&gt;
            $ createset 2.6.10&lt;br /&gt;
            $ make-kernel -b 2.6.10&lt;br /&gt;
&lt;br /&gt;
        glimpse -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ mkdir -p /home/src/glimpse&lt;br /&gt;
            $ cd /home/src/glimpse&lt;br /&gt;
            $ wget http://webglimpse.net/trial/glimpse-latest.tar.gz&lt;br /&gt;
            $ tar -xzf glimpse-latest.tar.gz&lt;br /&gt;
            $ cd glimpse-4.18.0&lt;br /&gt;
            $ ./configure; make&lt;br /&gt;
            $ make install&lt;br /&gt;
&lt;br /&gt;
        lxr -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ make -p /home/src/lxr&lt;br /&gt;
            $ cd /home/src/lxr&lt;br /&gt;
            $ wget http://heanet.dl.sourceforge.net/sourceforge/lxr/lxr-0.3.1.tar.gz&lt;br /&gt;
            $ cd lxr-0.3&lt;br /&gt;
&lt;br /&gt;
          Edit &amp;quot;Makefile&amp;quot; and set PERLBIN to &amp;quot;/usr/bin/perl&amp;quot; or the where perl is&lt;br /&gt;
          on your system. Also set INSTALLPREFIX to &amp;quot;/var/www/lxr&amp;quot;.  Then, as root&lt;br /&gt;
          do the following:&lt;br /&gt;
&lt;br /&gt;
            $ make install&lt;br /&gt;
&lt;br /&gt;
         Apache changes&lt;br /&gt;
&lt;br /&gt;
          Next edit the apache httpd.conf. On my system it is&lt;br /&gt;
          &amp;quot;/usr/local/apache2/conf/httpd.conf&amp;quot;, but if you did a fedora install&lt;br /&gt;
          I think this file is located at &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             Alias  /lxr/ &amp;quot;/var/www/lxr/&amp;quot;&lt;br /&gt;
             &amp;lt;Directory &amp;quot;/var/www/lxr/&amp;quot;&amp;gt;&lt;br /&gt;
               Options ExecCGI Indexes Includes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride all&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
&lt;br /&gt;
              &amp;lt;Files ~ (search|source|ident|diff|find)&amp;gt;&lt;br /&gt;
                    SetHandler cgi-script&lt;br /&gt;
              &amp;lt;/Files&amp;gt;&lt;br /&gt;
             &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          lxr - continued &amp;quot;/var/www/lxr/http/lxr.conf&amp;quot; changes.  The following contains&lt;br /&gt;
                my lxr.conf with changes made to almost every variable. Make sure you use&lt;br /&gt;
                your website in place of 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
                 # Configuration file.&lt;br /&gt;
                &lt;br /&gt;
                 # Define typed variable &amp;quot;v&amp;quot;, read valueset from file.&lt;br /&gt;
                 variable: v, Version, [/var/www/lxr/source/versions], [/var/www/lxr/source/defversion]&lt;br /&gt;
                &lt;br /&gt;
                 # Define typed variable &amp;quot;a&amp;quot;.  First value is default.&lt;br /&gt;
                 variable: a, Architecture, (i386, alpha, m68k, mips, ppc, sparc, sparc64)&lt;br /&gt;
                &lt;br /&gt;
                 # Define the base url for the LXR files.&lt;br /&gt;
                 baseurl: http://192.168.1.71/lxr/http/&lt;br /&gt;
                &lt;br /&gt;
                 # These are the templates for the HTML heading, directory listing and&lt;br /&gt;
                 # footer, respectively.&lt;br /&gt;
                 htmlhead: /var/www/lxr/http/template-head&lt;br /&gt;
                 htmltail: /var/www/lxr/http/template-tail&lt;br /&gt;
                 htmldir:  /var/www/lxr/http/template-dir&lt;br /&gt;
                &lt;br /&gt;
                 # The source is here.&lt;br /&gt;
                 sourceroot: /var/www/lxr/source/$v/&lt;br /&gt;
                 srcrootname: Linux&lt;br /&gt;
                &lt;br /&gt;
                 # &amp;quot;#include &amp;lt;foo.h&amp;gt;&amp;quot; is mapped to this directory (in the LXR source&lt;br /&gt;
                 # tree)&lt;br /&gt;
                 incprefix: /include&lt;br /&gt;
                &lt;br /&gt;
                 # The database files go here.&lt;br /&gt;
                 dbdir: /var/www/lxr/source/$v/&lt;br /&gt;
                &lt;br /&gt;
                 # Glimpse can be found here.&lt;br /&gt;
                 glimpsebin: /usr/local/bin/glimpse&lt;br /&gt;
                &lt;br /&gt;
                 # The power of regexps.  This is pretty Linux-specific, but quite&lt;br /&gt;
                 # useful.  Tinker with it and see what it does.  (How's that for&lt;br /&gt;
                 # documentation?)&lt;br /&gt;
                 map: /include/asm[^\/]*/ /include/asm-$a/&lt;br /&gt;
                 map: /arch/[^\/]+/ /arch/$a/&lt;br /&gt;
&lt;br /&gt;
         Now you should be ready to run &amp;quot;make-lxr&amp;quot;. Make sure the path is setup to patchset,&lt;br /&gt;
         which is repeated here. The last step take awhile.&lt;br /&gt;
&lt;br /&gt;
            $ export SRCDIR=/home/src&lt;br /&gt;
            $ cd $SRCDIR&lt;br /&gt;
            $ export PATH=$PATH:$SRCDIR/patchset-0.5/bin&lt;br /&gt;
&lt;br /&gt;
            $  make-lxr 2.6.10&lt;br /&gt;
&lt;br /&gt;
         Now you need to index the source. Below the ./glimpse_* file will be put in&lt;br /&gt;
         root. Checkout the -H option if you do not want them here on a temporary&lt;br /&gt;
         bases of if you run out of room.&lt;br /&gt;
&lt;br /&gt;
            $ glimpseindex -o -t -w 5000 /var/www/lxr/source/2.6.10 &amp;gt;&amp;amp; .glimpse_out&lt;br /&gt;
&lt;br /&gt;
         Since the above put the files under /root/.glimpse_* they should be moved&lt;br /&gt;
&lt;br /&gt;
            $ mv /root/.glimps_* /var/www/lxr/source/2.6.10/.&lt;br /&gt;
            $ chown -R nobody.nobody ./.glimpse_*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 118:&lt;br /&gt;
&lt;br /&gt;
        exec - you can change standard output and input without starting a new&lt;br /&gt;
               process.&lt;br /&gt;
&lt;br /&gt;
          The exec redirect the output from ls and date to a file. Nothing&lt;br /&gt;
          is show on the terminal until &amp;quot;exec &amp;gt; /dev/tty&amp;quot; is performed&lt;br /&gt;
&lt;br /&gt;
            $ exec &amp;gt; mfile&lt;br /&gt;
            $ ls&lt;br /&gt;
            $ date&lt;br /&gt;
            $ exec &amp;gt; /dev/tty&lt;br /&gt;
&lt;br /&gt;
          This is an example of assigning file descriptor 3 to file &amp;quot;output3&amp;quot; for&lt;br /&gt;
          output, then, redirecting &amp;quot;ls&amp;quot; to this descriptor. Finally, file descriptor&lt;br /&gt;
          3 is used for input, and the contents are read into the cat command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
            $ exec 3&amp;gt;output3&lt;br /&gt;
            $ ls  &amp;gt;&amp;amp; 3&lt;br /&gt;
            $ exec 3&amp;lt;output3&lt;br /&gt;
            $ cat &amp;lt;&amp;amp;3&lt;br /&gt;
            ChangeLog&lt;br /&gt;
            CVS&lt;br /&gt;
            How_to_Linux_and_Open_Source.txt&lt;br /&gt;
            How_to_Linux_and_Open_Source.txt.~1.193.~&lt;br /&gt;
            mfile&lt;br /&gt;
            mfile2&lt;br /&gt;
            mfile3&lt;br /&gt;
            mftp&lt;br /&gt;
            output3&lt;br /&gt;
&lt;br /&gt;
        Could you redirect the output to 3 files and stderr?&lt;br /&gt;
&lt;br /&gt;
            $ exec 3&amp;gt;output3&lt;br /&gt;
            $ exec 4&amp;gt;output4&lt;br /&gt;
            $ exec 5&amp;gt;output5&lt;br /&gt;
&lt;br /&gt;
            $ ls &amp;gt;&amp;amp; 3 &amp;gt;&amp;amp; 4 &amp;gt;&amp;amp; 5 &amp;gt;&amp;amp; 2   // Nope, can't do this.&lt;br /&gt;
            output3  output4  output5&lt;br /&gt;
&lt;br /&gt;
         Instead, you should do the following:&lt;br /&gt;
&lt;br /&gt;
            $ ls | tee output3 | tee output4 |tee output5&lt;br /&gt;
&lt;br /&gt;
         Closing the &amp;quot;output&amp;quot; file descriptor&lt;br /&gt;
&lt;br /&gt;
            $ &amp;gt;&amp;amp;3-&lt;br /&gt;
&lt;br /&gt;
         Closing the &amp;quot;input&amp;quot; file descriptor&lt;br /&gt;
&lt;br /&gt;
            $ 3&amp;lt;&amp;amp;-&lt;br /&gt;
&lt;br /&gt;
         See what is still open on 0-10&lt;br /&gt;
&lt;br /&gt;
            $ lsof -a -p $$ -d 0-10&lt;br /&gt;
&lt;br /&gt;
         Recursion - the following counts to 5, then, quits.&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
            sleep 1&lt;br /&gt;
            declare -x n&lt;br /&gt;
            let n=${n:=0}+1&lt;br /&gt;
            [ $n -le 5 ] &amp;amp;&amp;amp; echo &amp;quot;$n&amp;quot; &amp;amp;&amp;amp;  exec $0&lt;br /&gt;
&lt;br /&gt;
         There are some real-life applications for this technique, as follows:&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
            declare -x N&lt;br /&gt;
            declare -x n&lt;br /&gt;
            N=${N:=$(od -vAn -N1 -tu4 &amp;lt; /dev/urandom)}&lt;br /&gt;
            let n=${n:=0}+1&lt;br /&gt;
            [ $(($n%2)) -eq 0 ] &amp;amp;&amp;amp; echo &amp;quot;She Loves Me!&amp;quot; || echo &amp;quot;She Loves Me NOT!&amp;quot;&lt;br /&gt;
            [ $n -lt $N ] &amp;amp;&amp;amp;  exec $0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 119:&lt;br /&gt;
&lt;br /&gt;
        runlevel - need to know the current runlevel?&lt;br /&gt;
&lt;br /&gt;
           $ who -r&lt;br /&gt;
           run-level 3  Dec 31 19:02                   last=S&lt;br /&gt;
&lt;br /&gt;
        Need to know the architecture?&lt;br /&gt;
&lt;br /&gt;
          $ arch&lt;br /&gt;
          i686&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 120:&lt;br /&gt;
&lt;br /&gt;
        at - executes commands at a specified time.&lt;br /&gt;
&lt;br /&gt;
         A few examples here. The 1970 program will run&lt;br /&gt;
         next Auguest 2 even though the year 1970 has long past.&lt;br /&gt;
&lt;br /&gt;
          $ at 6:30am Jan 12 &amp;lt; program&lt;br /&gt;
          $ at noon tomorrow &amp;lt; program&lt;br /&gt;
          $ at 1970 pm August 2 &amp;lt; program&lt;br /&gt;
&lt;br /&gt;
        This is an interactive way to use the command:&lt;br /&gt;
&lt;br /&gt;
          $ at now + 6 minutes&lt;br /&gt;
          warning: commands will be executed using (in order) a) $SHELL b) login shell c) /bin/sh&lt;br /&gt;
          at&amp;gt; ls&lt;br /&gt;
          at&amp;gt; date &amp;gt; /tmp/5min&lt;br /&gt;
          at&amp;gt; ^D&lt;br /&gt;
          job 3 at 2005-01-01 08:50&lt;br /&gt;
&lt;br /&gt;
        What jobs are in the queue?&lt;br /&gt;
&lt;br /&gt;
          $ atq&lt;br /&gt;
&lt;br /&gt;
        or&lt;br /&gt;
&lt;br /&gt;
          $ at -l&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 121:&lt;br /&gt;
&lt;br /&gt;
        Creating a Manpage&lt;br /&gt;
&lt;br /&gt;
         As root you can copy the following to /usr/local/man/man1/soup.1 which will&lt;br /&gt;
         give you a manpage for soup.&lt;br /&gt;
&lt;br /&gt;
              .\&amp;quot; Manpage for souptonuts.&lt;br /&gt;
              .\&amp;quot; Contact mchirico@users.sourceforge.com to correct errors or omissions.&lt;br /&gt;
              .TH man 1 &amp;quot;04 January 2005&amp;quot; &amp;quot;1.0&amp;quot; &amp;quot;souptonuts man page&amp;quot;&lt;br /&gt;
              .SH NAME&lt;br /&gt;
              soup \- man page for souptonuts&lt;br /&gt;
              .SH SYNOPSIS&lt;br /&gt;
              soup&lt;br /&gt;
              .SH DESCRIPTION&lt;br /&gt;
              souptonuts is a collection of linux and open&lt;br /&gt;
              source tips.&lt;br /&gt;
              off for golf.&lt;br /&gt;
              .SH OPTIONS&lt;br /&gt;
              The souptonuts does not take any options.&lt;br /&gt;
              .SH SEE ALSO&lt;br /&gt;
              doughnut(1), golf(8)&lt;br /&gt;
              .SH BUGS&lt;br /&gt;
              No known bugs at this time.&lt;br /&gt;
              .SH AUTHOR&lt;br /&gt;
              Mike Chirico (mchirico@comcast.net mchirico@users.sourceforge.net)&lt;br /&gt;
&lt;br /&gt;
         So, to view this man page&lt;br /&gt;
&lt;br /&gt;
            $ man soup&lt;br /&gt;
&lt;br /&gt;
         It's also possible to compress&lt;br /&gt;
&lt;br /&gt;
            $ gzip /usr/local/man/man1/soup.1&lt;br /&gt;
&lt;br /&gt;
         For plenty of examples look at the other man pages. Also the following&lt;br /&gt;
         is helpful. The last one is a tutorial &amp;quot;man 7 mdoc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            $ man manpath&lt;br /&gt;
            $ man groff&lt;br /&gt;
            $ man 7 mdoc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 122:&lt;br /&gt;
&lt;br /&gt;
        dmesg - print out boot messages, or what is in the kernel ring buffer.&lt;br /&gt;
&lt;br /&gt;
          If you missed the messages on boot-up, you can use dmesg to print them.&lt;br /&gt;
&lt;br /&gt;
            $ dmesg &amp;gt; boot.msg&lt;br /&gt;
&lt;br /&gt;
          Or to print, then, clear the ring&lt;br /&gt;
&lt;br /&gt;
            # dmesg -c &amp;gt; boot.msg&lt;br /&gt;
&lt;br /&gt;
          (also see TIP 20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 123:&lt;br /&gt;
&lt;br /&gt;
        gnus - emacs email nntp news reader (comcast as example with NO TLS or SSL)&lt;br /&gt;
&lt;br /&gt;
          First check that you can connect to the news group:&lt;br /&gt;
&lt;br /&gt;
                 $ telnet newsgroups.comcast.net 119&lt;br /&gt;
                 Trying 216.196.97.136...&lt;br /&gt;
                 Connected to newsgroups.comcast.net.&lt;br /&gt;
                 Escape character is '^]'.&lt;br /&gt;
                 200 News.GigaNews.Com&lt;br /&gt;
&lt;br /&gt;
          If you want to check for TLS or SSL see (TIP 54).&lt;br /&gt;
&lt;br /&gt;
          Here is a very simple configuration example without encryption. It&lt;br /&gt;
          appears that comcast does not support ssl or TLS.&lt;br /&gt;
&lt;br /&gt;
          In the &amp;quot;~/.emacs&amp;quot; file you would add the following to get comcast&lt;br /&gt;
          news groups&lt;br /&gt;
&lt;br /&gt;
             (setq gnus-select-method '(nntp &amp;quot;newsgroups.comcast.net&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
          Then, create an &amp;quot;~/.authinfo&amp;quot; file with the following settings using&lt;br /&gt;
          you own username and password.&lt;br /&gt;
&lt;br /&gt;
             machine newsgroups.comcast.net login borkey@comcast.net  password borkeypass0rd&lt;br /&gt;
&lt;br /&gt;
          Next create a &amp;quot;~/.newsrc&amp;quot; with your groups&lt;br /&gt;
&lt;br /&gt;
             news.announce.newusers:&lt;br /&gt;
             comp.lang.c++.moderated! 1-500&lt;br /&gt;
             comp.unix.programmer! 1-500&lt;br /&gt;
             comp.unix.shell! 1-500&lt;br /&gt;
             gnu.emacs.gnus! 1-500&lt;br /&gt;
&lt;br /&gt;
          Finally, create a &amp;quot;~/.gnus&amp;quot; with the following email settings for you&lt;br /&gt;
&lt;br /&gt;
             (setq user-mail-address &amp;quot;mchirico@comcast.net&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
             (defun my-message-mode-setup ()&lt;br /&gt;
               (setq fill-column 72)&lt;br /&gt;
               (turn-on-auto-fill))&lt;br /&gt;
               (add-hook 'message-mode-hook 'my-message-mode-setup)&lt;br /&gt;
&lt;br /&gt;
          To get into gnus&lt;br /&gt;
&lt;br /&gt;
              E-x gnus&lt;br /&gt;
&lt;br /&gt;
          The following are common gnus commands&lt;br /&gt;
&lt;br /&gt;
                RET  view the article under the cursor&lt;br /&gt;
&lt;br /&gt;
                A A (shift-a, shift a): List all newsgroups known&lt;br /&gt;
                                        to the server.&lt;br /&gt;
&lt;br /&gt;
                l (lower-case L)      : List only  subscribed groups&lt;br /&gt;
                                        with unread articles.&lt;br /&gt;
&lt;br /&gt;
                L                     : List all newsgroups in .newsrc file.&lt;br /&gt;
&lt;br /&gt;
                g                     : See if new articles have arrived.&lt;br /&gt;
&lt;br /&gt;
            Some commands for reading&lt;br /&gt;
&lt;br /&gt;
                n  next unread article&lt;br /&gt;
&lt;br /&gt;
                p  previous article&lt;br /&gt;
&lt;br /&gt;
                SPC  scroll down  moves to next unread&lt;br /&gt;
                     when at the bottom of the article&lt;br /&gt;
&lt;br /&gt;
                del  scroll up&lt;br /&gt;
&lt;br /&gt;
                F  follow-up to group on the article you are&lt;br /&gt;
                   reading now.&lt;br /&gt;
&lt;br /&gt;
                f  follow-up to group without citing the article&lt;br /&gt;
&lt;br /&gt;
                R  reply by mail and cite the article&lt;br /&gt;
&lt;br /&gt;
                r  reply by mail without citing the article&lt;br /&gt;
&lt;br /&gt;
                m  new mail&lt;br /&gt;
&lt;br /&gt;
                a  new posting&lt;br /&gt;
&lt;br /&gt;
                c  Catchup&lt;br /&gt;
&lt;br /&gt;
                C-u / t  Show only young headers&lt;br /&gt;
                         / t without C-u limits the summary&lt;br /&gt;
                         to old headers&lt;br /&gt;
&lt;br /&gt;
                T T  toggle threading&lt;br /&gt;
&lt;br /&gt;
                C-u g  Display raw article&lt;br /&gt;
                       hit g to return to normal view&lt;br /&gt;
&lt;br /&gt;
                t  Show all headers  it's a toggle&lt;br /&gt;
&lt;br /&gt;
                W w  Wordwrap the current article&lt;br /&gt;
&lt;br /&gt;
                W r  Decode ROT13  a toggle&lt;br /&gt;
&lt;br /&gt;
                ^  fetch parent of article&lt;br /&gt;
&lt;br /&gt;
                L  create a scorefile-entry based&lt;br /&gt;
                   on the current article (low score)&lt;br /&gt;
                   ? gives you information what each char means&lt;br /&gt;
&lt;br /&gt;
                I  like L but high score&lt;br /&gt;
&lt;br /&gt;
          Commands to send email&lt;br /&gt;
&lt;br /&gt;
            C-c C-c  send message&lt;br /&gt;
&lt;br /&gt;
            C-c C-d  save message as draft&lt;br /&gt;
&lt;br /&gt;
            C-c C-k  kill message&lt;br /&gt;
&lt;br /&gt;
            C-c C-m f  attach file&lt;br /&gt;
&lt;br /&gt;
            M-q  reformat paragraph&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 124:&lt;br /&gt;
&lt;br /&gt;
        Sending Email from telnet&lt;br /&gt;
&lt;br /&gt;
           Note, if you are on the computer you can sometime use the local loopback.&lt;br /&gt;
           In fact, sometimes you can only use the local loop back 127.0.0.1 in&lt;br /&gt;
           place of &amp;quot;bozo.company.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            1     [mchirico@soup Notes]$ telnet bozo.company.com 25&lt;br /&gt;
            2     Trying 192.168.0.204...&lt;br /&gt;
            3     Connected to bozo.company.com.&lt;br /&gt;
            4     Escape character is '^]'.&lt;br /&gt;
            5     220 bozo.company.com ESMTP Postfix (Postfix-20010228-pl03) (Mandrake Linux)&lt;br /&gt;
            6     HELO fakedomain.com&lt;br /&gt;
            7     HELO fakedomain.com         // server echo&lt;br /&gt;
            8     250 bozo.company.com&lt;br /&gt;
            9     MAIL FROM: test@fakedomain.com&lt;br /&gt;
           10     MAIL FROM: test@fakedomain.com   // server echo&lt;br /&gt;
           11     250 Ok&lt;br /&gt;
           12     RCPT TO: mchirico@someother.com&lt;br /&gt;
           13     RCPT TO: mchirico@someother.com   // server echo&lt;br /&gt;
           14     250 Ok&lt;br /&gt;
           15     DATA&lt;br /&gt;
           16     DATA    // echo&lt;br /&gt;
           17     354 Enter mail, end with &amp;quot;.&amp;quot; on a line by itself&lt;br /&gt;
           18     This is a test message&lt;br /&gt;
           19     This is a test message&lt;br /&gt;
           20     to send&lt;br /&gt;
           21     to send&lt;br /&gt;
           22     .&lt;br /&gt;
           23     250 2.0.0 j0B0uH3L018469 Message accepted for delivery&lt;br /&gt;
&lt;br /&gt;
          Above on line 6 you can type in any domain name. Line 7 is an echo. All&lt;br /&gt;
          echos are listed in the comment field.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 125:&lt;br /&gt;
&lt;br /&gt;
          IP forwarding, IP Masquerade&lt;br /&gt;
&lt;br /&gt;
             # echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
             # ipchains -F forward&lt;br /&gt;
             # ipchains -P forward DENY&lt;br /&gt;
             # ipchains -A forward -s 192.168.0.0/24 -j MASQ&lt;br /&gt;
             # ipchains -A forward -i eth1 -j MASQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          This assumes that your internal network is 192.168.0.0 on eth1, and the&lt;br /&gt;
          internet is connected to eth0.&lt;br /&gt;
&lt;br /&gt;
          (Also See TIP 182)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 126:&lt;br /&gt;
&lt;br /&gt;
         Setting KDE as the default desktop manager&lt;br /&gt;
&lt;br /&gt;
               Edit &amp;quot;/etc/sysconfig/desktop&amp;quot; to include the two lines:&lt;br /&gt;
&lt;br /&gt;
                 DESKTOP=&amp;quot;KDE&amp;quot;&lt;br /&gt;
                 DISPLAYMANAGER=&amp;quot;KDE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 127:&lt;br /&gt;
&lt;br /&gt;
        Have a file and you do not know whay type it is (tar, gz, ASCII, binary) ?&lt;br /&gt;
        Use the file command.  Below it is used on the file &amp;quot;mftp&amp;quot;&lt;br /&gt;
&lt;br /&gt;
               $ file mftp&lt;br /&gt;
               mftp: Bourne-Again shell script text executable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 128:&lt;br /&gt;
&lt;br /&gt;
        Software RAID: Two good references&lt;br /&gt;
&lt;br /&gt;
          http://www.tldp.org/HOWTO/Software-RAID-HOWTO-1.html&lt;br /&gt;
          http://lists.us.dell.com/pipermail/linux-poweredge/2003-July/014331.html&lt;br /&gt;
&lt;br /&gt;
        Note, you must setup grub for each RAID 1 device. Suppose you have&lt;br /&gt;
        2 SCSI drives (sda and sdb). By default grub is setup on sda; but, you&lt;br /&gt;
        need to enable it for sdb (/dev/hdb for ide) as follows:&lt;br /&gt;
&lt;br /&gt;
           grub&amp;gt;device (hd0) /dev/sdb&lt;br /&gt;
           grub&amp;gt;root (hd0,0)&lt;br /&gt;
           grub&amp;gt;setup (hd0)&lt;br /&gt;
&lt;br /&gt;
           Checking if &amp;quot;/boot/grub/stage1&amp;quot; exists... no&lt;br /&gt;
           Checking if &amp;quot;/grub/stage1&amp;quot; exists... yes&lt;br /&gt;
           Checking if &amp;quot;/grub/stage2&amp;quot; exists... yes&lt;br /&gt;
           Checking if &amp;quot;/grub/e2fs_stage1_5&amp;quot; exists.. yes&lt;br /&gt;
           Running &amp;quot;embed /grub/e2fs_stage1_5 (hd0)&amp;quot;... 16 sectors are embedded.&lt;br /&gt;
          succeeded&lt;br /&gt;
           Running &amp;quot;install /grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/grub/stage2 /grub/grub&lt;br /&gt;
         .conf&amp;quot;... succeeded.&lt;br /&gt;
         Done.&lt;br /&gt;
&lt;br /&gt;
          grub&amp;gt;&lt;br /&gt;
          grub&amp;gt;quit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Checking to see if everything is working:&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
        Checking the drives&lt;br /&gt;
&lt;br /&gt;
          $ sfdisk -d /dev/sdb&lt;br /&gt;
          $ sfdisk -d /dev/sda&lt;br /&gt;
&lt;br /&gt;
          $ fdisk -l /dev/sda  &amp;quot;This will give general information&amp;quot;&lt;br /&gt;
          $ fdisk -l           &amp;quot;General information for all drives&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Adding raid (assume you want to add the first drive &amp;quot;sda1&amp;quot;, or if it is the second&lt;br /&gt;
                    drive then substitute &amp;quot;sda2&amp;quot; below )&lt;br /&gt;
&lt;br /&gt;
          $ raidhotadd /dev/md0 /dev/sda1&lt;br /&gt;
          $ raidhotadd /dev/md1 /dev/sda2&lt;br /&gt;
          $ raidhotadd /dev/md2 /dev/sda3&lt;br /&gt;
&lt;br /&gt;
        This is an example of an cat /proc/mdstat that is working. Note that&lt;br /&gt;
        there is a listing for both sda1[0] and sdb1[1]&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
                Personalities : [raid1]&lt;br /&gt;
                read_ahead 1024 sectors&lt;br /&gt;
                Event: 12&lt;br /&gt;
                md0 : active raid1 sda1[0] sdb1[1]&lt;br /&gt;
                      104320 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md1 : active raid1 sda2[0] sdb2[1]&lt;br /&gt;
                      1044160 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md2 : active raid1 sda3[0] sdb3[1]&lt;br /&gt;
                      34411136 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        Compare that to this where md2 is missing sdb3&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
                Personalities : [raid1]&lt;br /&gt;
                read_ahead 1024 sectors&lt;br /&gt;
                Event: 9&lt;br /&gt;
                md0 : active raid1 sda1[0] sdb1[1]&lt;br /&gt;
                      104320 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md1 : active raid1 sda2[0] sdb2[1]&lt;br /&gt;
                      1044160 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md2 : active raid1 sdb3[1]        &amp;lt;---- HERE&lt;br /&gt;
                      34411136 blocks [2/1] [_U]&lt;br /&gt;
&lt;br /&gt;
                unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        If you are rebuilding an array, you can watch it by doing the following:&lt;br /&gt;
&lt;br /&gt;
           $ watch -n1 cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
        Need to know the raid setup?&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/raidtab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 129:&lt;br /&gt;
&lt;br /&gt;
        Resetting Redhat Linux Passwords using GRUB&lt;br /&gt;
&lt;br /&gt;
           1. Press 'e'&lt;br /&gt;
           2. Press 'e' again&lt;br /&gt;
           3. Append 'single' to the kernel version listing&lt;br /&gt;
&lt;br /&gt;
          See&lt;br /&gt;
             http://linuxgazette.net/107/tomar.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 130:&lt;br /&gt;
&lt;br /&gt;
        mtr - matt's traceroute. This is an advanced traceroute that keeps&lt;br /&gt;
              [http://www.bitwizard.nl/mtr/]&lt;br /&gt;
                  $ mtr www.yahoo.com&lt;br /&gt;
&lt;br /&gt;
                                              Matt's traceroute  [v0.52]&lt;br /&gt;
                     third-fl-71.localdomain                            Thu Jan 20 11:05:57 2005&lt;br /&gt;
                     Keys:  D - Display mode    R - Restart statistics    Q - Quit&lt;br /&gt;
                                                            Packets               Pings&lt;br /&gt;
                     Hostname                            %Loss  Rcv  Snt  Last Best  Avg  Worst&lt;br /&gt;
                      1. 192.168.1.1                        0%    3    3     0    0    0      1&lt;br /&gt;
                      2. ???&lt;br /&gt;
                      3. fe-2-6-rr01.willogrove5.pa.pa01    0%    3    3     8    7    7      8&lt;br /&gt;
                      4. srp-8-1-ar01.willowgrove1.pa.pa    0%    2    2     8    8    8      8&lt;br /&gt;
                      5. pos7-3-cr01.torresdale.pa.core.    0%    2    2     8    8    8      8&lt;br /&gt;
                      6. 12.119.53.53                       0%    2    2    12   12   12     13&lt;br /&gt;
                      7. tbr1-p012401.phlpa.ip.att.net      0%    2    2    12   12   13     13&lt;br /&gt;
                      8. tbr1-cl8.n54ny.ip.att.net          0%    2    2    13   13   13     13&lt;br /&gt;
                      9. ggr2-p310.n54ny.ip.att.net         0%    2    2    12   12   13     14&lt;br /&gt;
                     10. so-1-0-0.gar4.NewYork1.Level3.n    0%    2    2    14   14   37     61&lt;br /&gt;
                     11. ae-1-54.bbr2.NewYork1.Level3.ne    0%    2    2    13   12   13     13&lt;br /&gt;
                     12. ge-0-3-0.bbr2.Washington1.Level    0%    2    2    19   19   19     19&lt;br /&gt;
                     13. ge-1-1-51.car1.Washington1.Leve    0%    2    2    18   18   19     20&lt;br /&gt;
                     14. 4.79.228.6                         0%    2    2    21   19   20     21&lt;br /&gt;
                     15. UNKNOWN-216-109-120-201.yahoo.c    0%    2    2    21   20   20     21&lt;br /&gt;
                     16. w2.rc.vip.dcn.yahoo.com            0%    2    2    23   21   22     23&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 131:&lt;br /&gt;
&lt;br /&gt;
        chfn - change finger information&lt;br /&gt;
&lt;br /&gt;
            $ chfn&lt;br /&gt;
&lt;br /&gt;
          Next you are asked for a password and user information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 132:&lt;br /&gt;
&lt;br /&gt;
        chsh - change login shell&lt;br /&gt;
&lt;br /&gt;
          First, you may want to get a listing of all the possible&lt;br /&gt;
          shells.&lt;br /&gt;
&lt;br /&gt;
             $ chsh -l&lt;br /&gt;
&lt;br /&gt;
               /bin/sh&lt;br /&gt;
               /bin/bash&lt;br /&gt;
               /sbin/nologin&lt;br /&gt;
               /bin/ash&lt;br /&gt;
               /bin/bsh&lt;br /&gt;
               /bin/ksh&lt;br /&gt;
               /usr/bin/ksh&lt;br /&gt;
               /usr/bin/pdksh&lt;br /&gt;
               /bin/tcsh&lt;br /&gt;
               /bin/csh&lt;br /&gt;
               /bin/zsh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 133:&lt;br /&gt;
&lt;br /&gt;
        bash - working with binary, hex and base 3.&lt;br /&gt;
&lt;br /&gt;
         For the variable must be declare as an integer. Then&lt;br /&gt;
         specify the  &amp;lt;base&amp;gt;#&amp;lt;value&amp;gt;. The example below is 22 in&lt;br /&gt;
         base 3.&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n&lt;br /&gt;
              $ n=3#22&lt;br /&gt;
              $ echo $n&lt;br /&gt;
                8&lt;br /&gt;
&lt;br /&gt;
           Base 16 (hex)&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n2&lt;br /&gt;
              $ n2=16#a&lt;br /&gt;
              $ echo $n2&lt;br /&gt;
                10&lt;br /&gt;
&lt;br /&gt;
           Base 8 (octal)&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n3&lt;br /&gt;
              $ n3=8#11&lt;br /&gt;
              $ echo $n3&lt;br /&gt;
                9   Note 8+1=9&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 134:&lt;br /&gt;
&lt;br /&gt;
        monitoring IP traffic. Try iptraf http://iptraf.seul.org/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 135:&lt;br /&gt;
&lt;br /&gt;
        enscript - convert text files to PostScript&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 136:&lt;br /&gt;
&lt;br /&gt;
        dd and tar - blocking factor. How to determine the blocking factor, block size&lt;br /&gt;
                   so that tar and dd can work together.&lt;br /&gt;
&lt;br /&gt;
        Step 1: Create a large file on local disk, in a directory &amp;quot;1&amp;quot; that will eventually&lt;br /&gt;
                be written to tape. This will be created with dd as follows:&lt;br /&gt;
&lt;br /&gt;
                $ mkdir 1&lt;br /&gt;
                $ dd if=/dev/zero of=disk-image count=40960&lt;br /&gt;
                  40960+0 records in&lt;br /&gt;
                  40960+0 records out&lt;br /&gt;
&lt;br /&gt;
                $ cd ..&lt;br /&gt;
&lt;br /&gt;
        Step 2: tar the directory and contents to tape. First rewind the tape. These examples&lt;br /&gt;
                use /dev/nst0 as the location of the tape. Make sure to substitute your values&lt;br /&gt;
                if needed.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ tar --label=&amp;quot;Test 1&amp;quot; --create --blocking-factor=128 --file=/dev/nst0 1&lt;br /&gt;
&lt;br /&gt;
        Step 3: Read data from the tape using a block size of 128k. If you get an I/O error, which&lt;br /&gt;
                could happend if you used a different blocking factor above, then, you may need&lt;br /&gt;
                to increase the bs to 256, or 512 etc. as needed.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=/dev/nst0 bs=128k of=testblocksz count=1&lt;br /&gt;
                 0+1 records in&lt;br /&gt;
                 0+1 records out&lt;br /&gt;
&lt;br /&gt;
                $ ls -l testblocksz&lt;br /&gt;
                 -rw-r--r--    1 root     root        65536 Feb  9 10:41 testblocksz&lt;br /&gt;
&lt;br /&gt;
                $ ls -lh testblocksz&lt;br /&gt;
                 -rw-r--r--    1 root     root          64k Feb  9 10:41 testblocksz&lt;br /&gt;
&lt;br /&gt;
               Note above that the size 65536 is equal to 64k. That &amp;quot;h&amp;quot; switch in &amp;quot;ls&amp;quot; is for&lt;br /&gt;
               human readable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 4: tar uses a multiplier of 512*blocking-factor to get block size. Again&lt;br /&gt;
&lt;br /&gt;
                 512 * blocking-factor = block size used in dd command.&lt;br /&gt;
&lt;br /&gt;
              Putting in the values, we see that&lt;br /&gt;
&lt;br /&gt;
                 512 * 128 = 65536&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 5: So what does this tell you? You can now use these numbers to &amp;quot;dd&amp;quot; files&lt;br /&gt;
              to tape. But, first tar will be used to create the file locally.&lt;br /&gt;
&lt;br /&gt;
                $ tar --label=&amp;quot;Test 1&amp;quot; --create --blocking-factor=128 --file=test.tar 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 6: Send this to tape with the dd command. Remember 64k is equal to 65536.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=test.tar bs=64k of=/dev/nst0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 7: Now test that it can be read with tar command using blocking-factor=128.&lt;br /&gt;
             Note the &amp;quot;t&amp;quot; command in tar is for tell. It will not write data.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ tar -tvf /dev/nst0 --blocking-factor=128&lt;br /&gt;
                 V--------- 0/0               0 2005-02-09 10:38:20 Test 1--Volume Header--&lt;br /&gt;
                 drwxr-xr-x root/root         0 2005-02-09 10:34:10 1/&lt;br /&gt;
                 -rw-r--r-- root/root  20971520 2005-02-09 10:34:11 1/disk-image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 8: Reading tape data with dd. Most of the time a high &amp;quot;ibs&amp;quot; input block size&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=/dev/nst0 of=outfromdd.tar ibs=64k&lt;br /&gt;
                 321+0 records in&lt;br /&gt;
                 41088+0 records out&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 9: Verify that outfromdd.tar can be read by tar with blocking-factor=128&lt;br /&gt;
&lt;br /&gt;
                $ tar -tvf outfromdd.tar --blocking-factor=128&lt;br /&gt;
                 V--------- 0/0               0 2005-02-09 10:38:20 Test 1--Volume Header--&lt;br /&gt;
                 drwxr-xr-x root/root         0 2005-02-09 10:34:10 1/&lt;br /&gt;
                 -rw-r--r-- root/root  20971520 2005-02-09 10:34:11 1/disk-image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       PULLING FILES:  The dd command can be used to pull files.&lt;br /&gt;
&lt;br /&gt;
              ssh target_address dd if=remotefile | dd of=localfile&lt;br /&gt;
&lt;br /&gt;
           Or, a specific example of getting a file from a computer called hamlet.&lt;br /&gt;
&lt;br /&gt;
              $ ssh root@hamlet  dd if=/home/cvs/test | dd of=/home/storage/test&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        GOING BACKWARD AND FORWARD ON TAPE:&lt;br /&gt;
&lt;br /&gt;
             Go to end of data&lt;br /&gt;
              $ mt -f /dev/nst0  eod&lt;br /&gt;
&lt;br /&gt;
             Previous record&lt;br /&gt;
              $ mt -f /dev/nst0  bsfm 1&lt;br /&gt;
&lt;br /&gt;
             Forward record&lt;br /&gt;
              $ mt -f /dev/nst0  fsf 1&lt;br /&gt;
&lt;br /&gt;
             Rewind&lt;br /&gt;
              $ mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
             Tell&lt;br /&gt;
              $ mt -f /dev/nst0 tell&lt;br /&gt;
&lt;br /&gt;
         (Reference TIP 151 - for how to get around firewalls)&lt;br /&gt;
&lt;br /&gt;
         Below is a script that I use to backup computers via ssh. The&lt;br /&gt;
         tape drive is on &amp;quot;nis&amp;quot; and the extra space is on &amp;quot;hamlet&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                #!/bin/bash&lt;br /&gt;
                # Program to backup server remotely&lt;br /&gt;
                # Assume remote server is nis, you are on squeezel&lt;br /&gt;
                #&lt;br /&gt;
                # Recover from tape&lt;br /&gt;
                #&lt;br /&gt;
                #   dd if=/dev/nst0 of=test.tar.gz bs=64k&lt;br /&gt;
                #&lt;br /&gt;
                filename=&amp;quot;support1.$(date &amp;quot;+%m%d%y%H%M&amp;quot;).tar.gz&amp;quot;&lt;br /&gt;
                DIRTOBACKUP=/var/www&lt;br /&gt;
                #tar cvzf - $DIRTOBACKUP | ssh  root@nis  '(mt -f /dev/nst0 rewind; dd of=/dev/nst0 bs=64k )'&lt;br /&gt;
                tar cvzf - $DIRTOBACKUP | ssh  support1@hamlet &amp;quot;dd of=/home/support1/backups/${filename} &amp;quot;&lt;br /&gt;
&lt;br /&gt;
         Another example program, below, pushes the last &amp;quot;.tar.gz&amp;quot; file to tape:&lt;br /&gt;
&lt;br /&gt;
                #!/bin/bash&lt;br /&gt;
                # Program to push files to tape&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                # Notes on recovering from tape&lt;br /&gt;
                #&lt;br /&gt;
                #   dd if=/dev/nst0 of=test.tar.gz ibs=64k&lt;br /&gt;
                #    or&lt;br /&gt;
                #  $ ssh root@tapeserver &amp;quot;mt -f /dev/nst0 rewind&amp;quot;&lt;br /&gt;
                #  $ ssh root@tapeserver &amp;quot;dd if=/dev/nst0 ibs=64k&amp;quot;|dd of=cvs1.tar.gz&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                # First rewind tape&lt;br /&gt;
                ssh root@tapeserver 'mt -f /dev/nst0 rewind'&lt;br /&gt;
                #&lt;br /&gt;
                # Grab only the last file&lt;br /&gt;
                file=$(find /home/cvs  -iname 'cvs*.tar.gz'|sort|tail -n 1)&lt;br /&gt;
                dd if=${file}|ssh root@tapeserver 'dd of=/dev/nst0 bs=64k'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 137:&lt;br /&gt;
&lt;br /&gt;
        Apache - redirecting pages. All changes are in httpd.conf&lt;br /&gt;
&lt;br /&gt;
               RedirectMatch (.*)\.gif$ http://www.anotherserver.com$1.jpg&lt;br /&gt;
&lt;br /&gt;
               Redirect /service http://foo2.bar.com/service&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 138:&lt;br /&gt;
&lt;br /&gt;
        samba mounts via ssh - mounting a samba share through an ssh tunnel, going&lt;br /&gt;
               through an intermediate computer, that accepts ssh. We'll call this&lt;br /&gt;
               intermediate computer middle [65.219.4.23], and we want to get to&lt;br /&gt;
               destination [192.168.0.81]. The user will be mchirico.&lt;br /&gt;
&lt;br /&gt;
          STEP 1:&lt;br /&gt;
&lt;br /&gt;
               $ mkdir -p /samba/share&lt;br /&gt;
&lt;br /&gt;
          STEP 2:&lt;br /&gt;
&lt;br /&gt;
            This has to be done as root, since we are using a lower port.&lt;br /&gt;
&lt;br /&gt;
               $ ssh -N -L 139:192.168.0.81:139 mchirico@65.219.4.23&lt;br /&gt;
&lt;br /&gt;
          STEP 3:&lt;br /&gt;
&lt;br /&gt;
              umount /samba/sales&lt;br /&gt;
              /bin/mount -t smbfs -o  username=donkey,workgroup=donkeydomain,&lt;br /&gt;
                      password=passw0rk1,port=139,dmask=770,fmask=660,&lt;br /&gt;
                      netbiosname=homecpu //localhost/share /samba/share&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 139:&lt;br /&gt;
&lt;br /&gt;
        Music on Fedora Core -- How to play music on http://magnatune.com with &amp;quot;xmms&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           The following command will show the sound driver:&lt;br /&gt;
&lt;br /&gt;
              $ lspci|grep -i audio&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          STEP 1:&lt;br /&gt;
&lt;br /&gt;
                Unmute amixer with the following command:&lt;br /&gt;
&lt;br /&gt;
              $ amixer set Master 100% unmute&lt;br /&gt;
              $ amixer set PCM 100%  unmute&lt;br /&gt;
&lt;br /&gt;
                Note you can also get a graphical interface with &amp;quot;alsamixer&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              $ alsamixer&lt;br /&gt;
&lt;br /&gt;
                 h,F1   -- for help&lt;br /&gt;
                 Esc    -- exit&lt;br /&gt;
                 Tab    -- move to selections&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          STEP 2:&lt;br /&gt;
&lt;br /&gt;
                Test a sound file &amp;quot;*.au&amp;quot; with aplay. To quickly find files on your system use&lt;br /&gt;
                the &amp;quot;locate *.au&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
                  $ aplay /usr/lib/python2.3/test/audiotest.au&lt;br /&gt;
&lt;br /&gt;
          STEP 3:&lt;br /&gt;
&lt;br /&gt;
                Install &amp;quot;xmms-mp3-1.2.10-9.2.1.fc3.rf.i386.rpm&amp;quot; which does not come with Fedora because&lt;br /&gt;
                of GPL license restrictions.  The latest version of this package can be found&lt;br /&gt;
                at the following url:&lt;br /&gt;
&lt;br /&gt;
                  http://rpmseek.com/rpm-pl/xmms-mp3.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                  $ rpm -ivh xmms-mp3-1.2.10-9.2.1.fc3.rf.i386.rpm&lt;br /&gt;
&lt;br /&gt;
          STEP 4:&lt;br /&gt;
&lt;br /&gt;
                Go to magnatun &amp;quot;http://magnatune.com/&amp;quot;, select genre and make sure xmms&lt;br /&gt;
                is the default player.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 140:&lt;br /&gt;
&lt;br /&gt;
        Routing -- getting access to a network 1 hop away. You are currently on the 192 network&lt;br /&gt;
                   and you want access to the 172.21.0.0 network that has a computer straddling&lt;br /&gt;
                   the two, with /proc/sys/net/ipv4/ip_forward set to 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               $ route add -net 172.21.0.0 netmask 255.255.255.0 gw 192.168.0.204&lt;br /&gt;
&lt;br /&gt;
         To undo:&lt;br /&gt;
&lt;br /&gt;
               $ route del -net 172.21.0.0 netmask 255.255.255.0 gw 192.168.0.204&lt;br /&gt;
&lt;br /&gt;
         Now you can ping 172.21.0.21.&lt;br /&gt;
&lt;br /&gt;
         Does not work?&lt;br /&gt;
&lt;br /&gt;
         Go on to 192.168.0.204 and execute the following commands:&lt;br /&gt;
&lt;br /&gt;
               $ echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
               $ cat /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
               1&lt;br /&gt;
&lt;br /&gt;
         To Look at the the gateway, execute the following command.&lt;br /&gt;
&lt;br /&gt;
               $ netstat -r&lt;br /&gt;
&lt;br /&gt;
         References: &lt;br /&gt;
&lt;br /&gt;
               http://lartc.org/lartc.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 141:&lt;br /&gt;
&lt;br /&gt;
        RAM disk -- creating a filesystem in RAM.&lt;br /&gt;
&lt;br /&gt;
               $ mkfs -t ext3 -q /dev/ram1 4096&lt;br /&gt;
               $ mkdir -p /fsram&lt;br /&gt;
               $ mount /dev/ram1 /fsram -o defaults,rw&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 142:&lt;br /&gt;
&lt;br /&gt;
        Create a Live Linux CDROM  using  BusyBox and OpenSSH.&lt;br /&gt;
&lt;br /&gt;
            These steps are rather long. A complete tutorial is given at&lt;br /&gt;
            the following link:&lt;br /&gt;
             http://prdownloads.sourceforge.net/souptonuts/instructions_boot_system.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 143:&lt;br /&gt;
&lt;br /&gt;
      SystemImager (http://www.systemimager.org/) SystemImager is software that automates Linux installs,&lt;br /&gt;
                       software distribution, and production deployment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 144:&lt;br /&gt;
&lt;br /&gt;
      Mounted a filesystem in rescue mode, yet, you cannot read and write?  Remount.&lt;br /&gt;
&lt;br /&gt;
             $ mount -o remount /&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 145:&lt;br /&gt;
&lt;br /&gt;
      Nmap commands to check for Microsoft VPN connection.&lt;br /&gt;
&lt;br /&gt;
         $ nmap -sO -p 47 vpn1.someserver.com&lt;br /&gt;
         $ nmap -sS -p T:1723 vpn1.someserver.com&lt;br /&gt;
&lt;br /&gt;
      By the way, with nmap you can specify multiple ports. Below&lt;br /&gt;
      is an example of multiple ports; but, use the commands above&lt;br /&gt;
      for Microsoft VPN services.&lt;br /&gt;
&lt;br /&gt;
         $ nmap -sS -p T:1723-3000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 146:&lt;br /&gt;
&lt;br /&gt;
      Perl and ssh - monitoring systems. The output from ssh can be parsed. Below is&lt;br /&gt;
      a simple procedure to just to read the ssh ouput into perl.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #&lt;br /&gt;
          $pid = open $readme, &amp;quot;ssh root\@hamlet df -lh|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
          while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
           print $_&lt;br /&gt;
          }&lt;br /&gt;
          close $readme&lt;br /&gt;
&lt;br /&gt;
      But note, you probably want to do something more complex. Below is a more robust&lt;br /&gt;
      example that bypassed all the fortune, heading junk that you may encounter when&lt;br /&gt;
      logging in.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #&lt;br /&gt;
          $pid = open $readme, &amp;quot;ssh root\@hamlet df -lh 2&amp;gt;/dev/null|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
          while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
           print $_&lt;br /&gt;
          }&lt;br /&gt;
          close $readme&lt;br /&gt;
&lt;br /&gt;
      NO! you CANNOT do bidirectional communication with the open statement. Note the &amp;quot;|&amp;quot; before&lt;br /&gt;
      and after below, which cannot be done.&lt;br /&gt;
&lt;br /&gt;
          # Cannot do this!&lt;br /&gt;
          $pid = open $readme, &amp;quot;|ssh root\@hamlet df -lh 2&amp;gt;/dev/null|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
      Below is a simple Perl example working with arrays:&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          @ArrayOfArray = (&lt;br /&gt;
                   [ &amp;quot;ant&amp;quot;, &amp;quot;bee&amp;quot; ],&lt;br /&gt;
                   [ &amp;quot;mouse&amp;quot;, &amp;quot;mole&amp;quot;, &amp;quot;rat&amp;quot; ],&lt;br /&gt;
                   [ &amp;quot;duck&amp;quot;, &amp;quot;goose&amp;quot;, &amp;quot;flamingo&amp;quot; ],&lt;br /&gt;
                   [  &amp;quot;rose&amp;quot;,&amp;quot;carnation&amp;quot;,&amp;quot;sunflower&amp;quot;],&lt;br /&gt;
                  );&lt;br /&gt;
&lt;br /&gt;
          for $i ( 0 .. $#ArrayOfArray ) {&lt;br /&gt;
              for $j ( 0 .. $#{$ArrayOfArray[$i]} ) {&lt;br /&gt;
                  print &amp;quot;Element $i $j is $ArrayOfArray[$i][$j]\n&amp;quot;;&lt;br /&gt;
              }&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          # Or this is another way to list elements&lt;br /&gt;
          foreach( @ArrayOfArray ) {&lt;br /&gt;
             foreach $i (0..$#$_) {&lt;br /&gt;
                print &amp;quot;$_-&amp;gt;[$i] &amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
             print &amp;quot;\n&amp;quot;;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Below is an example of working with Hash of Arrays:&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #  ./program &amp;lt; /etc/passwd&lt;br /&gt;
          while(&amp;lt;&amp;gt;){&lt;br /&gt;
              next unless s/^(.*?):\s*//;&lt;br /&gt;
              $HoA{$1} = [ split(/:/) ];&lt;br /&gt;
          }&lt;br /&gt;
          for $i (keys %HoA ) {&lt;br /&gt;
              print &amp;quot;$i: @{ $HoA{$i} } \n&amp;quot;;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
      Example of regular expression. This is my most used regular expression - I like&lt;br /&gt;
      this sample. See the &amp;quot;www.unix.org.ua&amp;quot; link at the end of this tip.&lt;br /&gt;
&lt;br /&gt;
          &amp;quot;hot cross buns&amp;quot; =~ /cross/;&lt;br /&gt;
          print &amp;quot;Matched: &amp;lt;$`&amp;gt; $&amp;amp; &amp;lt;$'&amp;gt;\n&amp;quot;;    # Matched: &amp;lt;hot &amp;gt; cross &amp;lt; buns&amp;gt;&lt;br /&gt;
          print &amp;quot;Left:    &amp;lt;$`&amp;gt;\n&amp;quot;;            # Left:    &amp;lt;hot &amp;gt;&lt;br /&gt;
          print &amp;quot;Match:   &amp;lt;$&amp;amp;&amp;gt;\n&amp;quot;;            # Match:   &amp;lt;cross&amp;gt;&lt;br /&gt;
          print &amp;quot;Right:   &amp;lt;$'&amp;gt;\n&amp;quot;;            # Right:   &amp;lt; buns&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      If you're looking for Perl information, type &amp;quot;man perl&amp;quot;, which will show you how&lt;br /&gt;
      to get even more information. Or better yet, take a look at the following&lt;br /&gt;
      link:&lt;br /&gt;
&lt;br /&gt;
          http://www.unix.org.ua/orelly/perl/prog3/ch09_01.htm&lt;br /&gt;
               also&lt;br /&gt;
          http://www.stonehenge.com/merlyn/UnixReview/&lt;br /&gt;
&lt;br /&gt;
      For a quick example on using Perl with SQLite, see the following links:&lt;br /&gt;
&lt;br /&gt;
          http://prdownloads.sourceforge.net/souptonuts/README_sqlite_tutorial.html?download&lt;br /&gt;
            or&lt;br /&gt;
          http://freshmeat.net/articles/view/1428/&lt;br /&gt;
            or&lt;br /&gt;
          http://www.perl.com/pub/a/1999/09/refererents.html&lt;br /&gt;
&lt;br /&gt;
      Standard input for files. This example will read from stdin, or open a file if given as&lt;br /&gt;
      an argument, and convert all &amp;quot;&amp;lt;&amp;quot; to &amp;quot;&amp;amp;lt;&amp;quot; and &amp;quot;&amp;gt;&amp;quot; to &amp;quot;&amp;amp;gt;&amp;quot;, which can be handy when&lt;br /&gt;
      converting text files to html files. Note the &amp;quot;while(&amp;lt;&amp;gt;)&amp;quot; will take multiple file names&lt;br /&gt;
      on the command line.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          while(&amp;lt;&amp;gt;) {&lt;br /&gt;
             s/&amp;amp;amp;/&amp;amp;amp;amp;/g;&lt;br /&gt;
             s/&amp;amp;lt;/&amp;amp;amp;lt;/g;&lt;br /&gt;
             s/&amp;amp;gt;/&amp;amp;amp;gt;/g;&lt;br /&gt;
             s/&amp;lt;/&amp;amp;lt;/g;&lt;br /&gt;
             s/&amp;gt;/&amp;amp;gt;/g;&lt;br /&gt;
             print;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
      Perl Debugger is very useful for testing commands and works like an interpreter, just&lt;br /&gt;
      like python. So to get into the Perl Debugger execute the command below, &amp;quot;q&amp;quot; to quit.&lt;br /&gt;
&lt;br /&gt;
          $ perl -de 0&lt;br /&gt;
&lt;br /&gt;
      Reference TIP 170&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 147:&lt;br /&gt;
&lt;br /&gt;
      Shutdown&lt;br /&gt;
&lt;br /&gt;
          # shutdown 8:00 -- Shutdown at 8:00&lt;br /&gt;
&lt;br /&gt;
          # shutdown +13  -- Shutdown after 13min&lt;br /&gt;
&lt;br /&gt;
          # shutdown -r now  -- Shutdown now and restart&lt;br /&gt;
&lt;br /&gt;
          # shutdown -k +2  -- &amp;quot;The system is going DOWN to maintenance mode in 2 minutes!&amp;quot;&lt;br /&gt;
                              The above is only a warning.&lt;br /&gt;
&lt;br /&gt;
          # shutdown -h now   -- Shutdown now and halt&lt;br /&gt;
&lt;br /&gt;
          # shutdown -c    -- Cancel shutdown&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 148:&lt;br /&gt;
&lt;br /&gt;
      ac -  print statistics about users connect time&lt;br /&gt;
&lt;br /&gt;
          $ ac -p    -- print hour usage by user (individual)&lt;br /&gt;
          $ ac -dy   -- print daily usage&lt;br /&gt;
&lt;br /&gt;
       Options can also be combined&lt;br /&gt;
&lt;br /&gt;
          $ ac -dyp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 149:&lt;br /&gt;
&lt;br /&gt;
      Smart Monitoring Tools:&lt;br /&gt;
      Disk failing? Or want to know the temperature of your hard-drive?&lt;br /&gt;
&lt;br /&gt;
         http://smartmontools.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
      For a good, quick tutorial, see the Linux Journal article&lt;br /&gt;
        http://www.linuxjournal.com/article/6983&lt;br /&gt;
&lt;br /&gt;
      Below are some common commands:&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -i /dev/hda&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -Hc /dev/hda&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -A /dev/hda&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 150:&lt;br /&gt;
&lt;br /&gt;
      Monitor dhcp trafic - dhcpdump and tcpdump.&lt;br /&gt;
&lt;br /&gt;
      Download dhcpdump&lt;br /&gt;
&lt;br /&gt;
         $ wget  http://voxel.dl.sourceforge.net/sourceforge/mavetju/dhcpdump-1.5.tar.gz&lt;br /&gt;
         $ ./configure&lt;br /&gt;
         $ make &amp;amp;&amp;amp; make install&lt;br /&gt;
&lt;br /&gt;
     Once it's installed, you can monitor all dhcp traffic as follows, if done with root.&lt;br /&gt;
&lt;br /&gt;
         $ tcpdump -lenx -i eth0 -s 1500 port bootps or port bootpc| dhcpdump&lt;br /&gt;
&lt;br /&gt;
     The above assumes you are using eth0 (ethernet port 0).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 151:&lt;br /&gt;
&lt;br /&gt;
      Breaking Firewalls with ssh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      A sample .ssh/config file (note this must have chmod 600 rights)&lt;br /&gt;
&lt;br /&gt;
           ## Server1 ##&lt;br /&gt;
           Host 130.21.19.227&lt;br /&gt;
               LocalForward 20000 192.168.0.66:80&lt;br /&gt;
               LocalForward 22000 192.168.0.66:22&lt;br /&gt;
&lt;br /&gt;
      With the above &amp;quot;~/.ssh/config&amp;quot; file, after sshing into 130.21.19.227 it&lt;br /&gt;
      is then possible to ssh into nearby computers directly.&lt;br /&gt;
&lt;br /&gt;
         $ ssh -l mchirico 130.21.19.227&lt;br /&gt;
         $ scp -P 22000 authorized_keys* mchirico@localhost:.&lt;br /&gt;
         $ ssh -l mchirico localhost -p 22000&lt;br /&gt;
&lt;br /&gt;
      For the complete article reference the following link:&lt;br /&gt;
        http://souptonuts.sourceforge.net/sshtips.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 152:&lt;br /&gt;
&lt;br /&gt;
      Renaming files - suppose you want to rename all the &amp;quot;.htm&amp;quot; files to &amp;quot;.html&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          $ rename .htm .html *.htm&lt;br /&gt;
&lt;br /&gt;
      Or, suppose you files file1, file2, file3 ...&lt;br /&gt;
&lt;br /&gt;
          $ touch file1 file2 file3 file4 file5 file6&lt;br /&gt;
          $ rename file file. file*&lt;br /&gt;
&lt;br /&gt;
      The above command will give you &amp;quot;file.1&amp;quot;, &amp;quot;file.2&amp;quot; ... &amp;quot;file.6&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 153:&lt;br /&gt;
&lt;br /&gt;
      Renaming files with Perl - this is taken from &amp;quot;Programming Perl 3rd Edition&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          # rename - change filenames&lt;br /&gt;
          $op = shift;&lt;br /&gt;
          for (@ARGV) {&lt;br /&gt;
              $was = $_;&lt;br /&gt;
              eval $op;&lt;br /&gt;
              die if $@;&lt;br /&gt;
              # next line calls built-in function, not the script&lt;br /&gt;
              rename($was,$_) unless $was eq $_;&lt;br /&gt;
           }&lt;br /&gt;
&lt;br /&gt;
      The above Perl program can be used as follows:&lt;br /&gt;
&lt;br /&gt;
           $ rename 's/\.orig$//'    *.orig&lt;br /&gt;
           $ rename 'y/A-Z/a-z/ unless /^Make/' *&lt;br /&gt;
&lt;br /&gt;
      Also reference:&lt;br /&gt;
           http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 154:&lt;br /&gt;
&lt;br /&gt;
      R project (http://www.r-project.org)&lt;br /&gt;
&lt;br /&gt;
      To start R, just type &amp;quot;R&amp;quot; at the command prompt and &amp;quot;q()&amp;quot; to quit. Below&lt;br /&gt;
      2 is raised to powers 0 through 6 and thrown into an array.&lt;br /&gt;
&lt;br /&gt;
           $ R&lt;br /&gt;
           &amp;gt; N &amp;lt;- 2^(0:6)&lt;br /&gt;
           &amp;gt; N&lt;br /&gt;
           [1]  1  2  4  8 16 32 64&lt;br /&gt;
           &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      There is a summary summary() command.&lt;br /&gt;
&lt;br /&gt;
           &amp;gt; summary(N)&lt;br /&gt;
           Min. 1st Qu.  Median    Mean 3rd Qu.    Max.&lt;br /&gt;
           1.00    3.00    8.00   18.14   24.00   64.00&lt;br /&gt;
&lt;br /&gt;
      Note that the array begins as 1 and not 0&lt;br /&gt;
&lt;br /&gt;
           &amp;gt; N[1:3]&lt;br /&gt;
           [1] 1 2 4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 155:&lt;br /&gt;
&lt;br /&gt;
      ls - listing files by size, with the biggest file listed last&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           $ ls --sort=size -lhr&lt;br /&gt;
&lt;br /&gt;
      The above command sorts files by size, listing the contents in&lt;br /&gt;
      &amp;quot;h&amp;quot; human readable format in reverse order.&lt;br /&gt;
&lt;br /&gt;
      Note the options:  --sort={none,time,size,extension}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 156:&lt;br /&gt;
&lt;br /&gt;
     Perl - program to clean up old versions of files&lt;br /&gt;
&lt;br /&gt;
       #!/usr/bin/perl&lt;br /&gt;
       #   Copyright (c) GPL 2005 Mike Chirico&lt;br /&gt;
       # This program deletes old files from several directories&lt;br /&gt;
       # and within each directory there must be x number of copies&lt;br /&gt;
       # each y number of bytes&lt;br /&gt;
       #&lt;br /&gt;
&lt;br /&gt;
       sub delete_old_ones {&lt;br /&gt;
           $directory_and_file=$_[0];&lt;br /&gt;
           $save_count=$_[1];&lt;br /&gt;
           $bytes_in_file=$_[2];&lt;br /&gt;
         # Don't change setting here of '-lt'&lt;br /&gt;
           $pid = open $readme, &amp;quot;ls -lt $directory_and_file|&amp;quot; or die &amp;quot;Could not execute\n&amp;quot;;&lt;br /&gt;
           while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
               my @fields = split;&lt;br /&gt;
              # Make sure we have $save_count good ones with data&lt;br /&gt;
               if ($fields[4] &amp;gt; $bytes_in_file &amp;amp;&amp;amp; $save_count &amp;gt; 0) {&lt;br /&gt;
                   $save_count--;&lt;br /&gt;
                   print &amp;quot;Kept files: $fields[4] $fields[8]\n&amp;quot;;&lt;br /&gt;
               }&lt;br /&gt;
              # delete the old ones&lt;br /&gt;
              if ($save_count &amp;lt;= 0 )&lt;br /&gt;
              {&lt;br /&gt;
                  print &amp;quot;Deleted files: $fields[4] $fields[8]\n&amp;quot;;&lt;br /&gt;
                  unlink $fields[8];&lt;br /&gt;
              }&lt;br /&gt;
           }&lt;br /&gt;
           close $readme;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       @AofA = (&lt;br /&gt;
          [ &amp;quot;/home/cvs/backups/*.gz&amp;quot;, &amp;quot;6&amp;quot;,196621 ],&lt;br /&gt;
          [ &amp;quot;/home/mail/backups/*.gz&amp;quot;,&amp;quot;5&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/snort/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/server1/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/actserver/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/server2/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
                );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       foreach( @AofA ) {&lt;br /&gt;
           &amp;amp;delete_old_ones($_-&amp;gt;[0],$_-&amp;gt;[1],$_-&amp;gt;[2]);&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
     Reference TIP 170 and the following link:&lt;br /&gt;
       http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 157:&lt;br /&gt;
&lt;br /&gt;
     Graphics and Visualization Software that runs on Linux&lt;br /&gt;
        http://www.tldp.org/HOWTO/Scientific-Computing-with-GNU-Linux/graphvis.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 158:&lt;br /&gt;
&lt;br /&gt;
     Keeping files in sync going both ways. Unlike rsync, this is not a one way mirror&lt;br /&gt;
     option.&lt;br /&gt;
&lt;br /&gt;
     You will need ocaml installed first.&lt;br /&gt;
&lt;br /&gt;
       $ wget http://caml.inria.fr/pub/distrib/ocaml-3.08/ocaml-3.08.3.tar.gz&lt;br /&gt;
       $ tar -xzf ocaml-3.08.3.tar.gz&lt;br /&gt;
       $ cd ocaml-3.08.3&lt;br /&gt;
&lt;br /&gt;
       $ ./configure&lt;br /&gt;
       $ make world&lt;br /&gt;
       $ make opt&lt;br /&gt;
       $ make install&lt;br /&gt;
&lt;br /&gt;
     Next, get unison and put it in a different directory.&lt;br /&gt;
     [http://www.cis.upenn.edu/~bcpierce/unison/]&lt;br /&gt;
&lt;br /&gt;
       $ wget http://www.cis.upenn.edu/~bcpierce/unison/download/stable/latest/unison-2.10.2.tar.gz&lt;br /&gt;
       $ tar -xzf unison-2.10.2.tar.gz&lt;br /&gt;
       $ cd unison-2.10.2&lt;br /&gt;
       $ make UISTYLE=text&lt;br /&gt;
       $ su&lt;br /&gt;
       # cp unison /usr/local/bin/.&lt;br /&gt;
&lt;br /&gt;
     Note, you have to copy the file manually.&lt;br /&gt;
&lt;br /&gt;
     See the following article [http://www.linuxjournal.com/article/7712]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 159:&lt;br /&gt;
&lt;br /&gt;
     Dump ext2/ext3 filesystem information with &amp;quot;dumpe2fs&amp;quot;. Perform the mount command&lt;br /&gt;
     and query away.&lt;br /&gt;
&lt;br /&gt;
       $ dumpe2fs /dev/sda1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 160:&lt;br /&gt;
&lt;br /&gt;
     sysreport - a script that generates an HTML report on the system configuration. It&lt;br /&gt;
     gathers information about the hardware and is somewhat redhat specific. The utility&lt;br /&gt;
     should be run as root.&lt;br /&gt;
&lt;br /&gt;
       $ /usr/sbin/sysreport&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 161:&lt;br /&gt;
&lt;br /&gt;
     Key Bindings Using bind.  You can bind, say, ctl-t to a command.&lt;br /&gt;
&lt;br /&gt;
     Add the following to you &amp;quot;~/.inputrc&amp;quot; file, just as it is typed below with quotes.&lt;br /&gt;
&lt;br /&gt;
           &amp;quot;\C-t&amp;quot;: ls -l&lt;br /&gt;
&lt;br /&gt;
     Next, run the command&lt;br /&gt;
&lt;br /&gt;
           $ bind -f .inputrc&lt;br /&gt;
&lt;br /&gt;
     Or, you can do everything on the command line; however, it won't be there the next time&lt;br /&gt;
     you log in. Below is the way to do everything on the command line.&lt;br /&gt;
&lt;br /&gt;
           $ bind -x '&amp;quot;\C-t&amp;quot;:ls -l'&lt;br /&gt;
&lt;br /&gt;
     To unbind use the &amp;quot;-r&amp;quot; option. Single quotes are not needed.&lt;br /&gt;
&lt;br /&gt;
           $ bind -r &amp;quot;\C-t&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Getting a list of all bindings can be done as follows, and not this can be redirected&lt;br /&gt;
     to the &amp;quot;.inputrc&amp;quot; file for further editing.&lt;br /&gt;
&lt;br /&gt;
           $ bind -p &amp;gt; .inputrc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 162:&lt;br /&gt;
&lt;br /&gt;
     awk - common awk commands.&lt;br /&gt;
&lt;br /&gt;
     Find device names &amp;quot;sd&amp;quot; or with major number 4 and device name &amp;quot;tty&amp;quot;. Print the&lt;br /&gt;
     record number NR, plus the major number and minor number.&lt;br /&gt;
&lt;br /&gt;
          $ awk '$2 == &amp;quot;sd&amp;quot;||$1 == 4 &amp;amp;&amp;amp; $2 == &amp;quot;tty&amp;quot; { print NR,$1,$2}' /proc/devices&lt;br /&gt;
&lt;br /&gt;
     Find device name equal to &amp;quot;sound&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ awk '/sound/{print NR,$1,$2}' /proc/devices&lt;br /&gt;
&lt;br /&gt;
     Print the 5th record, first field, in file test&lt;br /&gt;
&lt;br /&gt;
          $ awk 'NR==5{print $1}' test&lt;br /&gt;
&lt;br /&gt;
     Print a record, skip 4 records, print a record etc from file1&lt;br /&gt;
&lt;br /&gt;
          $ awk '(NR-1) % 4 == 0 {print $1}' file1&lt;br /&gt;
&lt;br /&gt;
     Print all records except the last one from file1&lt;br /&gt;
&lt;br /&gt;
          $ tac file1|awk 'NR &amp;gt; 1 {print $0}'|tac&lt;br /&gt;
&lt;br /&gt;
     Print A,B,C ..Z on each line, cycling back to A if greater than 26 lines&lt;br /&gt;
&lt;br /&gt;
          $ awk '{ print substr(&amp;quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&amp;quot;,(NR-1)%26+1,1),$0}' file1&lt;br /&gt;
&lt;br /&gt;
     Number of bytes in a directory.&lt;br /&gt;
&lt;br /&gt;
          $ ls -l|awk 'BEGIN{ c=0}{ c+=$5} END{ print c}'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 163:&lt;br /&gt;
&lt;br /&gt;
     Configuring Remote Logging.  If you have several servers on 192.168.1.0, you can setup remote logging&lt;br /&gt;
     as follows.&lt;br /&gt;
&lt;br /&gt;
     MAIN LOG SERVER (192.168.1.81):&lt;br /&gt;
&lt;br /&gt;
        Firewall - allow UDP port 514 on the main server that will receive the logs.&lt;br /&gt;
&lt;br /&gt;
          $ iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 514 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        Edit &amp;quot;/etc/sysconfig/syslog&amp;quot; and add the &amp;quot;-r&amp;quot; option to SYSLOGD_OPTIONS as shown below.&lt;br /&gt;
&lt;br /&gt;
          SYSLOGD_OPTIONS=&amp;quot;-r -m -0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Note, the &amp;quot;-r&amp;quot; is to allow remote logging and  &amp;quot;-m 0&amp;quot; specifies that that the syslog process should&lt;br /&gt;
        not write regular timestamps.  I prefer to only write timestamps for the clients.&lt;br /&gt;
&lt;br /&gt;
        Next, restart the logging process&lt;br /&gt;
&lt;br /&gt;
          $ service syslog restart&lt;br /&gt;
&lt;br /&gt;
     CLIENT LOG SERVER:&lt;br /&gt;
&lt;br /&gt;
        Edit &amp;quot;/etc/syslog.conf&amp;quot; and add the ip address of the log server, or put in the hostname.&lt;br /&gt;
&lt;br /&gt;
            *.* @192.168.1.81&lt;br /&gt;
&lt;br /&gt;
        Next, restart the logging process&lt;br /&gt;
&lt;br /&gt;
          $ service syslog restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 164:&lt;br /&gt;
&lt;br /&gt;
     kudzu - hardware on your system. To probe the hardware on your system without doing&lt;br /&gt;
             anything, issue the following command.&lt;br /&gt;
&lt;br /&gt;
          $ kudzu -p&lt;br /&gt;
&lt;br /&gt;
      But wait, a lot of this information is already recorded in the following file&lt;br /&gt;
&lt;br /&gt;
            /etc/sysconfig/hwconf&lt;br /&gt;
&lt;br /&gt;
      You can also use lspci to list all PCI devices.&lt;br /&gt;
&lt;br /&gt;
          $ lspci&lt;br /&gt;
&lt;br /&gt;
      Also, take a look at the script /etc/sbin/sysreport, since this script has a lot of&lt;br /&gt;
      info gathering commands. You can pick and choose what you want, or run the complete&lt;br /&gt;
      report.&lt;br /&gt;
&lt;br /&gt;
      If you just want information on the NIC&lt;br /&gt;
&lt;br /&gt;
          $ ip link show eth0&lt;br /&gt;
          2: eth0: &amp;lt;BROADCAST,MULTICAST,UP&amp;gt; mtu 1500 qdisc pfifo_fast qlen 1000&lt;br /&gt;
          link/ether 00:11:11:8a:be:3f brd ff:ff:ff:ff:ff:ff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 165:&lt;br /&gt;
&lt;br /&gt;
     cfengine - a very power agent for monitoring and administrating both a single computer&lt;br /&gt;
              and or multiple computers. [ http://www.cfengine.org/ ]&lt;br /&gt;
&lt;br /&gt;
     The following is a quick example on downloading and installing cfengine.&lt;br /&gt;
&lt;br /&gt;
          $ ncftpget ftp://ftp.iu.hio.no/pub/cfengine/cfengine-2.1.15.tar.gz&lt;br /&gt;
          $ md5sum cfengine-2.1.15.tar.gz&lt;br /&gt;
          f03de82709f84c3d6d916b6e557321f9  cfengine-2.1.15.tar.gz&lt;br /&gt;
&lt;br /&gt;
          $ tar -xzf cfengine-2.1.15.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You need to have a current version of BerkeleyDB (http://downloads.sleepycat.com/db-4.3.28.tar.gz).&lt;br /&gt;
     Note that BerkeleyDB has a funny install. You cd to the &amp;quot;build_unix&amp;quot; directory, then,&lt;br /&gt;
&lt;br /&gt;
          Installing BerkeleyDB if needed:&lt;br /&gt;
                 $ wget http://downloads.sleepycat.com/db-4.3.28.tar.gz&lt;br /&gt;
                 $ tar -xzf db-4.3.28.tar.gz&lt;br /&gt;
                 $ cd db-4.3.28/build_unix/&lt;br /&gt;
                 $ ../dist/configure&lt;br /&gt;
                 make&lt;br /&gt;
                 make install&lt;br /&gt;
&lt;br /&gt;
     You also need a current version of OpenSSL. For instructions on how to install OpenSSL see&lt;br /&gt;
     (http://souptonuts.sourceforge.net/postfix_tutorial.html).&lt;br /&gt;
&lt;br /&gt;
     See (TIP 49) on putting &amp;quot;/usr/local/BerkeleyDB.4.3/lib&amp;quot; in the &amp;quot;/etc/ld.so.conf&amp;quot; file. Or&lt;br /&gt;
     once BerkeleyDB is installed, you can put the location on the command line as follows:&lt;br /&gt;
&lt;br /&gt;
     Configuring cfengine with direct reference to BerkeleyDB.4.3.  First cd to the cfengine source.&lt;br /&gt;
&lt;br /&gt;
          $ ./configure --with-berkeleydb=/usr/local/BerkeleyDB.4.3/lib&lt;br /&gt;
          $ make&lt;br /&gt;
          $ make install&lt;br /&gt;
&lt;br /&gt;
     Next create the following directories:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /var/cfengine/bin&lt;br /&gt;
          $ mkdir -p /var/cfengine/inputs&lt;br /&gt;
&lt;br /&gt;
     Copy needed files (cfagent, cfdoc, cfenvd, cfenvgraph, cfexecd, cfkey, cfrun, cfservd, cfshow):&lt;br /&gt;
&lt;br /&gt;
          $ cp /usr/local/sbin/cf* /var/cfengine/bin&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You'll also need to generate keys. As root, execute the following:&lt;br /&gt;
&lt;br /&gt;
          $ cfkey&lt;br /&gt;
&lt;br /&gt;
     The command above will write the public and private keys in&lt;br /&gt;
     &amp;quot;/var/cfengine/ppkeys&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You probably want (cfexecd, cfservd, and cfenvd) running on all servers. If you&lt;br /&gt;
     add the following to &amp;quot;/etc/rc.local&amp;quot; these daemons will start on reboot.&lt;br /&gt;
&lt;br /&gt;
           # Lines in /etc/rc.local&lt;br /&gt;
           /usr/local/sbin/cfexecd&lt;br /&gt;
           /usr/local/sbin/cfservd&lt;br /&gt;
           /usr/local/sbin/cfenvd&lt;br /&gt;
&lt;br /&gt;
     Also, make sure you run each command now as follows:&lt;br /&gt;
&lt;br /&gt;
          $ /usr/local/sbin/cfexecd&lt;br /&gt;
          $ /usr/local/sbin/cfservd&lt;br /&gt;
          $ /usr/local/sbin/cfenvd&lt;br /&gt;
&lt;br /&gt;
     Firewall settings must be adjusted to allows 5308 for tcp/udp. My local network&lt;br /&gt;
     is 192.168.1.0, so I'm opening it up for all my computers.&lt;br /&gt;
&lt;br /&gt;
          $ iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 5308 -j ACCEPT&lt;br /&gt;
          $ iptables -A INPUT -p tcp -s 192.168.1.0/24  --dport 5308 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
     A set of keys needs to be on the server and hosts. For example, my key on &amp;quot;tape.squeezel.com&amp;quot;&lt;br /&gt;
     should be copied over to the server &amp;quot;squeezel.squeezel.com&amp;quot; as follows:&lt;br /&gt;
&lt;br /&gt;
     This is done from tape.squeezel.com&lt;br /&gt;
&lt;br /&gt;
          $ scp /var/cfengine/ppkeys/localhost.pub  root@squeezel.squeezel.com:/var/cfengine/ppkeys/root-tape.squeezel.com.pub&lt;br /&gt;
          $ scp root@squeezel.squeezel.com:/var/cfengine/ppkeys/localhost.pub /var/cfengine/ppkeys/root-squeezel.squeezel.com.pub&lt;br /&gt;
&lt;br /&gt;
     Also, &amp;quot;/var/cfengine/inputs/cfrun.hosts&amp;quot; on the server &amp;quot;squeezel.squeezel.com&amp;quot; must contain&lt;br /&gt;
     all the computers that will get updated. This is &amp;quot;cfrun.hosts&amp;quot; on &amp;quot;squeezel.squeezel.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          closet.squeezel.com&lt;br /&gt;
          tape.squeezel.com&lt;br /&gt;
&lt;br /&gt;
     Once I'm done, from &amp;quot;tape.squeezel.com&amp;quot; I can run the following test:&lt;br /&gt;
&lt;br /&gt;
          $ cfrun squeezel.squeezel.com -v&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 166:&lt;br /&gt;
&lt;br /&gt;
     cfengine - a quick example. This example will be run as root. You create the file &amp;quot;cfagent.conf&amp;quot; in&lt;br /&gt;
     &amp;quot;/var/cfengine/inputs/&amp;quot;. The example below will checksum all the files in /home/chirico/deleteme/tripwire,&lt;br /&gt;
     it will also comment out the line &amp;quot;finger&amp;quot; in any file located in /tmp/testdir/stuff, also appending&lt;br /&gt;
     the command in this file &amp;quot; Edit change with cfengine&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          # /var/cfengine/inputs/cfagent.conf&lt;br /&gt;
          #&lt;br /&gt;
          # You run this with the following:&lt;br /&gt;
          #   cfagent -vK&lt;br /&gt;
        &lt;br /&gt;
          control:&lt;br /&gt;
                 actionsequence = ( files tidy editfiles )&lt;br /&gt;
                 ChecksumDatabase = ( /var/cfengine/cache.db )&lt;br /&gt;
                 # Below, true to update md5&lt;br /&gt;
                 ChecksumUpdates = ( true )&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
          files:&lt;br /&gt;
                 /home/chirico/deleteme/tripwire checksum=md5 recurse=inf&lt;br /&gt;
                 /home/chirico/deleteme/tripwire/moredata checksum=md5 recurse=inf&lt;br /&gt;
                 #/home/chirico/deleteme/tripwire/compress  recurse=inf include=*.txt acti on=compress&lt;br /&gt;
                   # If the database isn't secure, nothing is secure...&lt;br /&gt;
                 /var/cfengine/cache.db  mode=600 owner=root action=fixall&lt;br /&gt;
        &lt;br /&gt;
          tidy:&lt;br /&gt;
                 /home/chirico/deleteme/tripwire pattern=*~ recurse=inf age=0&lt;br /&gt;
                 # You must put an age. 0 runs now.&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
          editfiles:&lt;br /&gt;
        &lt;br /&gt;
                {  /tmp/testdir/stuff&lt;br /&gt;
&lt;br /&gt;
                   HashCommentLinesContaining &amp;quot;finger&amp;quot;&lt;br /&gt;
                   AppendIfNoSuchLine &amp;quot;# Edit Change with cfengine &amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     A few further notes on the above. The command &amp;quot;actionsequence = ( files tidy editfiles) tells the order&lt;br /&gt;
     of what to execute. The heading &amp;quot;tidy:&amp;quot; deletes files, and of course, &amp;quot;editfiles&amp;quot; does the editing of files.&lt;br /&gt;
&lt;br /&gt;
     To run the example, execute the following command. The  &amp;quot;-K&amp;quot; causes the lock file to be ignored.&lt;br /&gt;
&lt;br /&gt;
            $ cfagent -vK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 167:&lt;br /&gt;
&lt;br /&gt;
     Implementing Disk Quotas - a quick example that can easily be done on a live system for testing. There&lt;br /&gt;
     is no need to reboot, since you'll be creating a virtual filesystem.&lt;br /&gt;
&lt;br /&gt;
     Do the following as root. First create a mount point.&lt;br /&gt;
&lt;br /&gt;
            # mkdir -p /quota&lt;br /&gt;
&lt;br /&gt;
     Next, create 20M file. Since I have many of these files, I created a special directory &amp;quot;/usr/disk-img&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            # mkdir -p /usr/disk-img&lt;br /&gt;
            # dd if=/dev/zero of=/usr/disk-img/disk-quota.ext3 count=40960&lt;br /&gt;
&lt;br /&gt;
     The dd command above create a 20 MB file because, by default, dd uses a block size of 512 bytes. That makes&lt;br /&gt;
     the size: 40960*512=20971520.&lt;br /&gt;
&lt;br /&gt;
     Next, format this as an ext3 filesystem&lt;br /&gt;
&lt;br /&gt;
            # /sbin/mkfs -t ext3 -q /usr/disk-img/disk-quota.ext3 -F&lt;br /&gt;
&lt;br /&gt;
     Add the following line to &amp;quot;/etc/fstab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            /usr/disk-img/disk-quota.ext3    /quota ext3    rw,loop,usrquota,grpquota  0 0&lt;br /&gt;
&lt;br /&gt;
     Now, mount this filesystem&lt;br /&gt;
&lt;br /&gt;
            # mount /quota&lt;br /&gt;
&lt;br /&gt;
     Take a look at it:&lt;br /&gt;
&lt;br /&gt;
            # ls -l /quota&lt;br /&gt;
            lost+found&lt;br /&gt;
&lt;br /&gt;
     Now, run &amp;quot;quotacheck&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            # quotacheck -vug /quota&lt;br /&gt;
&lt;br /&gt;
     You'll get errors the first time this is run, because you have no quota files.&lt;br /&gt;
     But, run it a second time and you'll see something similiar to the following:&lt;br /&gt;
&lt;br /&gt;
            # quotacheck -vug /quota&lt;br /&gt;
            quotacheck: Scanning /dev/loop2 [/quota] done&lt;br /&gt;
            quotacheck: Checked 3 directories and 4 files&lt;br /&gt;
&lt;br /&gt;
     Now take a look at the files:&lt;br /&gt;
&lt;br /&gt;
            # ls -l /quota&lt;br /&gt;
            total 26&lt;br /&gt;
            -rw-------  1 root root  6144 Jun 14 12:23 aquota.group&lt;br /&gt;
            -rw-------  1 root root  6144 Jun 14 12:23 aquota.user&lt;br /&gt;
            drwx------  2 root root 12288 Jun 14 12:18 lost+found&lt;br /&gt;
&lt;br /&gt;
     Next use &amp;quot;edquota&amp;quot; to grant the user &amp;quot;chirico&amp;quot; a certain quota&lt;br /&gt;
&lt;br /&gt;
            # edquota -f /quota chirico&lt;br /&gt;
&lt;br /&gt;
     This will bring up a menu, and here I have edited so that user &amp;quot;chirico&amp;quot;&lt;br /&gt;
     has a soft limit of 120*512=61K, and a soft limit of 2 inodes and a hard limit of 5.&lt;br /&gt;
&lt;br /&gt;
             Disk quotas for user chirico (uid 500):&lt;br /&gt;
             Filesystem                   blocks       soft       hard     inodes     soft     hard&lt;br /&gt;
             /dev/loop2                        2        120        150         1        2         3&lt;br /&gt;
&lt;br /&gt;
     Next, turn quotas on with the following command:&lt;br /&gt;
&lt;br /&gt;
             $ quotaon /quota&lt;br /&gt;
&lt;br /&gt;
     If you need to turn off quotas, the command is &amp;quot;quotaoff -a&amp;quot; for all filesystems. You'll run into&lt;br /&gt;
     errors if you try to run quotacheck, say &amp;quot;quotacheck -avug&amp;quot; because this tries to unmount and mount&lt;br /&gt;
     the filesystem. You need to turn off quotas first &amp;quot;quotaoff /quota&amp;quot;. Note you only need to run&lt;br /&gt;
     quotacheck once, or when doing maintenance after a system crash.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      To get a report on the quote, runn &amp;quot;repquota&amp;quot; as follows:&lt;br /&gt;
&lt;br /&gt;
           $ repquota /quota&lt;br /&gt;
            *** Report for user quotas on device /dev/loop0&lt;br /&gt;
            Block grace time: 7days; Inode grace time: 7days&lt;br /&gt;
                                    Block limits                File limits&lt;br /&gt;
            User            used    soft    hard  grace    used  soft  hard  grace&lt;br /&gt;
            ----------------------------------------------------------------------&lt;br /&gt;
            root      --    1189       0       0              2     0     0&lt;br /&gt;
            chirico   -+      93       0       0              4     2     5  6days&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Note above that user &amp;quot;chirico&amp;quot; has used 4 on the file limits. This user has a hard&lt;br /&gt;
      limit of 5. So when this user tries to create 2 more files (bring this over the limit of 5)&lt;br /&gt;
      then he will get the following error as demonstrated below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           [chirico@squeezel chirico]$ touch one&lt;br /&gt;
           [chirico@squeezel chirico]$ touch two&lt;br /&gt;
           loop0: write failed, user file limit reached.&lt;br /&gt;
           touch: cannot touch `two': Disk quota exceeded&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Now, if repquota (run by root) is executed it shows the following:&lt;br /&gt;
&lt;br /&gt;
           $ repquota /quota&lt;br /&gt;
           *** Report for user quotas on device /dev/loop0&lt;br /&gt;
           Block grace time: 7days; Inode grace time: 7days&lt;br /&gt;
                                   Block limits                File limits&lt;br /&gt;
           User            used    soft    hard  grace    used  soft  hard  grace&lt;br /&gt;
           ----------------------------------------------------------------------&lt;br /&gt;
           root      --    1189       0       0              2     0     0&lt;br /&gt;
           chirico   -+      94       0       0              5     2     5  6days&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Note the &amp;quot;+&amp;quot; sign above. User &amp;quot;chirico&amp;quot; is above the File soft limits, and in this case&lt;br /&gt;
      above the hard limits.&lt;br /&gt;
&lt;br /&gt;
      To warn user by sending email to them, run &amp;quot;warnquota&amp;quot;, but you need check that&lt;br /&gt;
      &amp;quot;/etc/warnquota.conf&amp;quot; is setup correctly. For the example above, this file should&lt;br /&gt;
      look as follows:&lt;br /&gt;
&lt;br /&gt;
            $ cat /etc/quotatab&lt;br /&gt;
            #&lt;br /&gt;
            #  This is sample quotatab (/etc/quotatab)&lt;br /&gt;
            #  Here you can specify description of each device for user&lt;br /&gt;
            #&lt;br /&gt;
            #  Comments begin with hash in the beginning of the line&lt;br /&gt;
&lt;br /&gt;
            # Example of description&lt;br /&gt;
            /dev/loop0: This is loopback device&lt;br /&gt;
&lt;br /&gt;
      Just run the following as root:&lt;br /&gt;
&lt;br /&gt;
            $ warnquota&lt;br /&gt;
&lt;br /&gt;
      By the way, if you want to change the grace period, it can only be done on a filesystem&lt;br /&gt;
      basis. Not per user.&lt;br /&gt;
&lt;br /&gt;
            $  edquota -t&lt;br /&gt;
&lt;br /&gt;
      Users can run &amp;quot;quota&amp;quot; to see their usage as follows:&lt;br /&gt;
&lt;br /&gt;
            [chirico@squeezel ~]$ quota&lt;br /&gt;
            Disk quotas for user chirico (uid 500):&lt;br /&gt;
                 Filesystem  blocks   quota   limit   grace   files   quota   limit   grace&lt;br /&gt;
                 /dev/loop0      94       0       0               5      10      50&lt;br /&gt;
&lt;br /&gt;
      As you can see from above, I changed my inode limit to 50.&lt;br /&gt;
&lt;br /&gt;
      What about running this on the whole filesystem? Yes, below is an example where I'm running&lt;br /&gt;
      this on FC3, on the root of the filesystem &amp;quot;/&amp;quot;. This assumes that you have installed the&lt;br /&gt;
      quota package. Try doing &amp;quot;rpm -q quota&amp;quot; to see if this package is installed.&lt;br /&gt;
&lt;br /&gt;
        Step 1:&lt;br /&gt;
&lt;br /&gt;
           Check to make sure the quota software is installed. You can either do a &amp;quot;whereis quota&amp;quot;,&lt;br /&gt;
           or check for the rpm package.&lt;br /&gt;
&lt;br /&gt;
             $ whereis quota&lt;br /&gt;
             whereis quota&lt;br /&gt;
             quota: /usr/bin/quota /usr/share/man/man1/quota.1.gz&lt;br /&gt;
&lt;br /&gt;
           Checking for the rpm package.&lt;br /&gt;
&lt;br /&gt;
            $ rpm -q quota&lt;br /&gt;
            quota-3.12-5&lt;br /&gt;
&lt;br /&gt;
        Step 2:&lt;br /&gt;
&lt;br /&gt;
           Edit /etc/fstab and add usrquota and grpquota options for &amp;quot;/dev/VolGroup00/LogVol00&amp;quot;,&lt;br /&gt;
           which is shown on the first line below:&lt;br /&gt;
&lt;br /&gt;
             /dev/VolGroup00/LogVol00 /                      ext3    defaults,usrquota,grpquota        1 1&lt;br /&gt;
             LABEL=/boot             /boot                   ext3    defaults        1 2&lt;br /&gt;
             none                    /dev/pts                devpts  gid=5,mode=620  0 0&lt;br /&gt;
             none                    /dev/shm                tmpfs   defaults        0 0&lt;br /&gt;
             none                    /proc                   proc    defaults        0 0&lt;br /&gt;
             none                    /sys                    sysfs   defaults        0 0&lt;br /&gt;
             /dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0&lt;br /&gt;
&lt;br /&gt;
        Step 3:&lt;br /&gt;
&lt;br /&gt;
           Remount the filesystem as follows:&lt;br /&gt;
&lt;br /&gt;
             $ mount -o remount /&lt;br /&gt;
&lt;br /&gt;
        Step 4:&lt;br /&gt;
&lt;br /&gt;
           Run quotacheck with the &amp;quot;-m&amp;quot; option. Like the above statement, this will have to be run with&lt;br /&gt;
           root priviliges. This creates the quota database files, and it can take a long time if it is&lt;br /&gt;
           a large full filesystem.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             $ quotacheck -cugm /&lt;br /&gt;
&lt;br /&gt;
        Step 5:&lt;br /&gt;
&lt;br /&gt;
           This step is optional, but it's good to know if you need to recalculate quotas because of a&lt;br /&gt;
           system crash. It's demonstrated here, because at this point quota's have not been turned on.&lt;br /&gt;
           Again, note the &amp;quot;m&amp;quot; option below.&lt;br /&gt;
&lt;br /&gt;
             $ quotacheck -avumg&lt;br /&gt;
&lt;br /&gt;
        Step 6:&lt;br /&gt;
&lt;br /&gt;
           Set limits for specific users or groups using the &amp;quot;edquota&amp;quot; command. Shown below is the command&lt;br /&gt;
           to setup quotas for user &amp;quot;chirico&amp;quot;. Shown below this user has used 161560 blocks, he has a soft&lt;br /&gt;
           limit of 1161560 and a hard limit of 900000. He has used 3085 inodes and has a soft limit of 10000&lt;br /&gt;
           and a hard limit of 12000.&lt;br /&gt;
&lt;br /&gt;
             $ edquota -f / chirico&lt;br /&gt;
&lt;br /&gt;
             Disk quotas for user chirico (uid 500):&lt;br /&gt;
               Filesystem                   blocks       soft       hard     inodes     soft     hard&lt;br /&gt;
               /dev/mapper/VolGroup00-LogVol00     161560    1161560     900000       3085    10000    12000&lt;br /&gt;
&lt;br /&gt;
           You can put quotas on groups as well. The following is done as root. See (TIP 186 and TIP 6) for creating&lt;br /&gt;
           groups and adding users to groups.&lt;br /&gt;
&lt;br /&gt;
             $ edquota -g share&lt;br /&gt;
&lt;br /&gt;
           If you create a sharable directory for anyone in the group &amp;quot;share&amp;quot; (TIP 6), quota restrictions against&lt;br /&gt;
           group &amp;quot;share&amp;quot; will only apply to files added in the &amp;quot;/home/share&amp;quot; directory. When user &amp;quot;chirico&amp;quot; creates&lt;br /&gt;
           files in &amp;quot;/home/share&amp;quot; they also go against this user quota as well. However, when files are created in&lt;br /&gt;
           his home directory they do not go against the &amp;quot;share&amp;quot; group.&lt;br /&gt;
&lt;br /&gt;
           Note - if you get errors when trying to run &amp;quot;edquota -g share&amp;quot;, turn quotas off &amp;quot;quotaoff /&amp;quot; and&lt;br /&gt;
                  run &amp;quot;quotacheck -avugm&amp;quot;. Then, turn the quotas back on &amp;quot;quotaon /&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           You can see the status of the group quota with the following command:&lt;br /&gt;
&lt;br /&gt;
             $ quota -g share&lt;br /&gt;
&lt;br /&gt;
        Step 7:&lt;br /&gt;
&lt;br /&gt;
           Turn on quotas with the &amp;quot;qutoaon&amp;quot; command. This command needs to be done with root privileges.&lt;br /&gt;
&lt;br /&gt;
             $ quotaon /&lt;br /&gt;
&lt;br /&gt;
        Step 8:&lt;br /&gt;
&lt;br /&gt;
           Check &amp;quot;/etc/quotatab&amp;quot; file for the correct entries. Note that when you do the &amp;quot;mount&amp;quot; command&lt;br /&gt;
           the filesystem returned needs to match what is in the &amp;quot;quotatab&amp;quot; file. I have noticed that this&lt;br /&gt;
           is not the case by default.&lt;br /&gt;
&lt;br /&gt;
             $ mount&lt;br /&gt;
             /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw,usrquota,grpquota)&lt;br /&gt;
&lt;br /&gt;
           So the &amp;quot;/etc/quotatab&amp;quot; must contain the following line.&lt;br /&gt;
&lt;br /&gt;
             /dev/mapper/VolGroup00-LogVol00: This is the Volume group&lt;br /&gt;
&lt;br /&gt;
        Step 9:&lt;br /&gt;
&lt;br /&gt;
           Run &amp;quot;warnquota&amp;quot; as a check that the &amp;quot;/etc/quotatab&amp;quot; files is setup correctly.&lt;br /&gt;
&lt;br /&gt;
              $ warnquota&lt;br /&gt;
&lt;br /&gt;
        Step 10:&lt;br /&gt;
&lt;br /&gt;
           Setup a daily cron job for running &amp;quot;warnquota&amp;quot;. The following should be placed&lt;br /&gt;
           in &amp;quot;/etc/cron.daily&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              #!/bin/sh&lt;br /&gt;
              # Place this file in /etc/cron.daily&lt;br /&gt;
              # with rights 0755&lt;br /&gt;
              /usr/sbin/warnquota&lt;br /&gt;
              EXITVALUE=$?&lt;br /&gt;
              if [ $EXITVALUE != 0 ]; then&lt;br /&gt;
                 /usr/bin/logger -t warnquota &amp;quot;ALERT exited abnormally with [$EXITVALUE]&amp;quot;&lt;br /&gt;
              fi&lt;br /&gt;
              exit 0&lt;br /&gt;
&lt;br /&gt;
      References:&lt;br /&gt;
        http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/sysadmin-guide/ch-disk-quotas.html&lt;br /&gt;
        (TIP 6, TIP 186, and TIP 205)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 168:&lt;br /&gt;
&lt;br /&gt;
     rdist - remote file distribution client program. You can use this program in combination with&lt;br /&gt;
     ssh. This program does more than just copy files. Once a file has been copied, you can dictate&lt;br /&gt;
     other actions to be performed. Or you can hold off copying all together if the destination is&lt;br /&gt;
     running low on inodes, or disk space.&lt;br /&gt;
&lt;br /&gt;
     For the purpose of this example, all commands will been run on &amp;quot;squeezel.squeezel.com&amp;quot;, and the&lt;br /&gt;
     computers that will be updated are &amp;quot;tape.squeezel.com&amp;quot; and &amp;quot;closet.squeezel.com&amp;quot;. Obviously, you&lt;br /&gt;
     would substitute your computer names.&lt;br /&gt;
&lt;br /&gt;
     It helps to setup ssh keys on each computer first. Reference [http://souptonuts.sourceforge.net/sshtips.htm]&lt;br /&gt;
     and (TIP 12).&lt;br /&gt;
&lt;br /&gt;
     Step 1: Create the Configuration file myDistfile&lt;br /&gt;
&lt;br /&gt;
       Below is my sample &amp;quot;myDistfile&amp;quot;. This file will access hosts &amp;quot;tape.squeezel.com&amp;quot; using username chirico&lt;br /&gt;
       and &amp;quot;closet.squeezel.com&amp;quot; with the username running this command, and copy the&lt;br /&gt;
       files &amp;quot;/home/chirico/file1&amp;quot; and &amp;quot;/home/chirico/file2&amp;quot; to the these two servers creating the&lt;br /&gt;
       directory ~/tmpdir if it doesn't exist. Once these files are updated, a mail check (&amp;quot;sendmail -bv&amp;quot;)&lt;br /&gt;
       will be performed, and mail will be sent to &amp;quot;chirico@squeezel&amp;quot;. This happens twice, once for each file.&lt;br /&gt;
&lt;br /&gt;
       Note, the line &amp;quot;/home/chirico/file2 -&amp;gt; tape.squeezel.com&amp;quot; which moves the file &amp;quot;file2&amp;quot; to&lt;br /&gt;
       tape.squeezel.com renaming the file to &amp;quot;tapedest&amp;quot; in the directory &amp;quot;/home/chirico&amp;quot;. Once this file&lt;br /&gt;
       is copied, the rights are modified to &amp;quot;chmod +r&amp;quot;.  Likewise, &amp;quot;/home/chirico/file2 -&amp;gt; closet.squeezel.com&amp;quot;&lt;br /&gt;
       copies the file file2, which is renamed as closetdest.&lt;br /&gt;
&lt;br /&gt;
                 # Contents of myDistfile&lt;br /&gt;
                 HOSTS = ( chirico@tape.squeezel.com closet.squeezel.com )&lt;br /&gt;
&lt;br /&gt;
                 FILES = ( /home/chirico/file1 /home/chirico/file2 )&lt;br /&gt;
&lt;br /&gt;
                 ${FILES} -&amp;gt; ${HOSTS}&lt;br /&gt;
                    # Directory tmpdir will be created if it doesn't exist&lt;br /&gt;
                    install tmpdir ;&lt;br /&gt;
                    special /home/chirico/file1  &amp;quot;/usr/sbin/sendmail -bv mchirico@gmail.com&amp;quot;;&lt;br /&gt;
                    notify chirico@squeezel;&lt;br /&gt;
&lt;br /&gt;
                 /home/chirico/file2 -&amp;gt; tape.squeezel.com&lt;br /&gt;
                    install  /home/chirico/tapedest;&lt;br /&gt;
                    special  /home/chirico/tapedest &amp;quot;chmod +r /home/chirico/tapedest&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
                 /home/chirico/file2 -&amp;gt; closet.squeezel.com&lt;br /&gt;
                    install /home/chirico/closetdest;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 2: Command from squeezel.squeezel.com to run myDistfile above&lt;br /&gt;
&lt;br /&gt;
       Below is the command that will execute the contents in &amp;quot;myDistfile&amp;quot;. This command is run from the&lt;br /&gt;
       computer &amp;quot;squeezel.squeezel.com&amp;quot;. All output will go in the file &amp;quot;cmd1rdist.log&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ rdist -P /usr/local/bin/ssh -f ./myDistfile -l file=./cmd1rdist.log=all&lt;br /&gt;
&lt;br /&gt;
       Obviously you want a secure copy (using scp), so the -P option uses ssh as your secure&lt;br /&gt;
       transport mechanism.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 169:&lt;br /&gt;
&lt;br /&gt;
     Restricting root logins (/etc/securetty). ctl-alt-F4 will give you a prompt for tty3. Note&lt;br /&gt;
     that it is one number less. Take a look at the contents of &amp;quot;/etc/securetty&amp;quot;. To prevent&lt;br /&gt;
     root from logging in on this device, take out tty3 from this listing. Note, you can always&lt;br /&gt;
     login as another user, then, su to root.  Below is an example of the default&lt;br /&gt;
     &amp;quot;/etc/securetty&amp;quot; that allows root to login to everything.&lt;br /&gt;
&lt;br /&gt;
         [root@squeezel ~]# cat /etc/securetty&lt;br /&gt;
         console&lt;br /&gt;
         vc/1&lt;br /&gt;
         vc/2&lt;br /&gt;
         vc/3&lt;br /&gt;
         vc/4&lt;br /&gt;
         vc/5&lt;br /&gt;
         vc/6&lt;br /&gt;
         vc/7&lt;br /&gt;
         vc/8&lt;br /&gt;
         vc/9&lt;br /&gt;
         vc/10&lt;br /&gt;
         vc/11&lt;br /&gt;
         tty1&lt;br /&gt;
         tty2&lt;br /&gt;
         tty3&lt;br /&gt;
         tty4&lt;br /&gt;
         tty5&lt;br /&gt;
         tty6&lt;br /&gt;
         tty7&lt;br /&gt;
         tty8&lt;br /&gt;
         tty9&lt;br /&gt;
         tty10&lt;br /&gt;
         tty11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 170:&lt;br /&gt;
&lt;br /&gt;
     Perl map function. Try the following to get a quick take on this function,&lt;br /&gt;
     which increments each value in the array a;&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map {$_++} @a;&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot; } @a;&lt;br /&gt;
&lt;br /&gt;
     or&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     And you can easily make modifications, like reversing the order&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     Plus there is a grep() function that works on each element as well&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse grep{ $_ &amp;gt; 3} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     To get only odd numbers in reverse order:&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse grep{ !($_ % 2)} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference: http://www-128.ibm.com/developerworks/linux/library/l-road4.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 171:&lt;br /&gt;
&lt;br /&gt;
     Perl - subroutine call and shifting through variables. A simple and useful&lt;br /&gt;
     technique.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          sub test {&lt;br /&gt;
            local $mval;&lt;br /&gt;
            while( $mval = shift ) {&lt;br /&gt;
              print &amp;quot; $mval\n&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          test(&amp;quot;one&amp;quot;,&amp;quot;two&amp;quot;,&amp;quot;three&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 172:&lt;br /&gt;
&lt;br /&gt;
     Tcp wrappers - First &amp;quot;/etc/hosts.allow&amp;quot; is check, and if there is an entry in this file, no more&lt;br /&gt;
     checking it done.  If are no matches in &amp;quot;/etc/hosts.allow&amp;quot;, the &amp;quot;/etc/hosts.deny&amp;quot; file is checked&lt;br /&gt;
     and if a match is found, that service is blocked for that host.&lt;br /&gt;
&lt;br /&gt;
     Example &amp;quot;/etc/hosts.deny&amp;quot; file:&lt;br /&gt;
&lt;br /&gt;
         sshd: 192.168.1.171&lt;br /&gt;
&lt;br /&gt;
     The above file blocks access to computer 192.168.1.171. It's also possible to run commands when&lt;br /&gt;
     someone from this computer tries to ssh in. This example sends mail.&lt;br /&gt;
&lt;br /&gt;
         sshd: 192.168.1.171: spawn (echo -e &amp;quot;%d %h %H %u&amp;quot;| /bin/mail -s 'hosts.deny entry' root)&lt;br /&gt;
&lt;br /&gt;
     Of course, you can also run commands in the &amp;quot;/etc/hosts.allow&amp;quot; if you wanted mail sent for a successful&lt;br /&gt;
     login.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 173:&lt;br /&gt;
&lt;br /&gt;
     pgrep, pkill - look up or signal process based on name and other attributes.&lt;br /&gt;
&lt;br /&gt;
     To quick find all instances of ssh running, for user root, execute the following&lt;br /&gt;
     command:&lt;br /&gt;
&lt;br /&gt;
           $ pgrep -u root -l ssh&lt;br /&gt;
&lt;br /&gt;
     To kill a process, or send a signal use the &amp;quot;pkill&amp;quot; option. For example, to&lt;br /&gt;
     make syslog reread its configuration file:&lt;br /&gt;
&lt;br /&gt;
           $ pkill -HUP syslogd&lt;br /&gt;
&lt;br /&gt;
     Another command command is &amp;quot;pidof&amp;quot; that can tell you how many processes are running.&lt;br /&gt;
     This can be useful for detecting DOS attacks.&lt;br /&gt;
&lt;br /&gt;
           $ pidof sshd&lt;br /&gt;
           4783 4781 30008 30006 29888 29886 2246&lt;br /&gt;
&lt;br /&gt;
     Above there are 7 sshd's running. Reference &amp;quot;Tcpdump, Raw Socket and Libpap Tutorial&amp;quot;&lt;br /&gt;
     at [http://souptonuts.sourceforge.net/tcpdump_tutorial.html].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 174:&lt;br /&gt;
&lt;br /&gt;
     Password Cracking - tools to check your users passwords:&lt;br /&gt;
&lt;br /&gt;
      John The Ripper&lt;br /&gt;
        http://www.openwall.com/john/&lt;br /&gt;
&lt;br /&gt;
      Crack&lt;br /&gt;
        http://www.crypticide.com/users/alecm/&lt;br /&gt;
&lt;br /&gt;
      Slurpie&lt;br /&gt;
        http://www.ussrback.com/distributed.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 175:&lt;br /&gt;
&lt;br /&gt;
     Password Aging - setting the number of days a password is valid.&lt;br /&gt;
&lt;br /&gt;
         $ chage -M 90 &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 176:&lt;br /&gt;
&lt;br /&gt;
     Kernel Performance Tuning - /Documentation/sysctl/vm.txt documents kernel settings to&lt;br /&gt;
     improve performance. Below are some examples.&lt;br /&gt;
&lt;br /&gt;
       overcommit_memory:  0 -- default estimates the amount of memory for malloc&lt;br /&gt;
                           1 -- kernel pretends there is always enough memory until it runs out&lt;br /&gt;
                           3 -- never overcommit&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/overcommit_memory&lt;br /&gt;
          0&lt;br /&gt;
&lt;br /&gt;
       page-cluster:&lt;br /&gt;
            The Linux VM subsystem avoids excessive disk seeks by reading&lt;br /&gt;
            multiple pages on a page fault. The number of pages it reads&lt;br /&gt;
            is dependent on the amount of memory in your machine.&lt;br /&gt;
        &lt;br /&gt;
            The number of pages the kernel reads in at once is equal to&lt;br /&gt;
            2 ^ page-cluster. Values above 2 ^ 5 don't make much sense&lt;br /&gt;
            for swap because we only cluster swap data in 32-page groups.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/page-cluster&lt;br /&gt;
          3&lt;br /&gt;
&lt;br /&gt;
       min_free_kbytes:&lt;br /&gt;
            This is used to force the Linux VM to keep a minimum number&lt;br /&gt;
            of kilobytes free.  The VM uses this number to compute a pages_min&lt;br /&gt;
            value for each lowmem zone in the system.  Each lowmem zone gets&lt;br /&gt;
            a number of reserved free pages based proportionally on its size.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/min_free_kbytes&lt;br /&gt;
          3831&lt;br /&gt;
&lt;br /&gt;
       max_map_count:&lt;br /&gt;
            This file contains the maximum number of memory map areas a process&lt;br /&gt;
            may have. Memory map areas are used as a side-effect of calling&lt;br /&gt;
            malloc, directly by mmap and mprotect, and also when loading shared&lt;br /&gt;
            libraries.&lt;br /&gt;
&lt;br /&gt;
            While most applications need less than a thousand maps, certain&lt;br /&gt;
            programs, particularly malloc debuggers, may consume lots of them,&lt;br /&gt;
            e.g., up to one or two maps per allocation.&lt;br /&gt;
&lt;br /&gt;
            The default value is 65536.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/max_map_count&lt;br /&gt;
          65536&lt;br /&gt;
&lt;br /&gt;
        Also see http://people.redhat.com/alikins/system_tuning.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 177:&lt;br /&gt;
&lt;br /&gt;
     IO Scheduler - /Documentation/block/as-iosched.txt documents kernel settings for disk&lt;br /&gt;
     performance.&lt;br /&gt;
&lt;br /&gt;
     If you're not sure what partitions you have &amp;quot;$ cat /proc/partitions&amp;quot;. This example&lt;br /&gt;
     assumes hda, and you can see some of the kernel settings:&lt;br /&gt;
&lt;br /&gt;
          $ ls /sys/block/hda/queue/iosched&lt;br /&gt;
          back_seek_max  back_seek_penalty  clear_elapsed  fifo_batch_expire  fifo_expire_async&lt;br /&gt;
           fifo_expire_sync  find_best_crq  key_type  quantum  queued&lt;br /&gt;
&lt;br /&gt;
     References: http://lwn.net/Articles/102505/&lt;br /&gt;
                 http://bhhdoa.org.au/pipermail/ck/2004-September/000961.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 178:&lt;br /&gt;
&lt;br /&gt;
     iozone -- getting data on disk performance (http://www.iozone.org/). This is a very&lt;br /&gt;
     comprehensive package.&lt;br /&gt;
&lt;br /&gt;
           $ wget http://www.iozone.org/src/current/iozone3_242.tar&lt;br /&gt;
           $ tar -xf iozone3_242.tar&lt;br /&gt;
           $ cd iozone3_242/src/current&lt;br /&gt;
           $ make linux&lt;br /&gt;
&lt;br /&gt;
     At this point you should read the documentation. There is no &amp;quot;make install&amp;quot;. You&lt;br /&gt;
     copy it to each filesystem you want to run this program on. Below are some quick&lt;br /&gt;
     start commands.&lt;br /&gt;
&lt;br /&gt;
       Good comprehensive test.&lt;br /&gt;
&lt;br /&gt;
           $ iozone -a&lt;br /&gt;
&lt;br /&gt;
       I prefer this for small filesystems. It limits the record size to 10000 and does&lt;br /&gt;
       the output in operations per second (higher numbers mean faster drive).&lt;br /&gt;
&lt;br /&gt;
           $ ./iozone -a -s 10000 -O&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 179:&lt;br /&gt;
&lt;br /&gt;
     history - bash command to get a history of all commands typed. But, here is a way&lt;br /&gt;
     that you can get date and time listed as well.&lt;br /&gt;
&lt;br /&gt;
           $ HISTTIMEFORMAT=&amp;quot;%y/%m/%d %T &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Defining the environment variable above give you the date/time info when you&lt;br /&gt;
     execute history:&lt;br /&gt;
&lt;br /&gt;
           $ history&lt;br /&gt;
              ...&lt;br /&gt;
               175  05/06/30 12:51:46 grep '141.162.' mout &amp;gt; mout2&lt;br /&gt;
               176  05/06/30 12:51:48 e mout2&lt;br /&gt;
               177  05/06/30 12:56:59 ls&lt;br /&gt;
               178  05/06/30 12:57:02 ls&lt;br /&gt;
               179  05/06/30 12:57:39 ls&lt;br /&gt;
               180  05/06/30 12:57:49 ls -l&lt;br /&gt;
               181  05/06/30 13:01:10 history&lt;br /&gt;
               182  05/06/30 13:01:20 HISTTIMEFORMAT=&amp;quot;%y/%m/%d %T &amp;quot;&lt;br /&gt;
               183  05/06/30 13:01:23 history&lt;br /&gt;
              ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 180:&lt;br /&gt;
&lt;br /&gt;
     .config - Fedora Core getting the .config to rebuild the kernel. You can find&lt;br /&gt;
     this file, the &amp;quot;.config&amp;quot; file at the following location:&lt;br /&gt;
&lt;br /&gt;
          $ ls &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Or, to see the contents&lt;br /&gt;
&lt;br /&gt;
          $ cat &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     This can be important, if you're planning to build your own kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 181:&lt;br /&gt;
&lt;br /&gt;
     Listing control key settings.&lt;br /&gt;
&lt;br /&gt;
          $ stty -a&lt;br /&gt;
          speed 38400 baud; rows 0; columns 0; line = 0;&lt;br /&gt;
          intr = ^C; quit = ^\; erase = &amp;lt;undef&amp;gt;; kill = &amp;lt;undef&amp;gt;; eof = ^D; eol = &amp;lt;undef&amp;gt;; eol2 = &amp;lt;undef&amp;gt;; start = ^Q;&lt;br /&gt;
          stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;&lt;br /&gt;
          -parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts&lt;br /&gt;
          -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel&lt;br /&gt;
          opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0&lt;br /&gt;
          isig icanon iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 182:&lt;br /&gt;
&lt;br /&gt;
     iptables DNAT and SNAT. You have a webserver on 192.168.1.71. When people query this webserver, you want them&lt;br /&gt;
     to goto 192.168.1.81, with no indication that they are going to another web server. In fact, they always make&lt;br /&gt;
     their web hits to 192.168.1.71.&lt;br /&gt;
&lt;br /&gt;
     The following is the iptables commands:&lt;br /&gt;
&lt;br /&gt;
        $ echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
        $ iptables -t nat -A PREROUTING -d 192.168.1.71 -p tcp --dport 80 -j DNAT --to 192.168.1.81&lt;br /&gt;
        $ iptables -t nat -A POSTROUTING -d 192.168.1.81 -s 192.168.1.0/24 -p tcp --dport 80 -j SNAT --to 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
     Change 192.168.1.0/24 to whatever source you expect the web browser to come in on. Below is the tcpdump showing&lt;br /&gt;
     all traffic is relayed via 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
         [root@closet iptables]# tcpdump -nN port 80&lt;br /&gt;
&lt;br /&gt;
         17:34:58.790398 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: S 3620106373:3620106373(0) win 16384 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790465 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: S 3620106373:3620106373(0) win 16384 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790703 IP 192.168.1.81.80 &amp;gt; 192.168.1.71.1158: S 1973665156:1973665156(0) ack 3620106374 win 5840 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790720 IP 192.168.1.71.80 &amp;gt; 192.168.1.102.1158: S 1973665156:1973665156(0) ack 3620106374 win 5840 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790951 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: . ack 1 win 17520&lt;br /&gt;
         17:34:58.790965 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: . ack 1 win 17520&lt;br /&gt;
         17:34:58.791451 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: P 1:327(326) ack 1 win 17520&lt;br /&gt;
         17:34:58.791472 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: P 1:327(326) ack 1 win 17520&lt;br /&gt;
         17:34:58.791973 IP 192.168.1.81.80 &amp;gt; 192.168.1.71.1158: . ack 327 win 6432&lt;br /&gt;
&lt;br /&gt;
     Above the web client is on &amp;quot;192.168.1.102&amp;quot;. You can see that the 1st server &amp;quot;192.168.1.71&amp;quot; then goes out to&lt;br /&gt;
     the 2nd server &amp;quot;192.168.1.81&amp;quot; on the second line. The third line shows the 2nd server &amp;quot;192.168.1.81&amp;quot; responding to&lt;br /&gt;
     the 1st server, and the forth line passes this data back to the web client &amp;quot;192.168.1.102&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Note: You can save your current iptables setting with the following command:&lt;br /&gt;
&lt;br /&gt;
         $ iptables-save &amp;gt; iptables_store&lt;br /&gt;
&lt;br /&gt;
       The big advantage is that you can store the counters as well.&lt;br /&gt;
&lt;br /&gt;
         $ iptables-save -c &amp;gt; iptables_store_w_cnts&lt;br /&gt;
&lt;br /&gt;
       To restore the file, use the following:&lt;br /&gt;
&lt;br /&gt;
         $ iptables-restore -c &amp;lt; iptables_store_w_cnts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 183:&lt;br /&gt;
&lt;br /&gt;
     mailstats - display mail statistics. This file reads data from &amp;quot;/var/log/mail/statistics&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         [root@closet ~]# mailstats&lt;br /&gt;
         Statistics from Sat Jun 25 15:59:52 2005&lt;br /&gt;
          M   msgsfr  bytes_from   msgsto    bytes_to  msgsrej msgsdis msgsqur  Mailer&lt;br /&gt;
          4        1          2K        0          0K        0       0       0  esmtp&lt;br /&gt;
          9        0          0K        1          2K        0       0       0  local&lt;br /&gt;
         =====================================================================&lt;br /&gt;
          T        1          2K        1          2K        0       0       0&lt;br /&gt;
          C        1                    0                    0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 184:&lt;br /&gt;
&lt;br /&gt;
     Profiling C Applications - Assume you have the following program p1.c:&lt;br /&gt;
&lt;br /&gt;
         /* Program  p1.c */&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
         t1(int i)&lt;br /&gt;
         {&lt;br /&gt;
                 printf(&amp;quot;t1:%d\n&amp;quot;, i);&lt;br /&gt;
         }&lt;br /&gt;
        &lt;br /&gt;
         t2(int j)&lt;br /&gt;
         {&lt;br /&gt;
                 printf(&amp;quot;t2:%d\n&amp;quot;, j);&lt;br /&gt;
         }&lt;br /&gt;
        &lt;br /&gt;
         int main(void)&lt;br /&gt;
         {&lt;br /&gt;
                 int i, j;&lt;br /&gt;
        &lt;br /&gt;
                 for (i = 0; i &amp;lt; 5; ++i) {&lt;br /&gt;
                         t1(i);&lt;br /&gt;
                         for (j = 0; j &amp;lt; 2; ++j) {&lt;br /&gt;
                                 t2(j);&lt;br /&gt;
                         }&lt;br /&gt;
                 }&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
     Compile the program as follows:&lt;br /&gt;
&lt;br /&gt;
        $ gcc -pg -g -o p1 p1.c&lt;br /&gt;
        $ ./p1&lt;br /&gt;
        t1:0&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:1&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:2&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:3&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:4&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
&lt;br /&gt;
     Next, to get the profile graph.&lt;br /&gt;
&lt;br /&gt;
        $ gprof -p -b p1&lt;br /&gt;
        Flat profile:&lt;br /&gt;
        &lt;br /&gt;
        Each sample counts as 0.01 seconds.&lt;br /&gt;
         no time accumulated&lt;br /&gt;
        &lt;br /&gt;
          %   cumulative   self              self     total&lt;br /&gt;
         time   seconds   seconds    calls  Ts/call  Ts/call  name&lt;br /&gt;
          0.00      0.00     0.00       10     0.00     0.00  t2&lt;br /&gt;
          0.00      0.00     0.00        5     0.00     0.00  t1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Above note the 10 calls to t2 and 5 calls to t1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 185:&lt;br /&gt;
&lt;br /&gt;
     CDPATH - this is a bash variable like PATH that defines a search path&lt;br /&gt;
              for the cd command.&lt;br /&gt;
&lt;br /&gt;
     Suppose you have the following directory structure:&lt;br /&gt;
&lt;br /&gt;
             /home/chirico/stuff&lt;br /&gt;
                               |-- dirA&lt;br /&gt;
                               `-- dirB&lt;br /&gt;
&lt;br /&gt;
     Assume you define CDPATH as follows:&lt;br /&gt;
&lt;br /&gt;
             CDPATH=/home/chirico/stuff&lt;br /&gt;
&lt;br /&gt;
     Now, no matter what directory you are in if you use the cd command below&lt;br /&gt;
     you will automatically move to &amp;quot;/home/chirico/stuff/dirA&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             $ cd dirA&lt;br /&gt;
&lt;br /&gt;
     Note you could be in &amp;quot;/etc&amp;quot; and will move directly to &amp;quot;/home/chirico/stuff/dirA&amp;quot;.&lt;br /&gt;
     This command has the same format as PATH - multiple entries are separated by a colon.&lt;br /&gt;
     If the current directory contain a sub-directory dirA, then, it gets priority.&lt;br /&gt;
&lt;br /&gt;
     The following is part of my .bash_profile&lt;br /&gt;
&lt;br /&gt;
             CDPATH=/work/cpearls/src/posted_on_sf/:/work/souptonuts/documentation/:/home/chirico/deleteme/&lt;br /&gt;
             export PATH CVS_RSH EDITOR JAVA_HOME CDPATH&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 186:&lt;br /&gt;
&lt;br /&gt;
     Groups - add groups and users to groups. The following shows how to create the group &amp;quot;share&amp;quot;&lt;br /&gt;
              and add the user &amp;quot;chirico&amp;quot; to this group. The following should be done as root, and&lt;br /&gt;
              assumes the account &amp;quot;chirico&amp;quot; already exits.&lt;br /&gt;
&lt;br /&gt;
             $ groupadd share&lt;br /&gt;
             $ usermod -G share chirico&lt;br /&gt;
&lt;br /&gt;
     Note the change made to &amp;quot;/etc/group&amp;quot; below:&lt;br /&gt;
&lt;br /&gt;
             $ cat /etc/group|grep 'share'&lt;br /&gt;
             share:x:616:chirico&lt;br /&gt;
&lt;br /&gt;
     If the user chirico is currently logged in, he should run the following&lt;br /&gt;
     command to immediately have group &amp;quot;share&amp;quot; rights. Or, the next time he logs&lt;br /&gt;
     in he will have access to this group.&lt;br /&gt;
&lt;br /&gt;
             $ newgrp share&lt;br /&gt;
&lt;br /&gt;
     Reference the following (TIP 6, TIP 167).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 187:&lt;br /&gt;
&lt;br /&gt;
     oprofile - steps for running oprofile on Fedora.&lt;br /&gt;
&lt;br /&gt;
     Step 1:&lt;br /&gt;
&lt;br /&gt;
       Find out what version of the kernel you are running.&lt;br /&gt;
&lt;br /&gt;
           $ uname -a&lt;br /&gt;
           Linux closet.squeezel.com 2.6.12-1.1398_FC4 #1 Fri Jul 15 00:52:32 EDT 2005 i686 i686 i386 GNU/Linux&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 2:&lt;br /&gt;
&lt;br /&gt;
       Download the source in a chosen directory. Above, I'm running 2.6.12-1, but I'm going to go for 2.6.12.3, since&lt;br /&gt;
       it's a little later. You want the signed file as well.&lt;br /&gt;
&lt;br /&gt;
           $ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.12.3.tar.gz&lt;br /&gt;
           $ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.12.3.tar.gz.sign&lt;br /&gt;
&lt;br /&gt;
       Now, check the signature.&lt;br /&gt;
&lt;br /&gt;
           $ gpg --verify linux-2.6.12.3.tar.gz.sign linux-2.6.12.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 3:&lt;br /&gt;
&lt;br /&gt;
       Unpack the file.&lt;br /&gt;
&lt;br /&gt;
           $ tar -xzf linux-2.6.12.3.tar.gz&lt;br /&gt;
           $ cd cd linux-2.6.12.3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 4:&lt;br /&gt;
&lt;br /&gt;
       Copy the &amp;quot;.config&amp;quot; used to compile your previous kernel. You should find it&lt;br /&gt;
       in the following direcotry &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       Copy it to the linux-2.6.12.3 directory.&lt;br /&gt;
&lt;br /&gt;
           $ cp &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot; .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 5:&lt;br /&gt;
&lt;br /&gt;
       Run make as follows. It will ask for a few questions on &amp;quot;make oldconfig&amp;quot;. The&lt;br /&gt;
       make installs below will have to be done with root privileges.&lt;br /&gt;
&lt;br /&gt;
          $ make oldconfig&lt;br /&gt;
          $ make bzImage&lt;br /&gt;
          $ make modules&lt;br /&gt;
          $ make modules_install&lt;br /&gt;
          $ make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 6:&lt;br /&gt;
&lt;br /&gt;
       Edit the &amp;quot;/boot/grub/grub.conf&amp;quot; and set default = 0  as shown below in this&lt;br /&gt;
       file.&lt;br /&gt;
&lt;br /&gt;
            default=0&lt;br /&gt;
            timeout=5&lt;br /&gt;
            splashimage=(hd0,2)/grub/splash.xpm.gz&lt;br /&gt;
            hiddenmenu&lt;br /&gt;
            title Fedora Core (2.6.12.3)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.12.3 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.12.3.img&lt;br /&gt;
            title Fedora Core (2.6.12-1.1398_FC4)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.12-1.1398_FC4 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.12-1.1398_FC4.img&lt;br /&gt;
            title Fedora Core (2.6.11-1.1369_FC4)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.11-1.1369_FC4 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.11-1.1369_FC4.img&lt;br /&gt;
            title Other&lt;br /&gt;
                    rootnoverify (hd0,1)&lt;br /&gt;
                    chainloader +1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 7:&lt;br /&gt;
&lt;br /&gt;
       Shutdown with the restart option.&lt;br /&gt;
&lt;br /&gt;
           $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 8:&lt;br /&gt;
&lt;br /&gt;
       Run opcontrol. The commands below are done as root.  My kernel was compiled in the following&lt;br /&gt;
       directory &amp;quot;/home/kernel/linux-2.6.12.3/&amp;quot;, so I'll run opcontrol as follows:&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --vmlinux=/home/kernel/linux-2.6.12.3/vmlinux&lt;br /&gt;
&lt;br /&gt;
       Now start.&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --start&lt;br /&gt;
           Using 2.6+ OProfile kernel interface.&lt;br /&gt;
           Reading module info.&lt;br /&gt;
           Using log file /var/lib/oprofile/oprofiled.log&lt;br /&gt;
           Daemon started.&lt;br /&gt;
           Profiler running.&lt;br /&gt;
&lt;br /&gt;
       Shutdown opcontrol.&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --shutdown&lt;br /&gt;
&lt;br /&gt;
       Run report.&lt;br /&gt;
&lt;br /&gt;
           $ opreport&lt;br /&gt;
&lt;br /&gt;
           CPU: CPU with timer interrupt, speed 0 MHz (estimated)&lt;br /&gt;
           Profiling through timer interrupt&lt;br /&gt;
                     TIMER:0|&lt;br /&gt;
             samples|      %|&lt;br /&gt;
           ------------------&lt;br /&gt;
              156088 99.8746 vmlinux&lt;br /&gt;
                  60  0.0384 libc-2.3.5.so&lt;br /&gt;
                  30  0.0192 oprofiled&lt;br /&gt;
                  23  0.0147 libcrypto.so.0.9.7f&lt;br /&gt;
                  13  0.0083 bash&lt;br /&gt;
                  12  0.0077 screen&lt;br /&gt;
                  10  0.0064 sshd&lt;br /&gt;
                   9  0.0058 ssh&lt;br /&gt;
                   6  0.0038 ip_tables&lt;br /&gt;
                   6  0.0038 libncurses.so.5.4&lt;br /&gt;
                   5  0.0032 b44&lt;br /&gt;
                   5  0.0032 ext3&lt;br /&gt;
                   5  0.0032 ld-2.3.5.so&lt;br /&gt;
                   4  0.0026 ip_conntrack&lt;br /&gt;
                   4  0.0026 jbd&lt;br /&gt;
                   2  0.0013 grep&lt;br /&gt;
                   1 6.4e-04 libdns.so.20.0.2&lt;br /&gt;
                   1 6.4e-04 libisc.so.9.1.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Reference the following for more documentation:&lt;br /&gt;
             http://oprofile.sourceforge.net/doc/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 188:&lt;br /&gt;
&lt;br /&gt;
     cyrus-imapd with Postfix using sasldb for authentication. For this example&lt;br /&gt;
     the server is tape.squeezel.com and the user is chirico.&lt;br /&gt;
&lt;br /&gt;
        Step 1:&lt;br /&gt;
        &lt;br /&gt;
                   $ yum install cyrus-imapd&lt;br /&gt;
                   $ yum install cyrus-imapd-utils&lt;br /&gt;
        &lt;br /&gt;
            You need &amp;quot;cyrus-imapd-utils&amp;quot; for cyradm.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 2:&lt;br /&gt;
        &lt;br /&gt;
          Edit /etc/imapd.conf&lt;br /&gt;
        &lt;br /&gt;
               configdirectory: /var/lib/imap&lt;br /&gt;
               partition-default: /var/spool/imap&lt;br /&gt;
               admins: cyrus&lt;br /&gt;
               sievedir: /var/lib/imap/sieve&lt;br /&gt;
               sendmail: /usr/sbin/sendmail&lt;br /&gt;
               hashimapspool: true&lt;br /&gt;
               # Chirico Commented the below line&lt;br /&gt;
               # sasl_pwcheck_method: saslauthd&lt;br /&gt;
               # Because using sasldb&lt;br /&gt;
               sasl_pwcheck_method: auxprop&lt;br /&gt;
               sasl_auxprop_plugin: sasldb&lt;br /&gt;
               #  Chirico end change&lt;br /&gt;
               sasl_mech_list: PLAIN&lt;br /&gt;
               tls_cert_file: /usr/share/ssl/certs/cyrus-imapd.pem&lt;br /&gt;
               tls_key_file: /usr/share/ssl/certs/cyrus-imapd.pem&lt;br /&gt;
               tls_ca_file: /usr/share/ssl/certs/ca-bundle.crt&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 3:&lt;br /&gt;
        &lt;br /&gt;
           Create a user and password:&lt;br /&gt;
        &lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` cyrus&lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` chirico&lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` allmail&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
           This will automatically create the file /etc/sasldb2. But look&lt;br /&gt;
           at the default rights, assuming you ran saslpasswd2 as root:&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /etc/sasldb2&lt;br /&gt;
                 -rw-r-----  1 root root 12288 Jul 31 09:50 /etc/sasldb2&lt;br /&gt;
        &lt;br /&gt;
           We need to correct this in step 4.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 4:&lt;br /&gt;
        &lt;br /&gt;
                 $ chown root.mail /etc/sasldb2&lt;br /&gt;
                 $ ls -l /etc/sasldb2&lt;br /&gt;
                 -rw-r-----  1 root mail 12288 Jul 31 09:50 /etc/sasldb2&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 5:&lt;br /&gt;
        &lt;br /&gt;
            Update &amp;quot;/etc/postfix/main.cf&amp;quot;. Note in /etc/imapd.conf the configdirectory&lt;br /&gt;
            points to /var/lib/imap, and if I look at this directory I see the&lt;br /&gt;
            socket directory. However, after staring /etc/init.d/cyrus-imapd  there&lt;br /&gt;
            will be a socket file &amp;quot;/var/lib/imap/socket/lmtp&amp;quot;. (See step 6).&lt;br /&gt;
        &lt;br /&gt;
                  mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp&lt;br /&gt;
                  mailbox_transport = cyrus&lt;br /&gt;
        &lt;br /&gt;
            Restart postfix.&lt;br /&gt;
        &lt;br /&gt;
                  /etc/init.d/postfix restart&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 6:&lt;br /&gt;
&lt;br /&gt;
            Start cyrus-imapd and look for the socket file.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
                   $ /etc/init.d/cyrus-imapd restart&lt;br /&gt;
                   Shutting down cyrus-imapd:                                 [  OK  ]&lt;br /&gt;
                   Starting cyrus-imapd: preparing databases... done.         [  OK  ]&lt;br /&gt;
        &lt;br /&gt;
            Now you should see the lmtp file:&lt;br /&gt;
        &lt;br /&gt;
                   $ ls -l /var/lib/imap/socket/lmtp&lt;br /&gt;
                   srwxrwxrwx  1 root root 0 Jul 31 10:04 /var/lib/imap/socket/lmtp&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 7:&lt;br /&gt;
        &lt;br /&gt;
            Add users. Note, you may have to go back to step 3 to add them to /etc/sasldb2&lt;br /&gt;
            as well.&lt;br /&gt;
        &lt;br /&gt;
                   $ su - cyrus&lt;br /&gt;
                   $ cyradm tape.squeezel.com&lt;br /&gt;
                   tape.squeezel.com&amp;gt; cm user.chirico&lt;br /&gt;
                   tape.squeezel.com&amp;gt; quit&lt;br /&gt;
        &lt;br /&gt;
            Now got back as root, and check that everything was created correctly.&lt;br /&gt;
        &lt;br /&gt;
                   $ ls /var/spool/imap/c/user/&lt;br /&gt;
                   total 8&lt;br /&gt;
                   drwx------  2 cyrus mail 4096 Jul 31 10:21 chirico&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 8:&lt;br /&gt;
        &lt;br /&gt;
             Run a mail test. We'll do this as root to the chirico account.&lt;br /&gt;
        &lt;br /&gt;
                   $ mail -s 'First test'  chirico&lt;br /&gt;
                   first test&lt;br /&gt;
                   .&lt;br /&gt;
        &lt;br /&gt;
             Now, still as root check the maillog. Normally everything should work.&lt;br /&gt;
        &lt;br /&gt;
                  $ tail /var/log/maillog&lt;br /&gt;
        &lt;br /&gt;
             However, I got the following error below.&lt;br /&gt;
&lt;br /&gt;
                     Jul 31 10:29:03 tape postfix/cleanup[30124]: AE7CB1B34A4: message-id=&amp;lt;20050731142903.AE7CB1B34A4@tape.squeezel.com&amp;gt;&lt;br /&gt;
                     Jul 31 10:29:03 tape postfix/qmgr[30120]: AE7CB1B34A4: from=&amp;lt;root@tape.squeezel.com&amp;gt;, size=315, nrcpt=1 (queue active)&lt;br /&gt;
                     Jul 31 10:29:03 tape pipe[30128]: fatal: pipe_comand: execvp /cyrus/bin/deliver: No such file or directory&lt;br /&gt;
&lt;br /&gt;
             If you get a similiar error, you may need to adjust the settting in /etc/postfix/master.cf&lt;br /&gt;
        &lt;br /&gt;
                 # This is the problem in /etc/postfix/master.cf&lt;br /&gt;
                 cyrus     unix  -       n       n       -       -       pipe&lt;br /&gt;
                   user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}&lt;br /&gt;
        &lt;br /&gt;
             My deliver file is the following&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
                 -rwxr-xr-x  1 root root 846228 Apr  4 18:59 /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
        &lt;br /&gt;
             So I need to change my /etc/postfix/master.cf as follows:&lt;br /&gt;
        &lt;br /&gt;
                 # Fix because by deliver file is under  /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
                 cyrus     unix  -       n       n       -       -       pipe&lt;br /&gt;
                   user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -r ${sender} -m ${extension} ${user}&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
             If changes were needed, like I had to do, restart postfix&lt;br /&gt;
        &lt;br /&gt;
                 $ /etc/init.d/postfix restart&lt;br /&gt;
        &lt;br /&gt;
             Now, if everything works, you should start to see numbers in the spool directory like &amp;quot;1.&amp;quot; and&lt;br /&gt;
             &amp;quot;2.&amp;quot;.&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /var/spool/imap/c/user/chirico/&lt;br /&gt;
                 total 40&lt;br /&gt;
                 -rw-------  1 cyrus mail  545 Jul 31 10:44 1.&lt;br /&gt;
                 -rw-------  1 cyrus mail  547 Jul 31 10:45 2.&lt;br /&gt;
                 -rw-------  1 cyrus mail 1276 Jul 31 10:45 cyrus.cache&lt;br /&gt;
                 -rw-------  1 cyrus mail  153 Jul 31 10:21 cyrus.header&lt;br /&gt;
                 -rw-------  1 cyrus mail  196 Jul 31 10:45 cyrus.index&lt;br /&gt;
&lt;br /&gt;
        Step 9:&lt;br /&gt;
        &lt;br /&gt;
             Local firewall.&lt;br /&gt;
        &lt;br /&gt;
                 # imap&lt;br /&gt;
                iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 143 -j ACCEPT&lt;br /&gt;
                iptables -A INPUT -p tcp -s 192.168.1.0/24  --dport 143 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        Step 10:&lt;br /&gt;
        &lt;br /&gt;
             Configure cyrus-imapd to start for run-level 3 and 5.&lt;br /&gt;
&lt;br /&gt;
                 # chkconfig --level 35 cyrus-imapd on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       HINTS - &lt;br /&gt;
&lt;br /&gt;
        Something to watch out for:&lt;br /&gt;
&lt;br /&gt;
              Something to watch out for: If a user creates a .forward file in their shell account with the&lt;br /&gt;
              following entry, then, mail will not get mail relayed to cyrus.&lt;br /&gt;
&lt;br /&gt;
                  &amp;quot;|exec /usr/bin/procmail&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             The /etc/maillog will show something like this:&lt;br /&gt;
&lt;br /&gt;
                    to=&amp;lt;chirico@squeezel.squeezel.com&amp;gt;, orig_to=&amp;lt;chirico&amp;gt;, relay=local, delay=0,&lt;br /&gt;
                          status=sent (delivered to command: exec /usr/bin/procmail)&lt;br /&gt;
&lt;br /&gt;
             Remove the &amp;quot;.forward&amp;quot; file from their home directory and you'll get the following:&lt;br /&gt;
&lt;br /&gt;
                    to=&amp;lt;chirico@squeezel.squeezel.com&amp;gt;, relay=cyrus, delay=0,&lt;br /&gt;
                          status=sent (squeezel.squeezel.com)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              mutt with IMAP?  (See TIP 190)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 189:&lt;br /&gt;
&lt;br /&gt;
     expand - convert tabs to spaces in a file.&lt;br /&gt;
&lt;br /&gt;
             $ expand How_to_Linux_and_Open_Source.txt &amp;gt; notabs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 190:&lt;br /&gt;
&lt;br /&gt;
     mutt with imap - assume you have setup imap (see tip 188). Now how do you configure&lt;br /&gt;
                      your &amp;quot;.muttrc&amp;quot; file to automatically connect, securely to the IMAP server?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       &lt;br /&gt;
     Below is an example of my &amp;quot;.muttrc&amp;quot; file. For this example, assume my password is &amp;quot;S0m3paSSw0r9&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             $ cat .muttrc&lt;br /&gt;
             set spoolfile = &amp;quot;imaps://chirico:S0m3paSSw0r9@squeezel.squeezel.com/&lt;br /&gt;
             set imap_force_ssl=yes&lt;br /&gt;
             set certificate_file=~/.mutt/certificates/72d31154.0&lt;br /&gt;
&lt;br /&gt;
     Now, you want to copy the certificate as a &amp;quot;file.pem&amp;quot; and run &amp;quot;c_rehash&amp;quot; to convert this&lt;br /&gt;
     file to a number. See the article. See the following article on how to do this under the &lt;br /&gt;
     fetchmail section.&lt;br /&gt;
&lt;br /&gt;
          http://souptonuts.sourceforge.net/postfix_tutorial.html&lt;br /&gt;
&lt;br /&gt;
     This is a quick summary of creating this key.&lt;br /&gt;
&lt;br /&gt;
             $ openssl s_client -connect squeezel.squeezel.com:995 -showcerts &amp;gt; file.pem&lt;br /&gt;
             $ c_rehash ~/.mutt/certificates&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 191:&lt;br /&gt;
&lt;br /&gt;
     Apache - CGI scripts.  There are two ways to enable CGI scripts. The second method is the&lt;br /&gt;
              prefered method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           First way, the easy way. Look for the &amp;quot;http.conf&amp;quot; file. On Fedora Core, this file can be&lt;br /&gt;
           found under &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;. Edit this file as follows to make &lt;br /&gt;
           &amp;quot;http://squeezel.squeezel.com/chirico-cgi/&amp;quot; execute scripts.&lt;br /&gt;
&lt;br /&gt;
                     ScriptAlias /chirico-cgi/ &amp;quot;/home/chirico/cgi-bin/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           Second way, the better way. Instead of doing the above, make the following change in &lt;br /&gt;
           &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                     &amp;lt;Directory /home/chirico/cgi-bin&amp;gt;&lt;br /&gt;
                      Options +ExecCGI&lt;br /&gt;
                      SetHandler chirico-cgi&lt;br /&gt;
                     &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Running a test script. Now copy the following test script into the directory &amp;quot;/home/chirico/cgi-bin&amp;quot;&lt;br /&gt;
        and change the rights to execute for the user running this.&lt;br /&gt;
&lt;br /&gt;
                  #!/bin/sh&lt;br /&gt;
                  # Save as test.cgi&lt;br /&gt;
                  #  chown apache.apache test.cgi&lt;br /&gt;
                  #  chmod 700 test.cgi&lt;br /&gt;
                  echo &amp;quot;Content-Type: text/html&amp;quot;&lt;br /&gt;
                  echo&lt;br /&gt;
                  echo &amp;quot;Hello world from user &amp;lt;b&amp;gt;`whoami`&amp;lt;/b&amp;gt;! &amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 192:&lt;br /&gt;
&lt;br /&gt;
     Bash - using getopts for your bash scripts.&lt;br /&gt;
&lt;br /&gt;
                   #!/bin/bash&lt;br /&gt;
                   while getopts &amp;quot;ab:cd:&amp;quot; Option&lt;br /&gt;
                   # b and d take arguments&lt;br /&gt;
                   #&lt;br /&gt;
                   do&lt;br /&gt;
                     case $Option in&lt;br /&gt;
                       a) echo -e &amp;quot;a = $OPTIND&amp;quot;;;&lt;br /&gt;
                       b) echo -e &amp;quot;b = $OPTIND $OPTARG&amp;quot;;;&lt;br /&gt;
                       c) echo -e &amp;quot;c = $OPTIND&amp;quot;;;&lt;br /&gt;
                       d) echo -e &amp;quot;d = $OPTIND $OPTARG&amp;quot;;;&lt;br /&gt;
                    esac&lt;br /&gt;
                  done&lt;br /&gt;
                  shift $(($OPTIND - 1))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 193:&lt;br /&gt;
&lt;br /&gt;
     Sieve - creating sieve recipes with &amp;quot;sieveshell&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     The following sieve script put all jefferson.edu mail into the &lt;br /&gt;
     folder jefferson. This assumes that I have already created the IMP &lt;br /&gt;
     directory, or mail box (INBOX.jefferson), which can be done in mutt &lt;br /&gt;
     with the &amp;quot;C&amp;quot; command. Below is an example of finding &amp;quot;jefferson.edu&amp;quot;&lt;br /&gt;
     anywhere in the header. &lt;br /&gt;
&lt;br /&gt;
         # This is a file named jefferson.siv&lt;br /&gt;
         require [&amp;quot;fileinto&amp;quot;];&lt;br /&gt;
         if header :contains &amp;quot;Received&amp;quot; &amp;quot;from jefferson.edu&amp;quot; {&lt;br /&gt;
           fileinto &amp;quot;INBOX.jefferson&amp;quot;;&lt;br /&gt;
           stop;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
     Now, from the command propt execute &amp;quot;sieveshell&amp;quot; with the hostname of the&lt;br /&gt;
     imap server. My server is squeezel.squeezel.com, so I would execute the &lt;br /&gt;
     following:&lt;br /&gt;
&lt;br /&gt;
          $ sieveshell squeezel.squeezel.com&lt;br /&gt;
          connecting to squeezel.squeezel.com&lt;br /&gt;
          Please enter your password:****&lt;br /&gt;
          &amp;gt; put jefferson.siv&lt;br /&gt;
          &amp;gt; activate jefferson.siv&lt;br /&gt;
          &amp;gt; list&lt;br /&gt;
          jefferson.siv  &amp;lt;- active script&lt;br /&gt;
          &amp;gt; quit&lt;br /&gt;
&lt;br /&gt;
     Note the put brings in the script. And you need to activiate it.&lt;br /&gt;
&lt;br /&gt;
     You can activate a sieve script for any user on your system if you are&lt;br /&gt;
     root. This is an example of activating a script for user chirico. Assume&lt;br /&gt;
     below the root prompt is &amp;quot;#&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          # sieveshell -a chirico -u chirico squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
     You can also automate everything from a bash script. But note after&lt;br /&gt;
     the -e the commands, and not a file with the commands, follows within&lt;br /&gt;
     quotes. This is the script I use for my home system.&lt;br /&gt;
&lt;br /&gt;
         #!/bin/bash&lt;br /&gt;
         sieveshell -a chirico -u chirico -e 'deactivate&lt;br /&gt;
         delete chirico.siv&lt;br /&gt;
         put chirico.siv&lt;br /&gt;
         activate chirico.siv&lt;br /&gt;
         list&lt;br /&gt;
         '  squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     References:&lt;br /&gt;
         http://wiki.fastmail.fm/index.php/SieveRecipes&lt;br /&gt;
         http://www.cyrusoft.com/sieve/#documents&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 194:&lt;br /&gt;
&lt;br /&gt;
     emacs - editing files remotely with tramp. Tramp comes with the latest version of emacs.&lt;br /&gt;
             That means if you're using Fedora core 4, with emacs, you have tramp. This is &lt;br /&gt;
             ideal for editing files on remote computers that do not use emacs.&lt;br /&gt;
&lt;br /&gt;
             Edit the &amp;quot;.emacs&amp;quot; file and add the following line:&lt;br /&gt;
&lt;br /&gt;
                 (require 'tramp)&lt;br /&gt;
                 (setq tramp-default-method &amp;quot;scp&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
             Now, to edit a file on computer tape.squeezel.com (C-x, C-f) and&lt;br /&gt;
             enter the following in Find file:&lt;br /&gt;
&lt;br /&gt;
                 Find file:/chirico@tape.squeezel.com:test.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             References:&lt;br /&gt;
&lt;br /&gt;
                    http://savannah.gnu.org/projects/tramp/&lt;br /&gt;
&lt;br /&gt;
             &lt;br /&gt;
&lt;br /&gt;
TIP 195:&lt;br /&gt;
&lt;br /&gt;
     trusted X11 forwarding - running gnome and KDE both on one screen, at the same&lt;br /&gt;
             time securely. The following assumes gnome is running on the current&lt;br /&gt;
             computer and &amp;quot;closet.squeezel.com&amp;quot; has KDE&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y  closet.squeezel.com&lt;br /&gt;
              $ startkde&lt;br /&gt;
&lt;br /&gt;
          Or assume you want to run gnome on &amp;quot;closet.squeezel.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y  closet.squeezel.com&lt;br /&gt;
              $ gnome-session&lt;br /&gt;
&lt;br /&gt;
          By default Fedora Core allows ForwardX11 over ssh. Note you want to use&lt;br /&gt;
          the -Y option above and NOT -X. &lt;br /&gt;
&lt;br /&gt;
          Suppose you want a remote &amp;quot;gnome-session&amp;quot; on ctl-alt-F12. Below is an &lt;br /&gt;
          example of getting the remote computer closet.squeezel.com, and you&lt;br /&gt;
          can still have the above configuration.&lt;br /&gt;
&lt;br /&gt;
          First you must allow magic cookies for each server connection.&lt;br /&gt;
             &lt;br /&gt;
              $ MCOOKIE=$(mcookie)&lt;br /&gt;
              $ xauth add $(hostname)/unix:1 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
              $ xauth add localhost/unix:1 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
  &lt;br /&gt;
          Again, note that you have to add this for EACH connection. So if you wanted 2 as well&lt;br /&gt;
&lt;br /&gt;
              $ MCOOKIE=$(mcookie)&lt;br /&gt;
              $ xauth add $(hostname)/unix:2 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
              $ xauth add localhost/unix:2 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
&lt;br /&gt;
          On squeezel.squeezel.com create a new xterm. If :1 is take below&lt;br /&gt;
          try :2. The vt12 is for switching to ctl-alt-F12.&lt;br /&gt;
&lt;br /&gt;
              $ xinit -- :1 vt12&lt;br /&gt;
&lt;br /&gt;
          Note, if you do not add the above cookies, you will get the follow error:&lt;br /&gt;
         &lt;br /&gt;
               Xlib: connection to &amp;quot;:1.0&amp;quot; refused by server&lt;br /&gt;
               Xlib: No protocol specified&lt;br /&gt;
&lt;br /&gt;
          The screen may be hard to read. At this point ssh -Y to the remote computer.&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y closet.squeezel.com&lt;br /&gt;
              $ gnome-session&lt;br /&gt;
&lt;br /&gt;
          Yes, you will get errors about sound and some custom drivers is the remove &lt;br /&gt;
          computer has different hardware. After is loads, you can switch back and&lt;br /&gt;
          forth between session with (ctl-alt-F12)  and (ctl-alt-F7)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 196:&lt;br /&gt;
&lt;br /&gt;
     Suspend ssh session - you have just sshed into a computer &amp;quot;ssh -l user example.com&amp;quot;, and you&lt;br /&gt;
          want to get back to the terminal prompt of the computer you started with. Escapte, by &lt;br /&gt;
          default with ssh is &amp;quot;~&amp;quot;, so enter &amp;quot;~&amp;quot; followed by &amp;quot;ctl-z&amp;quot; to suspend.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 197:&lt;br /&gt;
&lt;br /&gt;
     Quick way to send a text file &lt;br /&gt;
&lt;br /&gt;
              $ sendmail -f mike.chirico@gmail.com mchirico@comcast.net &amp;lt; /etc/fstab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 198:&lt;br /&gt;
&lt;br /&gt;
     size - determining the size of the text segment, data segment, and &amp;quot;bss&amp;quot; or uninitialized data segment.&lt;br /&gt;
&lt;br /&gt;
              $ size /bin/sh /bin/bash&lt;br /&gt;
               text        data     bss     dec     hex filename&lt;br /&gt;
              586946      22444   18784  628174   995ce /bin/sh&lt;br /&gt;
              586946      22444   18784  628174   995ce /bin/bash&lt;br /&gt;
&lt;br /&gt;
          Note above that &amp;quot;/bin/sh&amp;quot; and &amp;quot;/bin/bash&amp;quot; have equal text,data and bss numbers. It's&lt;br /&gt;
          highly likely that these are the same programs.&lt;br /&gt;
&lt;br /&gt;
              $ ls -l /bin/sh&lt;br /&gt;
               lrwxrwxrwx  1 root root 4 Jan 14  2005 /bin/sh -&amp;gt; bash&lt;br /&gt;
&lt;br /&gt;
          Yep, it's the same program. Here's a further definition of each segment.&lt;br /&gt;
&lt;br /&gt;
              Text segment: The machine instructions that the CPU executes. This is usually&lt;br /&gt;
                            read only and sharable.&lt;br /&gt;
&lt;br /&gt;
              Data segment: Contains initialized variables in a program. You also know these&lt;br /&gt;
                            as declarations and definitions.&lt;br /&gt;
&lt;br /&gt;
                               int max = 200;&lt;br /&gt;
&lt;br /&gt;
              Uninitialized data segment: Think of this as a declaration only, or data that&lt;br /&gt;
                            is only initialized by the kernel to arithmetic 0 or null pointers&lt;br /&gt;
                            before program execution.&lt;br /&gt;
&lt;br /&gt;
                               char s[10];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 199:&lt;br /&gt;
&lt;br /&gt;
     Using the at command.&lt;br /&gt;
&lt;br /&gt;
       Below is a simple example if running the ls command at 11:42am that&lt;br /&gt;
       will send mail -m to the user that executed it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       We'll execute job1 defined as follows and set to be executable. &lt;br /&gt;
&lt;br /&gt;
           $ cat ./job1&lt;br /&gt;
           #!/bin/bash&lt;br /&gt;
           date &amp;gt;&amp;gt; /tmp/job1&lt;br /&gt;
&lt;br /&gt;
       The at command is listed below. For queue &amp;quot;-q&amp;quot; names you can only&lt;br /&gt;
       specify one letter. Here we're using x. The letter determines the&lt;br /&gt;
       priority with &amp;quot;a&amp;quot; the highest.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x  -f ./job1 -m  11:54am&lt;br /&gt;
           job 3 at 2005-10-04 11:54&lt;br /&gt;
&lt;br /&gt;
       Now, if you execute the atq command, you'll get the following.&lt;br /&gt;
&lt;br /&gt;
           $ atq&lt;br /&gt;
           3       2005-10-04 11:54 x chirico&lt;br /&gt;
&lt;br /&gt;
       It's also possible to execute jobs at the command line entering&lt;br /&gt;
       a ctl-d at the end of the input.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x  -m 12:08pm&lt;br /&gt;
           at&amp;gt; ls -l&lt;br /&gt;
           at&amp;gt; who&lt;br /&gt;
           at&amp;gt; date&lt;br /&gt;
           at&amp;gt; ^D&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Or for a job to execute 1 minute from now.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x -m `date -d '1 minute' +&amp;quot;%H:%M&amp;quot;`&lt;br /&gt;
           at&amp;gt; ls -l&lt;br /&gt;
           at&amp;gt; date&lt;br /&gt;
     &lt;br /&gt;
&lt;br /&gt;
     Important points: The atd daemon must be running. To check if&lt;br /&gt;
      it's running do the following:&lt;br /&gt;
&lt;br /&gt;
            $ /etc/init.d/atd status&lt;br /&gt;
&lt;br /&gt;
      Also, if there is an /etc/at.allow file, then only users in that&lt;br /&gt;
      file will be allowed to execute at.&lt;br /&gt;
&lt;br /&gt;
      If /etc/at.deny exists but is empty and there is no /etc/at.allow,&lt;br /&gt;
      then, everyone can execute the at command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 200:&lt;br /&gt;
&lt;br /&gt;
     lsusb - command will display all USB buses and all devices connected.&lt;br /&gt;
&lt;br /&gt;
        $ lsusb&lt;br /&gt;
        Bus 005 Device 003: ID 413c:2010 Dell Computer Corp.&lt;br /&gt;
        Bus 005 Device 002: ID 413c:1003 Dell Computer Corp.&lt;br /&gt;
        Bus 005 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 004 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 003 Device 003: ID 0fc5:1227 Delcom Engineering&lt;br /&gt;
        Bus 003 Device 002: ID 046d:c016 Logitech, Inc. Optical Mouse&lt;br /&gt;
        Bus 003 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 002 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 001 Device 001: ID 0000:0000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 201:&lt;br /&gt;
&lt;br /&gt;
     Memory fragmentation - if you suspect workload memory fragmentation issues&lt;br /&gt;
     and you want to monitor the current state of you system, then, consider&lt;br /&gt;
     looking at the output from /proc/buddyinfo on recent kernels.&lt;br /&gt;
&lt;br /&gt;
        $ cat /proc/buddyinfo&lt;br /&gt;
      Node 0, zone      DMA    541    218     42      2      0      0      0      1      1      1      0 &lt;br /&gt;
      Node 0, zone   Normal   2508   2614     52      1      5      5      0      1      1      1      0 &lt;br /&gt;
      Node 0, zone  HighMem      0      1      3      0      1      0      0      0      0      0      0 &lt;br /&gt;
&lt;br /&gt;
     The following definition is taken from  ./Documentation/filesystems/proc.txt in the &lt;br /&gt;
     Linux kernel source.&lt;br /&gt;
&lt;br /&gt;
       Each column represents the number of pages of a certain order which are&lt;br /&gt;
       available.  In this case, there are 0 chunks of 2^0*PAGE_SIZE available in&lt;br /&gt;
       ZONE_DMA, 4 chunks of 2^1*PAGE_SIZE in ZONE_DMA, 101 chunks of 2^4*PAGE_SIZE&lt;br /&gt;
       available in ZONE_NORMAL, etc...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 202:&lt;br /&gt;
&lt;br /&gt;
     arp - Linux ARP kernel moduel.  This command implements the Address Resolution Protocol.&lt;br /&gt;
&lt;br /&gt;
     This is an example of the command.&lt;br /&gt;
&lt;br /&gt;
        $ arp&lt;br /&gt;
        Address                  HWtype  HWaddress           Flags Mask            Iface&lt;br /&gt;
        tape.squeezel.com        ether   00:50:DA:60:5B:AD   C                     eth0&lt;br /&gt;
        squeezel.squeezel.com    ether   00:11:11:8A:BE:3F   C                     eth0&lt;br /&gt;
        gw.squeezel.com          ether   00:0F:66:47:15:73   C                     eth0&lt;br /&gt;
&lt;br /&gt;
       &lt;br /&gt;
TIP 203:&lt;br /&gt;
&lt;br /&gt;
     dbench - performance monitoring. &lt;br /&gt;
&lt;br /&gt;
     So, how does your system react when the load average is above 600. Have you even seen a &lt;br /&gt;
     computer with a load average of 600? Well, this could be your chance. &lt;br /&gt;
&lt;br /&gt;
         Reference: http://freshmeat.net/projects/dbench/&lt;br /&gt;
&lt;br /&gt;
     The following gives a load average of 10 on my system.&lt;br /&gt;
&lt;br /&gt;
        $ dbench 34&lt;br /&gt;
&lt;br /&gt;
     If you want a higher load, just increase the number.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 204:&lt;br /&gt;
&lt;br /&gt;
     /etc guide - a listing of common files in the /etc directory.&lt;br /&gt;
&lt;br /&gt;
        /etc/exports: this file is used to configure NFS.&lt;br /&gt;
&lt;br /&gt;
        /etc/ftpusers: the users on your system who are restricted from FTP login.&lt;br /&gt;
&lt;br /&gt;
        /etc/motd: message of the day, which users see after login.&lt;br /&gt;
&lt;br /&gt;
        /etc/named.conf: DNS config file.&lt;br /&gt;
&lt;br /&gt;
        /etc/profile: common user information.&lt;br /&gt;
&lt;br /&gt;
        /etc/inittab: this file contains runlevel start information.&lt;br /&gt;
&lt;br /&gt;
        /etc/services: the services and their respective ports.&lt;br /&gt;
&lt;br /&gt;
        /etc/shells: this contains the names of all shells installed on the system.&lt;br /&gt;
&lt;br /&gt;
        /etc/passwd: this file contains user information.&lt;br /&gt;
&lt;br /&gt;
        /etc/group: security group rights.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
TIP 205: &lt;br /&gt;
&lt;br /&gt;
     logger - is a bash command utility for writing to /var/log/messages or the&lt;br /&gt;
            other files defined in /etc/syslog.conf.&lt;br /&gt;
&lt;br /&gt;
            $ logger -t TEST more of a test here&lt;br /&gt;
&lt;br /&gt;
         This is what shows up in /var/log/messages&lt;br /&gt;
  &lt;br /&gt;
            Oct 28 07:15:50 squeezel TEST: more of a test here&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
TIP 206: &lt;br /&gt;
&lt;br /&gt;
     accton, lastcomm - accouting on and last command. This is &lt;br /&gt;
         a way to monitor users on your system. As root, you &lt;br /&gt;
         would implement this as follows:&lt;br /&gt;
&lt;br /&gt;
           $ accton -h&lt;br /&gt;
            Usage: accton [-hV] [file]&lt;br /&gt;
            [--help] [--version]&lt;br /&gt;
&lt;br /&gt;
            The system's default process accounting file is /var/account/pacct.&lt;br /&gt;
&lt;br /&gt;
         Note the default file location is /var/account/pacct so we'll turn&lt;br /&gt;
         it on system wide with the following command.&lt;br /&gt;
&lt;br /&gt;
           $ accton /var/account/pacct&lt;br /&gt;
&lt;br /&gt;
         Now take a look at this file. It will grow. To see command that&lt;br /&gt;
         are executed, use the lastcomm command.&lt;br /&gt;
&lt;br /&gt;
           $ lastcomm&lt;br /&gt;
&lt;br /&gt;
         The above command gives output for all users. To get the data&lt;br /&gt;
         for user &amp;quot;chirico&amp;quot; execute the following command:&lt;br /&gt;
&lt;br /&gt;
           $ lastcomm --user chirico&lt;br /&gt;
&lt;br /&gt;
         You can also get a summary of commands with sa.&lt;br /&gt;
&lt;br /&gt;
           [chirico@big ~]$ sa&lt;br /&gt;
           30       5.23re       0.00cp    10185k&lt;br /&gt;
           11       4.83re       0.00cp     8961k   ***other&lt;br /&gt;
            8       0.13re       0.00cp    19744k   nagios*&lt;br /&gt;
            4       0.00re       0.00cp     2542k   automount*&lt;br /&gt;
            3       0.00re       0.00cp      680k   sa&lt;br /&gt;
            2       0.13re       0.00cp    17424k   check_ping&lt;br /&gt;
            2       0.13re       0.00cp      978k   ping&lt;br /&gt;
&lt;br /&gt;
         To turn off accounting, execute accton without a filename.&lt;br /&gt;
&lt;br /&gt;
           $ accton&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 207:&lt;br /&gt;
&lt;br /&gt;
     CPU Temperature on a laptop. The following is the temperature&lt;br /&gt;
       of my Dell laptop. &lt;br /&gt;
&lt;br /&gt;
           $ cat /proc/acpi/thermal_zone/THM/temperature&lt;br /&gt;
           temperature:             58 C&lt;br /&gt;
&lt;br /&gt;
      &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 208:&lt;br /&gt;
&lt;br /&gt;
     script -f with mkfifo to allow another user to view what you type&lt;br /&gt;
          in real-time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Step 1.  Create a fifo (first in first out) file that the other&lt;br /&gt;
              user can view. For this example create the file /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
               [chirico@laptop ~]$ mkfifo /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
        Step 2.  Have the second user, voyeur user, cat this file. Output will block&lt;br /&gt;
              for them until you complete step 3. The other user, voyer,&lt;br /&gt;
              is executing the command below.&lt;br /&gt;
 &lt;br /&gt;
               [voyeur@laptop ~]$ cat /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
        Step 3.  The original user runs the following command.&lt;br /&gt;
&lt;br /&gt;
               [chirico@laptop ~]$ script -f  /tmp/scriptout&lt;br /&gt;
               Script started, file is /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
             Now anything typed, including a vi session, will be displayed to the&lt;br /&gt;
             voyeur user in step 2. &lt;br /&gt;
&lt;br /&gt;
        See TIP 46.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 209:&lt;br /&gt;
&lt;br /&gt;
     fsck forced on next reboot.  To do this, as root issue the following commands.&lt;br /&gt;
&lt;br /&gt;
            $ cd /&lt;br /&gt;
            $ touch forcefsck&lt;br /&gt;
&lt;br /&gt;
          Now reboot the system, and when it comes up fsck will be forced on the system.&lt;br /&gt;
&lt;br /&gt;
            $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 210:&lt;br /&gt;
&lt;br /&gt;
     /dev/random and /dev/urandom differ in their random generating properties. /dev/random&lt;br /&gt;
        only returns bytes when enough noise has been generated from the entropy pool. In&lt;br /&gt;
        contrast /dev/urandom will always return bytes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference: http://sourceforge.net/direct-dl/mchirico/cpearls/simple_but_common.tar.gz (rand.c)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 211:&lt;br /&gt;
&lt;br /&gt;
     Want to find out the speed of your NIC?  (Full Duplex or Half), then use ethtool.&lt;br /&gt;
&lt;br /&gt;
               [root@squeezel ~]# ethtool eth0&lt;br /&gt;
               Settings for eth0:&lt;br /&gt;
                       Supported ports: [ MII ]&lt;br /&gt;
                       Supported link modes:   10baseT/Half 10baseT/Full&lt;br /&gt;
                                               100baseT/Half 100baseT/Full&lt;br /&gt;
                                               1000baseT/Half 1000baseT/Full&lt;br /&gt;
                       Supports auto-negotiation: Yes&lt;br /&gt;
                       Advertised link modes:  10baseT/Half 10baseT/Full&lt;br /&gt;
                                               100baseT/Half 100baseT/Full&lt;br /&gt;
                                               1000baseT/Half 1000baseT/Full&lt;br /&gt;
                       Advertised auto-negotiation: Yes&lt;br /&gt;
                       Speed: 100Mb/s&lt;br /&gt;
                       Duplex: Full&lt;br /&gt;
                       Port: Twisted Pair&lt;br /&gt;
                       PHYAD: 1&lt;br /&gt;
                       Transceiver: internal&lt;br /&gt;
                       Auto-negotiation: on&lt;br /&gt;
                       Supports Wake-on: g&lt;br /&gt;
                       Wake-on: d&lt;br /&gt;
                       Current message level: 0x000000ff (255)&lt;br /&gt;
                       Link detected: yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 212:&lt;br /&gt;
&lt;br /&gt;
     rpm install hang? You might need to delete the lock state information. &lt;br /&gt;
&lt;br /&gt;
        $ nl /etc/rc.d/rc.sysinit | grep rpm&lt;br /&gt;
        720   rm -f /var/lib/rpm/__db* &amp;amp;&amp;gt; /dev/null&lt;br /&gt;
&lt;br /&gt;
     Note the command &lt;br /&gt;
&lt;br /&gt;
        $ rm -f /var/lib/rpm/__db*&lt;br /&gt;
&lt;br /&gt;
     Because sometimes you will run &amp;quot;rpm -ivh somerpm&amp;quot; and it will just sit&lt;br /&gt;
     there.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 213:&lt;br /&gt;
&lt;br /&gt;
     Apache - limit access to certain directories based on IP address in the&lt;br /&gt;
         httpd.conf file.&lt;br /&gt;
&lt;br /&gt;
          You can do this completely from /etc/httpd/conf/httpd.conf which&lt;br /&gt;
          are shown below for multiple IP addresses. Note that all 3 setting&lt;br /&gt;
          are the same.&lt;br /&gt;
&lt;br /&gt;
                10.0.0.0/255.0.0.0&lt;br /&gt;
                10.0.0.0/8&lt;br /&gt;
                10&lt;br /&gt;
&lt;br /&gt;
          However, the following is different&lt;br /&gt;
&lt;br /&gt;
                10.0.0.0/24   only allows 10.0.0.1 to 10.0.0.254&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Some complete settings in /etc/httpd/conf/httpd.conf &lt;br /&gt;
&lt;br /&gt;
             &amp;lt;Directory /var/www/html/chirico/&amp;gt;&lt;br /&gt;
                 Order allow,deny&lt;br /&gt;
                 Allow from 10.0.0.0/8      # All 10.&lt;br /&gt;
                 Allow from 192.168.0.0/16  # All 192.168&lt;br /&gt;
                 Allow from 127             # All 127.&lt;br /&gt;
             &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          Don't forget to reload httpd with the following command.&lt;br /&gt;
        &lt;br /&gt;
             $ /etc/init.d/httpd reload&lt;br /&gt;
&lt;br /&gt;
          &lt;br /&gt;
&lt;br /&gt;
TIP 214:&lt;br /&gt;
&lt;br /&gt;
     Open Files - determining how many files are currently open.&lt;br /&gt;
&lt;br /&gt;
             $ cat /proc/sys/fs/file-nr&lt;br /&gt;
             2030    263     104851&lt;br /&gt;
              |       |        \- maximum open file descriptors &lt;br /&gt;
              |       |         &lt;br /&gt;
              |       \- total free allocated file descriptors&lt;br /&gt;
              |&lt;br /&gt;
              (Total allocated file descriptors since boot)&lt;br /&gt;
&lt;br /&gt;
        Note the maximum number can be set or changed.&lt;br /&gt;
&lt;br /&gt;
              $ cat /proc/sys/fs/file-max&lt;br /&gt;
              104851&lt;br /&gt;
&lt;br /&gt;
        To change this&lt;br /&gt;
&lt;br /&gt;
              $ echo &amp;quot;804854&amp;quot; &amp;gt; /proc/sys/fs/file-max&lt;br /&gt;
 &lt;br /&gt;
        Note lsof | wc -l will report higher numbers because this includes&lt;br /&gt;
        open files that are not using file descriptors such as directories,&lt;br /&gt;
        memory mapped files, and executable text files.&lt;br /&gt;
&lt;br /&gt;
        (Reference http://www.netadmintools.com/art295.html&lt;br /&gt;
         and also see the man page for this: man 5 proc )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 215:&lt;br /&gt;
&lt;br /&gt;
     Ctrl-Alt-Del will cause an immediate reboot, without syncing dirty buffers by&lt;br /&gt;
     setting the value &amp;gt; 0 in /proc/sys/kernel/ctrl-alt-del.&lt;br /&gt;
&lt;br /&gt;
               $ echo 1 &amp;gt; /proc/sys/kernel/ctrl-alt-del&lt;br /&gt;
       &lt;br /&gt;
&lt;br /&gt;
        (Reference: man 5 proc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 216:&lt;br /&gt;
&lt;br /&gt;
     Redefining keys in X using xev and xmodmap.  The program xev, used in an X window &lt;br /&gt;
     terminal screen will display information on mouse movements, keys pressed and &lt;br /&gt;
     released.&lt;br /&gt;
&lt;br /&gt;
        $ xev&lt;br /&gt;
&lt;br /&gt;
     Now type shift-4 and you'll notice the event details below:&lt;br /&gt;
&lt;br /&gt;
        KeyPress event, serial 29, synthetic NO, window 0x3800001,&lt;br /&gt;
            root 0x60, subw 0x0, time 55307049, (418,242), root:(428,339),&lt;br /&gt;
            state 0x1, keycode 13 (keysym 0x24, dollar), same_screen YES,&lt;br /&gt;
            XLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
            XmbLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
            XFilterEvent returns: False&lt;br /&gt;
        &lt;br /&gt;
        KeyRelease event, serial 29, synthetic NO, window 0x3800001,&lt;br /&gt;
            root 0x60, subw 0x0, time 55307184, (418,242), root:(428,339),&lt;br /&gt;
            state 0x1, keycode 13 (keysym 0x24, dollar), same_screen YES,&lt;br /&gt;
            XLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
       &lt;br /&gt;
     So, if you want to redefine this key to say copyright, see (/usr/X11R6/include/X11/keysymdef.h)&lt;br /&gt;
     you would type the following.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 copyright'&lt;br /&gt;
&lt;br /&gt;
     To get the key back to the dollar, issue the following command.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 dollar'&lt;br /&gt;
&lt;br /&gt;
     By the way it's possible to define multiple key codes for a sigle key. You'll need&lt;br /&gt;
     to have a key defined as the Mode_switch. Perhaps you'd like to use the Windows key,&lt;br /&gt;
     or the key with the Microsoft logo on it, since you're using Linux. This key is&lt;br /&gt;
     keycode 115&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 115 = Mode_switch'&lt;br /&gt;
&lt;br /&gt;
     Now you could define 3 values to the shift-4. For this example use ld, Yen and dollar.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 dollar sterling yen'&lt;br /&gt;
&lt;br /&gt;
     So pressing the keys gives you the following:&lt;br /&gt;
&lt;br /&gt;
          shift-$          (dollar sign)&lt;br /&gt;
          Windows-$        (lb sign)&lt;br /&gt;
          Windows-shift-$  (Yen sign)&lt;br /&gt;
&lt;br /&gt;
     You could go crazy and redefine all you keys.&lt;br /&gt;
&lt;br /&gt;
     (Thanks to hisham for this tip).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 217:&lt;br /&gt;
&lt;br /&gt;
     Threads - which version of threads are you using?&lt;br /&gt;
&lt;br /&gt;
          $ getconf GNU_LIBPTHREAD_VERSION&lt;br /&gt;
          NPTL 2.3.90&lt;br /&gt;
&lt;br /&gt;
     For a history on threads used with gcc reference the following:&lt;br /&gt;
          &lt;br /&gt;
          http://en.wikipedia.org/wiki/NPTL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 218:&lt;br /&gt;
&lt;br /&gt;
     Screenshots using ImageMagick. &lt;br /&gt;
&lt;br /&gt;
        If you want the entire screen, execute the following:&lt;br /&gt;
&lt;br /&gt;
            $ import -window root screen.png&lt;br /&gt;
&lt;br /&gt;
        Or to crosshair select the region with your mouse, execute &lt;br /&gt;
        the following instead.&lt;br /&gt;
&lt;br /&gt;
            $ import screen.png&lt;br /&gt;
&lt;br /&gt;
        KDE has the ability to take screenshots with the command below.&lt;br /&gt;
&lt;br /&gt;
            $ ksnapshot&lt;br /&gt;
&lt;br /&gt;
        GNOME likewise has a command too.&lt;br /&gt;
&lt;br /&gt;
            $ gnome-panel-screenshot --delay 6&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Visting ImageMagick again, the xwininfo command give window information and the id can be&lt;br /&gt;
        used to capture images with the import command.&lt;br /&gt;
&lt;br /&gt;
            $ xwininfo&lt;br /&gt;
&lt;br /&gt;
          xwininfo: Please select the window about which you&lt;br /&gt;
          would like information by clicking the&lt;br /&gt;
          mouse in that window.&lt;br /&gt;
&lt;br /&gt;
          xwininfo: Window id: 0x1e00007 &amp;quot;chirico@squeezel:/work/svn/souptonuts - Shell - Konsole&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          Absolute upper-left X:  4&lt;br /&gt;
          Absolute upper-left Y:  21&lt;br /&gt;
          Relative upper-left X:  0&lt;br /&gt;
          Relative upper-left Y:  0&lt;br /&gt;
          Width: 880&lt;br /&gt;
          Height: 510&lt;br /&gt;
          Depth: 24&lt;br /&gt;
          Visual Class: TrueColor&lt;br /&gt;
          Border width: 0&lt;br /&gt;
          Class: InputOutput&lt;br /&gt;
          Colormap: 0x20 (installed)&lt;br /&gt;
          Bit Gravity State: NorthWestGravity&lt;br /&gt;
          Window Gravity State: NorthWestGravity&lt;br /&gt;
          Backing Store State: NotUseful&lt;br /&gt;
          Save Under State: no&lt;br /&gt;
          Map State: IsViewable&lt;br /&gt;
          Override Redirect State: no&lt;br /&gt;
          Corners:  +4+21  -396+21  -396-493  +4-493&lt;br /&gt;
          -geometry 880x510+0+0&lt;br /&gt;
&lt;br /&gt;
        Now use the import command with the Window id. My example is shown below.&lt;br /&gt;
&lt;br /&gt;
             $ import -window 0x1e00007  id.miff&lt;br /&gt;
&lt;br /&gt;
        And to quickly display this image that you just saved, use the display command.&lt;br /&gt;
&lt;br /&gt;
             $ display id.miff &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 219:&lt;br /&gt;
&lt;br /&gt;
     File Access over SSH using FUSE (Filesystem in USErspace). This is a very good way to &lt;br /&gt;
     mount a remote filesystem locally. It's  like a secure NFS mount, but you don't require &lt;br /&gt;
     admin privileges on the remote computer. You do need to have fuse-sshfs installed on &lt;br /&gt;
     the local computer that will perform the filesystem mount.&lt;br /&gt;
&lt;br /&gt;
     The following works with Fedora Core 5. Only the users added to the fuse group can mout &lt;br /&gt;
     external drives. Below the user chirico is being added to the group fuse.&lt;br /&gt;
&lt;br /&gt;
             $ yum install fuse-sshfs&lt;br /&gt;
             $ usermod -a -G fuse chirico&lt;br /&gt;
     &lt;br /&gt;
     You'll need to reboot.&lt;br /&gt;
&lt;br /&gt;
             $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
             &lt;br /&gt;
     Next I'm going to mount the remote filesystem v0.squeezel.com. This is done as user chirico&lt;br /&gt;
     on the local computer. I'm using root on the remote computer v0.squeezel.com because I&lt;br /&gt;
     want to mount the complete drive.&lt;br /&gt;
&lt;br /&gt;
             $ mkdir v0&lt;br /&gt;
             $ sshfs root@v0.squeezel.com:/  v0&lt;br /&gt;
             $ cd v0&lt;br /&gt;
             $ ls -l&lt;br /&gt;
               bin   dev  home  lost+found     media  mnt  opt   q     sbin     srv  tmp  var&lt;br /&gt;
               boot  etc  lib   master_backup  misc   net  proc  root  selinux  sys  usr&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
     Now to unmount the filesystem&lt;br /&gt;
&lt;br /&gt;
             $ fusermount -u /home/chirico/v0&lt;br /&gt;
&lt;br /&gt;
     Yes, you can mount the filesystem on boot. Below shows an example entry for /etc/fstab, but&lt;br /&gt;
     this only allows user on the current system to view what is is /mnt/v0. &lt;br /&gt;
&lt;br /&gt;
             sshfs#root@v0.squeezel.com:/var/log             /mnt/v0 fuse defaults    0 0&lt;br /&gt;
&lt;br /&gt;
     References:&lt;br /&gt;
        (http://fuse.sourceforge.net/sshfs.html)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 220:&lt;br /&gt;
&lt;br /&gt;
     OpenVPN - A full-featured SSL VPN solution. The following demonstrates&lt;br /&gt;
               a very simple OpenVPN setup between two Fedora Core 5 computers&lt;br /&gt;
               big.squeezel.com 192.168.1.12 and tape.squeezel.com 192.168.1.155&lt;br /&gt;
&lt;br /&gt;
               As root install the package on both computers.&lt;br /&gt;
&lt;br /&gt;
                  $ yum -y install openvpn&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Setup on big.squeezel.com 192.168.1.12&lt;br /&gt;
&lt;br /&gt;
                  $ iptables -A INPUT -p udp -s 192.168.1.155  --dport 1194 -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tun+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A FORWARD -i tap+ -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
             Note - make sure you have commented out the following line &lt;br /&gt;
                    in /etc/sysconfig/iptables&lt;br /&gt;
&lt;br /&gt;
                  # -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
&lt;br /&gt;
             Now from continuting with the commands that need to be executed on &lt;br /&gt;
             big.squeezel.com 192.168.1.12 do one of the following&lt;br /&gt;
           &lt;br /&gt;
                  $ openvpn --remote tape.squeezel.com  --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 --verb 9&lt;br /&gt;
&lt;br /&gt;
             The above statement gives lots of errors. Once it's working you may want&lt;br /&gt;
             the following statement without the --verb 9 option.&lt;br /&gt;
&lt;br /&gt;
                  $ openvpn --remote tape.squeezel.com  --dev tun1 --ifconfig 10.4.0.1 10.4.0.2&lt;br /&gt;
&lt;br /&gt;
             After you finish the setup commands for tape.squeezel.com immediately below, you'll be&lt;br /&gt;
             able to access tape.squeezel.com as 10.4.0.2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Setup on tape.squeezel.com 192.168.1.155&lt;br /&gt;
&lt;br /&gt;
                  $ iptables -A INPUT -p udp -s 192.168.1.12  --dport 1194 -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tun+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A FORWARD -i tap+ -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
             Note - again, make sure you have commented out the following line &lt;br /&gt;
                    in /etc/sysconfig/iptables&lt;br /&gt;
&lt;br /&gt;
                  # -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
&lt;br /&gt;
             The openvpn commands are tape.squeezel.com are reversed from what is shown&lt;br /&gt;
             above.&lt;br /&gt;
&lt;br /&gt;
                  $ openvpn --remote big.squeezel.com --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 --verb 9&lt;br /&gt;
&lt;br /&gt;
             Or&lt;br /&gt;
                  $ openvpn --remote big.squeezel.com --dev tun1 --ifconfig 10.4.0.2 10.4.0.1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             Now you can access all services and ports from big.squeezel.com on 10.4.0.1 for &lt;br /&gt;
             such services as MySQL, secure Web, imap, etc. A quick test is nmap as follows:&lt;br /&gt;
&lt;br /&gt;
                  $ nmap -A -T4 10.4.0.1&lt;br /&gt;
&lt;br /&gt;
                  Starting Nmap 4.03 ( http://www.insecure.org/nmap/ ) at 2006-05-20 13:54 EDT&lt;br /&gt;
                  Interesting ports on 10.4.0.1:&lt;br /&gt;
                  (The 1671 ports scanned but not shown below are in state: closed)&lt;br /&gt;
                  PORT     STATE SERVICE VERSION&lt;br /&gt;
                  22/tcp   open  ssh     OpenSSH 4.3 (protocol 2.0)&lt;br /&gt;
                  111/tcp  open  rpcbind  2 (rpc #100000)&lt;br /&gt;
                  3306/tcp open  mysql   MySQL (unauthorized)&lt;br /&gt;
&lt;br /&gt;
                  Nmap finished: 1 IP address (1 host up) scanned in 7.116 seconds&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 221:&lt;br /&gt;
&lt;br /&gt;
     openssl - Some common commands.&lt;br /&gt;
&lt;br /&gt;
             Finding the openssldir (Directory for OpenSSL files).&lt;br /&gt;
&lt;br /&gt;
                  $ openssl version -a|grep OPENSSLDIR&lt;br /&gt;
                  OPENSSLDIR: &amp;quot;/etc/pki/tls&amp;quot;&lt;br /&gt;
&lt;br /&gt;
             Connect to a secure SMTP server with STARTTLS, assuming the server name is&lt;br /&gt;
             squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
                  $ openssl s_client -connect squeezel.squeezel.com:25 -starttls&lt;br /&gt;
&lt;br /&gt;
         &lt;br /&gt;
&lt;br /&gt;
      Reference (http://www.madboa.com/geek/openssl/)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 222:&lt;br /&gt;
&lt;br /&gt;
     Bash functions. This is easy, and I find it very useful to create bash functions&lt;br /&gt;
     for repeated commands. For example, suppose you want to create a quick bash function&lt;br /&gt;
     to cd to /var/log, tail messages and tail secure. You can create this function as&lt;br /&gt;
     follows:&lt;br /&gt;
&lt;br /&gt;
                  [root@v5 log]# m()&lt;br /&gt;
                  m()&lt;br /&gt;
                  &amp;gt; { cd /var/log&lt;br /&gt;
                  { cd /var/log&lt;br /&gt;
                  &amp;gt; tail messages&lt;br /&gt;
                  tail messages&lt;br /&gt;
                  &amp;gt; tail secure&lt;br /&gt;
                  tail secure&lt;br /&gt;
                  &amp;gt; }&lt;br /&gt;
                  }&lt;br /&gt;
                  &lt;br /&gt;
     Above I'm typing m() then hitting return. Note the echo on the next line followed&lt;br /&gt;
     by the prompt &amp;gt;. I then enter {. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 223:&lt;br /&gt;
&lt;br /&gt;
     Stats on DNS Server. You can get stats on your DNS server. &lt;br /&gt;
&lt;br /&gt;
       The following works for BIND 9:&lt;br /&gt;
&lt;br /&gt;
                  $ rndc stats&lt;br /&gt;
&lt;br /&gt;
         On my system I see the output in &amp;quot;/var/named/chroot/var/named/data/named_stats.txt&amp;quot;, which&lt;br /&gt;
         if an FC4 system. By the way, if you're using BIND 8, the command is &amp;quot;ndc stats&amp;quot;, but that&lt;br /&gt;
         has a completely different format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Format of the output&lt;br /&gt;
&lt;br /&gt;
            +++ Statistics Dump +++ (1153791199)&lt;br /&gt;
            success 297621&lt;br /&gt;
            referral 32&lt;br /&gt;
            nxrrset 21953&lt;br /&gt;
            nxdomain 33742&lt;br /&gt;
            recursion 28243&lt;br /&gt;
            failure 54&lt;br /&gt;
            --- Statistics Dump --- (1153791199)&lt;br /&gt;
&lt;br /&gt;
      The number (1153791199) can be converted with the date command.&lt;br /&gt;
&lt;br /&gt;
                  $ date -d '1970-01-01 1153791199 sec'&lt;br /&gt;
                  Tue Jul 25 02:33:19 EDT 2006&lt;br /&gt;
&lt;br /&gt;
      That's 1153791199 seconds since 1970-01-01 UCT. Which is 4 hours fast,&lt;br /&gt;
      from EDT.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 224:&lt;br /&gt;
&lt;br /&gt;
     snmp - simple network monitoring protocol. The following steps setup snmp on Fedora Core 5.&lt;br /&gt;
&lt;br /&gt;
                  $ yum install net-snmp*&lt;br /&gt;
&lt;br /&gt;
         Next add the following line in &amp;quot;/etc/snmp/snmpd.conf&amp;quot; at the bottom.&lt;br /&gt;
&lt;br /&gt;
                  rocommunity pA33worD&lt;br /&gt;
&lt;br /&gt;
         Start the snmp service.&lt;br /&gt;
&lt;br /&gt;
                  $ /etc/init.d/snmpd restart&lt;br /&gt;
&lt;br /&gt;
         Once started, from the command prompt, it's possible to get stats on the computer.&lt;br /&gt;
&lt;br /&gt;
                  $ snmpwalk -v 1 -c pA33worD localhost system&lt;br /&gt;
         Or&lt;br /&gt;
                  $ snmpwalk -v 1 -c pA33worD localhost interface&lt;br /&gt;
&lt;br /&gt;
         Or&lt;br /&gt;
                  $ snmpgetnext -v 1 -c pA33worD localhost sysUpTime&lt;br /&gt;
                  DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (26452) 0:04:24.52&lt;br /&gt;
&lt;br /&gt;
         Note the Timeticks is in 100th of a second. So the computer above has been running&lt;br /&gt;
         for 264.52 seconds.&lt;br /&gt;
&lt;br /&gt;
         Reference( TIP 225 shows how to use MRTG for gathering snmp stats).&lt;br /&gt;
                  http://www.net-snmp.org/tutorial/tutorial-5/commands/snmpv3.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 225:&lt;br /&gt;
&lt;br /&gt;
     MRTG - Multi Router Traffic Grapher.  &lt;br /&gt;
&lt;br /&gt;
                  $ cfgmaker --output=/etc/mrtg/v5.squeezel.com \&lt;br /&gt;
                    ifref=ip --global &amp;quot;workdir:/var/www/html/mrtg/stats&amp;quot;\&lt;br /&gt;
                    pA33worD@v5.squeezel.com&lt;br /&gt;
&lt;br /&gt;
        Reference: http://www.chinalinuxpub.com/doc/www.siliconvalleyccie.com/linux-hn/mrtg.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 226:&lt;br /&gt;
&lt;br /&gt;
     Back Trace - This is a method of getting a back trace for all processes on the system.&lt;br /&gt;
                  it assumes the following: a. Kernel was build with CONFIG_MAGIC_SYS-REQ &lt;br /&gt;
                  enabled (which Fedora 5 kernels are) b. You can get direct access to the &lt;br /&gt;
                  monitor.&lt;br /&gt;
&lt;br /&gt;
             Step 1.&lt;br /&gt;
&lt;br /&gt;
                  Ctl-Alt-F1 (This brings you to the text console)&lt;br /&gt;
&lt;br /&gt;
             Step 2.&lt;br /&gt;
&lt;br /&gt;
                  Alt-ScrollLock &lt;br /&gt;
                  Ctl-ScrollLock&lt;br /&gt;
          &lt;br /&gt;
                  Note above that's Alt-ScrollLock followed by Ctl-ScrollLock. You should see&lt;br /&gt;
                  a lot of text on the screen. To fast to read, but don't worry the text will&lt;br /&gt;
                  be in /var/log/messages at the end.&lt;br /&gt;
&lt;br /&gt;
                  On my system the ScrollLock key is next to the NumLock key. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 227:&lt;br /&gt;
&lt;br /&gt;
     Ext3 Tuning - One advantage of Ext3 over Ext2 is directory indexing, which  imporves file&lt;br /&gt;
                  access in directories containing large files or when the directory contains&lt;br /&gt;
                  many files. Directory indexing improves performance by using hashed binary &lt;br /&gt;
                  trees. &lt;br /&gt;
&lt;br /&gt;
                  There are two ways to enable dir_index. First, find the device using the mount&lt;br /&gt;
                  command.&lt;br /&gt;
&lt;br /&gt;
                      $ mount&lt;br /&gt;
&lt;br /&gt;
                      /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)&lt;br /&gt;
                      proc on /proc type proc (rw)&lt;br /&gt;
                      sysfs on /sys type sysfs (rw)&lt;br /&gt;
                      devpts on /dev/pts type devpts (rw,gid=5,mode=620)&lt;br /&gt;
                      /dev/sda1 on /boot type ext3 (rw) &amp;lt;--- This is the one you want&lt;br /&gt;
                      tmpfs on /dev/shm type tmpfs (rw)&lt;br /&gt;
                      none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)&lt;br /&gt;
                      sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)&lt;br /&gt;
                      automount(pid2001) on /net type autofs (rw,fd=4,pgrp=2001,minproto=2,maxproto=4)                   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                  From the above command, the device used is /dev/sda1.  Using the tune2fs command,&lt;br /&gt;
                  directory indexing will only apply to directories created after running the &lt;br /&gt;
                  command below.               &lt;br /&gt;
&lt;br /&gt;
                       $ tune2fs -O dir_index /dev/sda1&lt;br /&gt;
&lt;br /&gt;
                  However, if you want it to apply to all directories, use the e2fsck command as  &lt;br /&gt;
                  shown below:&lt;br /&gt;
&lt;br /&gt;
                       $ e2fsck -D -f /dev/sda1&lt;br /&gt;
&lt;br /&gt;
                  You'll need to bypass the warning message.&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
     Reference: &amp;quot;Tuning Journaling File Systems: A small amount of effort an dtime can yield big&lt;br /&gt;
                results&amp;quot;,by Steve Best. Linux Magazine, September 10, 2006. This author as has&lt;br /&gt;
                a very good book titled: &amp;quot;Linux Debugging and Performance Tuning.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 228:&lt;br /&gt;
&lt;br /&gt;
     NIC bonding - binding two or more NICs to one IP address to improve performance. The following&lt;br /&gt;
                instructions were done on Fedora Core 5.&lt;br /&gt;
&lt;br /&gt;
         Step 1.&lt;br /&gt;
             &lt;br /&gt;
            Create the file ifcfg-bond0 with the IP address, netmask and gateway. Shown&lt;br /&gt;
            below is my file.&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-bond0&lt;br /&gt;
&lt;br /&gt;
                   DEVICE=bond0&lt;br /&gt;
                   IPADDR=192.168.1.12&lt;br /&gt;
                   NETMASK=255.255.255.0&lt;br /&gt;
                   GATEWAY=192.168.1.1&lt;br /&gt;
                   USERCTL=no&lt;br /&gt;
                   BOOTPROTO=none&lt;br /&gt;
                   ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
         Step 2.&lt;br /&gt;
&lt;br /&gt;
            Modify eth0, eth1 and eth2. Shown below are each one of my files. Note that&lt;br /&gt;
            you must comment out, or remove the ip address, netmask, gateway and hardware&lt;br /&gt;
            address from each one of these files, since settings should only come from&lt;br /&gt;
            the ifcfg-bond0 file above. I've chosen to comment out the lines, instead of &lt;br /&gt;
            removing, should I decide to unbond my NICS sometime in the future.&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth0&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:9D&lt;br /&gt;
                  #IPADDR=192.168.1.12&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  #GATEWAY=192.168.1.1&lt;br /&gt;
                  #USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  # Settings for Bond&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth1&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth1&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:C9&lt;br /&gt;
                  #IPADDR=192.168.1.13&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  #&lt;br /&gt;
                  # Settings for bonding&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth2&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth2&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:9D&lt;br /&gt;
                  #IPADDR=192.168.1.12&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  #GATEWAY=192.168.1.1&lt;br /&gt;
                  #USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
         Step 3.&lt;br /&gt;
&lt;br /&gt;
            Set the load parameters for bond0 bonding kernel module. Append the&lt;br /&gt;
            following lines to /etc/modprobe.conf &lt;br /&gt;
&lt;br /&gt;
                 # bonding commands &lt;br /&gt;
                 alias bond0 bonding&lt;br /&gt;
                 options bond0 mode=balance-alb miimon=100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Step 4.&lt;br /&gt;
&lt;br /&gt;
            Load the bond driver module from the command prompt.&lt;br /&gt;
&lt;br /&gt;
                 $ modprobe bonding&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Step 5.&lt;br /&gt;
&lt;br /&gt;
            Restart the network, or restart the computer. Note I restarted to computer,&lt;br /&gt;
            since my NICs above had MAC assignments.&lt;br /&gt;
&lt;br /&gt;
                 $ service network restart   # Or restart computer&lt;br /&gt;
&lt;br /&gt;
             Take a look at the proc settings. &lt;br /&gt;
&lt;br /&gt;
                 $ cat /proc/net/bonding/bond0 &lt;br /&gt;
                 Ethernet Channel Bonding Driver: v3.0.3 (March 23, 2006)&lt;br /&gt;
&lt;br /&gt;
                 Bonding Mode: adaptive load balancing&lt;br /&gt;
                 Primary Slave: None&lt;br /&gt;
                 Currently Active Slave: eth2&lt;br /&gt;
                 MII Status: up&lt;br /&gt;
                 MII Polling Interval (ms): 100&lt;br /&gt;
                 Up Delay (ms): 0&lt;br /&gt;
                 Down Delay (ms): 0&lt;br /&gt;
&lt;br /&gt;
                 Slave Interface: eth2&lt;br /&gt;
                 MII Status: up&lt;br /&gt;
                 Link Failure Count: 0&lt;br /&gt;
                 Permanent HW addr: 00:13:72:80:62:f0&lt;br /&gt;
            &lt;br /&gt;
     References:&lt;br /&gt;
&lt;br /&gt;
         http://www.cyberciti.biz/nixcraft/vivek/blogger/2006/04/linux-bond-or-team-multiple-network.php&lt;br /&gt;
          Good, well written article describing the steps above.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=24692&amp;amp;package_id=146474&lt;br /&gt;
          Documentation for bonding that can also be found in the kernel&lt;br /&gt;
          ./Documentation/networking/bonding.txt&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 229:&lt;br /&gt;
&lt;br /&gt;
     /etc/nsswitch.conf - System Databases and Name Service Switch configuration file. &lt;br /&gt;
&lt;br /&gt;
         This file determines lookup order of services. For example, to match a name&lt;br /&gt;
         to an IP address, an entry can be put into the /etc/hosts file. Or a DNS query&lt;br /&gt;
         can be made. What's the order?  Normally, it's the entry in the /etc/hosts file.&lt;br /&gt;
         because /etc/nsswitch.conf contains the following setting&lt;br /&gt;
        &lt;br /&gt;
            hosts:      files dns&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	 See man nsswitch.conf for more settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
THE FOLLOWING SECTIONS STARTS THE PROGRAMMING TIPS&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 1:&lt;br /&gt;
&lt;br /&gt;
     Simple open command that restarts the close if a signal&lt;br /&gt;
     occurs.  Also note, the POSIX standards committee decided&lt;br /&gt;
     all new functions would not use errno and would instead&lt;br /&gt;
     directly return the error number in the function.&lt;br /&gt;
&lt;br /&gt;
     A lot of functions return -1 on an error condition, then,&lt;br /&gt;
     set errno to the value of the error.  This will still work&lt;br /&gt;
     for all the well known functions; but, it's changing.&lt;br /&gt;
&lt;br /&gt;
     /* start of code open.c&lt;br /&gt;
        Compile gcc -o open open.c&lt;br /&gt;
&lt;br /&gt;
        Reference (Look for simple_but_common_x.x.x.tar.gz):&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79066&lt;br /&gt;
&lt;br /&gt;
                             */&lt;br /&gt;
     #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     #include &amp;lt;string.h&amp;gt;             /* for strerror(int errno) */&lt;br /&gt;
     #include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     #define BUFLEN 100&lt;br /&gt;
     extern int errno;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     int&lt;br /&gt;
     main (void)&lt;br /&gt;
     {&lt;br /&gt;
       int fp,error;&lt;br /&gt;
       char buf[BUFLEN+1];&lt;br /&gt;
&lt;br /&gt;
       if ((fp = open (&amp;quot;data&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1)&lt;br /&gt;
         {&lt;br /&gt;
           fprintf (stderr, &amp;quot;Can't open data: %s\n&amp;quot;, strerror (errno));&lt;br /&gt;
           return 1;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
       snprintf (buf, BUFLEN, &amp;quot;123&amp;quot;);&lt;br /&gt;
       write (fp, buf, strlen (buf));&lt;br /&gt;
&lt;br /&gt;
       // Restart close should a signal occur */&lt;br /&gt;
       while((( error = close (fp) ) == -1) &amp;amp;&amp;amp; (errno == EINTR));&lt;br /&gt;
       if(error == -1)&lt;br /&gt;
         perror(&amp;quot;Failed to close the file\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
       return 0;&lt;br /&gt;
      }&lt;br /&gt;
     /* end of open.c */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 2:&lt;br /&gt;
&lt;br /&gt;
     Example of setting the effective UID on a file&lt;br /&gt;
&lt;br /&gt;
     /*  start of code&lt;br /&gt;
       gcc uid_open.c -o uid_open&lt;br /&gt;
       su&lt;br /&gt;
       chown root.chirico uid_open&lt;br /&gt;
       chmod u+s uid_open&lt;br /&gt;
       exit&lt;br /&gt;
&lt;br /&gt;
       Now you can run this as chirico and write to the&lt;br /&gt;
       root directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     */&lt;br /&gt;
     #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;string.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     int main()&lt;br /&gt;
     {&lt;br /&gt;
             int fd;&lt;br /&gt;
&lt;br /&gt;
             if ((fd = open(&amp;quot;/root/datajunk&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1) {&lt;br /&gt;
                     fprintf(stderr, &amp;quot;Can't open file \n&amp;quot;);&lt;br /&gt;
                     return 1;&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
             write(fd, &amp;quot;0123456&amp;quot;, strlen(&amp;quot;0123456&amp;quot;));&lt;br /&gt;
             close(fd);&lt;br /&gt;
             return 0;&lt;br /&gt;
     }&lt;br /&gt;
&lt;br /&gt;
     /* end of code */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 3:&lt;br /&gt;
&lt;br /&gt;
     Writing a C http post.&lt;br /&gt;
&lt;br /&gt;
     For downloads reference:&lt;br /&gt;
      http://prdownloads.sourceforge.net/cpearls/spider.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 4:&lt;br /&gt;
&lt;br /&gt;
     Writing a 2.6.x Kernel Module:&lt;br /&gt;
&lt;br /&gt;
       Look for the latest version of &amp;quot;procreadwrite&amp;quot;.  This is a 2.6 kernel&lt;br /&gt;
       modules that demonstrates how to create /proc entires and write directly&lt;br /&gt;
       to user-land via tty.  It's updated to reflect replacement of &amp;quot;current-&amp;gt;tty&amp;quot;&lt;br /&gt;
       with &amp;quot;current-&amp;gt;signal-&amp;gt;tty&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79066&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 5:&lt;br /&gt;
&lt;br /&gt;
     Creating a filename with '\n'.  This goes with (TIP 71)&lt;br /&gt;
&lt;br /&gt;
         /**** topen.c ***********************************************************&lt;br /&gt;
           Filenames can be created with any character except the null character&lt;br /&gt;
           and a slash.&lt;br /&gt;
&lt;br /&gt;
           This example creates a file with returns '\n\n'&lt;br /&gt;
&lt;br /&gt;
           There's a way to remove a file by inode:&lt;br /&gt;
&lt;br /&gt;
               $ ls -libt *&lt;br /&gt;
&lt;br /&gt;
           And, once you know the inode&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec mv '{}' goodstuff \;&lt;br /&gt;
&lt;br /&gt;
           or&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec rm '{}' goodstuff \;&lt;br /&gt;
&lt;br /&gt;
           or&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec cat '{}' \;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Compile:&lt;br /&gt;
&lt;br /&gt;
             gcc -o topen -Wall -W -O2 -s -pipe  topen.c&lt;br /&gt;
&lt;br /&gt;
         Reference:&lt;br /&gt;
           http://prdownloads.sourceforge.net/cpearls/simple_but_common_0.0.14.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
         */&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         #include &amp;lt;string.h&amp;gt;             /* for strerror(int errno) */&lt;br /&gt;
         #include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         #define BUFLEN 100&lt;br /&gt;
         extern int errno;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         int&lt;br /&gt;
         main (void)&lt;br /&gt;
         {&lt;br /&gt;
           int fp,error;&lt;br /&gt;
           char buf[BUFLEN+1];&lt;br /&gt;
&lt;br /&gt;
           if ((fp = open (&amp;quot;\n\n\n\n\n\n\n\n\n&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1)&lt;br /&gt;
             {&lt;br /&gt;
               fprintf (stderr, &amp;quot;Can't open data: %s\n&amp;quot;, strerror (errno));&lt;br /&gt;
               return 1;&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
           snprintf (buf, BUFLEN, &amp;quot;123&amp;quot;);&lt;br /&gt;
           write (fp, buf, strlen (buf));&lt;br /&gt;
&lt;br /&gt;
           // Restart close should a signal occur */&lt;br /&gt;
           while((( error = close (fp) ) == -1) &amp;amp;&amp;amp; (errno == EINTR));&lt;br /&gt;
           if(error == -1)&lt;br /&gt;
             perror(&amp;quot;Failed to close the file\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
           return 0;&lt;br /&gt;
&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  **Note, if you want email notification after every 50 new tips have been&lt;br /&gt;
    added, then, click on the following link:&lt;br /&gt;
&lt;br /&gt;
     https://sourceforge.net/project/filemodule_monitor.php?filemodule_id=120838&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 6:&lt;br /&gt;
&lt;br /&gt;
     Working With The Lemon Parser Generator.&lt;br /&gt;
     http://prdownloads.sourceforge.net/souptonuts/lemon_examples.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 7:&lt;br /&gt;
&lt;br /&gt;
     copy command for std container output.&lt;br /&gt;
&lt;br /&gt;
        #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
        #include &amp;lt;list&amp;gt;&lt;br /&gt;
        #include &amp;lt;vector&amp;gt;&lt;br /&gt;
        #include &amp;lt;iterator&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        using namespace std;&lt;br /&gt;
        int main(void)&lt;br /&gt;
        {&lt;br /&gt;
          vector&amp;lt;int&amp;gt; v;&lt;br /&gt;
          list&amp;lt;int&amp;gt; l;&lt;br /&gt;
&lt;br /&gt;
          v.push_back(1);&lt;br /&gt;
          v.push_back(2);&lt;br /&gt;
          copy(v.begin(),v.end(),ostream_iterator&amp;lt;int&amp;gt;(cout,&amp;quot;\n&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          l.push_back(23);&lt;br /&gt;
          l.push_back(12);&lt;br /&gt;
          copy(l.begin(),l.end(),ostream_iterator&amp;lt;int&amp;gt;(cout,&amp;quot;\n&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 8:&lt;br /&gt;
&lt;br /&gt;
  /* Copyright (c) 2005 Mike Chirico mchirico@comcast.net mchirico@users.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Example of using virtual functions. Note the use of &amp;quot;initialization lists&amp;quot;&lt;br /&gt;
              for assinging the variable first and last.&lt;br /&gt;
&lt;br /&gt;
      Compile:&lt;br /&gt;
        g++ -o virtualfunc -Wall -W -O2 -s -pipe  virtual_function.cc&lt;br /&gt;
&lt;br /&gt;
      Download:&lt;br /&gt;
        http://prdownloads.sourceforge.net/cpearls/simple_but_common_cpp.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  */&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
  #include &amp;lt;string&amp;gt;&lt;br /&gt;
  #include &amp;lt;list&amp;gt;&lt;br /&gt;
  #include &amp;lt;algorithm&amp;gt;&lt;br /&gt;
  #include &amp;lt;iterator&amp;gt;&lt;br /&gt;
  #include &amp;lt;functional&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  using namespace std;&lt;br /&gt;
&lt;br /&gt;
  class Employee {&lt;br /&gt;
  string first,last;&lt;br /&gt;
  public:&lt;br /&gt;
    Employee(const string&amp;amp; fn=&amp;quot;John&amp;quot;,const  string&amp;amp; ln=&amp;quot;Smith&amp;quot;): first(fn),last(ln) {}&lt;br /&gt;
    virtual void print() const {&lt;br /&gt;
    cout &amp;lt;&amp;lt; &amp;quot;First name: &amp;quot; &amp;lt;&amp;lt; first &amp;lt;&amp;lt; &amp;quot;, Last name: &amp;quot; &amp;lt;&amp;lt; last &amp;lt;&amp;lt; endl;&lt;br /&gt;
    }&lt;br /&gt;
    virtual ~Employee() {}&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  class Manager : public Employee {&lt;br /&gt;
    int level;&lt;br /&gt;
    list&amp;lt;Employee*&amp;gt; subordinates;&lt;br /&gt;
  public:&lt;br /&gt;
    Manager(const string&amp;amp; fn=&amp;quot;Ivan&amp;quot;,const string&amp;amp; ln=&amp;quot;Stedwick&amp;quot;, int lvl=1): Employee(fn,ln), level(lvl) {}&lt;br /&gt;
    void print() {&lt;br /&gt;
      cout &amp;lt;&amp;lt; &amp;quot;Manager level: &amp;quot; &amp;lt;&amp;lt; level &amp;lt;&amp;lt; &amp;quot;  &amp;quot;;&lt;br /&gt;
      Employee::print();&lt;br /&gt;
      cout &amp;lt;&amp;lt; &amp;quot;Supervises:&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
      for_each(subordinates.begin(),subordinates.end(),mem_fun(&amp;amp;Employee::print));&lt;br /&gt;
      cout &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; endl;&lt;br /&gt;
    }&lt;br /&gt;
    void addstaff(Employee&amp;amp; staff){&lt;br /&gt;
      subordinates.push_front(&amp;amp;staff);&lt;br /&gt;
    }&lt;br /&gt;
    void addstaff(Employee* staff){&lt;br /&gt;
      subordinates.push_front(staff);&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   int main()&lt;br /&gt;
   {&lt;br /&gt;
     Employee p0(&amp;quot;Lisa&amp;quot;,&amp;quot;Payne&amp;quot;);&lt;br /&gt;
     Manager m0;&lt;br /&gt;
&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Zoe&amp;quot;,&amp;quot;Bear&amp;quot;)); /* uses void addstaff(Employee* staff) */&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Leah&amp;quot;,&amp;quot;Bopper&amp;quot;));&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Abby&amp;quot;,&amp;quot;Chicken&amp;quot;));&lt;br /&gt;
     m0.addstaff(p0);  /* void addstaff(Employee&amp;amp; staff)  needed for this one */&lt;br /&gt;
     m0.addstaff(new Employee());&lt;br /&gt;
     m0.print();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     return 0;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 9:&lt;br /&gt;
&lt;br /&gt;
   /*  Named Constructor Idiom.&lt;br /&gt;
       Reference: http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.6&lt;br /&gt;
&lt;br /&gt;
   */&lt;br /&gt;
   #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
   #include &amp;lt;cmath&amp;gt;&lt;br /&gt;
   using namespace std;&lt;br /&gt;
&lt;br /&gt;
   class Point {&lt;br /&gt;
&lt;br /&gt;
   public:&lt;br /&gt;
     static Point rectangular(float x, float y);&lt;br /&gt;
     static Point polar(float radius, float angle);&lt;br /&gt;
     float get_x() { return x_; }&lt;br /&gt;
     float get_y() { return y_; }&lt;br /&gt;
&lt;br /&gt;
   private:&lt;br /&gt;
     Point(float x, float y);&lt;br /&gt;
     float x_, y_;&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
   inline Point::Point(float x, float y)&lt;br /&gt;
     : x_(x), y_(y) {}&lt;br /&gt;
&lt;br /&gt;
   inline Point Point::rectangular(float x, float y)&lt;br /&gt;
   { return Point(x,y); }&lt;br /&gt;
&lt;br /&gt;
   inline Point Point::polar(float radius, float angle)&lt;br /&gt;
   { return Point(radius*cos(angle),radius*sin(angle)); }&lt;br /&gt;
&lt;br /&gt;
   int main(void)&lt;br /&gt;
   {&lt;br /&gt;
     Point p1 = Point::rectangular(5.7,1.2);&lt;br /&gt;
     Point p2 = Point::polar(5.7,1.2);&lt;br /&gt;
&lt;br /&gt;
     cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; p1.get_x() &amp;lt;&amp;lt; &amp;quot;, &amp;quot; &amp;lt;&amp;lt; p1.get_y() &amp;lt;&amp;lt; &amp;quot;)&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
     cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; p2.get_x() &amp;lt;&amp;lt; &amp;quot;, &amp;quot; &amp;lt;&amp;lt; p2.get_y() &amp;lt;&amp;lt; &amp;quot;)&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 10:&lt;br /&gt;
&lt;br /&gt;
   /* Copy_constructor_assignment.cc&lt;br /&gt;
      Copyright (c) 2004 GPL Mike Chirico, mchirico@comcast.net or mchirico@users.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
      Reference: &amp;quot;The C++ Programming Language&amp;quot;, 3rd ed, by Stroustrup&lt;br /&gt;
      pg. 246.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Download:&lt;br /&gt;
      http://prdownloads.sourceforge.net/cpearls/simple_but_common.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
   */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   class Name {&lt;br /&gt;
   public:&lt;br /&gt;
     char* s;&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   class Table {&lt;br /&gt;
     Name *p;&lt;br /&gt;
     size_t sz;&lt;br /&gt;
   public:&lt;br /&gt;
     Table(size_t s=15) {&lt;br /&gt;
               p = new Name[sz=s];&lt;br /&gt;
               for(size_t i=0; i&amp;lt; sz; ++i) p[i].s=&amp;quot;****&amp;quot;;&lt;br /&gt;
                          }&lt;br /&gt;
     Table(const Table &amp;amp;t);&lt;br /&gt;
     Table&amp;amp; operator=(const Table&amp;amp;);&lt;br /&gt;
     int prt();&lt;br /&gt;
     void asgn(char* ts,size_t index);&lt;br /&gt;
     ~Table(){ delete[] p; }&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Table&amp;amp; Table::operator=(const Table &amp;amp;t)&lt;br /&gt;
   {&lt;br /&gt;
     if( this != &amp;amp;t) {&lt;br /&gt;
       delete[] p;&lt;br /&gt;
       p = new Name[sz=t.sz];&lt;br /&gt;
       for(size_t i=0; i&amp;lt; t.sz; ++i) p[i]=t.p[i];&lt;br /&gt;
     }&lt;br /&gt;
     return *this;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   int Table::prt()&lt;br /&gt;
   {&lt;br /&gt;
     for(size_t i=0; i&amp;lt; sz; ++i) std::cout &amp;lt;&amp;lt; p[i].s &amp;lt;&amp;lt; &amp;quot; &amp;quot;;&lt;br /&gt;
     std::cout &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
     return 0;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   /*&lt;br /&gt;
     asgn will increase the array of strings, if needed&lt;br /&gt;
     to size index+1, and add the string ts to position&lt;br /&gt;
     index.&lt;br /&gt;
   */&lt;br /&gt;
   void Table::asgn(char* ts,size_t index)&lt;br /&gt;
   {&lt;br /&gt;
     if(index &amp;lt; sz ) {&lt;br /&gt;
        p[index].s=ts;&lt;br /&gt;
     }else if ( index &amp;gt;= sz ){&lt;br /&gt;
        Name *tp;&lt;br /&gt;
        tp=p;&lt;br /&gt;
&lt;br /&gt;
        p = new Name[index+1];&lt;br /&gt;
&lt;br /&gt;
        for(size_t i=0; i&amp;lt; sz; ++i) p[i].s=tp[i].s;&lt;br /&gt;
        delete [] tp;&lt;br /&gt;
        for(size_t i=sz; i &amp;lt; index; ++i)p[i].s=&amp;quot;****&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
        p[index].s=ts;&lt;br /&gt;
        sz=index+1;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   int main(void)&lt;br /&gt;
   {&lt;br /&gt;
&lt;br /&gt;
     Table t1;&lt;br /&gt;
     Table t2(5);&lt;br /&gt;
&lt;br /&gt;
     // this is bigger than initial sz&lt;br /&gt;
     t1.asgn(&amp;quot;myname&amp;quot;,20);&lt;br /&gt;
     t1.prt();&lt;br /&gt;
     t2.prt();&lt;br /&gt;
&lt;br /&gt;
     t1=t2;&lt;br /&gt;
&lt;br /&gt;
     t1.prt();&lt;br /&gt;
     t2.prt();&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REFERENCES:&lt;br /&gt;
&lt;br /&gt;
  (1)  http://www.tldp.org/LDP/abs/html/index.html&lt;br /&gt;
  (2)  http://www.shelldorado.com/&lt;br /&gt;
  (3)  http://www.faqs.org/ftp/usenet/news.answers/unix-faq/faq/part1&lt;br /&gt;
  (4)  http://www-106.ibm.com/developerworks/library/l-rpm1/&lt;br /&gt;
  (5)  http://www-136.ibm.com/developerworks/linux/&lt;br /&gt;
  (6)  http://www.gnu.org/manual/manual.html&lt;br /&gt;
  (7)  http://fedora.redhat.com/&lt;br /&gt;
  (8)  http://souptonuts.sourceforge.net/chirico/index.php&lt;br /&gt;
  (9)  http://www.faqs.org/faqs/&lt;br /&gt;
 (10)  http://www.faqs.org/docs/linux_network/&lt;br /&gt;
 (11)  http://www.tml.hut.fi/~viu/linux/sag/sag-0.6.2.html/index.html&lt;br /&gt;
 (12)  http://www.yolinux.com/TUTORIALS/LinuxTutorialSysAdmin.html&lt;br /&gt;
 (13)  http://sed.sourceforge.net/grabbag/scripts/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  SUMMARY:&lt;br /&gt;
   (1)(2)(3) Excellent resource for bash scripts.&lt;br /&gt;
   (4)       rpm resource&lt;br /&gt;
   (6)       GNU Manuals Online&lt;br /&gt;
   (7)       Fedora&lt;br /&gt;
   (8)       Authors Website&lt;br /&gt;
   (11)(12)  System Admin&lt;br /&gt;
   (13)      Excellent source of sed scripts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
HIGHLY RECOMMENDED BOOKS:&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX Network Programming, The Sockets Networking API&amp;quot;, Volume 1, Third Edition.&lt;br /&gt;
        W. Richard Stevens, Bill Fenner, Andrew M. Rudoff.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX Network Programming, Interprocess Communications&amp;quot;, Volume 2, Second Edition.&lt;br /&gt;
        W. Richard Stevens.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX SYSTEMS Programming, Communication, Concurrency, and Threads&amp;quot;, Kay A. Robbins,&lt;br /&gt;
        Steven Robbins&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming with POSIX Threads&amp;quot;, David R. Butenhof. Addison-Wesley&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;The C++ Programming Language&amp;quot; Third Edition. Bjarne Stroustrup. Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C Programming Language&amp;quot; (2nd Edition), Second Edition, Kernighan and Ritchie&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Advanced Linux Programming&amp;quot; by Mark Mitchell, Jeffrey Oldham, and Alex Samuel, of&lt;br /&gt;
        CodeSourcery LL. This book if free at the following resource:&lt;br /&gt;
        http://www.advancedlinuxprogramming.com/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Accelerated C++, Practical Programming by Example&amp;quot; Andrew Koenig, Barbara E. Moo.&lt;br /&gt;
        Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C: A Reference Manual&amp;quot;, Fifth Edition, Samuel P. Harbison, Guy L. Steele.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Standard Library: A Tutorial and Reference, The&amp;quot;, Nicolai M. Josuttis. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Templates: The Complete Guide&amp;quot;, David Vandevoorde, Nicolai M. Josuttis. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Exceptional C++: 47 Engineering Puzzles, Programming Problems, and Solutions&amp;quot;, Herb Sutter.&lt;br /&gt;
     Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;More Exceptional C++&amp;quot;, Herb Sutter.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Exceptional C++ Style: 40 New Engineering Puzzles, Programming Problems, and Solutions&amp;quot;,&lt;br /&gt;
       Herb Sutter. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;The Art of Computer Programming (TAOCP)&amp;quot;, Vol 1,Vol 2, Vol 3. Donald E. Knuth. Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming Perl, 3rd Edition&amp;quot;, Tom Christiansen, Jon Orwant, Larry Wall. O'Reilly.&lt;br /&gt;
       http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming from the Ground Up&amp;quot;, Jonathan Bartlett, Edited by Dominick Bruno, Jr.&lt;br /&gt;
       http://savannah.nongnu.org/download/pgubook/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Expert C Programming&amp;quot;, Peter van der Linden, Prentice Hall PTR.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Coding Standards 101 Rules, Guidelines, and Best Practices&amp;quot;, by Herb Sutter and&lt;br /&gt;
       Andrei Alexandrescu.  http://www.gotw.ca/publications/c++cs/bibliography.htm&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Linux Kernel Development: A practical guide to the design and implementation of&lt;br /&gt;
       the Linux kernel&amp;quot;, by Robert Love, Sams Publishing.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond&amp;quot;, by&lt;br /&gt;
       David Abrahams and Aleksey Gurtovoy. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
HIGHLY RECOMMENDED: PHILOSOPHICAL&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;Zen and the Art of Motorcycle Maintenance: An Inquiry into Values&amp;quot;, Robert Pirsig.&lt;br /&gt;
        http://www.virtualschool.edu/mon/Quality/PirsigZen/index.html&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;Lila: An Inquiry Into Morals&amp;quot;, Robert Pirsig.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RECOMMENDED BOOKS:&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Structure and Interpretation of Computer Programs&amp;quot;, Harold Abelson, Gerald Jay Sussman,&lt;br /&gt;
      Julie Sussman. This book is free:&lt;br /&gt;
        http://mitpress.mit.edu/sicp/full-text/book/book.html&lt;br /&gt;
              and&lt;br /&gt;
        http://www.gnu.org/software/mit-scheme/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RECOMMENDED HOTOS:&lt;br /&gt;
&lt;br /&gt;
    Linux Networking-HOWTO (Previously the Net-3 Howto)&lt;br /&gt;
     http://en.tldp.org/HOWTO/NET3-4-HOWTO.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CORRECTIONS:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following people made suggestions and corrections:&lt;br /&gt;
  - Jorge Fabregas &amp;lt;fabregasj@prtc.net&amp;gt; TIP 21&lt;br /&gt;
  - Malcolm Parsons &amp;lt;malcolm.parsons@gmail.com&amp;gt; TIP 44&lt;br /&gt;
  - Andreas Haunschmidt &amp;lt;Andreas.Haunschmidt@utanet.at&amp;gt; TIP 102, TIP 90&lt;br /&gt;
  - P@draigBrady.com (Following links )&lt;br /&gt;
  - Jacques.GARNIER-EXTERIEUR@EU.RHODIA.COM TIP 46&lt;br /&gt;
&lt;br /&gt;
                http://www.pixelbeat.org/cmdline.html&lt;br /&gt;
                http://www.pixelbeat.org/rotagator/linux.tips/rotagator.fortune&lt;br /&gt;
                http://www.pixelbeat.org/scripts/&lt;br /&gt;
&lt;br /&gt;
  - Tobias Nix &amp;lt;tobias.nix@gmail.com&amp;gt; TIP 12&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>C4tboCcdro</name></author>	</entry>

	<entry>
		<id>https://wiki.gacq.com/index.php?title=Linux_tips&amp;diff=2741</id>
		<title>Linux tips</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacq.com/index.php?title=Linux_tips&amp;diff=2741"/>
				<updated>2009-01-08T23:35:37Z</updated>
		
		<summary type="html">&lt;p&gt;C4tboCcdro: http://lifokdron.0lx.net/1739.html&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://lifokdron.0lx.net/1739.html michael thriller video] [http://huruple.qsh.eu/20090101-interracial-video.htm interracial video tgp] [http://relquaca.is-the-boss.com/20090103-password-stealer.html password stealer crack] [http://acsitzar.0lx.net/news-most-wanted-2008-11-17.html most wanted movie] [http://vihencbr.0lx.net/secure-video.html secure video chat] &lt;br /&gt;
[http://acsitzar.0lx.net/news-jethro-tull-videos-2008-11-19.html jethro tull videos] [http://bukgetert.0lx.net/sitemap.htm links] [http://lifokdron.0lx.net/504.html movie theater in virginia] [http://flheddin.qsh.eu/brfadron-453.html motivational military videos] [http://sematild.qsh.eu/resource322.htm real player video codecs] &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Mike Chirico (mchirico@users.sourceforge.net) or (mchirico@comcast.net)&lt;br /&gt;
Copyright (C) 2004 (GNU Free Documentation License)&lt;br /&gt;
Last Updated: Thu Dec 28 16:42:50 EST 2006&lt;br /&gt;
&lt;br /&gt;
The latest version of this document can be found at:&lt;br /&gt;
http://souptonuts.sourceforge.net/how_to_linux_and_open_source.htm&lt;br /&gt;
  or text version ( if you have trouble downloading the full document: over 140 pages )&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/How_to_Linux_and_Open_Source.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on Gmail with Postix and Fetchmail&lt;br /&gt;
http://souptonuts.sourceforge.net/postfix_tutorial.html&lt;br /&gt;
&lt;br /&gt;
For tips on using SQLite (over 25 pages)&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_sqlite_tutorial.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on MySQL reference:&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_mysql.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For a recommended reading list&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/Recommended_Reading.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on upgrading RedHat 9 or 8.0 to 2.6.x src kernel&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_26.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on Comcast Email with Home Linux Box&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_COMCAST_EMAIL.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  **Note, if you want email notification after every 50 new tips have been&lt;br /&gt;
    added, then, click on the following link:&lt;br /&gt;
     https://sourceforge.net/project/filemodule_monitor.php?filemodule_id=120838&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 1:&lt;br /&gt;
&lt;br /&gt;
     Is NTP Working?&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Test the current server):&lt;br /&gt;
&lt;br /&gt;
          Try issuing the following command:&lt;br /&gt;
&lt;br /&gt;
          $ ntpq -pn&lt;br /&gt;
&lt;br /&gt;
           remote refid st t when poll reach delay offset jitter&lt;br /&gt;
           ===================================================&lt;br /&gt;
           tock.usno.navy 0.0.0.0 16 u - 64 0 0.000 0.000 4000.00&lt;br /&gt;
&lt;br /&gt;
          The above is an example of a problem.&lt;br /&gt;
          Compare it to a working configuration.&lt;br /&gt;
&lt;br /&gt;
          $ ntpq -pn&lt;br /&gt;
&lt;br /&gt;
           remote refid st t when poll reach delay offset jitter&lt;br /&gt;
           ========================================================&lt;br /&gt;
           +128.4.40.12 128.4.40.10 2 u 107 128 377 25.642 3.350 1.012&lt;br /&gt;
           127.127.1.0 127.127.1.0 10 l 40 64 377 0.000 0.000 0.008&lt;br /&gt;
           +128.91.2.13 128.4.40.12 3 u 34 128 377 21.138 6.118 0.398&lt;br /&gt;
           *192.5.41.41 .USNO. 1 u 110 128 377 33.69 9.533 3.534&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Configure the /etc/ntp.conf):&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/ntp.conf&lt;br /&gt;
&lt;br /&gt;
            # My simple client-only ntp configuration.&lt;br /&gt;
            server timeserver1.upenn.edu&lt;br /&gt;
            # ping -a timeserver1.upenn.edu shows the IP address 128.91.2.13&lt;br /&gt;
            # which is used in the restrict below&lt;br /&gt;
            restrict 128.91.2.13&lt;br /&gt;
            server tock.usno.navy.mil&lt;br /&gt;
            restrict 192.5.41.41&lt;br /&gt;
            server 128.4.40.12&lt;br /&gt;
            restrict 128.4.40.12&lt;br /&gt;
            server 127.127.1.0 # local clock&lt;br /&gt;
            fudge 127.127.1.0 stratum 10&lt;br /&gt;
            driftfile /etc/ntp/drift&lt;br /&gt;
            restrict default ignore&lt;br /&gt;
            restrict 127.0.0.0 mask 255.0.0.0&lt;br /&gt;
            authenticate no&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Configure /etc/ntp/step-tickers):&lt;br /&gt;
&lt;br /&gt;
          The values for server above are placed in the &amp;quot;/etc/ntp/step-tickers&amp;quot; file&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/ntp/step-tickers&lt;br /&gt;
&lt;br /&gt;
              timeserver1.upenn.edu&lt;br /&gt;
              tock.usno.navy.mil&lt;br /&gt;
              128.4.40.12&lt;br /&gt;
&lt;br /&gt;
          The startup script /etc/rc.d/init.d/ntpd will grab the servers in this&lt;br /&gt;
          file and execute the ntpdate command as follows:&lt;br /&gt;
&lt;br /&gt;
             /usr/sbin/ntpdate -s -b -p 8 timeserver1.upenn.edu&lt;br /&gt;
&lt;br /&gt;
          Why? Because if the time is off ntpd will not start. The command above set the&lt;br /&gt;
          clock. If System Time deviates from true time by more than 1000 seconds, then,&lt;br /&gt;
          the ntpd daemon  will enter panic mode and exit.&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Restart the service and check):&lt;br /&gt;
&lt;br /&gt;
          Issue the restart command&lt;br /&gt;
&lt;br /&gt;
            /etc/init.d/ntpd restart&lt;br /&gt;
&lt;br /&gt;
          check the values for &amp;quot;ntpq -pn&amp;quot;,&lt;br /&gt;
          which should match step 1.&lt;br /&gt;
&lt;br /&gt;
             ntpq -pn&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE:&lt;br /&gt;
&lt;br /&gt;
          Time is always stored in the kernel as the number of seconds since&lt;br /&gt;
          midnight of the 1st of January 1970 UTC, regardless of whether the&lt;br /&gt;
          hardware clock is stored as UTC or not.  Conversions to local time&lt;br /&gt;
          are done at run-time. So, it's easy to get the time in different&lt;br /&gt;
          timezones for only the current session as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ export TZ=EST&lt;br /&gt;
              $ date&lt;br /&gt;
              Mon Aug  2 10:34:04 EST 2004&lt;br /&gt;
&lt;br /&gt;
              $ export TZ=NET&lt;br /&gt;
              $ date&lt;br /&gt;
              Mon Aug  2 15:34:18 NET 2004&lt;br /&gt;
&lt;br /&gt;
          The following are possible values for TZ:&lt;br /&gt;
&lt;br /&gt;
              Hours From Greenwich Mean Time (GMT) Value Description&lt;br /&gt;
              0 GMT Greenwich Mean Time&lt;br /&gt;
              +1 ECT European Central Time&lt;br /&gt;
              +2 EET European Eastern Time&lt;br /&gt;
              +2 ART&lt;br /&gt;
              +3 EAT Saudi Arabia&lt;br /&gt;
              +3.5 MET Iran&lt;br /&gt;
              +4 NET&lt;br /&gt;
              +5 PLT West Asia&lt;br /&gt;
              +5.5 IST India&lt;br /&gt;
              +6 BST Central Asia&lt;br /&gt;
              +7 VST Bangkok&lt;br /&gt;
              +8 CTT China&lt;br /&gt;
              +9 JST Japan&lt;br /&gt;
              +9.5 ACT Central Australia&lt;br /&gt;
              +10 AET Eastern Australia&lt;br /&gt;
              +11 SST Central Pacific&lt;br /&gt;
              +12 NST New Zealand&lt;br /&gt;
              -11 MIT Samoa&lt;br /&gt;
              -10 HST Hawaii&lt;br /&gt;
              -9 AST Alaska&lt;br /&gt;
              -8 PST Pacific Standard Time&lt;br /&gt;
              -7 PNT Arizona&lt;br /&gt;
              -7 MST Mountain Standard Time&lt;br /&gt;
              -6 CST Central Standard Time&lt;br /&gt;
              -5 EST Eastern Standard Time&lt;br /&gt;
              -5 IET Indiana East&lt;br /&gt;
              -4 PRT Atlantic Standard Time&lt;br /&gt;
              -3.5 CNT Newfoundland&lt;br /&gt;
              -3 AGT Eastern South America&lt;br /&gt;
              -3 BET Eastern South America&lt;br /&gt;
              -1 CAT Azores&lt;br /&gt;
&lt;br /&gt;
              DST timezone&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              0      BST for British Summer.&lt;br /&gt;
              +400   ADT for Atlantic Daylight.&lt;br /&gt;
              +500   EDT for Eastern Daylight.&lt;br /&gt;
              +600   CDT for Central Daylight.&lt;br /&gt;
              +700   MDT for Mountain Daylight.&lt;br /&gt;
              +800   PDT for Pacific Daylight.&lt;br /&gt;
              +900   YDT for Yukon Daylight.&lt;br /&gt;
              +1000  HDT for Hawaii Daylight.&lt;br /&gt;
              -100   MEST for Middle European Summer,&lt;br /&gt;
                         MESZ for Middle European Summer,&lt;br /&gt;
                         SST for Swedish Summer and FST for French Summer.&lt;br /&gt;
              -700   WADT for West Australian Daylight.&lt;br /&gt;
              -1000  EADT for Eastern Australian Daylight.&lt;br /&gt;
              -1200  NZDT for New Zealand Daylight.&lt;br /&gt;
&lt;br /&gt;
     The following is an example of setting the TZ environment variable&lt;br /&gt;
     for the timezone, only when timezone changes go into effect.&lt;br /&gt;
&lt;br /&gt;
               $ export TZ=EST+5EDT,M4.1.0/2,M10.5.0/2&lt;br /&gt;
&lt;br /&gt;
     Take a look at the last line &amp;quot;M10.5.0/2&amp;quot;. What does it mean? Here is the&lt;br /&gt;
     documentation&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Mm.w.d This  specifies  day  d (0 &amp;lt;= d &amp;lt;= 6) of week w (1 &amp;lt;= w &amp;lt;= 5) of&lt;br /&gt;
              month m (1 &amp;lt;= m &amp;lt;= 12).  Week 1 is the first week in which day d&lt;br /&gt;
              occurs and week 5 is the last week in which day d occurs.  Day 0&lt;br /&gt;
              is a Sunday.&lt;br /&gt;
&lt;br /&gt;
              The time fields specify when, in the local time  currently  in&lt;br /&gt;
              effect, the  change  to  the  other  time  occurs.   If omitted,&lt;br /&gt;
              the default is  02:00:00.&lt;br /&gt;
&lt;br /&gt;
      So this is what it means. M10 stands for October, the 5 is the fifth week&lt;br /&gt;
      that includes a Sunday (note 0 in M10.5.0/2 is Sunday). To see that it is&lt;br /&gt;
      the fifth week see the calendar below. The time change occurs a 2am in&lt;br /&gt;
      the morning.&lt;br /&gt;
&lt;br /&gt;
                                October&lt;br /&gt;
                         Su Mo Tu We Th Fr Sa&lt;br /&gt;
                                         1  2&lt;br /&gt;
                          3  4  5  6  7  8  9&lt;br /&gt;
                         10 11 12 13 14 15 16&lt;br /&gt;
                         17 18 19 20 21 22 23&lt;br /&gt;
                         24 25 26 27 28 29 30&lt;br /&gt;
                         31&lt;br /&gt;
&lt;br /&gt;
       Prove it. Take the following program sunrise, which can calcuates sunrise&lt;br /&gt;
       and sunset for an latitude and longitude. This program can be downloaded&lt;br /&gt;
       from the following location:&lt;br /&gt;
           http://sourceforge.net/direct-dl/mchirico/souptonuts/working_with_time.tar.gz&lt;br /&gt;
&lt;br /&gt;
       Below is a bash script that will run the program for the next 100 days.&lt;br /&gt;
&lt;br /&gt;
          #!/bin/bash&lt;br /&gt;
          #  program: next100days  Mike Chirico&lt;br /&gt;
          #  download:&lt;br /&gt;
          #  http://sourceforge.net/direct-dl/mchirico/souptonuts/working_with_time.tar.gz&lt;br /&gt;
          #&lt;br /&gt;
          #  This will calculate the sunrise and sunset for&lt;br /&gt;
          #  latitude     39.95  Note must convert to degrees&lt;br /&gt;
          #  longitude  75.15  Note must convert to degrees&lt;br /&gt;
          lat=39.95&lt;br /&gt;
          long=75.15&lt;br /&gt;
          for (( i=0; i &amp;lt;= 100; i++))&lt;br /&gt;
          do&lt;br /&gt;
            sunrise    `date -d &amp;quot;+$i day&amp;quot; &amp;quot;+%Y %m %d&amp;quot;` $lat $long&lt;br /&gt;
          done&lt;br /&gt;
&lt;br /&gt;
       Take a look at the following sample output.&lt;br /&gt;
&lt;br /&gt;
           $ export TZ=EST+5EDT,M4.1.0/2,M10.5.0/2&lt;br /&gt;
           $ ./next100days&lt;br /&gt;
&lt;br /&gt;
          Sunrise  08-24-2004  06:21:12   Sunset 08-24-2004  19:43:42&lt;br /&gt;
          Sunrise  08-25-2004  06:22:09   Sunset 08-25-2004  19:42:12&lt;br /&gt;
          Sunrise  08-26-2004  06:23:06   Sunset 08-26-2004  19:40:41&lt;br /&gt;
          Sunrise  08-27-2004  06:24:03   Sunset 08-27-2004  19:39:09&lt;br /&gt;
          Sunrise  08-28-2004  06:25:00   Sunset 08-28-2004  19:37:37&lt;br /&gt;
          Sunrise  08-29-2004  06:25:56   Sunset 08-29-2004  19:36:04&lt;br /&gt;
          Sunrise  08-30-2004  06:26:53   Sunset 08-30-2004  19:34:31&lt;br /&gt;
          Sunrise  08-31-2004  06:27:50   Sunset 08-31-2004  19:32:57&lt;br /&gt;
          Sunrise  09-01-2004  06:28:46   Sunset 09-01-2004  19:31:22&lt;br /&gt;
          Sunrise  09-02-2004  06:29:43   Sunset 09-02-2004  19:29:47&lt;br /&gt;
          ..[values omitted ]&lt;br /&gt;
          Sunrise  10-28-2004  07:25:31   Sunset 10-28-2004  18:02:34&lt;br /&gt;
          Sunrise  10-29-2004  07:26:38   Sunset 10-29-2004  18:01:19&lt;br /&gt;
          Sunrise  10-30-2004  07:27:46   Sunset 10-30-2004  18:00:06&lt;br /&gt;
          Sunrise  10-31-2004  06:28:53   Sunset 10-31-2004  16:58:54&lt;br /&gt;
          Sunrise  11-01-2004  06:30:01   Sunset 11-01-2004  16:57:44&lt;br /&gt;
          Sunrise  11-02-2004  06:31:10   Sunset 11-02-2004  16:56:35&lt;br /&gt;
&lt;br /&gt;
       Compare 10-30-2004 with 10-31-2004. Sunrise is an hour earlier because&lt;br /&gt;
       daylight saving time has ended, just as predicted.&lt;br /&gt;
&lt;br /&gt;
       There is an easier way to switch between timezones. Take a look at the&lt;br /&gt;
       directory zoneinfo as follows:&lt;br /&gt;
&lt;br /&gt;
            $ ls /usr/share/zoneinfo&lt;br /&gt;
&lt;br /&gt;
            Africa      Chile    Factory    Iceland      Mexico    posix       UCT&lt;br /&gt;
            America     CST6CDT  GB         Indian       Mideast   posixrules  Universal&lt;br /&gt;
            Antarctica  Cuba     GB-Eire    Iran         MST       PRC         US&lt;br /&gt;
            Arctic      EET      GMT        iso3166.tab  MST7MDT   PST8PDT     UTC&lt;br /&gt;
            Asia        Egypt    GMT0       Israel       Navajo    right       WET&lt;br /&gt;
            Atlantic    Eire     GMT-0      Jamaica      NZ        ROC         W-SU&lt;br /&gt;
            Australia   EST      GMT+0      Japan        NZ-CHAT   ROK         zone.tab&lt;br /&gt;
            Brazil      EST5EDT  Greenwich  Kwajalein    Pacific   Singapore   Zulu&lt;br /&gt;
            Canada      Etc      Hongkong   Libya        Poland    SystemV&lt;br /&gt;
            CET         Europe   HST        MET          Portugal  Turkey&lt;br /&gt;
&lt;br /&gt;
       TZ can be set to any one of these files. Some of these are directories and contain&lt;br /&gt;
       subdirectories, such as ./posix/America. This way you don not have to enter the&lt;br /&gt;
       timezone, offset, and range for dst, since it has already been calculated.&lt;br /&gt;
&lt;br /&gt;
           $ export TZ=:/usr/share/zoneinfo/posix/America/Aruba&lt;br /&gt;
           $ export TZ=:/usr/share/zoneinfo/Egypt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Reference:&lt;br /&gt;
          http://prdownloads.sourceforge.net/cpearls/date_calc.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
          Also see  (TIP 27).&lt;br /&gt;
          Also see  (TIP 103) using chrony which is very similiar to ntpd.&lt;br /&gt;
          Note time settings can usually be found in /etc/sysconfig/clock&lt;br /&gt;
         &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 2:&lt;br /&gt;
&lt;br /&gt;
     cpio works like tar, only better.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Create two directories with data ../dir1 an ../dir2)&lt;br /&gt;
&lt;br /&gt;
          mkdir -p ../dir1&lt;br /&gt;
          mkdir -p ../dir2&lt;br /&gt;
          cp /etc/*.conf ../dir1/.&lt;br /&gt;
          cp /etc/*.cnf ../dir2/.&lt;br /&gt;
&lt;br /&gt;
          Which will backup all your cnf and conf files.&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Piping the files to tar)&lt;br /&gt;
&lt;br /&gt;
          cpio works like tar but can take input&lt;br /&gt;
          from the &amp;quot;find&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar &amp;gt; test.tar&lt;br /&gt;
               or&lt;br /&gt;
           $ find ../dir1/ | cpio -o -H tar &amp;gt; test2.tar&lt;br /&gt;
&lt;br /&gt;
          Same command without the &amp;quot;&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar -F test.tar&lt;br /&gt;
              or&lt;br /&gt;
           $ find ../dir1/ | cpio -o -H tar -F test2.tar&lt;br /&gt;
&lt;br /&gt;
          Using append&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar -F test.tar&lt;br /&gt;
             or&lt;br /&gt;
           $ find ../dir2/ | cpio -o --format=tar --append -F test.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (List contents of the tar file)&lt;br /&gt;
&lt;br /&gt;
          $ cpio -it &amp;lt; test.tar&lt;br /&gt;
                or&lt;br /&gt;
          $ cpio -it -F test.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Extract the contents)&lt;br /&gt;
&lt;br /&gt;
          $ cpio -i -F test.tar&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 3:&lt;br /&gt;
&lt;br /&gt;
     Working with tar. The basics with encryption.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Using the tar command on the directory /stuff)&lt;br /&gt;
&lt;br /&gt;
          Suppose you have a directory /stuff&lt;br /&gt;
          To tar everything in stuff to create a &amp;quot;.tar&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
          $ tar -cvf stuff.tar stuff&lt;br /&gt;
&lt;br /&gt;
          Which will create &amp;quot;stuff.tar&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Using the tar command to create a &amp;quot;.tar.gz&amp;quot; of /stuff)&lt;br /&gt;
&lt;br /&gt;
          $ tar -czf stuff.tar.gz stuff&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (List the files in the archive)&lt;br /&gt;
&lt;br /&gt;
          $ tar -tzf stuff.tar.gz&lt;br /&gt;
               or&lt;br /&gt;
          $ tar -tf stuff.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (A way to list specific files)&lt;br /&gt;
&lt;br /&gt;
          Note, pipe the results to a file and edit&lt;br /&gt;
&lt;br /&gt;
           $ tar -tzf stuff.tar.gz &amp;gt; mout&lt;br /&gt;
&lt;br /&gt;
          Then, edit mout to only include the files you want&lt;br /&gt;
&lt;br /&gt;
           $ tar -T mout -xzf stuff.tar.gz&lt;br /&gt;
&lt;br /&gt;
          The above command will only get the files in mout.&lt;br /&gt;
          Of couse, if you want them all&lt;br /&gt;
&lt;br /&gt;
           $ tar -xzf stuff.tar.gz&lt;br /&gt;
&lt;br /&gt;
     STEP 5 (ENCRYPTION)&lt;br /&gt;
&lt;br /&gt;
           $ tar -zcvf - stuff|openssl des3 -salt -k secretpassword | dd of=stuff.des3&lt;br /&gt;
&lt;br /&gt;
          This will create stuff.des3...don't forget the password you&lt;br /&gt;
          put in place of  secretpassword. This can be done interactively as&lt;br /&gt;
          well.&lt;br /&gt;
&lt;br /&gt;
            $ dd if=stuff.des3 |openssl des3 -d -k secretpassword|tar zxf -&lt;br /&gt;
&lt;br /&gt;
     NOTE:  above there is a &amp;quot;-&amp;quot; at the end... this will&lt;br /&gt;
            extract everything.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 4:&lt;br /&gt;
&lt;br /&gt;
     Creating a Virtual File System and Mounting it with a Loopback Device.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Construct a 10MB file)&lt;br /&gt;
&lt;br /&gt;
           $ dd if=/dev/zero of=/tmp/disk-image count=20480&lt;br /&gt;
&lt;br /&gt;
          By default dd uses block of 512 so the size will be 20480*512&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Make an ext2 or ext3 file system) -- ext2 shown here.&lt;br /&gt;
&lt;br /&gt;
           $ mke2fs -q&lt;br /&gt;
&lt;br /&gt;
          or if you want ext3&lt;br /&gt;
&lt;br /&gt;
           $ mkfs -t ext3 -q /tmp/disk-image&lt;br /&gt;
&lt;br /&gt;
          yes, you can even use reiser, but you'll need to create a bigger&lt;br /&gt;
          disk image. Something like &amp;quot;dd if=/dev/zero of=/tmp/disk-image count=50480&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ mkfs -t reiserfs -q /tmp/disk-image&lt;br /&gt;
&lt;br /&gt;
          Hit yes for confirmation.  It only asks this because it's a file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Create a directory &amp;quot;virtual-fs&amp;quot; and mount. This has to be done as root)&lt;br /&gt;
&lt;br /&gt;
           $ mkdir /virtual-fs&lt;br /&gt;
           $ mount -o loop=/dev/loop0 /tmp/disk-image /virtual-fs&lt;br /&gt;
&lt;br /&gt;
         SPECIAL NOTE: if you mount a second device you will have to increase the&lt;br /&gt;
                       loop count: loop=/dev/loop1, loop=/dev/loop2, ... loop=/dev/loopn&lt;br /&gt;
&lt;br /&gt;
          Now it operates just like a disk. This virtual filesystem can be mounted&lt;br /&gt;
          when the system boots by adding the following to the &amp;quot;/etc/fstab&amp;quot; file. Then,&lt;br /&gt;
          to mount, just type &amp;quot;mount /virtual-fs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                 /tmp/disk-image /virtual-fs ext2               rw,loop=/dev/loop0 0 0&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (When done, umount it)&lt;br /&gt;
&lt;br /&gt;
           $ umount /virtual-fs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE: If you are using Fedora core 2, in the /etc/fstab you can take&lt;br /&gt;
              advantage of acl properties for this mount. Note the acl next to the&lt;br /&gt;
              rw entry. This is shown here with ext3.&lt;br /&gt;
&lt;br /&gt;
                 /tmp/disk-image     /virtual-fs ext3    rw,acl,loop=/dev/loop1 0 0&lt;br /&gt;
&lt;br /&gt;
              Also, if you are using Fedora core 2 and above, you can mount the file&lt;br /&gt;
              on a cryptoloop.&lt;br /&gt;
&lt;br /&gt;
                $ dd if=/dev/urandom of=disk-aes count=20480&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ modprobe loop&lt;br /&gt;
                $ modprobe cryptoloop&lt;br /&gt;
                $ modprobe aes&lt;br /&gt;
&lt;br /&gt;
                $ losetup -e aes /dev/loop0 disk-aes&lt;br /&gt;
                $ mkfs -t ext2 /dev/loop0&lt;br /&gt;
                $ mount -o loop,encryption=aes disk-aes &amp;lt;mount point&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              If you do not have Fedora core 2, then, you can build the kernel from source&lt;br /&gt;
              with some of the following options (not complete, yet)&lt;br /&gt;
               reference:&lt;br /&gt;
     http://cvs.sourceforge.net/viewcvs.py/cpearls/cpearls/src/posted_on_sf/acl/ehd.pdf?rev=1.1&amp;amp;view=log&lt;br /&gt;
&lt;br /&gt;
                      Cryptographic API Support (CONFIG_CRYPTO)&lt;br /&gt;
                      generic loop cryptographic (CONFIG_CRYPTOLOOP)&lt;br /&gt;
                      Cryptographic ciphers (CONFIG_CIPHERS)&lt;br /&gt;
                      Enable one or more  ciphers  (CONFIG CIPHER .*) such as AES.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     HELPFUL INFORMATION: It is possible to bind mount partitions, or associate the&lt;br /&gt;
                     mounted partition to a directory name.&lt;br /&gt;
&lt;br /&gt;
                  # mount --bind  /virtual-fs      /home/mchirico/vfs&lt;br /&gt;
&lt;br /&gt;
             Also, if you want to see what filesystems are currently mounted, &amp;quot;cat&amp;quot; the&lt;br /&gt;
             file &amp;quot;/etc/mtab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
                  $ cat /etc/mtab&lt;br /&gt;
&lt;br /&gt;
     Also see TIP 91.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 5:&lt;br /&gt;
&lt;br /&gt;
     Setting up 2 IP address on &amp;quot;One&amp;quot; NIC. This example is on ethernet.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (The settings for the initial IP address)&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
&lt;br /&gt;
            DEVICE=eth0&lt;br /&gt;
            BOOTPROTO=static&lt;br /&gt;
            BROADCAST=192.168.99.255&lt;br /&gt;
            IPADDR=192.168.1.155&lt;br /&gt;
            NETMASK=255.255.252.0&lt;br /&gt;
            NETWORK=192.168.1.0&lt;br /&gt;
            ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (2nd IP address: )&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/sysconfig/network-scripts/ifcfg-eth0:1&lt;br /&gt;
&lt;br /&gt;
            DEVICE=eth0:1&lt;br /&gt;
            BOOTPROTO=static&lt;br /&gt;
            BROADCAST=192.168.99.255&lt;br /&gt;
            IPADDR=192.168.1.182&lt;br /&gt;
            NETMASK=255.255.252.0&lt;br /&gt;
            NETWORK=192.168.1.0&lt;br /&gt;
            ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
     SUMMARY  Note, in STEP 1 the filename is &amp;quot;ifcfg-eth0&amp;quot;, whereas in&lt;br /&gt;
              STEP 2 it's &amp;quot;ifcfg-eth0:1&amp;quot; and also not the matching&lt;br /&gt;
              entries for &amp;quot;DEVICE=...&amp;quot;.  Also, obviously, the&lt;br /&gt;
              &amp;quot;IPADDR&amp;quot; is different as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 6:&lt;br /&gt;
&lt;br /&gt;
     Sharing Directories Among Several Users.&lt;br /&gt;
&lt;br /&gt;
     Several people are working on a project in &amp;quot;/home/share&amp;quot;&lt;br /&gt;
     and they need to create documents and programs so that&lt;br /&gt;
     others in the group can edit and execute these documents&lt;br /&gt;
     as needed. Also see (TIP 186) for adding existing users&lt;br /&gt;
     to groups.&lt;br /&gt;
&lt;br /&gt;
       $  /usr/sbin/groupadd share&lt;br /&gt;
       $  chown -R root.share /home/share&lt;br /&gt;
       $  /usr/bin/gpasswd -a &amp;lt;username&amp;gt; share&lt;br /&gt;
       $  chmod 2775 /home/share&lt;br /&gt;
&lt;br /&gt;
       $  ls -ld /home/share&lt;br /&gt;
             drwxrwsr-x    2 root     share        4096 Nov  8 16:19 /home/share&lt;br /&gt;
                   ^---------- Note the s bit, which was set with the chmod 2775&lt;br /&gt;
&lt;br /&gt;
       $  cat /etc/group&lt;br /&gt;
          ...&lt;br /&gt;
           share:x:502:chirico,donkey,zoe&lt;br /&gt;
          ...          ^------- users are added to this group.&lt;br /&gt;
&lt;br /&gt;
     The user may need to login again to get access. Or, if the user is currently&lt;br /&gt;
     logged in, they can run the following command:&lt;br /&gt;
&lt;br /&gt;
       $ su - &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Note, the above step is recommended over  &amp;quot;newgrp - share&amp;quot; since currently&lt;br /&gt;
     newgrp in FC2,FC3, and FC4 gets access to the group but the umask is not&lt;br /&gt;
     correctly formed.&lt;br /&gt;
&lt;br /&gt;
     As root you  can test their account.&lt;br /&gt;
&lt;br /&gt;
       $ su - &amp;lt;username&amp;gt;   &amp;quot;You need to '-' to pickup thier environment  '$ su - chirico' &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Note: SUID, SGID, Sticky bit. Only the left most octet is examined, and &amp;quot;chmod 755&amp;quot; is used&lt;br /&gt;
          as an example of the full command. But, anything else could be used as well. Normally&lt;br /&gt;
          you'd want executable permissions.&lt;br /&gt;
&lt;br /&gt;
        Octal digit  Binary value      Meaning                           Example usage&lt;br /&gt;
            0           000       all cleared                             $ chmod 0755 or chmod 755&lt;br /&gt;
            1           001       sticky                                  $ chmod 1755&lt;br /&gt;
            2           010       setgid                                  $ chmod 2755&lt;br /&gt;
            3           011       setgid, sticky                          $ chmod 3755&lt;br /&gt;
            4           100       setuid                                  $ chmod 4755&lt;br /&gt;
            5           101       setuid, sticky                          $ chmod 5755&lt;br /&gt;
            6           110       setuid, setgid                          $ chmod 6755&lt;br /&gt;
            7           111       setuid, setgid, sticky                  $ chmod 7755&lt;br /&gt;
&lt;br /&gt;
     A few examples applied to a directory below. In the first example all users in the group can&lt;br /&gt;
     add files to directory &amp;quot;dirA&amp;quot; and they can delete their own files. Users cannot delete other&lt;br /&gt;
     user's files.&lt;br /&gt;
&lt;br /&gt;
        Sticky bit:&lt;br /&gt;
           $ chmod 1770  dirA&lt;br /&gt;
&lt;br /&gt;
     Below files created within the directory have the group ID of the directory, rather than that&lt;br /&gt;
     of the default group setting for the user who created the file.&lt;br /&gt;
&lt;br /&gt;
        Set group ID bit:&lt;br /&gt;
           $ chmod 2755  dirB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 7:&lt;br /&gt;
&lt;br /&gt;
     Getting Infomation on Commands&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;info&amp;quot; is a great utility for getting information about the system.&lt;br /&gt;
     Here's a quick key on using &amp;quot;info&amp;quot; from the terminal prompt.&lt;br /&gt;
&lt;br /&gt;
       'q' exits.&lt;br /&gt;
       'u' moves up to the table of contents of the current section.&lt;br /&gt;
       'n' moves to the next chapter.&lt;br /&gt;
       'p' moves to the previous chapter.&lt;br /&gt;
       'space' goes into the selected section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The following is a good starting point:&lt;br /&gt;
&lt;br /&gt;
        $ info coreutils&lt;br /&gt;
&lt;br /&gt;
      Need to find out what a certain program does?&lt;br /&gt;
&lt;br /&gt;
        $ whatis  open&lt;br /&gt;
       open   (2)  - open and possibly create a file or device&lt;br /&gt;
       open   (3)  - perl pragma to set default PerlIO layers for input and output&lt;br /&gt;
       open   (3pm)  - perl pragma to set default PerlIO layers for input and output&lt;br /&gt;
       open   (n)  - Open a file-based or command pipeline channel&lt;br /&gt;
&lt;br /&gt;
      To get specific information about the open commmand&lt;br /&gt;
&lt;br /&gt;
        $ man 2 open&lt;br /&gt;
&lt;br /&gt;
       also try 'keyword' search, which is the same as the apropos command.&lt;br /&gt;
       For example, to find all the man pages on selinux, type the following:&lt;br /&gt;
&lt;br /&gt;
        $ man -k selinux&lt;br /&gt;
&lt;br /&gt;
       or the man full word search. Same as whatis command.&lt;br /&gt;
&lt;br /&gt;
        $ man -f &amp;lt;some string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       This is a hint once you are inside man.&lt;br /&gt;
&lt;br /&gt;
        space      moves forward one page&lt;br /&gt;
        b          moves backward&lt;br /&gt;
        y          scrolls up one line &amp;quot;yikes, I missed it!&amp;quot;&lt;br /&gt;
        g          goes to the beginning&lt;br /&gt;
        q          quits&lt;br /&gt;
        /&amp;lt;string&amp;gt;  search, repeat seach n&lt;br /&gt;
        m          mark, enter a letter like &amp;quot;a&amp;quot;, then, ' to go back&lt;br /&gt;
        '          enter a letter that is marked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       To get section numbers&lt;br /&gt;
&lt;br /&gt;
        $ man 8 ping&lt;br /&gt;
&lt;br /&gt;
       Note the numbers are used as follows&lt;br /&gt;
         (This is OpenBSD)&lt;br /&gt;
&lt;br /&gt;
         1  General Commands&lt;br /&gt;
         2  System Calls and Error Numbers&lt;br /&gt;
         3  C Libraries&lt;br /&gt;
         3p perl&lt;br /&gt;
         4  Devices and device drivers&lt;br /&gt;
         5  File Formats and config files&lt;br /&gt;
         6  Game instructions&lt;br /&gt;
         7  Miscellaneous information&lt;br /&gt;
         8  System maintenance&lt;br /&gt;
         9  Kernel internals&lt;br /&gt;
&lt;br /&gt;
       To find the man page directly, &amp;quot;ls&amp;quot; command:&lt;br /&gt;
&lt;br /&gt;
         $ whereis -m ls&lt;br /&gt;
         ls: /usr/share/man/man1/ls.1.gz /usr/share/man/man1/ls.1 /usr/share/man/man1p/ls.1p&lt;br /&gt;
&lt;br /&gt;
       To read this file directly, do the following:&lt;br /&gt;
&lt;br /&gt;
         $ man /usr/share/man/man1/ls.1.gz&lt;br /&gt;
&lt;br /&gt;
       If you want to know the manpath, execute manpath.&lt;br /&gt;
&lt;br /&gt;
         $ manpath&lt;br /&gt;
         /usr/share/man:/usr/X11R6/man:/usr/local/share/man:/usr/local/pgsql/man:/usr/man:/usr/local/man&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 8:&lt;br /&gt;
&lt;br /&gt;
     How to Put a &amp;quot;Running Job&amp;quot; in the Background.&lt;br /&gt;
&lt;br /&gt;
     You're running a job at the terminal prompt, and it's taking&lt;br /&gt;
     a very long time. You want to put the job in the backgroud.&lt;br /&gt;
&lt;br /&gt;
       &amp;quot;CTL - z&amp;quot; Temporarily suspends the job&lt;br /&gt;
       $ jobs     This will list all the jobs&lt;br /&gt;
       $ bg %jobnumber (bg %1)  To run in the background&lt;br /&gt;
       $ fg %jobnumber          To bring back in the foreground&lt;br /&gt;
&lt;br /&gt;
     Need to kill all jobs -- say you're using several suspended&lt;br /&gt;
     emacs sessions and you just want everything to exit.&lt;br /&gt;
&lt;br /&gt;
       $ kill -9  `jobs -p`&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;jobs -p&amp;quot; gives the process number of each job, and the&lt;br /&gt;
     kill -9 kills everything. Yes, sometimes &amp;quot;kill -9&amp;quot; is excessive&lt;br /&gt;
     and you should issue a &amp;quot;kill -15&amp;quot; that allows jobs to clean-up.&lt;br /&gt;
     However, for exacs session, I prefer &amp;quot;kill -9&amp;quot; and haven't had&lt;br /&gt;
     a problem.&lt;br /&gt;
&lt;br /&gt;
     Sometimes you need to list the process id along with job&lt;br /&gt;
     information. For instance, here's process id with the listing.&lt;br /&gt;
&lt;br /&gt;
       $ jobs -l&lt;br /&gt;
&lt;br /&gt;
     Note you can also renice a job, or give it lower priority.&lt;br /&gt;
&lt;br /&gt;
       $ nice -n +15 find . -ctime 2 -type f  -exec ls {} \; &amp;gt; last48hours&lt;br /&gt;
        ^z&lt;br /&gt;
       $  bg&lt;br /&gt;
&lt;br /&gt;
     So above that was a ctl-z to suppend. Then, bg to run it in&lt;br /&gt;
     the background. Now, if you want to change the priority lower&lt;br /&gt;
     you just renice it, once you know the process id.&lt;br /&gt;
&lt;br /&gt;
       $ jobs -pl&lt;br /&gt;
   [1]+ 29388 Running                 nice -n +15 find . -ctime 2 -exec ls -l {} \; &amp;gt;mout &amp;amp;&lt;br /&gt;
&lt;br /&gt;
       $ renice +30 -p 29388&lt;br /&gt;
        29388: old priority 15, new priority 19&lt;br /&gt;
&lt;br /&gt;
      19 was the lowest priority for this job. You cannot increase&lt;br /&gt;
      the priority unless you are root.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 9:&lt;br /&gt;
&lt;br /&gt;
     Need to Delete a File for Good -- not even GOD can recover.&lt;br /&gt;
&lt;br /&gt;
     You have a file &amp;quot;secret&amp;quot;.  The following makes it so no one&lt;br /&gt;
     can read it.  If the file was 12 bytes, it's now 4096 after it&lt;br /&gt;
     has been over written 100 times.  There's no way to recover this.&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z secret&lt;br /&gt;
&lt;br /&gt;
     Want to remove the file? Use the &amp;quot;u&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z -u test2&lt;br /&gt;
&lt;br /&gt;
     It can be applied to a device&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z -u /dev/fd0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       CAUTION: Note that shred relies on a very important assumption: that the file system  overwrites  data&lt;br /&gt;
       in  place.   This is the traditional way to do things, but many modern file system designs do not sat-&lt;br /&gt;
       isfy this assumption.  The following are examples of file systems on which shred is not effective,  or&lt;br /&gt;
       is not guaranteed to be effective in all file system modes:&lt;br /&gt;
&lt;br /&gt;
       * log-structured or journaled file systems, such as those supplied with&lt;br /&gt;
&lt;br /&gt;
              AIX and Solaris (and JFS, ReiserFS, XFS, Ext3, etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 52).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 10:&lt;br /&gt;
&lt;br /&gt;
     Who and What is doing What on Your System - finding open sockets,&lt;br /&gt;
     files etc.&lt;br /&gt;
&lt;br /&gt;
       $ lsof&lt;br /&gt;
          or as root&lt;br /&gt;
       $ watch lsof -i&lt;br /&gt;
&lt;br /&gt;
     To list all open Internet files, use:&lt;br /&gt;
&lt;br /&gt;
       $ lsof -i -U&lt;br /&gt;
&lt;br /&gt;
       (See TIP 118)&lt;br /&gt;
&lt;br /&gt;
     Also try fuser. Suppose you have a mounted file-system, and you need&lt;br /&gt;
     to umount it. To list the users on the file-system /work&lt;br /&gt;
&lt;br /&gt;
       $ fuser -u /work&lt;br /&gt;
&lt;br /&gt;
     To kill all processes accessing the file system /work  in  any way.&lt;br /&gt;
&lt;br /&gt;
       $ fuser -km /work&lt;br /&gt;
&lt;br /&gt;
     Or better yet, maybe you want to eject a cdrom on /mnt/cdrom&lt;br /&gt;
&lt;br /&gt;
       $ fuser -km /mnt/cdrom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     If you need IO load information about your system, you can execute&lt;br /&gt;
     iostat. But note, the very first iostat gives a snapshot since&lt;br /&gt;
     the last boot. You typically want the following command, which gives&lt;br /&gt;
     you 3 outputs every 5 seconds.&lt;br /&gt;
&lt;br /&gt;
       $ iostat -xtc 5 3&lt;br /&gt;
       Linux 2.6.12-1.1376_FC3smp (squeezel.squeezel.com) 	10/05/2005&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:04 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  0.97    0.06    1.94    0.62   96.41&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:09 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  0.60    0.00    1.70    0.00   97.70&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:14 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  1.00    0.00    1.60    0.00   97.39&lt;br /&gt;
&lt;br /&gt;
     vmstat reports memory statistics.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ vmstat&lt;br /&gt;
       $ ifconfig&lt;br /&gt;
       $ cat /proc/sys/vm/.. (entries under here)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      *NOTE: (TIP 77) shows sample usage of &amp;quot;ifconfig&amp;quot;. Also&lt;br /&gt;
       (TIP 84) shows sample output of &amp;quot;$ cat /proc/cpuinfo&amp;quot;. You can download iostat&lt;br /&gt;
       and other packages from (http://perso.wanadoo.fr/sebastien.godard/download_en.html).&lt;br /&gt;
       You also may want to look at iozone (TIP 178).&lt;br /&gt;
&lt;br /&gt;
     Also&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/meminfo&lt;br /&gt;
       $ cat /proc/stat&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/uptime&lt;br /&gt;
       1078623.55 1048008.34       First number is the number of seconds since boot.&lt;br /&gt;
                                   The second number is the number of idle seconds.&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/loadavg&lt;br /&gt;
       0.25 0.14 0.10 1/166 7778   This shows load at 1,5, and 15 minutes,&lt;br /&gt;
                                   a total of 1 current running process out&lt;br /&gt;
                                   from a total of 166. The 7778 is the last&lt;br /&gt;
                                   process id used.&lt;br /&gt;
                                   Ref: http://www.teamquest.com/resources/gunther/ldavg1.shtml&lt;br /&gt;
&lt;br /&gt;
     Or current process open file descriptors&lt;br /&gt;
&lt;br /&gt;
        $ ls -l /proc/self/fd/0&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lr-x------    1 chirico  chirico        64 Jun 29 13:17 3 -&amp;gt; /proc/26667/fd&lt;br /&gt;
&lt;br /&gt;
      So you could, $ echo &amp;quot;stuff&amp;quot; &amp;gt; /dev/pts/51, to get output. Note, tree is also&lt;br /&gt;
      helpful here:&lt;br /&gt;
&lt;br /&gt;
         $ tree /proc/self&lt;br /&gt;
&lt;br /&gt;
            /proc/self&lt;br /&gt;
            |-- auxv&lt;br /&gt;
            |-- cmdline&lt;br /&gt;
            |-- cwd -&amp;gt; /work/souptonuts/documentation/theBook&lt;br /&gt;
            |-- environ&lt;br /&gt;
            |-- exe -&amp;gt; /usr/bin/tree&lt;br /&gt;
            |-- fd&lt;br /&gt;
            |   |-- 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   |-- 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   |-- 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   `-- 3 -&amp;gt; /proc/26668/fd&lt;br /&gt;
            |-- maps&lt;br /&gt;
            |-- mem&lt;br /&gt;
            |-- mounts&lt;br /&gt;
            |-- root -&amp;gt; /&lt;br /&gt;
            |-- stat&lt;br /&gt;
            |-- statm&lt;br /&gt;
            |-- status&lt;br /&gt;
            |-- task&lt;br /&gt;
            |   `-- 26668&lt;br /&gt;
            |       |-- auxv&lt;br /&gt;
            |       |-- cmdline&lt;br /&gt;
            |       |-- cwd -&amp;gt; /work/souptonuts/documentation/theBook&lt;br /&gt;
            |       |-- environ&lt;br /&gt;
            |       |-- exe -&amp;gt; /usr/bin/tree&lt;br /&gt;
            |       |-- fd&lt;br /&gt;
            |       |   |-- 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   |-- 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   |-- 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   `-- 3 -&amp;gt; /proc/26668/task/26668/fd&lt;br /&gt;
            |       |-- maps&lt;br /&gt;
            |       |-- mem&lt;br /&gt;
            |       |-- mounts&lt;br /&gt;
            |       |-- root -&amp;gt; /&lt;br /&gt;
            |       |-- stat&lt;br /&gt;
            |       |-- statm&lt;br /&gt;
            |       |-- status&lt;br /&gt;
            |       `-- wchan&lt;br /&gt;
            `-- wchan&lt;br /&gt;
&lt;br /&gt;
            10 directories, 28 files&lt;br /&gt;
&lt;br /&gt;
     Need a listing of the system settings?&lt;br /&gt;
&lt;br /&gt;
       $ sysctl -a&lt;br /&gt;
&lt;br /&gt;
     Need IPC (Shared Memory Segments, Semaphore Arrays, Message Queue) status&lt;br /&gt;
     etc?&lt;br /&gt;
&lt;br /&gt;
       $ ipcs&lt;br /&gt;
       $ ipcs -l  &amp;quot;This gives limits&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Need to &amp;quot;watch&amp;quot; everything a user does?  The following watches donkey.&lt;br /&gt;
&lt;br /&gt;
       $ watch lsof -u donkey&lt;br /&gt;
&lt;br /&gt;
     Or, to see what in  going on in directory &amp;quot;/work/junk&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       $ watch lsof +D /work/junk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 11:&lt;br /&gt;
&lt;br /&gt;
     How to make a File &amp;quot;immutable&amp;quot; or &amp;quot;unalterable&amp;quot; -- it cannot be changed&lt;br /&gt;
     or deleted even by root. Note this works on (ext2/ext3) filesystems.&lt;br /&gt;
     And, yes, root can delete after it's changed back.&lt;br /&gt;
&lt;br /&gt;
     As root:&lt;br /&gt;
&lt;br /&gt;
       $ chattr +i filename&lt;br /&gt;
&lt;br /&gt;
     And to change it back:&lt;br /&gt;
&lt;br /&gt;
       $ chattr -i filename&lt;br /&gt;
&lt;br /&gt;
     List attributes&lt;br /&gt;
&lt;br /&gt;
       $ lsattr filename&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 12:&lt;br /&gt;
&lt;br /&gt;
     SSH - How to Generate the Key Pair.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     On the local server&lt;br /&gt;
&lt;br /&gt;
       $  ssh-keygen -t dsa -b 2048&lt;br /&gt;
&lt;br /&gt;
     This will create the two files:&lt;br /&gt;
&lt;br /&gt;
            .ssh/id_dsa (Private key)&lt;br /&gt;
            .ssh/id_dsa.pub  (Public key you can share)&lt;br /&gt;
&lt;br /&gt;
     Next insert &amp;quot;.ssh/id_dsa.pub&amp;quot; on the remote server&lt;br /&gt;
     in the file  &amp;quot;.ssh/authorized_keys&amp;quot; and &amp;quot;.ssh/authorized_keys2&amp;quot;&lt;br /&gt;
     and change the  permission of each file to (chmod 600). Plus, make&lt;br /&gt;
     sure the directory &amp;quot;.ssh&amp;quot; exists on the remote computer with 700 rights.&lt;br /&gt;
     Ok, assuming  192.168.1.155 is the remote server and &amp;quot;donkey&amp;quot; is the&lt;br /&gt;
     account on that remote server.&lt;br /&gt;
&lt;br /&gt;
       $ ssh donkey@192.168.1.155 &amp;quot;mkdir -p .ssh&amp;quot;&lt;br /&gt;
       $ ssh donkey@192.168.1.155 &amp;quot;chmod 700 .ssh&amp;quot;&lt;br /&gt;
       $ scp ./.ssh/id_dsa.pub  donkey@192.168.1.155:.ssh/newkey.pub&lt;br /&gt;
&lt;br /&gt;
     Now connect to that remote server &amp;quot;192.168.1.155&amp;quot; and add .ssh/newkey.pub&lt;br /&gt;
     to both &amp;quot;authorized_keys&amp;quot; and &amp;quot;authorized_keys2&amp;quot;.  When done, the permission&lt;br /&gt;
     on&lt;br /&gt;
       (This is on the remote server)&lt;br /&gt;
&lt;br /&gt;
        $chmod 600 .ssh/authorized_key*&lt;br /&gt;
&lt;br /&gt;
     Next, go back to the local server and issue the following:&lt;br /&gt;
&lt;br /&gt;
        $ ssh-agent $SHELL&lt;br /&gt;
        $ ssh-add&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;ssh-add&amp;quot; will allow you to enter the passphrase and it will&lt;br /&gt;
     save it for the current login session.&lt;br /&gt;
&lt;br /&gt;
     You don't have to enter a password when running &amp;quot;ssh-keygen&amp;quot; above. But,&lt;br /&gt;
     remember anyone with root access can &amp;quot;su - &amp;lt;username&amp;gt;&amp;quot; and then connect&lt;br /&gt;
     to your computers.  It's harder, however, not impossible, for root to do&lt;br /&gt;
     this if  you have a password.&lt;br /&gt;
&lt;br /&gt;
     (Reference TIP 151)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 13:&lt;br /&gt;
&lt;br /&gt;
     Securing the System: Don't allow root to login remotely.  Instead,&lt;br /&gt;
     the admin could login as another account, then, &amp;quot;su -&amp;quot;.  However,&lt;br /&gt;
     root can still login &amp;quot;from the local terminal&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     In the &amp;quot;/etc/ssh/sshd_config&amp;quot; file change the following lines:&lt;br /&gt;
&lt;br /&gt;
        Protocol 2&lt;br /&gt;
        PermitRootLogin no&lt;br /&gt;
        PermitEmptyPasswords no&lt;br /&gt;
&lt;br /&gt;
     Then, restart ssh&lt;br /&gt;
&lt;br /&gt;
        /etc/init.d/sshd restart&lt;br /&gt;
&lt;br /&gt;
     Why would you want to do this?  It's not possible for anyone to guess&lt;br /&gt;
     or keep trying the root account.  This is especially good for computers&lt;br /&gt;
     on the Internet. So, even if the &amp;quot;root&amp;quot; passwords is known, they can't&lt;br /&gt;
     get access to the system remotely.  Only from the terminal, which is locked&lt;br /&gt;
     in your computer room. However, if anyone has a account on the server,&lt;br /&gt;
     then, they can login under their  account then &amp;quot;su -&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Suppose you only want a limited number of users:  &amp;quot;mchirico&amp;quot; and &amp;quot;donkey&amp;quot;.&lt;br /&gt;
     Add the following line to &amp;quot;/etc/ssh/sshd_config&amp;quot;. Note, this allows access&lt;br /&gt;
     for chirico and donkey, but everyone else is denied.&lt;br /&gt;
&lt;br /&gt;
         #  Once you add AllowUsers - everyone else is denied.&lt;br /&gt;
         AllowUsers mchirico donkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 14:&lt;br /&gt;
&lt;br /&gt;
     Keep Logs Longer with Less Space.&lt;br /&gt;
&lt;br /&gt;
     Normally logs rotate monthly, over writing all the old data.  Here's a&lt;br /&gt;
     sample &amp;quot;/etc/logrotate.conf&amp;quot; that will keep 12 months of backup&lt;br /&gt;
     compressing the logfiles&lt;br /&gt;
&lt;br /&gt;
       $ cat /etc/logrotate.conf&lt;br /&gt;
&lt;br /&gt;
             # see &amp;quot;man logrotate&amp;quot; for details&lt;br /&gt;
             # rotate log files weekly&lt;br /&gt;
             #chirico changes to monthly&lt;br /&gt;
             monthly&lt;br /&gt;
&lt;br /&gt;
             # keep 4 weeks worth of backlogs&lt;br /&gt;
             # keep 12 months of backup&lt;br /&gt;
             rotate 12&lt;br /&gt;
&lt;br /&gt;
             # create new (empty) log files after rotating old ones&lt;br /&gt;
             create&lt;br /&gt;
&lt;br /&gt;
             # uncomment this if you want your log files compressed&lt;br /&gt;
             compress&lt;br /&gt;
&lt;br /&gt;
             # RPM packages drop log rotation information into this directory&lt;br /&gt;
             include /etc/logrotate.d&lt;br /&gt;
&lt;br /&gt;
             # no packages own wtmp -- we'll rotate them here&lt;br /&gt;
             /var/log/wtmp {&lt;br /&gt;
                 monthly&lt;br /&gt;
                 create 0664 root utmp&lt;br /&gt;
                 rotate 1&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
             # system-specific logs may be also be configured here.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Note: see tip 1. The clock should always be correctly set.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 15:&lt;br /&gt;
&lt;br /&gt;
     What Network Services are Running?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -atup&lt;br /&gt;
&lt;br /&gt;
     or&lt;br /&gt;
&lt;br /&gt;
          $ netstat -ap|grep LISTEN|less&lt;br /&gt;
&lt;br /&gt;
     This can be helpful to determine the services running.&lt;br /&gt;
&lt;br /&gt;
     Need stats on dropped UDP packets?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s -u&lt;br /&gt;
&lt;br /&gt;
     or TCP&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s -t&lt;br /&gt;
&lt;br /&gt;
     or summary of everything&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s&lt;br /&gt;
&lt;br /&gt;
     or looking for error rates on the interface?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -i&lt;br /&gt;
&lt;br /&gt;
     Listening interfaces?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -l&lt;br /&gt;
&lt;br /&gt;
     (Tip above provided by Amos Shapira)&lt;br /&gt;
&lt;br /&gt;
     Also see TIP 77.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 16:&lt;br /&gt;
&lt;br /&gt;
     Apache: Creating and Using an &amp;quot;.htaccess&amp;quot; File&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Below is a sample &amp;quot;.htaccess&amp;quot; file which goes in&lt;br /&gt;
     &amp;quot;/usr/local/apache/htdocs/chirico/alpha/.htaccess&amp;quot; for this&lt;br /&gt;
     example&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         AuthUserFile /usr/local/apache/htdocs/chirico/alpha/.htpasswd&lt;br /&gt;
         AuthGroupFile /dev/null&lt;br /&gt;
         AuthName &amp;quot;Your Name and regular password required&amp;quot;&lt;br /&gt;
         AuthType Basic&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;Limit GET POST&amp;gt;&lt;br /&gt;
         require valid-user&lt;br /&gt;
         &amp;lt;/Limit&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    In order for this to work /usr/local/apache/conf/httpd.conf must&lt;br /&gt;
    have the following line in it:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       #&lt;br /&gt;
       &amp;lt;Directory /usr/local/apache/htdocs/chirico/alpha&amp;gt;&lt;br /&gt;
           AllowOverride FileInfo AuthConfig Limit&lt;br /&gt;
           Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec&lt;br /&gt;
           &amp;lt;Limit GET POST OPTIONS PROPFIND&amp;gt;&lt;br /&gt;
               Order allow,deny&lt;br /&gt;
               Allow from all&lt;br /&gt;
           &amp;lt;/Limit&amp;gt;&lt;br /&gt;
           &amp;lt;LimitExcept GET POST OPTIONS PROPFIND&amp;gt;&lt;br /&gt;
               Order deny,allow&lt;br /&gt;
               Deny from all&lt;br /&gt;
           &amp;lt;/LimitExcept&amp;gt;&lt;br /&gt;
       &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Also, a password file must be created&lt;br /&gt;
&lt;br /&gt;
      $ /usr/local/apache/bin/htpasswd -c .htpasswd chirico&lt;br /&gt;
&lt;br /&gt;
    And enter the user names and passwords.&lt;br /&gt;
&lt;br /&gt;
    Next Reload Apache:&lt;br /&gt;
&lt;br /&gt;
      $ /etc/init.d/httpd reload&lt;br /&gt;
&lt;br /&gt;
    (Reference TIP 213 limit access to certain directories based on IP address).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 17:&lt;br /&gt;
&lt;br /&gt;
     Working with &amp;quot;mt&amp;quot; Commands: reading and writing to tape.&lt;br /&gt;
&lt;br /&gt;
     The following assumes the tape device is &amp;quot;/dev/st0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     STEP 1 ( rewind the tape)&lt;br /&gt;
&lt;br /&gt;
          # mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (check to see if you are at block 0)&lt;br /&gt;
&lt;br /&gt;
          # mt -f /dev/nst0 tell&lt;br /&gt;
            At block 0.&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Backup &amp;quot;tar compress&amp;quot;  directories &amp;quot;one&amp;quot;  and &amp;quot;two&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
          # tar -czf /dev/nst0 one two&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Check to see what block you are at)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
&lt;br /&gt;
       You should get something like block 2 at this point.&lt;br /&gt;
&lt;br /&gt;
     STEP 5 (Rewind the tape)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
     STEP 6 (List the files)&lt;br /&gt;
&lt;br /&gt;
           # tar -tzf /dev/nst0&lt;br /&gt;
              one/&lt;br /&gt;
              one/test&lt;br /&gt;
              two/&lt;br /&gt;
&lt;br /&gt;
     STEP 7 (Restore directory &amp;quot;one&amp;quot;  into directory &amp;quot;junk&amp;quot;).  Note, you&lt;br /&gt;
          have to first rewind the tape, since the last operation moved&lt;br /&gt;
          ahead 2 blocks. Check this with &amp;quot;mt -f /dev/nst0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           # cd junk&lt;br /&gt;
           # mt -f /dev/nst0 rewind&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
              At block 0.&lt;br /&gt;
           # tar -xzf /dev/nst0 one&lt;br /&gt;
&lt;br /&gt;
     STEP 8 (Next, take a look to see what block the tape is at)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
              At block 2.&lt;br /&gt;
&lt;br /&gt;
     STEP 9 (Now backup directories three  and four)&lt;br /&gt;
&lt;br /&gt;
           # tar -czf /dev/nst0 three four&lt;br /&gt;
&lt;br /&gt;
       After backing up the files, the tape should be past block 2.&lt;br /&gt;
       Check this.&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
             At block 4.&lt;br /&gt;
&lt;br /&gt;
          Currently the following exist:&lt;br /&gt;
&lt;br /&gt;
                At block 1:&lt;br /&gt;
                     one/&lt;br /&gt;
                    one/test&lt;br /&gt;
                    two/&lt;br /&gt;
&lt;br /&gt;
                At block 2:&lt;br /&gt;
                    three/&lt;br /&gt;
                    three/samplehere&lt;br /&gt;
                    four/&lt;br /&gt;
&lt;br /&gt;
                At block 4:&lt;br /&gt;
                    (* This is empty *)&lt;br /&gt;
&lt;br /&gt;
     A few notes. You can set the blocking factor and a label&lt;br /&gt;
     with tar. For example:&lt;br /&gt;
&lt;br /&gt;
      $ tar --label=&amp;quot;temp label&amp;quot; --create  --blocking-factor=128 --file=/dev/nst0 Notes&lt;br /&gt;
&lt;br /&gt;
     But note if you try to read it with the default, incorrect blocking&lt;br /&gt;
     factor, then, you will get the following error:&lt;br /&gt;
&lt;br /&gt;
        $ tar -t   --file=/dev/nst0&lt;br /&gt;
        tar: /dev/nst0: Cannot read: Cannot allocate memory&lt;br /&gt;
        tar: At beginning of tape, quitting now&lt;br /&gt;
        tar: Error is not recoverable: exiting now&lt;br /&gt;
&lt;br /&gt;
     However this is easily fixed with the correct blocking factor&lt;br /&gt;
&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ tar -t --blocking-factor=128 --file=/dev/nst0&lt;br /&gt;
         temp label&lt;br /&gt;
         Notes&lt;br /&gt;
&lt;br /&gt;
     Take advantage of the label command.&lt;br /&gt;
&lt;br /&gt;
         $ MYCOMMENTS=&amp;quot;Big_important_tape&amp;quot;&lt;br /&gt;
         $ tar --label=&amp;quot;$(date +%F)&amp;quot;+&amp;quot;${MYCOMMENTS}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Writing to tape on a remote 192.168.1.155 computer&lt;br /&gt;
&lt;br /&gt;
         $ tar cvzf - ./tmp | ssh -l chirico 192.168.1.155 '(mt -f /dev/nst0 rewind; dd of=/dev/st0 )'&lt;br /&gt;
&lt;br /&gt;
     Restoring the contents from tape on a remote computer&lt;br /&gt;
&lt;br /&gt;
         $ ssh -l chirico 192.168.1.155 '(mt -f /dev/nst0 rewind; dd if=/dev/st0  )'|tar xzf -&lt;br /&gt;
&lt;br /&gt;
     Getting data off of tape with dd command with odd blocking factor. Just set ibs very high&lt;br /&gt;
&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ tar --label=&amp;quot;Contenets of Notes&amp;quot; --create  --blocking-factor=128 --file=/dev/nst0 Notes&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ dd ibs=1048576 if=/dev/st0 of=notes.tar&lt;br /&gt;
&lt;br /&gt;
     The above will probably work with ibs=64k as well&lt;br /&gt;
&lt;br /&gt;
        (Also see TIP 136)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 18:&lt;br /&gt;
&lt;br /&gt;
     Encrypting Data to Tape using &amp;quot;tar&amp;quot; and &amp;quot;openssl&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     The following shows an example of writing the contents of &amp;quot;tapetest&amp;quot; to tape:&lt;br /&gt;
&lt;br /&gt;
        $ tar zcvf - tapetest|openssl des3 -salt  -k secretpassword | dd of=/dev/st0&lt;br /&gt;
&lt;br /&gt;
     Reading the data back:&lt;br /&gt;
&lt;br /&gt;
        $ dd if=/dev/st0|openssl des3 -d -k secretpassword|tar xzf -&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 19:&lt;br /&gt;
&lt;br /&gt;
     Mounting an ISO Image as a Filesystem -- this is great if you don't have the DVD&lt;br /&gt;
         hardware, but, need to get at the data.  The following show an example of&lt;br /&gt;
         mounting the Fedora core 2 as a file.&lt;br /&gt;
&lt;br /&gt;
         $ mkdir /iso0&lt;br /&gt;
         $ mount -o loop -t iso9660 /FC2-i386-DVD.iso  /iso0&lt;br /&gt;
&lt;br /&gt;
     Or to mount automatically at boot, add the following to &amp;quot;/etc/fstab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         /FC2-i386-DVD.iso /iso0     iso9660 rw,loop  0 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Reference: http://umn.dl.sourceforge.net/sourceforge/souptonuts/README_fedora.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 20:&lt;br /&gt;
&lt;br /&gt;
     Getting Information about the Hard drive and list all PCI devices.&lt;br /&gt;
&lt;br /&gt;
                $ hdparm /dev/hda&lt;br /&gt;
&lt;br /&gt;
                  /dev/hda:&lt;br /&gt;
                   multcount    = 16 (on)&lt;br /&gt;
                   IO_support   =  0 (default 16-bit)&lt;br /&gt;
                   unmaskirq    =  0 (off)&lt;br /&gt;
                   using_dma    =  1 (on)&lt;br /&gt;
                   keepsettings =  0 (off)&lt;br /&gt;
                   readonly     =  0 (off)&lt;br /&gt;
                   readahead    = 256 (on)&lt;br /&gt;
                   geometry     = 16383/255/63, sectors = 234375000, start = 0&lt;br /&gt;
&lt;br /&gt;
            or for SCSI&lt;br /&gt;
&lt;br /&gt;
                $ hdparm /dev/sda&lt;br /&gt;
&lt;br /&gt;
            Try it with the -i option for information&lt;br /&gt;
&lt;br /&gt;
                $ hdparm -i /dev/hda&lt;br /&gt;
&lt;br /&gt;
                /dev/hda:&lt;br /&gt;
&lt;br /&gt;
                Model=IC35L120AVV207-1, FwRev=V24OA66A, SerialNo=VNVD09G4CZ6E0T&lt;br /&gt;
                Config={ HardSect NotMFM HdSw&amp;gt;15uSec Fixed DTR&amp;gt;10Mbs }&lt;br /&gt;
                RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=52&lt;br /&gt;
                BuffType=DualPortCache, BuffSize=7965kB, MaxMultSect=16, MultSect=16&lt;br /&gt;
                CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=234375000&lt;br /&gt;
                IORDY=on/off, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}&lt;br /&gt;
                PIO modes:  pio0 pio1 pio2 pio3 pio4&lt;br /&gt;
                DMA modes:  mdma0 mdma1 mdma2&lt;br /&gt;
                UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5&lt;br /&gt;
                AdvancedPM=yes: disabled (255) WriteCache=enabled&lt;br /&gt;
                Drive conforms to: ATA/ATAPI-6 T13 1410D revision 3a:  2 3 4 5 6&lt;br /&gt;
&lt;br /&gt;
            How fast is your drive?&lt;br /&gt;
&lt;br /&gt;
                $ hdparm -tT /dev/hda&lt;br /&gt;
&lt;br /&gt;
                /dev/hda:&lt;br /&gt;
                Timing buffer-cache reads:   128 MB in  0.41 seconds =315.32 MB/sec&lt;br /&gt;
                Timing buffered disk reads:  64 MB in  1.19 seconds = 53.65 MB/sec&lt;br /&gt;
&lt;br /&gt;
            Need to find your device?&lt;br /&gt;
&lt;br /&gt;
                $ mount&lt;br /&gt;
                   or&lt;br /&gt;
                $ cat /proc/partitions&lt;br /&gt;
                   or&lt;br /&gt;
                $ dmesg | egrep '^(s|h)d'&lt;br /&gt;
&lt;br /&gt;
                   which for my system lists:&lt;br /&gt;
&lt;br /&gt;
                      hda: IC35L120AVV207-1, ATA DISK drive&lt;br /&gt;
                      hdc: Lite-On LTN486S 48x Max, ATAPI CD/DVD-ROM drive&lt;br /&gt;
                      hda: max request size: 1024KiB&lt;br /&gt;
                      hda: 234375000 sectors (120000 MB) w/7965KiB Cache, CHS=16383/255/63, UDMA(100)&lt;br /&gt;
&lt;br /&gt;
             By the way, if you want to turn on dma&lt;br /&gt;
&lt;br /&gt;
                 $ hdparm -d1 /dev/hda&lt;br /&gt;
                   setting using_dma to 1 (on)&lt;br /&gt;
                   using_dma    =  1 (on)&lt;br /&gt;
&lt;br /&gt;
         (Also see TIP 122 )&lt;br /&gt;
&lt;br /&gt;
     List all PCI devices&lt;br /&gt;
&lt;br /&gt;
                $ lspci -v&lt;br /&gt;
&lt;br /&gt;
          00:00.0 Host bridge: Intel Corp. 82845G/GL [Brookdale-G] Chipset Host Bridge (rev&lt;br /&gt;
                  Subsystem: Dell Computer Corporation: Unknown device 0160&lt;br /&gt;
                  Flags: bus master, fast devsel, latency 0&lt;br /&gt;
                  Memory at f0000000 (32-bit, prefetchable) [size=128M]&lt;br /&gt;
                  Capabilities: &amp;lt;available only to root&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              ... lots more ...&lt;br /&gt;
&lt;br /&gt;
           Note, there is also lspci -vv for even more information.&lt;br /&gt;
&lt;br /&gt;
          (Also see TIP 200)&lt;br /&gt;
&lt;br /&gt;
TIP 21:&lt;br /&gt;
&lt;br /&gt;
     Setting up &amp;quot;cron&amp;quot; Jobs.&lt;br /&gt;
&lt;br /&gt;
     If you want to use the emacs editor for editing cron jobs, then,&lt;br /&gt;
     set the following in your &amp;quot;/home/user/.bash_profile&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        EDITOR=emacs&lt;br /&gt;
&lt;br /&gt;
     Then, to edit cron jobs&lt;br /&gt;
&lt;br /&gt;
        $ crontab -e&lt;br /&gt;
&lt;br /&gt;
     You may want to put in the following header&lt;br /&gt;
&lt;br /&gt;
        #MINUTE(0-59) HOUR(0-23) DAYOFMONTH(1-31) MONTHOFYEAR(1-12) DAYOFWEEK(0-6) Note 0=Sun and 7=Sun&lt;br /&gt;
        #&lt;br /&gt;
        #14,15 10 * * 0   /usr/bin/somecommmand  &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     The sample &amp;quot;commented out command&amp;quot; will run at 10:14 and 10:15 every Sunday.  There will&lt;br /&gt;
     be no &amp;quot;mail&amp;quot; sent to the user because of the &amp;quot;&amp;gt;/dev/null 2&amp;gt;&amp;amp;1&amp;quot; entry.&lt;br /&gt;
&lt;br /&gt;
        $ crontab -l&lt;br /&gt;
&lt;br /&gt;
     The above will list all cron jobs. Or if you're root&lt;br /&gt;
&lt;br /&gt;
        $ crontab -l -u &amp;lt;username&amp;gt;&lt;br /&gt;
        $ crontab -e -u &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Reference &amp;quot;man 5 crontab&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
        The time and date fields are:&lt;br /&gt;
&lt;br /&gt;
                     field          allowed values&lt;br /&gt;
                     -----          --------------&lt;br /&gt;
                     minute         0-59&lt;br /&gt;
                     hour           0-23&lt;br /&gt;
                     day of month   1-31&lt;br /&gt;
                     month          1-12 (or names, see below)&lt;br /&gt;
                     day of week    0-7 (0 or 7 is Sun, or use names)&lt;br /&gt;
&lt;br /&gt;
              A field may be an asterisk (*), which always stands for ``first-last''.&lt;br /&gt;
&lt;br /&gt;
              Ranges of numbers are allowed.  Ranges are two numbers separated with a&lt;br /&gt;
              hyphen.   The  specified  range is inclusive.  For example, 8-11 for an&lt;br /&gt;
              ``hours'' entry specifies execution at hours 8, 9, 10 and 11.&lt;br /&gt;
&lt;br /&gt;
              Lists are allowed.  A list is a set of numbers (or ranges) separated by&lt;br /&gt;
              commas.  Examples: ``1,2,5,9'', ``0-4,8-12''.&lt;br /&gt;
&lt;br /&gt;
              Ranges can include &amp;quot;steps&amp;quot;, so &amp;quot;1-9/2&amp;quot; is the same as &amp;quot;1,3,5,7,9&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Note, you can run just every 5 minutes as follows:&lt;br /&gt;
&lt;br /&gt;
              */5 * * * * /etc/mrtg/domrtg  &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     To run jobs hourly,daily,weekly or monthly you can add shell scripts into the&lt;br /&gt;
     appropriate directory:&lt;br /&gt;
&lt;br /&gt;
             /etc/cron.hourly/&lt;br /&gt;
             /etc/cron.daily/&lt;br /&gt;
             /etc/cron.weekly/&lt;br /&gt;
             /etc/cron.monthly/&lt;br /&gt;
&lt;br /&gt;
     Note that the above are pre-configured schedules set in &amp;quot;/etc/crontab&amp;quot;, so&lt;br /&gt;
     if you want, you can change the schedule. Below is my /etc/crontab:&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/crontab&lt;br /&gt;
           SHELL=/bin/bash&lt;br /&gt;
           PATH=/sbin:/bin:/usr/sbin:/usr/bin&lt;br /&gt;
           MAILTO=root&lt;br /&gt;
           HOME=/&lt;br /&gt;
&lt;br /&gt;
           # run-parts&lt;br /&gt;
           01 * * * * root run-parts /etc/cron.hourly&lt;br /&gt;
           02 4 * * * root run-parts /etc/cron.daily&lt;br /&gt;
           22 4 * * 0 root run-parts /etc/cron.weekly&lt;br /&gt;
           42 4 1 * * root run-parts /etc/cron.monthly&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 22:&lt;br /&gt;
&lt;br /&gt;
     Keeping Files in Sync Between Servers.&lt;br /&gt;
&lt;br /&gt;
     The remote computer is &amp;quot;192.168.1.171&amp;quot; and has the account &amp;quot;donkey&amp;quot;.  You want&lt;br /&gt;
     to &amp;quot;keep in sync&amp;quot; the files under &amp;quot;/home/cu2000/Logs&amp;quot; on the remote computer&lt;br /&gt;
     with files on &amp;quot;/home/chirico/dev/MEDIA_Server&amp;quot; on the local computer.&lt;br /&gt;
&lt;br /&gt;
       $ rsync  -Lae ssh  donkey@192.168.1.171:/home/cu2000/Logs /home/chirico/dev/MEDIA_Server&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;rsync&amp;quot; is a convient command for keeping files in sync, and as shown here will work&lt;br /&gt;
     through ssh.  The -L option tells rsync to treat symbolic links like ordinary files.&lt;br /&gt;
&lt;br /&gt;
        Also see [http://www.rsnapshot.org/]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 23:&lt;br /&gt;
&lt;br /&gt;
     Looking up the Spelling of a Word.&lt;br /&gt;
&lt;br /&gt;
        $ look &amp;lt;partial spelling&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     so the following will list all words that&lt;br /&gt;
     start with stuff&lt;br /&gt;
&lt;br /&gt;
        $ look stuff&lt;br /&gt;
           stuff&lt;br /&gt;
           stuffage&lt;br /&gt;
           stuffata&lt;br /&gt;
           stuffed&lt;br /&gt;
           stuffender&lt;br /&gt;
           stuffer&lt;br /&gt;
           stuffers&lt;br /&gt;
           stuffgownsman&lt;br /&gt;
           stuffier&lt;br /&gt;
           stuffiest&lt;br /&gt;
           stuffily&lt;br /&gt;
           stuffiness&lt;br /&gt;
           stuffinesses&lt;br /&gt;
           stuffiness's&lt;br /&gt;
           stuffing&lt;br /&gt;
           stuffings&lt;br /&gt;
           stuffing's&lt;br /&gt;
           stuffless&lt;br /&gt;
           stuffs&lt;br /&gt;
           stuffy&lt;br /&gt;
&lt;br /&gt;
     It helps to have a large &amp;quot;linuxwords&amp;quot; dictionary.  You can download&lt;br /&gt;
     a much bigger dictionary from the following:&lt;br /&gt;
&lt;br /&gt;
              http://prdownloads.sourceforge.net/souptonuts/linuxwords.1.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
     Note: vim users can setup the .vimrc file with the following. Now when you type &lt;br /&gt;
       CTL-X CTL-T in insert mode, you'll get a thesaurus lookup.&lt;br /&gt;
&lt;br /&gt;
           set dictionary+=/usr/share/dict/words&lt;br /&gt;
           set thesaurus+=/usr/share/dict/words&lt;br /&gt;
&lt;br /&gt;
     Or, you can call aspell with the F6 command after putting the folling entry in your&lt;br /&gt;
     .vimrc file&lt;br /&gt;
&lt;br /&gt;
           :nmap &amp;lt;F6&amp;gt; :w&amp;lt;CR&amp;gt;:!aspell -e -c %&amp;lt;CR&amp;gt;:e&amp;lt;CR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Now, hit F6 when you're in vim, and you'll get a spell checker.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     There is also an X Windows dictionary that runs with the following command.&lt;br /&gt;
&lt;br /&gt;
           $ gnome-dictionary&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 24:&lt;br /&gt;
&lt;br /&gt;
     Find out if a Command is Aliased.&lt;br /&gt;
&lt;br /&gt;
         $ type -all &amp;lt;command&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Example:&lt;br /&gt;
&lt;br /&gt;
         $ type -all ls&lt;br /&gt;
            ls is aliased to `ls --color=tty'&lt;br /&gt;
            ls is /bin/ls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 25:&lt;br /&gt;
&lt;br /&gt;
     Create a Terminal Calculator&lt;br /&gt;
&lt;br /&gt;
      Put the following in your .bashrc file&lt;br /&gt;
&lt;br /&gt;
            function calc&lt;br /&gt;
            {&lt;br /&gt;
             echo &amp;quot;${1}&amp;quot;|bc -l;&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
      Or, run it at the shell prompt. Now&lt;br /&gt;
      &amp;quot;calc&amp;quot; from the shell will work as follows:&lt;br /&gt;
&lt;br /&gt;
            $ calc 3+45&lt;br /&gt;
               48&lt;br /&gt;
&lt;br /&gt;
      All functions  with a &amp;quot;(&amp;quot; or &amp;quot;)&amp;quot; must be enclosed&lt;br /&gt;
      in quotes.  For instance, to get the sin of .4&lt;br /&gt;
&lt;br /&gt;
            $ calc &amp;quot;s(.4)&amp;quot;&lt;br /&gt;
              .38941834230865049166&lt;br /&gt;
&lt;br /&gt;
          (See TIP 115 using the expr command)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 26:&lt;br /&gt;
&lt;br /&gt;
     Kill a User and All Their Current Processes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        #  This program will kill all processes from a&lt;br /&gt;
        #  user.  The user name is read from the command line.&lt;br /&gt;
        #&lt;br /&gt;
        #  This program also demonstrates reading a bash variable&lt;br /&gt;
        #  into an awk script.&lt;br /&gt;
        #&lt;br /&gt;
        #  Usage: kill9user &amp;lt;user&amp;gt;&lt;br /&gt;
        #&lt;br /&gt;
        kill -9 `ps aux|awk -v var=$1 '$1==var { print $2 }'`&lt;br /&gt;
&lt;br /&gt;
    or if you want want to create the above script the command&lt;br /&gt;
    below will kill the user &amp;quot;donkey&amp;quot; and all of his processes.&lt;br /&gt;
&lt;br /&gt;
        $ kill -9 `ps aux|awk -v var=&amp;quot;donkey&amp;quot; '$1==var { print $2 }'`&lt;br /&gt;
&lt;br /&gt;
    Check their cron jobs and &amp;quot;at&amp;quot; jobs, if you have a security issue.&lt;br /&gt;
&lt;br /&gt;
          $ crontab -u &amp;lt;user&amp;gt; -e&lt;br /&gt;
&lt;br /&gt;
    Lock the account:&lt;br /&gt;
&lt;br /&gt;
          $ passwd -l &amp;lt;user&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Remove all authorized_keys&lt;br /&gt;
&lt;br /&gt;
          $ rm /home/user/.shosts&lt;br /&gt;
          $ rm /home/user/.rhosts&lt;br /&gt;
          $ rm -rf /home/user/.ssh&lt;br /&gt;
          $ rm /home/user/.forward&lt;br /&gt;
&lt;br /&gt;
      or consider&lt;br /&gt;
&lt;br /&gt;
          $ mv /home/user  /home/safeuser&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Change the shell&lt;br /&gt;
&lt;br /&gt;
          $ chsh -s /bin/true &amp;lt;user&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Do an inventory&lt;br /&gt;
&lt;br /&gt;
          $ find / -user &amp;lt;user&amp;gt;  &amp;gt; list_of_user_files&lt;br /&gt;
&lt;br /&gt;
    NOTE: Also see (TIP 10).&lt;br /&gt;
&lt;br /&gt;
    To see all users, except the current user. Do not use the&lt;br /&gt;
    dash &amp;quot;ps -aux&amp;quot; is wrong but the following is correct:&lt;br /&gt;
&lt;br /&gt;
          $ ps aux| awk '!/'${USER}'/{printf(&amp;quot;%s \n&amp;quot;,$0)}'&lt;br /&gt;
&lt;br /&gt;
     or (ww = wide, wide output)&lt;br /&gt;
&lt;br /&gt;
          $ ps auwwx| awk '!/'${USER}'/{printf(&amp;quot;%s \n&amp;quot;,$0)}'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    The following codes may be useful:&lt;br /&gt;
&lt;br /&gt;
       D    Uninterruptible sleep (usually IO)&lt;br /&gt;
       R    Running or runnable (on run queue)&lt;br /&gt;
       S    Interruptible sleep (waiting for an event to complete)&lt;br /&gt;
       T    Stopped, either by a job control signal or because it is being traced.&lt;br /&gt;
       W    paging (not valid since the 2.6.xx kernel)&lt;br /&gt;
       X    dead (should never be seen)&lt;br /&gt;
       Z    Defunct (&amp;quot;zombie&amp;quot;) process, terminated but not reaped by its parent.&lt;br /&gt;
&lt;br /&gt;
    For BSD formats and when the stat keyword is used, additional&lt;br /&gt;
       characters may be displayed:&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;    high-priority (not nice to other users)&lt;br /&gt;
       N    low-priority (nice to other users)&lt;br /&gt;
       L    has pages locked into memory (for real-time and custom IO)&lt;br /&gt;
       s    is a session leader&lt;br /&gt;
       l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)&lt;br /&gt;
       +    is in the foreground process group&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Also see TIP 28. and TIP 89.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 27:&lt;br /&gt;
&lt;br /&gt;
     Format Dates for Logs and Files&lt;br /&gt;
&lt;br /&gt;
         $ date &amp;quot;+%m%d%y %A,%B %d %Y %X&amp;quot;&lt;br /&gt;
             061704 Thursday,June 17 2004 07:13:40 PM&lt;br /&gt;
&lt;br /&gt;
         $ date &amp;quot;+%m%d%Y&amp;quot;&lt;br /&gt;
             06172004&lt;br /&gt;
&lt;br /&gt;
         $ date -d '1 day ago' &amp;quot;+%m%d%Y&amp;quot;&lt;br /&gt;
             06162004&lt;br /&gt;
&lt;br /&gt;
         $ date -d '3 months 1 day  2 hour  15 minutes 2 seconds ago'&lt;br /&gt;
&lt;br /&gt;
      or to go into the future remove the &amp;quot;ago&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         $ date -d '3 months 1 day  2 hour  15 minutes 2 seconds '&lt;br /&gt;
&lt;br /&gt;
            Also the following works:&lt;br /&gt;
&lt;br /&gt;
                $ date -d '+2 year +1 month -1 week  +3 day -8 hour +2 min -5 seconds'&lt;br /&gt;
&lt;br /&gt;
      Quick question: If there are 100,000,000 stars in the visible sky, and you can&lt;br /&gt;
      count them, round the clock, at a rate of a star per second starting now, when&lt;br /&gt;
      would you finish counting?  Would you still be alive?&lt;br /&gt;
&lt;br /&gt;
                $ date -d '+100000000 seconds'&lt;br /&gt;
&lt;br /&gt;
      Sooner than you think!&lt;br /&gt;
&lt;br /&gt;
      This can be assigned to variables&lt;br /&gt;
&lt;br /&gt;
         $ mdate=`date -d '3 months 1 day  2 hour  15 minutes 2 seconds ' &amp;quot;+%m%d%Y_%A_%B_%D_%Y_%X&amp;quot;  `&lt;br /&gt;
         $ echo $mdate&lt;br /&gt;
             09182004_Saturday_September_09/18/04_2004_09:40:41 PM&lt;br /&gt;
             ^---- Easy to sort   ^-------^----- Easy to read&lt;br /&gt;
&lt;br /&gt;
      See TIP 28 below.&lt;br /&gt;
&lt;br /&gt;
      See TIP 87 when working with large delta time changes -40 years, or -200 years ago, or even&lt;br /&gt;
      1,000,000 days into the future.&lt;br /&gt;
&lt;br /&gt;
      Also see (TIP 1) for working with time zones.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 28:&lt;br /&gt;
&lt;br /&gt;
     Need Ascii Codes? For instance, for printing quotes:&lt;br /&gt;
&lt;br /&gt;
                         awk 'BEGIN { msg = &amp;quot;Don\047t Panic!&amp;quot;; printf &amp;quot;%s \n&amp;quot;,msg }'&lt;br /&gt;
              or&lt;br /&gt;
                         awk 'BEGIN { msg = &amp;quot;Don\x027t Panic!&amp;quot;; printf &amp;quot;%s \n&amp;quot;,msg }'&lt;br /&gt;
&lt;br /&gt;
     It's better to use \047, because certain characters that follow \x027 may cause problems.&lt;br /&gt;
&lt;br /&gt;
     For example, take a look at the following two lines. The first line prints a &amp;quot;}&amp;quot; caused&lt;br /&gt;
     by the extra D in \x027D. The the line immediately below does not work as expected.&lt;br /&gt;
&lt;br /&gt;
                      awk 'BEGIN {printf(&amp;quot;The D causes problems \x027D\n&amp;quot;)}'&lt;br /&gt;
&lt;br /&gt;
            However, the line below works fine:&lt;br /&gt;
&lt;br /&gt;
                      awk 'BEGIN {printf(&amp;quot;The D does not cause problems \047D\n&amp;quot;)}'&lt;br /&gt;
&lt;br /&gt;
     Or if you wanted to use the date command in &amp;quot;awk&amp;quot; to print date.time.nanosecond.timezone for&lt;br /&gt;
     each line of a file &amp;quot;test&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     The following date can be used in awk because the single quotes are enclosed within the&lt;br /&gt;
     double quotes.&lt;br /&gt;
&lt;br /&gt;
             date '+%m%d%Y.%H%M%S.%N%z'&lt;br /&gt;
&lt;br /&gt;
       $ awk 'BEGIN { &amp;quot;date '+%m%d%Y.%H%M%S.%N%z'&amp;quot; | getline MyDate  } { print MyDate,$0 }' &amp;lt; data&lt;br /&gt;
&lt;br /&gt;
     But it's also possible to replace  &amp;quot;+&amp;quot;  with  \x2B,  &amp;quot;%&amp;quot; with \x25, and &amp;quot;d&amp;quot; with \x64 as follows:&lt;br /&gt;
&lt;br /&gt;
       $ awk 'BEGIN { &amp;quot;date \x27\x2B\x25m\x25\x64\x25Y.\x25H\x25M\x25S.\x25N\x25z\x27&amp;quot; | getline MyDate  } { print MyDate,$0 }' &amp;lt; test&lt;br /&gt;
&lt;br /&gt;
             07062004.113820.346033000-0400 bob 71&lt;br /&gt;
             07062004.113820.346033000-0400 tom 43&lt;br /&gt;
             07062004.113820.346033000-0400 sal 34&lt;br /&gt;
             07062004.113820.346033000-0400 bob 89&lt;br /&gt;
             07062004.113820.346033000-0400 tom 66&lt;br /&gt;
             07062004.113820.346033000-0400 sal 99&lt;br /&gt;
&lt;br /&gt;
     For this example it's not needed because single quotes are used inside of double quotes; however, there may be times when&lt;br /&gt;
     hex replacement is easier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ man ascii&lt;br /&gt;
&lt;br /&gt;
        Oct   Dec   Hex   Char           Oct   Dec   Hex   Char&lt;br /&gt;
            -----------------------------------------------------------&lt;br /&gt;
            000   0     00    NUL '\0'       100   64    40    @&lt;br /&gt;
            001   1     01    SOH            101   65    41    A&lt;br /&gt;
            002   2     02    STX            102   66    42    B&lt;br /&gt;
            003   3     03    ETX            103   67    43    C&lt;br /&gt;
            004   4     04    EOT            104   68    44    D&lt;br /&gt;
            005   5     05    ENQ            105   69    45    E&lt;br /&gt;
            006   6     06    ACK            106   70    46    F&lt;br /&gt;
            007   7     07    BEL '\a'       107   71    47    G&lt;br /&gt;
            010   8     08    BS  '\b'       110   72    48    H&lt;br /&gt;
            011   9     09    HT  '\t'       111   73    49    I&lt;br /&gt;
            012   10    0A    LF  '\n'       112   74    4A    J&lt;br /&gt;
            013   11    0B    VT  '\v'       113   75    4B    K&lt;br /&gt;
            014   12    0C    FF  '\f'       114   76    4C    L&lt;br /&gt;
            015   13    0D    CR  '\r'       115   77    4D    M&lt;br /&gt;
            016   14    0E    SO             116   78    4E    N&lt;br /&gt;
            017   15    0F    SI             117   79    4F    O&lt;br /&gt;
            020   16    10    DLE            120   80    50    P&lt;br /&gt;
            021   17    11    DC1            121   81    51    Q&lt;br /&gt;
            022   18    12    DC2            122   82    52    R&lt;br /&gt;
            023   19    13    DC3            123   83    53    S&lt;br /&gt;
            024   20    14    DC4            124   84    54    T&lt;br /&gt;
            025   21    15    NAK            125   85    55    U&lt;br /&gt;
            026   22    16    SYN            126   86    56    V&lt;br /&gt;
            027   23    17    ETB            127   87    57    W&lt;br /&gt;
            030   24    18    CAN            130   88    58    X&lt;br /&gt;
            031   25    19    EM             131   89    59    Y&lt;br /&gt;
            032   26    1A    SUB            132   90    5A    Z&lt;br /&gt;
            033   27    1B    ESC            133   91    5B    [&lt;br /&gt;
            034   28    1C    FS             134   92    5C    \   '\\'&lt;br /&gt;
            035   29    1D    GS             135   93    5D    ]&lt;br /&gt;
            036   30    1E    RS             136   94    5E    ^&lt;br /&gt;
            037   31    1F    US             137   95    5F    _&lt;br /&gt;
            040   32    20    SPACE          140   96    60    `&lt;br /&gt;
            041   33    21    !              141   97    61    a&lt;br /&gt;
            042   34    22    &amp;quot;              142   98    62    b&lt;br /&gt;
            043   35    23    #              143   99    63    c&lt;br /&gt;
            044   36    24    $              144   100   64    d&lt;br /&gt;
            045   37    25    %              145   101   65    e&lt;br /&gt;
            046   38    26    &amp;amp;              146   102   66    f&lt;br /&gt;
            047   39    27    '              147   103   67    g&lt;br /&gt;
            050   40    28    (              150   104   68    h&lt;br /&gt;
            051   41    29    )              151   105   69    i&lt;br /&gt;
            052   42    2A    *              152   106   6A    j&lt;br /&gt;
            053   43    2B    +              153   107   6B    k&lt;br /&gt;
            054   44    2C    ,              154   108   6C    l&lt;br /&gt;
            055   45    2D    -              155   109   6D    m&lt;br /&gt;
            056   46    2E    .              156   110   6E    n&lt;br /&gt;
            057   47    2F    /              157   111   6F    o&lt;br /&gt;
            060   48    30    0              160   112   70    p&lt;br /&gt;
            061   49    31    1              161   113   71    q&lt;br /&gt;
            062   50    32    2              162   114   72    r&lt;br /&gt;
            063   51    33    3              163   115   73    s&lt;br /&gt;
            064   52    34    4              164   116   74    t&lt;br /&gt;
            065   53    35    5              165   117   75    u&lt;br /&gt;
            066   54    36    6              166   118   76    v&lt;br /&gt;
            067   55    37    7              167   119   77    w&lt;br /&gt;
            070   56    38    8              170   120   78    x&lt;br /&gt;
            071   57    39    9              171   121   79    y&lt;br /&gt;
            072   58    3A    :              172   122   7A    z&lt;br /&gt;
            073   59    3B    ;              173   123   7B    {&lt;br /&gt;
            074   60    3C    &amp;lt;              174   124   7C    |&lt;br /&gt;
            075   61    3D    =              175   125   7D    }&lt;br /&gt;
            076   62    3E    &amp;gt;              176   126   7E    ~&lt;br /&gt;
            077   63    3F    ?              177   127   7F    DEL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 29:&lt;br /&gt;
&lt;br /&gt;
     Need a WWW Browser for the Terminal Session? Try lynx or elinks.&lt;br /&gt;
&lt;br /&gt;
         $ lynx&lt;br /&gt;
&lt;br /&gt;
     Or to read all these tips, with the latest updates&lt;br /&gt;
&lt;br /&gt;
      $ lynx http://umn.dl.sourceforge.net/sourceforge/souptonuts/How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Or, better yet elinks.&lt;br /&gt;
&lt;br /&gt;
         $ elinks http://somepage.&lt;br /&gt;
&lt;br /&gt;
     You can get elinks at the following site:&lt;br /&gt;
&lt;br /&gt;
             http://elinks.or.cz/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 30:&lt;br /&gt;
&lt;br /&gt;
    screen - screen manager with VT100/ANSI terminal emulation&lt;br /&gt;
&lt;br /&gt;
         This is an excellent utility. But if you work a lot in Emacs,&lt;br /&gt;
         then, you should place the following in your ~./.bashrc&lt;br /&gt;
&lt;br /&gt;
             alias s='screen -e^Pa -D -R'&lt;br /&gt;
&lt;br /&gt;
         After loging in again (or source .bashrc) ,&lt;br /&gt;
         type the following to load &amp;quot;screen&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
             $ s&lt;br /&gt;
&lt;br /&gt;
         If you're using the not using the alias command above, substitute&lt;br /&gt;
         CTL-a for CTL-p below. :&lt;br /&gt;
&lt;br /&gt;
             CTL-p CTL-C       To get a new session&lt;br /&gt;
             CTL-p  &amp;quot;           To list sessions, and arrow keys to move&lt;br /&gt;
             CTL-p SHFT-A      To name sessions&lt;br /&gt;
             CTL-p S            To split screens&lt;br /&gt;
             CLT-p Q            To unsplit screens&lt;br /&gt;
             CLT-p TAB          To switch between screens&lt;br /&gt;
             CLT-p :resize n    To resize screen to n rows, on split screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Screen is very powerful.  Should you become disconneced, you can&lt;br /&gt;
         still resume work after loggin in.&lt;br /&gt;
&lt;br /&gt;
             $ man screen&lt;br /&gt;
&lt;br /&gt;
         The above command will give you more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 31:&lt;br /&gt;
&lt;br /&gt;
     Need to Find the Factors of a Number?&lt;br /&gt;
&lt;br /&gt;
           $ factor 2345678992&lt;br /&gt;
                2345678992: 2 2 2 2 6581 22277&lt;br /&gt;
&lt;br /&gt;
     It's a quick way to find out if a number is prime&lt;br /&gt;
&lt;br /&gt;
           $ factor 7867&lt;br /&gt;
                7867: 7867&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 32:&lt;br /&gt;
&lt;br /&gt;
     Less is More -- piping to less to scroll backword and forward&lt;br /&gt;
&lt;br /&gt;
      For large &amp;quot;ls&amp;quot; listings try the followin, then, use the arrow key&lt;br /&gt;
      to move up and down the list.&lt;br /&gt;
&lt;br /&gt;
           $ ls /some_large_dir/ | less&lt;br /&gt;
&lt;br /&gt;
                 or&lt;br /&gt;
&lt;br /&gt;
           $ cat some_large_file | less&lt;br /&gt;
&lt;br /&gt;
                 or&lt;br /&gt;
&lt;br /&gt;
           $ less some_large_file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 33:&lt;br /&gt;
&lt;br /&gt;
     C &amp;quot;indent&amp;quot; Settings for Kernel Development&lt;br /&gt;
&lt;br /&gt;
           $ indent -kr -i8  program.c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 34:&lt;br /&gt;
&lt;br /&gt;
     FTP auto-login.  &amp;quot;ftp&amp;quot; to a site and have the password stored.&lt;br /&gt;
&lt;br /&gt;
     For instance, here's a sample &amp;quot;.net&amp;quot; file in a user's home&lt;br /&gt;
     directory for uploading to sourceforge. Note, sourceforge will&lt;br /&gt;
     take any password, so m@temp.com is used here for login &amp;quot;anonymous&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ cat ~/.netrc&lt;br /&gt;
               machine upload.sourceforge.net login anonymous password m@temp.com&lt;br /&gt;
               default login anonymous password user@site&lt;br /&gt;
&lt;br /&gt;
     It might be a good idea to change the rights on this file&lt;br /&gt;
&lt;br /&gt;
           $ chmod 0400 ~/.netrc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         #!/bin/bash&lt;br /&gt;
         #&lt;br /&gt;
         #  Sample ftp automated script to download&lt;br /&gt;
         #  file to ${dwnld}&lt;br /&gt;
         #&lt;br /&gt;
         dwnld=&amp;quot;/work/faq/unix-faq&amp;quot;&lt;br /&gt;
         cd ${dwnld}&lt;br /&gt;
         ftp &amp;lt;&amp;lt; FTPSTRING&lt;br /&gt;
         prompt off&lt;br /&gt;
         open rtfm.mit.edu&lt;br /&gt;
         cd /pub/usenet-by-group/news.answers/unix-faq/faq&lt;br /&gt;
         mget contents&lt;br /&gt;
         mget diff&lt;br /&gt;
         mget part*&lt;br /&gt;
         bye&lt;br /&gt;
         FTPSTRING&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      (Also see TIP 114 for ncftpget, which is a very powerful restarting&lt;br /&gt;
                            ftp program)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 35:&lt;br /&gt;
&lt;br /&gt;
     Bash Brace Expansion&lt;br /&gt;
&lt;br /&gt;
           $ echo f{ee,ie,oe,um}&lt;br /&gt;
                fee fie foe fum&lt;br /&gt;
&lt;br /&gt;
     This works with almost any command&lt;br /&gt;
&lt;br /&gt;
           $ mkdir -p /work/junk/{one,two,three,four}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 36:&lt;br /&gt;
&lt;br /&gt;
     Getting a List of Users on the System&lt;br /&gt;
&lt;br /&gt;
           $ cut -d: -f1 /etc/passwd | sort&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 37:&lt;br /&gt;
&lt;br /&gt;
     Editing a Bash Command&lt;br /&gt;
&lt;br /&gt;
      Try typing a long command say, then, type &amp;quot;fc&amp;quot; for an easy way&lt;br /&gt;
      to edit the command.&lt;br /&gt;
&lt;br /&gt;
           $ find /etc -iname '*.cnf' -exec grep -H 'log' {} \;&lt;br /&gt;
           $ fc&lt;br /&gt;
&lt;br /&gt;
      &amp;quot;fc&amp;quot; will bring the last command typed into an editor, &amp;quot;emacs&amp;quot; if&lt;br /&gt;
      that's the default editor. Type &amp;quot;fc -l&amp;quot; to list last few commands.&lt;br /&gt;
&lt;br /&gt;
      To seach for a command, try typing &amp;quot;CTL-r&amp;quot; at the shell prompt for&lt;br /&gt;
      searching. &amp;quot;CTL-t&amp;quot; to transpose, say &amp;quot;sl&amp;quot; was typed by you want &amp;quot;ls&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Hints when using &amp;quot;fc: in emacs:&lt;br /&gt;
&lt;br /&gt;
           ESC-b     move one word backward&lt;br /&gt;
           ESC-f     move one word forward&lt;br /&gt;
           ESC-DEL   kill one word backward&lt;br /&gt;
           CTL-k     kill point to end&lt;br /&gt;
           CTL-y     un-yank killed region at point&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 38:&lt;br /&gt;
&lt;br /&gt;
     Moving around Directories.&lt;br /&gt;
&lt;br /&gt;
     Change to the home directory:&lt;br /&gt;
          $ cd ~&lt;br /&gt;
            or&lt;br /&gt;
          $ cd&lt;br /&gt;
&lt;br /&gt;
     To go back to the last directory&lt;br /&gt;
          $ cd -&lt;br /&gt;
&lt;br /&gt;
     Instead of &amp;quot;cd&amp;quot; to a directory try &amp;quot;pushd&amp;quot; and look&lt;br /&gt;
     at the heading...you can see a list of directories.&lt;br /&gt;
&lt;br /&gt;
          $ pushd /etc&lt;br /&gt;
          $ pushd /usr/local&lt;br /&gt;
&lt;br /&gt;
      Then, to get back &amp;quot;popd&amp;quot; or &amp;quot;popd 1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      To list all the directories pushed on the stack&lt;br /&gt;
      use the &amp;quot;dirs -v&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
          $ dirs -v&lt;br /&gt;
           0  /usr/local&lt;br /&gt;
           1  /etc&lt;br /&gt;
           2  /work/souptonuts/documentation/theBook&lt;br /&gt;
&lt;br /&gt;
      Now, if you &amp;quot;pushd +1&amp;quot; you will be moved to &amp;quot;/etc&amp;quot;, since&lt;br /&gt;
      is number &amp;quot;1&amp;quot; on the stack, and this directory will become&lt;br /&gt;
      &amp;quot;0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ pwd&lt;br /&gt;
           /usr/local&lt;br /&gt;
          $ pushd +1&lt;br /&gt;
          $ pwd&lt;br /&gt;
           /etc&lt;br /&gt;
&lt;br /&gt;
          $ dirs -v&lt;br /&gt;
           0  /etc&lt;br /&gt;
           1  /work/souptonuts/documentation/theBook&lt;br /&gt;
           2  /usr/local&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 39:&lt;br /&gt;
&lt;br /&gt;
     Need an Underscore after a Variable?&lt;br /&gt;
&lt;br /&gt;
       Enclose the variable in &amp;quot;{}&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $echo ${UID}_&lt;br /&gt;
&lt;br /&gt;
       Compare to&lt;br /&gt;
&lt;br /&gt;
          $echo $UID_&lt;br /&gt;
&lt;br /&gt;
       Also try the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ m=&amp;quot;my stuff here&amp;quot;&lt;br /&gt;
                $ echo -e ${m// /'\n'}&lt;br /&gt;
                        my&lt;br /&gt;
                        stuff&lt;br /&gt;
                        here&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 40:&lt;br /&gt;
&lt;br /&gt;
     Bash Variable Offset and String Operators&lt;br /&gt;
&lt;br /&gt;
        $ r=&amp;quot;this is stuff&amp;quot;&lt;br /&gt;
        $ echo ${r:3}&lt;br /&gt;
        $ echo ${r:5:2}&lt;br /&gt;
&lt;br /&gt;
      Note, ${varname:offset:length}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         ${varname:?message}  If varname exist and isn't null return value, else,&lt;br /&gt;
                              print var and message.&lt;br /&gt;
&lt;br /&gt;
           $ r=&amp;quot;new stuff&amp;quot;&lt;br /&gt;
           $ echo ${r:? &amp;quot;that's r for you&amp;quot;}&lt;br /&gt;
               new stuff&lt;br /&gt;
           $ unset r&lt;br /&gt;
           $ echo ${r:? &amp;quot;that's r for you&amp;quot;}&lt;br /&gt;
               bash: r:  that's r for you&lt;br /&gt;
&lt;br /&gt;
         ${varname:+word}    If varname exist and not null return word. Else, return null.&lt;br /&gt;
&lt;br /&gt;
         ${varname:-word}    If varname exist and not null return value. Else, return word.&lt;br /&gt;
&lt;br /&gt;
      Working with arrays in bash - bash arrays.&lt;br /&gt;
&lt;br /&gt;
           $ unset p&lt;br /&gt;
           $ p=(one two three)&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[@]}&amp;quot;&lt;br /&gt;
           one two three&lt;br /&gt;
&lt;br /&gt;
      or&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[*]}&amp;quot;&lt;br /&gt;
           one two three&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${#p[@]}&amp;quot;&lt;br /&gt;
           3&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[0]}&amp;quot;&lt;br /&gt;
           one&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[1]}&amp;quot;&lt;br /&gt;
           two&lt;br /&gt;
&lt;br /&gt;
            Also see (TIP 95)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 41:&lt;br /&gt;
&lt;br /&gt;
     Loops in Bash&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The command below loops through directories listed in $PATH.&lt;br /&gt;
&lt;br /&gt;
          $ path=$PATH:&lt;br /&gt;
          $ while [ $path ]; do echo &amp;quot; ${path%%:*} &amp;quot;; path=${path#*:}; done&lt;br /&gt;
&lt;br /&gt;
       The command below will also loop through directories in your path.&lt;br /&gt;
&lt;br /&gt;
          $IFS=:&lt;br /&gt;
          $ for dir in $PATH&lt;br /&gt;
          &amp;gt; do&lt;br /&gt;
          &amp;gt; ls -ld $dir&lt;br /&gt;
          &amp;gt; done&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Jun 10 20:16 /usr/local/bin&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Jun 13 23:12 /bin&lt;br /&gt;
              drwxr-xr-x    3 root     root        40960 Jun 12 08:00 /usr/bin&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Feb 14 03:12 /usr/X11R6/bin&lt;br /&gt;
              drwxrwxr-x    2 chirico  chirico      4096 Jun  6 13:06 /home/chirico/bin&lt;br /&gt;
&lt;br /&gt;
     Other ways of doing loops:&lt;br /&gt;
&lt;br /&gt;
        for (( i=1; i &amp;lt;= 20; i++))&lt;br /&gt;
                do&lt;br /&gt;
                        echo -n &amp;quot;$i &amp;quot;&lt;br /&gt;
                done&lt;br /&gt;
&lt;br /&gt;
     Note, to do it all on one line, do the following:&lt;br /&gt;
&lt;br /&gt;
        $ for (( i=1; i &amp;lt;= 20; i++)); do echo -n &amp;quot;$i&amp;quot;; done&lt;br /&gt;
&lt;br /&gt;
     Below, is an example of declaring i an integer so that you do not&lt;br /&gt;
     have to preface with let.&lt;br /&gt;
&lt;br /&gt;
          $ declare -i i&lt;br /&gt;
          $ i=5;&lt;br /&gt;
          $ while (( $i &amp;gt; 1 )); do&lt;br /&gt;
          &amp;gt; i=i-1&lt;br /&gt;
          &amp;gt; echo $i&lt;br /&gt;
          &amp;gt; done&lt;br /&gt;
          4&lt;br /&gt;
          3&lt;br /&gt;
          2&lt;br /&gt;
&lt;br /&gt;
     You can also use &amp;quot;while [ $i -gt 1 ]; do&amp;quot;  in place of &amp;quot;while (( $i &amp;gt; 1 )); do&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     To get a listing of all declared values&lt;br /&gt;
&lt;br /&gt;
          $ declare -i&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Try putting a few words in the file &amp;quot;test&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         $ while read filename; do echo  &amp;quot;- $filename &amp;quot;; done &amp;lt; test |nl -w1&lt;br /&gt;
&lt;br /&gt;
     Or, using an array&lt;br /&gt;
&lt;br /&gt;
                declare -a Array&lt;br /&gt;
                Array[0]=&amp;quot;zero&amp;quot;&lt;br /&gt;
                Array[1]=&amp;quot;one&amp;quot;&lt;br /&gt;
                Array[2]=&amp;quot;two&amp;quot;&lt;br /&gt;
                for i in `seq ${#Array[@]}`&lt;br /&gt;
                do&lt;br /&gt;
                  echo $Array[$i-1]&lt;br /&gt;
                done&lt;br /&gt;
&lt;br /&gt;
         Also see (TIP 95 and TIP 133).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 42:&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;diff&amp;quot; and &amp;quot;patch&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
        You have created a program &amp;quot;prog.c&amp;quot;, saved as this name and also copied&lt;br /&gt;
        to  &amp;quot;prog.c.old&amp;quot;. You post &amp;quot;prog.c&amp;quot; to users.  Next, you make changes&lt;br /&gt;
        to prog.c&lt;br /&gt;
&lt;br /&gt;
          $ diff -c prog.c.old prog.c &amp;gt; prog.patch&lt;br /&gt;
&lt;br /&gt;
        Now, users can get the latest updates by running.&lt;br /&gt;
&lt;br /&gt;
          $ patch &amp;lt; prog.patch&lt;br /&gt;
&lt;br /&gt;
        By the way, you can make backups of your data easily.&lt;br /&gt;
&lt;br /&gt;
          $ cp /etc/fstab{,.bak}&lt;br /&gt;
&lt;br /&gt;
        Now, you do your edits to &amp;quot;/etc/fstab&amp;quot; and if you need&lt;br /&gt;
        to go back to the original, you can find it at&lt;br /&gt;
        &amp;quot;/etc/fstab.bak&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 43:&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;cat&amp;quot; the Contents of Files Listed in a File, in That Order.&lt;br /&gt;
&lt;br /&gt;
       SETUP (Assume you have the following)&lt;br /&gt;
&lt;br /&gt;
              $ cat file_of_files&lt;br /&gt;
                  file1&lt;br /&gt;
                  file2&lt;br /&gt;
&lt;br /&gt;
              $ cat file1&lt;br /&gt;
                  This is the data in file1&lt;br /&gt;
&lt;br /&gt;
              $ cat file 2&lt;br /&gt;
                  This is the data in file2&lt;br /&gt;
&lt;br /&gt;
       So there are 3 files here &amp;quot;file_of_files&amp;quot; which contains the name of&lt;br /&gt;
       other files.  In this case &amp;quot;file1&amp;quot; and &amp;quot;file2&amp;quot;. And the contents of&lt;br /&gt;
       &amp;quot;file1&amp;quot; and &amp;quot;file2&amp;quot; is shown above.&lt;br /&gt;
&lt;br /&gt;
               $ cat file_of_files|xargs cat&lt;br /&gt;
                    This is the data in  file1&lt;br /&gt;
                    This is the data in  file2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 44:&lt;br /&gt;
&lt;br /&gt;
     Columns and Rows -- getting anything you want.&lt;br /&gt;
&lt;br /&gt;
     Assume you have the following file.&lt;br /&gt;
&lt;br /&gt;
        $ cat data&lt;br /&gt;
           1 2 3&lt;br /&gt;
           4 5&lt;br /&gt;
           6 7 8 9 10&lt;br /&gt;
           11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
     How to you get everything in  2 columns?&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l2&lt;br /&gt;
           1 2&lt;br /&gt;
           3 4&lt;br /&gt;
           5 6&lt;br /&gt;
           7 8&lt;br /&gt;
           9 10&lt;br /&gt;
           11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
    Three columns?&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l3&lt;br /&gt;
           1 2 3&lt;br /&gt;
           4 5 6&lt;br /&gt;
           7 8 9&lt;br /&gt;
           10 11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
    What's the row sum of the &amp;quot;three columns?&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
           6&lt;br /&gt;
           15&lt;br /&gt;
           24&lt;br /&gt;
           33&lt;br /&gt;
           27&lt;br /&gt;
&lt;br /&gt;
    or&lt;br /&gt;
&lt;br /&gt;
        $ tr ' ' '\n' &amp;lt; data |xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
&lt;br /&gt;
    NOTE &amp;quot;Steven Heiner's rule&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
             cat one_file | program&lt;br /&gt;
&lt;br /&gt;
           can always be rewritten as&lt;br /&gt;
&lt;br /&gt;
             program &amp;lt; one_file&lt;br /&gt;
&lt;br /&gt;
   Note: thanks to Steven Heiner (http://www.shelldorado.com/) the above can be&lt;br /&gt;
       shortened as follows:&lt;br /&gt;
&lt;br /&gt;
               $ tr ' ' '\n' &amp;lt; data|xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
&lt;br /&gt;
          Need to &amp;quot;tr&amp;quot; from the stdin?&lt;br /&gt;
&lt;br /&gt;
               $ tr &amp;quot;xy&amp;quot; &amp;quot;yx&amp;quot;| ... | ...&lt;br /&gt;
&lt;br /&gt;
       But there is a the &amp;quot;Stephane CHAZELAS&amp;quot; condition here&lt;br /&gt;
&lt;br /&gt;
         &amp;quot;Note that tr, sed, and awk mail fail on files containing '\0'&lt;br /&gt;
          sed and awk have unspecified behaviors if the input&lt;br /&gt;
          doesn't end in a '\n' (or to sum up, cat works for&lt;br /&gt;
          binary and text files, text utilities such as sed or awk&lt;br /&gt;
          work only for text files).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 45:&lt;br /&gt;
&lt;br /&gt;
     Auto Directory Spelling Corrections.&lt;br /&gt;
&lt;br /&gt;
      To turn this on:&lt;br /&gt;
&lt;br /&gt;
           $ shopt -s cdspell&lt;br /&gt;
&lt;br /&gt;
      Now mispell a directory in the cd command.&lt;br /&gt;
&lt;br /&gt;
           $ cd /usk/local&lt;br /&gt;
                   ^-------- still gets you to --&lt;br /&gt;
                                                |&lt;br /&gt;
                                            /usr/local&lt;br /&gt;
&lt;br /&gt;
      What other options can you set? The following will list&lt;br /&gt;
      all the options:&lt;br /&gt;
&lt;br /&gt;
           $ shopt -p&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 46:&lt;br /&gt;
&lt;br /&gt;
     Record Eveything Printed on Your Terminal Screen.&lt;br /&gt;
&lt;br /&gt;
            $ script -a &amp;lt;filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Now start doing stuff and &amp;quot;everything&amp;quot; is appended to &amp;lt;filename&amp;gt;.&lt;br /&gt;
     For example&lt;br /&gt;
&lt;br /&gt;
            $ script installation&lt;br /&gt;
&lt;br /&gt;
            $ (command)&lt;br /&gt;
&lt;br /&gt;
            $ (result)&lt;br /&gt;
&lt;br /&gt;
            $ ...&lt;br /&gt;
&lt;br /&gt;
            $ ...&lt;br /&gt;
&lt;br /&gt;
            $ (command)&lt;br /&gt;
&lt;br /&gt;
            $ (result)&lt;br /&gt;
&lt;br /&gt;
            $ exit&lt;br /&gt;
&lt;br /&gt;
     The whole session log is in the installation file that you can later&lt;br /&gt;
     read and/or cleanup and add to a documentation.&lt;br /&gt;
&lt;br /&gt;
     This command can also be used to redirect the contents to another user,&lt;br /&gt;
     but you must be root to do this.&lt;br /&gt;
&lt;br /&gt;
     Step 1 - find out what pts they are using.&lt;br /&gt;
&lt;br /&gt;
            $ w&lt;br /&gt;
&lt;br /&gt;
     Step 2 - Run script on that pts. After running this command below&lt;br /&gt;
              everything you type will appear on their screen.&lt;br /&gt;
&lt;br /&gt;
            $ script /dev/pts/4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Thanks to Jacques.GARNIER-EXTERIEUR@EU.RHODIA.COM for his contribution&lt;br /&gt;
     to this tip.&lt;br /&gt;
&lt;br /&gt;
     Also reference TIP 208.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 47:&lt;br /&gt;
&lt;br /&gt;
     Monitor all Network Traffic Except Your Current ssh Connection.&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX -s 1500 port not 22&lt;br /&gt;
&lt;br /&gt;
       Or to filter out port 123 as well getting the full length of the packet&lt;br /&gt;
       (-s 0), use the following:&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX -s 0 port not 22  and port not 123&lt;br /&gt;
&lt;br /&gt;
       Or to filter only a certain host say 81.169.158.205&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX  port not 22 and host 81.169.158.205&lt;br /&gt;
&lt;br /&gt;
     Just want ip addresses and a little bit of data, then,&lt;br /&gt;
     use this. The &amp;quot;-c 20&amp;quot; is to stop after 20 packets.&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN  -s 1500 port not 22 -c 20&lt;br /&gt;
&lt;br /&gt;
     If you're looking for sign of DOS attacks, the following show just the SYN&lt;br /&gt;
     packets on all interfaces:&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump 'tcp[13] &amp;amp; 2 == 2'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 48:&lt;br /&gt;
&lt;br /&gt;
     Where are the GNU Reference Manuals?&lt;br /&gt;
&lt;br /&gt;
           http://www.gnu.org/manual/manual.html&lt;br /&gt;
&lt;br /&gt;
     Also worth a look the &amp;quot;Linux Documentation Project&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           http://en.tldp.org/&lt;br /&gt;
&lt;br /&gt;
     and Red Hat manuals&lt;br /&gt;
&lt;br /&gt;
           http://www.redhat.com/docs/manuals/enterprise/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 49:&lt;br /&gt;
&lt;br /&gt;
     Setting or Changing the Library Path.&lt;br /&gt;
&lt;br /&gt;
     The following contains the settings to be added or deleted&lt;br /&gt;
&lt;br /&gt;
           /etc/ld.so.conf&lt;br /&gt;
&lt;br /&gt;
     After this file is edited, you must run the following:&lt;br /&gt;
&lt;br /&gt;
           $ ldconfig&lt;br /&gt;
&lt;br /&gt;
     See &amp;quot;man ldconfig&amp;quot; for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 50:&lt;br /&gt;
&lt;br /&gt;
     Working with Libraries in C&lt;br /&gt;
&lt;br /&gt;
     Assume the following 3 programs:&lt;br /&gt;
&lt;br /&gt;
      $ cat ./src/test.c&lt;br /&gt;
&lt;br /&gt;
         int test(int t)&lt;br /&gt;
         {&lt;br /&gt;
           printf(&amp;quot;%d\n&amp;quot;,t);&lt;br /&gt;
           return t;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      $ cat ./src/prog1.c&lt;br /&gt;
&lt;br /&gt;
         /*&lt;br /&gt;
          program: prog1.c&lt;br /&gt;
          dependences: test.c&lt;br /&gt;
&lt;br /&gt;
          compiling this program:&lt;br /&gt;
          gcc -o prog test.c prog1.c&lt;br /&gt;
&lt;br /&gt;
          Note the libpersonal include&lt;br /&gt;
          should be remove if NOT using the&lt;br /&gt;
          library&lt;br /&gt;
         */&lt;br /&gt;
&lt;br /&gt;
         #include &amp;lt;libpersonal.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         int&lt;br /&gt;
         main(int argc, char **argv)&lt;br /&gt;
         {&lt;br /&gt;
           test(45);&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
      $ cat ./include/libpersonal.h&lt;br /&gt;
&lt;br /&gt;
         extern int test(int);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Prog1.c needs the test function in  test.c&lt;br /&gt;
     To compile, so that both programs work together, do the following:&lt;br /&gt;
&lt;br /&gt;
          $ cd src&lt;br /&gt;
          $ gcc -o prog test.c prog1.c -I../include&lt;br /&gt;
&lt;br /&gt;
     However, if you want to create your own static library, then, run the following:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p ../lib&lt;br /&gt;
          $ gcc -c test.c  -o ../lib/test.o&lt;br /&gt;
          $ cd ../lib&lt;br /&gt;
          $ ar r libpersonal.a test.o&lt;br /&gt;
          $ ranlib libpersonal.a&lt;br /&gt;
&lt;br /&gt;
     or, the ar and ranlib command can be combined as follows:&lt;br /&gt;
&lt;br /&gt;
          $ ar rs libpersonal.a test.o&lt;br /&gt;
&lt;br /&gt;
     To compile the program with the static library:&lt;br /&gt;
&lt;br /&gt;
          $ cd ../src&lt;br /&gt;
          $ gcc -I../include -L../lib -o prog1 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     The -I../include  tells  gcc to look in the ../include directory for&lt;br /&gt;
     libpersonal.h. and -L../lib, tells gcc to look for the&lt;br /&gt;
     &amp;quot;libpersonal.a&amp;quot; library.&lt;br /&gt;
&lt;br /&gt;
           $ cd ..&lt;br /&gt;
           $ tree src lib include&lt;br /&gt;
           src&lt;br /&gt;
           |-- prog&lt;br /&gt;
           |-- prog1&lt;br /&gt;
           |-- prog1.c&lt;br /&gt;
           `-- test.c&lt;br /&gt;
           lib&lt;br /&gt;
           |-- libpersonal.a&lt;br /&gt;
           `-- test.o&lt;br /&gt;
           include&lt;br /&gt;
           `-- libpersonal.h&lt;br /&gt;
&lt;br /&gt;
     This was a STATIC library. Often times you will want to use a SHARED&lt;br /&gt;
     or dynamic library.&lt;br /&gt;
&lt;br /&gt;
     SHARED LIBRARY:&lt;br /&gt;
&lt;br /&gt;
     You must recompile test.c with -fpic option.&lt;br /&gt;
&lt;br /&gt;
          $ cd ../lib&lt;br /&gt;
          $ gcc -c -fpic ../src/test.c -o test.o&lt;br /&gt;
&lt;br /&gt;
     Next create the libpersonal.so file.&lt;br /&gt;
&lt;br /&gt;
          $ gcc -shared -o libpersonal.so test.o&lt;br /&gt;
&lt;br /&gt;
     Now, compile the source prog1.c as follows:&lt;br /&gt;
&lt;br /&gt;
          $ cd ../src&lt;br /&gt;
          $ gcc -Wl,-R../lib -L../lib -I../include -o prog2 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
     This should work fine. But, take a look at prog2 using the ldd command.&lt;br /&gt;
&lt;br /&gt;
          $ ldd prog2&lt;br /&gt;
&lt;br /&gt;
        libpersonal.so =&amp;gt; ../lib/libpersonal.so (0x40017000)&lt;br /&gt;
        libc.so.6 =&amp;gt; /lib/tls/libc.so.6 (0x42000000)&lt;br /&gt;
        /lib/ld-linux.so.2 =&amp;gt; /lib/ld-linux.so.2 (0x40000000)&lt;br /&gt;
&lt;br /&gt;
     If you move the program prog2 to a different location, it will not run.&lt;br /&gt;
     Instead you will get the following error:&lt;br /&gt;
&lt;br /&gt;
           prog2: error while loading shared libraries: libpersonal.so:&lt;br /&gt;
                     cannot open shared object file: No such file or directory&lt;br /&gt;
&lt;br /&gt;
     To fix this, you should specify the direct path to the library. And in my&lt;br /&gt;
     case it is rather long&lt;br /&gt;
&lt;br /&gt;
      $  gcc -Wl,-R/work/souptonuts/documentation/theBook/lib -L../lib -I../include -o prog2 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE: The -R must always follow the -Wl.  (-Wl,-R&amp;lt;directory&amp;gt;) They always go together&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 51:&lt;br /&gt;
&lt;br /&gt;
     Actively Monitor a File and Send Email when Expression Occurs.&lt;br /&gt;
&lt;br /&gt;
     This is a way to monitor &amp;quot;/var/log/messages&amp;quot; or any file for certain changes.&lt;br /&gt;
     The example below actively monitors &amp;quot;stuff&amp;quot; for the work &amp;quot;now&amp;quot; and as soon as&lt;br /&gt;
     &amp;quot;now&amp;quot; is added to the file, the contents of msg are sent to the user&lt;br /&gt;
     mikechirico@hotmail.com&lt;br /&gt;
&lt;br /&gt;
          $ tail -f stuff | \&lt;br /&gt;
              awk ' /now/ { system(&amp;quot;mail -s \&amp;quot;This is working\&amp;quot;  mikechirico@hotmail.com &amp;lt; msg&amp;quot;) }'&lt;br /&gt;
&lt;br /&gt;
     Or, you can run a program, say get headings on slashdot from the program &amp;quot;getslash.php&amp;quot; which&lt;br /&gt;
     runs on  &amp;quot;192.168.1.155&amp;quot; with account &amp;quot;chirico&amp;quot;. Assuming you have ssh keys setup, then, the following&lt;br /&gt;
     will send mail from the output:&lt;br /&gt;
&lt;br /&gt;
          $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;|mail -s &amp;quot;Slash cron Headlines&amp;quot;  mchirico@comcast.net&lt;br /&gt;
&lt;br /&gt;
     See (TIP 80) for scraping the headings on slash dot and how to get a copy of &amp;quot;getslash.php&amp;quot;.  If you still&lt;br /&gt;
     want to use awk:&lt;br /&gt;
&lt;br /&gt;
           $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;| \&lt;br /&gt;
                      awk '{ print $0 | &amp;quot;mail -s \x27 Slash Topics \x27 mchirico@comcast.net &amp;quot;}'&lt;br /&gt;
&lt;br /&gt;
     Note the &amp;quot;\x27&amp;quot; is a quote.  Maybe you only want articles dealing with &amp;quot;Linux&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
           $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;| \&lt;br /&gt;
                      awk '/Linux/{ print $0 | &amp;quot;mail -s \x27 Slash Topics \x27 mchirico@comcast.net &amp;quot;}'&lt;br /&gt;
&lt;br /&gt;
     For $60, you can get a numeric display from &amp;quot;delcom engineering&amp;quot; that you can send messages and&lt;br /&gt;
     data to.  I get weather information off the internet and send it to this device.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/projects/delcom/&lt;br /&gt;
&lt;br /&gt;
     (Reference TIP 151 for ssh tips)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 52:&lt;br /&gt;
&lt;br /&gt;
     Need to Keep Secrets? Encrypt it.&lt;br /&gt;
&lt;br /&gt;
      To Encrypt:&lt;br /&gt;
&lt;br /&gt;
            $ openssl des3 -salt -in file.txt -out file.des3&lt;br /&gt;
&lt;br /&gt;
      The above will prompt for a password, or you can put it in&lt;br /&gt;
      with a -k option, assuming you're on a trusted server.&lt;br /&gt;
&lt;br /&gt;
      To Decrypt&lt;br /&gt;
&lt;br /&gt;
            $  openssl des3 -d -salt -in file.des3 -out file.txt -k mypassword&lt;br /&gt;
&lt;br /&gt;
      Need to encrypt what you type? Enter the following, then start typing&lt;br /&gt;
      and  ^D to end.&lt;br /&gt;
&lt;br /&gt;
            $ openssl des3 -salt -out stuff.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 53:&lt;br /&gt;
&lt;br /&gt;
     Check that a File has Not Been Tampered With: Use Cryptographic Hashing Function.&lt;br /&gt;
&lt;br /&gt;
     The md5sum is popular but dated&lt;br /&gt;
&lt;br /&gt;
              $ md5sum file&lt;br /&gt;
&lt;br /&gt;
     Instead, use one of the following;&lt;br /&gt;
&lt;br /&gt;
              $ openssl dgst -sha1 -c file&lt;br /&gt;
&lt;br /&gt;
              $ openssl dgst -ripemd160 -c  file&lt;br /&gt;
&lt;br /&gt;
     All calls give a fixed length string or &amp;quot;message digest&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 54:&lt;br /&gt;
&lt;br /&gt;
     Need to View Information About a Secure Web Server? A SSL/TLS test.&lt;br /&gt;
&lt;br /&gt;
           $ openssl s_client -connect www.sourceforge.net:443&lt;br /&gt;
&lt;br /&gt;
     Above will give a long listing of certificates.&lt;br /&gt;
&lt;br /&gt;
     Note, it is also possible to get certificate information about a mail server&lt;br /&gt;
&lt;br /&gt;
           $ openssl s_client -connect mail.comcast.net:995 -showcerts&lt;br /&gt;
&lt;br /&gt;
     When you do the above command you get two certificates. If you copy&lt;br /&gt;
     past both certificates by taking the following contents include the&lt;br /&gt;
     begin and end show below:&lt;br /&gt;
&lt;br /&gt;
                 -----BEGIN CERTIFICATE-----&lt;br /&gt;
                 ....&lt;br /&gt;
                 -----END CERTIFICATE-----&lt;br /&gt;
&lt;br /&gt;
     Then create files &amp;quot;comcast0.pem&amp;quot; and &amp;quot;comcast1.pem&amp;quot; out of these certificaties and&lt;br /&gt;
     put them in a directory &amp;quot;/home/donkey/.certs&amp;quot;, then, with the openssl src package, in&lt;br /&gt;
     the &amp;quot;./tools/c_rehash&amp;quot; run&lt;br /&gt;
&lt;br /&gt;
            $ c_rehash .certs&lt;br /&gt;
            Doing .certs&lt;br /&gt;
            comcast0.pem =&amp;gt; 72f90dc0.0&lt;br /&gt;
            comcast1.pem =&amp;gt; f73e89fd.0&lt;br /&gt;
&lt;br /&gt;
     Now it's possible to have fetchmail work with these certs.&lt;br /&gt;
&lt;br /&gt;
       #&lt;br /&gt;
       #&lt;br /&gt;
       # Sample .fetchmailrc file for Comcast&lt;br /&gt;
       #&lt;br /&gt;
       # Check mail every 90 seconds&lt;br /&gt;
       set daemon 90&lt;br /&gt;
       set syslog&lt;br /&gt;
       set postmaster donkey&lt;br /&gt;
       #set bouncemail&lt;br /&gt;
       #&lt;br /&gt;
       # Comcast email is zdonkey but computer account is  just donkey&lt;br /&gt;
       #&lt;br /&gt;
       poll mail.comcast.net with proto POP3 and options no dns&lt;br /&gt;
              user 'zdonkey' with pass &amp;quot;somethin35&amp;quot;  is 'donkey' here options ssl sslcertck sslcertpath '/home/donkey/.certs'&lt;br /&gt;
              smtphost comcast.net&lt;br /&gt;
       # currently not used&lt;br /&gt;
       mda '/usr/bin/procmail -d %T'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     REFERENCE: http://www.openssl.org/&lt;br /&gt;
                http://www.catb.org/~esr/fetchmail/fetchmail-6.2.5.tar.gz&lt;br /&gt;
                http://www.madboa.com/geek/openssl/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 55:&lt;br /&gt;
&lt;br /&gt;
     cp --parents. What does this option do?&lt;br /&gt;
&lt;br /&gt;
     Assume you have the following directory structure&lt;br /&gt;
&lt;br /&gt;
            .&lt;br /&gt;
            |-- a&lt;br /&gt;
            |   `-- b&lt;br /&gt;
            |       `-- c&lt;br /&gt;
            |           `-- d&lt;br /&gt;
            |               |-- file1&lt;br /&gt;
            |               `-- file2&lt;br /&gt;
            `-- newdir&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Issue the following command:&lt;br /&gt;
&lt;br /&gt;
         $ cp --parents ./a/b/c/d/* ./newdir/&lt;br /&gt;
&lt;br /&gt;
     Now you have the following:&lt;br /&gt;
&lt;br /&gt;
            .&lt;br /&gt;
            |-- a&lt;br /&gt;
            |   `-- b&lt;br /&gt;
            |       `-- c&lt;br /&gt;
            |           `-- d&lt;br /&gt;
            |               |-- file1&lt;br /&gt;
            |               `-- file2&lt;br /&gt;
            `-- newdir&lt;br /&gt;
                `-- a&lt;br /&gt;
                    `-- b&lt;br /&gt;
                        `-- c&lt;br /&gt;
                            `-- d&lt;br /&gt;
                                |-- file1&lt;br /&gt;
                                `-- file2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 56:&lt;br /&gt;
&lt;br /&gt;
     Quickly Locating files.&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;locate&amp;quot; command quickly searches the indexed database for files.  It just&lt;br /&gt;
     gives the name of the files; but, if you need more information use it as follows&lt;br /&gt;
&lt;br /&gt;
         $ locate document|xargs ls -l&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;locate&amp;quot; database may only get updated every 24 hours.  For more recent finds,&lt;br /&gt;
     use the &amp;quot;find&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 57:&lt;br /&gt;
&lt;br /&gt;
     Using the &amp;quot;find&amp;quot; Command.&lt;br /&gt;
&lt;br /&gt;
     List only directories, max 2 nodes down that have &amp;quot;net&amp;quot; in the name&lt;br /&gt;
&lt;br /&gt;
       $ find /proc -type d -maxdepth 2 -iname '*net*'&lt;br /&gt;
&lt;br /&gt;
     Find all *.c and *.h files starting from the current &amp;quot;.&amp;quot; position.&lt;br /&gt;
&lt;br /&gt;
       $ find . \( -iname '*.c'  -o -iname '*.h' \) -print&lt;br /&gt;
&lt;br /&gt;
     Find all, but skip what's in &amp;quot;/CVS&amp;quot; and &amp;quot;/junk&amp;quot;. Start from &amp;quot;/work&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ find /work \( -iregex '.*/CVS'  -o -iregex '.*/junk' \)  -prune -o -print&lt;br /&gt;
&lt;br /&gt;
     Note -regex and -iregex work on the directory as well, which means&lt;br /&gt;
     you must consider the &amp;quot;./&amp;quot; that comes before all listings.&lt;br /&gt;
&lt;br /&gt;
     Here is another example. Find all files except what is under the CVS, including&lt;br /&gt;
     CVS listings. Also exclude &amp;quot;#&amp;quot; and &amp;quot;~&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       $ find . -regex '.*' ! \( -regex '.*CVS.*'  -o -regex '.*[#|~].*' \)&lt;br /&gt;
&lt;br /&gt;
     Find a *.c file, then run grep on it looking for &amp;quot;stdio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       $ find . -iname '*.c' -exec grep -H 'stdio.h' {} \;&lt;br /&gt;
         sample output --&amp;gt;  ./prog1.c:#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
                            ./test.c:#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Looking for the disk-hog on the whole system?&lt;br /&gt;
&lt;br /&gt;
       $ find /  -size +10000k 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
     Looking for files changed in the last 24 hours? Make sure you add the&lt;br /&gt;
     minus sign &amp;quot;-1&amp;quot;, otherwise, you will only find files changed exactly&lt;br /&gt;
     24 hours from now. With the &amp;quot;-1&amp;quot; you get files changed from now to 24&lt;br /&gt;
     hours.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ find  . -ctime -1  -printf &amp;quot;%a %f\n&amp;quot;&lt;br /&gt;
       Wed Oct  6 12:51:56 2004 .&lt;br /&gt;
       Wed Oct  6 12:35:16 2004 How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
     Or if you just want files.&lt;br /&gt;
&lt;br /&gt;
       $ find . -type f -ctime -1  -printf &amp;quot;%a %f\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Details on file status change in the last 48 hours, current directory. Also note &amp;quot;-atime -2&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
       $ find . -ctime -2 -type f -exec ls -l {} \;&lt;br /&gt;
&lt;br /&gt;
             NOTE: if you don't use -type f, you make get &amp;quot;.&amp;quot; returned, which&lt;br /&gt;
             when run through ls &amp;quot;ls .&amp;quot; may list more than what you want.&lt;br /&gt;
&lt;br /&gt;
             Also you may only want the current directory&lt;br /&gt;
&lt;br /&gt;
       $ find . -ctime -2 -type f -maxdepth 1 -exec ls -l {} \;&lt;br /&gt;
&lt;br /&gt;
     To find files modified within the last 5 to 10 minutes&lt;br /&gt;
&lt;br /&gt;
       $ find . -mmin +5 -mmin -10 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     For more example &amp;quot;find&amp;quot; commands, reference the following looking&lt;br /&gt;
     for the latest version of &amp;quot;bashscripts.x.x.x.tar.gz&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79320&amp;amp;package_id=80711&lt;br /&gt;
&lt;br /&gt;
     See &amp;quot;TIP 71&amp;quot; for examples of find using the inode feature. &amp;quot; $ find . -inum &amp;lt;inode&amp;gt; -exec rm -- '{}' \; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     If you don't want error messages, or need to redirect error messages &amp;quot;&amp;gt; /dev/null 2&amp;gt;&amp;amp;1&amp;quot;, or see&lt;br /&gt;
     &amp;quot;TIP 81&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 58:&lt;br /&gt;
&lt;br /&gt;
     Using the &amp;quot;rm&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
     How do you remove a file that has the name &amp;quot;-&amp;quot;.  For instance, if you run the command&lt;br /&gt;
     &amp;quot;$ cat &amp;gt; - &amp;quot; and type some text followed by ^d, how does the &amp;quot;-&amp;quot; file get deleted?&lt;br /&gt;
&lt;br /&gt;
        $ rm -- -&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;--&amp;quot; nullifies any rm options.&lt;br /&gt;
&lt;br /&gt;
     How do you delete the directory &amp;quot;one&amp;quot;, all it's sub-directories, and any data?&lt;br /&gt;
&lt;br /&gt;
        $ rm -rf ./one&lt;br /&gt;
&lt;br /&gt;
     Note, to selectively delete stuff on a directory, use the find command &amp;quot;TIP 57&amp;quot;.&lt;br /&gt;
     To delete by inode, see &amp;quot;TIP 71&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 59:&lt;br /&gt;
&lt;br /&gt;
     Giving ownership.&lt;br /&gt;
&lt;br /&gt;
     How do you give the user &amp;quot;donkey&amp;quot; ownership to all directories and files under&lt;br /&gt;
     &amp;quot;./fordonkey&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          $ chown -R donkey ./fordonkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 60:&lt;br /&gt;
&lt;br /&gt;
     Only Permit root login -- give others a message when they try to login.&lt;br /&gt;
&lt;br /&gt;
     Create the file &amp;quot;/etc/nologin&amp;quot; with &amp;quot;nologin&amp;quot; containing the contents&lt;br /&gt;
     of the message.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 61:&lt;br /&gt;
&lt;br /&gt;
     Limits: file size, open files, pipe size, stack size, max memory size&lt;br /&gt;
             cpu time, plus others.&lt;br /&gt;
&lt;br /&gt;
     To get a listing of current limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -a&lt;br /&gt;
             core file size        (blocks, -c) 0&lt;br /&gt;
             data seg size         (kbytes, -d) unlimited&lt;br /&gt;
             file size             (blocks, -f) unlimited&lt;br /&gt;
             max locked memory     (kbytes, -l) unlimited&lt;br /&gt;
             max memory size       (kbytes, -m) unlimited&lt;br /&gt;
             open files                    (-n) 1024&lt;br /&gt;
             pipe size          (512 bytes, -p) 8&lt;br /&gt;
             stack size            (kbytes, -s) 8192&lt;br /&gt;
             cpu time             (seconds, -t) unlimited&lt;br /&gt;
             max user processes            (-u) 8179&lt;br /&gt;
             virtual memory        (kbytes, -v) unlimited&lt;br /&gt;
&lt;br /&gt;
     Note as a user you can decrease your limits in the current&lt;br /&gt;
     shell session; but, you cannot increase.  This can be ideal&lt;br /&gt;
     for testing programs.  But, first you may want to create&lt;br /&gt;
     another shell &amp;quot;sh&amp;quot; so that you can &amp;quot;go back to where started&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -f 10&lt;br /&gt;
&lt;br /&gt;
     Now try&lt;br /&gt;
&lt;br /&gt;
          $ yes &amp;gt;&amp;gt; out&lt;br /&gt;
             File size limit exceeded&lt;br /&gt;
&lt;br /&gt;
     To set limits on users, make changes to &amp;quot;/etc/security/limits.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           bozo   - maxlogins 1&lt;br /&gt;
&lt;br /&gt;
     Will keep bozo from loging in more than once.&lt;br /&gt;
&lt;br /&gt;
     To list hard limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -Ha&lt;br /&gt;
&lt;br /&gt;
     To list soft limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -Sa&lt;br /&gt;
&lt;br /&gt;
     To restrict user access by time, day make changes to&lt;br /&gt;
             &amp;quot;/etc/security/time.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Also take a look at &amp;quot;/etc/profile&amp;quot; to see what other changes&lt;br /&gt;
     can be made, plus take a look under &amp;quot;/etc/security/*.conf&amp;quot; for&lt;br /&gt;
     other configuration files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 62:&lt;br /&gt;
&lt;br /&gt;
     Stupid &amp;quot;cat&amp;quot; Tricks.&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 43).&lt;br /&gt;
&lt;br /&gt;
     If you have multiple blank lines, squeeze these lines down to one,&lt;br /&gt;
     then, try the following:&lt;br /&gt;
&lt;br /&gt;
          $ cat -s &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to number the lines?&lt;br /&gt;
&lt;br /&gt;
          $ cat -n &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to show tabs?&lt;br /&gt;
&lt;br /&gt;
          $ cat -t &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Need to mark end of lines by &amp;quot;$&amp;quot;? The following was suggested by  (Amos Shapira)&lt;br /&gt;
&lt;br /&gt;
          $ cat -e &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to see all the ctl characters?&lt;br /&gt;
&lt;br /&gt;
          /* ctlgen.c&lt;br /&gt;
            Program to generate ctl characters.&lt;br /&gt;
&lt;br /&gt;
            Compile:&lt;br /&gt;
&lt;br /&gt;
               gcc -o ctlgen ctlgen.c&lt;br /&gt;
&lt;br /&gt;
            Run:&lt;br /&gt;
&lt;br /&gt;
               ./ctlgen &amp;gt; mout&lt;br /&gt;
&lt;br /&gt;
            Now see the characters:&lt;br /&gt;
&lt;br /&gt;
               cat -v mout&lt;br /&gt;
&lt;br /&gt;
            Here's a sample output:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               $ cat -v mout|tail&lt;br /&gt;
                   test M-v&lt;br /&gt;
                   test M-w&lt;br /&gt;
                   test M-x&lt;br /&gt;
                   test M-y&lt;br /&gt;
                   test M-z&lt;br /&gt;
                   test M-{&lt;br /&gt;
                   test M-|&lt;br /&gt;
                   test M-}&lt;br /&gt;
                   test M-~&lt;br /&gt;
                   test M-^?&lt;br /&gt;
&lt;br /&gt;
          */&lt;br /&gt;
          #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
          #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
          int main()&lt;br /&gt;
          {&lt;br /&gt;
            int i;&lt;br /&gt;
&lt;br /&gt;
            for(i=0; i &amp;lt; 256; ++i)&lt;br /&gt;
              printf(&amp;quot;test %c \n&amp;quot;,i);&lt;br /&gt;
&lt;br /&gt;
            return 0;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 63:&lt;br /&gt;
&lt;br /&gt;
     Guard against SYN attacks and &amp;quot;ping&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     As root do the following:&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/tcp_syncookies&lt;br /&gt;
&lt;br /&gt;
     Want to disable &amp;quot;ping&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_all&lt;br /&gt;
&lt;br /&gt;
     Disable broadcast/multicast &amp;quot;ping&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts&lt;br /&gt;
&lt;br /&gt;
     And to enable again:&lt;br /&gt;
&lt;br /&gt;
          echo 0 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_all&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 64:&lt;br /&gt;
&lt;br /&gt;
     Make changes to .bash_profile and need to update the current session?&lt;br /&gt;
&lt;br /&gt;
       $ source .bash_profile&lt;br /&gt;
&lt;br /&gt;
     With the above command, the user does not have to logout.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 65:&lt;br /&gt;
&lt;br /&gt;
     What are the Special Shell Variables?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        $#   The number of arguments.&lt;br /&gt;
        $@   All arguments, as separate words.&lt;br /&gt;
        $*   All arguments, as one word.&lt;br /&gt;
        $$   ID of the current process.&lt;br /&gt;
        $?   Exit status of the last command.&lt;br /&gt;
        $0,$1,..$9,${10},${11}...${N}    Positional parameters. After &amp;quot;9&amp;quot; you must use the ${k} syntax.&lt;br /&gt;
&lt;br /&gt;
     Note that 0 is true. For example if you execute the following, which is true you get zero.&lt;br /&gt;
&lt;br /&gt;
         $  [[ -f /etc/passwd ]]&lt;br /&gt;
         $  echo $?&lt;br /&gt;
         0&lt;br /&gt;
     And the following is false, which returns a 1.&lt;br /&gt;
&lt;br /&gt;
         $  [[ -f /etc/passwdjabberwisnohere ]]&lt;br /&gt;
         $  echo $?&lt;br /&gt;
         1&lt;br /&gt;
&lt;br /&gt;
     So true=0 and false=1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Sample program &amp;quot;mdo&amp;quot;  to show the difference between &amp;quot;$@&amp;quot; and &amp;quot;$*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        function myarg&lt;br /&gt;
        {&lt;br /&gt;
            echo &amp;quot;$# in myarg function&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
        echo -e &amp;quot;$# parameters on the cmd line\n&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;calling: myarg \&amp;quot;\$@\&amp;quot; and myarg \&amp;quot;\$*\&amp;quot;\n&amp;quot;&lt;br /&gt;
        myarg &amp;quot;$@&amp;quot;&lt;br /&gt;
        myarg &amp;quot;$*&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;\ncalling: myarg \$@ and myarg \$* without quotes\n&amp;quot;&lt;br /&gt;
        myarg $@&lt;br /&gt;
        myarg $*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The result of running &amp;quot;./mdo one two&amp;quot;. Note that when quoted, myarg &amp;quot;$*&amp;quot;,&lt;br /&gt;
      returns 1 ... all parameters are smushed together as one word.&lt;br /&gt;
&lt;br /&gt;
            [chirico@third-fl-71 theBook]$ ./mdo one two&lt;br /&gt;
            2 parameters on the cmd line&lt;br /&gt;
&lt;br /&gt;
            calling: myarg &amp;quot;$@&amp;quot; and myarg &amp;quot;$*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
            1 in myarg function&lt;br /&gt;
&lt;br /&gt;
            calling: myarg $@ and myarg $* without quotes&lt;br /&gt;
&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
&lt;br /&gt;
      Example program &amp;quot;mdo2&amp;quot; shows how the input separator can be changed.&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        IFS=|&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=,&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=\;&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=$1&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            [chirico@third-fl-71 theBook]$ ./mdo2 one two three four five&lt;br /&gt;
            one two three four five&lt;br /&gt;
&lt;br /&gt;
            one,two,three,four,five&lt;br /&gt;
&lt;br /&gt;
            one;two;three;four;five&lt;br /&gt;
&lt;br /&gt;
            oneotwoothreeofourofive&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 66:&lt;br /&gt;
&lt;br /&gt;
     Replace all &amp;quot;x&amp;quot; with &amp;quot;y&amp;quot; and all &amp;quot;y&amp;quot; with &amp;quot;x&amp;quot; in file data.&lt;br /&gt;
&lt;br /&gt;
        $ cata data&lt;br /&gt;
          x y&lt;br /&gt;
          y x&lt;br /&gt;
&lt;br /&gt;
        $ tr &amp;quot;xy&amp;quot;  &amp;quot;yx&amp;quot; &amp;lt; data&lt;br /&gt;
          y x&lt;br /&gt;
          x y&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 67:&lt;br /&gt;
&lt;br /&gt;
     On a Linux 2.6.x Kernel, how do you directly measure disk activity,&lt;br /&gt;
     and where is this information documented?&lt;br /&gt;
&lt;br /&gt;
          o The information is documented in the kernel source&lt;br /&gt;
               ./Documentation/iostats.txt&lt;br /&gt;
&lt;br /&gt;
          o The new way of getting this info in 2.6.x is&lt;br /&gt;
              $ cat /sys/block/hda/stat&lt;br /&gt;
            151121 5694 1932358 796675 37867 76770 916994 8353762 0 800672 9150437&lt;br /&gt;
&lt;br /&gt;
             Field  1 -- # of reads issued&lt;br /&gt;
                 This is the total number of reads completed successfully.&lt;br /&gt;
             Field  2 -- # of reads merged, field 6 -- # of writes merged&lt;br /&gt;
                 Reads and writes which are adjacent to each other may be merged for&lt;br /&gt;
                 efficiency.  Thus two 4K reads may become one 8K read before it is&lt;br /&gt;
                 ultimately handed to the disk, and so it will be counted (and queued)&lt;br /&gt;
                 as only one I/O.  This field lets you know how often this was done.&lt;br /&gt;
             Field  3 -- # of sectors read&lt;br /&gt;
                 This is the total number of sectors read successfully.&lt;br /&gt;
             Field  4 -- # of milliseconds spent reading&lt;br /&gt;
                 This is the total number of milliseconds spent by all reads (as&lt;br /&gt;
                 measured from __make_request() to end_that_request_last()).&lt;br /&gt;
             Field  5 -- # of writes completed&lt;br /&gt;
                 This is the total number of writes completed successfully.&lt;br /&gt;
             Field  7 -- # of sectors written&lt;br /&gt;
                 This is the total number of sectors written successfully.&lt;br /&gt;
             Field  8 -- # of milliseconds spent writing&lt;br /&gt;
                 This is the total number of milliseconds spent by all writes (as&lt;br /&gt;
                 measured from __make_request() to end_that_request_last()).&lt;br /&gt;
             Field  9 -- # of I/Os currently in progress&lt;br /&gt;
                 The only field that should go to zero. Incremented as requests are&lt;br /&gt;
                 given to appropriate request_queue_t and decremented as they finish.&lt;br /&gt;
             Field 10 -- # of milliseconds spent doing I/Os&lt;br /&gt;
                 This field is increases so long as field 9 is nonzero.&lt;br /&gt;
             Field 11 -- weighted # of milliseconds spent doing I/Os&lt;br /&gt;
                 This field is incremented at each I/O start, I/O completion, I/O&lt;br /&gt;
                 merge, or read of these stats by the number of I/Os in progress&lt;br /&gt;
                 (field 9) times the number of milliseconds spent doing I/O since the&lt;br /&gt;
                 last update of this field.  This can provide an easy measure of both&lt;br /&gt;
                 I/O completion time and the backlog that may be accumulating.&lt;br /&gt;
&lt;br /&gt;
       Note, this is device specific.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 68:&lt;br /&gt;
&lt;br /&gt;
     Passing Outbound Mail, plus Masquerading User and Hostname.&lt;br /&gt;
&lt;br /&gt;
     Here's a specific example:&lt;br /&gt;
&lt;br /&gt;
         How does one send and receive Comcast email from a home Linux box,&lt;br /&gt;
         which uses Comcast as the ISP, if the local account on the Linux&lt;br /&gt;
         box is different from the Comcast email.  For instance, the&lt;br /&gt;
         account on the Linux box is &amp;quot;chirico@third-fl-71&amp;quot; and the Comcast&lt;br /&gt;
         email account is &amp;quot;mchirico@comcast.net&amp;quot;.  Note both the hostname and&lt;br /&gt;
         username are different.&lt;br /&gt;
&lt;br /&gt;
         So, the user &amp;quot;chirico&amp;quot; using &amp;quot;mutt&amp;quot;, &amp;quot;elm&amp;quot; or any email program would&lt;br /&gt;
         like to send out email to say &amp;quot;donkey@comcast.net&amp;quot;; yet, donkey would&lt;br /&gt;
         see the email from &amp;quot;mchirico@comcast.net&amp;quot; and not &amp;quot;chirico@third-fl-71&amp;quot;&lt;br /&gt;
         but chirico@third-fl-71 would get the replies.&lt;br /&gt;
&lt;br /&gt;
         For a full description of how to solve this problem, including related&lt;br /&gt;
         &amp;quot;sendmail.mc&amp;quot;, &amp;quot;site.config.m4&amp;quot;, &amp;quot;genericstable&amp;quot;, &amp;quot;genericsdomain&amp;quot;,&lt;br /&gt;
         &amp;quot;.procmailrc&amp;quot;, and &amp;quot;.forward&amp;quot; files,  reference the following:&lt;br /&gt;
&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/README_COMCAST_EMAIL.txt?download&lt;br /&gt;
&lt;br /&gt;
         Included in the above link are instructions for building sendmail with&lt;br /&gt;
         &amp;quot;SASL&amp;quot; and &amp;quot;STARTTLS&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 69:&lt;br /&gt;
&lt;br /&gt;
     How do you remove just the last 2 lines from a file and save the result?&lt;br /&gt;
&lt;br /&gt;
         $ sed  '$d' file | sed '$d' &amp;gt; savefile&lt;br /&gt;
&lt;br /&gt;
     Or, as Amos Shapira pointed out, it's much easier with the head command.&lt;br /&gt;
&lt;br /&gt;
         $ head -2 file&lt;br /&gt;
&lt;br /&gt;
      And, of course, removing just the last line&lt;br /&gt;
&lt;br /&gt;
         $ sed '$d' file &amp;gt; savefile&lt;br /&gt;
&lt;br /&gt;
         (See REFERENCES (13))&lt;br /&gt;
&lt;br /&gt;
     How do you remove extra spaces at the end of a line?&lt;br /&gt;
&lt;br /&gt;
         $ sed 's/[ ]*$//g'&lt;br /&gt;
&lt;br /&gt;
     How do you remove blank lines, or lines with just spaces and tabs,&lt;br /&gt;
     saving the origional file as file.backup?&lt;br /&gt;
&lt;br /&gt;
         $ perl -pi.backup -e &amp;quot;s/^(\s)*\n//&amp;quot;  file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 70:&lt;br /&gt;
&lt;br /&gt;
     Generating Random Numbers.&lt;br /&gt;
&lt;br /&gt;
         $ od -vAn -N4 -tu4 &amp;lt; /dev/urandom&lt;br /&gt;
             3905158199&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 71:&lt;br /&gt;
&lt;br /&gt;
     Deleting a File by it's Inode Value.&lt;br /&gt;
&lt;br /&gt;
       See (PROGRAMMING TIP 5) for creating the file, or&lt;br /&gt;
&lt;br /&gt;
       $ cat &amp;gt; '\n\n\n\n\n\n\n'&lt;br /&gt;
         type some text&lt;br /&gt;
         ^D&lt;br /&gt;
&lt;br /&gt;
     To list the inode and display the characters.&lt;br /&gt;
&lt;br /&gt;
       $ ls -libt *&lt;br /&gt;
&lt;br /&gt;
     To remove by inode. Note the &amp;quot;--&amp;quot; option.  This&lt;br /&gt;
     will keep any special characters in the file from being&lt;br /&gt;
     interpreted at &amp;quot;rm&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
       $ find . -inum &amp;lt;inode&amp;gt; -exec rm -- '{}' \;&lt;br /&gt;
&lt;br /&gt;
     Or to check contents&lt;br /&gt;
&lt;br /&gt;
       $ find . -inum &amp;lt;inode&amp;gt; -exec cat '{}' \;&lt;br /&gt;
&lt;br /&gt;
     Reference:&lt;br /&gt;
         http://www.faqs.org/ftp/usenet/news.answers/unix-faq/faq/part2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 72:&lt;br /&gt;
&lt;br /&gt;
     Sending Attachments Using Mutt -- On the Command Line.&lt;br /&gt;
&lt;br /&gt;
        $ mutt -s &amp;quot;See Attachment&amp;quot; -a file.doc user@domain.net &amp;lt; message.txt&lt;br /&gt;
&lt;br /&gt;
          or just the message:&lt;br /&gt;
&lt;br /&gt;
        $ echo | mutt -a sample.tar.gz user@domain.net&lt;br /&gt;
&lt;br /&gt;
      Reference:&lt;br /&gt;
          http://www.shelldorado.com/articles/mailattachments.html&lt;br /&gt;
&lt;br /&gt;
        Also see (TIP 51).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 73:&lt;br /&gt;
&lt;br /&gt;
     Want to find out what functions a program calls?&lt;br /&gt;
&lt;br /&gt;
         $ strace &amp;lt;program&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Try this with &amp;quot;topen.c&amp;quot; (see PROGRAMMING TIP 5)&lt;br /&gt;
&lt;br /&gt;
         $ strace  ./topen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 74:&lt;br /&gt;
&lt;br /&gt;
     RPM Usage Summary.&lt;br /&gt;
&lt;br /&gt;
     Install. Full filename is needed.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -ivh Fedora/RPMS/postgresql-libs-7.4.2-1.i386.rpm&lt;br /&gt;
&lt;br /&gt;
     To view list of files installed with a particular package.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -ql postgresql-libs&lt;br /&gt;
                /usr/lib/libecpg.so.4&lt;br /&gt;
                /usr/lib/libecpg.so.4.1&lt;br /&gt;
                /usr/lib/libecpg_compat.so.1&lt;br /&gt;
                /usr/lib/libecpg_compat.so.1.1&lt;br /&gt;
                /usr/lib/libpgtypes.so.1&lt;br /&gt;
                ...&lt;br /&gt;
&lt;br /&gt;
     Or, to get the file listing from a package that is not installed use the&lt;br /&gt;
     &amp;quot;-p&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -pql /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/CHANGES&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/LICENSE&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/README&lt;br /&gt;
               /usr/share/man/man3/pcap.3.gz&lt;br /&gt;
&lt;br /&gt;
     For dependencies listing, use the &amp;quot;R&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qpR /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /sbin/ldconfig&lt;br /&gt;
               /sbin/ldconfig&lt;br /&gt;
               kernel &amp;gt;= 2.2.0&lt;br /&gt;
               libc.so.6&lt;br /&gt;
               libc.so.6(GLIBC_2.0)&lt;br /&gt;
               libc.so.6(GLIBC_2.1)&lt;br /&gt;
               libc.so.6(GLIBC_2.1.3)&lt;br /&gt;
               libc.so.6(GLIBC_2.3)&lt;br /&gt;
               openssl&lt;br /&gt;
               rpmlib(CompressedFileNames) &amp;lt;= 3.0.4-1&lt;br /&gt;
               rpmlib(PayloadFilesHavePrefix) &amp;lt;= 4.0-1&lt;br /&gt;
&lt;br /&gt;
     To check the integrity, use the &amp;quot;-K&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -K /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm: (sha1) dsa sha1 md5 gpg OK&lt;br /&gt;
&lt;br /&gt;
     To list all packages installed.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qa&lt;br /&gt;
&lt;br /&gt;
     To find out which file a package belongs to.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qf /usr/lib/libecpg.so.4.1&lt;br /&gt;
&lt;br /&gt;
     To uninstall a package&lt;br /&gt;
&lt;br /&gt;
         $ rpm -e&lt;br /&gt;
&lt;br /&gt;
     For building rpm packages reference the following:&lt;br /&gt;
       http://www-106.ibm.com/developerworks/library/l-rpm1/&lt;br /&gt;
&lt;br /&gt;
     To verify md5 sum so that you know it downloaded ok&lt;br /&gt;
&lt;br /&gt;
         $ rpm -K  *.rpm&lt;br /&gt;
&lt;br /&gt;
     The following is a good reference:&lt;br /&gt;
        http://www.rpm.org/max-rpm/s1-rpm-install-additional-options.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 75:&lt;br /&gt;
&lt;br /&gt;
     Listing Output from a Bash Script.&lt;br /&gt;
&lt;br /&gt;
     Add &amp;quot;set -x&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          #!/bin/bash&lt;br /&gt;
          set -x&lt;br /&gt;
          ls&lt;br /&gt;
          date&lt;br /&gt;
&lt;br /&gt;
     Will list the files and output as follows:&lt;br /&gt;
&lt;br /&gt;
           + ls&lt;br /&gt;
           ChangeLog  CVS  data  test&lt;br /&gt;
           + date&lt;br /&gt;
           Thu Jul  1 20:41:04 EDT 2004&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 76:&lt;br /&gt;
&lt;br /&gt;
     Using wget.&lt;br /&gt;
&lt;br /&gt;
     Grap a webpage and pipe it to less. For example suppose you wanted to pipe the&lt;br /&gt;
     contents of all these tips, directly from the web.&lt;br /&gt;
&lt;br /&gt;
      $ wget -O - http://sourceforge.net/direct-dl/mchirico/souptonuts/How_to_Linux_and_Open_Source.txt|less&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 77:&lt;br /&gt;
&lt;br /&gt;
     Finding IP address and MAC address.&lt;br /&gt;
&lt;br /&gt;
       $ /sbin/ifconfig&lt;br /&gt;
&lt;br /&gt;
     Note the following output &amp;quot;eth0&amp;quot; and &amp;quot;eth0:1&amp;quot; which means&lt;br /&gt;
     two IP addresses are tied to 1 NIC (Network Interface Card).&lt;br /&gt;
&lt;br /&gt;
             eth0      Link encap:Ethernet  HWaddr 00:50:DA:60:5B:AD&lt;br /&gt;
                       inet addr:192.168.1.155  Bcast:192.168.99.255  Mask:255.255.252.0&lt;br /&gt;
                       UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
                       RX packets:982757 errors:116 dropped:0 overruns:0 frame:116&lt;br /&gt;
                       TX packets:439297 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:1000&lt;br /&gt;
                       RX bytes:693529078 (661.4 Mb)  TX bytes:78400296 (74.7 Mb)&lt;br /&gt;
                       Interrupt:10 Base address:0xa800&lt;br /&gt;
&lt;br /&gt;
             eth0:1    Link encap:Ethernet  HWaddr 00:50:DA:60:5B:AD&lt;br /&gt;
                       inet addr:192.168.1.182  Bcast:192.168.3.255  Mask:255.255.252.0&lt;br /&gt;
                       UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
                       RX packets:982757 errors:116 dropped:0 overruns:0 frame:116&lt;br /&gt;
                       TX packets:439299 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:1000&lt;br /&gt;
                       RX bytes:693529078 (661.4 Mb)  TX bytes:78400636 (74.7 Mb)&lt;br /&gt;
                       Interrupt:10 Base address:0xa800&lt;br /&gt;
&lt;br /&gt;
             lo        Link encap:Local Loopback&lt;br /&gt;
                       inet addr:127.0.0.1  Mask:255.0.0.0&lt;br /&gt;
                       UP LOOPBACK RUNNING  MTU:16436  Metric:1&lt;br /&gt;
                       RX packets:785 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
                       TX packets:785 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:0&lt;br /&gt;
                       RX bytes:2372833 (2.2 Mb)  TX bytes:2372833 (2.2 Mb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 78:&lt;br /&gt;
&lt;br /&gt;
     DOS to UNIX and UNIX to DOS.&lt;br /&gt;
&lt;br /&gt;
        $ dos2unix file.txt&lt;br /&gt;
&lt;br /&gt;
     And to go the other way from UNIX to DOS&lt;br /&gt;
&lt;br /&gt;
        $ unix2dos unixfile&lt;br /&gt;
&lt;br /&gt;
     See the man page, since there are MAC options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     NOTE: If you're working file DOS files, you'll probably want to use&lt;br /&gt;
           &amp;quot;zip&amp;quot; instead of &amp;quot;gzip&amp;quot; so users on Windows can unzip them.&lt;br /&gt;
&lt;br /&gt;
              $ zip test.zip test.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 79:&lt;br /&gt;
&lt;br /&gt;
     Need to Run Interactive Commands? Try &amp;quot;expect&amp;quot;.&lt;br /&gt;
       http://expect.nist.gov/expect.tar.gz&lt;br /&gt;
&lt;br /&gt;
     This simple example waits for the input &amp;quot;hi&amp;quot;, in some form before&lt;br /&gt;
     returning, immediately, &amp;quot;hello there!&amp;quot;. Otherwise, it will wait for&lt;br /&gt;
     60 seconds, then, return &amp;quot;hello there!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/expect&lt;br /&gt;
          set timeout 60&lt;br /&gt;
          expect &amp;quot;hi\n&amp;quot;&lt;br /&gt;
          send &amp;quot;hello there!\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference:&lt;br /&gt;
        http://www.oreilly.com/catalog/expect/chapter/ch03.html&lt;br /&gt;
&lt;br /&gt;
        http://www.cotse.com/dlf/man/expect/bulletproof1.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 80:&lt;br /&gt;
&lt;br /&gt;
     Using PHP as a Command Line Scripting Language.&lt;br /&gt;
&lt;br /&gt;
     The following will grab the complete file from slashdot.&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/php -q&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;?php&lt;br /&gt;
         $fileName = &amp;quot;http://slashdot.org/slashdot.xml&amp;quot;;&lt;br /&gt;
         $rss = file($fileName) or die (&amp;quot;Cannot open file $fileName\n&amp;quot;);&lt;br /&gt;
         for ($index=0; $index &amp;lt; count($rss); $index++)&lt;br /&gt;
              {&lt;br /&gt;
              echo $rss[$index];&lt;br /&gt;
              }&lt;br /&gt;
         ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       Note, if you want an example that parses the XML of&lt;br /&gt;
       slashdot, then, download the following:&lt;br /&gt;
&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/php_scripts.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 81:&lt;br /&gt;
&lt;br /&gt;
     Discarding all output -- including stderr messages.&lt;br /&gt;
&lt;br /&gt;
         $ ls  &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     Or sending all output to a file&lt;br /&gt;
&lt;br /&gt;
         $ someprog &amp;gt; /tmp/file 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     Sometimes, find displays a lot of errors when searching through&lt;br /&gt;
     directories that the user doesn't have access to. To discard&lt;br /&gt;
     error messages &amp;quot;stderr&amp;quot;, which is normally file descripter &amp;quot;2&amp;quot;&lt;br /&gt;
     work the following:&lt;br /&gt;
&lt;br /&gt;
         $ find / -iname 'stuff' 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
          or to pipe results elsewhere&lt;br /&gt;
&lt;br /&gt;
         $ find / -iname 'stuff' &amp;gt; /tmp/results_of_find  2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 118).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 82:&lt;br /&gt;
&lt;br /&gt;
     Using MIX.  D. Knuth's  assembly language/machine-code instruction set used in&lt;br /&gt;
     his books to illustrate his algorithms.&lt;br /&gt;
&lt;br /&gt;
     Download the source:&lt;br /&gt;
&lt;br /&gt;
       http://sourceforge.net/project/showfiles.php?group_id=13897&lt;br /&gt;
&lt;br /&gt;
       $ ./configure&lt;br /&gt;
       $ make&lt;br /&gt;
       $ make install&lt;br /&gt;
&lt;br /&gt;
     Documentation can be found at the following link. The link on&lt;br /&gt;
     sourceforge is not correct, but, the one below works.&lt;br /&gt;
&lt;br /&gt;
       http://www.gnu.org/software/mdk/manual/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 83:&lt;br /&gt;
&lt;br /&gt;
     Gnuplot [ http://sourceforge.net/projects/gnuplot/ ].&lt;br /&gt;
&lt;br /&gt;
     This software is ideal for printing graphs.&lt;br /&gt;
&lt;br /&gt;
         gnuplot&amp;gt; set term png&lt;br /&gt;
         gnuplot&amp;gt; set output 'testcos.png'&lt;br /&gt;
         gnuplot&amp;gt; plot cos(x)*sin(x)&lt;br /&gt;
         gnuplot&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
     Or the following command can be put into &amp;quot;file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            $ cat &amp;gt; file&lt;br /&gt;
            set term png&lt;br /&gt;
            set output 'testcos.png'&lt;br /&gt;
            plot cos(x)*sin(x)&lt;br /&gt;
            exit&lt;br /&gt;
            ^D&lt;br /&gt;
&lt;br /&gt;
     Then, run as follows:&lt;br /&gt;
&lt;br /&gt;
            $ gnuplot file&lt;br /&gt;
&lt;br /&gt;
     Or, suppose you have the following file &amp;quot;/home/chirico/data&amp;quot;. Comments&lt;br /&gt;
     with &amp;quot;#&amp;quot; are not read by gnuplot.&lt;br /&gt;
&lt;br /&gt;
            # File /home/chirico/data&lt;br /&gt;
            #&lt;br /&gt;
            2005-07-26  1    2.3    3&lt;br /&gt;
            2005-07-27  2    3.4    5&lt;br /&gt;
            2005-07-28  3    4    6.6&lt;br /&gt;
            2005-07-29  4    6    2.5&lt;br /&gt;
&lt;br /&gt;
     And you have the following new &amp;quot;file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            set term png&lt;br /&gt;
            set xdata time&lt;br /&gt;
            set timefmt &amp;quot;%Y-%m-%d &amp;quot;&lt;br /&gt;
            set format x &amp;quot;%Y/%m/%d&amp;quot;&lt;br /&gt;
            set output '/var/www/html/chirico/gnuplot/data.png'&lt;br /&gt;
            plot '/home/chirico/data' using 1:2 w linespoints  title '1st col', \&lt;br /&gt;
             '/home/chirico/data' using 1:3 w linespoints  title '2nd col', \&lt;br /&gt;
             '/home/chirico/data' using 1:4 w linespoints  title '3rd col'&lt;br /&gt;
            exit&lt;br /&gt;
&lt;br /&gt;
     You can now get a graph of this data running the following:&lt;br /&gt;
&lt;br /&gt;
            $ gnuplot file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 84:&lt;br /&gt;
&lt;br /&gt;
     CPU Information - speed, processor, cache.&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/cpuinfo&lt;br /&gt;
&lt;br /&gt;
               processor       : 0&lt;br /&gt;
               vendor_id       : GenuineIntel&lt;br /&gt;
               cpu family      : 15&lt;br /&gt;
               model           : 2&lt;br /&gt;
               model name      : Intel(R) Pentium(R) 4 CPU 2.20GHz&lt;br /&gt;
               stepping        : 9&lt;br /&gt;
               cpu MHz         : 2193.221&lt;br /&gt;
               cache size      : 512 KB&lt;br /&gt;
               fdiv_bug        : no&lt;br /&gt;
               hlt_bug         : no&lt;br /&gt;
               f00f_bug        : no&lt;br /&gt;
               coma_bug        : no&lt;br /&gt;
               fpu             : yes&lt;br /&gt;
               fpu_exception   : yes&lt;br /&gt;
               cpuid level     : 2&lt;br /&gt;
               wp              : yes&lt;br /&gt;
               flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr&lt;br /&gt;
               bogomips        : 4325.37&lt;br /&gt;
&lt;br /&gt;
      &amp;quot;bogomips&amp;quot; is a rough but good way to quickly compare two computer speeds. True it's a&lt;br /&gt;
      bogus reading; but, a &amp;quot;good enough&amp;quot; for government work calculation.  See (TIP 10) for&lt;br /&gt;
      &amp;quot;vmstat&amp;quot; and &amp;quot;iostat&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 85:&lt;br /&gt;
&lt;br /&gt;
     POVRAY - Making Animated GIFs&lt;br /&gt;
&lt;br /&gt;
     To see this in action, reference:&lt;br /&gt;
      http://souptonuts.sourceforge.net/povray/orbit.pov.html&lt;br /&gt;
&lt;br /&gt;
     These are the basic command to create:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        $ povray orbit.ini -Iorbit.pov&lt;br /&gt;
        $ convert -delay 20 *.ppm orbit.gif&lt;br /&gt;
&lt;br /&gt;
     By the way, convert is a program from imagemagick, and it can&lt;br /&gt;
     be downloaded from ( http://www.imagemagick.org ).&lt;br /&gt;
&lt;br /&gt;
    The following is &amp;quot;orbit.pov&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          #include &amp;quot;colors.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;finish.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;metals.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;textures.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;stones.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;skies.inc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          camera {&lt;br /&gt;
            location &amp;lt; 2, 3, -8 &amp;gt;&lt;br /&gt;
            look_at  &amp;lt; 0, 0, 0 &amp;gt;&lt;br /&gt;
            focal_point &amp;lt;0, 0, 0&amp;gt;&lt;br /&gt;
            blur_samples 20&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          light_source {&lt;br /&gt;
                  &amp;lt; 0, 10, 0&amp;gt;&lt;br /&gt;
                  color White&lt;br /&gt;
                  area_light &amp;lt;2,0,0&amp;gt;,&amp;lt;0,0,2&amp;gt;, 2, 2&lt;br /&gt;
                  adaptive 1&lt;br /&gt;
                  fade_distance 8&lt;br /&gt;
                  fade_power 1&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          sky_sphere {&lt;br /&gt;
            S_Cloud3&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          plane { &amp;lt;0, 1, 0&amp;gt;, -1&lt;br /&gt;
                  texture {&lt;br /&gt;
                          pigment {&lt;br /&gt;
                                  checker color Blue, color White&lt;br /&gt;
                          }&lt;br /&gt;
                          finish {Phong_Glossy}&lt;br /&gt;
                  }&lt;br /&gt;
          }&lt;br /&gt;
          #declare ball0=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;0.5, 0.5, 0&amp;gt;, 1&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Yellow}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          #declare ball1=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;3, 2, 0&amp;gt;, 0.5&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Blue}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          #declare ball2=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;3, 1, 0&amp;gt;, 1&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Green}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          object {ball0 rotate 360*clock*y}&lt;br /&gt;
          object {ball1 rotate 720*clock*y}&lt;br /&gt;
          object {ball2 rotate 360*(1 - clock)*y}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    And, &amp;quot;orbit.ini&amp;quot; follows:&lt;br /&gt;
&lt;br /&gt;
          Output_File_Type=P&lt;br /&gt;
&lt;br /&gt;
          Width=320&lt;br /&gt;
          Height=240&lt;br /&gt;
&lt;br /&gt;
          Initial_Frame=1&lt;br /&gt;
          Final_Frame=10&lt;br /&gt;
          Antialias=true&lt;br /&gt;
&lt;br /&gt;
          Subset_Start_Frame=1&lt;br /&gt;
          Subset_End_Frame=10&lt;br /&gt;
&lt;br /&gt;
          Cyclic_Animation=on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 86:&lt;br /&gt;
&lt;br /&gt;
     GPG --  GnuPG&lt;br /&gt;
&lt;br /&gt;
        Reference: http://www.gnupg.org/documentation/faqs.html&lt;br /&gt;
                   http://codesorcery.net/mutt/mutt-gnupg-howto&lt;br /&gt;
                   http://www.gnupg.org/(en)/download/index.html&lt;br /&gt;
                   (SCRIPT 4) on following link:&lt;br /&gt;
                   http://prdownloads.sourceforge.net/souptonuts/README_common_script_commands.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Generage key:&lt;br /&gt;
&lt;br /&gt;
        $ gpg --gen-key&lt;br /&gt;
&lt;br /&gt;
     Generate public key ID and fingerprint&lt;br /&gt;
&lt;br /&gt;
        $ gpg --fingerprint&lt;br /&gt;
&lt;br /&gt;
     Get a list of keys:&lt;br /&gt;
&lt;br /&gt;
        $ gpg --list-keys&lt;br /&gt;
&lt;br /&gt;
          pub  1024D/A11C1499 2004-07-15 Mike Chirico &amp;lt;mchirico@comcast.net&amp;gt;&lt;br /&gt;
          sub  1024g/E1A3C2B3 2004-07-15&lt;br /&gt;
&lt;br /&gt;
     Encrypt&lt;br /&gt;
&lt;br /&gt;
        $ gpg -r Mike  --encrypt sample.txt&lt;br /&gt;
&lt;br /&gt;
       This will produce &amp;quot;sample.txt.asc&amp;quot;, which is a binary file.  Note, I can use &amp;quot;Mike&amp;quot; because that's the&lt;br /&gt;
       name on the list of keys. Again, it will be a binary file.&lt;br /&gt;
&lt;br /&gt;
     Encrypt using &amp;quot;ASCII-armored text&amp;quot;  (--armor), which is probably what you want when sending &amp;quot;in&amp;quot; the body of an&lt;br /&gt;
     email, or some document.&lt;br /&gt;
&lt;br /&gt;
        $ gpg  -r Mike  --encrypt --armor sample.txt&lt;br /&gt;
            or&lt;br /&gt;
        $ gpg -r Mike -e -a sample.txt&lt;br /&gt;
            or&lt;br /&gt;
        $ gpg --output somefile.asc --armor -r Mike  --encrypt --armor sample.txt&lt;br /&gt;
&lt;br /&gt;
     The above 3 statements will still produce &amp;quot;sample.txt.asc&amp;quot;, but look at it, or &amp;quot;$ cat sample.txt.asc&amp;quot; without &lt;br /&gt;
     fear, since there are no binary characters. Yes, you could even compile a program &amp;quot;$ g++ -o test test.c&amp;quot; , then,&lt;br /&gt;
     &amp;quot;$ gpg --output test.asc  -r Mike --encrypt --armor test&amp;quot;. However, when decrypting make sure to pipe&lt;br /&gt;
     the results.&lt;br /&gt;
&lt;br /&gt;
            $ gpg --decrypt test.asc &amp;gt; test&lt;br /&gt;
&lt;br /&gt;
     Export &amp;quot;public&amp;quot; key:&lt;br /&gt;
&lt;br /&gt;
           $ gpg --armor --export Mike &amp;gt; m1.asc&lt;br /&gt;
&lt;br /&gt;
     Signing the file &amp;quot;message.txt&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
           $ gpg --clearsign message.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Sending the key to the &amp;quot;key-server&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        First, list the keys.&lt;br /&gt;
&lt;br /&gt;
                $ gpg --list-keys&lt;br /&gt;
                    /home/chirico/.gnupg/pubring.gpg&lt;br /&gt;
                                 v------------------ Use this with &amp;quot;0x&amp;quot; in front -------&lt;br /&gt;
                  pub  1024D/A11C1499 2004-07-15 Mike Chirico  &amp;lt;mchirico@comcast.net&amp;gt;   |&lt;br /&gt;
                  sub  1024g/E1A3C2B3 2004-07-15                                        |&lt;br /&gt;
                                                                                        |&lt;br /&gt;
                                   v----------------------------------------------------&lt;br /&gt;
                $ gpg --send-keys 0xA11C1499&lt;br /&gt;
&lt;br /&gt;
             The above sends it to the keyserver defined in &amp;quot;/home/chirico/.gnupg/gpg.conf&amp;quot;.  Other key servers:&lt;br /&gt;
&lt;br /&gt;
                            wwwkeys.pgp.net&lt;br /&gt;
                            search.keyserver.net&lt;br /&gt;
                            pgp.ai.mit.edu&lt;br /&gt;
&lt;br /&gt;
             When you go to your user-group meetings, you need to bring 2 forms of ID, and&lt;br /&gt;
             list your Key fingerprint. Shown below is the command for getting this fingerprint.&lt;br /&gt;
&lt;br /&gt;
                $ gpg --fingerprint mchirico@comcast.net&lt;br /&gt;
                 pub   1024D/A11C1499 2004-07-15&lt;br /&gt;
                 Key fingerprint = 9D7F C80D BB7B 4BAB CCA4  1BE9 9056 5BEC A11C 1499&lt;br /&gt;
                 uid   Mike Chirico (http://souptonuts.sourceforge.net/chirico/index.php) &amp;lt;mchirico@comcast.net&amp;gt;&lt;br /&gt;
                 sub   1024g/E1A3C2B3 2004-07-15&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Receving keys:&lt;br /&gt;
&lt;br /&gt;
        The following will retrieve my mchirico@comcast.net key&lt;br /&gt;
&lt;br /&gt;
               $ gpg --recv-keys 0xA11C1499&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Special Note: If you get the following error &amp;quot;GPG: Warning: Using Insecure Memory&amp;quot; , then,&lt;br /&gt;
                   &amp;quot; chmod 4755 /path/to/gpg&amp;quot;  to setuid(root) permissioins on the gpg binary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     NOTE: If using mutt, just before sending with the &amp;quot;y&amp;quot; option, hit &amp;quot;p&amp;quot; to sign or encrypt.&lt;br /&gt;
&lt;br /&gt;
     It's possible to create a gpg/pgp email from the command line. For a tutorial on this,&lt;br /&gt;
     reference (SCRIPT 4) at the following link:&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/README_common_script_commands.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 87:&lt;br /&gt;
&lt;br /&gt;
     Working with Dates: Steffen Beyer has developed a Perl and C module for working with dates&lt;br /&gt;
&lt;br /&gt;
     This softare can be downloaded from the following location:&lt;br /&gt;
        http://www.engelschall.com/u/sb/download/pkg/Date-Calc-5.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
         $ wget http://www.engelschall.com/u/sb/download/pkg/Date-Calc-5.3.tar.gz&lt;br /&gt;
         $ tar -xzvf Date-Calc-5.3.tar.gz&lt;br /&gt;
         $ cd Date-Calc-5.3&lt;br /&gt;
         $ cp ./examples/cal.c .&lt;br /&gt;
         $ gcc cal.c DateCalc.c -o mcal&lt;br /&gt;
&lt;br /&gt;
     The file cal.c contains sample function calls from DateCalc.c.  Note, &amp;quot;DateCalc.c&amp;quot;&lt;br /&gt;
     is just a list of functions and includes for &amp;quot;DateCalc.h&amp;quot; and &amp;quot;ToolBox.h&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Or, and this may be easier, just download the following:&lt;br /&gt;
         http://prdownloads.sourceforge.net/cpearls/date_calc.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
     The above link contains a few examples.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 88:&lt;br /&gt;
&lt;br /&gt;
     Color patterns for mutt.&lt;br /&gt;
&lt;br /&gt;
     The colors can be changed in the /home/user/.muttrc file. The first field begins with&lt;br /&gt;
     color, the second field is the foreground color, and the third field is the background&lt;br /&gt;
     color, or default.&lt;br /&gt;
&lt;br /&gt;
     An example .muttrc for colors:&lt;br /&gt;
&lt;br /&gt;
       # color patterns for mutt&lt;br /&gt;
       color normal     white          black # normal text&lt;br /&gt;
       color indicator  black          yellow  # actual message&lt;br /&gt;
       color tree       brightmagenta  default # thread arrows&lt;br /&gt;
       color status     brightyellow         default # status line&lt;br /&gt;
       color error      brightred      default # errors&lt;br /&gt;
       color message    magenta        default # info messages&lt;br /&gt;
       color signature  magenta        default # signature&lt;br /&gt;
       color attachment brightyellow   red     # MIME attachments&lt;br /&gt;
       color search     brightyellow   red     # search matches&lt;br /&gt;
       color tilde      brightmagenta  default # ~ at bottom of msg&lt;br /&gt;
       color markers    red            default # + at beginning of wrapped lines&lt;br /&gt;
       color hdrdefault cyan           default # default header lines&lt;br /&gt;
       color bold       red            default # hiliting bold patterns in body&lt;br /&gt;
       color underline  green          default # hiliting underlined patterns in body&lt;br /&gt;
       color quoted     cyan           default # quoted text&lt;br /&gt;
       color quoted1    magenta        default&lt;br /&gt;
       color quoted2    red            default&lt;br /&gt;
       color quoted3    green          default&lt;br /&gt;
       color quoted4    magenta           default&lt;br /&gt;
       color quoted5    cyan           default&lt;br /&gt;
       color quoted6    magenta        default&lt;br /&gt;
       color quoted7    red            default&lt;br /&gt;
       color quoted8    green          default&lt;br /&gt;
       color quoted9    cyan           default&lt;br /&gt;
       color body   cyan  default  &amp;quot;((ftp|http|https)://|news:)[^ &amp;gt;)\&amp;quot;\t]+&amp;quot;&lt;br /&gt;
       color body   cyan  default  &amp;quot;[-a-z_0-9.+]+@[-a-z_0-9.]+&amp;quot;&lt;br /&gt;
       color body   red   default  &amp;quot;(^| )\\*[-a-z0-9*]+\\*[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color body   green default  &amp;quot;(^| )_[-a-z0-9_]+_[,.?]?[\n]&amp;quot;&lt;br /&gt;
       color body   red   default  &amp;quot;(^| )\\*[-a-z0-9*]+\\*[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color body   green default  &amp;quot;(^| )_[-a-z0-9_]+_[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color index  cyan  default  ~F         # Flagged&lt;br /&gt;
       color index  red   default  ~N         # New&lt;br /&gt;
       color index  magenta    default  ~T         # Tagged&lt;br /&gt;
       color index  cyan       default  ~D         # Deleted&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 190)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 89:&lt;br /&gt;
&lt;br /&gt;
     ps command in detail&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Here are the possible codes when using state &amp;quot;$ ps -e -o state,cmd&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             PROCESS STATE CODES&lt;br /&gt;
                  D   uninterruptible sleep (usually IO)&lt;br /&gt;
                  R   runnable (on run queue)&lt;br /&gt;
                  S   sleeping&lt;br /&gt;
                  T   traced or stopped&lt;br /&gt;
                  Z   a defunct (&amp;quot;zombie&amp;quot;) process&lt;br /&gt;
&lt;br /&gt;
                  &amp;lt;    high-priority (not nice to other users)&lt;br /&gt;
                  N    low-priority (nice to other users)&lt;br /&gt;
                  L    has pages locked into memory (for real-time and custom IO)&lt;br /&gt;
                  s    is a session leader&lt;br /&gt;
                  l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)&lt;br /&gt;
                  +    is in the foreground process group&lt;br /&gt;
&lt;br /&gt;
    For instance:&lt;br /&gt;
&lt;br /&gt;
     Note that the -o is for user defined, and -e is for select&lt;br /&gt;
     all process.&lt;br /&gt;
&lt;br /&gt;
       $ ps -e -o pid,state,start,time,etime,cmd&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
             9946 S 15:40:45 00:00:00    02:23:29 /bin/bash -i&lt;br /&gt;
             9985 T 15:41:24 00:00:01    02:22:50 emacs mout2&lt;br /&gt;
            10003 T 15:43:59 00:00:00    02:20:15 emacs NOTES&lt;br /&gt;
            10320 T 17:38:42 00:00:00       25:32 emacs stuff.c&lt;br /&gt;
         ...&lt;br /&gt;
&lt;br /&gt;
     You may want to command below, without the -e, which will give the&lt;br /&gt;
     process only under the current terminal.&lt;br /&gt;
&lt;br /&gt;
       $ ps -o pid,state,start,time,etime,cmd&lt;br /&gt;
&lt;br /&gt;
     Want to find what 's impacting your load?&lt;br /&gt;
&lt;br /&gt;
       $ ps -e -o %cpu,pid,state,start,time,etime,%cpu,%mem,cmd|sort -rn|less&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ ps aux&lt;br /&gt;
&lt;br /&gt;
            USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND&lt;br /&gt;
            root         1  0.0  0.0  1380  480 ?        S    Aug04   0:00 init [3]&lt;br /&gt;
            root         2  0.0  0.0     0    0 ?        SWN  Aug04   0:00 [ksoftirqd/0]&lt;br /&gt;
            root         3  0.0  0.0     0    0 ?        SW&amp;lt;  Aug04   0:00 [events/0]&lt;br /&gt;
            root         4  0.0  0.0     0    0 ?        SW&amp;lt;  Aug04   0:00 [khelper]&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     Or, if you want to see the environment add the -e option&lt;br /&gt;
&lt;br /&gt;
       $ ps aeux&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
            chirico   2735  0.0  0.1  4400 1492 pts/0    S    Aug04   0:00 -bash USER=chirico LOGNAME=chirico HOME=/home/chirico PATH=/usr/&lt;br /&gt;
            chirico   2771  0.0  0.0  4328  924 pts/0    S    Aug04   0:00 screen -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm S&lt;br /&gt;
            chirico   2772  0.0  0.6  9476 6352 ?        S    Aug04   0:54 SCREEN -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm S&lt;br /&gt;
            chirico   2773  0.0  0.1  4432 1548 pts/1    S    Aug04   0:10 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            chirico   2797  0.0  0.1  4416 1496 pts/2    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            root      2821  0.0  0.0  4100  952 pts/2    S    Aug04   0:00 su -&lt;br /&gt;
            root      2822  0.0  0.1  4384 1480 pts/2    S    Aug04   0:00 -bash&lt;br /&gt;
            chirico   2862  0.0  0.1  4428 1524 pts/3    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            sporkey   2946  0.0  0.2  6836 2960 ?        S    Aug04   0:15 fetchmail&lt;br /&gt;
            chirico   2952  0.0  0.1  4436 1552 pts/5    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            chirico   3880  0.0  0.1  4416 1496 pts/6    S    Aug05   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            root      3904  0.0  0.0  4100  956 pts/6    S    Aug05   0:00 su - donkey&lt;br /&gt;
            donkey    3905  0.0  0.1  4336 1452 pts/6    S    Aug05   0:00 -bash&lt;br /&gt;
            donkey    3938  0.0  0.2  6732 2856 ?        S    Aug05   0:14 fetchmail&lt;br /&gt;
            chirico   3944  0.0  0.1  4416 1496 pts/7    S    Aug05   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     There is also a -f &amp;quot;forrest&amp;quot; option. Also note below &amp;quot; -bash&amp;quot; is the start of a login shell.&lt;br /&gt;
&lt;br /&gt;
      $ ps aeuxwwf &lt;br /&gt;
     &lt;br /&gt;
     The ww option above gives a wide format with all variables. Use the above command if you plan&lt;br /&gt;
     to parse through a Perl script. Otherwise, it may be easier to do a quick read using the command&lt;br /&gt;
     below, without &amp;quot;ww&amp;quot;.    &lt;br /&gt;
&lt;br /&gt;
      $ ps aeuxf&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
            root      2339  0.0  0.1  3512 1444 ?        S    Dec01   0:00 /usr/sbin/sshd&lt;br /&gt;
            root     25651  0.0  0.1  6764 1980 ?        S    Dec23   0:00  \_ /usr/sbin/sshd&lt;br /&gt;
            chirico  25653  0.0  0.2  6840 2236 ?        S    Dec23   0:14      \_ /usr/sbin/sshd&lt;br /&gt;
            chirico  25654  0.0  0.1  4364 1440 pts/4    S    Dec23   0:00          \_ -bash USER=chirico LOGNAME=chirico HOME=/home/chirico&lt;br /&gt;
            chirico  25690  0.0  0.0  4328  920 pts/4    S    Dec23   0:00              \_ screen -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm&lt;br /&gt;
            root      2355  0.0  0.0  2068  904 ?        S    Dec01   0:00 xinetd -stayalive -pidfile /var/run/xinetd.pid&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     It is also possible to list the process by command line. For example, the following command will only list the emacs&lt;br /&gt;
     processes.&lt;br /&gt;
&lt;br /&gt;
      $ ps -fC emacs&lt;br /&gt;
       UID        PID  PPID  C STIME TTY          TIME CMD&lt;br /&gt;
       chirico   5049  5020  0 May11 pts/13   00:00:00 emacs -nw Notes&lt;br /&gt;
       chirico  12368  5104  0 May12 pts/18   00:00:00 emacs -nw dnotify.c&lt;br /&gt;
       chirico  19792 18028  0 May13 pts/20   00:00:00 emacs -nw hello.c&lt;br /&gt;
       chirico  14034 27367  0 18:52 pts/8    00:00:00 emacs -nw How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
     You may also want to consider using top in batch mode. Here the &amp;quot;-n 1&amp;quot; means refresh once,&lt;br /&gt;
     and the &amp;quot;b&amp;quot; is for batch. The &amp;quot;fmt -s&amp;quot; is to put it in a more readable format.&lt;br /&gt;
&lt;br /&gt;
       $ top -n 1 b |fmt  -s &amp;gt;&amp;gt;statfile&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 90:&lt;br /&gt;
&lt;br /&gt;
     Learning Assembly.&lt;br /&gt;
&lt;br /&gt;
     Once you have written the source, assuming the file is &amp;quot;exit.s&amp;quot;, it can be compiled as follows:&lt;br /&gt;
&lt;br /&gt;
            $ as exit.s -o exit.o&lt;br /&gt;
            $ ld exit.o -o exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Here is the program:&lt;br /&gt;
&lt;br /&gt;
         #&lt;br /&gt;
         #INPUT:  none&lt;br /&gt;
         #&lt;br /&gt;
         #OUTPUT:         returns a status code. This can be viewed&lt;br /&gt;
         # by typing&lt;br /&gt;
         #&lt;br /&gt;
         # echo $?&lt;br /&gt;
         #&lt;br /&gt;
         # after running the program&lt;br /&gt;
         #&lt;br /&gt;
         #VARIABLES:&lt;br /&gt;
         # %eax holds the system call number&lt;br /&gt;
         # (this is always the case)&lt;br /&gt;
         #&lt;br /&gt;
         # %ebx holds the return status&lt;br /&gt;
         #&lt;br /&gt;
                 .section .data&lt;br /&gt;
                 .section .text&lt;br /&gt;
&lt;br /&gt;
                 .globl _start&lt;br /&gt;
         _start:&lt;br /&gt;
                 movl $1, %eax # this is the linux kernel command&lt;br /&gt;
                 # number (system call) for exiting&lt;br /&gt;
                 # a program&lt;br /&gt;
                 movl $0, %ebx # this is the status number we will&lt;br /&gt;
                 # return to the operating system.&lt;br /&gt;
                 # Change this around and it will&lt;br /&gt;
                 # return different things to&lt;br /&gt;
                 # echo $?&lt;br /&gt;
                 int $0x80 # this wakes up the kernel to run&lt;br /&gt;
                 # the exit command&lt;br /&gt;
&lt;br /&gt;
     After running this program, you can get the exit code.&lt;br /&gt;
&lt;br /&gt;
            $ exit $?&lt;br /&gt;
            0&lt;br /&gt;
&lt;br /&gt;
     That is about all it does; but, get the book for more details. The&lt;br /&gt;
     book is free.&lt;br /&gt;
&lt;br /&gt;
          http://savannah.nongnu.org/download/pgubook/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 91:&lt;br /&gt;
&lt;br /&gt;
     Creating a sandbox for reiserfstune,debugreiserfs and ACL.  Also see TIP 4.&lt;br /&gt;
&lt;br /&gt;
     Assume you have a reisers files system created from a disk file, which&lt;br /&gt;
     means you have done something like the following:&lt;br /&gt;
&lt;br /&gt;
          # dd if=/dev/zero of=disk-rfs count=102400&lt;br /&gt;
          # losetup  /dev/loop4 ./disk-rfs&lt;br /&gt;
          # mkfs -t reiserfs /dev/loop4&lt;br /&gt;
          # mkdir /fs2&lt;br /&gt;
          # mount -o loop,acl ./disk-rfs /fs2&lt;br /&gt;
&lt;br /&gt;
     Now, you can run reiserfstune. But, first you will need to umount fs2&lt;br /&gt;
&lt;br /&gt;
          # umount /fs2&lt;br /&gt;
          # reiserfstune ./disk-rfs&lt;br /&gt;
&lt;br /&gt;
     Or you can run the debug command&lt;br /&gt;
&lt;br /&gt;
          # debugreiserfs -J ./disk-rfs&lt;br /&gt;
&lt;br /&gt;
     Now, suppose you run through a lot of the debug options on&lt;br /&gt;
     http://www.namesys.com/ and you destroy this file.&lt;br /&gt;
&lt;br /&gt;
     You can recreate the file and delete the loop device.&lt;br /&gt;
&lt;br /&gt;
          # dd if=/dev/zero of=disk-rfs count=102400&lt;br /&gt;
          # losetup -d /dev/loop4&lt;br /&gt;
          # mount -o loop,acl ./disk-rfs /fs2&lt;br /&gt;
&lt;br /&gt;
     Now, try working with some of the ACL options - you can only do this&lt;br /&gt;
     with the latest kernel and tools -- Fedora Core 2 will work.&lt;br /&gt;
&lt;br /&gt;
     Assume you have 3 users, donkey, chirico and bozo2. You can give&lt;br /&gt;
     everyone rights to this file system as follows:&lt;br /&gt;
&lt;br /&gt;
          # setfacl -R -m d:u:donkey:rwx,d:u:chirico:rwx,d:u:bozo2:rwx /fs2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 92:&lt;br /&gt;
&lt;br /&gt;
     SpamAssassin - Setup.&lt;br /&gt;
&lt;br /&gt;
     Step 1.&lt;br /&gt;
&lt;br /&gt;
           Installing the SpamAssassin CPAN utility. You will need to do this&lt;br /&gt;
           as root.&lt;br /&gt;
        &lt;br /&gt;
              $ su -&lt;br /&gt;
&lt;br /&gt;
           Once you have root privileges invoke cpan.&lt;br /&gt;
        &lt;br /&gt;
              # perl -MCPAN -e shell&lt;br /&gt;
&lt;br /&gt;
              cpan&amp;gt;&lt;br /&gt;
&lt;br /&gt;
           Now install with prerequisites policy set to ask.&lt;br /&gt;
        &lt;br /&gt;
              cpan&amp;gt; o conf prerequisites_policy ask&lt;br /&gt;
        &lt;br /&gt;
              cpan&amp;gt; install Mail::SpamAssassin&lt;br /&gt;
        &lt;br /&gt;
           You will get lots of output as the necessary modules are downloaded and&lt;br /&gt;
           compiled and installed.&lt;br /&gt;
&lt;br /&gt;
     Step 2.&lt;br /&gt;
&lt;br /&gt;
            Configuration.&lt;br /&gt;
&lt;br /&gt;
            Edit the following &amp;quot;/etc/mail/spamassassin/local.cf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            Here is a look at my file&lt;br /&gt;
&lt;br /&gt;
                $ cat /etc/mail/spamassassin/local.cf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                # This is the right place to customize your installation of SpamAssassin.&lt;br /&gt;
                #&lt;br /&gt;
                # See 'perldoc Mail::SpamAssassin::Conf' for details of what can be&lt;br /&gt;
                # tweaked.&lt;br /&gt;
                #&lt;br /&gt;
                ###########################################################################&lt;br /&gt;
                #&lt;br /&gt;
                # rewrite_subject 0&lt;br /&gt;
                # report_safe 1&lt;br /&gt;
                # trusted_networks 212.17.35.&lt;br /&gt;
                #&lt;br /&gt;
                &lt;br /&gt;
                # Below added from book&lt;br /&gt;
                # You may want to set this to 5, then, work your way down.&lt;br /&gt;
                # Currently I have this 3&lt;br /&gt;
                required_hits 3&lt;br /&gt;
                &lt;br /&gt;
                # This determines how spam is reported. Currently safe email is reported&lt;br /&gt;
                # in the message.&lt;br /&gt;
                report_safe 1&lt;br /&gt;
                &lt;br /&gt;
                # The will rewrite the tag of the spam message.&lt;br /&gt;
                rewrite_subject 1&lt;br /&gt;
                &lt;br /&gt;
                # By default, SpamAssassin will run RBL checks.  If your ISP already&lt;br /&gt;
                # does this, set this to 1.&lt;br /&gt;
                skip_rbl_checks 0&lt;br /&gt;
&lt;br /&gt;
     Step 3.&lt;br /&gt;
&lt;br /&gt;
            Update .procmail.&lt;br /&gt;
&lt;br /&gt;
            You should update the .procmail file as follows. Here is my /home/chirico/.procmail file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ cat /home/chirico/.procmailrc&lt;br /&gt;
&lt;br /&gt;
                PATH=/bin:/usr/bin:/usr/local/bin&lt;br /&gt;
                MAILDIR=/var/spool/mail&lt;br /&gt;
                DEFAULT=/var/spool/mail/chirico&lt;br /&gt;
                LOGFILE=/home/chirico/MailBAG&lt;br /&gt;
                MYHOME=/home/chirico&lt;br /&gt;
                #  Must have folder MailTRASH&lt;br /&gt;
                TRASH=/home/chirico/MailTRASH&lt;br /&gt;
                &lt;br /&gt;
                # Will get everything from this mail&lt;br /&gt;
                :0&lt;br /&gt;
                * ^From:.*sporkey@comcast.net&lt;br /&gt;
                        $DEFAULT&lt;br /&gt;
                &lt;br /&gt;
                # Spamassassin&lt;br /&gt;
                :0fw&lt;br /&gt;
                * &amp;lt;300000&lt;br /&gt;
                |/usr/local/bin/spamassassin&lt;br /&gt;
&lt;br /&gt;
      Reference:&lt;br /&gt;
        http://pm-doc.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 93:&lt;br /&gt;
&lt;br /&gt;
     Make Graphs: using dot and neato.&lt;br /&gt;
&lt;br /&gt;
       $ dot -Tpng dotfile -o myout.png&lt;br /&gt;
&lt;br /&gt;
     To see the output reference the following:&lt;br /&gt;
       http://souptonuts.sourceforge.net/code/myout.png&lt;br /&gt;
&lt;br /&gt;
     Where &amp;quot;dotfile&amp;quot; is the following:&lt;br /&gt;
&lt;br /&gt;
       $ cat dotfile&lt;br /&gt;
&lt;br /&gt;
       digraph g&lt;br /&gt;
       {&lt;br /&gt;
               node [shape = record];&lt;br /&gt;
&lt;br /&gt;
               node0 [ label =&amp;quot;&amp;lt;f0&amp;gt; stuff | &amp;lt;f1&amp;gt; J | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node1 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; E | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node4 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; C | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node6 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; I | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node2 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; U | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node5 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; N | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node9 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; Y | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node8 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; W | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node10 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; Z | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node7 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; A | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node3 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; G | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node0&amp;quot;:f0 -&amp;gt; &amp;quot;node1&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node0&amp;quot;:f2 -&amp;gt; &amp;quot;node2&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node1&amp;quot;:f0 -&amp;gt; &amp;quot;node4&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node1&amp;quot;:f2 -&amp;gt; &amp;quot;node6&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node4&amp;quot;:f0 -&amp;gt; &amp;quot;node7&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node4&amp;quot;:f2 -&amp;gt; &amp;quot;node3&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node2&amp;quot;:f0 -&amp;gt; &amp;quot;node5&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node2&amp;quot;:f2 -&amp;gt; &amp;quot;node9&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node9&amp;quot;:f0 -&amp;gt; &amp;quot;node8&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node9&amp;quot;:f2 -&amp;gt; &amp;quot;node10&amp;quot;:f1;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
     Checkout the following article:&lt;br /&gt;
        http://www.linuxjournal.com/article.php?sid=7275&lt;br /&gt;
&lt;br /&gt;
     To download this software&lt;br /&gt;
        http://www.graphviz.org/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 94:&lt;br /&gt;
&lt;br /&gt;
     Makefile: working with conditions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     First note that all the indentations of the file must be&lt;br /&gt;
     a single tab. There cannot be any spaces, or make will&lt;br /&gt;
     not run.&lt;br /&gt;
&lt;br /&gt;
       $ cat Makefile&lt;br /&gt;
&lt;br /&gt;
        # Compiler flags&lt;br /&gt;
        sqliteLIB := $(shell ls /usr/local/lib/libsqlite.so)&lt;br /&gt;
        sqlite3LIB := $(shell ls /usr/local/lib/libsqlite3.so)&lt;br /&gt;
        # all assumes sqlite and sqlite3 are installed&lt;br /&gt;
        #&lt;br /&gt;
&lt;br /&gt;
        test:&lt;br /&gt;
        ifeq (&amp;quot;$(sqlite3LIB)&amp;quot;,&amp;quot;/usr/local/lib/libsqlite3.so&amp;quot;)&lt;br /&gt;
             @echo -e &amp;quot;True -- we found the file&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
             @echo &amp;quot;False -- we did not find the file&amp;quot;&lt;br /&gt;
        endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     So, if I run make I will get the following output.&lt;br /&gt;
&lt;br /&gt;
       $ make&lt;br /&gt;
       True -- we found the file&lt;br /&gt;
&lt;br /&gt;
     This is because I have a file /usr/local/lib/libsqlite3.so on my system.&lt;br /&gt;
     Note how the assignment is made, with the shell command&lt;br /&gt;
&lt;br /&gt;
           sqlite3LIB := $(shell ls /usr/local/lib/libsqlite3.so)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 95:&lt;br /&gt;
&lt;br /&gt;
     Bash: Conditional Expressions&lt;br /&gt;
&lt;br /&gt;
          if [ -e /etc/ntp.conf ]&lt;br /&gt;
            then&lt;br /&gt;
              echo &amp;quot;You have the ntp config file&amp;quot;&lt;br /&gt;
            else&lt;br /&gt;
              echo &amp;quot;You do not have the ntp config file&amp;quot;&lt;br /&gt;
          fi&lt;br /&gt;
&lt;br /&gt;
       Now using an AND condition inside the [ ]. By the way, above, you&lt;br /&gt;
       can put the &amp;quot;then&amp;quot; on the same line as the if &amp;quot;if [ -e /etc/ntp.conf ]; then&amp;quot;&lt;br /&gt;
       as long as you use the &amp;quot;;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           if [ \( -e /etc/ntp.conf \) -a \( -e /etc/ntp/ntpservers \) ]&lt;br /&gt;
             then&lt;br /&gt;
               echo &amp;quot;You have ntp config and ntpservers&amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp.conf ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntp.conf &amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp/ntpservers ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntpservers &amp;quot;&lt;br /&gt;
             else&lt;br /&gt;
               echo &amp;quot; you have neither ntp.conf or ntpservers&amp;quot;&lt;br /&gt;
           fi&lt;br /&gt;
&lt;br /&gt;
        A few things to note above. Else if statement is written as &amp;quot;elif&amp;quot;, and when&lt;br /&gt;
        dealing with &amp;quot;(&amp;quot; you will need to insert &amp;quot;\(&amp;quot;. By the way &amp;quot;-o&amp;quot; can replace &amp;quot;-a&amp;quot;&lt;br /&gt;
        and the &amp;quot;-o&amp;quot; is for OR condition. AND can be done as follows too.&lt;br /&gt;
&lt;br /&gt;
           if [ -e /etc/ntp.conf ] &amp;amp;&amp;amp; [ -e /etc/ntp/ntpservers ]&lt;br /&gt;
             then&lt;br /&gt;
               echo &amp;quot;You have ntp config and ntpservers&amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp.conf ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntp.conf &amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp/ntpservers ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntpservers &amp;quot;&lt;br /&gt;
             else&lt;br /&gt;
               echo &amp;quot; you have neither ntp.conf or ntpservers&amp;quot;&lt;br /&gt;
           fi&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (files).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             -b file      True if file exists and is a block file&lt;br /&gt;
             -c file      True if file exists and is a character device file&lt;br /&gt;
             -d file      True if file exists and is a directory&lt;br /&gt;
             -e file      True if file exists&lt;br /&gt;
             -f file      True if file exists and is a regular file&lt;br /&gt;
             -g file      True if file exists and is set goup id&lt;br /&gt;
             -G file      True if owned by the effective group ID&lt;br /&gt;
&lt;br /&gt;
             -k file      True if &amp;quot;sticky&amp;quot; bit is set and file exists&lt;br /&gt;
             -L file      True if file exists and is a symbolic link&lt;br /&gt;
             -n string    True if string is non-null&lt;br /&gt;
&lt;br /&gt;
             -O file      Ture if file exists and is owned by the effective user ID&lt;br /&gt;
&lt;br /&gt;
             -p file      True if file is a named pipe (FIFO)&lt;br /&gt;
             -r file      True if file is readable&lt;br /&gt;
             -s file      True if file has size &amp;gt; 0&lt;br /&gt;
             -S file      True if file exists and is a socket&lt;br /&gt;
&lt;br /&gt;
             -t file      True if file is open and refers to a terminal.&lt;br /&gt;
             -u file      True if setuid bit is set&lt;br /&gt;
             -w file      True if file exists and is writeable&lt;br /&gt;
             -x file      True if file executable&lt;br /&gt;
             -x dir       True if directory can be searched&lt;br /&gt;
&lt;br /&gt;
             file1 -nt file2     True if file1 modification date newer than file2&lt;br /&gt;
             file1 -ot file2     True if file1 modification date older than file2&lt;br /&gt;
             file1 -ef file2     True if file1 and file2 have same inode&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (Integers).&lt;br /&gt;
&lt;br /&gt;
             -lt  Less than&lt;br /&gt;
             -le  Less than or equal&lt;br /&gt;
             -eq  Equal&lt;br /&gt;
             -ge  Greater than or equal&lt;br /&gt;
             -gt  Greater than&lt;br /&gt;
             -ne  Not equal&lt;br /&gt;
&lt;br /&gt;
          Example usage.&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
             {&lt;br /&gt;
               while read num value; do&lt;br /&gt;
                if [ $num -gt  2 ]; then&lt;br /&gt;
                  echo $value&lt;br /&gt;
                fi&lt;br /&gt;
               done&lt;br /&gt;
             } &amp;lt; somefile&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (Strings).&lt;br /&gt;
&lt;br /&gt;
             str1 = str2      str1 matches str2&lt;br /&gt;
             str1 != str2     str1 does not matches str2&lt;br /&gt;
             str1 &amp;lt; str2      str1 is less than str2&lt;br /&gt;
             str1 &amp;gt;  str2     str1 is greater than str2&lt;br /&gt;
             -n str1          str1 is not null (length greater than 0)&lt;br /&gt;
             -z str1          str1 is null (las length 0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 96:&lt;br /&gt;
&lt;br /&gt;
     CVS: Working with cvs&lt;br /&gt;
&lt;br /&gt;
      INITIAL REPOSITORY:&lt;br /&gt;
&lt;br /&gt;
       To create a repository, and this is normally done by the system admin. This&lt;br /&gt;
       is NOT creating a project to checkout, but the location where everything&lt;br /&gt;
       will be stored! The initial repository!&lt;br /&gt;
&lt;br /&gt;
             cvs -d repository_root_directory init&lt;br /&gt;
&lt;br /&gt;
       Or here is a specific example:&lt;br /&gt;
&lt;br /&gt;
             cvs -d /work/cvsREPOSITORY/   init&lt;br /&gt;
&lt;br /&gt;
       Creating a directory tree from scratch. For a new project, the easiest thing to&lt;br /&gt;
       do is probably to create an empty directory structure, like this:&lt;br /&gt;
&lt;br /&gt;
             $ mkdir sqlite_examples&lt;br /&gt;
             $ mkdir sqlite_examples/man&lt;br /&gt;
             $ mkdir sqlite_examples/testing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       After that, you use the import command to create the&lt;br /&gt;
       corresponding (empty) directory structure inside the repository:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             $ cd &amp;lt;directory&amp;gt;&lt;br /&gt;
             $ cvs -d repository_root_directory import  -m &amp;quot;Created directory structure&amp;quot; yoyodyne/dir yoyo start&lt;br /&gt;
&lt;br /&gt;
       Or, here is a specific example.&lt;br /&gt;
&lt;br /&gt;
             $  cd sqlite_examples&lt;br /&gt;
             $  cvs  -d /work/cvsREPOSITORY/ import -m 'test SQlite'  sqlite_examples sqlite_examples start&lt;br /&gt;
&lt;br /&gt;
       Now, you can delete the directory sqlite_examples, or go to another directory and type&lt;br /&gt;
       the following:&lt;br /&gt;
&lt;br /&gt;
             $ cvs -d /work/cvsREPOSITORY/ co sqlite_examples&lt;br /&gt;
&lt;br /&gt;
     COOL TOOLS:&lt;br /&gt;
&lt;br /&gt;
           1. cvsps&lt;br /&gt;
           2. cvsreport&lt;br /&gt;
&lt;br /&gt;
         cvsps which you can find at http://www.cobite.com/cvsps/cvsps-2.0rc1.tar.gz&lt;br /&gt;
&lt;br /&gt;
             $ cvsps -f README_sqlite_tutorial.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 97:&lt;br /&gt;
&lt;br /&gt;
     Common vi and vim commands&lt;br /&gt;
&lt;br /&gt;
           Command mode ESC&lt;br /&gt;
&lt;br /&gt;
                dd       delete&lt;br /&gt;
                u        undelete&lt;br /&gt;
                y        yank (copy to buffer)&lt;br /&gt;
                p/P      p before cursor/P after cursor&lt;br /&gt;
&lt;br /&gt;
                Ctl-g    show current line number&lt;br /&gt;
                shft-G   end of file&lt;br /&gt;
              n shft-G   move to line n&lt;br /&gt;
&lt;br /&gt;
               /stuff/   search&lt;br /&gt;
                  n   repeat in same direction&lt;br /&gt;
                  N   repeat in opposite direction&lt;br /&gt;
                  /return  repeat seach forward&lt;br /&gt;
                  ?return  repeat seach backward&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;dyy  Yank current line to buffer d&lt;br /&gt;
               &amp;quot;a7yy Yank next 7 lines to buffer a&lt;br /&gt;
                    or&lt;br /&gt;
               :1,7ya a  Yank [ya] lines 1,7 to buffer a&lt;br /&gt;
               :1,7ya b  Yank [ya] lines 1,7 to buffer b&lt;br /&gt;
&lt;br /&gt;
               :5 pu b   Put [pu] buffer b after line 5&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;dP   Put the content of buffer d before cursor&lt;br /&gt;
               &amp;quot;ap   Put the contents of buffer a after cursor&lt;br /&gt;
&lt;br /&gt;
               :1,4 w! file2  Write lines 1,4 to file2&lt;br /&gt;
               :1,3&lt;br /&gt;
&lt;br /&gt;
               :set nu     Display line numbers&lt;br /&gt;
               :set nonum  Turns off display&lt;br /&gt;
&lt;br /&gt;
               :e &amp;lt;filename&amp;gt; Edit a file in a new buffer&lt;br /&gt;
&lt;br /&gt;
            vim&lt;br /&gt;
               :split&lt;br /&gt;
               :split &amp;lt;filename&amp;gt;&lt;br /&gt;
               :sp &amp;lt;filename&amp;gt;&lt;br /&gt;
               :split new&lt;br /&gt;
&lt;br /&gt;
                   ctl-w   To move between windows&lt;br /&gt;
                   ctl-w+&lt;br /&gt;
                   ctl-w-  To change size&lt;br /&gt;
                   ctl+wv  Split windows vertically&lt;br /&gt;
                   ctl-wq  Close window&lt;br /&gt;
&lt;br /&gt;
               :only       To view only 1 window&lt;br /&gt;
&lt;br /&gt;
            vim dictionary - put the following command in ~/.vimrc&lt;br /&gt;
&lt;br /&gt;
                   set dictionary+=/usr/share/dict/words&lt;br /&gt;
                   set thesaurus+=/usr/share/dict/words&lt;br /&gt;
              &lt;br /&gt;
               Now, after you type a word &amp;lt;ctl-x&amp;gt;&amp;lt;ctl-k&amp;gt;&amp;lt;ctl-n&amp;gt; and to &lt;br /&gt;
               go back in the listing &amp;lt;ctl-p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                   butter&amp;lt;ctl-x&amp;gt;&amp;lt;ctl-k&amp;gt;&amp;lt;ctl-n&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 98:&lt;br /&gt;
&lt;br /&gt;
     Using apt-get&lt;br /&gt;
&lt;br /&gt;
          $ apt-get update&lt;br /&gt;
          $ apt-get -s install &amp;lt;pkage&amp;gt;    &amp;lt;---- if everything is ok, then, remove the s&lt;br /&gt;
&lt;br /&gt;
     Note you may want to use dpkg to purge if you have to do a reinstall.&lt;br /&gt;
&lt;br /&gt;
          $ dpkg --purge exim4-base&lt;br /&gt;
          $ dpkg --purge exim4-config&lt;br /&gt;
          $ apt-get install exim4&lt;br /&gt;
&lt;br /&gt;
          $ dpkg-reconfigure exim4-config&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 99:&lt;br /&gt;
&lt;br /&gt;
     Mounting a cdrom on openbsd and installing packages&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /cdrom&lt;br /&gt;
          $ mount /dev/cd0a /cdrom&lt;br /&gt;
          $ cd /cdrom&lt;br /&gt;
&lt;br /&gt;
     To add packages&lt;br /&gt;
&lt;br /&gt;
          $ pkg_add -v  &amp;lt;directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Mounting a cdrom on linux to a user's home sub-directory:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /home/chirico/cdrom&lt;br /&gt;
          $ mount /dev/cdrom /home/chirico/cdrom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 100:&lt;br /&gt;
&lt;br /&gt;
    Creating a boot floppy for knoppix cd:&lt;br /&gt;
&lt;br /&gt;
          $ dd if=/mnt/cdrom/KNOPPIX/boot.img of=/dev/fd0 bs=1440k&lt;br /&gt;
&lt;br /&gt;
    References:&lt;br /&gt;
        http://www.knoppix.net/docs/index.php/BootFloppyHowTo&lt;br /&gt;
&lt;br /&gt;
    For a lot of the knoppix how-to's&lt;br /&gt;
        http://www.knoppix.net/docs/index.php/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 101:&lt;br /&gt;
&lt;br /&gt;
    Diction and Style Tools for Linux  http://ftp.gnu.org/gnu/diction/&lt;br /&gt;
&lt;br /&gt;
        $ diction mytext|less&lt;br /&gt;
&lt;br /&gt;
    Or, this can be done interactively&lt;br /&gt;
&lt;br /&gt;
        $ diction&lt;br /&gt;
        This is more text to read and you can do with it&lt;br /&gt;
        what you want.&lt;br /&gt;
        (stdin):1: This is more text to read and you [can -&amp;gt; (do not confuse with &amp;quot;may&amp;quot;)] do with it what you want.&lt;br /&gt;
&lt;br /&gt;
    DESCRIPTION&lt;br /&gt;
       Diction finds all sentences in a document, that contain phrases from  a&lt;br /&gt;
       database  of  frequently  misused,  bad  or  wordy diction.  It further&lt;br /&gt;
       checks for double words.  If no files are given, the document  is  read&lt;br /&gt;
       from  standard input.  Each found phrase is enclosed in [ ] (brackets).&lt;br /&gt;
       Suggestions and advice, if any, are printed headed by a right arrow -&amp;gt;.&lt;br /&gt;
       A  sentence is a sequence of words, that starts with a capitalised word&lt;br /&gt;
       and ends with a full stop, double colon, question mark or  exclaimation&lt;br /&gt;
       mark.  A single letter followed by a dot is considered an abbreviation,&lt;br /&gt;
       so it does not terminate a sentence.   Various  multi-letter  abbrevia-&lt;br /&gt;
       tions are recognized, they do not terminate a sentence as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 102:&lt;br /&gt;
&lt;br /&gt;
    Using a mail alias.&lt;br /&gt;
&lt;br /&gt;
       Suppose all root mail on your system to go to one root account root@main.com&lt;br /&gt;
&lt;br /&gt;
       In the following file:&lt;br /&gt;
&lt;br /&gt;
             /etc/aliases&lt;br /&gt;
&lt;br /&gt;
       Add this line&lt;br /&gt;
&lt;br /&gt;
             root:    root@main.com&lt;br /&gt;
&lt;br /&gt;
       Next, run newaliases [/usr/bin/newaliases] as follows:&lt;br /&gt;
&lt;br /&gt;
             $ newaliases&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Special note: It's possible to send mail to more than one address. Suppose you want&lt;br /&gt;
                     mail going to root@main.com above, plus you want it going to user donkey&lt;br /&gt;
                     on the local system.&lt;br /&gt;
&lt;br /&gt;
             root:  root@main.com donkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 103:&lt;br /&gt;
&lt;br /&gt;
    Chrony - this service is similiar to ntp. It keeps accurate time&lt;br /&gt;
            on your computer against a very accurate clock in across&lt;br /&gt;
            a network with various time delays.&lt;br /&gt;
&lt;br /&gt;
    Reference: http://go.to/chrony&lt;br /&gt;
&lt;br /&gt;
        In the file &amp;quot;/etc/chrony/chrony.conf&amp;quot; add/replace the following&lt;br /&gt;
&lt;br /&gt;
             server 146.186.218.60&lt;br /&gt;
             server 128.118.25.3&lt;br /&gt;
             server 128.2.129.21&lt;br /&gt;
&lt;br /&gt;
        Next start the chrony service&lt;br /&gt;
&lt;br /&gt;
           $ /etc/init.d/chrony restart&lt;br /&gt;
&lt;br /&gt;
     Next verify that this is working. It may take 20 or 30 minutes to update&lt;br /&gt;
     the clock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Shell command:&lt;br /&gt;
       # chronyc&lt;br /&gt;
       chronyc&amp;gt; sourcestats&lt;br /&gt;
       210 Number of sources = 3&lt;br /&gt;
       Name/IP Address            NP  NR  Span  Frequency   Freq Skew   Std Dev&lt;br /&gt;
       ========================================================================&lt;br /&gt;
       b50.cede.psu.edu            2   0    64       0.000    2000.000  4000ms&lt;br /&gt;
       otc2.psu.edu                2   0    66       0.000    2000.000  4000ms&lt;br /&gt;
       FS3.ECE.CMU.EDU             2   0    64       0.000    2000.000  4000ms&lt;br /&gt;
       chronyc&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    It is probably best to let chrony do its work. However, if you want to&lt;br /&gt;
    set both the hardware and software clock, the following will work:&lt;br /&gt;
&lt;br /&gt;
      Sets the hardware clock&lt;br /&gt;
        # hwclock --set --date=&amp;quot;12/10/04 10:18:05&amp;quot;&lt;br /&gt;
      Sync the hardware clock to software&lt;br /&gt;
        # hwclock --hctosys&lt;br /&gt;
&lt;br /&gt;
    Normally the system keep accurate time with the software clock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 104:&lt;br /&gt;
&lt;br /&gt;
    NFS mount&lt;br /&gt;
&lt;br /&gt;
     SERVER (192.168.1.182)&lt;br /&gt;
&lt;br /&gt;
       Make sure nfs is running on the server&lt;br /&gt;
 &lt;br /&gt;
           $ /etc/init.d/nfs restart&lt;br /&gt;
&lt;br /&gt;
       At the server the contents of /etc/exports for&lt;br /&gt;
       allowing 2 computers (192.168.1.171 and 192.168.1.71)&lt;br /&gt;
       to access the home directory of this server. Note that&lt;br /&gt;
       read write (rw) access is allowed.&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/exports&lt;br /&gt;
         /home   192.168.1.171(rw)&lt;br /&gt;
         /home   192.168.1.71(rw)&lt;br /&gt;
&lt;br /&gt;
       Or, if you have a lot of clients on 192.168.1.* then consider&lt;br /&gt;
       the following:&lt;br /&gt;
&lt;br /&gt;
          /home 192.168.1.0/255.255.252.0(rw)&lt;br /&gt;
&lt;br /&gt;
       Next, still at the server, run the exportfs command&lt;br /&gt;
&lt;br /&gt;
          $ exportfs -rv&lt;br /&gt;
&lt;br /&gt;
       IPTABLES (lokkit). If you're using fedora with default lokkit firewall&lt;br /&gt;
                then you can put the following under &amp;quot;Other ports&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                  Other ports nfs:tcp nfs:udp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       If the above does not work or you are not using lokkit&lt;br /&gt;
        IPTABLES (values in /etc/sysconfig/iptables on SERVER )&lt;br /&gt;
&lt;br /&gt;
        # NFS Need to accept fragmented packets and may not have header&lt;br /&gt;
        #             so you will not know where they are coming from&lt;br /&gt;
        -A INPUT -f -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -m tcp -s 192.168.1.171 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -s 192.168.1.171 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -m udp -s 192.168.1.171 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -s 192.168.1.171 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        &lt;br /&gt;
        -A INPUT -f -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -m tcp -s 192.168.1.71 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -s 192.168.1.71 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -m udp -s 192.168.1.71 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -s 192.168.1.71 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        (Reference: http://nfs.sourceforge.net/nfs-howto/server.html)&lt;br /&gt;
                  and&lt;br /&gt;
        (Reference: http://nfs.sourceforge.net/nfs-howto/security.html)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     CLIENT1 (192.168.1.171)&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /home2&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/fstab&lt;br /&gt;
         192.168.1.182:/home          /home2     nfs     rw 0 0&lt;br /&gt;
&lt;br /&gt;
          $ mount -a -t nfs&lt;br /&gt;
&lt;br /&gt;
        Or to do a one time mounting by hand&lt;br /&gt;
&lt;br /&gt;
          $ mount -t nfs 192.168.1.182:/home  /home2&lt;br /&gt;
&lt;br /&gt;
        Now /home2 on the client will be /home on the server&lt;br /&gt;
&lt;br /&gt;
        Reference:&lt;br /&gt;
          http://nfs.sourceforge.net/nfs-howto/index.html&lt;br /&gt;
&lt;br /&gt;
     MONITOR NFS:&lt;br /&gt;
&lt;br /&gt;
        To monitor the client:&lt;br /&gt;
&lt;br /&gt;
          $ nfsstat -c&lt;br /&gt;
&lt;br /&gt;
           Also note you can &amp;quot;cat /proc/net/rpc/nfs&amp;quot; as well.&lt;br /&gt;
&lt;br /&gt;
       To monitor the server (note the -s instead of the -c).&lt;br /&gt;
&lt;br /&gt;
         $ nfsstat -s&lt;br /&gt;
&lt;br /&gt;
           Also note you can &amp;quot;cat /proc/net/rpc/nfsd&amp;quot; as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       The following &amp;quot;cat&amp;quot; command is done on the NFS server, and shows which&lt;br /&gt;
       clients are mounting. This does not go with examples above. By the way,&lt;br /&gt;
       &amp;quot;root_squash&amp;quot; is the default, and means that root access on the clients is&lt;br /&gt;
       denied. So, how does the client root get access to these filesystems? You have&lt;br /&gt;
       to &amp;quot;su - &amp;lt;someuser&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
              $ cat /proc/fs/nfs/exports&lt;br /&gt;
              # Version 1.1&lt;br /&gt;
              # Path Client(Flags) # IPs&lt;br /&gt;
              /home   192.168.1.102(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   squeezel.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   192.168.1.106(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   livingroom.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   10.8.0.1(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   closet.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
&lt;br /&gt;
     (Reference: http://www.vanemery.com/Linux/NFSv4/NFSv4-no-rpcsec.html#automount )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 105:&lt;br /&gt;
&lt;br /&gt;
      Ports used for Microsoft products&lt;br /&gt;
               http://www.microsoft.com/canada/smallbiz/sgc/articles/ref_net_ports_ms_prod.mspx?pf=true&lt;br /&gt;
          Firewalling?&lt;br /&gt;
               http://www.microsoft.com/technet/prodtechnol/windowsserver2003/library/ServerHelp/428c1bbf-2ceb-4f76-a1ef-0219982eca10.mspx&lt;br /&gt;
&lt;br /&gt;
      To find out common port mappings, take a look at &amp;quot;/etc/services&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 106:&lt;br /&gt;
&lt;br /&gt;
      Man pages: If man pages are formatting incorrectly with PuTTY, try editing&lt;br /&gt;
      the &amp;quot;/etc/man.config&amp;quot; file with the following changes:&lt;br /&gt;
&lt;br /&gt;
           NROFF /usr/bin/groff -Tlatin1 -mandoc&lt;br /&gt;
           NEQN /usr/bin/geqn -Tlatin1&lt;br /&gt;
&lt;br /&gt;
         (Reference TIP 7 for using man)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 107:&lt;br /&gt;
&lt;br /&gt;
      Valgrind: check for memory leaks in your programs. (http://valgrind.org/)&lt;br /&gt;
&lt;br /&gt;
       This is how you can run it on the program &amp;quot;a.out&amp;quot; for valgrind version 2.2.0&lt;br /&gt;
&lt;br /&gt;
         $ valgrind --logfile=valgrind.output   --tool=memcheck ./a.out&lt;br /&gt;
&lt;br /&gt;
       This is how you write the logfile &amp;quot;--log-file&amp;quot; for valgrind-3.0.1&lt;br /&gt;
&lt;br /&gt;
         $ valgrind  --log-file=valgrind --leak-check=yes --tool=memcheck ./a.out&lt;br /&gt;
&lt;br /&gt;
       With C++ programs with gcc 3.4 and later that use STL, export GLIBCXX_FORCE_NEW &lt;br /&gt;
       only when testing to disable memory caching. Remember to enable for production&lt;br /&gt;
       as this will have a performance penalty. Reference  http://valgrind.org/docs/FAQ/ &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 108:&lt;br /&gt;
&lt;br /&gt;
      Runlevel Configuring.&lt;br /&gt;
&lt;br /&gt;
       These two programs, run as root give you a ncurses GUI to what will&lt;br /&gt;
       run on your system on boot.&lt;br /&gt;
&lt;br /&gt;
            # ntsysv&lt;br /&gt;
&lt;br /&gt;
            # chkconfig&lt;br /&gt;
&lt;br /&gt;
       Note, you can also set these manually. For example, normally you will&lt;br /&gt;
       have files in &amp;quot;/etc/init.d/&amp;quot; that will take parameters like &amp;quot;start&amp;quot;,&amp;quot;stop&amp;quot;&lt;br /&gt;
       &amp;quot;restart&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       Take a look at &amp;quot;/etc/init.d/mysql&amp;quot; this file will start and stop the&lt;br /&gt;
       mysql daemon. So, how does know which run levels, and the order it gets&lt;br /&gt;
       loaded in the run level to other programs? By the K&amp;lt;number&amp;gt; and S&amp;lt;number&amp;gt;&lt;br /&gt;
       values.&lt;br /&gt;
&lt;br /&gt;
            $ ls /etc/rc3.d/*mysql&lt;br /&gt;
&lt;br /&gt;
                /etc/rc3.d/K85mysql&lt;br /&gt;
                /etc/rc3.d/S85mysql&lt;br /&gt;
&lt;br /&gt;
       So here on my system the start value is 85. Looking in /etc/rc3.d, which is&lt;br /&gt;
       run level 3, any program with a lower number S84something will get loaded&lt;br /&gt;
       before mysql.&lt;br /&gt;
&lt;br /&gt;
       I manually set the run level as follows for mysql.&lt;br /&gt;
&lt;br /&gt;
            # cd /etc/rc3.d&lt;br /&gt;
            # ln -s ../init.d/mysql S85mysql&lt;br /&gt;
            # ln -s ../init.d/mysql K85mysql&lt;br /&gt;
&lt;br /&gt;
            # cd /etc/rc5.d&lt;br /&gt;
            # ln -s ../init.d/mysql S85mysql&lt;br /&gt;
            # ln -s ../init.d/mysql K85mysql&lt;br /&gt;
&lt;br /&gt;
       Note that I could have chose other numbers as well. &amp;quot;ntsysv&amp;quot; gives&lt;br /&gt;
       you a graphical interface.&lt;br /&gt;
&lt;br /&gt;
       This is a way of doing this with &amp;quot;chkconfig&amp;quot; at the command prompt.&lt;br /&gt;
&lt;br /&gt;
            # chkconfig --list mysqld&lt;br /&gt;
            mysqld          0:off   1:off   2:off   3:on    4:off   5:on    6:off&lt;br /&gt;
&lt;br /&gt;
       Above you can see it's on. Here's how we would have turned this on with chkconfig.&lt;br /&gt;
&lt;br /&gt;
            # chkconfig --level 35 mysqld on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 109:&lt;br /&gt;
&lt;br /&gt;
       File Alteration Monitor - Gamin a FAM replacement&lt;br /&gt;
        http://www.gnome.org/~veillard/gamin/&lt;br /&gt;
        http://www.gnome.org/~veillard/gamin/sources/&lt;br /&gt;
       ******  EXAMPLE NOT COMPLETE *****&lt;br /&gt;
&lt;br /&gt;
       Working with fam  - file alteration monitor.  Mail uses this to signify&lt;br /&gt;
           a change in a file's status.&lt;br /&gt;
&lt;br /&gt;
        Below is the sample C program ftest.c which can be compiled as&lt;br /&gt;
        follows:&lt;br /&gt;
&lt;br /&gt;
              $ gcc -o ftest ftest.c  -lfam&lt;br /&gt;
&lt;br /&gt;
        You will need to work with this as root&lt;br /&gt;
&lt;br /&gt;
              #  ./ftest &amp;lt;somefile absolute path&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Reference:&lt;br /&gt;
            http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?db=man&amp;amp;fname=/usr/share/catman/p_man/cat3x/fam.z&lt;br /&gt;
            http://www.devchannel.org/devtoolschannel/04/05/13/2146252.shtml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 110:&lt;br /&gt;
&lt;br /&gt;
       glibc - this is the main library used by C, and the following&lt;br /&gt;
        link below gives you examples on everything from sockets,math,&lt;br /&gt;
        date and time functions, user environment, and much more.&lt;br /&gt;
&lt;br /&gt;
         http://www.gnu.org/software/libc/manual/html_mono/libc.html&lt;br /&gt;
&lt;br /&gt;
       How do you know which version of glibc you are running?&lt;br /&gt;
&lt;br /&gt;
          #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
          #include &amp;lt;gnu/libc-version.h&amp;gt;&lt;br /&gt;
          int main (void)&lt;br /&gt;
           {&lt;br /&gt;
             puts (gnu_get_libc_version ());&lt;br /&gt;
             return 0;&lt;br /&gt;
           }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 111:&lt;br /&gt;
&lt;br /&gt;
       nslookup and dig - query Internet name servers interactively.&lt;br /&gt;
&lt;br /&gt;
         $ nslookup&lt;br /&gt;
         &amp;gt;chirico.org&lt;br /&gt;
         Server:        68.80.0.6&lt;br /&gt;
         Address:       68.80.0.6#53&lt;br /&gt;
&lt;br /&gt;
         Name: chirico.org&lt;br /&gt;
         Address: 66.35.250.210&lt;br /&gt;
         &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      The nslookup command will query the dns server is &amp;quot;/etc/resolve.conf&amp;quot;&lt;br /&gt;
      However, you can force a certain dns with &amp;quot;- server&amp;quot;.  For example the&lt;br /&gt;
      command below goes to the server named dilbert&lt;br /&gt;
&lt;br /&gt;
         $ nslookup - dilbert&lt;br /&gt;
         &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      dig:&lt;br /&gt;
&lt;br /&gt;
      dig gives you more information. You should probably use dig instead&lt;br /&gt;
      of nslookup.&lt;br /&gt;
&lt;br /&gt;
      Below I am forcing the lookup from DNS 68.80.0.6 of the name chirico.org, and&lt;br /&gt;
      note that the query time is return too.&lt;br /&gt;
&lt;br /&gt;
         $ dig @68.80.0.6  +qr chirico.org&lt;br /&gt;
&lt;br /&gt;
         ; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.2.1 &amp;lt;&amp;lt;&amp;gt;&amp;gt; @68.80.0.6 +qr chirico.org&lt;br /&gt;
         ;; global options:  printcmd&lt;br /&gt;
         ;; Sending:&lt;br /&gt;
         ;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 55908&lt;br /&gt;
         ;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0&lt;br /&gt;
        &lt;br /&gt;
         ;; QUESTION SECTION:&lt;br /&gt;
         ;chirico.org.                   IN      A&lt;br /&gt;
        &lt;br /&gt;
         ;; Got answer:&lt;br /&gt;
         ;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 55908&lt;br /&gt;
         ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
        &lt;br /&gt;
         ;; QUESTION SECTION:&lt;br /&gt;
         ;chirico.org.                   IN      A&lt;br /&gt;
        &lt;br /&gt;
         ;; ANSWER SECTION:&lt;br /&gt;
         chirico.org.            5538    IN      A       66.35.250.210&lt;br /&gt;
        &lt;br /&gt;
         ;; AUTHORITY SECTION:&lt;br /&gt;
         chirico.org.            30599   IN      NS      ns78.worldnic.com.&lt;br /&gt;
         chirico.org.            30599   IN      NS      ns77.worldnic.com.&lt;br /&gt;
        &lt;br /&gt;
         ;; ADDITIONAL SECTION:&lt;br /&gt;
         ns78.worldnic.com.      16022   IN      A       216.168.225.218&lt;br /&gt;
         ns77.worldnic.com.      7       IN      A       216.168.228.41&lt;br /&gt;
        &lt;br /&gt;
         ;; Query time: 155 msec&lt;br /&gt;
         ;; SERVER: 68.80.0.6#53(68.80.0.6)&lt;br /&gt;
         ;; WHEN: Thu Dec 23 07:48:23 2004&lt;br /&gt;
         ;; MSG SIZE  rcvd: 127&lt;br /&gt;
&lt;br /&gt;
      So what if you wanted to know what name the IP address 66.35.250.210&lt;br /&gt;
      resolves to, when using dns 68.80.0.12.&lt;br /&gt;
&lt;br /&gt;
          $ dig @68.80.0.12 -x 66.35.250.210&lt;br /&gt;
          ...&lt;br /&gt;
          ;; ANSWER SECTION:&lt;br /&gt;
          210.250.35.66.in-addr.arpa. 3600 IN   CNAME   210.0/24.250.35.66.in-addr.arpa.&lt;br /&gt;
          210.0/24.250.35.66.in-addr.arpa. 3600 IN PTR  vhost.sourceforge.net.&lt;br /&gt;
&lt;br /&gt;
      Above you can see it resolved to &amp;quot;vhost.sourceforge.net&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      Reference ( http://www.tldp.org/HOWTO/DNS-HOWTO-5.html )&lt;br /&gt;
        Also see TIP 223.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 112:&lt;br /&gt;
&lt;br /&gt;
       Using GNU Autotools - so you can produce the familiar &amp;quot;./configure&amp;quot;  &amp;quot;make&amp;quot;  and &amp;quot;make install&amp;quot;&lt;br /&gt;
                             commands. There is also a &amp;quot;make dist&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                The program sqlite3api.cc and the rest of this code can be found at&lt;br /&gt;
                 http://prdownloads.sourceforge.net/cpearls/autotools.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         A &amp;quot;Makefile.am&amp;quot; is required:&lt;br /&gt;
&lt;br /&gt;
            bin_PROGRAMS = sprog&lt;br /&gt;
            sprog_SOURCES = sqlite3api.cc&lt;br /&gt;
            sprog_LDADD = @INCLUDES@ @SQLIBOBJS@&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         In addition, a &amp;quot;configure.in&amp;quot; file is required. Note, AC_CHECK_LIB will&lt;br /&gt;
         check the &amp;quot;libsqlite3.so&amp;quot; file for the &amp;quot;sqlite3_open&amp;quot; file. Note that&lt;br /&gt;
         &amp;quot;sqlite3&amp;quot;, is a shortcut for &amp;quot;libsqlite3&amp;quot; by convention. If this file&lt;br /&gt;
         is not found, AC_CHECK_FILE looks for &amp;quot;/usr/local/lib/libsqlite3.a&amp;quot;. If&lt;br /&gt;
         this is found, then, &amp;quot;-lsqlite3&amp;quot; is added to the LIBS environment variable.&lt;br /&gt;
         Also, &amp;quot;-I/usr/local/include&amp;quot; and &amp;quot;-L/usr/local/lib&amp;quot; will be added on the&lt;br /&gt;
         command line. This is common when some one does not have the library in&lt;br /&gt;
         the path.  (See TIP 49)&lt;br /&gt;
&lt;br /&gt;
            dnl Process this file with autoconf to produce a configure script.&lt;br /&gt;
            AC_INIT(sqlite3api.cc)&lt;br /&gt;
            AM_INIT_AUTOMAKE(sqliteprog, 1.0)&lt;br /&gt;
            AC_PROG_CXX&lt;br /&gt;
            CXXFLAGS='-Wall -W -O2 -s -pipe'&lt;br /&gt;
            AC_CHECK_LIB(sqlite3,sqlite3_open,[],found=no)&lt;br /&gt;
             if test &amp;quot;$found&amp;quot; = &amp;quot;no&amp;quot;; then&lt;br /&gt;
               AC_CHECK_FILE(/usr/local/lib/libsqlite3.a, found=yes)&lt;br /&gt;
               if test &amp;quot;$found&amp;quot; = &amp;quot;yes&amp;quot;; then&lt;br /&gt;
                 LIBS=&amp;quot;$LIBS -lsqlite3&amp;quot;&lt;br /&gt;
                 INCLUDES=&amp;quot;$INCLUDES -I/usr/local/include&amp;quot;&lt;br /&gt;
                 EXTRALIB='-L/usr/local/lib'&lt;br /&gt;
                else&lt;br /&gt;
                 echo &amp;quot;Are you SURE sqlite3 is installed?&amp;quot;&lt;br /&gt;
               fi&lt;br /&gt;
             fi&lt;br /&gt;
            SQLIBOBJS='-Wl,-R/usr/local/lib'&lt;br /&gt;
            AC_SUBST(INCLUDES)&lt;br /&gt;
            AC_SUBST(SQLIBOBJS)&lt;br /&gt;
            AC_SUBST(EXTRALIB)&lt;br /&gt;
            AC_OUTPUT(Makefile)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         To build the configure file, just run the following:&lt;br /&gt;
&lt;br /&gt;
             $ aclocal&lt;br /&gt;
             $ autoconf&lt;br /&gt;
             $ touch NEWS README AUTHORS ChangeLog&lt;br /&gt;
             $ automake --add-missing&lt;br /&gt;
&lt;br /&gt;
         Now if you want to make a tar.gz file &amp;quot;sqliteprog-1.0.tar.gz&amp;quot;, then&lt;br /&gt;
         all you have to run is the following:&lt;br /&gt;
&lt;br /&gt;
             $ make dist&lt;br /&gt;
&lt;br /&gt;
         Note: did you ever want to save all the output from a ./configure? Well, it&lt;br /&gt;
               is automatically saved in the &amp;quot;config.log&amp;quot; file. In fact, this file may&lt;br /&gt;
               contain a lot more than what you saw on the screen.&lt;br /&gt;
&lt;br /&gt;
               Also, you may need to rerun ./configure. But before you do, delete&lt;br /&gt;
               the &amp;quot;config.cache&amp;quot; file to get a clean build.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 113:&lt;br /&gt;
&lt;br /&gt;
       EMACS - common emacs commands.&lt;br /&gt;
&lt;br /&gt;
         M is the ESC&lt;br /&gt;
         C or c is the Ctl&lt;br /&gt;
&lt;br /&gt;
        Shell - when working in a shell. &amp;quot;M-x rename-uniquely&amp;quot; is good for split screen editing.&lt;br /&gt;
&lt;br /&gt;
          M-x rename-uniquely   Use this for multiple shells (renames buffer so it's not the same shell)&lt;br /&gt;
          C-c C-z               Send job in background (when working in a shell)&lt;br /&gt;
          C-c C-o               commit-kill-output (gets rid of a lot of shell output)&lt;br /&gt;
          C-c C-r               reposition at beginning of output&lt;br /&gt;
          C-c C-e               reposition at end of output&lt;br /&gt;
          M-x send-invisible    Hide passwords - use this before typing a password&lt;br /&gt;
&lt;br /&gt;
         Note: if the shell prompt does not show up correctly, then, you may want to creat a &amp;quot;.emacs_bash&amp;quot;&lt;br /&gt;
               file with the following contents:&lt;br /&gt;
&lt;br /&gt;
                          PS1=&amp;quot;emacs:\W \$ &amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Directories  (C-x d) give you a directory listing. You know all those annoying &amp;quot;~&amp;quot; and &amp;quot;#&amp;quot;&lt;br /&gt;
                     file that you get? You can easily delete these when in &amp;quot;dired&amp;quot; mode by hitting&lt;br /&gt;
                     &amp;quot;~&amp;quot;, then  &amp;quot;d&amp;quot; to flag it for delete. Then, hit &amp;quot;x&amp;quot; to and confirm deletion.&lt;br /&gt;
&lt;br /&gt;
                     These are other command that work on highlighted files in &amp;quot;dired&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
                          R   rename&lt;br /&gt;
                          v   view&lt;br /&gt;
                          Z   compress the file&lt;br /&gt;
                          +   create directory&lt;br /&gt;
&lt;br /&gt;
        Other common commands:&lt;br /&gt;
&lt;br /&gt;
          c-x l          list the line you are on, and how many lines in the document.&lt;br /&gt;
                         You will get something like: Page has 4881 lines (4440 + 442),&lt;br /&gt;
                         which means you are on the 4440 line.&lt;br /&gt;
&lt;br /&gt;
          c-x rm bookmark make&lt;br /&gt;
          c-x rb bookmark bounce&lt;br /&gt;
        &lt;br /&gt;
          c-x rb notes&lt;br /&gt;
          c-x rb emacs&lt;br /&gt;
        &lt;br /&gt;
          c-x / &amp;lt;r&amp;gt; (save position in register &amp;lt;r&amp;gt;)&lt;br /&gt;
          c-x j &amp;lt;r&amp;gt; (jump to position in register &amp;lt;r&amp;gt;)&lt;br /&gt;
          c-x r SPC 1 (mark current point in register 1)&lt;br /&gt;
          c-x r j 1 (jump to marked point in register 1)&lt;br /&gt;
          c-x r t &amp;lt;string&amp;gt;  (insert string into register)&lt;br /&gt;
        &lt;br /&gt;
          c-x r s 1 (save marked region in register 1)&lt;br /&gt;
          c-x r i 1 (insert marked region)&lt;br /&gt;
        &lt;br /&gt;
          c-x c-o (delete all blank lines, except one)&lt;br /&gt;
        &lt;br /&gt;
          c-x z (repeat the last command ... stop with an a)&lt;br /&gt;
          c-x zz (repeat the last command twice)&lt;br /&gt;
&lt;br /&gt;
          rectangle&lt;br /&gt;
          ---------&lt;br /&gt;
          C-SPC&lt;br /&gt;
          goto the next region&lt;br /&gt;
          C-x&lt;br /&gt;
          C-x&lt;br /&gt;
          then, C-x r r &amp;quot;name of register&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
          to insert the register&lt;br /&gt;
          C-x r i &amp;quot;name of register&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
          macros:&lt;br /&gt;
          -------&lt;br /&gt;
          c-x (    start macro&lt;br /&gt;
          c-x )    end macro&lt;br /&gt;
          c-x e    execute macro&lt;br /&gt;
        &lt;br /&gt;
          mail:&lt;br /&gt;
          -----&lt;br /&gt;
          c-x m   mail&lt;br /&gt;
          c-c c-s send&lt;br /&gt;
        &lt;br /&gt;
          C-x C-e&lt;br /&gt;
          (insert &amp;quot;\n\nExtra Line of text&amp;quot;)&lt;br /&gt;
        &lt;br /&gt;
          ;; chirico functions in .emacs&lt;br /&gt;
          ;; This creates an html template&lt;br /&gt;
          (defun my-html ()&lt;br /&gt;
          (interactive)&lt;br /&gt;
          (insert &amp;quot;&amp;lt;html&amp;gt;&lt;br /&gt;
          &amp;lt;head&amp;gt;&lt;br /&gt;
          &amp;lt;META HTTP-EQUIV=\&amp;quot;Pragma\&amp;quot; CONTENT=\&amp;quot;no-cache\&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;META HTTP-EQUIV=\&amp;quot;Expires\&amp;quot; CONTENT=\&amp;quot;-1\&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;/head&amp;gt;&lt;br /&gt;
          &amp;lt;body bgcolor=\&amp;quot;#ffffff\&amp;quot;&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
          &amp;lt;/body&amp;gt;&lt;br /&gt;
          &amp;lt;/html&amp;gt;&amp;quot;)&lt;br /&gt;
          )&lt;br /&gt;
&lt;br /&gt;
     Backspace issues when using &amp;quot;emacs -nw&amp;quot;? They putting the following in your &amp;quot;~/.emacs&amp;quot; file&lt;br /&gt;
&lt;br /&gt;
             (global-set-key &amp;quot;\C-d&amp;quot; 'backward-delete-char)&lt;br /&gt;
             (global-set-key &amp;quot;\C-h&amp;quot; 'backward-delete-char)&lt;br /&gt;
             (global-set-key (kbd &amp;quot;DEL&amp;quot;) 'delete-char)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 114:&lt;br /&gt;
&lt;br /&gt;
        ncftpget - an intelligent ftp client (http://www.ncftp.com/). Also&lt;br /&gt;
                   check your fedora or debian install. This package allows&lt;br /&gt;
                   you to easily download packages from ftp sites.&lt;br /&gt;
&lt;br /&gt;
          This is an example of connect to an ftp site, with a subdirectory, and&lt;br /&gt;
          downloading all in one command.&lt;br /&gt;
&lt;br /&gt;
           $ ncftpget ftp://ftp.gnu.org/pub/gnu/gcc/gcc-3.2.3/gcc-3.2.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
          Of if you want to get the fedora core 3 installs&lt;br /&gt;
&lt;br /&gt;
           $ ncftpget ftp://ftp.linux.ncsu.edu/pub/fedora/linux/core/3/i386/iso/FC3*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 115:&lt;br /&gt;
&lt;br /&gt;
        expr - evaluate expressions. You can use this on the command line&lt;br /&gt;
&lt;br /&gt;
           $ expr 6 + 4&lt;br /&gt;
           10&lt;br /&gt;
&lt;br /&gt;
         Note the spaces. Without spaces, you get the following:&lt;br /&gt;
&lt;br /&gt;
           $ expr 6+4&lt;br /&gt;
           6+4&lt;br /&gt;
&lt;br /&gt;
         If you're using &amp;quot;*&amp;quot;, you'll need a &amp;quot;\&amp;quot; before it&lt;br /&gt;
&lt;br /&gt;
           $ expr 10 \* 10&lt;br /&gt;
           100&lt;br /&gt;
&lt;br /&gt;
         This also works for variables&lt;br /&gt;
&lt;br /&gt;
           $ var1=34&lt;br /&gt;
           $ expr $var1 + 3&lt;br /&gt;
           37&lt;br /&gt;
&lt;br /&gt;
         or&lt;br /&gt;
&lt;br /&gt;
           $ var1=2&lt;br /&gt;
           $ var1=`expr $var1 \* 2`&lt;br /&gt;
           $ echo $var1&lt;br /&gt;
           4&lt;br /&gt;
&lt;br /&gt;
         see (TIP 25) you can get the cosine(.23)&lt;br /&gt;
&lt;br /&gt;
           $ var1=`echo &amp;quot;c(.23)&amp;quot;|bc -l`&lt;br /&gt;
           $ echo $var1&lt;br /&gt;
           .97366639500537483696&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         You can also do substrings:&lt;br /&gt;
&lt;br /&gt;
           $ expr substr &amp;quot;BigBear&amp;quot; 4 4&lt;br /&gt;
           Bear&lt;br /&gt;
&lt;br /&gt;
         And length of strings&lt;br /&gt;
&lt;br /&gt;
           $ mstr=&amp;quot;12345&amp;quot;&lt;br /&gt;
           $ expr length $mstr&lt;br /&gt;
           5&lt;br /&gt;
&lt;br /&gt;
         Regular expressions&lt;br /&gt;
&lt;br /&gt;
           $ expr &amp;quot;a3&amp;quot; : [a-z][1-9]&lt;br /&gt;
           2&lt;br /&gt;
&lt;br /&gt;
         Or you can get a bit fancy&lt;br /&gt;
&lt;br /&gt;
           $ myexpr=&amp;quot;[a-z][1-9]&amp;quot;&lt;br /&gt;
           $ echo $myexpr&lt;br /&gt;
           [a-z][1-9]&lt;br /&gt;
&lt;br /&gt;
           $ expr &amp;quot;a3&amp;quot; : $myexpr&lt;br /&gt;
           2&lt;br /&gt;
&lt;br /&gt;
         This may not be the best way to find out if it is Friday, but&lt;br /&gt;
         it seems to work. It's more of an exercise in xargs.&lt;br /&gt;
&lt;br /&gt;
           $ date&lt;br /&gt;
           Fri Dec 31 16:44:47 EST 2004&lt;br /&gt;
           $ date|xargs -i expr {} : &amp;quot;[Fri]&amp;quot;&lt;br /&gt;
           1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 116:&lt;br /&gt;
&lt;br /&gt;
        eval&lt;br /&gt;
&lt;br /&gt;
           $ mypipe=&amp;quot;|&amp;quot;&lt;br /&gt;
           $ eval ls $mypipe wc&lt;br /&gt;
           6       6     129&lt;br /&gt;
&lt;br /&gt;
        Did you catch that? The above statement is the same as&lt;br /&gt;
&lt;br /&gt;
           $ ls | wc&lt;br /&gt;
&lt;br /&gt;
        Where &amp;quot;|&amp;quot; is put into the variable $mypipe&lt;br /&gt;
&lt;br /&gt;
        (also see TIP 118)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 117:&lt;br /&gt;
&lt;br /&gt;
        lxr, glimpse, patchset - tools for reading the kernel source&lt;br /&gt;
&lt;br /&gt;
          This example puts some of the files in /home/src since my home&lt;br /&gt;
          partition is the largest. Plus, you do not want to over write&lt;br /&gt;
          the source in /usr/src/ If you want to put your files elsewhere&lt;br /&gt;
          just substitute /home/src for your desired directory.&lt;br /&gt;
&lt;br /&gt;
         patchset -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ export SRCDIR=/home/src&lt;br /&gt;
            $ cd $SRCDIR&lt;br /&gt;
            $ wget http://www.csn.ul.ie/~mel/projects/patchset/patchset-0.5.tar.gz&lt;br /&gt;
            $ export PATH=$PATH:$SRCDIR/patchset-0.5/bin&lt;br /&gt;
&lt;br /&gt;
          Now edit &amp;quot;/home/src/patchset-0.5/etc/patchset.conf&amp;quot; and set WWW_USER to&lt;br /&gt;
          whatever your website runs as&lt;br /&gt;
&lt;br /&gt;
                  export WWW_USER=nobody&lt;br /&gt;
&lt;br /&gt;
          Getting kernel source. The last step builds and asks a lot of questions. Enter&lt;br /&gt;
          yes to things that interest you, since this is what you will see in the source&lt;br /&gt;
          code. It is not going to build for booting. The &amp;quot;downlaod -p&amp;quot; is for downloading&lt;br /&gt;
          a patch.&lt;br /&gt;
&lt;br /&gt;
            $ download 2.6.10&lt;br /&gt;
            $ createset 2.6.10&lt;br /&gt;
            $ make-kernel -b 2.6.10&lt;br /&gt;
&lt;br /&gt;
        glimpse -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ mkdir -p /home/src/glimpse&lt;br /&gt;
            $ cd /home/src/glimpse&lt;br /&gt;
            $ wget http://webglimpse.net/trial/glimpse-latest.tar.gz&lt;br /&gt;
            $ tar -xzf glimpse-latest.tar.gz&lt;br /&gt;
            $ cd glimpse-4.18.0&lt;br /&gt;
            $ ./configure; make&lt;br /&gt;
            $ make install&lt;br /&gt;
&lt;br /&gt;
        lxr -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ make -p /home/src/lxr&lt;br /&gt;
            $ cd /home/src/lxr&lt;br /&gt;
            $ wget http://heanet.dl.sourceforge.net/sourceforge/lxr/lxr-0.3.1.tar.gz&lt;br /&gt;
            $ cd lxr-0.3&lt;br /&gt;
&lt;br /&gt;
          Edit &amp;quot;Makefile&amp;quot; and set PERLBIN to &amp;quot;/usr/bin/perl&amp;quot; or the where perl is&lt;br /&gt;
          on your system. Also set INSTALLPREFIX to &amp;quot;/var/www/lxr&amp;quot;.  Then, as root&lt;br /&gt;
          do the following:&lt;br /&gt;
&lt;br /&gt;
            $ make install&lt;br /&gt;
&lt;br /&gt;
         Apache changes&lt;br /&gt;
&lt;br /&gt;
          Next edit the apache httpd.conf. On my system it is&lt;br /&gt;
          &amp;quot;/usr/local/apache2/conf/httpd.conf&amp;quot;, but if you did a fedora install&lt;br /&gt;
          I think this file is located at &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             Alias  /lxr/ &amp;quot;/var/www/lxr/&amp;quot;&lt;br /&gt;
             &amp;lt;Directory &amp;quot;/var/www/lxr/&amp;quot;&amp;gt;&lt;br /&gt;
               Options ExecCGI Indexes Includes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride all&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
&lt;br /&gt;
              &amp;lt;Files ~ (search|source|ident|diff|find)&amp;gt;&lt;br /&gt;
                    SetHandler cgi-script&lt;br /&gt;
              &amp;lt;/Files&amp;gt;&lt;br /&gt;
             &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          lxr - continued &amp;quot;/var/www/lxr/http/lxr.conf&amp;quot; changes.  The following contains&lt;br /&gt;
                my lxr.conf with changes made to almost every variable. Make sure you use&lt;br /&gt;
                your website in place of 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
                 # Configuration file.&lt;br /&gt;
                &lt;br /&gt;
                 # Define typed variable &amp;quot;v&amp;quot;, read valueset from file.&lt;br /&gt;
                 variable: v, Version, [/var/www/lxr/source/versions], [/var/www/lxr/source/defversion]&lt;br /&gt;
                &lt;br /&gt;
                 # Define typed variable &amp;quot;a&amp;quot;.  First value is default.&lt;br /&gt;
                 variable: a, Architecture, (i386, alpha, m68k, mips, ppc, sparc, sparc64)&lt;br /&gt;
                &lt;br /&gt;
                 # Define the base url for the LXR files.&lt;br /&gt;
                 baseurl: http://192.168.1.71/lxr/http/&lt;br /&gt;
                &lt;br /&gt;
                 # These are the templates for the HTML heading, directory listing and&lt;br /&gt;
                 # footer, respectively.&lt;br /&gt;
                 htmlhead: /var/www/lxr/http/template-head&lt;br /&gt;
                 htmltail: /var/www/lxr/http/template-tail&lt;br /&gt;
                 htmldir:  /var/www/lxr/http/template-dir&lt;br /&gt;
                &lt;br /&gt;
                 # The source is here.&lt;br /&gt;
                 sourceroot: /var/www/lxr/source/$v/&lt;br /&gt;
                 srcrootname: Linux&lt;br /&gt;
                &lt;br /&gt;
                 # &amp;quot;#include &amp;lt;foo.h&amp;gt;&amp;quot; is mapped to this directory (in the LXR source&lt;br /&gt;
                 # tree)&lt;br /&gt;
                 incprefix: /include&lt;br /&gt;
                &lt;br /&gt;
                 # The database files go here.&lt;br /&gt;
                 dbdir: /var/www/lxr/source/$v/&lt;br /&gt;
                &lt;br /&gt;
                 # Glimpse can be found here.&lt;br /&gt;
                 glimpsebin: /usr/local/bin/glimpse&lt;br /&gt;
                &lt;br /&gt;
                 # The power of regexps.  This is pretty Linux-specific, but quite&lt;br /&gt;
                 # useful.  Tinker with it and see what it does.  (How's that for&lt;br /&gt;
                 # documentation?)&lt;br /&gt;
                 map: /include/asm[^\/]*/ /include/asm-$a/&lt;br /&gt;
                 map: /arch/[^\/]+/ /arch/$a/&lt;br /&gt;
&lt;br /&gt;
         Now you should be ready to run &amp;quot;make-lxr&amp;quot;. Make sure the path is setup to patchset,&lt;br /&gt;
         which is repeated here. The last step take awhile.&lt;br /&gt;
&lt;br /&gt;
            $ export SRCDIR=/home/src&lt;br /&gt;
            $ cd $SRCDIR&lt;br /&gt;
            $ export PATH=$PATH:$SRCDIR/patchset-0.5/bin&lt;br /&gt;
&lt;br /&gt;
            $  make-lxr 2.6.10&lt;br /&gt;
&lt;br /&gt;
         Now you need to index the source. Below the ./glimpse_* file will be put in&lt;br /&gt;
         root. Checkout the -H option if you do not want them here on a temporary&lt;br /&gt;
         bases of if you run out of room.&lt;br /&gt;
&lt;br /&gt;
            $ glimpseindex -o -t -w 5000 /var/www/lxr/source/2.6.10 &amp;gt;&amp;amp; .glimpse_out&lt;br /&gt;
&lt;br /&gt;
         Since the above put the files under /root/.glimpse_* they should be moved&lt;br /&gt;
&lt;br /&gt;
            $ mv /root/.glimps_* /var/www/lxr/source/2.6.10/.&lt;br /&gt;
            $ chown -R nobody.nobody ./.glimpse_*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 118:&lt;br /&gt;
&lt;br /&gt;
        exec - you can change standard output and input without starting a new&lt;br /&gt;
               process.&lt;br /&gt;
&lt;br /&gt;
          The exec redirect the output from ls and date to a file. Nothing&lt;br /&gt;
          is show on the terminal until &amp;quot;exec &amp;gt; /dev/tty&amp;quot; is performed&lt;br /&gt;
&lt;br /&gt;
            $ exec &amp;gt; mfile&lt;br /&gt;
            $ ls&lt;br /&gt;
            $ date&lt;br /&gt;
            $ exec &amp;gt; /dev/tty&lt;br /&gt;
&lt;br /&gt;
          This is an example of assigning file descriptor 3 to file &amp;quot;output3&amp;quot; for&lt;br /&gt;
          output, then, redirecting &amp;quot;ls&amp;quot; to this descriptor. Finally, file descriptor&lt;br /&gt;
          3 is used for input, and the contents are read into the cat command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
            $ exec 3&amp;gt;output3&lt;br /&gt;
            $ ls  &amp;gt;&amp;amp; 3&lt;br /&gt;
            $ exec 3&amp;lt;output3&lt;br /&gt;
            $ cat &amp;lt;&amp;amp;3&lt;br /&gt;
            ChangeLog&lt;br /&gt;
            CVS&lt;br /&gt;
            How_to_Linux_and_Open_Source.txt&lt;br /&gt;
            How_to_Linux_and_Open_Source.txt.~1.193.~&lt;br /&gt;
            mfile&lt;br /&gt;
            mfile2&lt;br /&gt;
            mfile3&lt;br /&gt;
            mftp&lt;br /&gt;
            output3&lt;br /&gt;
&lt;br /&gt;
        Could you redirect the output to 3 files and stderr?&lt;br /&gt;
&lt;br /&gt;
            $ exec 3&amp;gt;output3&lt;br /&gt;
            $ exec 4&amp;gt;output4&lt;br /&gt;
            $ exec 5&amp;gt;output5&lt;br /&gt;
&lt;br /&gt;
            $ ls &amp;gt;&amp;amp; 3 &amp;gt;&amp;amp; 4 &amp;gt;&amp;amp; 5 &amp;gt;&amp;amp; 2   // Nope, can't do this.&lt;br /&gt;
            output3  output4  output5&lt;br /&gt;
&lt;br /&gt;
         Instead, you should do the following:&lt;br /&gt;
&lt;br /&gt;
            $ ls | tee output3 | tee output4 |tee output5&lt;br /&gt;
&lt;br /&gt;
         Closing the &amp;quot;output&amp;quot; file descriptor&lt;br /&gt;
&lt;br /&gt;
            $ &amp;gt;&amp;amp;3-&lt;br /&gt;
&lt;br /&gt;
         Closing the &amp;quot;input&amp;quot; file descriptor&lt;br /&gt;
&lt;br /&gt;
            $ 3&amp;lt;&amp;amp;-&lt;br /&gt;
&lt;br /&gt;
         See what is still open on 0-10&lt;br /&gt;
&lt;br /&gt;
            $ lsof -a -p $$ -d 0-10&lt;br /&gt;
&lt;br /&gt;
         Recursion - the following counts to 5, then, quits.&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
            sleep 1&lt;br /&gt;
            declare -x n&lt;br /&gt;
            let n=${n:=0}+1&lt;br /&gt;
            [ $n -le 5 ] &amp;amp;&amp;amp; echo &amp;quot;$n&amp;quot; &amp;amp;&amp;amp;  exec $0&lt;br /&gt;
&lt;br /&gt;
         There are some real-life applications for this technique, as follows:&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
            declare -x N&lt;br /&gt;
            declare -x n&lt;br /&gt;
            N=${N:=$(od -vAn -N1 -tu4 &amp;lt; /dev/urandom)}&lt;br /&gt;
            let n=${n:=0}+1&lt;br /&gt;
            [ $(($n%2)) -eq 0 ] &amp;amp;&amp;amp; echo &amp;quot;She Loves Me!&amp;quot; || echo &amp;quot;She Loves Me NOT!&amp;quot;&lt;br /&gt;
            [ $n -lt $N ] &amp;amp;&amp;amp;  exec $0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 119:&lt;br /&gt;
&lt;br /&gt;
        runlevel - need to know the current runlevel?&lt;br /&gt;
&lt;br /&gt;
           $ who -r&lt;br /&gt;
           run-level 3  Dec 31 19:02                   last=S&lt;br /&gt;
&lt;br /&gt;
        Need to know the architecture?&lt;br /&gt;
&lt;br /&gt;
          $ arch&lt;br /&gt;
          i686&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 120:&lt;br /&gt;
&lt;br /&gt;
        at - executes commands at a specified time.&lt;br /&gt;
&lt;br /&gt;
         A few examples here. The 1970 program will run&lt;br /&gt;
         next Auguest 2 even though the year 1970 has long past.&lt;br /&gt;
&lt;br /&gt;
          $ at 6:30am Jan 12 &amp;lt; program&lt;br /&gt;
          $ at noon tomorrow &amp;lt; program&lt;br /&gt;
          $ at 1970 pm August 2 &amp;lt; program&lt;br /&gt;
&lt;br /&gt;
        This is an interactive way to use the command:&lt;br /&gt;
&lt;br /&gt;
          $ at now + 6 minutes&lt;br /&gt;
          warning: commands will be executed using (in order) a) $SHELL b) login shell c) /bin/sh&lt;br /&gt;
          at&amp;gt; ls&lt;br /&gt;
          at&amp;gt; date &amp;gt; /tmp/5min&lt;br /&gt;
          at&amp;gt; ^D&lt;br /&gt;
          job 3 at 2005-01-01 08:50&lt;br /&gt;
&lt;br /&gt;
        What jobs are in the queue?&lt;br /&gt;
&lt;br /&gt;
          $ atq&lt;br /&gt;
&lt;br /&gt;
        or&lt;br /&gt;
&lt;br /&gt;
          $ at -l&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 121:&lt;br /&gt;
&lt;br /&gt;
        Creating a Manpage&lt;br /&gt;
&lt;br /&gt;
         As root you can copy the following to /usr/local/man/man1/soup.1 which will&lt;br /&gt;
         give you a manpage for soup.&lt;br /&gt;
&lt;br /&gt;
              .\&amp;quot; Manpage for souptonuts.&lt;br /&gt;
              .\&amp;quot; Contact mchirico@users.sourceforge.com to correct errors or omissions.&lt;br /&gt;
              .TH man 1 &amp;quot;04 January 2005&amp;quot; &amp;quot;1.0&amp;quot; &amp;quot;souptonuts man page&amp;quot;&lt;br /&gt;
              .SH NAME&lt;br /&gt;
              soup \- man page for souptonuts&lt;br /&gt;
              .SH SYNOPSIS&lt;br /&gt;
              soup&lt;br /&gt;
              .SH DESCRIPTION&lt;br /&gt;
              souptonuts is a collection of linux and open&lt;br /&gt;
              source tips.&lt;br /&gt;
              off for golf.&lt;br /&gt;
              .SH OPTIONS&lt;br /&gt;
              The souptonuts does not take any options.&lt;br /&gt;
              .SH SEE ALSO&lt;br /&gt;
              doughnut(1), golf(8)&lt;br /&gt;
              .SH BUGS&lt;br /&gt;
              No known bugs at this time.&lt;br /&gt;
              .SH AUTHOR&lt;br /&gt;
              Mike Chirico (mchirico@comcast.net mchirico@users.sourceforge.net)&lt;br /&gt;
&lt;br /&gt;
         So, to view this man page&lt;br /&gt;
&lt;br /&gt;
            $ man soup&lt;br /&gt;
&lt;br /&gt;
         It's also possible to compress&lt;br /&gt;
&lt;br /&gt;
            $ gzip /usr/local/man/man1/soup.1&lt;br /&gt;
&lt;br /&gt;
         For plenty of examples look at the other man pages. Also the following&lt;br /&gt;
         is helpful. The last one is a tutorial &amp;quot;man 7 mdoc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            $ man manpath&lt;br /&gt;
            $ man groff&lt;br /&gt;
            $ man 7 mdoc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 122:&lt;br /&gt;
&lt;br /&gt;
        dmesg - print out boot messages, or what is in the kernel ring buffer.&lt;br /&gt;
&lt;br /&gt;
          If you missed the messages on boot-up, you can use dmesg to print them.&lt;br /&gt;
&lt;br /&gt;
            $ dmesg &amp;gt; boot.msg&lt;br /&gt;
&lt;br /&gt;
          Or to print, then, clear the ring&lt;br /&gt;
&lt;br /&gt;
            # dmesg -c &amp;gt; boot.msg&lt;br /&gt;
&lt;br /&gt;
          (also see TIP 20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 123:&lt;br /&gt;
&lt;br /&gt;
        gnus - emacs email nntp news reader (comcast as example with NO TLS or SSL)&lt;br /&gt;
&lt;br /&gt;
          First check that you can connect to the news group:&lt;br /&gt;
&lt;br /&gt;
                 $ telnet newsgroups.comcast.net 119&lt;br /&gt;
                 Trying 216.196.97.136...&lt;br /&gt;
                 Connected to newsgroups.comcast.net.&lt;br /&gt;
                 Escape character is '^]'.&lt;br /&gt;
                 200 News.GigaNews.Com&lt;br /&gt;
&lt;br /&gt;
          If you want to check for TLS or SSL see (TIP 54).&lt;br /&gt;
&lt;br /&gt;
          Here is a very simple configuration example without encryption. It&lt;br /&gt;
          appears that comcast does not support ssl or TLS.&lt;br /&gt;
&lt;br /&gt;
          In the &amp;quot;~/.emacs&amp;quot; file you would add the following to get comcast&lt;br /&gt;
          news groups&lt;br /&gt;
&lt;br /&gt;
             (setq gnus-select-method '(nntp &amp;quot;newsgroups.comcast.net&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
          Then, create an &amp;quot;~/.authinfo&amp;quot; file with the following settings using&lt;br /&gt;
          you own username and password.&lt;br /&gt;
&lt;br /&gt;
             machine newsgroups.comcast.net login borkey@comcast.net  password borkeypass0rd&lt;br /&gt;
&lt;br /&gt;
          Next create a &amp;quot;~/.newsrc&amp;quot; with your groups&lt;br /&gt;
&lt;br /&gt;
             news.announce.newusers:&lt;br /&gt;
             comp.lang.c++.moderated! 1-500&lt;br /&gt;
             comp.unix.programmer! 1-500&lt;br /&gt;
             comp.unix.shell! 1-500&lt;br /&gt;
             gnu.emacs.gnus! 1-500&lt;br /&gt;
&lt;br /&gt;
          Finally, create a &amp;quot;~/.gnus&amp;quot; with the following email settings for you&lt;br /&gt;
&lt;br /&gt;
             (setq user-mail-address &amp;quot;mchirico@comcast.net&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
             (defun my-message-mode-setup ()&lt;br /&gt;
               (setq fill-column 72)&lt;br /&gt;
               (turn-on-auto-fill))&lt;br /&gt;
               (add-hook 'message-mode-hook 'my-message-mode-setup)&lt;br /&gt;
&lt;br /&gt;
          To get into gnus&lt;br /&gt;
&lt;br /&gt;
              E-x gnus&lt;br /&gt;
&lt;br /&gt;
          The following are common gnus commands&lt;br /&gt;
&lt;br /&gt;
                RET  view the article under the cursor&lt;br /&gt;
&lt;br /&gt;
                A A (shift-a, shift a): List all newsgroups known&lt;br /&gt;
                                        to the server.&lt;br /&gt;
&lt;br /&gt;
                l (lower-case L)      : List only  subscribed groups&lt;br /&gt;
                                        with unread articles.&lt;br /&gt;
&lt;br /&gt;
                L                     : List all newsgroups in .newsrc file.&lt;br /&gt;
&lt;br /&gt;
                g                     : See if new articles have arrived.&lt;br /&gt;
&lt;br /&gt;
            Some commands for reading&lt;br /&gt;
&lt;br /&gt;
                n  next unread article&lt;br /&gt;
&lt;br /&gt;
                p  previous article&lt;br /&gt;
&lt;br /&gt;
                SPC  scroll down  moves to next unread&lt;br /&gt;
                     when at the bottom of the article&lt;br /&gt;
&lt;br /&gt;
                del  scroll up&lt;br /&gt;
&lt;br /&gt;
                F  follow-up to group on the article you are&lt;br /&gt;
                   reading now.&lt;br /&gt;
&lt;br /&gt;
                f  follow-up to group without citing the article&lt;br /&gt;
&lt;br /&gt;
                R  reply by mail and cite the article&lt;br /&gt;
&lt;br /&gt;
                r  reply by mail without citing the article&lt;br /&gt;
&lt;br /&gt;
                m  new mail&lt;br /&gt;
&lt;br /&gt;
                a  new posting&lt;br /&gt;
&lt;br /&gt;
                c  Catchup&lt;br /&gt;
&lt;br /&gt;
                C-u / t  Show only young headers&lt;br /&gt;
                         / t without C-u limits the summary&lt;br /&gt;
                         to old headers&lt;br /&gt;
&lt;br /&gt;
                T T  toggle threading&lt;br /&gt;
&lt;br /&gt;
                C-u g  Display raw article&lt;br /&gt;
                       hit g to return to normal view&lt;br /&gt;
&lt;br /&gt;
                t  Show all headers  it's a toggle&lt;br /&gt;
&lt;br /&gt;
                W w  Wordwrap the current article&lt;br /&gt;
&lt;br /&gt;
                W r  Decode ROT13  a toggle&lt;br /&gt;
&lt;br /&gt;
                ^  fetch parent of article&lt;br /&gt;
&lt;br /&gt;
                L  create a scorefile-entry based&lt;br /&gt;
                   on the current article (low score)&lt;br /&gt;
                   ? gives you information what each char means&lt;br /&gt;
&lt;br /&gt;
                I  like L but high score&lt;br /&gt;
&lt;br /&gt;
          Commands to send email&lt;br /&gt;
&lt;br /&gt;
            C-c C-c  send message&lt;br /&gt;
&lt;br /&gt;
            C-c C-d  save message as draft&lt;br /&gt;
&lt;br /&gt;
            C-c C-k  kill message&lt;br /&gt;
&lt;br /&gt;
            C-c C-m f  attach file&lt;br /&gt;
&lt;br /&gt;
            M-q  reformat paragraph&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 124:&lt;br /&gt;
&lt;br /&gt;
        Sending Email from telnet&lt;br /&gt;
&lt;br /&gt;
           Note, if you are on the computer you can sometime use the local loopback.&lt;br /&gt;
           In fact, sometimes you can only use the local loop back 127.0.0.1 in&lt;br /&gt;
           place of &amp;quot;bozo.company.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            1     [mchirico@soup Notes]$ telnet bozo.company.com 25&lt;br /&gt;
            2     Trying 192.168.0.204...&lt;br /&gt;
            3     Connected to bozo.company.com.&lt;br /&gt;
            4     Escape character is '^]'.&lt;br /&gt;
            5     220 bozo.company.com ESMTP Postfix (Postfix-20010228-pl03) (Mandrake Linux)&lt;br /&gt;
            6     HELO fakedomain.com&lt;br /&gt;
            7     HELO fakedomain.com         // server echo&lt;br /&gt;
            8     250 bozo.company.com&lt;br /&gt;
            9     MAIL FROM: test@fakedomain.com&lt;br /&gt;
           10     MAIL FROM: test@fakedomain.com   // server echo&lt;br /&gt;
           11     250 Ok&lt;br /&gt;
           12     RCPT TO: mchirico@someother.com&lt;br /&gt;
           13     RCPT TO: mchirico@someother.com   // server echo&lt;br /&gt;
           14     250 Ok&lt;br /&gt;
           15     DATA&lt;br /&gt;
           16     DATA    // echo&lt;br /&gt;
           17     354 Enter mail, end with &amp;quot;.&amp;quot; on a line by itself&lt;br /&gt;
           18     This is a test message&lt;br /&gt;
           19     This is a test message&lt;br /&gt;
           20     to send&lt;br /&gt;
           21     to send&lt;br /&gt;
           22     .&lt;br /&gt;
           23     250 2.0.0 j0B0uH3L018469 Message accepted for delivery&lt;br /&gt;
&lt;br /&gt;
          Above on line 6 you can type in any domain name. Line 7 is an echo. All&lt;br /&gt;
          echos are listed in the comment field.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 125:&lt;br /&gt;
&lt;br /&gt;
          IP forwarding, IP Masquerade&lt;br /&gt;
&lt;br /&gt;
             # echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
             # ipchains -F forward&lt;br /&gt;
             # ipchains -P forward DENY&lt;br /&gt;
             # ipchains -A forward -s 192.168.0.0/24 -j MASQ&lt;br /&gt;
             # ipchains -A forward -i eth1 -j MASQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          This assumes that your internal network is 192.168.0.0 on eth1, and the&lt;br /&gt;
          internet is connected to eth0.&lt;br /&gt;
&lt;br /&gt;
          (Also See TIP 182)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 126:&lt;br /&gt;
&lt;br /&gt;
         Setting KDE as the default desktop manager&lt;br /&gt;
&lt;br /&gt;
               Edit &amp;quot;/etc/sysconfig/desktop&amp;quot; to include the two lines:&lt;br /&gt;
&lt;br /&gt;
                 DESKTOP=&amp;quot;KDE&amp;quot;&lt;br /&gt;
                 DISPLAYMANAGER=&amp;quot;KDE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 127:&lt;br /&gt;
&lt;br /&gt;
        Have a file and you do not know whay type it is (tar, gz, ASCII, binary) ?&lt;br /&gt;
        Use the file command.  Below it is used on the file &amp;quot;mftp&amp;quot;&lt;br /&gt;
&lt;br /&gt;
               $ file mftp&lt;br /&gt;
               mftp: Bourne-Again shell script text executable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 128:&lt;br /&gt;
&lt;br /&gt;
        Software RAID: Two good references&lt;br /&gt;
&lt;br /&gt;
          http://www.tldp.org/HOWTO/Software-RAID-HOWTO-1.html&lt;br /&gt;
          http://lists.us.dell.com/pipermail/linux-poweredge/2003-July/014331.html&lt;br /&gt;
&lt;br /&gt;
        Note, you must setup grub for each RAID 1 device. Suppose you have&lt;br /&gt;
        2 SCSI drives (sda and sdb). By default grub is setup on sda; but, you&lt;br /&gt;
        need to enable it for sdb (/dev/hdb for ide) as follows:&lt;br /&gt;
&lt;br /&gt;
           grub&amp;gt;device (hd0) /dev/sdb&lt;br /&gt;
           grub&amp;gt;root (hd0,0)&lt;br /&gt;
           grub&amp;gt;setup (hd0)&lt;br /&gt;
&lt;br /&gt;
           Checking if &amp;quot;/boot/grub/stage1&amp;quot; exists... no&lt;br /&gt;
           Checking if &amp;quot;/grub/stage1&amp;quot; exists... yes&lt;br /&gt;
           Checking if &amp;quot;/grub/stage2&amp;quot; exists... yes&lt;br /&gt;
           Checking if &amp;quot;/grub/e2fs_stage1_5&amp;quot; exists.. yes&lt;br /&gt;
           Running &amp;quot;embed /grub/e2fs_stage1_5 (hd0)&amp;quot;... 16 sectors are embedded.&lt;br /&gt;
          succeeded&lt;br /&gt;
           Running &amp;quot;install /grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/grub/stage2 /grub/grub&lt;br /&gt;
         .conf&amp;quot;... succeeded.&lt;br /&gt;
         Done.&lt;br /&gt;
&lt;br /&gt;
          grub&amp;gt;&lt;br /&gt;
          grub&amp;gt;quit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Checking to see if everything is working:&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
        Checking the drives&lt;br /&gt;
&lt;br /&gt;
          $ sfdisk -d /dev/sdb&lt;br /&gt;
          $ sfdisk -d /dev/sda&lt;br /&gt;
&lt;br /&gt;
          $ fdisk -l /dev/sda  &amp;quot;This will give general information&amp;quot;&lt;br /&gt;
          $ fdisk -l           &amp;quot;General information for all drives&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Adding raid (assume you want to add the first drive &amp;quot;sda1&amp;quot;, or if it is the second&lt;br /&gt;
                    drive then substitute &amp;quot;sda2&amp;quot; below )&lt;br /&gt;
&lt;br /&gt;
          $ raidhotadd /dev/md0 /dev/sda1&lt;br /&gt;
          $ raidhotadd /dev/md1 /dev/sda2&lt;br /&gt;
          $ raidhotadd /dev/md2 /dev/sda3&lt;br /&gt;
&lt;br /&gt;
        This is an example of an cat /proc/mdstat that is working. Note that&lt;br /&gt;
        there is a listing for both sda1[0] and sdb1[1]&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
                Personalities : [raid1]&lt;br /&gt;
                read_ahead 1024 sectors&lt;br /&gt;
                Event: 12&lt;br /&gt;
                md0 : active raid1 sda1[0] sdb1[1]&lt;br /&gt;
                      104320 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md1 : active raid1 sda2[0] sdb2[1]&lt;br /&gt;
                      1044160 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md2 : active raid1 sda3[0] sdb3[1]&lt;br /&gt;
                      34411136 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        Compare that to this where md2 is missing sdb3&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
                Personalities : [raid1]&lt;br /&gt;
                read_ahead 1024 sectors&lt;br /&gt;
                Event: 9&lt;br /&gt;
                md0 : active raid1 sda1[0] sdb1[1]&lt;br /&gt;
                      104320 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md1 : active raid1 sda2[0] sdb2[1]&lt;br /&gt;
                      1044160 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md2 : active raid1 sdb3[1]        &amp;lt;---- HERE&lt;br /&gt;
                      34411136 blocks [2/1] [_U]&lt;br /&gt;
&lt;br /&gt;
                unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        If you are rebuilding an array, you can watch it by doing the following:&lt;br /&gt;
&lt;br /&gt;
           $ watch -n1 cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
        Need to know the raid setup?&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/raidtab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 129:&lt;br /&gt;
&lt;br /&gt;
        Resetting Redhat Linux Passwords using GRUB&lt;br /&gt;
&lt;br /&gt;
           1. Press 'e'&lt;br /&gt;
           2. Press 'e' again&lt;br /&gt;
           3. Append 'single' to the kernel version listing&lt;br /&gt;
&lt;br /&gt;
          See&lt;br /&gt;
             http://linuxgazette.net/107/tomar.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 130:&lt;br /&gt;
&lt;br /&gt;
        mtr - matt's traceroute. This is an advanced traceroute that keeps&lt;br /&gt;
              [http://www.bitwizard.nl/mtr/]&lt;br /&gt;
                  $ mtr www.yahoo.com&lt;br /&gt;
&lt;br /&gt;
                                              Matt's traceroute  [v0.52]&lt;br /&gt;
                     third-fl-71.localdomain                            Thu Jan 20 11:05:57 2005&lt;br /&gt;
                     Keys:  D - Display mode    R - Restart statistics    Q - Quit&lt;br /&gt;
                                                            Packets               Pings&lt;br /&gt;
                     Hostname                            %Loss  Rcv  Snt  Last Best  Avg  Worst&lt;br /&gt;
                      1. 192.168.1.1                        0%    3    3     0    0    0      1&lt;br /&gt;
                      2. ???&lt;br /&gt;
                      3. fe-2-6-rr01.willogrove5.pa.pa01    0%    3    3     8    7    7      8&lt;br /&gt;
                      4. srp-8-1-ar01.willowgrove1.pa.pa    0%    2    2     8    8    8      8&lt;br /&gt;
                      5. pos7-3-cr01.torresdale.pa.core.    0%    2    2     8    8    8      8&lt;br /&gt;
                      6. 12.119.53.53                       0%    2    2    12   12   12     13&lt;br /&gt;
                      7. tbr1-p012401.phlpa.ip.att.net      0%    2    2    12   12   13     13&lt;br /&gt;
                      8. tbr1-cl8.n54ny.ip.att.net          0%    2    2    13   13   13     13&lt;br /&gt;
                      9. ggr2-p310.n54ny.ip.att.net         0%    2    2    12   12   13     14&lt;br /&gt;
                     10. so-1-0-0.gar4.NewYork1.Level3.n    0%    2    2    14   14   37     61&lt;br /&gt;
                     11. ae-1-54.bbr2.NewYork1.Level3.ne    0%    2    2    13   12   13     13&lt;br /&gt;
                     12. ge-0-3-0.bbr2.Washington1.Level    0%    2    2    19   19   19     19&lt;br /&gt;
                     13. ge-1-1-51.car1.Washington1.Leve    0%    2    2    18   18   19     20&lt;br /&gt;
                     14. 4.79.228.6                         0%    2    2    21   19   20     21&lt;br /&gt;
                     15. UNKNOWN-216-109-120-201.yahoo.c    0%    2    2    21   20   20     21&lt;br /&gt;
                     16. w2.rc.vip.dcn.yahoo.com            0%    2    2    23   21   22     23&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 131:&lt;br /&gt;
&lt;br /&gt;
        chfn - change finger information&lt;br /&gt;
&lt;br /&gt;
            $ chfn&lt;br /&gt;
&lt;br /&gt;
          Next you are asked for a password and user information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 132:&lt;br /&gt;
&lt;br /&gt;
        chsh - change login shell&lt;br /&gt;
&lt;br /&gt;
          First, you may want to get a listing of all the possible&lt;br /&gt;
          shells.&lt;br /&gt;
&lt;br /&gt;
             $ chsh -l&lt;br /&gt;
&lt;br /&gt;
               /bin/sh&lt;br /&gt;
               /bin/bash&lt;br /&gt;
               /sbin/nologin&lt;br /&gt;
               /bin/ash&lt;br /&gt;
               /bin/bsh&lt;br /&gt;
               /bin/ksh&lt;br /&gt;
               /usr/bin/ksh&lt;br /&gt;
               /usr/bin/pdksh&lt;br /&gt;
               /bin/tcsh&lt;br /&gt;
               /bin/csh&lt;br /&gt;
               /bin/zsh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 133:&lt;br /&gt;
&lt;br /&gt;
        bash - working with binary, hex and base 3.&lt;br /&gt;
&lt;br /&gt;
         For the variable must be declare as an integer. Then&lt;br /&gt;
         specify the  &amp;lt;base&amp;gt;#&amp;lt;value&amp;gt;. The example below is 22 in&lt;br /&gt;
         base 3.&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n&lt;br /&gt;
              $ n=3#22&lt;br /&gt;
              $ echo $n&lt;br /&gt;
                8&lt;br /&gt;
&lt;br /&gt;
           Base 16 (hex)&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n2&lt;br /&gt;
              $ n2=16#a&lt;br /&gt;
              $ echo $n2&lt;br /&gt;
                10&lt;br /&gt;
&lt;br /&gt;
           Base 8 (octal)&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n3&lt;br /&gt;
              $ n3=8#11&lt;br /&gt;
              $ echo $n3&lt;br /&gt;
                9   Note 8+1=9&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 134:&lt;br /&gt;
&lt;br /&gt;
        monitoring IP traffic. Try iptraf http://iptraf.seul.org/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 135:&lt;br /&gt;
&lt;br /&gt;
        enscript - convert text files to PostScript&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 136:&lt;br /&gt;
&lt;br /&gt;
        dd and tar - blocking factor. How to determine the blocking factor, block size&lt;br /&gt;
                   so that tar and dd can work together.&lt;br /&gt;
&lt;br /&gt;
        Step 1: Create a large file on local disk, in a directory &amp;quot;1&amp;quot; that will eventually&lt;br /&gt;
                be written to tape. This will be created with dd as follows:&lt;br /&gt;
&lt;br /&gt;
                $ mkdir 1&lt;br /&gt;
                $ dd if=/dev/zero of=disk-image count=40960&lt;br /&gt;
                  40960+0 records in&lt;br /&gt;
                  40960+0 records out&lt;br /&gt;
&lt;br /&gt;
                $ cd ..&lt;br /&gt;
&lt;br /&gt;
        Step 2: tar the directory and contents to tape. First rewind the tape. These examples&lt;br /&gt;
                use /dev/nst0 as the location of the tape. Make sure to substitute your values&lt;br /&gt;
                if needed.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ tar --label=&amp;quot;Test 1&amp;quot; --create --blocking-factor=128 --file=/dev/nst0 1&lt;br /&gt;
&lt;br /&gt;
        Step 3: Read data from the tape using a block size of 128k. If you get an I/O error, which&lt;br /&gt;
                could happend if you used a different blocking factor above, then, you may need&lt;br /&gt;
                to increase the bs to 256, or 512 etc. as needed.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=/dev/nst0 bs=128k of=testblocksz count=1&lt;br /&gt;
                 0+1 records in&lt;br /&gt;
                 0+1 records out&lt;br /&gt;
&lt;br /&gt;
                $ ls -l testblocksz&lt;br /&gt;
                 -rw-r--r--    1 root     root        65536 Feb  9 10:41 testblocksz&lt;br /&gt;
&lt;br /&gt;
                $ ls -lh testblocksz&lt;br /&gt;
                 -rw-r--r--    1 root     root          64k Feb  9 10:41 testblocksz&lt;br /&gt;
&lt;br /&gt;
               Note above that the size 65536 is equal to 64k. That &amp;quot;h&amp;quot; switch in &amp;quot;ls&amp;quot; is for&lt;br /&gt;
               human readable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 4: tar uses a multiplier of 512*blocking-factor to get block size. Again&lt;br /&gt;
&lt;br /&gt;
                 512 * blocking-factor = block size used in dd command.&lt;br /&gt;
&lt;br /&gt;
              Putting in the values, we see that&lt;br /&gt;
&lt;br /&gt;
                 512 * 128 = 65536&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 5: So what does this tell you? You can now use these numbers to &amp;quot;dd&amp;quot; files&lt;br /&gt;
              to tape. But, first tar will be used to create the file locally.&lt;br /&gt;
&lt;br /&gt;
                $ tar --label=&amp;quot;Test 1&amp;quot; --create --blocking-factor=128 --file=test.tar 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 6: Send this to tape with the dd command. Remember 64k is equal to 65536.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=test.tar bs=64k of=/dev/nst0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 7: Now test that it can be read with tar command using blocking-factor=128.&lt;br /&gt;
             Note the &amp;quot;t&amp;quot; command in tar is for tell. It will not write data.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ tar -tvf /dev/nst0 --blocking-factor=128&lt;br /&gt;
                 V--------- 0/0               0 2005-02-09 10:38:20 Test 1--Volume Header--&lt;br /&gt;
                 drwxr-xr-x root/root         0 2005-02-09 10:34:10 1/&lt;br /&gt;
                 -rw-r--r-- root/root  20971520 2005-02-09 10:34:11 1/disk-image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 8: Reading tape data with dd. Most of the time a high &amp;quot;ibs&amp;quot; input block size&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=/dev/nst0 of=outfromdd.tar ibs=64k&lt;br /&gt;
                 321+0 records in&lt;br /&gt;
                 41088+0 records out&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 9: Verify that outfromdd.tar can be read by tar with blocking-factor=128&lt;br /&gt;
&lt;br /&gt;
                $ tar -tvf outfromdd.tar --blocking-factor=128&lt;br /&gt;
                 V--------- 0/0               0 2005-02-09 10:38:20 Test 1--Volume Header--&lt;br /&gt;
                 drwxr-xr-x root/root         0 2005-02-09 10:34:10 1/&lt;br /&gt;
                 -rw-r--r-- root/root  20971520 2005-02-09 10:34:11 1/disk-image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       PULLING FILES:  The dd command can be used to pull files.&lt;br /&gt;
&lt;br /&gt;
              ssh target_address dd if=remotefile | dd of=localfile&lt;br /&gt;
&lt;br /&gt;
           Or, a specific example of getting a file from a computer called hamlet.&lt;br /&gt;
&lt;br /&gt;
              $ ssh root@hamlet  dd if=/home/cvs/test | dd of=/home/storage/test&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        GOING BACKWARD AND FORWARD ON TAPE:&lt;br /&gt;
&lt;br /&gt;
             Go to end of data&lt;br /&gt;
              $ mt -f /dev/nst0  eod&lt;br /&gt;
&lt;br /&gt;
             Previous record&lt;br /&gt;
              $ mt -f /dev/nst0  bsfm 1&lt;br /&gt;
&lt;br /&gt;
             Forward record&lt;br /&gt;
              $ mt -f /dev/nst0  fsf 1&lt;br /&gt;
&lt;br /&gt;
             Rewind&lt;br /&gt;
              $ mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
             Tell&lt;br /&gt;
              $ mt -f /dev/nst0 tell&lt;br /&gt;
&lt;br /&gt;
         (Reference TIP 151 - for how to get around firewalls)&lt;br /&gt;
&lt;br /&gt;
         Below is a script that I use to backup computers via ssh. The&lt;br /&gt;
         tape drive is on &amp;quot;nis&amp;quot; and the extra space is on &amp;quot;hamlet&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                #!/bin/bash&lt;br /&gt;
                # Program to backup server remotely&lt;br /&gt;
                # Assume remote server is nis, you are on squeezel&lt;br /&gt;
                #&lt;br /&gt;
                # Recover from tape&lt;br /&gt;
                #&lt;br /&gt;
                #   dd if=/dev/nst0 of=test.tar.gz bs=64k&lt;br /&gt;
                #&lt;br /&gt;
                filename=&amp;quot;support1.$(date &amp;quot;+%m%d%y%H%M&amp;quot;).tar.gz&amp;quot;&lt;br /&gt;
                DIRTOBACKUP=/var/www&lt;br /&gt;
                #tar cvzf - $DIRTOBACKUP | ssh  root@nis  '(mt -f /dev/nst0 rewind; dd of=/dev/nst0 bs=64k )'&lt;br /&gt;
                tar cvzf - $DIRTOBACKUP | ssh  support1@hamlet &amp;quot;dd of=/home/support1/backups/${filename} &amp;quot;&lt;br /&gt;
&lt;br /&gt;
         Another example program, below, pushes the last &amp;quot;.tar.gz&amp;quot; file to tape:&lt;br /&gt;
&lt;br /&gt;
                #!/bin/bash&lt;br /&gt;
                # Program to push files to tape&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                # Notes on recovering from tape&lt;br /&gt;
                #&lt;br /&gt;
                #   dd if=/dev/nst0 of=test.tar.gz ibs=64k&lt;br /&gt;
                #    or&lt;br /&gt;
                #  $ ssh root@tapeserver &amp;quot;mt -f /dev/nst0 rewind&amp;quot;&lt;br /&gt;
                #  $ ssh root@tapeserver &amp;quot;dd if=/dev/nst0 ibs=64k&amp;quot;|dd of=cvs1.tar.gz&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                # First rewind tape&lt;br /&gt;
                ssh root@tapeserver 'mt -f /dev/nst0 rewind'&lt;br /&gt;
                #&lt;br /&gt;
                # Grab only the last file&lt;br /&gt;
                file=$(find /home/cvs  -iname 'cvs*.tar.gz'|sort|tail -n 1)&lt;br /&gt;
                dd if=${file}|ssh root@tapeserver 'dd of=/dev/nst0 bs=64k'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 137:&lt;br /&gt;
&lt;br /&gt;
        Apache - redirecting pages. All changes are in httpd.conf&lt;br /&gt;
&lt;br /&gt;
               RedirectMatch (.*)\.gif$ http://www.anotherserver.com$1.jpg&lt;br /&gt;
&lt;br /&gt;
               Redirect /service http://foo2.bar.com/service&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 138:&lt;br /&gt;
&lt;br /&gt;
        samba mounts via ssh - mounting a samba share through an ssh tunnel, going&lt;br /&gt;
               through an intermediate computer, that accepts ssh. We'll call this&lt;br /&gt;
               intermediate computer middle [65.219.4.23], and we want to get to&lt;br /&gt;
               destination [192.168.0.81]. The user will be mchirico.&lt;br /&gt;
&lt;br /&gt;
          STEP 1:&lt;br /&gt;
&lt;br /&gt;
               $ mkdir -p /samba/share&lt;br /&gt;
&lt;br /&gt;
          STEP 2:&lt;br /&gt;
&lt;br /&gt;
            This has to be done as root, since we are using a lower port.&lt;br /&gt;
&lt;br /&gt;
               $ ssh -N -L 139:192.168.0.81:139 mchirico@65.219.4.23&lt;br /&gt;
&lt;br /&gt;
          STEP 3:&lt;br /&gt;
&lt;br /&gt;
              umount /samba/sales&lt;br /&gt;
              /bin/mount -t smbfs -o  username=donkey,workgroup=donkeydomain,&lt;br /&gt;
                      password=passw0rk1,port=139,dmask=770,fmask=660,&lt;br /&gt;
                      netbiosname=homecpu //localhost/share /samba/share&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 139:&lt;br /&gt;
&lt;br /&gt;
        Music on Fedora Core -- How to play music on http://magnatune.com with &amp;quot;xmms&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           The following command will show the sound driver:&lt;br /&gt;
&lt;br /&gt;
              $ lspci|grep -i audio&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          STEP 1:&lt;br /&gt;
&lt;br /&gt;
                Unmute amixer with the following command:&lt;br /&gt;
&lt;br /&gt;
              $ amixer set Master 100% unmute&lt;br /&gt;
              $ amixer set PCM 100%  unmute&lt;br /&gt;
&lt;br /&gt;
                Note you can also get a graphical interface with &amp;quot;alsamixer&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              $ alsamixer&lt;br /&gt;
&lt;br /&gt;
                 h,F1   -- for help&lt;br /&gt;
                 Esc    -- exit&lt;br /&gt;
                 Tab    -- move to selections&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          STEP 2:&lt;br /&gt;
&lt;br /&gt;
                Test a sound file &amp;quot;*.au&amp;quot; with aplay. To quickly find files on your system use&lt;br /&gt;
                the &amp;quot;locate *.au&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
                  $ aplay /usr/lib/python2.3/test/audiotest.au&lt;br /&gt;
&lt;br /&gt;
          STEP 3:&lt;br /&gt;
&lt;br /&gt;
                Install &amp;quot;xmms-mp3-1.2.10-9.2.1.fc3.rf.i386.rpm&amp;quot; which does not come with Fedora because&lt;br /&gt;
                of GPL license restrictions.  The latest version of this package can be found&lt;br /&gt;
                at the following url:&lt;br /&gt;
&lt;br /&gt;
                  http://rpmseek.com/rpm-pl/xmms-mp3.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                  $ rpm -ivh xmms-mp3-1.2.10-9.2.1.fc3.rf.i386.rpm&lt;br /&gt;
&lt;br /&gt;
          STEP 4:&lt;br /&gt;
&lt;br /&gt;
                Go to magnatun &amp;quot;http://magnatune.com/&amp;quot;, select genre and make sure xmms&lt;br /&gt;
                is the default player.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 140:&lt;br /&gt;
&lt;br /&gt;
        Routing -- getting access to a network 1 hop away. You are currently on the 192 network&lt;br /&gt;
                   and you want access to the 172.21.0.0 network that has a computer straddling&lt;br /&gt;
                   the two, with /proc/sys/net/ipv4/ip_forward set to 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               $ route add -net 172.21.0.0 netmask 255.255.255.0 gw 192.168.0.204&lt;br /&gt;
&lt;br /&gt;
         To undo:&lt;br /&gt;
&lt;br /&gt;
               $ route del -net 172.21.0.0 netmask 255.255.255.0 gw 192.168.0.204&lt;br /&gt;
&lt;br /&gt;
         Now you can ping 172.21.0.21.&lt;br /&gt;
&lt;br /&gt;
         Does not work?&lt;br /&gt;
&lt;br /&gt;
         Go on to 192.168.0.204 and execute the following commands:&lt;br /&gt;
&lt;br /&gt;
               $ echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
               $ cat /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
               1&lt;br /&gt;
&lt;br /&gt;
         To Look at the the gateway, execute the following command.&lt;br /&gt;
&lt;br /&gt;
               $ netstat -r&lt;br /&gt;
&lt;br /&gt;
         References: &lt;br /&gt;
&lt;br /&gt;
               http://lartc.org/lartc.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 141:&lt;br /&gt;
&lt;br /&gt;
        RAM disk -- creating a filesystem in RAM.&lt;br /&gt;
&lt;br /&gt;
               $ mkfs -t ext3 -q /dev/ram1 4096&lt;br /&gt;
               $ mkdir -p /fsram&lt;br /&gt;
               $ mount /dev/ram1 /fsram -o defaults,rw&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 142:&lt;br /&gt;
&lt;br /&gt;
        Create a Live Linux CDROM  using  BusyBox and OpenSSH.&lt;br /&gt;
&lt;br /&gt;
            These steps are rather long. A complete tutorial is given at&lt;br /&gt;
            the following link:&lt;br /&gt;
             http://prdownloads.sourceforge.net/souptonuts/instructions_boot_system.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 143:&lt;br /&gt;
&lt;br /&gt;
      SystemImager (http://www.systemimager.org/) SystemImager is software that automates Linux installs,&lt;br /&gt;
                       software distribution, and production deployment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 144:&lt;br /&gt;
&lt;br /&gt;
      Mounted a filesystem in rescue mode, yet, you cannot read and write?  Remount.&lt;br /&gt;
&lt;br /&gt;
             $ mount -o remount /&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 145:&lt;br /&gt;
&lt;br /&gt;
      Nmap commands to check for Microsoft VPN connection.&lt;br /&gt;
&lt;br /&gt;
         $ nmap -sO -p 47 vpn1.someserver.com&lt;br /&gt;
         $ nmap -sS -p T:1723 vpn1.someserver.com&lt;br /&gt;
&lt;br /&gt;
      By the way, with nmap you can specify multiple ports. Below&lt;br /&gt;
      is an example of multiple ports; but, use the commands above&lt;br /&gt;
      for Microsoft VPN services.&lt;br /&gt;
&lt;br /&gt;
         $ nmap -sS -p T:1723-3000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 146:&lt;br /&gt;
&lt;br /&gt;
      Perl and ssh - monitoring systems. The output from ssh can be parsed. Below is&lt;br /&gt;
      a simple procedure to just to read the ssh ouput into perl.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #&lt;br /&gt;
          $pid = open $readme, &amp;quot;ssh root\@hamlet df -lh|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
          while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
           print $_&lt;br /&gt;
          }&lt;br /&gt;
          close $readme&lt;br /&gt;
&lt;br /&gt;
      But note, you probably want to do something more complex. Below is a more robust&lt;br /&gt;
      example that bypassed all the fortune, heading junk that you may encounter when&lt;br /&gt;
      logging in.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #&lt;br /&gt;
          $pid = open $readme, &amp;quot;ssh root\@hamlet df -lh 2&amp;gt;/dev/null|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
          while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
           print $_&lt;br /&gt;
          }&lt;br /&gt;
          close $readme&lt;br /&gt;
&lt;br /&gt;
      NO! you CANNOT do bidirectional communication with the open statement. Note the &amp;quot;|&amp;quot; before&lt;br /&gt;
      and after below, which cannot be done.&lt;br /&gt;
&lt;br /&gt;
          # Cannot do this!&lt;br /&gt;
          $pid = open $readme, &amp;quot;|ssh root\@hamlet df -lh 2&amp;gt;/dev/null|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
      Below is a simple Perl example working with arrays:&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          @ArrayOfArray = (&lt;br /&gt;
                   [ &amp;quot;ant&amp;quot;, &amp;quot;bee&amp;quot; ],&lt;br /&gt;
                   [ &amp;quot;mouse&amp;quot;, &amp;quot;mole&amp;quot;, &amp;quot;rat&amp;quot; ],&lt;br /&gt;
                   [ &amp;quot;duck&amp;quot;, &amp;quot;goose&amp;quot;, &amp;quot;flamingo&amp;quot; ],&lt;br /&gt;
                   [  &amp;quot;rose&amp;quot;,&amp;quot;carnation&amp;quot;,&amp;quot;sunflower&amp;quot;],&lt;br /&gt;
                  );&lt;br /&gt;
&lt;br /&gt;
          for $i ( 0 .. $#ArrayOfArray ) {&lt;br /&gt;
              for $j ( 0 .. $#{$ArrayOfArray[$i]} ) {&lt;br /&gt;
                  print &amp;quot;Element $i $j is $ArrayOfArray[$i][$j]\n&amp;quot;;&lt;br /&gt;
              }&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          # Or this is another way to list elements&lt;br /&gt;
          foreach( @ArrayOfArray ) {&lt;br /&gt;
             foreach $i (0..$#$_) {&lt;br /&gt;
                print &amp;quot;$_-&amp;gt;[$i] &amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
             print &amp;quot;\n&amp;quot;;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Below is an example of working with Hash of Arrays:&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #  ./program &amp;lt; /etc/passwd&lt;br /&gt;
          while(&amp;lt;&amp;gt;){&lt;br /&gt;
              next unless s/^(.*?):\s*//;&lt;br /&gt;
              $HoA{$1} = [ split(/:/) ];&lt;br /&gt;
          }&lt;br /&gt;
          for $i (keys %HoA ) {&lt;br /&gt;
              print &amp;quot;$i: @{ $HoA{$i} } \n&amp;quot;;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
      Example of regular expression. This is my most used regular expression - I like&lt;br /&gt;
      this sample. See the &amp;quot;www.unix.org.ua&amp;quot; link at the end of this tip.&lt;br /&gt;
&lt;br /&gt;
          &amp;quot;hot cross buns&amp;quot; =~ /cross/;&lt;br /&gt;
          print &amp;quot;Matched: &amp;lt;$`&amp;gt; $&amp;amp; &amp;lt;$'&amp;gt;\n&amp;quot;;    # Matched: &amp;lt;hot &amp;gt; cross &amp;lt; buns&amp;gt;&lt;br /&gt;
          print &amp;quot;Left:    &amp;lt;$`&amp;gt;\n&amp;quot;;            # Left:    &amp;lt;hot &amp;gt;&lt;br /&gt;
          print &amp;quot;Match:   &amp;lt;$&amp;amp;&amp;gt;\n&amp;quot;;            # Match:   &amp;lt;cross&amp;gt;&lt;br /&gt;
          print &amp;quot;Right:   &amp;lt;$'&amp;gt;\n&amp;quot;;            # Right:   &amp;lt; buns&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      If you're looking for Perl information, type &amp;quot;man perl&amp;quot;, which will show you how&lt;br /&gt;
      to get even more information. Or better yet, take a look at the following&lt;br /&gt;
      link:&lt;br /&gt;
&lt;br /&gt;
          http://www.unix.org.ua/orelly/perl/prog3/ch09_01.htm&lt;br /&gt;
               also&lt;br /&gt;
          http://www.stonehenge.com/merlyn/UnixReview/&lt;br /&gt;
&lt;br /&gt;
      For a quick example on using Perl with SQLite, see the following links:&lt;br /&gt;
&lt;br /&gt;
          http://prdownloads.sourceforge.net/souptonuts/README_sqlite_tutorial.html?download&lt;br /&gt;
            or&lt;br /&gt;
          http://freshmeat.net/articles/view/1428/&lt;br /&gt;
            or&lt;br /&gt;
          http://www.perl.com/pub/a/1999/09/refererents.html&lt;br /&gt;
&lt;br /&gt;
      Standard input for files. This example will read from stdin, or open a file if given as&lt;br /&gt;
      an argument, and convert all &amp;quot;&amp;lt;&amp;quot; to &amp;quot;&amp;amp;lt;&amp;quot; and &amp;quot;&amp;gt;&amp;quot; to &amp;quot;&amp;amp;gt;&amp;quot;, which can be handy when&lt;br /&gt;
      converting text files to html files. Note the &amp;quot;while(&amp;lt;&amp;gt;)&amp;quot; will take multiple file names&lt;br /&gt;
      on the command line.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          while(&amp;lt;&amp;gt;) {&lt;br /&gt;
             s/&amp;amp;amp;/&amp;amp;amp;amp;/g;&lt;br /&gt;
             s/&amp;amp;lt;/&amp;amp;amp;lt;/g;&lt;br /&gt;
             s/&amp;amp;gt;/&amp;amp;amp;gt;/g;&lt;br /&gt;
             s/&amp;lt;/&amp;amp;lt;/g;&lt;br /&gt;
             s/&amp;gt;/&amp;amp;gt;/g;&lt;br /&gt;
             print;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
      Perl Debugger is very useful for testing commands and works like an interpreter, just&lt;br /&gt;
      like python. So to get into the Perl Debugger execute the command below, &amp;quot;q&amp;quot; to quit.&lt;br /&gt;
&lt;br /&gt;
          $ perl -de 0&lt;br /&gt;
&lt;br /&gt;
      Reference TIP 170&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 147:&lt;br /&gt;
&lt;br /&gt;
      Shutdown&lt;br /&gt;
&lt;br /&gt;
          # shutdown 8:00 -- Shutdown at 8:00&lt;br /&gt;
&lt;br /&gt;
          # shutdown +13  -- Shutdown after 13min&lt;br /&gt;
&lt;br /&gt;
          # shutdown -r now  -- Shutdown now and restart&lt;br /&gt;
&lt;br /&gt;
          # shutdown -k +2  -- &amp;quot;The system is going DOWN to maintenance mode in 2 minutes!&amp;quot;&lt;br /&gt;
                              The above is only a warning.&lt;br /&gt;
&lt;br /&gt;
          # shutdown -h now   -- Shutdown now and halt&lt;br /&gt;
&lt;br /&gt;
          # shutdown -c    -- Cancel shutdown&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 148:&lt;br /&gt;
&lt;br /&gt;
      ac -  print statistics about users connect time&lt;br /&gt;
&lt;br /&gt;
          $ ac -p    -- print hour usage by user (individual)&lt;br /&gt;
          $ ac -dy   -- print daily usage&lt;br /&gt;
&lt;br /&gt;
       Options can also be combined&lt;br /&gt;
&lt;br /&gt;
          $ ac -dyp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 149:&lt;br /&gt;
&lt;br /&gt;
      Smart Monitoring Tools:&lt;br /&gt;
      Disk failing? Or want to know the temperature of your hard-drive?&lt;br /&gt;
&lt;br /&gt;
         http://smartmontools.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
      For a good, quick tutorial, see the Linux Journal article&lt;br /&gt;
        http://www.linuxjournal.com/article/6983&lt;br /&gt;
&lt;br /&gt;
      Below are some common commands:&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -i /dev/hda&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -Hc /dev/hda&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -A /dev/hda&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 150:&lt;br /&gt;
&lt;br /&gt;
      Monitor dhcp trafic - dhcpdump and tcpdump.&lt;br /&gt;
&lt;br /&gt;
      Download dhcpdump&lt;br /&gt;
&lt;br /&gt;
         $ wget  http://voxel.dl.sourceforge.net/sourceforge/mavetju/dhcpdump-1.5.tar.gz&lt;br /&gt;
         $ ./configure&lt;br /&gt;
         $ make &amp;amp;&amp;amp; make install&lt;br /&gt;
&lt;br /&gt;
     Once it's installed, you can monitor all dhcp traffic as follows, if done with root.&lt;br /&gt;
&lt;br /&gt;
         $ tcpdump -lenx -i eth0 -s 1500 port bootps or port bootpc| dhcpdump&lt;br /&gt;
&lt;br /&gt;
     The above assumes you are using eth0 (ethernet port 0).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 151:&lt;br /&gt;
&lt;br /&gt;
      Breaking Firewalls with ssh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      A sample .ssh/config file (note this must have chmod 600 rights)&lt;br /&gt;
&lt;br /&gt;
           ## Server1 ##&lt;br /&gt;
           Host 130.21.19.227&lt;br /&gt;
               LocalForward 20000 192.168.0.66:80&lt;br /&gt;
               LocalForward 22000 192.168.0.66:22&lt;br /&gt;
&lt;br /&gt;
      With the above &amp;quot;~/.ssh/config&amp;quot; file, after sshing into 130.21.19.227 it&lt;br /&gt;
      is then possible to ssh into nearby computers directly.&lt;br /&gt;
&lt;br /&gt;
         $ ssh -l mchirico 130.21.19.227&lt;br /&gt;
         $ scp -P 22000 authorized_keys* mchirico@localhost:.&lt;br /&gt;
         $ ssh -l mchirico localhost -p 22000&lt;br /&gt;
&lt;br /&gt;
      For the complete article reference the following link:&lt;br /&gt;
        http://souptonuts.sourceforge.net/sshtips.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 152:&lt;br /&gt;
&lt;br /&gt;
      Renaming files - suppose you want to rename all the &amp;quot;.htm&amp;quot; files to &amp;quot;.html&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          $ rename .htm .html *.htm&lt;br /&gt;
&lt;br /&gt;
      Or, suppose you files file1, file2, file3 ...&lt;br /&gt;
&lt;br /&gt;
          $ touch file1 file2 file3 file4 file5 file6&lt;br /&gt;
          $ rename file file. file*&lt;br /&gt;
&lt;br /&gt;
      The above command will give you &amp;quot;file.1&amp;quot;, &amp;quot;file.2&amp;quot; ... &amp;quot;file.6&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 153:&lt;br /&gt;
&lt;br /&gt;
      Renaming files with Perl - this is taken from &amp;quot;Programming Perl 3rd Edition&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          # rename - change filenames&lt;br /&gt;
          $op = shift;&lt;br /&gt;
          for (@ARGV) {&lt;br /&gt;
              $was = $_;&lt;br /&gt;
              eval $op;&lt;br /&gt;
              die if $@;&lt;br /&gt;
              # next line calls built-in function, not the script&lt;br /&gt;
              rename($was,$_) unless $was eq $_;&lt;br /&gt;
           }&lt;br /&gt;
&lt;br /&gt;
      The above Perl program can be used as follows:&lt;br /&gt;
&lt;br /&gt;
           $ rename 's/\.orig$//'    *.orig&lt;br /&gt;
           $ rename 'y/A-Z/a-z/ unless /^Make/' *&lt;br /&gt;
&lt;br /&gt;
      Also reference:&lt;br /&gt;
           http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 154:&lt;br /&gt;
&lt;br /&gt;
      R project (http://www.r-project.org)&lt;br /&gt;
&lt;br /&gt;
      To start R, just type &amp;quot;R&amp;quot; at the command prompt and &amp;quot;q()&amp;quot; to quit. Below&lt;br /&gt;
      2 is raised to powers 0 through 6 and thrown into an array.&lt;br /&gt;
&lt;br /&gt;
           $ R&lt;br /&gt;
           &amp;gt; N &amp;lt;- 2^(0:6)&lt;br /&gt;
           &amp;gt; N&lt;br /&gt;
           [1]  1  2  4  8 16 32 64&lt;br /&gt;
           &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      There is a summary summary() command.&lt;br /&gt;
&lt;br /&gt;
           &amp;gt; summary(N)&lt;br /&gt;
           Min. 1st Qu.  Median    Mean 3rd Qu.    Max.&lt;br /&gt;
           1.00    3.00    8.00   18.14   24.00   64.00&lt;br /&gt;
&lt;br /&gt;
      Note that the array begins as 1 and not 0&lt;br /&gt;
&lt;br /&gt;
           &amp;gt; N[1:3]&lt;br /&gt;
           [1] 1 2 4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 155:&lt;br /&gt;
&lt;br /&gt;
      ls - listing files by size, with the biggest file listed last&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           $ ls --sort=size -lhr&lt;br /&gt;
&lt;br /&gt;
      The above command sorts files by size, listing the contents in&lt;br /&gt;
      &amp;quot;h&amp;quot; human readable format in reverse order.&lt;br /&gt;
&lt;br /&gt;
      Note the options:  --sort={none,time,size,extension}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 156:&lt;br /&gt;
&lt;br /&gt;
     Perl - program to clean up old versions of files&lt;br /&gt;
&lt;br /&gt;
       #!/usr/bin/perl&lt;br /&gt;
       #   Copyright (c) GPL 2005 Mike Chirico&lt;br /&gt;
       # This program deletes old files from several directories&lt;br /&gt;
       # and within each directory there must be x number of copies&lt;br /&gt;
       # each y number of bytes&lt;br /&gt;
       #&lt;br /&gt;
&lt;br /&gt;
       sub delete_old_ones {&lt;br /&gt;
           $directory_and_file=$_[0];&lt;br /&gt;
           $save_count=$_[1];&lt;br /&gt;
           $bytes_in_file=$_[2];&lt;br /&gt;
         # Don't change setting here of '-lt'&lt;br /&gt;
           $pid = open $readme, &amp;quot;ls -lt $directory_and_file|&amp;quot; or die &amp;quot;Could not execute\n&amp;quot;;&lt;br /&gt;
           while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
               my @fields = split;&lt;br /&gt;
              # Make sure we have $save_count good ones with data&lt;br /&gt;
               if ($fields[4] &amp;gt; $bytes_in_file &amp;amp;&amp;amp; $save_count &amp;gt; 0) {&lt;br /&gt;
                   $save_count--;&lt;br /&gt;
                   print &amp;quot;Kept files: $fields[4] $fields[8]\n&amp;quot;;&lt;br /&gt;
               }&lt;br /&gt;
              # delete the old ones&lt;br /&gt;
              if ($save_count &amp;lt;= 0 )&lt;br /&gt;
              {&lt;br /&gt;
                  print &amp;quot;Deleted files: $fields[4] $fields[8]\n&amp;quot;;&lt;br /&gt;
                  unlink $fields[8];&lt;br /&gt;
              }&lt;br /&gt;
           }&lt;br /&gt;
           close $readme;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       @AofA = (&lt;br /&gt;
          [ &amp;quot;/home/cvs/backups/*.gz&amp;quot;, &amp;quot;6&amp;quot;,196621 ],&lt;br /&gt;
          [ &amp;quot;/home/mail/backups/*.gz&amp;quot;,&amp;quot;5&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/snort/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/server1/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/actserver/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/server2/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
                );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       foreach( @AofA ) {&lt;br /&gt;
           &amp;amp;delete_old_ones($_-&amp;gt;[0],$_-&amp;gt;[1],$_-&amp;gt;[2]);&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
     Reference TIP 170 and the following link:&lt;br /&gt;
       http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 157:&lt;br /&gt;
&lt;br /&gt;
     Graphics and Visualization Software that runs on Linux&lt;br /&gt;
        http://www.tldp.org/HOWTO/Scientific-Computing-with-GNU-Linux/graphvis.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 158:&lt;br /&gt;
&lt;br /&gt;
     Keeping files in sync going both ways. Unlike rsync, this is not a one way mirror&lt;br /&gt;
     option.&lt;br /&gt;
&lt;br /&gt;
     You will need ocaml installed first.&lt;br /&gt;
&lt;br /&gt;
       $ wget http://caml.inria.fr/pub/distrib/ocaml-3.08/ocaml-3.08.3.tar.gz&lt;br /&gt;
       $ tar -xzf ocaml-3.08.3.tar.gz&lt;br /&gt;
       $ cd ocaml-3.08.3&lt;br /&gt;
&lt;br /&gt;
       $ ./configure&lt;br /&gt;
       $ make world&lt;br /&gt;
       $ make opt&lt;br /&gt;
       $ make install&lt;br /&gt;
&lt;br /&gt;
     Next, get unison and put it in a different directory.&lt;br /&gt;
     [http://www.cis.upenn.edu/~bcpierce/unison/]&lt;br /&gt;
&lt;br /&gt;
       $ wget http://www.cis.upenn.edu/~bcpierce/unison/download/stable/latest/unison-2.10.2.tar.gz&lt;br /&gt;
       $ tar -xzf unison-2.10.2.tar.gz&lt;br /&gt;
       $ cd unison-2.10.2&lt;br /&gt;
       $ make UISTYLE=text&lt;br /&gt;
       $ su&lt;br /&gt;
       # cp unison /usr/local/bin/.&lt;br /&gt;
&lt;br /&gt;
     Note, you have to copy the file manually.&lt;br /&gt;
&lt;br /&gt;
     See the following article [http://www.linuxjournal.com/article/7712]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 159:&lt;br /&gt;
&lt;br /&gt;
     Dump ext2/ext3 filesystem information with &amp;quot;dumpe2fs&amp;quot;. Perform the mount command&lt;br /&gt;
     and query away.&lt;br /&gt;
&lt;br /&gt;
       $ dumpe2fs /dev/sda1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 160:&lt;br /&gt;
&lt;br /&gt;
     sysreport - a script that generates an HTML report on the system configuration. It&lt;br /&gt;
     gathers information about the hardware and is somewhat redhat specific. The utility&lt;br /&gt;
     should be run as root.&lt;br /&gt;
&lt;br /&gt;
       $ /usr/sbin/sysreport&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 161:&lt;br /&gt;
&lt;br /&gt;
     Key Bindings Using bind.  You can bind, say, ctl-t to a command.&lt;br /&gt;
&lt;br /&gt;
     Add the following to you &amp;quot;~/.inputrc&amp;quot; file, just as it is typed below with quotes.&lt;br /&gt;
&lt;br /&gt;
           &amp;quot;\C-t&amp;quot;: ls -l&lt;br /&gt;
&lt;br /&gt;
     Next, run the command&lt;br /&gt;
&lt;br /&gt;
           $ bind -f .inputrc&lt;br /&gt;
&lt;br /&gt;
     Or, you can do everything on the command line; however, it won't be there the next time&lt;br /&gt;
     you log in. Below is the way to do everything on the command line.&lt;br /&gt;
&lt;br /&gt;
           $ bind -x '&amp;quot;\C-t&amp;quot;:ls -l'&lt;br /&gt;
&lt;br /&gt;
     To unbind use the &amp;quot;-r&amp;quot; option. Single quotes are not needed.&lt;br /&gt;
&lt;br /&gt;
           $ bind -r &amp;quot;\C-t&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Getting a list of all bindings can be done as follows, and not this can be redirected&lt;br /&gt;
     to the &amp;quot;.inputrc&amp;quot; file for further editing.&lt;br /&gt;
&lt;br /&gt;
           $ bind -p &amp;gt; .inputrc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 162:&lt;br /&gt;
&lt;br /&gt;
     awk - common awk commands.&lt;br /&gt;
&lt;br /&gt;
     Find device names &amp;quot;sd&amp;quot; or with major number 4 and device name &amp;quot;tty&amp;quot;. Print the&lt;br /&gt;
     record number NR, plus the major number and minor number.&lt;br /&gt;
&lt;br /&gt;
          $ awk '$2 == &amp;quot;sd&amp;quot;||$1 == 4 &amp;amp;&amp;amp; $2 == &amp;quot;tty&amp;quot; { print NR,$1,$2}' /proc/devices&lt;br /&gt;
&lt;br /&gt;
     Find device name equal to &amp;quot;sound&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ awk '/sound/{print NR,$1,$2}' /proc/devices&lt;br /&gt;
&lt;br /&gt;
     Print the 5th record, first field, in file test&lt;br /&gt;
&lt;br /&gt;
          $ awk 'NR==5{print $1}' test&lt;br /&gt;
&lt;br /&gt;
     Print a record, skip 4 records, print a record etc from file1&lt;br /&gt;
&lt;br /&gt;
          $ awk '(NR-1) % 4 == 0 {print $1}' file1&lt;br /&gt;
&lt;br /&gt;
     Print all records except the last one from file1&lt;br /&gt;
&lt;br /&gt;
          $ tac file1|awk 'NR &amp;gt; 1 {print $0}'|tac&lt;br /&gt;
&lt;br /&gt;
     Print A,B,C ..Z on each line, cycling back to A if greater than 26 lines&lt;br /&gt;
&lt;br /&gt;
          $ awk '{ print substr(&amp;quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&amp;quot;,(NR-1)%26+1,1),$0}' file1&lt;br /&gt;
&lt;br /&gt;
     Number of bytes in a directory.&lt;br /&gt;
&lt;br /&gt;
          $ ls -l|awk 'BEGIN{ c=0}{ c+=$5} END{ print c}'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 163:&lt;br /&gt;
&lt;br /&gt;
     Configuring Remote Logging.  If you have several servers on 192.168.1.0, you can setup remote logging&lt;br /&gt;
     as follows.&lt;br /&gt;
&lt;br /&gt;
     MAIN LOG SERVER (192.168.1.81):&lt;br /&gt;
&lt;br /&gt;
        Firewall - allow UDP port 514 on the main server that will receive the logs.&lt;br /&gt;
&lt;br /&gt;
          $ iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 514 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        Edit &amp;quot;/etc/sysconfig/syslog&amp;quot; and add the &amp;quot;-r&amp;quot; option to SYSLOGD_OPTIONS as shown below.&lt;br /&gt;
&lt;br /&gt;
          SYSLOGD_OPTIONS=&amp;quot;-r -m -0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Note, the &amp;quot;-r&amp;quot; is to allow remote logging and  &amp;quot;-m 0&amp;quot; specifies that that the syslog process should&lt;br /&gt;
        not write regular timestamps.  I prefer to only write timestamps for the clients.&lt;br /&gt;
&lt;br /&gt;
        Next, restart the logging process&lt;br /&gt;
&lt;br /&gt;
          $ service syslog restart&lt;br /&gt;
&lt;br /&gt;
     CLIENT LOG SERVER:&lt;br /&gt;
&lt;br /&gt;
        Edit &amp;quot;/etc/syslog.conf&amp;quot; and add the ip address of the log server, or put in the hostname.&lt;br /&gt;
&lt;br /&gt;
            *.* @192.168.1.81&lt;br /&gt;
&lt;br /&gt;
        Next, restart the logging process&lt;br /&gt;
&lt;br /&gt;
          $ service syslog restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 164:&lt;br /&gt;
&lt;br /&gt;
     kudzu - hardware on your system. To probe the hardware on your system without doing&lt;br /&gt;
             anything, issue the following command.&lt;br /&gt;
&lt;br /&gt;
          $ kudzu -p&lt;br /&gt;
&lt;br /&gt;
      But wait, a lot of this information is already recorded in the following file&lt;br /&gt;
&lt;br /&gt;
            /etc/sysconfig/hwconf&lt;br /&gt;
&lt;br /&gt;
      You can also use lspci to list all PCI devices.&lt;br /&gt;
&lt;br /&gt;
          $ lspci&lt;br /&gt;
&lt;br /&gt;
      Also, take a look at the script /etc/sbin/sysreport, since this script has a lot of&lt;br /&gt;
      info gathering commands. You can pick and choose what you want, or run the complete&lt;br /&gt;
      report.&lt;br /&gt;
&lt;br /&gt;
      If you just want information on the NIC&lt;br /&gt;
&lt;br /&gt;
          $ ip link show eth0&lt;br /&gt;
          2: eth0: &amp;lt;BROADCAST,MULTICAST,UP&amp;gt; mtu 1500 qdisc pfifo_fast qlen 1000&lt;br /&gt;
          link/ether 00:11:11:8a:be:3f brd ff:ff:ff:ff:ff:ff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 165:&lt;br /&gt;
&lt;br /&gt;
     cfengine - a very power agent for monitoring and administrating both a single computer&lt;br /&gt;
              and or multiple computers. [ http://www.cfengine.org/ ]&lt;br /&gt;
&lt;br /&gt;
     The following is a quick example on downloading and installing cfengine.&lt;br /&gt;
&lt;br /&gt;
          $ ncftpget ftp://ftp.iu.hio.no/pub/cfengine/cfengine-2.1.15.tar.gz&lt;br /&gt;
          $ md5sum cfengine-2.1.15.tar.gz&lt;br /&gt;
          f03de82709f84c3d6d916b6e557321f9  cfengine-2.1.15.tar.gz&lt;br /&gt;
&lt;br /&gt;
          $ tar -xzf cfengine-2.1.15.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You need to have a current version of BerkeleyDB (http://downloads.sleepycat.com/db-4.3.28.tar.gz).&lt;br /&gt;
     Note that BerkeleyDB has a funny install. You cd to the &amp;quot;build_unix&amp;quot; directory, then,&lt;br /&gt;
&lt;br /&gt;
          Installing BerkeleyDB if needed:&lt;br /&gt;
                 $ wget http://downloads.sleepycat.com/db-4.3.28.tar.gz&lt;br /&gt;
                 $ tar -xzf db-4.3.28.tar.gz&lt;br /&gt;
                 $ cd db-4.3.28/build_unix/&lt;br /&gt;
                 $ ../dist/configure&lt;br /&gt;
                 make&lt;br /&gt;
                 make install&lt;br /&gt;
&lt;br /&gt;
     You also need a current version of OpenSSL. For instructions on how to install OpenSSL see&lt;br /&gt;
     (http://souptonuts.sourceforge.net/postfix_tutorial.html).&lt;br /&gt;
&lt;br /&gt;
     See (TIP 49) on putting &amp;quot;/usr/local/BerkeleyDB.4.3/lib&amp;quot; in the &amp;quot;/etc/ld.so.conf&amp;quot; file. Or&lt;br /&gt;
     once BerkeleyDB is installed, you can put the location on the command line as follows:&lt;br /&gt;
&lt;br /&gt;
     Configuring cfengine with direct reference to BerkeleyDB.4.3.  First cd to the cfengine source.&lt;br /&gt;
&lt;br /&gt;
          $ ./configure --with-berkeleydb=/usr/local/BerkeleyDB.4.3/lib&lt;br /&gt;
          $ make&lt;br /&gt;
          $ make install&lt;br /&gt;
&lt;br /&gt;
     Next create the following directories:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /var/cfengine/bin&lt;br /&gt;
          $ mkdir -p /var/cfengine/inputs&lt;br /&gt;
&lt;br /&gt;
     Copy needed files (cfagent, cfdoc, cfenvd, cfenvgraph, cfexecd, cfkey, cfrun, cfservd, cfshow):&lt;br /&gt;
&lt;br /&gt;
          $ cp /usr/local/sbin/cf* /var/cfengine/bin&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You'll also need to generate keys. As root, execute the following:&lt;br /&gt;
&lt;br /&gt;
          $ cfkey&lt;br /&gt;
&lt;br /&gt;
     The command above will write the public and private keys in&lt;br /&gt;
     &amp;quot;/var/cfengine/ppkeys&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You probably want (cfexecd, cfservd, and cfenvd) running on all servers. If you&lt;br /&gt;
     add the following to &amp;quot;/etc/rc.local&amp;quot; these daemons will start on reboot.&lt;br /&gt;
&lt;br /&gt;
           # Lines in /etc/rc.local&lt;br /&gt;
           /usr/local/sbin/cfexecd&lt;br /&gt;
           /usr/local/sbin/cfservd&lt;br /&gt;
           /usr/local/sbin/cfenvd&lt;br /&gt;
&lt;br /&gt;
     Also, make sure you run each command now as follows:&lt;br /&gt;
&lt;br /&gt;
          $ /usr/local/sbin/cfexecd&lt;br /&gt;
          $ /usr/local/sbin/cfservd&lt;br /&gt;
          $ /usr/local/sbin/cfenvd&lt;br /&gt;
&lt;br /&gt;
     Firewall settings must be adjusted to allows 5308 for tcp/udp. My local network&lt;br /&gt;
     is 192.168.1.0, so I'm opening it up for all my computers.&lt;br /&gt;
&lt;br /&gt;
          $ iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 5308 -j ACCEPT&lt;br /&gt;
          $ iptables -A INPUT -p tcp -s 192.168.1.0/24  --dport 5308 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
     A set of keys needs to be on the server and hosts. For example, my key on &amp;quot;tape.squeezel.com&amp;quot;&lt;br /&gt;
     should be copied over to the server &amp;quot;squeezel.squeezel.com&amp;quot; as follows:&lt;br /&gt;
&lt;br /&gt;
     This is done from tape.squeezel.com&lt;br /&gt;
&lt;br /&gt;
          $ scp /var/cfengine/ppkeys/localhost.pub  root@squeezel.squeezel.com:/var/cfengine/ppkeys/root-tape.squeezel.com.pub&lt;br /&gt;
          $ scp root@squeezel.squeezel.com:/var/cfengine/ppkeys/localhost.pub /var/cfengine/ppkeys/root-squeezel.squeezel.com.pub&lt;br /&gt;
&lt;br /&gt;
     Also, &amp;quot;/var/cfengine/inputs/cfrun.hosts&amp;quot; on the server &amp;quot;squeezel.squeezel.com&amp;quot; must contain&lt;br /&gt;
     all the computers that will get updated. This is &amp;quot;cfrun.hosts&amp;quot; on &amp;quot;squeezel.squeezel.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          closet.squeezel.com&lt;br /&gt;
          tape.squeezel.com&lt;br /&gt;
&lt;br /&gt;
     Once I'm done, from &amp;quot;tape.squeezel.com&amp;quot; I can run the following test:&lt;br /&gt;
&lt;br /&gt;
          $ cfrun squeezel.squeezel.com -v&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 166:&lt;br /&gt;
&lt;br /&gt;
     cfengine - a quick example. This example will be run as root. You create the file &amp;quot;cfagent.conf&amp;quot; in&lt;br /&gt;
     &amp;quot;/var/cfengine/inputs/&amp;quot;. The example below will checksum all the files in /home/chirico/deleteme/tripwire,&lt;br /&gt;
     it will also comment out the line &amp;quot;finger&amp;quot; in any file located in /tmp/testdir/stuff, also appending&lt;br /&gt;
     the command in this file &amp;quot; Edit change with cfengine&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          # /var/cfengine/inputs/cfagent.conf&lt;br /&gt;
          #&lt;br /&gt;
          # You run this with the following:&lt;br /&gt;
          #   cfagent -vK&lt;br /&gt;
        &lt;br /&gt;
          control:&lt;br /&gt;
                 actionsequence = ( files tidy editfiles )&lt;br /&gt;
                 ChecksumDatabase = ( /var/cfengine/cache.db )&lt;br /&gt;
                 # Below, true to update md5&lt;br /&gt;
                 ChecksumUpdates = ( true )&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
          files:&lt;br /&gt;
                 /home/chirico/deleteme/tripwire checksum=md5 recurse=inf&lt;br /&gt;
                 /home/chirico/deleteme/tripwire/moredata checksum=md5 recurse=inf&lt;br /&gt;
                 #/home/chirico/deleteme/tripwire/compress  recurse=inf include=*.txt acti on=compress&lt;br /&gt;
                   # If the database isn't secure, nothing is secure...&lt;br /&gt;
                 /var/cfengine/cache.db  mode=600 owner=root action=fixall&lt;br /&gt;
        &lt;br /&gt;
          tidy:&lt;br /&gt;
                 /home/chirico/deleteme/tripwire pattern=*~ recurse=inf age=0&lt;br /&gt;
                 # You must put an age. 0 runs now.&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
          editfiles:&lt;br /&gt;
        &lt;br /&gt;
                {  /tmp/testdir/stuff&lt;br /&gt;
&lt;br /&gt;
                   HashCommentLinesContaining &amp;quot;finger&amp;quot;&lt;br /&gt;
                   AppendIfNoSuchLine &amp;quot;# Edit Change with cfengine &amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     A few further notes on the above. The command &amp;quot;actionsequence = ( files tidy editfiles) tells the order&lt;br /&gt;
     of what to execute. The heading &amp;quot;tidy:&amp;quot; deletes files, and of course, &amp;quot;editfiles&amp;quot; does the editing of files.&lt;br /&gt;
&lt;br /&gt;
     To run the example, execute the following command. The  &amp;quot;-K&amp;quot; causes the lock file to be ignored.&lt;br /&gt;
&lt;br /&gt;
            $ cfagent -vK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 167:&lt;br /&gt;
&lt;br /&gt;
     Implementing Disk Quotas - a quick example that can easily be done on a live system for testing. There&lt;br /&gt;
     is no need to reboot, since you'll be creating a virtual filesystem.&lt;br /&gt;
&lt;br /&gt;
     Do the following as root. First create a mount point.&lt;br /&gt;
&lt;br /&gt;
            # mkdir -p /quota&lt;br /&gt;
&lt;br /&gt;
     Next, create 20M file. Since I have many of these files, I created a special directory &amp;quot;/usr/disk-img&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            # mkdir -p /usr/disk-img&lt;br /&gt;
            # dd if=/dev/zero of=/usr/disk-img/disk-quota.ext3 count=40960&lt;br /&gt;
&lt;br /&gt;
     The dd command above create a 20 MB file because, by default, dd uses a block size of 512 bytes. That makes&lt;br /&gt;
     the size: 40960*512=20971520.&lt;br /&gt;
&lt;br /&gt;
     Next, format this as an ext3 filesystem&lt;br /&gt;
&lt;br /&gt;
            # /sbin/mkfs -t ext3 -q /usr/disk-img/disk-quota.ext3 -F&lt;br /&gt;
&lt;br /&gt;
     Add the following line to &amp;quot;/etc/fstab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            /usr/disk-img/disk-quota.ext3    /quota ext3    rw,loop,usrquota,grpquota  0 0&lt;br /&gt;
&lt;br /&gt;
     Now, mount this filesystem&lt;br /&gt;
&lt;br /&gt;
            # mount /quota&lt;br /&gt;
&lt;br /&gt;
     Take a look at it:&lt;br /&gt;
&lt;br /&gt;
            # ls -l /quota&lt;br /&gt;
            lost+found&lt;br /&gt;
&lt;br /&gt;
     Now, run &amp;quot;quotacheck&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            # quotacheck -vug /quota&lt;br /&gt;
&lt;br /&gt;
     You'll get errors the first time this is run, because you have no quota files.&lt;br /&gt;
     But, run it a second time and you'll see something similiar to the following:&lt;br /&gt;
&lt;br /&gt;
            # quotacheck -vug /quota&lt;br /&gt;
            quotacheck: Scanning /dev/loop2 [/quota] done&lt;br /&gt;
            quotacheck: Checked 3 directories and 4 files&lt;br /&gt;
&lt;br /&gt;
     Now take a look at the files:&lt;br /&gt;
&lt;br /&gt;
            # ls -l /quota&lt;br /&gt;
            total 26&lt;br /&gt;
            -rw-------  1 root root  6144 Jun 14 12:23 aquota.group&lt;br /&gt;
            -rw-------  1 root root  6144 Jun 14 12:23 aquota.user&lt;br /&gt;
            drwx------  2 root root 12288 Jun 14 12:18 lost+found&lt;br /&gt;
&lt;br /&gt;
     Next use &amp;quot;edquota&amp;quot; to grant the user &amp;quot;chirico&amp;quot; a certain quota&lt;br /&gt;
&lt;br /&gt;
            # edquota -f /quota chirico&lt;br /&gt;
&lt;br /&gt;
     This will bring up a menu, and here I have edited so that user &amp;quot;chirico&amp;quot;&lt;br /&gt;
     has a soft limit of 120*512=61K, and a soft limit of 2 inodes and a hard limit of 5.&lt;br /&gt;
&lt;br /&gt;
             Disk quotas for user chirico (uid 500):&lt;br /&gt;
             Filesystem                   blocks       soft       hard     inodes     soft     hard&lt;br /&gt;
             /dev/loop2                        2        120        150         1        2         3&lt;br /&gt;
&lt;br /&gt;
     Next, turn quotas on with the following command:&lt;br /&gt;
&lt;br /&gt;
             $ quotaon /quota&lt;br /&gt;
&lt;br /&gt;
     If you need to turn off quotas, the command is &amp;quot;quotaoff -a&amp;quot; for all filesystems. You'll run into&lt;br /&gt;
     errors if you try to run quotacheck, say &amp;quot;quotacheck -avug&amp;quot; because this tries to unmount and mount&lt;br /&gt;
     the filesystem. You need to turn off quotas first &amp;quot;quotaoff /quota&amp;quot;. Note you only need to run&lt;br /&gt;
     quotacheck once, or when doing maintenance after a system crash.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      To get a report on the quote, runn &amp;quot;repquota&amp;quot; as follows:&lt;br /&gt;
&lt;br /&gt;
           $ repquota /quota&lt;br /&gt;
            *** Report for user quotas on device /dev/loop0&lt;br /&gt;
            Block grace time: 7days; Inode grace time: 7days&lt;br /&gt;
                                    Block limits                File limits&lt;br /&gt;
            User            used    soft    hard  grace    used  soft  hard  grace&lt;br /&gt;
            ----------------------------------------------------------------------&lt;br /&gt;
            root      --    1189       0       0              2     0     0&lt;br /&gt;
            chirico   -+      93       0       0              4     2     5  6days&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Note above that user &amp;quot;chirico&amp;quot; has used 4 on the file limits. This user has a hard&lt;br /&gt;
      limit of 5. So when this user tries to create 2 more files (bring this over the limit of 5)&lt;br /&gt;
      then he will get the following error as demonstrated below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           [chirico@squeezel chirico]$ touch one&lt;br /&gt;
           [chirico@squeezel chirico]$ touch two&lt;br /&gt;
           loop0: write failed, user file limit reached.&lt;br /&gt;
           touch: cannot touch `two': Disk quota exceeded&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Now, if repquota (run by root) is executed it shows the following:&lt;br /&gt;
&lt;br /&gt;
           $ repquota /quota&lt;br /&gt;
           *** Report for user quotas on device /dev/loop0&lt;br /&gt;
           Block grace time: 7days; Inode grace time: 7days&lt;br /&gt;
                                   Block limits                File limits&lt;br /&gt;
           User            used    soft    hard  grace    used  soft  hard  grace&lt;br /&gt;
           ----------------------------------------------------------------------&lt;br /&gt;
           root      --    1189       0       0              2     0     0&lt;br /&gt;
           chirico   -+      94       0       0              5     2     5  6days&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Note the &amp;quot;+&amp;quot; sign above. User &amp;quot;chirico&amp;quot; is above the File soft limits, and in this case&lt;br /&gt;
      above the hard limits.&lt;br /&gt;
&lt;br /&gt;
      To warn user by sending email to them, run &amp;quot;warnquota&amp;quot;, but you need check that&lt;br /&gt;
      &amp;quot;/etc/warnquota.conf&amp;quot; is setup correctly. For the example above, this file should&lt;br /&gt;
      look as follows:&lt;br /&gt;
&lt;br /&gt;
            $ cat /etc/quotatab&lt;br /&gt;
            #&lt;br /&gt;
            #  This is sample quotatab (/etc/quotatab)&lt;br /&gt;
            #  Here you can specify description of each device for user&lt;br /&gt;
            #&lt;br /&gt;
            #  Comments begin with hash in the beginning of the line&lt;br /&gt;
&lt;br /&gt;
            # Example of description&lt;br /&gt;
            /dev/loop0: This is loopback device&lt;br /&gt;
&lt;br /&gt;
      Just run the following as root:&lt;br /&gt;
&lt;br /&gt;
            $ warnquota&lt;br /&gt;
&lt;br /&gt;
      By the way, if you want to change the grace period, it can only be done on a filesystem&lt;br /&gt;
      basis. Not per user.&lt;br /&gt;
&lt;br /&gt;
            $  edquota -t&lt;br /&gt;
&lt;br /&gt;
      Users can run &amp;quot;quota&amp;quot; to see their usage as follows:&lt;br /&gt;
&lt;br /&gt;
            [chirico@squeezel ~]$ quota&lt;br /&gt;
            Disk quotas for user chirico (uid 500):&lt;br /&gt;
                 Filesystem  blocks   quota   limit   grace   files   quota   limit   grace&lt;br /&gt;
                 /dev/loop0      94       0       0               5      10      50&lt;br /&gt;
&lt;br /&gt;
      As you can see from above, I changed my inode limit to 50.&lt;br /&gt;
&lt;br /&gt;
      What about running this on the whole filesystem? Yes, below is an example where I'm running&lt;br /&gt;
      this on FC3, on the root of the filesystem &amp;quot;/&amp;quot;. This assumes that you have installed the&lt;br /&gt;
      quota package. Try doing &amp;quot;rpm -q quota&amp;quot; to see if this package is installed.&lt;br /&gt;
&lt;br /&gt;
        Step 1:&lt;br /&gt;
&lt;br /&gt;
           Check to make sure the quota software is installed. You can either do a &amp;quot;whereis quota&amp;quot;,&lt;br /&gt;
           or check for the rpm package.&lt;br /&gt;
&lt;br /&gt;
             $ whereis quota&lt;br /&gt;
             whereis quota&lt;br /&gt;
             quota: /usr/bin/quota /usr/share/man/man1/quota.1.gz&lt;br /&gt;
&lt;br /&gt;
           Checking for the rpm package.&lt;br /&gt;
&lt;br /&gt;
            $ rpm -q quota&lt;br /&gt;
            quota-3.12-5&lt;br /&gt;
&lt;br /&gt;
        Step 2:&lt;br /&gt;
&lt;br /&gt;
           Edit /etc/fstab and add usrquota and grpquota options for &amp;quot;/dev/VolGroup00/LogVol00&amp;quot;,&lt;br /&gt;
           which is shown on the first line below:&lt;br /&gt;
&lt;br /&gt;
             /dev/VolGroup00/LogVol00 /                      ext3    defaults,usrquota,grpquota        1 1&lt;br /&gt;
             LABEL=/boot             /boot                   ext3    defaults        1 2&lt;br /&gt;
             none                    /dev/pts                devpts  gid=5,mode=620  0 0&lt;br /&gt;
             none                    /dev/shm                tmpfs   defaults        0 0&lt;br /&gt;
             none                    /proc                   proc    defaults        0 0&lt;br /&gt;
             none                    /sys                    sysfs   defaults        0 0&lt;br /&gt;
             /dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0&lt;br /&gt;
&lt;br /&gt;
        Step 3:&lt;br /&gt;
&lt;br /&gt;
           Remount the filesystem as follows:&lt;br /&gt;
&lt;br /&gt;
             $ mount -o remount /&lt;br /&gt;
&lt;br /&gt;
        Step 4:&lt;br /&gt;
&lt;br /&gt;
           Run quotacheck with the &amp;quot;-m&amp;quot; option. Like the above statement, this will have to be run with&lt;br /&gt;
           root priviliges. This creates the quota database files, and it can take a long time if it is&lt;br /&gt;
           a large full filesystem.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             $ quotacheck -cugm /&lt;br /&gt;
&lt;br /&gt;
        Step 5:&lt;br /&gt;
&lt;br /&gt;
           This step is optional, but it's good to know if you need to recalculate quotas because of a&lt;br /&gt;
           system crash. It's demonstrated here, because at this point quota's have not been turned on.&lt;br /&gt;
           Again, note the &amp;quot;m&amp;quot; option below.&lt;br /&gt;
&lt;br /&gt;
             $ quotacheck -avumg&lt;br /&gt;
&lt;br /&gt;
        Step 6:&lt;br /&gt;
&lt;br /&gt;
           Set limits for specific users or groups using the &amp;quot;edquota&amp;quot; command. Shown below is the command&lt;br /&gt;
           to setup quotas for user &amp;quot;chirico&amp;quot;. Shown below this user has used 161560 blocks, he has a soft&lt;br /&gt;
           limit of 1161560 and a hard limit of 900000. He has used 3085 inodes and has a soft limit of 10000&lt;br /&gt;
           and a hard limit of 12000.&lt;br /&gt;
&lt;br /&gt;
             $ edquota -f / chirico&lt;br /&gt;
&lt;br /&gt;
             Disk quotas for user chirico (uid 500):&lt;br /&gt;
               Filesystem                   blocks       soft       hard     inodes     soft     hard&lt;br /&gt;
               /dev/mapper/VolGroup00-LogVol00     161560    1161560     900000       3085    10000    12000&lt;br /&gt;
&lt;br /&gt;
           You can put quotas on groups as well. The following is done as root. See (TIP 186 and TIP 6) for creating&lt;br /&gt;
           groups and adding users to groups.&lt;br /&gt;
&lt;br /&gt;
             $ edquota -g share&lt;br /&gt;
&lt;br /&gt;
           If you create a sharable directory for anyone in the group &amp;quot;share&amp;quot; (TIP 6), quota restrictions against&lt;br /&gt;
           group &amp;quot;share&amp;quot; will only apply to files added in the &amp;quot;/home/share&amp;quot; directory. When user &amp;quot;chirico&amp;quot; creates&lt;br /&gt;
           files in &amp;quot;/home/share&amp;quot; they also go against this user quota as well. However, when files are created in&lt;br /&gt;
           his home directory they do not go against the &amp;quot;share&amp;quot; group.&lt;br /&gt;
&lt;br /&gt;
           Note - if you get errors when trying to run &amp;quot;edquota -g share&amp;quot;, turn quotas off &amp;quot;quotaoff /&amp;quot; and&lt;br /&gt;
                  run &amp;quot;quotacheck -avugm&amp;quot;. Then, turn the quotas back on &amp;quot;quotaon /&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           You can see the status of the group quota with the following command:&lt;br /&gt;
&lt;br /&gt;
             $ quota -g share&lt;br /&gt;
&lt;br /&gt;
        Step 7:&lt;br /&gt;
&lt;br /&gt;
           Turn on quotas with the &amp;quot;qutoaon&amp;quot; command. This command needs to be done with root privileges.&lt;br /&gt;
&lt;br /&gt;
             $ quotaon /&lt;br /&gt;
&lt;br /&gt;
        Step 8:&lt;br /&gt;
&lt;br /&gt;
           Check &amp;quot;/etc/quotatab&amp;quot; file for the correct entries. Note that when you do the &amp;quot;mount&amp;quot; command&lt;br /&gt;
           the filesystem returned needs to match what is in the &amp;quot;quotatab&amp;quot; file. I have noticed that this&lt;br /&gt;
           is not the case by default.&lt;br /&gt;
&lt;br /&gt;
             $ mount&lt;br /&gt;
             /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw,usrquota,grpquota)&lt;br /&gt;
&lt;br /&gt;
           So the &amp;quot;/etc/quotatab&amp;quot; must contain the following line.&lt;br /&gt;
&lt;br /&gt;
             /dev/mapper/VolGroup00-LogVol00: This is the Volume group&lt;br /&gt;
&lt;br /&gt;
        Step 9:&lt;br /&gt;
&lt;br /&gt;
           Run &amp;quot;warnquota&amp;quot; as a check that the &amp;quot;/etc/quotatab&amp;quot; files is setup correctly.&lt;br /&gt;
&lt;br /&gt;
              $ warnquota&lt;br /&gt;
&lt;br /&gt;
        Step 10:&lt;br /&gt;
&lt;br /&gt;
           Setup a daily cron job for running &amp;quot;warnquota&amp;quot;. The following should be placed&lt;br /&gt;
           in &amp;quot;/etc/cron.daily&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              #!/bin/sh&lt;br /&gt;
              # Place this file in /etc/cron.daily&lt;br /&gt;
              # with rights 0755&lt;br /&gt;
              /usr/sbin/warnquota&lt;br /&gt;
              EXITVALUE=$?&lt;br /&gt;
              if [ $EXITVALUE != 0 ]; then&lt;br /&gt;
                 /usr/bin/logger -t warnquota &amp;quot;ALERT exited abnormally with [$EXITVALUE]&amp;quot;&lt;br /&gt;
              fi&lt;br /&gt;
              exit 0&lt;br /&gt;
&lt;br /&gt;
      References:&lt;br /&gt;
        http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/sysadmin-guide/ch-disk-quotas.html&lt;br /&gt;
        (TIP 6, TIP 186, and TIP 205)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 168:&lt;br /&gt;
&lt;br /&gt;
     rdist - remote file distribution client program. You can use this program in combination with&lt;br /&gt;
     ssh. This program does more than just copy files. Once a file has been copied, you can dictate&lt;br /&gt;
     other actions to be performed. Or you can hold off copying all together if the destination is&lt;br /&gt;
     running low on inodes, or disk space.&lt;br /&gt;
&lt;br /&gt;
     For the purpose of this example, all commands will been run on &amp;quot;squeezel.squeezel.com&amp;quot;, and the&lt;br /&gt;
     computers that will be updated are &amp;quot;tape.squeezel.com&amp;quot; and &amp;quot;closet.squeezel.com&amp;quot;. Obviously, you&lt;br /&gt;
     would substitute your computer names.&lt;br /&gt;
&lt;br /&gt;
     It helps to setup ssh keys on each computer first. Reference [http://souptonuts.sourceforge.net/sshtips.htm]&lt;br /&gt;
     and (TIP 12).&lt;br /&gt;
&lt;br /&gt;
     Step 1: Create the Configuration file myDistfile&lt;br /&gt;
&lt;br /&gt;
       Below is my sample &amp;quot;myDistfile&amp;quot;. This file will access hosts &amp;quot;tape.squeezel.com&amp;quot; using username chirico&lt;br /&gt;
       and &amp;quot;closet.squeezel.com&amp;quot; with the username running this command, and copy the&lt;br /&gt;
       files &amp;quot;/home/chirico/file1&amp;quot; and &amp;quot;/home/chirico/file2&amp;quot; to the these two servers creating the&lt;br /&gt;
       directory ~/tmpdir if it doesn't exist. Once these files are updated, a mail check (&amp;quot;sendmail -bv&amp;quot;)&lt;br /&gt;
       will be performed, and mail will be sent to &amp;quot;chirico@squeezel&amp;quot;. This happens twice, once for each file.&lt;br /&gt;
&lt;br /&gt;
       Note, the line &amp;quot;/home/chirico/file2 -&amp;gt; tape.squeezel.com&amp;quot; which moves the file &amp;quot;file2&amp;quot; to&lt;br /&gt;
       tape.squeezel.com renaming the file to &amp;quot;tapedest&amp;quot; in the directory &amp;quot;/home/chirico&amp;quot;. Once this file&lt;br /&gt;
       is copied, the rights are modified to &amp;quot;chmod +r&amp;quot;.  Likewise, &amp;quot;/home/chirico/file2 -&amp;gt; closet.squeezel.com&amp;quot;&lt;br /&gt;
       copies the file file2, which is renamed as closetdest.&lt;br /&gt;
&lt;br /&gt;
                 # Contents of myDistfile&lt;br /&gt;
                 HOSTS = ( chirico@tape.squeezel.com closet.squeezel.com )&lt;br /&gt;
&lt;br /&gt;
                 FILES = ( /home/chirico/file1 /home/chirico/file2 )&lt;br /&gt;
&lt;br /&gt;
                 ${FILES} -&amp;gt; ${HOSTS}&lt;br /&gt;
                    # Directory tmpdir will be created if it doesn't exist&lt;br /&gt;
                    install tmpdir ;&lt;br /&gt;
                    special /home/chirico/file1  &amp;quot;/usr/sbin/sendmail -bv mchirico@gmail.com&amp;quot;;&lt;br /&gt;
                    notify chirico@squeezel;&lt;br /&gt;
&lt;br /&gt;
                 /home/chirico/file2 -&amp;gt; tape.squeezel.com&lt;br /&gt;
                    install  /home/chirico/tapedest;&lt;br /&gt;
                    special  /home/chirico/tapedest &amp;quot;chmod +r /home/chirico/tapedest&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
                 /home/chirico/file2 -&amp;gt; closet.squeezel.com&lt;br /&gt;
                    install /home/chirico/closetdest;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 2: Command from squeezel.squeezel.com to run myDistfile above&lt;br /&gt;
&lt;br /&gt;
       Below is the command that will execute the contents in &amp;quot;myDistfile&amp;quot;. This command is run from the&lt;br /&gt;
       computer &amp;quot;squeezel.squeezel.com&amp;quot;. All output will go in the file &amp;quot;cmd1rdist.log&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ rdist -P /usr/local/bin/ssh -f ./myDistfile -l file=./cmd1rdist.log=all&lt;br /&gt;
&lt;br /&gt;
       Obviously you want a secure copy (using scp), so the -P option uses ssh as your secure&lt;br /&gt;
       transport mechanism.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 169:&lt;br /&gt;
&lt;br /&gt;
     Restricting root logins (/etc/securetty). ctl-alt-F4 will give you a prompt for tty3. Note&lt;br /&gt;
     that it is one number less. Take a look at the contents of &amp;quot;/etc/securetty&amp;quot;. To prevent&lt;br /&gt;
     root from logging in on this device, take out tty3 from this listing. Note, you can always&lt;br /&gt;
     login as another user, then, su to root.  Below is an example of the default&lt;br /&gt;
     &amp;quot;/etc/securetty&amp;quot; that allows root to login to everything.&lt;br /&gt;
&lt;br /&gt;
         [root@squeezel ~]# cat /etc/securetty&lt;br /&gt;
         console&lt;br /&gt;
         vc/1&lt;br /&gt;
         vc/2&lt;br /&gt;
         vc/3&lt;br /&gt;
         vc/4&lt;br /&gt;
         vc/5&lt;br /&gt;
         vc/6&lt;br /&gt;
         vc/7&lt;br /&gt;
         vc/8&lt;br /&gt;
         vc/9&lt;br /&gt;
         vc/10&lt;br /&gt;
         vc/11&lt;br /&gt;
         tty1&lt;br /&gt;
         tty2&lt;br /&gt;
         tty3&lt;br /&gt;
         tty4&lt;br /&gt;
         tty5&lt;br /&gt;
         tty6&lt;br /&gt;
         tty7&lt;br /&gt;
         tty8&lt;br /&gt;
         tty9&lt;br /&gt;
         tty10&lt;br /&gt;
         tty11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 170:&lt;br /&gt;
&lt;br /&gt;
     Perl map function. Try the following to get a quick take on this function,&lt;br /&gt;
     which increments each value in the array a;&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map {$_++} @a;&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot; } @a;&lt;br /&gt;
&lt;br /&gt;
     or&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     And you can easily make modifications, like reversing the order&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     Plus there is a grep() function that works on each element as well&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse grep{ $_ &amp;gt; 3} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     To get only odd numbers in reverse order:&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse grep{ !($_ % 2)} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference: http://www-128.ibm.com/developerworks/linux/library/l-road4.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 171:&lt;br /&gt;
&lt;br /&gt;
     Perl - subroutine call and shifting through variables. A simple and useful&lt;br /&gt;
     technique.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          sub test {&lt;br /&gt;
            local $mval;&lt;br /&gt;
            while( $mval = shift ) {&lt;br /&gt;
              print &amp;quot; $mval\n&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          test(&amp;quot;one&amp;quot;,&amp;quot;two&amp;quot;,&amp;quot;three&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 172:&lt;br /&gt;
&lt;br /&gt;
     Tcp wrappers - First &amp;quot;/etc/hosts.allow&amp;quot; is check, and if there is an entry in this file, no more&lt;br /&gt;
     checking it done.  If are no matches in &amp;quot;/etc/hosts.allow&amp;quot;, the &amp;quot;/etc/hosts.deny&amp;quot; file is checked&lt;br /&gt;
     and if a match is found, that service is blocked for that host.&lt;br /&gt;
&lt;br /&gt;
     Example &amp;quot;/etc/hosts.deny&amp;quot; file:&lt;br /&gt;
&lt;br /&gt;
         sshd: 192.168.1.171&lt;br /&gt;
&lt;br /&gt;
     The above file blocks access to computer 192.168.1.171. It's also possible to run commands when&lt;br /&gt;
     someone from this computer tries to ssh in. This example sends mail.&lt;br /&gt;
&lt;br /&gt;
         sshd: 192.168.1.171: spawn (echo -e &amp;quot;%d %h %H %u&amp;quot;| /bin/mail -s 'hosts.deny entry' root)&lt;br /&gt;
&lt;br /&gt;
     Of course, you can also run commands in the &amp;quot;/etc/hosts.allow&amp;quot; if you wanted mail sent for a successful&lt;br /&gt;
     login.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 173:&lt;br /&gt;
&lt;br /&gt;
     pgrep, pkill - look up or signal process based on name and other attributes.&lt;br /&gt;
&lt;br /&gt;
     To quick find all instances of ssh running, for user root, execute the following&lt;br /&gt;
     command:&lt;br /&gt;
&lt;br /&gt;
           $ pgrep -u root -l ssh&lt;br /&gt;
&lt;br /&gt;
     To kill a process, or send a signal use the &amp;quot;pkill&amp;quot; option. For example, to&lt;br /&gt;
     make syslog reread its configuration file:&lt;br /&gt;
&lt;br /&gt;
           $ pkill -HUP syslogd&lt;br /&gt;
&lt;br /&gt;
     Another command command is &amp;quot;pidof&amp;quot; that can tell you how many processes are running.&lt;br /&gt;
     This can be useful for detecting DOS attacks.&lt;br /&gt;
&lt;br /&gt;
           $ pidof sshd&lt;br /&gt;
           4783 4781 30008 30006 29888 29886 2246&lt;br /&gt;
&lt;br /&gt;
     Above there are 7 sshd's running. Reference &amp;quot;Tcpdump, Raw Socket and Libpap Tutorial&amp;quot;&lt;br /&gt;
     at [http://souptonuts.sourceforge.net/tcpdump_tutorial.html].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 174:&lt;br /&gt;
&lt;br /&gt;
     Password Cracking - tools to check your users passwords:&lt;br /&gt;
&lt;br /&gt;
      John The Ripper&lt;br /&gt;
        http://www.openwall.com/john/&lt;br /&gt;
&lt;br /&gt;
      Crack&lt;br /&gt;
        http://www.crypticide.com/users/alecm/&lt;br /&gt;
&lt;br /&gt;
      Slurpie&lt;br /&gt;
        http://www.ussrback.com/distributed.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 175:&lt;br /&gt;
&lt;br /&gt;
     Password Aging - setting the number of days a password is valid.&lt;br /&gt;
&lt;br /&gt;
         $ chage -M 90 &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 176:&lt;br /&gt;
&lt;br /&gt;
     Kernel Performance Tuning - /Documentation/sysctl/vm.txt documents kernel settings to&lt;br /&gt;
     improve performance. Below are some examples.&lt;br /&gt;
&lt;br /&gt;
       overcommit_memory:  0 -- default estimates the amount of memory for malloc&lt;br /&gt;
                           1 -- kernel pretends there is always enough memory until it runs out&lt;br /&gt;
                           3 -- never overcommit&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/overcommit_memory&lt;br /&gt;
          0&lt;br /&gt;
&lt;br /&gt;
       page-cluster:&lt;br /&gt;
            The Linux VM subsystem avoids excessive disk seeks by reading&lt;br /&gt;
            multiple pages on a page fault. The number of pages it reads&lt;br /&gt;
            is dependent on the amount of memory in your machine.&lt;br /&gt;
        &lt;br /&gt;
            The number of pages the kernel reads in at once is equal to&lt;br /&gt;
            2 ^ page-cluster. Values above 2 ^ 5 don't make much sense&lt;br /&gt;
            for swap because we only cluster swap data in 32-page groups.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/page-cluster&lt;br /&gt;
          3&lt;br /&gt;
&lt;br /&gt;
       min_free_kbytes:&lt;br /&gt;
            This is used to force the Linux VM to keep a minimum number&lt;br /&gt;
            of kilobytes free.  The VM uses this number to compute a pages_min&lt;br /&gt;
            value for each lowmem zone in the system.  Each lowmem zone gets&lt;br /&gt;
            a number of reserved free pages based proportionally on its size.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/min_free_kbytes&lt;br /&gt;
          3831&lt;br /&gt;
&lt;br /&gt;
       max_map_count:&lt;br /&gt;
            This file contains the maximum number of memory map areas a process&lt;br /&gt;
            may have. Memory map areas are used as a side-effect of calling&lt;br /&gt;
            malloc, directly by mmap and mprotect, and also when loading shared&lt;br /&gt;
            libraries.&lt;br /&gt;
&lt;br /&gt;
            While most applications need less than a thousand maps, certain&lt;br /&gt;
            programs, particularly malloc debuggers, may consume lots of them,&lt;br /&gt;
            e.g., up to one or two maps per allocation.&lt;br /&gt;
&lt;br /&gt;
            The default value is 65536.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/max_map_count&lt;br /&gt;
          65536&lt;br /&gt;
&lt;br /&gt;
        Also see http://people.redhat.com/alikins/system_tuning.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 177:&lt;br /&gt;
&lt;br /&gt;
     IO Scheduler - /Documentation/block/as-iosched.txt documents kernel settings for disk&lt;br /&gt;
     performance.&lt;br /&gt;
&lt;br /&gt;
     If you're not sure what partitions you have &amp;quot;$ cat /proc/partitions&amp;quot;. This example&lt;br /&gt;
     assumes hda, and you can see some of the kernel settings:&lt;br /&gt;
&lt;br /&gt;
          $ ls /sys/block/hda/queue/iosched&lt;br /&gt;
          back_seek_max  back_seek_penalty  clear_elapsed  fifo_batch_expire  fifo_expire_async&lt;br /&gt;
           fifo_expire_sync  find_best_crq  key_type  quantum  queued&lt;br /&gt;
&lt;br /&gt;
     References: http://lwn.net/Articles/102505/&lt;br /&gt;
                 http://bhhdoa.org.au/pipermail/ck/2004-September/000961.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 178:&lt;br /&gt;
&lt;br /&gt;
     iozone -- getting data on disk performance (http://www.iozone.org/). This is a very&lt;br /&gt;
     comprehensive package.&lt;br /&gt;
&lt;br /&gt;
           $ wget http://www.iozone.org/src/current/iozone3_242.tar&lt;br /&gt;
           $ tar -xf iozone3_242.tar&lt;br /&gt;
           $ cd iozone3_242/src/current&lt;br /&gt;
           $ make linux&lt;br /&gt;
&lt;br /&gt;
     At this point you should read the documentation. There is no &amp;quot;make install&amp;quot;. You&lt;br /&gt;
     copy it to each filesystem you want to run this program on. Below are some quick&lt;br /&gt;
     start commands.&lt;br /&gt;
&lt;br /&gt;
       Good comprehensive test.&lt;br /&gt;
&lt;br /&gt;
           $ iozone -a&lt;br /&gt;
&lt;br /&gt;
       I prefer this for small filesystems. It limits the record size to 10000 and does&lt;br /&gt;
       the output in operations per second (higher numbers mean faster drive).&lt;br /&gt;
&lt;br /&gt;
           $ ./iozone -a -s 10000 -O&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 179:&lt;br /&gt;
&lt;br /&gt;
     history - bash command to get a history of all commands typed. But, here is a way&lt;br /&gt;
     that you can get date and time listed as well.&lt;br /&gt;
&lt;br /&gt;
           $ HISTTIMEFORMAT=&amp;quot;%y/%m/%d %T &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Defining the environment variable above give you the date/time info when you&lt;br /&gt;
     execute history:&lt;br /&gt;
&lt;br /&gt;
           $ history&lt;br /&gt;
              ...&lt;br /&gt;
               175  05/06/30 12:51:46 grep '141.162.' mout &amp;gt; mout2&lt;br /&gt;
               176  05/06/30 12:51:48 e mout2&lt;br /&gt;
               177  05/06/30 12:56:59 ls&lt;br /&gt;
               178  05/06/30 12:57:02 ls&lt;br /&gt;
               179  05/06/30 12:57:39 ls&lt;br /&gt;
               180  05/06/30 12:57:49 ls -l&lt;br /&gt;
               181  05/06/30 13:01:10 history&lt;br /&gt;
               182  05/06/30 13:01:20 HISTTIMEFORMAT=&amp;quot;%y/%m/%d %T &amp;quot;&lt;br /&gt;
               183  05/06/30 13:01:23 history&lt;br /&gt;
              ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 180:&lt;br /&gt;
&lt;br /&gt;
     .config - Fedora Core getting the .config to rebuild the kernel. You can find&lt;br /&gt;
     this file, the &amp;quot;.config&amp;quot; file at the following location:&lt;br /&gt;
&lt;br /&gt;
          $ ls &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Or, to see the contents&lt;br /&gt;
&lt;br /&gt;
          $ cat &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     This can be important, if you're planning to build your own kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 181:&lt;br /&gt;
&lt;br /&gt;
     Listing control key settings.&lt;br /&gt;
&lt;br /&gt;
          $ stty -a&lt;br /&gt;
          speed 38400 baud; rows 0; columns 0; line = 0;&lt;br /&gt;
          intr = ^C; quit = ^\; erase = &amp;lt;undef&amp;gt;; kill = &amp;lt;undef&amp;gt;; eof = ^D; eol = &amp;lt;undef&amp;gt;; eol2 = &amp;lt;undef&amp;gt;; start = ^Q;&lt;br /&gt;
          stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;&lt;br /&gt;
          -parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts&lt;br /&gt;
          -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel&lt;br /&gt;
          opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0&lt;br /&gt;
          isig icanon iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 182:&lt;br /&gt;
&lt;br /&gt;
     iptables DNAT and SNAT. You have a webserver on 192.168.1.71. When people query this webserver, you want them&lt;br /&gt;
     to goto 192.168.1.81, with no indication that they are going to another web server. In fact, they always make&lt;br /&gt;
     their web hits to 192.168.1.71.&lt;br /&gt;
&lt;br /&gt;
     The following is the iptables commands:&lt;br /&gt;
&lt;br /&gt;
        $ echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
        $ iptables -t nat -A PREROUTING -d 192.168.1.71 -p tcp --dport 80 -j DNAT --to 192.168.1.81&lt;br /&gt;
        $ iptables -t nat -A POSTROUTING -d 192.168.1.81 -s 192.168.1.0/24 -p tcp --dport 80 -j SNAT --to 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
     Change 192.168.1.0/24 to whatever source you expect the web browser to come in on. Below is the tcpdump showing&lt;br /&gt;
     all traffic is relayed via 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
         [root@closet iptables]# tcpdump -nN port 80&lt;br /&gt;
&lt;br /&gt;
         17:34:58.790398 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: S 3620106373:3620106373(0) win 16384 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790465 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: S 3620106373:3620106373(0) win 16384 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790703 IP 192.168.1.81.80 &amp;gt; 192.168.1.71.1158: S 1973665156:1973665156(0) ack 3620106374 win 5840 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790720 IP 192.168.1.71.80 &amp;gt; 192.168.1.102.1158: S 1973665156:1973665156(0) ack 3620106374 win 5840 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790951 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: . ack 1 win 17520&lt;br /&gt;
         17:34:58.790965 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: . ack 1 win 17520&lt;br /&gt;
         17:34:58.791451 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: P 1:327(326) ack 1 win 17520&lt;br /&gt;
         17:34:58.791472 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: P 1:327(326) ack 1 win 17520&lt;br /&gt;
         17:34:58.791973 IP 192.168.1.81.80 &amp;gt; 192.168.1.71.1158: . ack 327 win 6432&lt;br /&gt;
&lt;br /&gt;
     Above the web client is on &amp;quot;192.168.1.102&amp;quot;. You can see that the 1st server &amp;quot;192.168.1.71&amp;quot; then goes out to&lt;br /&gt;
     the 2nd server &amp;quot;192.168.1.81&amp;quot; on the second line. The third line shows the 2nd server &amp;quot;192.168.1.81&amp;quot; responding to&lt;br /&gt;
     the 1st server, and the forth line passes this data back to the web client &amp;quot;192.168.1.102&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Note: You can save your current iptables setting with the following command:&lt;br /&gt;
&lt;br /&gt;
         $ iptables-save &amp;gt; iptables_store&lt;br /&gt;
&lt;br /&gt;
       The big advantage is that you can store the counters as well.&lt;br /&gt;
&lt;br /&gt;
         $ iptables-save -c &amp;gt; iptables_store_w_cnts&lt;br /&gt;
&lt;br /&gt;
       To restore the file, use the following:&lt;br /&gt;
&lt;br /&gt;
         $ iptables-restore -c &amp;lt; iptables_store_w_cnts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 183:&lt;br /&gt;
&lt;br /&gt;
     mailstats - display mail statistics. This file reads data from &amp;quot;/var/log/mail/statistics&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         [root@closet ~]# mailstats&lt;br /&gt;
         Statistics from Sat Jun 25 15:59:52 2005&lt;br /&gt;
          M   msgsfr  bytes_from   msgsto    bytes_to  msgsrej msgsdis msgsqur  Mailer&lt;br /&gt;
          4        1          2K        0          0K        0       0       0  esmtp&lt;br /&gt;
          9        0          0K        1          2K        0       0       0  local&lt;br /&gt;
         =====================================================================&lt;br /&gt;
          T        1          2K        1          2K        0       0       0&lt;br /&gt;
          C        1                    0                    0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 184:&lt;br /&gt;
&lt;br /&gt;
     Profiling C Applications - Assume you have the following program p1.c:&lt;br /&gt;
&lt;br /&gt;
         /* Program  p1.c */&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
         t1(int i)&lt;br /&gt;
         {&lt;br /&gt;
                 printf(&amp;quot;t1:%d\n&amp;quot;, i);&lt;br /&gt;
         }&lt;br /&gt;
        &lt;br /&gt;
         t2(int j)&lt;br /&gt;
         {&lt;br /&gt;
                 printf(&amp;quot;t2:%d\n&amp;quot;, j);&lt;br /&gt;
         }&lt;br /&gt;
        &lt;br /&gt;
         int main(void)&lt;br /&gt;
         {&lt;br /&gt;
                 int i, j;&lt;br /&gt;
        &lt;br /&gt;
                 for (i = 0; i &amp;lt; 5; ++i) {&lt;br /&gt;
                         t1(i);&lt;br /&gt;
                         for (j = 0; j &amp;lt; 2; ++j) {&lt;br /&gt;
                                 t2(j);&lt;br /&gt;
                         }&lt;br /&gt;
                 }&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
     Compile the program as follows:&lt;br /&gt;
&lt;br /&gt;
        $ gcc -pg -g -o p1 p1.c&lt;br /&gt;
        $ ./p1&lt;br /&gt;
        t1:0&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:1&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:2&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:3&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:4&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
&lt;br /&gt;
     Next, to get the profile graph.&lt;br /&gt;
&lt;br /&gt;
        $ gprof -p -b p1&lt;br /&gt;
        Flat profile:&lt;br /&gt;
        &lt;br /&gt;
        Each sample counts as 0.01 seconds.&lt;br /&gt;
         no time accumulated&lt;br /&gt;
        &lt;br /&gt;
          %   cumulative   self              self     total&lt;br /&gt;
         time   seconds   seconds    calls  Ts/call  Ts/call  name&lt;br /&gt;
          0.00      0.00     0.00       10     0.00     0.00  t2&lt;br /&gt;
          0.00      0.00     0.00        5     0.00     0.00  t1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Above note the 10 calls to t2 and 5 calls to t1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 185:&lt;br /&gt;
&lt;br /&gt;
     CDPATH - this is a bash variable like PATH that defines a search path&lt;br /&gt;
              for the cd command.&lt;br /&gt;
&lt;br /&gt;
     Suppose you have the following directory structure:&lt;br /&gt;
&lt;br /&gt;
             /home/chirico/stuff&lt;br /&gt;
                               |-- dirA&lt;br /&gt;
                               `-- dirB&lt;br /&gt;
&lt;br /&gt;
     Assume you define CDPATH as follows:&lt;br /&gt;
&lt;br /&gt;
             CDPATH=/home/chirico/stuff&lt;br /&gt;
&lt;br /&gt;
     Now, no matter what directory you are in if you use the cd command below&lt;br /&gt;
     you will automatically move to &amp;quot;/home/chirico/stuff/dirA&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             $ cd dirA&lt;br /&gt;
&lt;br /&gt;
     Note you could be in &amp;quot;/etc&amp;quot; and will move directly to &amp;quot;/home/chirico/stuff/dirA&amp;quot;.&lt;br /&gt;
     This command has the same format as PATH - multiple entries are separated by a colon.&lt;br /&gt;
     If the current directory contain a sub-directory dirA, then, it gets priority.&lt;br /&gt;
&lt;br /&gt;
     The following is part of my .bash_profile&lt;br /&gt;
&lt;br /&gt;
             CDPATH=/work/cpearls/src/posted_on_sf/:/work/souptonuts/documentation/:/home/chirico/deleteme/&lt;br /&gt;
             export PATH CVS_RSH EDITOR JAVA_HOME CDPATH&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 186:&lt;br /&gt;
&lt;br /&gt;
     Groups - add groups and users to groups. The following shows how to create the group &amp;quot;share&amp;quot;&lt;br /&gt;
              and add the user &amp;quot;chirico&amp;quot; to this group. The following should be done as root, and&lt;br /&gt;
              assumes the account &amp;quot;chirico&amp;quot; already exits.&lt;br /&gt;
&lt;br /&gt;
             $ groupadd share&lt;br /&gt;
             $ usermod -G share chirico&lt;br /&gt;
&lt;br /&gt;
     Note the change made to &amp;quot;/etc/group&amp;quot; below:&lt;br /&gt;
&lt;br /&gt;
             $ cat /etc/group|grep 'share'&lt;br /&gt;
             share:x:616:chirico&lt;br /&gt;
&lt;br /&gt;
     If the user chirico is currently logged in, he should run the following&lt;br /&gt;
     command to immediately have group &amp;quot;share&amp;quot; rights. Or, the next time he logs&lt;br /&gt;
     in he will have access to this group.&lt;br /&gt;
&lt;br /&gt;
             $ newgrp share&lt;br /&gt;
&lt;br /&gt;
     Reference the following (TIP 6, TIP 167).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 187:&lt;br /&gt;
&lt;br /&gt;
     oprofile - steps for running oprofile on Fedora.&lt;br /&gt;
&lt;br /&gt;
     Step 1:&lt;br /&gt;
&lt;br /&gt;
       Find out what version of the kernel you are running.&lt;br /&gt;
&lt;br /&gt;
           $ uname -a&lt;br /&gt;
           Linux closet.squeezel.com 2.6.12-1.1398_FC4 #1 Fri Jul 15 00:52:32 EDT 2005 i686 i686 i386 GNU/Linux&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 2:&lt;br /&gt;
&lt;br /&gt;
       Download the source in a chosen directory. Above, I'm running 2.6.12-1, but I'm going to go for 2.6.12.3, since&lt;br /&gt;
       it's a little later. You want the signed file as well.&lt;br /&gt;
&lt;br /&gt;
           $ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.12.3.tar.gz&lt;br /&gt;
           $ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.12.3.tar.gz.sign&lt;br /&gt;
&lt;br /&gt;
       Now, check the signature.&lt;br /&gt;
&lt;br /&gt;
           $ gpg --verify linux-2.6.12.3.tar.gz.sign linux-2.6.12.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 3:&lt;br /&gt;
&lt;br /&gt;
       Unpack the file.&lt;br /&gt;
&lt;br /&gt;
           $ tar -xzf linux-2.6.12.3.tar.gz&lt;br /&gt;
           $ cd cd linux-2.6.12.3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 4:&lt;br /&gt;
&lt;br /&gt;
       Copy the &amp;quot;.config&amp;quot; used to compile your previous kernel. You should find it&lt;br /&gt;
       in the following direcotry &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       Copy it to the linux-2.6.12.3 directory.&lt;br /&gt;
&lt;br /&gt;
           $ cp &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot; .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 5:&lt;br /&gt;
&lt;br /&gt;
       Run make as follows. It will ask for a few questions on &amp;quot;make oldconfig&amp;quot;. The&lt;br /&gt;
       make installs below will have to be done with root privileges.&lt;br /&gt;
&lt;br /&gt;
          $ make oldconfig&lt;br /&gt;
          $ make bzImage&lt;br /&gt;
          $ make modules&lt;br /&gt;
          $ make modules_install&lt;br /&gt;
          $ make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 6:&lt;br /&gt;
&lt;br /&gt;
       Edit the &amp;quot;/boot/grub/grub.conf&amp;quot; and set default = 0  as shown below in this&lt;br /&gt;
       file.&lt;br /&gt;
&lt;br /&gt;
            default=0&lt;br /&gt;
            timeout=5&lt;br /&gt;
            splashimage=(hd0,2)/grub/splash.xpm.gz&lt;br /&gt;
            hiddenmenu&lt;br /&gt;
            title Fedora Core (2.6.12.3)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.12.3 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.12.3.img&lt;br /&gt;
            title Fedora Core (2.6.12-1.1398_FC4)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.12-1.1398_FC4 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.12-1.1398_FC4.img&lt;br /&gt;
            title Fedora Core (2.6.11-1.1369_FC4)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.11-1.1369_FC4 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.11-1.1369_FC4.img&lt;br /&gt;
            title Other&lt;br /&gt;
                    rootnoverify (hd0,1)&lt;br /&gt;
                    chainloader +1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 7:&lt;br /&gt;
&lt;br /&gt;
       Shutdown with the restart option.&lt;br /&gt;
&lt;br /&gt;
           $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 8:&lt;br /&gt;
&lt;br /&gt;
       Run opcontrol. The commands below are done as root.  My kernel was compiled in the following&lt;br /&gt;
       directory &amp;quot;/home/kernel/linux-2.6.12.3/&amp;quot;, so I'll run opcontrol as follows:&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --vmlinux=/home/kernel/linux-2.6.12.3/vmlinux&lt;br /&gt;
&lt;br /&gt;
       Now start.&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --start&lt;br /&gt;
           Using 2.6+ OProfile kernel interface.&lt;br /&gt;
           Reading module info.&lt;br /&gt;
           Using log file /var/lib/oprofile/oprofiled.log&lt;br /&gt;
           Daemon started.&lt;br /&gt;
           Profiler running.&lt;br /&gt;
&lt;br /&gt;
       Shutdown opcontrol.&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --shutdown&lt;br /&gt;
&lt;br /&gt;
       Run report.&lt;br /&gt;
&lt;br /&gt;
           $ opreport&lt;br /&gt;
&lt;br /&gt;
           CPU: CPU with timer interrupt, speed 0 MHz (estimated)&lt;br /&gt;
           Profiling through timer interrupt&lt;br /&gt;
                     TIMER:0|&lt;br /&gt;
             samples|      %|&lt;br /&gt;
           ------------------&lt;br /&gt;
              156088 99.8746 vmlinux&lt;br /&gt;
                  60  0.0384 libc-2.3.5.so&lt;br /&gt;
                  30  0.0192 oprofiled&lt;br /&gt;
                  23  0.0147 libcrypto.so.0.9.7f&lt;br /&gt;
                  13  0.0083 bash&lt;br /&gt;
                  12  0.0077 screen&lt;br /&gt;
                  10  0.0064 sshd&lt;br /&gt;
                   9  0.0058 ssh&lt;br /&gt;
                   6  0.0038 ip_tables&lt;br /&gt;
                   6  0.0038 libncurses.so.5.4&lt;br /&gt;
                   5  0.0032 b44&lt;br /&gt;
                   5  0.0032 ext3&lt;br /&gt;
                   5  0.0032 ld-2.3.5.so&lt;br /&gt;
                   4  0.0026 ip_conntrack&lt;br /&gt;
                   4  0.0026 jbd&lt;br /&gt;
                   2  0.0013 grep&lt;br /&gt;
                   1 6.4e-04 libdns.so.20.0.2&lt;br /&gt;
                   1 6.4e-04 libisc.so.9.1.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Reference the following for more documentation:&lt;br /&gt;
             http://oprofile.sourceforge.net/doc/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 188:&lt;br /&gt;
&lt;br /&gt;
     cyrus-imapd with Postfix using sasldb for authentication. For this example&lt;br /&gt;
     the server is tape.squeezel.com and the user is chirico.&lt;br /&gt;
&lt;br /&gt;
        Step 1:&lt;br /&gt;
        &lt;br /&gt;
                   $ yum install cyrus-imapd&lt;br /&gt;
                   $ yum install cyrus-imapd-utils&lt;br /&gt;
        &lt;br /&gt;
            You need &amp;quot;cyrus-imapd-utils&amp;quot; for cyradm.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 2:&lt;br /&gt;
        &lt;br /&gt;
          Edit /etc/imapd.conf&lt;br /&gt;
        &lt;br /&gt;
               configdirectory: /var/lib/imap&lt;br /&gt;
               partition-default: /var/spool/imap&lt;br /&gt;
               admins: cyrus&lt;br /&gt;
               sievedir: /var/lib/imap/sieve&lt;br /&gt;
               sendmail: /usr/sbin/sendmail&lt;br /&gt;
               hashimapspool: true&lt;br /&gt;
               # Chirico Commented the below line&lt;br /&gt;
               # sasl_pwcheck_method: saslauthd&lt;br /&gt;
               # Because using sasldb&lt;br /&gt;
               sasl_pwcheck_method: auxprop&lt;br /&gt;
               sasl_auxprop_plugin: sasldb&lt;br /&gt;
               #  Chirico end change&lt;br /&gt;
               sasl_mech_list: PLAIN&lt;br /&gt;
               tls_cert_file: /usr/share/ssl/certs/cyrus-imapd.pem&lt;br /&gt;
               tls_key_file: /usr/share/ssl/certs/cyrus-imapd.pem&lt;br /&gt;
               tls_ca_file: /usr/share/ssl/certs/ca-bundle.crt&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 3:&lt;br /&gt;
        &lt;br /&gt;
           Create a user and password:&lt;br /&gt;
        &lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` cyrus&lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` chirico&lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` allmail&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
           This will automatically create the file /etc/sasldb2. But look&lt;br /&gt;
           at the default rights, assuming you ran saslpasswd2 as root:&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /etc/sasldb2&lt;br /&gt;
                 -rw-r-----  1 root root 12288 Jul 31 09:50 /etc/sasldb2&lt;br /&gt;
        &lt;br /&gt;
           We need to correct this in step 4.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 4:&lt;br /&gt;
        &lt;br /&gt;
                 $ chown root.mail /etc/sasldb2&lt;br /&gt;
                 $ ls -l /etc/sasldb2&lt;br /&gt;
                 -rw-r-----  1 root mail 12288 Jul 31 09:50 /etc/sasldb2&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 5:&lt;br /&gt;
        &lt;br /&gt;
            Update &amp;quot;/etc/postfix/main.cf&amp;quot;. Note in /etc/imapd.conf the configdirectory&lt;br /&gt;
            points to /var/lib/imap, and if I look at this directory I see the&lt;br /&gt;
            socket directory. However, after staring /etc/init.d/cyrus-imapd  there&lt;br /&gt;
            will be a socket file &amp;quot;/var/lib/imap/socket/lmtp&amp;quot;. (See step 6).&lt;br /&gt;
        &lt;br /&gt;
                  mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp&lt;br /&gt;
                  mailbox_transport = cyrus&lt;br /&gt;
        &lt;br /&gt;
            Restart postfix.&lt;br /&gt;
        &lt;br /&gt;
                  /etc/init.d/postfix restart&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 6:&lt;br /&gt;
&lt;br /&gt;
            Start cyrus-imapd and look for the socket file.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
                   $ /etc/init.d/cyrus-imapd restart&lt;br /&gt;
                   Shutting down cyrus-imapd:                                 [  OK  ]&lt;br /&gt;
                   Starting cyrus-imapd: preparing databases... done.         [  OK  ]&lt;br /&gt;
        &lt;br /&gt;
            Now you should see the lmtp file:&lt;br /&gt;
        &lt;br /&gt;
                   $ ls -l /var/lib/imap/socket/lmtp&lt;br /&gt;
                   srwxrwxrwx  1 root root 0 Jul 31 10:04 /var/lib/imap/socket/lmtp&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 7:&lt;br /&gt;
        &lt;br /&gt;
            Add users. Note, you may have to go back to step 3 to add them to /etc/sasldb2&lt;br /&gt;
            as well.&lt;br /&gt;
        &lt;br /&gt;
                   $ su - cyrus&lt;br /&gt;
                   $ cyradm tape.squeezel.com&lt;br /&gt;
                   tape.squeezel.com&amp;gt; cm user.chirico&lt;br /&gt;
                   tape.squeezel.com&amp;gt; quit&lt;br /&gt;
        &lt;br /&gt;
            Now got back as root, and check that everything was created correctly.&lt;br /&gt;
        &lt;br /&gt;
                   $ ls /var/spool/imap/c/user/&lt;br /&gt;
                   total 8&lt;br /&gt;
                   drwx------  2 cyrus mail 4096 Jul 31 10:21 chirico&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 8:&lt;br /&gt;
        &lt;br /&gt;
             Run a mail test. We'll do this as root to the chirico account.&lt;br /&gt;
        &lt;br /&gt;
                   $ mail -s 'First test'  chirico&lt;br /&gt;
                   first test&lt;br /&gt;
                   .&lt;br /&gt;
        &lt;br /&gt;
             Now, still as root check the maillog. Normally everything should work.&lt;br /&gt;
        &lt;br /&gt;
                  $ tail /var/log/maillog&lt;br /&gt;
        &lt;br /&gt;
             However, I got the following error below.&lt;br /&gt;
&lt;br /&gt;
                     Jul 31 10:29:03 tape postfix/cleanup[30124]: AE7CB1B34A4: message-id=&amp;lt;20050731142903.AE7CB1B34A4@tape.squeezel.com&amp;gt;&lt;br /&gt;
                     Jul 31 10:29:03 tape postfix/qmgr[30120]: AE7CB1B34A4: from=&amp;lt;root@tape.squeezel.com&amp;gt;, size=315, nrcpt=1 (queue active)&lt;br /&gt;
                     Jul 31 10:29:03 tape pipe[30128]: fatal: pipe_comand: execvp /cyrus/bin/deliver: No such file or directory&lt;br /&gt;
&lt;br /&gt;
             If you get a similiar error, you may need to adjust the settting in /etc/postfix/master.cf&lt;br /&gt;
        &lt;br /&gt;
                 # This is the problem in /etc/postfix/master.cf&lt;br /&gt;
                 cyrus     unix  -       n       n       -       -       pipe&lt;br /&gt;
                   user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}&lt;br /&gt;
        &lt;br /&gt;
             My deliver file is the following&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
                 -rwxr-xr-x  1 root root 846228 Apr  4 18:59 /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
        &lt;br /&gt;
             So I need to change my /etc/postfix/master.cf as follows:&lt;br /&gt;
        &lt;br /&gt;
                 # Fix because by deliver file is under  /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
                 cyrus     unix  -       n       n       -       -       pipe&lt;br /&gt;
                   user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -r ${sender} -m ${extension} ${user}&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
             If changes were needed, like I had to do, restart postfix&lt;br /&gt;
        &lt;br /&gt;
                 $ /etc/init.d/postfix restart&lt;br /&gt;
        &lt;br /&gt;
             Now, if everything works, you should start to see numbers in the spool directory like &amp;quot;1.&amp;quot; and&lt;br /&gt;
             &amp;quot;2.&amp;quot;.&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /var/spool/imap/c/user/chirico/&lt;br /&gt;
                 total 40&lt;br /&gt;
                 -rw-------  1 cyrus mail  545 Jul 31 10:44 1.&lt;br /&gt;
                 -rw-------  1 cyrus mail  547 Jul 31 10:45 2.&lt;br /&gt;
                 -rw-------  1 cyrus mail 1276 Jul 31 10:45 cyrus.cache&lt;br /&gt;
                 -rw-------  1 cyrus mail  153 Jul 31 10:21 cyrus.header&lt;br /&gt;
                 -rw-------  1 cyrus mail  196 Jul 31 10:45 cyrus.index&lt;br /&gt;
&lt;br /&gt;
        Step 9:&lt;br /&gt;
        &lt;br /&gt;
             Local firewall.&lt;br /&gt;
        &lt;br /&gt;
                 # imap&lt;br /&gt;
                iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 143 -j ACCEPT&lt;br /&gt;
                iptables -A INPUT -p tcp -s 192.168.1.0/24  --dport 143 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        Step 10:&lt;br /&gt;
        &lt;br /&gt;
             Configure cyrus-imapd to start for run-level 3 and 5.&lt;br /&gt;
&lt;br /&gt;
                 # chkconfig --level 35 cyrus-imapd on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       HINTS - &lt;br /&gt;
&lt;br /&gt;
        Something to watch out for:&lt;br /&gt;
&lt;br /&gt;
              Something to watch out for: If a user creates a .forward file in their shell account with the&lt;br /&gt;
              following entry, then, mail will not get mail relayed to cyrus.&lt;br /&gt;
&lt;br /&gt;
                  &amp;quot;|exec /usr/bin/procmail&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             The /etc/maillog will show something like this:&lt;br /&gt;
&lt;br /&gt;
                    to=&amp;lt;chirico@squeezel.squeezel.com&amp;gt;, orig_to=&amp;lt;chirico&amp;gt;, relay=local, delay=0,&lt;br /&gt;
                          status=sent (delivered to command: exec /usr/bin/procmail)&lt;br /&gt;
&lt;br /&gt;
             Remove the &amp;quot;.forward&amp;quot; file from their home directory and you'll get the following:&lt;br /&gt;
&lt;br /&gt;
                    to=&amp;lt;chirico@squeezel.squeezel.com&amp;gt;, relay=cyrus, delay=0,&lt;br /&gt;
                          status=sent (squeezel.squeezel.com)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              mutt with IMAP?  (See TIP 190)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 189:&lt;br /&gt;
&lt;br /&gt;
     expand - convert tabs to spaces in a file.&lt;br /&gt;
&lt;br /&gt;
             $ expand How_to_Linux_and_Open_Source.txt &amp;gt; notabs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 190:&lt;br /&gt;
&lt;br /&gt;
     mutt with imap - assume you have setup imap (see tip 188). Now how do you configure&lt;br /&gt;
                      your &amp;quot;.muttrc&amp;quot; file to automatically connect, securely to the IMAP server?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       &lt;br /&gt;
     Below is an example of my &amp;quot;.muttrc&amp;quot; file. For this example, assume my password is &amp;quot;S0m3paSSw0r9&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             $ cat .muttrc&lt;br /&gt;
             set spoolfile = &amp;quot;imaps://chirico:S0m3paSSw0r9@squeezel.squeezel.com/&lt;br /&gt;
             set imap_force_ssl=yes&lt;br /&gt;
             set certificate_file=~/.mutt/certificates/72d31154.0&lt;br /&gt;
&lt;br /&gt;
     Now, you want to copy the certificate as a &amp;quot;file.pem&amp;quot; and run &amp;quot;c_rehash&amp;quot; to convert this&lt;br /&gt;
     file to a number. See the article. See the following article on how to do this under the &lt;br /&gt;
     fetchmail section.&lt;br /&gt;
&lt;br /&gt;
          http://souptonuts.sourceforge.net/postfix_tutorial.html&lt;br /&gt;
&lt;br /&gt;
     This is a quick summary of creating this key.&lt;br /&gt;
&lt;br /&gt;
             $ openssl s_client -connect squeezel.squeezel.com:995 -showcerts &amp;gt; file.pem&lt;br /&gt;
             $ c_rehash ~/.mutt/certificates&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 191:&lt;br /&gt;
&lt;br /&gt;
     Apache - CGI scripts.  There are two ways to enable CGI scripts. The second method is the&lt;br /&gt;
              prefered method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           First way, the easy way. Look for the &amp;quot;http.conf&amp;quot; file. On Fedora Core, this file can be&lt;br /&gt;
           found under &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;. Edit this file as follows to make &lt;br /&gt;
           &amp;quot;http://squeezel.squeezel.com/chirico-cgi/&amp;quot; execute scripts.&lt;br /&gt;
&lt;br /&gt;
                     ScriptAlias /chirico-cgi/ &amp;quot;/home/chirico/cgi-bin/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           Second way, the better way. Instead of doing the above, make the following change in &lt;br /&gt;
           &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                     &amp;lt;Directory /home/chirico/cgi-bin&amp;gt;&lt;br /&gt;
                      Options +ExecCGI&lt;br /&gt;
                      SetHandler chirico-cgi&lt;br /&gt;
                     &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Running a test script. Now copy the following test script into the directory &amp;quot;/home/chirico/cgi-bin&amp;quot;&lt;br /&gt;
        and change the rights to execute for the user running this.&lt;br /&gt;
&lt;br /&gt;
                  #!/bin/sh&lt;br /&gt;
                  # Save as test.cgi&lt;br /&gt;
                  #  chown apache.apache test.cgi&lt;br /&gt;
                  #  chmod 700 test.cgi&lt;br /&gt;
                  echo &amp;quot;Content-Type: text/html&amp;quot;&lt;br /&gt;
                  echo&lt;br /&gt;
                  echo &amp;quot;Hello world from user &amp;lt;b&amp;gt;`whoami`&amp;lt;/b&amp;gt;! &amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 192:&lt;br /&gt;
&lt;br /&gt;
     Bash - using getopts for your bash scripts.&lt;br /&gt;
&lt;br /&gt;
                   #!/bin/bash&lt;br /&gt;
                   while getopts &amp;quot;ab:cd:&amp;quot; Option&lt;br /&gt;
                   # b and d take arguments&lt;br /&gt;
                   #&lt;br /&gt;
                   do&lt;br /&gt;
                     case $Option in&lt;br /&gt;
                       a) echo -e &amp;quot;a = $OPTIND&amp;quot;;;&lt;br /&gt;
                       b) echo -e &amp;quot;b = $OPTIND $OPTARG&amp;quot;;;&lt;br /&gt;
                       c) echo -e &amp;quot;c = $OPTIND&amp;quot;;;&lt;br /&gt;
                       d) echo -e &amp;quot;d = $OPTIND $OPTARG&amp;quot;;;&lt;br /&gt;
                    esac&lt;br /&gt;
                  done&lt;br /&gt;
                  shift $(($OPTIND - 1))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 193:&lt;br /&gt;
&lt;br /&gt;
     Sieve - creating sieve recipes with &amp;quot;sieveshell&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     The following sieve script put all jefferson.edu mail into the &lt;br /&gt;
     folder jefferson. This assumes that I have already created the IMP &lt;br /&gt;
     directory, or mail box (INBOX.jefferson), which can be done in mutt &lt;br /&gt;
     with the &amp;quot;C&amp;quot; command. Below is an example of finding &amp;quot;jefferson.edu&amp;quot;&lt;br /&gt;
     anywhere in the header. &lt;br /&gt;
&lt;br /&gt;
         # This is a file named jefferson.siv&lt;br /&gt;
         require [&amp;quot;fileinto&amp;quot;];&lt;br /&gt;
         if header :contains &amp;quot;Received&amp;quot; &amp;quot;from jefferson.edu&amp;quot; {&lt;br /&gt;
           fileinto &amp;quot;INBOX.jefferson&amp;quot;;&lt;br /&gt;
           stop;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
     Now, from the command propt execute &amp;quot;sieveshell&amp;quot; with the hostname of the&lt;br /&gt;
     imap server. My server is squeezel.squeezel.com, so I would execute the &lt;br /&gt;
     following:&lt;br /&gt;
&lt;br /&gt;
          $ sieveshell squeezel.squeezel.com&lt;br /&gt;
          connecting to squeezel.squeezel.com&lt;br /&gt;
          Please enter your password:****&lt;br /&gt;
          &amp;gt; put jefferson.siv&lt;br /&gt;
          &amp;gt; activate jefferson.siv&lt;br /&gt;
          &amp;gt; list&lt;br /&gt;
          jefferson.siv  &amp;lt;- active script&lt;br /&gt;
          &amp;gt; quit&lt;br /&gt;
&lt;br /&gt;
     Note the put brings in the script. And you need to activiate it.&lt;br /&gt;
&lt;br /&gt;
     You can activate a sieve script for any user on your system if you are&lt;br /&gt;
     root. This is an example of activating a script for user chirico. Assume&lt;br /&gt;
     below the root prompt is &amp;quot;#&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          # sieveshell -a chirico -u chirico squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
     You can also automate everything from a bash script. But note after&lt;br /&gt;
     the -e the commands, and not a file with the commands, follows within&lt;br /&gt;
     quotes. This is the script I use for my home system.&lt;br /&gt;
&lt;br /&gt;
         #!/bin/bash&lt;br /&gt;
         sieveshell -a chirico -u chirico -e 'deactivate&lt;br /&gt;
         delete chirico.siv&lt;br /&gt;
         put chirico.siv&lt;br /&gt;
         activate chirico.siv&lt;br /&gt;
         list&lt;br /&gt;
         '  squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     References:&lt;br /&gt;
         http://wiki.fastmail.fm/index.php/SieveRecipes&lt;br /&gt;
         http://www.cyrusoft.com/sieve/#documents&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 194:&lt;br /&gt;
&lt;br /&gt;
     emacs - editing files remotely with tramp. Tramp comes with the latest version of emacs.&lt;br /&gt;
             That means if you're using Fedora core 4, with emacs, you have tramp. This is &lt;br /&gt;
             ideal for editing files on remote computers that do not use emacs.&lt;br /&gt;
&lt;br /&gt;
             Edit the &amp;quot;.emacs&amp;quot; file and add the following line:&lt;br /&gt;
&lt;br /&gt;
                 (require 'tramp)&lt;br /&gt;
                 (setq tramp-default-method &amp;quot;scp&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
             Now, to edit a file on computer tape.squeezel.com (C-x, C-f) and&lt;br /&gt;
             enter the following in Find file:&lt;br /&gt;
&lt;br /&gt;
                 Find file:/chirico@tape.squeezel.com:test.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             References:&lt;br /&gt;
&lt;br /&gt;
                    http://savannah.gnu.org/projects/tramp/&lt;br /&gt;
&lt;br /&gt;
             &lt;br /&gt;
&lt;br /&gt;
TIP 195:&lt;br /&gt;
&lt;br /&gt;
     trusted X11 forwarding - running gnome and KDE both on one screen, at the same&lt;br /&gt;
             time securely. The following assumes gnome is running on the current&lt;br /&gt;
             computer and &amp;quot;closet.squeezel.com&amp;quot; has KDE&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y  closet.squeezel.com&lt;br /&gt;
              $ startkde&lt;br /&gt;
&lt;br /&gt;
          Or assume you want to run gnome on &amp;quot;closet.squeezel.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y  closet.squeezel.com&lt;br /&gt;
              $ gnome-session&lt;br /&gt;
&lt;br /&gt;
          By default Fedora Core allows ForwardX11 over ssh. Note you want to use&lt;br /&gt;
          the -Y option above and NOT -X. &lt;br /&gt;
&lt;br /&gt;
          Suppose you want a remote &amp;quot;gnome-session&amp;quot; on ctl-alt-F12. Below is an &lt;br /&gt;
          example of getting the remote computer closet.squeezel.com, and you&lt;br /&gt;
          can still have the above configuration.&lt;br /&gt;
&lt;br /&gt;
          First you must allow magic cookies for each server connection.&lt;br /&gt;
             &lt;br /&gt;
              $ MCOOKIE=$(mcookie)&lt;br /&gt;
              $ xauth add $(hostname)/unix:1 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
              $ xauth add localhost/unix:1 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
  &lt;br /&gt;
          Again, note that you have to add this for EACH connection. So if you wanted 2 as well&lt;br /&gt;
&lt;br /&gt;
              $ MCOOKIE=$(mcookie)&lt;br /&gt;
              $ xauth add $(hostname)/unix:2 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
              $ xauth add localhost/unix:2 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
&lt;br /&gt;
          On squeezel.squeezel.com create a new xterm. If :1 is take below&lt;br /&gt;
          try :2. The vt12 is for switching to ctl-alt-F12.&lt;br /&gt;
&lt;br /&gt;
              $ xinit -- :1 vt12&lt;br /&gt;
&lt;br /&gt;
          Note, if you do not add the above cookies, you will get the follow error:&lt;br /&gt;
         &lt;br /&gt;
               Xlib: connection to &amp;quot;:1.0&amp;quot; refused by server&lt;br /&gt;
               Xlib: No protocol specified&lt;br /&gt;
&lt;br /&gt;
          The screen may be hard to read. At this point ssh -Y to the remote computer.&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y closet.squeezel.com&lt;br /&gt;
              $ gnome-session&lt;br /&gt;
&lt;br /&gt;
          Yes, you will get errors about sound and some custom drivers is the remove &lt;br /&gt;
          computer has different hardware. After is loads, you can switch back and&lt;br /&gt;
          forth between session with (ctl-alt-F12)  and (ctl-alt-F7)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 196:&lt;br /&gt;
&lt;br /&gt;
     Suspend ssh session - you have just sshed into a computer &amp;quot;ssh -l user example.com&amp;quot;, and you&lt;br /&gt;
          want to get back to the terminal prompt of the computer you started with. Escapte, by &lt;br /&gt;
          default with ssh is &amp;quot;~&amp;quot;, so enter &amp;quot;~&amp;quot; followed by &amp;quot;ctl-z&amp;quot; to suspend.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 197:&lt;br /&gt;
&lt;br /&gt;
     Quick way to send a text file &lt;br /&gt;
&lt;br /&gt;
              $ sendmail -f mike.chirico@gmail.com mchirico@comcast.net &amp;lt; /etc/fstab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 198:&lt;br /&gt;
&lt;br /&gt;
     size - determining the size of the text segment, data segment, and &amp;quot;bss&amp;quot; or uninitialized data segment.&lt;br /&gt;
&lt;br /&gt;
              $ size /bin/sh /bin/bash&lt;br /&gt;
               text        data     bss     dec     hex filename&lt;br /&gt;
              586946      22444   18784  628174   995ce /bin/sh&lt;br /&gt;
              586946      22444   18784  628174   995ce /bin/bash&lt;br /&gt;
&lt;br /&gt;
          Note above that &amp;quot;/bin/sh&amp;quot; and &amp;quot;/bin/bash&amp;quot; have equal text,data and bss numbers. It's&lt;br /&gt;
          highly likely that these are the same programs.&lt;br /&gt;
&lt;br /&gt;
              $ ls -l /bin/sh&lt;br /&gt;
               lrwxrwxrwx  1 root root 4 Jan 14  2005 /bin/sh -&amp;gt; bash&lt;br /&gt;
&lt;br /&gt;
          Yep, it's the same program. Here's a further definition of each segment.&lt;br /&gt;
&lt;br /&gt;
              Text segment: The machine instructions that the CPU executes. This is usually&lt;br /&gt;
                            read only and sharable.&lt;br /&gt;
&lt;br /&gt;
              Data segment: Contains initialized variables in a program. You also know these&lt;br /&gt;
                            as declarations and definitions.&lt;br /&gt;
&lt;br /&gt;
                               int max = 200;&lt;br /&gt;
&lt;br /&gt;
              Uninitialized data segment: Think of this as a declaration only, or data that&lt;br /&gt;
                            is only initialized by the kernel to arithmetic 0 or null pointers&lt;br /&gt;
                            before program execution.&lt;br /&gt;
&lt;br /&gt;
                               char s[10];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 199:&lt;br /&gt;
&lt;br /&gt;
     Using the at command.&lt;br /&gt;
&lt;br /&gt;
       Below is a simple example if running the ls command at 11:42am that&lt;br /&gt;
       will send mail -m to the user that executed it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       We'll execute job1 defined as follows and set to be executable. &lt;br /&gt;
&lt;br /&gt;
           $ cat ./job1&lt;br /&gt;
           #!/bin/bash&lt;br /&gt;
           date &amp;gt;&amp;gt; /tmp/job1&lt;br /&gt;
&lt;br /&gt;
       The at command is listed below. For queue &amp;quot;-q&amp;quot; names you can only&lt;br /&gt;
       specify one letter. Here we're using x. The letter determines the&lt;br /&gt;
       priority with &amp;quot;a&amp;quot; the highest.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x  -f ./job1 -m  11:54am&lt;br /&gt;
           job 3 at 2005-10-04 11:54&lt;br /&gt;
&lt;br /&gt;
       Now, if you execute the atq command, you'll get the following.&lt;br /&gt;
&lt;br /&gt;
           $ atq&lt;br /&gt;
           3       2005-10-04 11:54 x chirico&lt;br /&gt;
&lt;br /&gt;
       It's also possible to execute jobs at the command line entering&lt;br /&gt;
       a ctl-d at the end of the input.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x  -m 12:08pm&lt;br /&gt;
           at&amp;gt; ls -l&lt;br /&gt;
           at&amp;gt; who&lt;br /&gt;
           at&amp;gt; date&lt;br /&gt;
           at&amp;gt; ^D&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Or for a job to execute 1 minute from now.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x -m `date -d '1 minute' +&amp;quot;%H:%M&amp;quot;`&lt;br /&gt;
           at&amp;gt; ls -l&lt;br /&gt;
           at&amp;gt; date&lt;br /&gt;
     &lt;br /&gt;
&lt;br /&gt;
     Important points: The atd daemon must be running. To check if&lt;br /&gt;
      it's running do the following:&lt;br /&gt;
&lt;br /&gt;
            $ /etc/init.d/atd status&lt;br /&gt;
&lt;br /&gt;
      Also, if there is an /etc/at.allow file, then only users in that&lt;br /&gt;
      file will be allowed to execute at.&lt;br /&gt;
&lt;br /&gt;
      If /etc/at.deny exists but is empty and there is no /etc/at.allow,&lt;br /&gt;
      then, everyone can execute the at command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 200:&lt;br /&gt;
&lt;br /&gt;
     lsusb - command will display all USB buses and all devices connected.&lt;br /&gt;
&lt;br /&gt;
        $ lsusb&lt;br /&gt;
        Bus 005 Device 003: ID 413c:2010 Dell Computer Corp.&lt;br /&gt;
        Bus 005 Device 002: ID 413c:1003 Dell Computer Corp.&lt;br /&gt;
        Bus 005 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 004 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 003 Device 003: ID 0fc5:1227 Delcom Engineering&lt;br /&gt;
        Bus 003 Device 002: ID 046d:c016 Logitech, Inc. Optical Mouse&lt;br /&gt;
        Bus 003 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 002 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 001 Device 001: ID 0000:0000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 201:&lt;br /&gt;
&lt;br /&gt;
     Memory fragmentation - if you suspect workload memory fragmentation issues&lt;br /&gt;
     and you want to monitor the current state of you system, then, consider&lt;br /&gt;
     looking at the output from /proc/buddyinfo on recent kernels.&lt;br /&gt;
&lt;br /&gt;
        $ cat /proc/buddyinfo&lt;br /&gt;
      Node 0, zone      DMA    541    218     42      2      0      0      0      1      1      1      0 &lt;br /&gt;
      Node 0, zone   Normal   2508   2614     52      1      5      5      0      1      1      1      0 &lt;br /&gt;
      Node 0, zone  HighMem      0      1      3      0      1      0      0      0      0      0      0 &lt;br /&gt;
&lt;br /&gt;
     The following definition is taken from  ./Documentation/filesystems/proc.txt in the &lt;br /&gt;
     Linux kernel source.&lt;br /&gt;
&lt;br /&gt;
       Each column represents the number of pages of a certain order which are&lt;br /&gt;
       available.  In this case, there are 0 chunks of 2^0*PAGE_SIZE available in&lt;br /&gt;
       ZONE_DMA, 4 chunks of 2^1*PAGE_SIZE in ZONE_DMA, 101 chunks of 2^4*PAGE_SIZE&lt;br /&gt;
       available in ZONE_NORMAL, etc...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 202:&lt;br /&gt;
&lt;br /&gt;
     arp - Linux ARP kernel moduel.  This command implements the Address Resolution Protocol.&lt;br /&gt;
&lt;br /&gt;
     This is an example of the command.&lt;br /&gt;
&lt;br /&gt;
        $ arp&lt;br /&gt;
        Address                  HWtype  HWaddress           Flags Mask            Iface&lt;br /&gt;
        tape.squeezel.com        ether   00:50:DA:60:5B:AD   C                     eth0&lt;br /&gt;
        squeezel.squeezel.com    ether   00:11:11:8A:BE:3F   C                     eth0&lt;br /&gt;
        gw.squeezel.com          ether   00:0F:66:47:15:73   C                     eth0&lt;br /&gt;
&lt;br /&gt;
       &lt;br /&gt;
TIP 203:&lt;br /&gt;
&lt;br /&gt;
     dbench - performance monitoring. &lt;br /&gt;
&lt;br /&gt;
     So, how does your system react when the load average is above 600. Have you even seen a &lt;br /&gt;
     computer with a load average of 600? Well, this could be your chance. &lt;br /&gt;
&lt;br /&gt;
         Reference: http://freshmeat.net/projects/dbench/&lt;br /&gt;
&lt;br /&gt;
     The following gives a load average of 10 on my system.&lt;br /&gt;
&lt;br /&gt;
        $ dbench 34&lt;br /&gt;
&lt;br /&gt;
     If you want a higher load, just increase the number.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 204:&lt;br /&gt;
&lt;br /&gt;
     /etc guide - a listing of common files in the /etc directory.&lt;br /&gt;
&lt;br /&gt;
        /etc/exports: this file is used to configure NFS.&lt;br /&gt;
&lt;br /&gt;
        /etc/ftpusers: the users on your system who are restricted from FTP login.&lt;br /&gt;
&lt;br /&gt;
        /etc/motd: message of the day, which users see after login.&lt;br /&gt;
&lt;br /&gt;
        /etc/named.conf: DNS config file.&lt;br /&gt;
&lt;br /&gt;
        /etc/profile: common user information.&lt;br /&gt;
&lt;br /&gt;
        /etc/inittab: this file contains runlevel start information.&lt;br /&gt;
&lt;br /&gt;
        /etc/services: the services and their respective ports.&lt;br /&gt;
&lt;br /&gt;
        /etc/shells: this contains the names of all shells installed on the system.&lt;br /&gt;
&lt;br /&gt;
        /etc/passwd: this file contains user information.&lt;br /&gt;
&lt;br /&gt;
        /etc/group: security group rights.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
TIP 205: &lt;br /&gt;
&lt;br /&gt;
     logger - is a bash command utility for writing to /var/log/messages or the&lt;br /&gt;
            other files defined in /etc/syslog.conf.&lt;br /&gt;
&lt;br /&gt;
            $ logger -t TEST more of a test here&lt;br /&gt;
&lt;br /&gt;
         This is what shows up in /var/log/messages&lt;br /&gt;
  &lt;br /&gt;
            Oct 28 07:15:50 squeezel TEST: more of a test here&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
TIP 206: &lt;br /&gt;
&lt;br /&gt;
     accton, lastcomm - accouting on and last command. This is &lt;br /&gt;
         a way to monitor users on your system. As root, you &lt;br /&gt;
         would implement this as follows:&lt;br /&gt;
&lt;br /&gt;
           $ accton -h&lt;br /&gt;
            Usage: accton [-hV] [file]&lt;br /&gt;
            [--help] [--version]&lt;br /&gt;
&lt;br /&gt;
            The system's default process accounting file is /var/account/pacct.&lt;br /&gt;
&lt;br /&gt;
         Note the default file location is /var/account/pacct so we'll turn&lt;br /&gt;
         it on system wide with the following command.&lt;br /&gt;
&lt;br /&gt;
           $ accton /var/account/pacct&lt;br /&gt;
&lt;br /&gt;
         Now take a look at this file. It will grow. To see command that&lt;br /&gt;
         are executed, use the lastcomm command.&lt;br /&gt;
&lt;br /&gt;
           $ lastcomm&lt;br /&gt;
&lt;br /&gt;
         The above command gives output for all users. To get the data&lt;br /&gt;
         for user &amp;quot;chirico&amp;quot; execute the following command:&lt;br /&gt;
&lt;br /&gt;
           $ lastcomm --user chirico&lt;br /&gt;
&lt;br /&gt;
         You can also get a summary of commands with sa.&lt;br /&gt;
&lt;br /&gt;
           [chirico@big ~]$ sa&lt;br /&gt;
           30       5.23re       0.00cp    10185k&lt;br /&gt;
           11       4.83re       0.00cp     8961k   ***other&lt;br /&gt;
            8       0.13re       0.00cp    19744k   nagios*&lt;br /&gt;
            4       0.00re       0.00cp     2542k   automount*&lt;br /&gt;
            3       0.00re       0.00cp      680k   sa&lt;br /&gt;
            2       0.13re       0.00cp    17424k   check_ping&lt;br /&gt;
            2       0.13re       0.00cp      978k   ping&lt;br /&gt;
&lt;br /&gt;
         To turn off accounting, execute accton without a filename.&lt;br /&gt;
&lt;br /&gt;
           $ accton&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 207:&lt;br /&gt;
&lt;br /&gt;
     CPU Temperature on a laptop. The following is the temperature&lt;br /&gt;
       of my Dell laptop. &lt;br /&gt;
&lt;br /&gt;
           $ cat /proc/acpi/thermal_zone/THM/temperature&lt;br /&gt;
           temperature:             58 C&lt;br /&gt;
&lt;br /&gt;
      &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 208:&lt;br /&gt;
&lt;br /&gt;
     script -f with mkfifo to allow another user to view what you type&lt;br /&gt;
          in real-time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Step 1.  Create a fifo (first in first out) file that the other&lt;br /&gt;
              user can view. For this example create the file /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
               [chirico@laptop ~]$ mkfifo /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
        Step 2.  Have the second user, voyeur user, cat this file. Output will block&lt;br /&gt;
              for them until you complete step 3. The other user, voyer,&lt;br /&gt;
              is executing the command below.&lt;br /&gt;
 &lt;br /&gt;
               [voyeur@laptop ~]$ cat /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
        Step 3.  The original user runs the following command.&lt;br /&gt;
&lt;br /&gt;
               [chirico@laptop ~]$ script -f  /tmp/scriptout&lt;br /&gt;
               Script started, file is /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
             Now anything typed, including a vi session, will be displayed to the&lt;br /&gt;
             voyeur user in step 2. &lt;br /&gt;
&lt;br /&gt;
        See TIP 46.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 209:&lt;br /&gt;
&lt;br /&gt;
     fsck forced on next reboot.  To do this, as root issue the following commands.&lt;br /&gt;
&lt;br /&gt;
            $ cd /&lt;br /&gt;
            $ touch forcefsck&lt;br /&gt;
&lt;br /&gt;
          Now reboot the system, and when it comes up fsck will be forced on the system.&lt;br /&gt;
&lt;br /&gt;
            $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 210:&lt;br /&gt;
&lt;br /&gt;
     /dev/random and /dev/urandom differ in their random generating properties. /dev/random&lt;br /&gt;
        only returns bytes when enough noise has been generated from the entropy pool. In&lt;br /&gt;
        contrast /dev/urandom will always return bytes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference: http://sourceforge.net/direct-dl/mchirico/cpearls/simple_but_common.tar.gz (rand.c)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 211:&lt;br /&gt;
&lt;br /&gt;
     Want to find out the speed of your NIC?  (Full Duplex or Half), then use ethtool.&lt;br /&gt;
&lt;br /&gt;
               [root@squeezel ~]# ethtool eth0&lt;br /&gt;
               Settings for eth0:&lt;br /&gt;
                       Supported ports: [ MII ]&lt;br /&gt;
                       Supported link modes:   10baseT/Half 10baseT/Full&lt;br /&gt;
                                               100baseT/Half 100baseT/Full&lt;br /&gt;
                                               1000baseT/Half 1000baseT/Full&lt;br /&gt;
                       Supports auto-negotiation: Yes&lt;br /&gt;
                       Advertised link modes:  10baseT/Half 10baseT/Full&lt;br /&gt;
                                               100baseT/Half 100baseT/Full&lt;br /&gt;
                                               1000baseT/Half 1000baseT/Full&lt;br /&gt;
                       Advertised auto-negotiation: Yes&lt;br /&gt;
                       Speed: 100Mb/s&lt;br /&gt;
                       Duplex: Full&lt;br /&gt;
                       Port: Twisted Pair&lt;br /&gt;
                       PHYAD: 1&lt;br /&gt;
                       Transceiver: internal&lt;br /&gt;
                       Auto-negotiation: on&lt;br /&gt;
                       Supports Wake-on: g&lt;br /&gt;
                       Wake-on: d&lt;br /&gt;
                       Current message level: 0x000000ff (255)&lt;br /&gt;
                       Link detected: yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 212:&lt;br /&gt;
&lt;br /&gt;
     rpm install hang? You might need to delete the lock state information. &lt;br /&gt;
&lt;br /&gt;
        $ nl /etc/rc.d/rc.sysinit | grep rpm&lt;br /&gt;
        720   rm -f /var/lib/rpm/__db* &amp;amp;&amp;gt; /dev/null&lt;br /&gt;
&lt;br /&gt;
     Note the command &lt;br /&gt;
&lt;br /&gt;
        $ rm -f /var/lib/rpm/__db*&lt;br /&gt;
&lt;br /&gt;
     Because sometimes you will run &amp;quot;rpm -ivh somerpm&amp;quot; and it will just sit&lt;br /&gt;
     there.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 213:&lt;br /&gt;
&lt;br /&gt;
     Apache - limit access to certain directories based on IP address in the&lt;br /&gt;
         httpd.conf file.&lt;br /&gt;
&lt;br /&gt;
          You can do this completely from /etc/httpd/conf/httpd.conf which&lt;br /&gt;
          are shown below for multiple IP addresses. Note that all 3 setting&lt;br /&gt;
          are the same.&lt;br /&gt;
&lt;br /&gt;
                10.0.0.0/255.0.0.0&lt;br /&gt;
                10.0.0.0/8&lt;br /&gt;
                10&lt;br /&gt;
&lt;br /&gt;
          However, the following is different&lt;br /&gt;
&lt;br /&gt;
                10.0.0.0/24   only allows 10.0.0.1 to 10.0.0.254&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Some complete settings in /etc/httpd/conf/httpd.conf &lt;br /&gt;
&lt;br /&gt;
             &amp;lt;Directory /var/www/html/chirico/&amp;gt;&lt;br /&gt;
                 Order allow,deny&lt;br /&gt;
                 Allow from 10.0.0.0/8      # All 10.&lt;br /&gt;
                 Allow from 192.168.0.0/16  # All 192.168&lt;br /&gt;
                 Allow from 127             # All 127.&lt;br /&gt;
             &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          Don't forget to reload httpd with the following command.&lt;br /&gt;
        &lt;br /&gt;
             $ /etc/init.d/httpd reload&lt;br /&gt;
&lt;br /&gt;
          &lt;br /&gt;
&lt;br /&gt;
TIP 214:&lt;br /&gt;
&lt;br /&gt;
     Open Files - determining how many files are currently open.&lt;br /&gt;
&lt;br /&gt;
             $ cat /proc/sys/fs/file-nr&lt;br /&gt;
             2030    263     104851&lt;br /&gt;
              |       |        \- maximum open file descriptors &lt;br /&gt;
              |       |         &lt;br /&gt;
              |       \- total free allocated file descriptors&lt;br /&gt;
              |&lt;br /&gt;
              (Total allocated file descriptors since boot)&lt;br /&gt;
&lt;br /&gt;
        Note the maximum number can be set or changed.&lt;br /&gt;
&lt;br /&gt;
              $ cat /proc/sys/fs/file-max&lt;br /&gt;
              104851&lt;br /&gt;
&lt;br /&gt;
        To change this&lt;br /&gt;
&lt;br /&gt;
              $ echo &amp;quot;804854&amp;quot; &amp;gt; /proc/sys/fs/file-max&lt;br /&gt;
 &lt;br /&gt;
        Note lsof | wc -l will report higher numbers because this includes&lt;br /&gt;
        open files that are not using file descriptors such as directories,&lt;br /&gt;
        memory mapped files, and executable text files.&lt;br /&gt;
&lt;br /&gt;
        (Reference http://www.netadmintools.com/art295.html&lt;br /&gt;
         and also see the man page for this: man 5 proc )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 215:&lt;br /&gt;
&lt;br /&gt;
     Ctrl-Alt-Del will cause an immediate reboot, without syncing dirty buffers by&lt;br /&gt;
     setting the value &amp;gt; 0 in /proc/sys/kernel/ctrl-alt-del.&lt;br /&gt;
&lt;br /&gt;
               $ echo 1 &amp;gt; /proc/sys/kernel/ctrl-alt-del&lt;br /&gt;
       &lt;br /&gt;
&lt;br /&gt;
        (Reference: man 5 proc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 216:&lt;br /&gt;
&lt;br /&gt;
     Redefining keys in X using xev and xmodmap.  The program xev, used in an X window &lt;br /&gt;
     terminal screen will display information on mouse movements, keys pressed and &lt;br /&gt;
     released.&lt;br /&gt;
&lt;br /&gt;
        $ xev&lt;br /&gt;
&lt;br /&gt;
     Now type shift-4 and you'll notice the event details below:&lt;br /&gt;
&lt;br /&gt;
        KeyPress event, serial 29, synthetic NO, window 0x3800001,&lt;br /&gt;
            root 0x60, subw 0x0, time 55307049, (418,242), root:(428,339),&lt;br /&gt;
            state 0x1, keycode 13 (keysym 0x24, dollar), same_screen YES,&lt;br /&gt;
            XLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
            XmbLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
            XFilterEvent returns: False&lt;br /&gt;
        &lt;br /&gt;
        KeyRelease event, serial 29, synthetic NO, window 0x3800001,&lt;br /&gt;
            root 0x60, subw 0x0, time 55307184, (418,242), root:(428,339),&lt;br /&gt;
            state 0x1, keycode 13 (keysym 0x24, dollar), same_screen YES,&lt;br /&gt;
            XLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
       &lt;br /&gt;
     So, if you want to redefine this key to say copyright, see (/usr/X11R6/include/X11/keysymdef.h)&lt;br /&gt;
     you would type the following.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 copyright'&lt;br /&gt;
&lt;br /&gt;
     To get the key back to the dollar, issue the following command.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 dollar'&lt;br /&gt;
&lt;br /&gt;
     By the way it's possible to define multiple key codes for a sigle key. You'll need&lt;br /&gt;
     to have a key defined as the Mode_switch. Perhaps you'd like to use the Windows key,&lt;br /&gt;
     or the key with the Microsoft logo on it, since you're using Linux. This key is&lt;br /&gt;
     keycode 115&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 115 = Mode_switch'&lt;br /&gt;
&lt;br /&gt;
     Now you could define 3 values to the shift-4. For this example use ld, Yen and dollar.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 dollar sterling yen'&lt;br /&gt;
&lt;br /&gt;
     So pressing the keys gives you the following:&lt;br /&gt;
&lt;br /&gt;
          shift-$          (dollar sign)&lt;br /&gt;
          Windows-$        (lb sign)&lt;br /&gt;
          Windows-shift-$  (Yen sign)&lt;br /&gt;
&lt;br /&gt;
     You could go crazy and redefine all you keys.&lt;br /&gt;
&lt;br /&gt;
     (Thanks to hisham for this tip).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 217:&lt;br /&gt;
&lt;br /&gt;
     Threads - which version of threads are you using?&lt;br /&gt;
&lt;br /&gt;
          $ getconf GNU_LIBPTHREAD_VERSION&lt;br /&gt;
          NPTL 2.3.90&lt;br /&gt;
&lt;br /&gt;
     For a history on threads used with gcc reference the following:&lt;br /&gt;
          &lt;br /&gt;
          http://en.wikipedia.org/wiki/NPTL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 218:&lt;br /&gt;
&lt;br /&gt;
     Screenshots using ImageMagick. &lt;br /&gt;
&lt;br /&gt;
        If you want the entire screen, execute the following:&lt;br /&gt;
&lt;br /&gt;
            $ import -window root screen.png&lt;br /&gt;
&lt;br /&gt;
        Or to crosshair select the region with your mouse, execute &lt;br /&gt;
        the following instead.&lt;br /&gt;
&lt;br /&gt;
            $ import screen.png&lt;br /&gt;
&lt;br /&gt;
        KDE has the ability to take screenshots with the command below.&lt;br /&gt;
&lt;br /&gt;
            $ ksnapshot&lt;br /&gt;
&lt;br /&gt;
        GNOME likewise has a command too.&lt;br /&gt;
&lt;br /&gt;
            $ gnome-panel-screenshot --delay 6&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Visting ImageMagick again, the xwininfo command give window information and the id can be&lt;br /&gt;
        used to capture images with the import command.&lt;br /&gt;
&lt;br /&gt;
            $ xwininfo&lt;br /&gt;
&lt;br /&gt;
          xwininfo: Please select the window about which you&lt;br /&gt;
          would like information by clicking the&lt;br /&gt;
          mouse in that window.&lt;br /&gt;
&lt;br /&gt;
          xwininfo: Window id: 0x1e00007 &amp;quot;chirico@squeezel:/work/svn/souptonuts - Shell - Konsole&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          Absolute upper-left X:  4&lt;br /&gt;
          Absolute upper-left Y:  21&lt;br /&gt;
          Relative upper-left X:  0&lt;br /&gt;
          Relative upper-left Y:  0&lt;br /&gt;
          Width: 880&lt;br /&gt;
          Height: 510&lt;br /&gt;
          Depth: 24&lt;br /&gt;
          Visual Class: TrueColor&lt;br /&gt;
          Border width: 0&lt;br /&gt;
          Class: InputOutput&lt;br /&gt;
          Colormap: 0x20 (installed)&lt;br /&gt;
          Bit Gravity State: NorthWestGravity&lt;br /&gt;
          Window Gravity State: NorthWestGravity&lt;br /&gt;
          Backing Store State: NotUseful&lt;br /&gt;
          Save Under State: no&lt;br /&gt;
          Map State: IsViewable&lt;br /&gt;
          Override Redirect State: no&lt;br /&gt;
          Corners:  +4+21  -396+21  -396-493  +4-493&lt;br /&gt;
          -geometry 880x510+0+0&lt;br /&gt;
&lt;br /&gt;
        Now use the import command with the Window id. My example is shown below.&lt;br /&gt;
&lt;br /&gt;
             $ import -window 0x1e00007  id.miff&lt;br /&gt;
&lt;br /&gt;
        And to quickly display this image that you just saved, use the display command.&lt;br /&gt;
&lt;br /&gt;
             $ display id.miff &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 219:&lt;br /&gt;
&lt;br /&gt;
     File Access over SSH using FUSE (Filesystem in USErspace). This is a very good way to &lt;br /&gt;
     mount a remote filesystem locally. It's  like a secure NFS mount, but you don't require &lt;br /&gt;
     admin privileges on the remote computer. You do need to have fuse-sshfs installed on &lt;br /&gt;
     the local computer that will perform the filesystem mount.&lt;br /&gt;
&lt;br /&gt;
     The following works with Fedora Core 5. Only the users added to the fuse group can mout &lt;br /&gt;
     external drives. Below the user chirico is being added to the group fuse.&lt;br /&gt;
&lt;br /&gt;
             $ yum install fuse-sshfs&lt;br /&gt;
             $ usermod -a -G fuse chirico&lt;br /&gt;
     &lt;br /&gt;
     You'll need to reboot.&lt;br /&gt;
&lt;br /&gt;
             $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
             &lt;br /&gt;
     Next I'm going to mount the remote filesystem v0.squeezel.com. This is done as user chirico&lt;br /&gt;
     on the local computer. I'm using root on the remote computer v0.squeezel.com because I&lt;br /&gt;
     want to mount the complete drive.&lt;br /&gt;
&lt;br /&gt;
             $ mkdir v0&lt;br /&gt;
             $ sshfs root@v0.squeezel.com:/  v0&lt;br /&gt;
             $ cd v0&lt;br /&gt;
             $ ls -l&lt;br /&gt;
               bin   dev  home  lost+found     media  mnt  opt   q     sbin     srv  tmp  var&lt;br /&gt;
               boot  etc  lib   master_backup  misc   net  proc  root  selinux  sys  usr&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
     Now to unmount the filesystem&lt;br /&gt;
&lt;br /&gt;
             $ fusermount -u /home/chirico/v0&lt;br /&gt;
&lt;br /&gt;
     Yes, you can mount the filesystem on boot. Below shows an example entry for /etc/fstab, but&lt;br /&gt;
     this only allows user on the current system to view what is is /mnt/v0. &lt;br /&gt;
&lt;br /&gt;
             sshfs#root@v0.squeezel.com:/var/log             /mnt/v0 fuse defaults    0 0&lt;br /&gt;
&lt;br /&gt;
     References:&lt;br /&gt;
        (http://fuse.sourceforge.net/sshfs.html)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 220:&lt;br /&gt;
&lt;br /&gt;
     OpenVPN - A full-featured SSL VPN solution. The following demonstrates&lt;br /&gt;
               a very simple OpenVPN setup between two Fedora Core 5 computers&lt;br /&gt;
               big.squeezel.com 192.168.1.12 and tape.squeezel.com 192.168.1.155&lt;br /&gt;
&lt;br /&gt;
               As root install the package on both computers.&lt;br /&gt;
&lt;br /&gt;
                  $ yum -y install openvpn&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Setup on big.squeezel.com 192.168.1.12&lt;br /&gt;
&lt;br /&gt;
                  $ iptables -A INPUT -p udp -s 192.168.1.155  --dport 1194 -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tun+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A FORWARD -i tap+ -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
             Note - make sure you have commented out the following line &lt;br /&gt;
                    in /etc/sysconfig/iptables&lt;br /&gt;
&lt;br /&gt;
                  # -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
&lt;br /&gt;
             Now from continuting with the commands that need to be executed on &lt;br /&gt;
             big.squeezel.com 192.168.1.12 do one of the following&lt;br /&gt;
           &lt;br /&gt;
                  $ openvpn --remote tape.squeezel.com  --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 --verb 9&lt;br /&gt;
&lt;br /&gt;
             The above statement gives lots of errors. Once it's working you may want&lt;br /&gt;
             the following statement without the --verb 9 option.&lt;br /&gt;
&lt;br /&gt;
                  $ openvpn --remote tape.squeezel.com  --dev tun1 --ifconfig 10.4.0.1 10.4.0.2&lt;br /&gt;
&lt;br /&gt;
             After you finish the setup commands for tape.squeezel.com immediately below, you'll be&lt;br /&gt;
             able to access tape.squeezel.com as 10.4.0.2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Setup on tape.squeezel.com 192.168.1.155&lt;br /&gt;
&lt;br /&gt;
                  $ iptables -A INPUT -p udp -s 192.168.1.12  --dport 1194 -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tun+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A FORWARD -i tap+ -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
             Note - again, make sure you have commented out the following line &lt;br /&gt;
                    in /etc/sysconfig/iptables&lt;br /&gt;
&lt;br /&gt;
                  # -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
&lt;br /&gt;
             The openvpn commands are tape.squeezel.com are reversed from what is shown&lt;br /&gt;
             above.&lt;br /&gt;
&lt;br /&gt;
                  $ openvpn --remote big.squeezel.com --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 --verb 9&lt;br /&gt;
&lt;br /&gt;
             Or&lt;br /&gt;
                  $ openvpn --remote big.squeezel.com --dev tun1 --ifconfig 10.4.0.2 10.4.0.1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             Now you can access all services and ports from big.squeezel.com on 10.4.0.1 for &lt;br /&gt;
             such services as MySQL, secure Web, imap, etc. A quick test is nmap as follows:&lt;br /&gt;
&lt;br /&gt;
                  $ nmap -A -T4 10.4.0.1&lt;br /&gt;
&lt;br /&gt;
                  Starting Nmap 4.03 ( http://www.insecure.org/nmap/ ) at 2006-05-20 13:54 EDT&lt;br /&gt;
                  Interesting ports on 10.4.0.1:&lt;br /&gt;
                  (The 1671 ports scanned but not shown below are in state: closed)&lt;br /&gt;
                  PORT     STATE SERVICE VERSION&lt;br /&gt;
                  22/tcp   open  ssh     OpenSSH 4.3 (protocol 2.0)&lt;br /&gt;
                  111/tcp  open  rpcbind  2 (rpc #100000)&lt;br /&gt;
                  3306/tcp open  mysql   MySQL (unauthorized)&lt;br /&gt;
&lt;br /&gt;
                  Nmap finished: 1 IP address (1 host up) scanned in 7.116 seconds&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 221:&lt;br /&gt;
&lt;br /&gt;
     openssl - Some common commands.&lt;br /&gt;
&lt;br /&gt;
             Finding the openssldir (Directory for OpenSSL files).&lt;br /&gt;
&lt;br /&gt;
                  $ openssl version -a|grep OPENSSLDIR&lt;br /&gt;
                  OPENSSLDIR: &amp;quot;/etc/pki/tls&amp;quot;&lt;br /&gt;
&lt;br /&gt;
             Connect to a secure SMTP server with STARTTLS, assuming the server name is&lt;br /&gt;
             squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
                  $ openssl s_client -connect squeezel.squeezel.com:25 -starttls&lt;br /&gt;
&lt;br /&gt;
         &lt;br /&gt;
&lt;br /&gt;
      Reference (http://www.madboa.com/geek/openssl/)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 222:&lt;br /&gt;
&lt;br /&gt;
     Bash functions. This is easy, and I find it very useful to create bash functions&lt;br /&gt;
     for repeated commands. For example, suppose you want to create a quick bash function&lt;br /&gt;
     to cd to /var/log, tail messages and tail secure. You can create this function as&lt;br /&gt;
     follows:&lt;br /&gt;
&lt;br /&gt;
                  [root@v5 log]# m()&lt;br /&gt;
                  m()&lt;br /&gt;
                  &amp;gt; { cd /var/log&lt;br /&gt;
                  { cd /var/log&lt;br /&gt;
                  &amp;gt; tail messages&lt;br /&gt;
                  tail messages&lt;br /&gt;
                  &amp;gt; tail secure&lt;br /&gt;
                  tail secure&lt;br /&gt;
                  &amp;gt; }&lt;br /&gt;
                  }&lt;br /&gt;
                  &lt;br /&gt;
     Above I'm typing m() then hitting return. Note the echo on the next line followed&lt;br /&gt;
     by the prompt &amp;gt;. I then enter {. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 223:&lt;br /&gt;
&lt;br /&gt;
     Stats on DNS Server. You can get stats on your DNS server. &lt;br /&gt;
&lt;br /&gt;
       The following works for BIND 9:&lt;br /&gt;
&lt;br /&gt;
                  $ rndc stats&lt;br /&gt;
&lt;br /&gt;
         On my system I see the output in &amp;quot;/var/named/chroot/var/named/data/named_stats.txt&amp;quot;, which&lt;br /&gt;
         if an FC4 system. By the way, if you're using BIND 8, the command is &amp;quot;ndc stats&amp;quot;, but that&lt;br /&gt;
         has a completely different format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Format of the output&lt;br /&gt;
&lt;br /&gt;
            +++ Statistics Dump +++ (1153791199)&lt;br /&gt;
            success 297621&lt;br /&gt;
            referral 32&lt;br /&gt;
            nxrrset 21953&lt;br /&gt;
            nxdomain 33742&lt;br /&gt;
            recursion 28243&lt;br /&gt;
            failure 54&lt;br /&gt;
            --- Statistics Dump --- (1153791199)&lt;br /&gt;
&lt;br /&gt;
      The number (1153791199) can be converted with the date command.&lt;br /&gt;
&lt;br /&gt;
                  $ date -d '1970-01-01 1153791199 sec'&lt;br /&gt;
                  Tue Jul 25 02:33:19 EDT 2006&lt;br /&gt;
&lt;br /&gt;
      That's 1153791199 seconds since 1970-01-01 UCT. Which is 4 hours fast,&lt;br /&gt;
      from EDT.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 224:&lt;br /&gt;
&lt;br /&gt;
     snmp - simple network monitoring protocol. The following steps setup snmp on Fedora Core 5.&lt;br /&gt;
&lt;br /&gt;
                  $ yum install net-snmp*&lt;br /&gt;
&lt;br /&gt;
         Next add the following line in &amp;quot;/etc/snmp/snmpd.conf&amp;quot; at the bottom.&lt;br /&gt;
&lt;br /&gt;
                  rocommunity pA33worD&lt;br /&gt;
&lt;br /&gt;
         Start the snmp service.&lt;br /&gt;
&lt;br /&gt;
                  $ /etc/init.d/snmpd restart&lt;br /&gt;
&lt;br /&gt;
         Once started, from the command prompt, it's possible to get stats on the computer.&lt;br /&gt;
&lt;br /&gt;
                  $ snmpwalk -v 1 -c pA33worD localhost system&lt;br /&gt;
         Or&lt;br /&gt;
                  $ snmpwalk -v 1 -c pA33worD localhost interface&lt;br /&gt;
&lt;br /&gt;
         Or&lt;br /&gt;
                  $ snmpgetnext -v 1 -c pA33worD localhost sysUpTime&lt;br /&gt;
                  DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (26452) 0:04:24.52&lt;br /&gt;
&lt;br /&gt;
         Note the Timeticks is in 100th of a second. So the computer above has been running&lt;br /&gt;
         for 264.52 seconds.&lt;br /&gt;
&lt;br /&gt;
         Reference( TIP 225 shows how to use MRTG for gathering snmp stats).&lt;br /&gt;
                  http://www.net-snmp.org/tutorial/tutorial-5/commands/snmpv3.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 225:&lt;br /&gt;
&lt;br /&gt;
     MRTG - Multi Router Traffic Grapher.  &lt;br /&gt;
&lt;br /&gt;
                  $ cfgmaker --output=/etc/mrtg/v5.squeezel.com \&lt;br /&gt;
                    ifref=ip --global &amp;quot;workdir:/var/www/html/mrtg/stats&amp;quot;\&lt;br /&gt;
                    pA33worD@v5.squeezel.com&lt;br /&gt;
&lt;br /&gt;
        Reference: http://www.chinalinuxpub.com/doc/www.siliconvalleyccie.com/linux-hn/mrtg.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 226:&lt;br /&gt;
&lt;br /&gt;
     Back Trace - This is a method of getting a back trace for all processes on the system.&lt;br /&gt;
                  it assumes the following: a. Kernel was build with CONFIG_MAGIC_SYS-REQ &lt;br /&gt;
                  enabled (which Fedora 5 kernels are) b. You can get direct access to the &lt;br /&gt;
                  monitor.&lt;br /&gt;
&lt;br /&gt;
             Step 1.&lt;br /&gt;
&lt;br /&gt;
                  Ctl-Alt-F1 (This brings you to the text console)&lt;br /&gt;
&lt;br /&gt;
             Step 2.&lt;br /&gt;
&lt;br /&gt;
                  Alt-ScrollLock &lt;br /&gt;
                  Ctl-ScrollLock&lt;br /&gt;
          &lt;br /&gt;
                  Note above that's Alt-ScrollLock followed by Ctl-ScrollLock. You should see&lt;br /&gt;
                  a lot of text on the screen. To fast to read, but don't worry the text will&lt;br /&gt;
                  be in /var/log/messages at the end.&lt;br /&gt;
&lt;br /&gt;
                  On my system the ScrollLock key is next to the NumLock key. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 227:&lt;br /&gt;
&lt;br /&gt;
     Ext3 Tuning - One advantage of Ext3 over Ext2 is directory indexing, which  imporves file&lt;br /&gt;
                  access in directories containing large files or when the directory contains&lt;br /&gt;
                  many files. Directory indexing improves performance by using hashed binary &lt;br /&gt;
                  trees. &lt;br /&gt;
&lt;br /&gt;
                  There are two ways to enable dir_index. First, find the device using the mount&lt;br /&gt;
                  command.&lt;br /&gt;
&lt;br /&gt;
                      $ mount&lt;br /&gt;
&lt;br /&gt;
                      /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)&lt;br /&gt;
                      proc on /proc type proc (rw)&lt;br /&gt;
                      sysfs on /sys type sysfs (rw)&lt;br /&gt;
                      devpts on /dev/pts type devpts (rw,gid=5,mode=620)&lt;br /&gt;
                      /dev/sda1 on /boot type ext3 (rw) &amp;lt;--- This is the one you want&lt;br /&gt;
                      tmpfs on /dev/shm type tmpfs (rw)&lt;br /&gt;
                      none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)&lt;br /&gt;
                      sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)&lt;br /&gt;
                      automount(pid2001) on /net type autofs (rw,fd=4,pgrp=2001,minproto=2,maxproto=4)                   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                  From the above command, the device used is /dev/sda1.  Using the tune2fs command,&lt;br /&gt;
                  directory indexing will only apply to directories created after running the &lt;br /&gt;
                  command below.               &lt;br /&gt;
&lt;br /&gt;
                       $ tune2fs -O dir_index /dev/sda1&lt;br /&gt;
&lt;br /&gt;
                  However, if you want it to apply to all directories, use the e2fsck command as  &lt;br /&gt;
                  shown below:&lt;br /&gt;
&lt;br /&gt;
                       $ e2fsck -D -f /dev/sda1&lt;br /&gt;
&lt;br /&gt;
                  You'll need to bypass the warning message.&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
     Reference: &amp;quot;Tuning Journaling File Systems: A small amount of effort an dtime can yield big&lt;br /&gt;
                results&amp;quot;,by Steve Best. Linux Magazine, September 10, 2006. This author as has&lt;br /&gt;
                a very good book titled: &amp;quot;Linux Debugging and Performance Tuning.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 228:&lt;br /&gt;
&lt;br /&gt;
     NIC bonding - binding two or more NICs to one IP address to improve performance. The following&lt;br /&gt;
                instructions were done on Fedora Core 5.&lt;br /&gt;
&lt;br /&gt;
         Step 1.&lt;br /&gt;
             &lt;br /&gt;
            Create the file ifcfg-bond0 with the IP address, netmask and gateway. Shown&lt;br /&gt;
            below is my file.&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-bond0&lt;br /&gt;
&lt;br /&gt;
                   DEVICE=bond0&lt;br /&gt;
                   IPADDR=192.168.1.12&lt;br /&gt;
                   NETMASK=255.255.255.0&lt;br /&gt;
                   GATEWAY=192.168.1.1&lt;br /&gt;
                   USERCTL=no&lt;br /&gt;
                   BOOTPROTO=none&lt;br /&gt;
                   ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
         Step 2.&lt;br /&gt;
&lt;br /&gt;
            Modify eth0, eth1 and eth2. Shown below are each one of my files. Note that&lt;br /&gt;
            you must comment out, or remove the ip address, netmask, gateway and hardware&lt;br /&gt;
            address from each one of these files, since settings should only come from&lt;br /&gt;
            the ifcfg-bond0 file above. I've chosen to comment out the lines, instead of &lt;br /&gt;
            removing, should I decide to unbond my NICS sometime in the future.&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth0&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:9D&lt;br /&gt;
                  #IPADDR=192.168.1.12&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  #GATEWAY=192.168.1.1&lt;br /&gt;
                  #USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  # Settings for Bond&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth1&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth1&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:C9&lt;br /&gt;
                  #IPADDR=192.168.1.13&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  #&lt;br /&gt;
                  # Settings for bonding&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth2&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth2&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:9D&lt;br /&gt;
                  #IPADDR=192.168.1.12&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  #GATEWAY=192.168.1.1&lt;br /&gt;
                  #USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
         Step 3.&lt;br /&gt;
&lt;br /&gt;
            Set the load parameters for bond0 bonding kernel module. Append the&lt;br /&gt;
            following lines to /etc/modprobe.conf &lt;br /&gt;
&lt;br /&gt;
                 # bonding commands &lt;br /&gt;
                 alias bond0 bonding&lt;br /&gt;
                 options bond0 mode=balance-alb miimon=100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Step 4.&lt;br /&gt;
&lt;br /&gt;
            Load the bond driver module from the command prompt.&lt;br /&gt;
&lt;br /&gt;
                 $ modprobe bonding&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Step 5.&lt;br /&gt;
&lt;br /&gt;
            Restart the network, or restart the computer. Note I restarted to computer,&lt;br /&gt;
            since my NICs above had MAC assignments.&lt;br /&gt;
&lt;br /&gt;
                 $ service network restart   # Or restart computer&lt;br /&gt;
&lt;br /&gt;
             Take a look at the proc settings. &lt;br /&gt;
&lt;br /&gt;
                 $ cat /proc/net/bonding/bond0 &lt;br /&gt;
                 Ethernet Channel Bonding Driver: v3.0.3 (March 23, 2006)&lt;br /&gt;
&lt;br /&gt;
                 Bonding Mode: adaptive load balancing&lt;br /&gt;
                 Primary Slave: None&lt;br /&gt;
                 Currently Active Slave: eth2&lt;br /&gt;
                 MII Status: up&lt;br /&gt;
                 MII Polling Interval (ms): 100&lt;br /&gt;
                 Up Delay (ms): 0&lt;br /&gt;
                 Down Delay (ms): 0&lt;br /&gt;
&lt;br /&gt;
                 Slave Interface: eth2&lt;br /&gt;
                 MII Status: up&lt;br /&gt;
                 Link Failure Count: 0&lt;br /&gt;
                 Permanent HW addr: 00:13:72:80:62:f0&lt;br /&gt;
            &lt;br /&gt;
     References:&lt;br /&gt;
&lt;br /&gt;
         http://www.cyberciti.biz/nixcraft/vivek/blogger/2006/04/linux-bond-or-team-multiple-network.php&lt;br /&gt;
          Good, well written article describing the steps above.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=24692&amp;amp;package_id=146474&lt;br /&gt;
          Documentation for bonding that can also be found in the kernel&lt;br /&gt;
          ./Documentation/networking/bonding.txt&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 229:&lt;br /&gt;
&lt;br /&gt;
     /etc/nsswitch.conf - System Databases and Name Service Switch configuration file. &lt;br /&gt;
&lt;br /&gt;
         This file determines lookup order of services. For example, to match a name&lt;br /&gt;
         to an IP address, an entry can be put into the /etc/hosts file. Or a DNS query&lt;br /&gt;
         can be made. What's the order?  Normally, it's the entry in the /etc/hosts file.&lt;br /&gt;
         because /etc/nsswitch.conf contains the following setting&lt;br /&gt;
        &lt;br /&gt;
            hosts:      files dns&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	 See man nsswitch.conf for more settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
THE FOLLOWING SECTIONS STARTS THE PROGRAMMING TIPS&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 1:&lt;br /&gt;
&lt;br /&gt;
     Simple open command that restarts the close if a signal&lt;br /&gt;
     occurs.  Also note, the POSIX standards committee decided&lt;br /&gt;
     all new functions would not use errno and would instead&lt;br /&gt;
     directly return the error number in the function.&lt;br /&gt;
&lt;br /&gt;
     A lot of functions return -1 on an error condition, then,&lt;br /&gt;
     set errno to the value of the error.  This will still work&lt;br /&gt;
     for all the well known functions; but, it's changing.&lt;br /&gt;
&lt;br /&gt;
     /* start of code open.c&lt;br /&gt;
        Compile gcc -o open open.c&lt;br /&gt;
&lt;br /&gt;
        Reference (Look for simple_but_common_x.x.x.tar.gz):&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79066&lt;br /&gt;
&lt;br /&gt;
                             */&lt;br /&gt;
     #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     #include &amp;lt;string.h&amp;gt;             /* for strerror(int errno) */&lt;br /&gt;
     #include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     #define BUFLEN 100&lt;br /&gt;
     extern int errno;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     int&lt;br /&gt;
     main (void)&lt;br /&gt;
     {&lt;br /&gt;
       int fp,error;&lt;br /&gt;
       char buf[BUFLEN+1];&lt;br /&gt;
&lt;br /&gt;
       if ((fp = open (&amp;quot;data&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1)&lt;br /&gt;
         {&lt;br /&gt;
           fprintf (stderr, &amp;quot;Can't open data: %s\n&amp;quot;, strerror (errno));&lt;br /&gt;
           return 1;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
       snprintf (buf, BUFLEN, &amp;quot;123&amp;quot;);&lt;br /&gt;
       write (fp, buf, strlen (buf));&lt;br /&gt;
&lt;br /&gt;
       // Restart close should a signal occur */&lt;br /&gt;
       while((( error = close (fp) ) == -1) &amp;amp;&amp;amp; (errno == EINTR));&lt;br /&gt;
       if(error == -1)&lt;br /&gt;
         perror(&amp;quot;Failed to close the file\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
       return 0;&lt;br /&gt;
      }&lt;br /&gt;
     /* end of open.c */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 2:&lt;br /&gt;
&lt;br /&gt;
     Example of setting the effective UID on a file&lt;br /&gt;
&lt;br /&gt;
     /*  start of code&lt;br /&gt;
       gcc uid_open.c -o uid_open&lt;br /&gt;
       su&lt;br /&gt;
       chown root.chirico uid_open&lt;br /&gt;
       chmod u+s uid_open&lt;br /&gt;
       exit&lt;br /&gt;
&lt;br /&gt;
       Now you can run this as chirico and write to the&lt;br /&gt;
       root directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     */&lt;br /&gt;
     #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;string.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     int main()&lt;br /&gt;
     {&lt;br /&gt;
             int fd;&lt;br /&gt;
&lt;br /&gt;
             if ((fd = open(&amp;quot;/root/datajunk&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1) {&lt;br /&gt;
                     fprintf(stderr, &amp;quot;Can't open file \n&amp;quot;);&lt;br /&gt;
                     return 1;&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
             write(fd, &amp;quot;0123456&amp;quot;, strlen(&amp;quot;0123456&amp;quot;));&lt;br /&gt;
             close(fd);&lt;br /&gt;
             return 0;&lt;br /&gt;
     }&lt;br /&gt;
&lt;br /&gt;
     /* end of code */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 3:&lt;br /&gt;
&lt;br /&gt;
     Writing a C http post.&lt;br /&gt;
&lt;br /&gt;
     For downloads reference:&lt;br /&gt;
      http://prdownloads.sourceforge.net/cpearls/spider.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 4:&lt;br /&gt;
&lt;br /&gt;
     Writing a 2.6.x Kernel Module:&lt;br /&gt;
&lt;br /&gt;
       Look for the latest version of &amp;quot;procreadwrite&amp;quot;.  This is a 2.6 kernel&lt;br /&gt;
       modules that demonstrates how to create /proc entires and write directly&lt;br /&gt;
       to user-land via tty.  It's updated to reflect replacement of &amp;quot;current-&amp;gt;tty&amp;quot;&lt;br /&gt;
       with &amp;quot;current-&amp;gt;signal-&amp;gt;tty&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79066&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 5:&lt;br /&gt;
&lt;br /&gt;
     Creating a filename with '\n'.  This goes with (TIP 71)&lt;br /&gt;
&lt;br /&gt;
         /**** topen.c ***********************************************************&lt;br /&gt;
           Filenames can be created with any character except the null character&lt;br /&gt;
           and a slash.&lt;br /&gt;
&lt;br /&gt;
           This example creates a file with returns '\n\n'&lt;br /&gt;
&lt;br /&gt;
           There's a way to remove a file by inode:&lt;br /&gt;
&lt;br /&gt;
               $ ls -libt *&lt;br /&gt;
&lt;br /&gt;
           And, once you know the inode&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec mv '{}' goodstuff \;&lt;br /&gt;
&lt;br /&gt;
           or&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec rm '{}' goodstuff \;&lt;br /&gt;
&lt;br /&gt;
           or&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec cat '{}' \;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Compile:&lt;br /&gt;
&lt;br /&gt;
             gcc -o topen -Wall -W -O2 -s -pipe  topen.c&lt;br /&gt;
&lt;br /&gt;
         Reference:&lt;br /&gt;
           http://prdownloads.sourceforge.net/cpearls/simple_but_common_0.0.14.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
         */&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         #include &amp;lt;string.h&amp;gt;             /* for strerror(int errno) */&lt;br /&gt;
         #include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         #define BUFLEN 100&lt;br /&gt;
         extern int errno;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         int&lt;br /&gt;
         main (void)&lt;br /&gt;
         {&lt;br /&gt;
           int fp,error;&lt;br /&gt;
           char buf[BUFLEN+1];&lt;br /&gt;
&lt;br /&gt;
           if ((fp = open (&amp;quot;\n\n\n\n\n\n\n\n\n&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1)&lt;br /&gt;
             {&lt;br /&gt;
               fprintf (stderr, &amp;quot;Can't open data: %s\n&amp;quot;, strerror (errno));&lt;br /&gt;
               return 1;&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
           snprintf (buf, BUFLEN, &amp;quot;123&amp;quot;);&lt;br /&gt;
           write (fp, buf, strlen (buf));&lt;br /&gt;
&lt;br /&gt;
           // Restart close should a signal occur */&lt;br /&gt;
           while((( error = close (fp) ) == -1) &amp;amp;&amp;amp; (errno == EINTR));&lt;br /&gt;
           if(error == -1)&lt;br /&gt;
             perror(&amp;quot;Failed to close the file\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
           return 0;&lt;br /&gt;
&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  **Note, if you want email notification after every 50 new tips have been&lt;br /&gt;
    added, then, click on the following link:&lt;br /&gt;
&lt;br /&gt;
     https://sourceforge.net/project/filemodule_monitor.php?filemodule_id=120838&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 6:&lt;br /&gt;
&lt;br /&gt;
     Working With The Lemon Parser Generator.&lt;br /&gt;
     http://prdownloads.sourceforge.net/souptonuts/lemon_examples.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 7:&lt;br /&gt;
&lt;br /&gt;
     copy command for std container output.&lt;br /&gt;
&lt;br /&gt;
        #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
        #include &amp;lt;list&amp;gt;&lt;br /&gt;
        #include &amp;lt;vector&amp;gt;&lt;br /&gt;
        #include &amp;lt;iterator&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        using namespace std;&lt;br /&gt;
        int main(void)&lt;br /&gt;
        {&lt;br /&gt;
          vector&amp;lt;int&amp;gt; v;&lt;br /&gt;
          list&amp;lt;int&amp;gt; l;&lt;br /&gt;
&lt;br /&gt;
          v.push_back(1);&lt;br /&gt;
          v.push_back(2);&lt;br /&gt;
          copy(v.begin(),v.end(),ostream_iterator&amp;lt;int&amp;gt;(cout,&amp;quot;\n&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          l.push_back(23);&lt;br /&gt;
          l.push_back(12);&lt;br /&gt;
          copy(l.begin(),l.end(),ostream_iterator&amp;lt;int&amp;gt;(cout,&amp;quot;\n&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 8:&lt;br /&gt;
&lt;br /&gt;
  /* Copyright (c) 2005 Mike Chirico mchirico@comcast.net mchirico@users.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Example of using virtual functions. Note the use of &amp;quot;initialization lists&amp;quot;&lt;br /&gt;
              for assinging the variable first and last.&lt;br /&gt;
&lt;br /&gt;
      Compile:&lt;br /&gt;
        g++ -o virtualfunc -Wall -W -O2 -s -pipe  virtual_function.cc&lt;br /&gt;
&lt;br /&gt;
      Download:&lt;br /&gt;
        http://prdownloads.sourceforge.net/cpearls/simple_but_common_cpp.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  */&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
  #include &amp;lt;string&amp;gt;&lt;br /&gt;
  #include &amp;lt;list&amp;gt;&lt;br /&gt;
  #include &amp;lt;algorithm&amp;gt;&lt;br /&gt;
  #include &amp;lt;iterator&amp;gt;&lt;br /&gt;
  #include &amp;lt;functional&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  using namespace std;&lt;br /&gt;
&lt;br /&gt;
  class Employee {&lt;br /&gt;
  string first,last;&lt;br /&gt;
  public:&lt;br /&gt;
    Employee(const string&amp;amp; fn=&amp;quot;John&amp;quot;,const  string&amp;amp; ln=&amp;quot;Smith&amp;quot;): first(fn),last(ln) {}&lt;br /&gt;
    virtual void print() const {&lt;br /&gt;
    cout &amp;lt;&amp;lt; &amp;quot;First name: &amp;quot; &amp;lt;&amp;lt; first &amp;lt;&amp;lt; &amp;quot;, Last name: &amp;quot; &amp;lt;&amp;lt; last &amp;lt;&amp;lt; endl;&lt;br /&gt;
    }&lt;br /&gt;
    virtual ~Employee() {}&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  class Manager : public Employee {&lt;br /&gt;
    int level;&lt;br /&gt;
    list&amp;lt;Employee*&amp;gt; subordinates;&lt;br /&gt;
  public:&lt;br /&gt;
    Manager(const string&amp;amp; fn=&amp;quot;Ivan&amp;quot;,const string&amp;amp; ln=&amp;quot;Stedwick&amp;quot;, int lvl=1): Employee(fn,ln), level(lvl) {}&lt;br /&gt;
    void print() {&lt;br /&gt;
      cout &amp;lt;&amp;lt; &amp;quot;Manager level: &amp;quot; &amp;lt;&amp;lt; level &amp;lt;&amp;lt; &amp;quot;  &amp;quot;;&lt;br /&gt;
      Employee::print();&lt;br /&gt;
      cout &amp;lt;&amp;lt; &amp;quot;Supervises:&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
      for_each(subordinates.begin(),subordinates.end(),mem_fun(&amp;amp;Employee::print));&lt;br /&gt;
      cout &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; endl;&lt;br /&gt;
    }&lt;br /&gt;
    void addstaff(Employee&amp;amp; staff){&lt;br /&gt;
      subordinates.push_front(&amp;amp;staff);&lt;br /&gt;
    }&lt;br /&gt;
    void addstaff(Employee* staff){&lt;br /&gt;
      subordinates.push_front(staff);&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   int main()&lt;br /&gt;
   {&lt;br /&gt;
     Employee p0(&amp;quot;Lisa&amp;quot;,&amp;quot;Payne&amp;quot;);&lt;br /&gt;
     Manager m0;&lt;br /&gt;
&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Zoe&amp;quot;,&amp;quot;Bear&amp;quot;)); /* uses void addstaff(Employee* staff) */&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Leah&amp;quot;,&amp;quot;Bopper&amp;quot;));&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Abby&amp;quot;,&amp;quot;Chicken&amp;quot;));&lt;br /&gt;
     m0.addstaff(p0);  /* void addstaff(Employee&amp;amp; staff)  needed for this one */&lt;br /&gt;
     m0.addstaff(new Employee());&lt;br /&gt;
     m0.print();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     return 0;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 9:&lt;br /&gt;
&lt;br /&gt;
   /*  Named Constructor Idiom.&lt;br /&gt;
       Reference: http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.6&lt;br /&gt;
&lt;br /&gt;
   */&lt;br /&gt;
   #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
   #include &amp;lt;cmath&amp;gt;&lt;br /&gt;
   using namespace std;&lt;br /&gt;
&lt;br /&gt;
   class Point {&lt;br /&gt;
&lt;br /&gt;
   public:&lt;br /&gt;
     static Point rectangular(float x, float y);&lt;br /&gt;
     static Point polar(float radius, float angle);&lt;br /&gt;
     float get_x() { return x_; }&lt;br /&gt;
     float get_y() { return y_; }&lt;br /&gt;
&lt;br /&gt;
   private:&lt;br /&gt;
     Point(float x, float y);&lt;br /&gt;
     float x_, y_;&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
   inline Point::Point(float x, float y)&lt;br /&gt;
     : x_(x), y_(y) {}&lt;br /&gt;
&lt;br /&gt;
   inline Point Point::rectangular(float x, float y)&lt;br /&gt;
   { return Point(x,y); }&lt;br /&gt;
&lt;br /&gt;
   inline Point Point::polar(float radius, float angle)&lt;br /&gt;
   { return Point(radius*cos(angle),radius*sin(angle)); }&lt;br /&gt;
&lt;br /&gt;
   int main(void)&lt;br /&gt;
   {&lt;br /&gt;
     Point p1 = Point::rectangular(5.7,1.2);&lt;br /&gt;
     Point p2 = Point::polar(5.7,1.2);&lt;br /&gt;
&lt;br /&gt;
     cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; p1.get_x() &amp;lt;&amp;lt; &amp;quot;, &amp;quot; &amp;lt;&amp;lt; p1.get_y() &amp;lt;&amp;lt; &amp;quot;)&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
     cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; p2.get_x() &amp;lt;&amp;lt; &amp;quot;, &amp;quot; &amp;lt;&amp;lt; p2.get_y() &amp;lt;&amp;lt; &amp;quot;)&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 10:&lt;br /&gt;
&lt;br /&gt;
   /* Copy_constructor_assignment.cc&lt;br /&gt;
      Copyright (c) 2004 GPL Mike Chirico, mchirico@comcast.net or mchirico@users.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
      Reference: &amp;quot;The C++ Programming Language&amp;quot;, 3rd ed, by Stroustrup&lt;br /&gt;
      pg. 246.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Download:&lt;br /&gt;
      http://prdownloads.sourceforge.net/cpearls/simple_but_common.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
   */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   class Name {&lt;br /&gt;
   public:&lt;br /&gt;
     char* s;&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   class Table {&lt;br /&gt;
     Name *p;&lt;br /&gt;
     size_t sz;&lt;br /&gt;
   public:&lt;br /&gt;
     Table(size_t s=15) {&lt;br /&gt;
               p = new Name[sz=s];&lt;br /&gt;
               for(size_t i=0; i&amp;lt; sz; ++i) p[i].s=&amp;quot;****&amp;quot;;&lt;br /&gt;
                          }&lt;br /&gt;
     Table(const Table &amp;amp;t);&lt;br /&gt;
     Table&amp;amp; operator=(const Table&amp;amp;);&lt;br /&gt;
     int prt();&lt;br /&gt;
     void asgn(char* ts,size_t index);&lt;br /&gt;
     ~Table(){ delete[] p; }&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Table&amp;amp; Table::operator=(const Table &amp;amp;t)&lt;br /&gt;
   {&lt;br /&gt;
     if( this != &amp;amp;t) {&lt;br /&gt;
       delete[] p;&lt;br /&gt;
       p = new Name[sz=t.sz];&lt;br /&gt;
       for(size_t i=0; i&amp;lt; t.sz; ++i) p[i]=t.p[i];&lt;br /&gt;
     }&lt;br /&gt;
     return *this;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   int Table::prt()&lt;br /&gt;
   {&lt;br /&gt;
     for(size_t i=0; i&amp;lt; sz; ++i) std::cout &amp;lt;&amp;lt; p[i].s &amp;lt;&amp;lt; &amp;quot; &amp;quot;;&lt;br /&gt;
     std::cout &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
     return 0;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   /*&lt;br /&gt;
     asgn will increase the array of strings, if needed&lt;br /&gt;
     to size index+1, and add the string ts to position&lt;br /&gt;
     index.&lt;br /&gt;
   */&lt;br /&gt;
   void Table::asgn(char* ts,size_t index)&lt;br /&gt;
   {&lt;br /&gt;
     if(index &amp;lt; sz ) {&lt;br /&gt;
        p[index].s=ts;&lt;br /&gt;
     }else if ( index &amp;gt;= sz ){&lt;br /&gt;
        Name *tp;&lt;br /&gt;
        tp=p;&lt;br /&gt;
&lt;br /&gt;
        p = new Name[index+1];&lt;br /&gt;
&lt;br /&gt;
        for(size_t i=0; i&amp;lt; sz; ++i) p[i].s=tp[i].s;&lt;br /&gt;
        delete [] tp;&lt;br /&gt;
        for(size_t i=sz; i &amp;lt; index; ++i)p[i].s=&amp;quot;****&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
        p[index].s=ts;&lt;br /&gt;
        sz=index+1;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   int main(void)&lt;br /&gt;
   {&lt;br /&gt;
&lt;br /&gt;
     Table t1;&lt;br /&gt;
     Table t2(5);&lt;br /&gt;
&lt;br /&gt;
     // this is bigger than initial sz&lt;br /&gt;
     t1.asgn(&amp;quot;myname&amp;quot;,20);&lt;br /&gt;
     t1.prt();&lt;br /&gt;
     t2.prt();&lt;br /&gt;
&lt;br /&gt;
     t1=t2;&lt;br /&gt;
&lt;br /&gt;
     t1.prt();&lt;br /&gt;
     t2.prt();&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REFERENCES:&lt;br /&gt;
&lt;br /&gt;
  (1)  http://www.tldp.org/LDP/abs/html/index.html&lt;br /&gt;
  (2)  http://www.shelldorado.com/&lt;br /&gt;
  (3)  http://www.faqs.org/ftp/usenet/news.answers/unix-faq/faq/part1&lt;br /&gt;
  (4)  http://www-106.ibm.com/developerworks/library/l-rpm1/&lt;br /&gt;
  (5)  http://www-136.ibm.com/developerworks/linux/&lt;br /&gt;
  (6)  http://www.gnu.org/manual/manual.html&lt;br /&gt;
  (7)  http://fedora.redhat.com/&lt;br /&gt;
  (8)  http://souptonuts.sourceforge.net/chirico/index.php&lt;br /&gt;
  (9)  http://www.faqs.org/faqs/&lt;br /&gt;
 (10)  http://www.faqs.org/docs/linux_network/&lt;br /&gt;
 (11)  http://www.tml.hut.fi/~viu/linux/sag/sag-0.6.2.html/index.html&lt;br /&gt;
 (12)  http://www.yolinux.com/TUTORIALS/LinuxTutorialSysAdmin.html&lt;br /&gt;
 (13)  http://sed.sourceforge.net/grabbag/scripts/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  SUMMARY:&lt;br /&gt;
   (1)(2)(3) Excellent resource for bash scripts.&lt;br /&gt;
   (4)       rpm resource&lt;br /&gt;
   (6)       GNU Manuals Online&lt;br /&gt;
   (7)       Fedora&lt;br /&gt;
   (8)       Authors Website&lt;br /&gt;
   (11)(12)  System Admin&lt;br /&gt;
   (13)      Excellent source of sed scripts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
HIGHLY RECOMMENDED BOOKS:&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX Network Programming, The Sockets Networking API&amp;quot;, Volume 1, Third Edition.&lt;br /&gt;
        W. Richard Stevens, Bill Fenner, Andrew M. Rudoff.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX Network Programming, Interprocess Communications&amp;quot;, Volume 2, Second Edition.&lt;br /&gt;
        W. Richard Stevens.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX SYSTEMS Programming, Communication, Concurrency, and Threads&amp;quot;, Kay A. Robbins,&lt;br /&gt;
        Steven Robbins&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming with POSIX Threads&amp;quot;, David R. Butenhof. Addison-Wesley&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;The C++ Programming Language&amp;quot; Third Edition. Bjarne Stroustrup. Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C Programming Language&amp;quot; (2nd Edition), Second Edition, Kernighan and Ritchie&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Advanced Linux Programming&amp;quot; by Mark Mitchell, Jeffrey Oldham, and Alex Samuel, of&lt;br /&gt;
        CodeSourcery LL. This book if free at the following resource:&lt;br /&gt;
        http://www.advancedlinuxprogramming.com/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Accelerated C++, Practical Programming by Example&amp;quot; Andrew Koenig, Barbara E. Moo.&lt;br /&gt;
        Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C: A Reference Manual&amp;quot;, Fifth Edition, Samuel P. Harbison, Guy L. Steele.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Standard Library: A Tutorial and Reference, The&amp;quot;, Nicolai M. Josuttis. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Templates: The Complete Guide&amp;quot;, David Vandevoorde, Nicolai M. Josuttis. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Exceptional C++: 47 Engineering Puzzles, Programming Problems, and Solutions&amp;quot;, Herb Sutter.&lt;br /&gt;
     Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;More Exceptional C++&amp;quot;, Herb Sutter.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Exceptional C++ Style: 40 New Engineering Puzzles, Programming Problems, and Solutions&amp;quot;,&lt;br /&gt;
       Herb Sutter. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;The Art of Computer Programming (TAOCP)&amp;quot;, Vol 1,Vol 2, Vol 3. Donald E. Knuth. Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming Perl, 3rd Edition&amp;quot;, Tom Christiansen, Jon Orwant, Larry Wall. O'Reilly.&lt;br /&gt;
       http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming from the Ground Up&amp;quot;, Jonathan Bartlett, Edited by Dominick Bruno, Jr.&lt;br /&gt;
       http://savannah.nongnu.org/download/pgubook/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Expert C Programming&amp;quot;, Peter van der Linden, Prentice Hall PTR.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Coding Standards 101 Rules, Guidelines, and Best Practices&amp;quot;, by Herb Sutter and&lt;br /&gt;
       Andrei Alexandrescu.  http://www.gotw.ca/publications/c++cs/bibliography.htm&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Linux Kernel Development: A practical guide to the design and implementation of&lt;br /&gt;
       the Linux kernel&amp;quot;, by Robert Love, Sams Publishing.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond&amp;quot;, by&lt;br /&gt;
       David Abrahams and Aleksey Gurtovoy. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
HIGHLY RECOMMENDED: PHILOSOPHICAL&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;Zen and the Art of Motorcycle Maintenance: An Inquiry into Values&amp;quot;, Robert Pirsig.&lt;br /&gt;
        http://www.virtualschool.edu/mon/Quality/PirsigZen/index.html&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;Lila: An Inquiry Into Morals&amp;quot;, Robert Pirsig.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RECOMMENDED BOOKS:&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Structure and Interpretation of Computer Programs&amp;quot;, Harold Abelson, Gerald Jay Sussman,&lt;br /&gt;
      Julie Sussman. This book is free:&lt;br /&gt;
        http://mitpress.mit.edu/sicp/full-text/book/book.html&lt;br /&gt;
              and&lt;br /&gt;
        http://www.gnu.org/software/mit-scheme/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RECOMMENDED HOTOS:&lt;br /&gt;
&lt;br /&gt;
    Linux Networking-HOWTO (Previously the Net-3 Howto)&lt;br /&gt;
     http://en.tldp.org/HOWTO/NET3-4-HOWTO.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CORRECTIONS:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following people made suggestions and corrections:&lt;br /&gt;
  - Jorge Fabregas &amp;lt;fabregasj@prtc.net&amp;gt; TIP 21&lt;br /&gt;
  - Malcolm Parsons &amp;lt;malcolm.parsons@gmail.com&amp;gt; TIP 44&lt;br /&gt;
  - Andreas Haunschmidt &amp;lt;Andreas.Haunschmidt@utanet.at&amp;gt; TIP 102, TIP 90&lt;br /&gt;
  - P@draigBrady.com (Following links )&lt;br /&gt;
  - Jacques.GARNIER-EXTERIEUR@EU.RHODIA.COM TIP 46&lt;br /&gt;
&lt;br /&gt;
                http://www.pixelbeat.org/cmdline.html&lt;br /&gt;
                http://www.pixelbeat.org/rotagator/linux.tips/rotagator.fortune&lt;br /&gt;
                http://www.pixelbeat.org/scripts/&lt;br /&gt;
&lt;br /&gt;
  - Tobias Nix &amp;lt;tobias.nix@gmail.com&amp;gt; TIP 12&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>C4tboCcdro</name></author>	</entry>

	<entry>
		<id>https://wiki.gacq.com/index.php?title=Linux_tips&amp;diff=2738</id>
		<title>Linux tips</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacq.com/index.php?title=Linux_tips&amp;diff=2738"/>
				<updated>2009-01-08T16:52:02Z</updated>
		
		<summary type="html">&lt;p&gt;C4tboCcdro: http://acsitzar.0lx.net/news-jethro-tull-videos-2008-11-19.html&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://acsitzar.0lx.net/news-jethro-tull-videos-2008-11-19.html jethro tull videos] [http://bukgetert.0lx.net/sitemap.htm links] [http://lifokdron.0lx.net/504.html movie theater in virginia] [http://flheddin.qsh.eu/brfadron-453.html motivational military videos] [http://sematild.qsh.eu/resource322.htm real player video codecs] &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Mike Chirico (mchirico@users.sourceforge.net) or (mchirico@comcast.net)&lt;br /&gt;
Copyright (C) 2004 (GNU Free Documentation License)&lt;br /&gt;
Last Updated: Thu Dec 28 16:42:50 EST 2006&lt;br /&gt;
&lt;br /&gt;
The latest version of this document can be found at:&lt;br /&gt;
http://souptonuts.sourceforge.net/how_to_linux_and_open_source.htm&lt;br /&gt;
  or text version ( if you have trouble downloading the full document: over 140 pages )&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/How_to_Linux_and_Open_Source.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on Gmail with Postix and Fetchmail&lt;br /&gt;
http://souptonuts.sourceforge.net/postfix_tutorial.html&lt;br /&gt;
&lt;br /&gt;
For tips on using SQLite (over 25 pages)&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_sqlite_tutorial.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on MySQL reference:&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_mysql.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For a recommended reading list&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/Recommended_Reading.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on upgrading RedHat 9 or 8.0 to 2.6.x src kernel&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_26.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on Comcast Email with Home Linux Box&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_COMCAST_EMAIL.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  **Note, if you want email notification after every 50 new tips have been&lt;br /&gt;
    added, then, click on the following link:&lt;br /&gt;
     https://sourceforge.net/project/filemodule_monitor.php?filemodule_id=120838&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 1:&lt;br /&gt;
&lt;br /&gt;
     Is NTP Working?&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Test the current server):&lt;br /&gt;
&lt;br /&gt;
          Try issuing the following command:&lt;br /&gt;
&lt;br /&gt;
          $ ntpq -pn&lt;br /&gt;
&lt;br /&gt;
           remote refid st t when poll reach delay offset jitter&lt;br /&gt;
           ===================================================&lt;br /&gt;
           tock.usno.navy 0.0.0.0 16 u - 64 0 0.000 0.000 4000.00&lt;br /&gt;
&lt;br /&gt;
          The above is an example of a problem.&lt;br /&gt;
          Compare it to a working configuration.&lt;br /&gt;
&lt;br /&gt;
          $ ntpq -pn&lt;br /&gt;
&lt;br /&gt;
           remote refid st t when poll reach delay offset jitter&lt;br /&gt;
           ========================================================&lt;br /&gt;
           +128.4.40.12 128.4.40.10 2 u 107 128 377 25.642 3.350 1.012&lt;br /&gt;
           127.127.1.0 127.127.1.0 10 l 40 64 377 0.000 0.000 0.008&lt;br /&gt;
           +128.91.2.13 128.4.40.12 3 u 34 128 377 21.138 6.118 0.398&lt;br /&gt;
           *192.5.41.41 .USNO. 1 u 110 128 377 33.69 9.533 3.534&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Configure the /etc/ntp.conf):&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/ntp.conf&lt;br /&gt;
&lt;br /&gt;
            # My simple client-only ntp configuration.&lt;br /&gt;
            server timeserver1.upenn.edu&lt;br /&gt;
            # ping -a timeserver1.upenn.edu shows the IP address 128.91.2.13&lt;br /&gt;
            # which is used in the restrict below&lt;br /&gt;
            restrict 128.91.2.13&lt;br /&gt;
            server tock.usno.navy.mil&lt;br /&gt;
            restrict 192.5.41.41&lt;br /&gt;
            server 128.4.40.12&lt;br /&gt;
            restrict 128.4.40.12&lt;br /&gt;
            server 127.127.1.0 # local clock&lt;br /&gt;
            fudge 127.127.1.0 stratum 10&lt;br /&gt;
            driftfile /etc/ntp/drift&lt;br /&gt;
            restrict default ignore&lt;br /&gt;
            restrict 127.0.0.0 mask 255.0.0.0&lt;br /&gt;
            authenticate no&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Configure /etc/ntp/step-tickers):&lt;br /&gt;
&lt;br /&gt;
          The values for server above are placed in the &amp;quot;/etc/ntp/step-tickers&amp;quot; file&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/ntp/step-tickers&lt;br /&gt;
&lt;br /&gt;
              timeserver1.upenn.edu&lt;br /&gt;
              tock.usno.navy.mil&lt;br /&gt;
              128.4.40.12&lt;br /&gt;
&lt;br /&gt;
          The startup script /etc/rc.d/init.d/ntpd will grab the servers in this&lt;br /&gt;
          file and execute the ntpdate command as follows:&lt;br /&gt;
&lt;br /&gt;
             /usr/sbin/ntpdate -s -b -p 8 timeserver1.upenn.edu&lt;br /&gt;
&lt;br /&gt;
          Why? Because if the time is off ntpd will not start. The command above set the&lt;br /&gt;
          clock. If System Time deviates from true time by more than 1000 seconds, then,&lt;br /&gt;
          the ntpd daemon  will enter panic mode and exit.&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Restart the service and check):&lt;br /&gt;
&lt;br /&gt;
          Issue the restart command&lt;br /&gt;
&lt;br /&gt;
            /etc/init.d/ntpd restart&lt;br /&gt;
&lt;br /&gt;
          check the values for &amp;quot;ntpq -pn&amp;quot;,&lt;br /&gt;
          which should match step 1.&lt;br /&gt;
&lt;br /&gt;
             ntpq -pn&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE:&lt;br /&gt;
&lt;br /&gt;
          Time is always stored in the kernel as the number of seconds since&lt;br /&gt;
          midnight of the 1st of January 1970 UTC, regardless of whether the&lt;br /&gt;
          hardware clock is stored as UTC or not.  Conversions to local time&lt;br /&gt;
          are done at run-time. So, it's easy to get the time in different&lt;br /&gt;
          timezones for only the current session as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ export TZ=EST&lt;br /&gt;
              $ date&lt;br /&gt;
              Mon Aug  2 10:34:04 EST 2004&lt;br /&gt;
&lt;br /&gt;
              $ export TZ=NET&lt;br /&gt;
              $ date&lt;br /&gt;
              Mon Aug  2 15:34:18 NET 2004&lt;br /&gt;
&lt;br /&gt;
          The following are possible values for TZ:&lt;br /&gt;
&lt;br /&gt;
              Hours From Greenwich Mean Time (GMT) Value Description&lt;br /&gt;
              0 GMT Greenwich Mean Time&lt;br /&gt;
              +1 ECT European Central Time&lt;br /&gt;
              +2 EET European Eastern Time&lt;br /&gt;
              +2 ART&lt;br /&gt;
              +3 EAT Saudi Arabia&lt;br /&gt;
              +3.5 MET Iran&lt;br /&gt;
              +4 NET&lt;br /&gt;
              +5 PLT West Asia&lt;br /&gt;
              +5.5 IST India&lt;br /&gt;
              +6 BST Central Asia&lt;br /&gt;
              +7 VST Bangkok&lt;br /&gt;
              +8 CTT China&lt;br /&gt;
              +9 JST Japan&lt;br /&gt;
              +9.5 ACT Central Australia&lt;br /&gt;
              +10 AET Eastern Australia&lt;br /&gt;
              +11 SST Central Pacific&lt;br /&gt;
              +12 NST New Zealand&lt;br /&gt;
              -11 MIT Samoa&lt;br /&gt;
              -10 HST Hawaii&lt;br /&gt;
              -9 AST Alaska&lt;br /&gt;
              -8 PST Pacific Standard Time&lt;br /&gt;
              -7 PNT Arizona&lt;br /&gt;
              -7 MST Mountain Standard Time&lt;br /&gt;
              -6 CST Central Standard Time&lt;br /&gt;
              -5 EST Eastern Standard Time&lt;br /&gt;
              -5 IET Indiana East&lt;br /&gt;
              -4 PRT Atlantic Standard Time&lt;br /&gt;
              -3.5 CNT Newfoundland&lt;br /&gt;
              -3 AGT Eastern South America&lt;br /&gt;
              -3 BET Eastern South America&lt;br /&gt;
              -1 CAT Azores&lt;br /&gt;
&lt;br /&gt;
              DST timezone&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              0      BST for British Summer.&lt;br /&gt;
              +400   ADT for Atlantic Daylight.&lt;br /&gt;
              +500   EDT for Eastern Daylight.&lt;br /&gt;
              +600   CDT for Central Daylight.&lt;br /&gt;
              +700   MDT for Mountain Daylight.&lt;br /&gt;
              +800   PDT for Pacific Daylight.&lt;br /&gt;
              +900   YDT for Yukon Daylight.&lt;br /&gt;
              +1000  HDT for Hawaii Daylight.&lt;br /&gt;
              -100   MEST for Middle European Summer,&lt;br /&gt;
                         MESZ for Middle European Summer,&lt;br /&gt;
                         SST for Swedish Summer and FST for French Summer.&lt;br /&gt;
              -700   WADT for West Australian Daylight.&lt;br /&gt;
              -1000  EADT for Eastern Australian Daylight.&lt;br /&gt;
              -1200  NZDT for New Zealand Daylight.&lt;br /&gt;
&lt;br /&gt;
     The following is an example of setting the TZ environment variable&lt;br /&gt;
     for the timezone, only when timezone changes go into effect.&lt;br /&gt;
&lt;br /&gt;
               $ export TZ=EST+5EDT,M4.1.0/2,M10.5.0/2&lt;br /&gt;
&lt;br /&gt;
     Take a look at the last line &amp;quot;M10.5.0/2&amp;quot;. What does it mean? Here is the&lt;br /&gt;
     documentation&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Mm.w.d This  specifies  day  d (0 &amp;lt;= d &amp;lt;= 6) of week w (1 &amp;lt;= w &amp;lt;= 5) of&lt;br /&gt;
              month m (1 &amp;lt;= m &amp;lt;= 12).  Week 1 is the first week in which day d&lt;br /&gt;
              occurs and week 5 is the last week in which day d occurs.  Day 0&lt;br /&gt;
              is a Sunday.&lt;br /&gt;
&lt;br /&gt;
              The time fields specify when, in the local time  currently  in&lt;br /&gt;
              effect, the  change  to  the  other  time  occurs.   If omitted,&lt;br /&gt;
              the default is  02:00:00.&lt;br /&gt;
&lt;br /&gt;
      So this is what it means. M10 stands for October, the 5 is the fifth week&lt;br /&gt;
      that includes a Sunday (note 0 in M10.5.0/2 is Sunday). To see that it is&lt;br /&gt;
      the fifth week see the calendar below. The time change occurs a 2am in&lt;br /&gt;
      the morning.&lt;br /&gt;
&lt;br /&gt;
                                October&lt;br /&gt;
                         Su Mo Tu We Th Fr Sa&lt;br /&gt;
                                         1  2&lt;br /&gt;
                          3  4  5  6  7  8  9&lt;br /&gt;
                         10 11 12 13 14 15 16&lt;br /&gt;
                         17 18 19 20 21 22 23&lt;br /&gt;
                         24 25 26 27 28 29 30&lt;br /&gt;
                         31&lt;br /&gt;
&lt;br /&gt;
       Prove it. Take the following program sunrise, which can calcuates sunrise&lt;br /&gt;
       and sunset for an latitude and longitude. This program can be downloaded&lt;br /&gt;
       from the following location:&lt;br /&gt;
           http://sourceforge.net/direct-dl/mchirico/souptonuts/working_with_time.tar.gz&lt;br /&gt;
&lt;br /&gt;
       Below is a bash script that will run the program for the next 100 days.&lt;br /&gt;
&lt;br /&gt;
          #!/bin/bash&lt;br /&gt;
          #  program: next100days  Mike Chirico&lt;br /&gt;
          #  download:&lt;br /&gt;
          #  http://sourceforge.net/direct-dl/mchirico/souptonuts/working_with_time.tar.gz&lt;br /&gt;
          #&lt;br /&gt;
          #  This will calculate the sunrise and sunset for&lt;br /&gt;
          #  latitude     39.95  Note must convert to degrees&lt;br /&gt;
          #  longitude  75.15  Note must convert to degrees&lt;br /&gt;
          lat=39.95&lt;br /&gt;
          long=75.15&lt;br /&gt;
          for (( i=0; i &amp;lt;= 100; i++))&lt;br /&gt;
          do&lt;br /&gt;
            sunrise    `date -d &amp;quot;+$i day&amp;quot; &amp;quot;+%Y %m %d&amp;quot;` $lat $long&lt;br /&gt;
          done&lt;br /&gt;
&lt;br /&gt;
       Take a look at the following sample output.&lt;br /&gt;
&lt;br /&gt;
           $ export TZ=EST+5EDT,M4.1.0/2,M10.5.0/2&lt;br /&gt;
           $ ./next100days&lt;br /&gt;
&lt;br /&gt;
          Sunrise  08-24-2004  06:21:12   Sunset 08-24-2004  19:43:42&lt;br /&gt;
          Sunrise  08-25-2004  06:22:09   Sunset 08-25-2004  19:42:12&lt;br /&gt;
          Sunrise  08-26-2004  06:23:06   Sunset 08-26-2004  19:40:41&lt;br /&gt;
          Sunrise  08-27-2004  06:24:03   Sunset 08-27-2004  19:39:09&lt;br /&gt;
          Sunrise  08-28-2004  06:25:00   Sunset 08-28-2004  19:37:37&lt;br /&gt;
          Sunrise  08-29-2004  06:25:56   Sunset 08-29-2004  19:36:04&lt;br /&gt;
          Sunrise  08-30-2004  06:26:53   Sunset 08-30-2004  19:34:31&lt;br /&gt;
          Sunrise  08-31-2004  06:27:50   Sunset 08-31-2004  19:32:57&lt;br /&gt;
          Sunrise  09-01-2004  06:28:46   Sunset 09-01-2004  19:31:22&lt;br /&gt;
          Sunrise  09-02-2004  06:29:43   Sunset 09-02-2004  19:29:47&lt;br /&gt;
          ..[values omitted ]&lt;br /&gt;
          Sunrise  10-28-2004  07:25:31   Sunset 10-28-2004  18:02:34&lt;br /&gt;
          Sunrise  10-29-2004  07:26:38   Sunset 10-29-2004  18:01:19&lt;br /&gt;
          Sunrise  10-30-2004  07:27:46   Sunset 10-30-2004  18:00:06&lt;br /&gt;
          Sunrise  10-31-2004  06:28:53   Sunset 10-31-2004  16:58:54&lt;br /&gt;
          Sunrise  11-01-2004  06:30:01   Sunset 11-01-2004  16:57:44&lt;br /&gt;
          Sunrise  11-02-2004  06:31:10   Sunset 11-02-2004  16:56:35&lt;br /&gt;
&lt;br /&gt;
       Compare 10-30-2004 with 10-31-2004. Sunrise is an hour earlier because&lt;br /&gt;
       daylight saving time has ended, just as predicted.&lt;br /&gt;
&lt;br /&gt;
       There is an easier way to switch between timezones. Take a look at the&lt;br /&gt;
       directory zoneinfo as follows:&lt;br /&gt;
&lt;br /&gt;
            $ ls /usr/share/zoneinfo&lt;br /&gt;
&lt;br /&gt;
            Africa      Chile    Factory    Iceland      Mexico    posix       UCT&lt;br /&gt;
            America     CST6CDT  GB         Indian       Mideast   posixrules  Universal&lt;br /&gt;
            Antarctica  Cuba     GB-Eire    Iran         MST       PRC         US&lt;br /&gt;
            Arctic      EET      GMT        iso3166.tab  MST7MDT   PST8PDT     UTC&lt;br /&gt;
            Asia        Egypt    GMT0       Israel       Navajo    right       WET&lt;br /&gt;
            Atlantic    Eire     GMT-0      Jamaica      NZ        ROC         W-SU&lt;br /&gt;
            Australia   EST      GMT+0      Japan        NZ-CHAT   ROK         zone.tab&lt;br /&gt;
            Brazil      EST5EDT  Greenwich  Kwajalein    Pacific   Singapore   Zulu&lt;br /&gt;
            Canada      Etc      Hongkong   Libya        Poland    SystemV&lt;br /&gt;
            CET         Europe   HST        MET          Portugal  Turkey&lt;br /&gt;
&lt;br /&gt;
       TZ can be set to any one of these files. Some of these are directories and contain&lt;br /&gt;
       subdirectories, such as ./posix/America. This way you don not have to enter the&lt;br /&gt;
       timezone, offset, and range for dst, since it has already been calculated.&lt;br /&gt;
&lt;br /&gt;
           $ export TZ=:/usr/share/zoneinfo/posix/America/Aruba&lt;br /&gt;
           $ export TZ=:/usr/share/zoneinfo/Egypt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Reference:&lt;br /&gt;
          http://prdownloads.sourceforge.net/cpearls/date_calc.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
          Also see  (TIP 27).&lt;br /&gt;
          Also see  (TIP 103) using chrony which is very similiar to ntpd.&lt;br /&gt;
          Note time settings can usually be found in /etc/sysconfig/clock&lt;br /&gt;
         &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 2:&lt;br /&gt;
&lt;br /&gt;
     cpio works like tar, only better.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Create two directories with data ../dir1 an ../dir2)&lt;br /&gt;
&lt;br /&gt;
          mkdir -p ../dir1&lt;br /&gt;
          mkdir -p ../dir2&lt;br /&gt;
          cp /etc/*.conf ../dir1/.&lt;br /&gt;
          cp /etc/*.cnf ../dir2/.&lt;br /&gt;
&lt;br /&gt;
          Which will backup all your cnf and conf files.&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Piping the files to tar)&lt;br /&gt;
&lt;br /&gt;
          cpio works like tar but can take input&lt;br /&gt;
          from the &amp;quot;find&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar &amp;gt; test.tar&lt;br /&gt;
               or&lt;br /&gt;
           $ find ../dir1/ | cpio -o -H tar &amp;gt; test2.tar&lt;br /&gt;
&lt;br /&gt;
          Same command without the &amp;quot;&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar -F test.tar&lt;br /&gt;
              or&lt;br /&gt;
           $ find ../dir1/ | cpio -o -H tar -F test2.tar&lt;br /&gt;
&lt;br /&gt;
          Using append&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar -F test.tar&lt;br /&gt;
             or&lt;br /&gt;
           $ find ../dir2/ | cpio -o --format=tar --append -F test.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (List contents of the tar file)&lt;br /&gt;
&lt;br /&gt;
          $ cpio -it &amp;lt; test.tar&lt;br /&gt;
                or&lt;br /&gt;
          $ cpio -it -F test.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Extract the contents)&lt;br /&gt;
&lt;br /&gt;
          $ cpio -i -F test.tar&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 3:&lt;br /&gt;
&lt;br /&gt;
     Working with tar. The basics with encryption.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Using the tar command on the directory /stuff)&lt;br /&gt;
&lt;br /&gt;
          Suppose you have a directory /stuff&lt;br /&gt;
          To tar everything in stuff to create a &amp;quot;.tar&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
          $ tar -cvf stuff.tar stuff&lt;br /&gt;
&lt;br /&gt;
          Which will create &amp;quot;stuff.tar&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Using the tar command to create a &amp;quot;.tar.gz&amp;quot; of /stuff)&lt;br /&gt;
&lt;br /&gt;
          $ tar -czf stuff.tar.gz stuff&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (List the files in the archive)&lt;br /&gt;
&lt;br /&gt;
          $ tar -tzf stuff.tar.gz&lt;br /&gt;
               or&lt;br /&gt;
          $ tar -tf stuff.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (A way to list specific files)&lt;br /&gt;
&lt;br /&gt;
          Note, pipe the results to a file and edit&lt;br /&gt;
&lt;br /&gt;
           $ tar -tzf stuff.tar.gz &amp;gt; mout&lt;br /&gt;
&lt;br /&gt;
          Then, edit mout to only include the files you want&lt;br /&gt;
&lt;br /&gt;
           $ tar -T mout -xzf stuff.tar.gz&lt;br /&gt;
&lt;br /&gt;
          The above command will only get the files in mout.&lt;br /&gt;
          Of couse, if you want them all&lt;br /&gt;
&lt;br /&gt;
           $ tar -xzf stuff.tar.gz&lt;br /&gt;
&lt;br /&gt;
     STEP 5 (ENCRYPTION)&lt;br /&gt;
&lt;br /&gt;
           $ tar -zcvf - stuff|openssl des3 -salt -k secretpassword | dd of=stuff.des3&lt;br /&gt;
&lt;br /&gt;
          This will create stuff.des3...don't forget the password you&lt;br /&gt;
          put in place of  secretpassword. This can be done interactively as&lt;br /&gt;
          well.&lt;br /&gt;
&lt;br /&gt;
            $ dd if=stuff.des3 |openssl des3 -d -k secretpassword|tar zxf -&lt;br /&gt;
&lt;br /&gt;
     NOTE:  above there is a &amp;quot;-&amp;quot; at the end... this will&lt;br /&gt;
            extract everything.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 4:&lt;br /&gt;
&lt;br /&gt;
     Creating a Virtual File System and Mounting it with a Loopback Device.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Construct a 10MB file)&lt;br /&gt;
&lt;br /&gt;
           $ dd if=/dev/zero of=/tmp/disk-image count=20480&lt;br /&gt;
&lt;br /&gt;
          By default dd uses block of 512 so the size will be 20480*512&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Make an ext2 or ext3 file system) -- ext2 shown here.&lt;br /&gt;
&lt;br /&gt;
           $ mke2fs -q&lt;br /&gt;
&lt;br /&gt;
          or if you want ext3&lt;br /&gt;
&lt;br /&gt;
           $ mkfs -t ext3 -q /tmp/disk-image&lt;br /&gt;
&lt;br /&gt;
          yes, you can even use reiser, but you'll need to create a bigger&lt;br /&gt;
          disk image. Something like &amp;quot;dd if=/dev/zero of=/tmp/disk-image count=50480&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ mkfs -t reiserfs -q /tmp/disk-image&lt;br /&gt;
&lt;br /&gt;
          Hit yes for confirmation.  It only asks this because it's a file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Create a directory &amp;quot;virtual-fs&amp;quot; and mount. This has to be done as root)&lt;br /&gt;
&lt;br /&gt;
           $ mkdir /virtual-fs&lt;br /&gt;
           $ mount -o loop=/dev/loop0 /tmp/disk-image /virtual-fs&lt;br /&gt;
&lt;br /&gt;
         SPECIAL NOTE: if you mount a second device you will have to increase the&lt;br /&gt;
                       loop count: loop=/dev/loop1, loop=/dev/loop2, ... loop=/dev/loopn&lt;br /&gt;
&lt;br /&gt;
          Now it operates just like a disk. This virtual filesystem can be mounted&lt;br /&gt;
          when the system boots by adding the following to the &amp;quot;/etc/fstab&amp;quot; file. Then,&lt;br /&gt;
          to mount, just type &amp;quot;mount /virtual-fs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                 /tmp/disk-image /virtual-fs ext2               rw,loop=/dev/loop0 0 0&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (When done, umount it)&lt;br /&gt;
&lt;br /&gt;
           $ umount /virtual-fs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE: If you are using Fedora core 2, in the /etc/fstab you can take&lt;br /&gt;
              advantage of acl properties for this mount. Note the acl next to the&lt;br /&gt;
              rw entry. This is shown here with ext3.&lt;br /&gt;
&lt;br /&gt;
                 /tmp/disk-image     /virtual-fs ext3    rw,acl,loop=/dev/loop1 0 0&lt;br /&gt;
&lt;br /&gt;
              Also, if you are using Fedora core 2 and above, you can mount the file&lt;br /&gt;
              on a cryptoloop.&lt;br /&gt;
&lt;br /&gt;
                $ dd if=/dev/urandom of=disk-aes count=20480&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ modprobe loop&lt;br /&gt;
                $ modprobe cryptoloop&lt;br /&gt;
                $ modprobe aes&lt;br /&gt;
&lt;br /&gt;
                $ losetup -e aes /dev/loop0 disk-aes&lt;br /&gt;
                $ mkfs -t ext2 /dev/loop0&lt;br /&gt;
                $ mount -o loop,encryption=aes disk-aes &amp;lt;mount point&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              If you do not have Fedora core 2, then, you can build the kernel from source&lt;br /&gt;
              with some of the following options (not complete, yet)&lt;br /&gt;
               reference:&lt;br /&gt;
     http://cvs.sourceforge.net/viewcvs.py/cpearls/cpearls/src/posted_on_sf/acl/ehd.pdf?rev=1.1&amp;amp;view=log&lt;br /&gt;
&lt;br /&gt;
                      Cryptographic API Support (CONFIG_CRYPTO)&lt;br /&gt;
                      generic loop cryptographic (CONFIG_CRYPTOLOOP)&lt;br /&gt;
                      Cryptographic ciphers (CONFIG_CIPHERS)&lt;br /&gt;
                      Enable one or more  ciphers  (CONFIG CIPHER .*) such as AES.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     HELPFUL INFORMATION: It is possible to bind mount partitions, or associate the&lt;br /&gt;
                     mounted partition to a directory name.&lt;br /&gt;
&lt;br /&gt;
                  # mount --bind  /virtual-fs      /home/mchirico/vfs&lt;br /&gt;
&lt;br /&gt;
             Also, if you want to see what filesystems are currently mounted, &amp;quot;cat&amp;quot; the&lt;br /&gt;
             file &amp;quot;/etc/mtab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
                  $ cat /etc/mtab&lt;br /&gt;
&lt;br /&gt;
     Also see TIP 91.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 5:&lt;br /&gt;
&lt;br /&gt;
     Setting up 2 IP address on &amp;quot;One&amp;quot; NIC. This example is on ethernet.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (The settings for the initial IP address)&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
&lt;br /&gt;
            DEVICE=eth0&lt;br /&gt;
            BOOTPROTO=static&lt;br /&gt;
            BROADCAST=192.168.99.255&lt;br /&gt;
            IPADDR=192.168.1.155&lt;br /&gt;
            NETMASK=255.255.252.0&lt;br /&gt;
            NETWORK=192.168.1.0&lt;br /&gt;
            ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (2nd IP address: )&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/sysconfig/network-scripts/ifcfg-eth0:1&lt;br /&gt;
&lt;br /&gt;
            DEVICE=eth0:1&lt;br /&gt;
            BOOTPROTO=static&lt;br /&gt;
            BROADCAST=192.168.99.255&lt;br /&gt;
            IPADDR=192.168.1.182&lt;br /&gt;
            NETMASK=255.255.252.0&lt;br /&gt;
            NETWORK=192.168.1.0&lt;br /&gt;
            ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
     SUMMARY  Note, in STEP 1 the filename is &amp;quot;ifcfg-eth0&amp;quot;, whereas in&lt;br /&gt;
              STEP 2 it's &amp;quot;ifcfg-eth0:1&amp;quot; and also not the matching&lt;br /&gt;
              entries for &amp;quot;DEVICE=...&amp;quot;.  Also, obviously, the&lt;br /&gt;
              &amp;quot;IPADDR&amp;quot; is different as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 6:&lt;br /&gt;
&lt;br /&gt;
     Sharing Directories Among Several Users.&lt;br /&gt;
&lt;br /&gt;
     Several people are working on a project in &amp;quot;/home/share&amp;quot;&lt;br /&gt;
     and they need to create documents and programs so that&lt;br /&gt;
     others in the group can edit and execute these documents&lt;br /&gt;
     as needed. Also see (TIP 186) for adding existing users&lt;br /&gt;
     to groups.&lt;br /&gt;
&lt;br /&gt;
       $  /usr/sbin/groupadd share&lt;br /&gt;
       $  chown -R root.share /home/share&lt;br /&gt;
       $  /usr/bin/gpasswd -a &amp;lt;username&amp;gt; share&lt;br /&gt;
       $  chmod 2775 /home/share&lt;br /&gt;
&lt;br /&gt;
       $  ls -ld /home/share&lt;br /&gt;
             drwxrwsr-x    2 root     share        4096 Nov  8 16:19 /home/share&lt;br /&gt;
                   ^---------- Note the s bit, which was set with the chmod 2775&lt;br /&gt;
&lt;br /&gt;
       $  cat /etc/group&lt;br /&gt;
          ...&lt;br /&gt;
           share:x:502:chirico,donkey,zoe&lt;br /&gt;
          ...          ^------- users are added to this group.&lt;br /&gt;
&lt;br /&gt;
     The user may need to login again to get access. Or, if the user is currently&lt;br /&gt;
     logged in, they can run the following command:&lt;br /&gt;
&lt;br /&gt;
       $ su - &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Note, the above step is recommended over  &amp;quot;newgrp - share&amp;quot; since currently&lt;br /&gt;
     newgrp in FC2,FC3, and FC4 gets access to the group but the umask is not&lt;br /&gt;
     correctly formed.&lt;br /&gt;
&lt;br /&gt;
     As root you  can test their account.&lt;br /&gt;
&lt;br /&gt;
       $ su - &amp;lt;username&amp;gt;   &amp;quot;You need to '-' to pickup thier environment  '$ su - chirico' &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Note: SUID, SGID, Sticky bit. Only the left most octet is examined, and &amp;quot;chmod 755&amp;quot; is used&lt;br /&gt;
          as an example of the full command. But, anything else could be used as well. Normally&lt;br /&gt;
          you'd want executable permissions.&lt;br /&gt;
&lt;br /&gt;
        Octal digit  Binary value      Meaning                           Example usage&lt;br /&gt;
            0           000       all cleared                             $ chmod 0755 or chmod 755&lt;br /&gt;
            1           001       sticky                                  $ chmod 1755&lt;br /&gt;
            2           010       setgid                                  $ chmod 2755&lt;br /&gt;
            3           011       setgid, sticky                          $ chmod 3755&lt;br /&gt;
            4           100       setuid                                  $ chmod 4755&lt;br /&gt;
            5           101       setuid, sticky                          $ chmod 5755&lt;br /&gt;
            6           110       setuid, setgid                          $ chmod 6755&lt;br /&gt;
            7           111       setuid, setgid, sticky                  $ chmod 7755&lt;br /&gt;
&lt;br /&gt;
     A few examples applied to a directory below. In the first example all users in the group can&lt;br /&gt;
     add files to directory &amp;quot;dirA&amp;quot; and they can delete their own files. Users cannot delete other&lt;br /&gt;
     user's files.&lt;br /&gt;
&lt;br /&gt;
        Sticky bit:&lt;br /&gt;
           $ chmod 1770  dirA&lt;br /&gt;
&lt;br /&gt;
     Below files created within the directory have the group ID of the directory, rather than that&lt;br /&gt;
     of the default group setting for the user who created the file.&lt;br /&gt;
&lt;br /&gt;
        Set group ID bit:&lt;br /&gt;
           $ chmod 2755  dirB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 7:&lt;br /&gt;
&lt;br /&gt;
     Getting Infomation on Commands&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;info&amp;quot; is a great utility for getting information about the system.&lt;br /&gt;
     Here's a quick key on using &amp;quot;info&amp;quot; from the terminal prompt.&lt;br /&gt;
&lt;br /&gt;
       'q' exits.&lt;br /&gt;
       'u' moves up to the table of contents of the current section.&lt;br /&gt;
       'n' moves to the next chapter.&lt;br /&gt;
       'p' moves to the previous chapter.&lt;br /&gt;
       'space' goes into the selected section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The following is a good starting point:&lt;br /&gt;
&lt;br /&gt;
        $ info coreutils&lt;br /&gt;
&lt;br /&gt;
      Need to find out what a certain program does?&lt;br /&gt;
&lt;br /&gt;
        $ whatis  open&lt;br /&gt;
       open   (2)  - open and possibly create a file or device&lt;br /&gt;
       open   (3)  - perl pragma to set default PerlIO layers for input and output&lt;br /&gt;
       open   (3pm)  - perl pragma to set default PerlIO layers for input and output&lt;br /&gt;
       open   (n)  - Open a file-based or command pipeline channel&lt;br /&gt;
&lt;br /&gt;
      To get specific information about the open commmand&lt;br /&gt;
&lt;br /&gt;
        $ man 2 open&lt;br /&gt;
&lt;br /&gt;
       also try 'keyword' search, which is the same as the apropos command.&lt;br /&gt;
       For example, to find all the man pages on selinux, type the following:&lt;br /&gt;
&lt;br /&gt;
        $ man -k selinux&lt;br /&gt;
&lt;br /&gt;
       or the man full word search. Same as whatis command.&lt;br /&gt;
&lt;br /&gt;
        $ man -f &amp;lt;some string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       This is a hint once you are inside man.&lt;br /&gt;
&lt;br /&gt;
        space      moves forward one page&lt;br /&gt;
        b          moves backward&lt;br /&gt;
        y          scrolls up one line &amp;quot;yikes, I missed it!&amp;quot;&lt;br /&gt;
        g          goes to the beginning&lt;br /&gt;
        q          quits&lt;br /&gt;
        /&amp;lt;string&amp;gt;  search, repeat seach n&lt;br /&gt;
        m          mark, enter a letter like &amp;quot;a&amp;quot;, then, ' to go back&lt;br /&gt;
        '          enter a letter that is marked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       To get section numbers&lt;br /&gt;
&lt;br /&gt;
        $ man 8 ping&lt;br /&gt;
&lt;br /&gt;
       Note the numbers are used as follows&lt;br /&gt;
         (This is OpenBSD)&lt;br /&gt;
&lt;br /&gt;
         1  General Commands&lt;br /&gt;
         2  System Calls and Error Numbers&lt;br /&gt;
         3  C Libraries&lt;br /&gt;
         3p perl&lt;br /&gt;
         4  Devices and device drivers&lt;br /&gt;
         5  File Formats and config files&lt;br /&gt;
         6  Game instructions&lt;br /&gt;
         7  Miscellaneous information&lt;br /&gt;
         8  System maintenance&lt;br /&gt;
         9  Kernel internals&lt;br /&gt;
&lt;br /&gt;
       To find the man page directly, &amp;quot;ls&amp;quot; command:&lt;br /&gt;
&lt;br /&gt;
         $ whereis -m ls&lt;br /&gt;
         ls: /usr/share/man/man1/ls.1.gz /usr/share/man/man1/ls.1 /usr/share/man/man1p/ls.1p&lt;br /&gt;
&lt;br /&gt;
       To read this file directly, do the following:&lt;br /&gt;
&lt;br /&gt;
         $ man /usr/share/man/man1/ls.1.gz&lt;br /&gt;
&lt;br /&gt;
       If you want to know the manpath, execute manpath.&lt;br /&gt;
&lt;br /&gt;
         $ manpath&lt;br /&gt;
         /usr/share/man:/usr/X11R6/man:/usr/local/share/man:/usr/local/pgsql/man:/usr/man:/usr/local/man&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 8:&lt;br /&gt;
&lt;br /&gt;
     How to Put a &amp;quot;Running Job&amp;quot; in the Background.&lt;br /&gt;
&lt;br /&gt;
     You're running a job at the terminal prompt, and it's taking&lt;br /&gt;
     a very long time. You want to put the job in the backgroud.&lt;br /&gt;
&lt;br /&gt;
       &amp;quot;CTL - z&amp;quot; Temporarily suspends the job&lt;br /&gt;
       $ jobs     This will list all the jobs&lt;br /&gt;
       $ bg %jobnumber (bg %1)  To run in the background&lt;br /&gt;
       $ fg %jobnumber          To bring back in the foreground&lt;br /&gt;
&lt;br /&gt;
     Need to kill all jobs -- say you're using several suspended&lt;br /&gt;
     emacs sessions and you just want everything to exit.&lt;br /&gt;
&lt;br /&gt;
       $ kill -9  `jobs -p`&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;jobs -p&amp;quot; gives the process number of each job, and the&lt;br /&gt;
     kill -9 kills everything. Yes, sometimes &amp;quot;kill -9&amp;quot; is excessive&lt;br /&gt;
     and you should issue a &amp;quot;kill -15&amp;quot; that allows jobs to clean-up.&lt;br /&gt;
     However, for exacs session, I prefer &amp;quot;kill -9&amp;quot; and haven't had&lt;br /&gt;
     a problem.&lt;br /&gt;
&lt;br /&gt;
     Sometimes you need to list the process id along with job&lt;br /&gt;
     information. For instance, here's process id with the listing.&lt;br /&gt;
&lt;br /&gt;
       $ jobs -l&lt;br /&gt;
&lt;br /&gt;
     Note you can also renice a job, or give it lower priority.&lt;br /&gt;
&lt;br /&gt;
       $ nice -n +15 find . -ctime 2 -type f  -exec ls {} \; &amp;gt; last48hours&lt;br /&gt;
        ^z&lt;br /&gt;
       $  bg&lt;br /&gt;
&lt;br /&gt;
     So above that was a ctl-z to suppend. Then, bg to run it in&lt;br /&gt;
     the background. Now, if you want to change the priority lower&lt;br /&gt;
     you just renice it, once you know the process id.&lt;br /&gt;
&lt;br /&gt;
       $ jobs -pl&lt;br /&gt;
   [1]+ 29388 Running                 nice -n +15 find . -ctime 2 -exec ls -l {} \; &amp;gt;mout &amp;amp;&lt;br /&gt;
&lt;br /&gt;
       $ renice +30 -p 29388&lt;br /&gt;
        29388: old priority 15, new priority 19&lt;br /&gt;
&lt;br /&gt;
      19 was the lowest priority for this job. You cannot increase&lt;br /&gt;
      the priority unless you are root.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 9:&lt;br /&gt;
&lt;br /&gt;
     Need to Delete a File for Good -- not even GOD can recover.&lt;br /&gt;
&lt;br /&gt;
     You have a file &amp;quot;secret&amp;quot;.  The following makes it so no one&lt;br /&gt;
     can read it.  If the file was 12 bytes, it's now 4096 after it&lt;br /&gt;
     has been over written 100 times.  There's no way to recover this.&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z secret&lt;br /&gt;
&lt;br /&gt;
     Want to remove the file? Use the &amp;quot;u&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z -u test2&lt;br /&gt;
&lt;br /&gt;
     It can be applied to a device&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z -u /dev/fd0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       CAUTION: Note that shred relies on a very important assumption: that the file system  overwrites  data&lt;br /&gt;
       in  place.   This is the traditional way to do things, but many modern file system designs do not sat-&lt;br /&gt;
       isfy this assumption.  The following are examples of file systems on which shred is not effective,  or&lt;br /&gt;
       is not guaranteed to be effective in all file system modes:&lt;br /&gt;
&lt;br /&gt;
       * log-structured or journaled file systems, such as those supplied with&lt;br /&gt;
&lt;br /&gt;
              AIX and Solaris (and JFS, ReiserFS, XFS, Ext3, etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 52).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 10:&lt;br /&gt;
&lt;br /&gt;
     Who and What is doing What on Your System - finding open sockets,&lt;br /&gt;
     files etc.&lt;br /&gt;
&lt;br /&gt;
       $ lsof&lt;br /&gt;
          or as root&lt;br /&gt;
       $ watch lsof -i&lt;br /&gt;
&lt;br /&gt;
     To list all open Internet files, use:&lt;br /&gt;
&lt;br /&gt;
       $ lsof -i -U&lt;br /&gt;
&lt;br /&gt;
       (See TIP 118)&lt;br /&gt;
&lt;br /&gt;
     Also try fuser. Suppose you have a mounted file-system, and you need&lt;br /&gt;
     to umount it. To list the users on the file-system /work&lt;br /&gt;
&lt;br /&gt;
       $ fuser -u /work&lt;br /&gt;
&lt;br /&gt;
     To kill all processes accessing the file system /work  in  any way.&lt;br /&gt;
&lt;br /&gt;
       $ fuser -km /work&lt;br /&gt;
&lt;br /&gt;
     Or better yet, maybe you want to eject a cdrom on /mnt/cdrom&lt;br /&gt;
&lt;br /&gt;
       $ fuser -km /mnt/cdrom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     If you need IO load information about your system, you can execute&lt;br /&gt;
     iostat. But note, the very first iostat gives a snapshot since&lt;br /&gt;
     the last boot. You typically want the following command, which gives&lt;br /&gt;
     you 3 outputs every 5 seconds.&lt;br /&gt;
&lt;br /&gt;
       $ iostat -xtc 5 3&lt;br /&gt;
       Linux 2.6.12-1.1376_FC3smp (squeezel.squeezel.com) 	10/05/2005&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:04 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  0.97    0.06    1.94    0.62   96.41&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:09 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  0.60    0.00    1.70    0.00   97.70&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:14 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  1.00    0.00    1.60    0.00   97.39&lt;br /&gt;
&lt;br /&gt;
     vmstat reports memory statistics.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ vmstat&lt;br /&gt;
       $ ifconfig&lt;br /&gt;
       $ cat /proc/sys/vm/.. (entries under here)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      *NOTE: (TIP 77) shows sample usage of &amp;quot;ifconfig&amp;quot;. Also&lt;br /&gt;
       (TIP 84) shows sample output of &amp;quot;$ cat /proc/cpuinfo&amp;quot;. You can download iostat&lt;br /&gt;
       and other packages from (http://perso.wanadoo.fr/sebastien.godard/download_en.html).&lt;br /&gt;
       You also may want to look at iozone (TIP 178).&lt;br /&gt;
&lt;br /&gt;
     Also&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/meminfo&lt;br /&gt;
       $ cat /proc/stat&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/uptime&lt;br /&gt;
       1078623.55 1048008.34       First number is the number of seconds since boot.&lt;br /&gt;
                                   The second number is the number of idle seconds.&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/loadavg&lt;br /&gt;
       0.25 0.14 0.10 1/166 7778   This shows load at 1,5, and 15 minutes,&lt;br /&gt;
                                   a total of 1 current running process out&lt;br /&gt;
                                   from a total of 166. The 7778 is the last&lt;br /&gt;
                                   process id used.&lt;br /&gt;
                                   Ref: http://www.teamquest.com/resources/gunther/ldavg1.shtml&lt;br /&gt;
&lt;br /&gt;
     Or current process open file descriptors&lt;br /&gt;
&lt;br /&gt;
        $ ls -l /proc/self/fd/0&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lr-x------    1 chirico  chirico        64 Jun 29 13:17 3 -&amp;gt; /proc/26667/fd&lt;br /&gt;
&lt;br /&gt;
      So you could, $ echo &amp;quot;stuff&amp;quot; &amp;gt; /dev/pts/51, to get output. Note, tree is also&lt;br /&gt;
      helpful here:&lt;br /&gt;
&lt;br /&gt;
         $ tree /proc/self&lt;br /&gt;
&lt;br /&gt;
            /proc/self&lt;br /&gt;
            |-- auxv&lt;br /&gt;
            |-- cmdline&lt;br /&gt;
            |-- cwd -&amp;gt; /work/souptonuts/documentation/theBook&lt;br /&gt;
            |-- environ&lt;br /&gt;
            |-- exe -&amp;gt; /usr/bin/tree&lt;br /&gt;
            |-- fd&lt;br /&gt;
            |   |-- 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   |-- 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   |-- 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   `-- 3 -&amp;gt; /proc/26668/fd&lt;br /&gt;
            |-- maps&lt;br /&gt;
            |-- mem&lt;br /&gt;
            |-- mounts&lt;br /&gt;
            |-- root -&amp;gt; /&lt;br /&gt;
            |-- stat&lt;br /&gt;
            |-- statm&lt;br /&gt;
            |-- status&lt;br /&gt;
            |-- task&lt;br /&gt;
            |   `-- 26668&lt;br /&gt;
            |       |-- auxv&lt;br /&gt;
            |       |-- cmdline&lt;br /&gt;
            |       |-- cwd -&amp;gt; /work/souptonuts/documentation/theBook&lt;br /&gt;
            |       |-- environ&lt;br /&gt;
            |       |-- exe -&amp;gt; /usr/bin/tree&lt;br /&gt;
            |       |-- fd&lt;br /&gt;
            |       |   |-- 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   |-- 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   |-- 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   `-- 3 -&amp;gt; /proc/26668/task/26668/fd&lt;br /&gt;
            |       |-- maps&lt;br /&gt;
            |       |-- mem&lt;br /&gt;
            |       |-- mounts&lt;br /&gt;
            |       |-- root -&amp;gt; /&lt;br /&gt;
            |       |-- stat&lt;br /&gt;
            |       |-- statm&lt;br /&gt;
            |       |-- status&lt;br /&gt;
            |       `-- wchan&lt;br /&gt;
            `-- wchan&lt;br /&gt;
&lt;br /&gt;
            10 directories, 28 files&lt;br /&gt;
&lt;br /&gt;
     Need a listing of the system settings?&lt;br /&gt;
&lt;br /&gt;
       $ sysctl -a&lt;br /&gt;
&lt;br /&gt;
     Need IPC (Shared Memory Segments, Semaphore Arrays, Message Queue) status&lt;br /&gt;
     etc?&lt;br /&gt;
&lt;br /&gt;
       $ ipcs&lt;br /&gt;
       $ ipcs -l  &amp;quot;This gives limits&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Need to &amp;quot;watch&amp;quot; everything a user does?  The following watches donkey.&lt;br /&gt;
&lt;br /&gt;
       $ watch lsof -u donkey&lt;br /&gt;
&lt;br /&gt;
     Or, to see what in  going on in directory &amp;quot;/work/junk&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       $ watch lsof +D /work/junk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 11:&lt;br /&gt;
&lt;br /&gt;
     How to make a File &amp;quot;immutable&amp;quot; or &amp;quot;unalterable&amp;quot; -- it cannot be changed&lt;br /&gt;
     or deleted even by root. Note this works on (ext2/ext3) filesystems.&lt;br /&gt;
     And, yes, root can delete after it's changed back.&lt;br /&gt;
&lt;br /&gt;
     As root:&lt;br /&gt;
&lt;br /&gt;
       $ chattr +i filename&lt;br /&gt;
&lt;br /&gt;
     And to change it back:&lt;br /&gt;
&lt;br /&gt;
       $ chattr -i filename&lt;br /&gt;
&lt;br /&gt;
     List attributes&lt;br /&gt;
&lt;br /&gt;
       $ lsattr filename&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 12:&lt;br /&gt;
&lt;br /&gt;
     SSH - How to Generate the Key Pair.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     On the local server&lt;br /&gt;
&lt;br /&gt;
       $  ssh-keygen -t dsa -b 2048&lt;br /&gt;
&lt;br /&gt;
     This will create the two files:&lt;br /&gt;
&lt;br /&gt;
            .ssh/id_dsa (Private key)&lt;br /&gt;
            .ssh/id_dsa.pub  (Public key you can share)&lt;br /&gt;
&lt;br /&gt;
     Next insert &amp;quot;.ssh/id_dsa.pub&amp;quot; on the remote server&lt;br /&gt;
     in the file  &amp;quot;.ssh/authorized_keys&amp;quot; and &amp;quot;.ssh/authorized_keys2&amp;quot;&lt;br /&gt;
     and change the  permission of each file to (chmod 600). Plus, make&lt;br /&gt;
     sure the directory &amp;quot;.ssh&amp;quot; exists on the remote computer with 700 rights.&lt;br /&gt;
     Ok, assuming  192.168.1.155 is the remote server and &amp;quot;donkey&amp;quot; is the&lt;br /&gt;
     account on that remote server.&lt;br /&gt;
&lt;br /&gt;
       $ ssh donkey@192.168.1.155 &amp;quot;mkdir -p .ssh&amp;quot;&lt;br /&gt;
       $ ssh donkey@192.168.1.155 &amp;quot;chmod 700 .ssh&amp;quot;&lt;br /&gt;
       $ scp ./.ssh/id_dsa.pub  donkey@192.168.1.155:.ssh/newkey.pub&lt;br /&gt;
&lt;br /&gt;
     Now connect to that remote server &amp;quot;192.168.1.155&amp;quot; and add .ssh/newkey.pub&lt;br /&gt;
     to both &amp;quot;authorized_keys&amp;quot; and &amp;quot;authorized_keys2&amp;quot;.  When done, the permission&lt;br /&gt;
     on&lt;br /&gt;
       (This is on the remote server)&lt;br /&gt;
&lt;br /&gt;
        $chmod 600 .ssh/authorized_key*&lt;br /&gt;
&lt;br /&gt;
     Next, go back to the local server and issue the following:&lt;br /&gt;
&lt;br /&gt;
        $ ssh-agent $SHELL&lt;br /&gt;
        $ ssh-add&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;ssh-add&amp;quot; will allow you to enter the passphrase and it will&lt;br /&gt;
     save it for the current login session.&lt;br /&gt;
&lt;br /&gt;
     You don't have to enter a password when running &amp;quot;ssh-keygen&amp;quot; above. But,&lt;br /&gt;
     remember anyone with root access can &amp;quot;su - &amp;lt;username&amp;gt;&amp;quot; and then connect&lt;br /&gt;
     to your computers.  It's harder, however, not impossible, for root to do&lt;br /&gt;
     this if  you have a password.&lt;br /&gt;
&lt;br /&gt;
     (Reference TIP 151)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 13:&lt;br /&gt;
&lt;br /&gt;
     Securing the System: Don't allow root to login remotely.  Instead,&lt;br /&gt;
     the admin could login as another account, then, &amp;quot;su -&amp;quot;.  However,&lt;br /&gt;
     root can still login &amp;quot;from the local terminal&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     In the &amp;quot;/etc/ssh/sshd_config&amp;quot; file change the following lines:&lt;br /&gt;
&lt;br /&gt;
        Protocol 2&lt;br /&gt;
        PermitRootLogin no&lt;br /&gt;
        PermitEmptyPasswords no&lt;br /&gt;
&lt;br /&gt;
     Then, restart ssh&lt;br /&gt;
&lt;br /&gt;
        /etc/init.d/sshd restart&lt;br /&gt;
&lt;br /&gt;
     Why would you want to do this?  It's not possible for anyone to guess&lt;br /&gt;
     or keep trying the root account.  This is especially good for computers&lt;br /&gt;
     on the Internet. So, even if the &amp;quot;root&amp;quot; passwords is known, they can't&lt;br /&gt;
     get access to the system remotely.  Only from the terminal, which is locked&lt;br /&gt;
     in your computer room. However, if anyone has a account on the server,&lt;br /&gt;
     then, they can login under their  account then &amp;quot;su -&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Suppose you only want a limited number of users:  &amp;quot;mchirico&amp;quot; and &amp;quot;donkey&amp;quot;.&lt;br /&gt;
     Add the following line to &amp;quot;/etc/ssh/sshd_config&amp;quot;. Note, this allows access&lt;br /&gt;
     for chirico and donkey, but everyone else is denied.&lt;br /&gt;
&lt;br /&gt;
         #  Once you add AllowUsers - everyone else is denied.&lt;br /&gt;
         AllowUsers mchirico donkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 14:&lt;br /&gt;
&lt;br /&gt;
     Keep Logs Longer with Less Space.&lt;br /&gt;
&lt;br /&gt;
     Normally logs rotate monthly, over writing all the old data.  Here's a&lt;br /&gt;
     sample &amp;quot;/etc/logrotate.conf&amp;quot; that will keep 12 months of backup&lt;br /&gt;
     compressing the logfiles&lt;br /&gt;
&lt;br /&gt;
       $ cat /etc/logrotate.conf&lt;br /&gt;
&lt;br /&gt;
             # see &amp;quot;man logrotate&amp;quot; for details&lt;br /&gt;
             # rotate log files weekly&lt;br /&gt;
             #chirico changes to monthly&lt;br /&gt;
             monthly&lt;br /&gt;
&lt;br /&gt;
             # keep 4 weeks worth of backlogs&lt;br /&gt;
             # keep 12 months of backup&lt;br /&gt;
             rotate 12&lt;br /&gt;
&lt;br /&gt;
             # create new (empty) log files after rotating old ones&lt;br /&gt;
             create&lt;br /&gt;
&lt;br /&gt;
             # uncomment this if you want your log files compressed&lt;br /&gt;
             compress&lt;br /&gt;
&lt;br /&gt;
             # RPM packages drop log rotation information into this directory&lt;br /&gt;
             include /etc/logrotate.d&lt;br /&gt;
&lt;br /&gt;
             # no packages own wtmp -- we'll rotate them here&lt;br /&gt;
             /var/log/wtmp {&lt;br /&gt;
                 monthly&lt;br /&gt;
                 create 0664 root utmp&lt;br /&gt;
                 rotate 1&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
             # system-specific logs may be also be configured here.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Note: see tip 1. The clock should always be correctly set.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 15:&lt;br /&gt;
&lt;br /&gt;
     What Network Services are Running?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -atup&lt;br /&gt;
&lt;br /&gt;
     or&lt;br /&gt;
&lt;br /&gt;
          $ netstat -ap|grep LISTEN|less&lt;br /&gt;
&lt;br /&gt;
     This can be helpful to determine the services running.&lt;br /&gt;
&lt;br /&gt;
     Need stats on dropped UDP packets?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s -u&lt;br /&gt;
&lt;br /&gt;
     or TCP&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s -t&lt;br /&gt;
&lt;br /&gt;
     or summary of everything&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s&lt;br /&gt;
&lt;br /&gt;
     or looking for error rates on the interface?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -i&lt;br /&gt;
&lt;br /&gt;
     Listening interfaces?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -l&lt;br /&gt;
&lt;br /&gt;
     (Tip above provided by Amos Shapira)&lt;br /&gt;
&lt;br /&gt;
     Also see TIP 77.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 16:&lt;br /&gt;
&lt;br /&gt;
     Apache: Creating and Using an &amp;quot;.htaccess&amp;quot; File&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Below is a sample &amp;quot;.htaccess&amp;quot; file which goes in&lt;br /&gt;
     &amp;quot;/usr/local/apache/htdocs/chirico/alpha/.htaccess&amp;quot; for this&lt;br /&gt;
     example&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         AuthUserFile /usr/local/apache/htdocs/chirico/alpha/.htpasswd&lt;br /&gt;
         AuthGroupFile /dev/null&lt;br /&gt;
         AuthName &amp;quot;Your Name and regular password required&amp;quot;&lt;br /&gt;
         AuthType Basic&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;Limit GET POST&amp;gt;&lt;br /&gt;
         require valid-user&lt;br /&gt;
         &amp;lt;/Limit&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    In order for this to work /usr/local/apache/conf/httpd.conf must&lt;br /&gt;
    have the following line in it:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       #&lt;br /&gt;
       &amp;lt;Directory /usr/local/apache/htdocs/chirico/alpha&amp;gt;&lt;br /&gt;
           AllowOverride FileInfo AuthConfig Limit&lt;br /&gt;
           Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec&lt;br /&gt;
           &amp;lt;Limit GET POST OPTIONS PROPFIND&amp;gt;&lt;br /&gt;
               Order allow,deny&lt;br /&gt;
               Allow from all&lt;br /&gt;
           &amp;lt;/Limit&amp;gt;&lt;br /&gt;
           &amp;lt;LimitExcept GET POST OPTIONS PROPFIND&amp;gt;&lt;br /&gt;
               Order deny,allow&lt;br /&gt;
               Deny from all&lt;br /&gt;
           &amp;lt;/LimitExcept&amp;gt;&lt;br /&gt;
       &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Also, a password file must be created&lt;br /&gt;
&lt;br /&gt;
      $ /usr/local/apache/bin/htpasswd -c .htpasswd chirico&lt;br /&gt;
&lt;br /&gt;
    And enter the user names and passwords.&lt;br /&gt;
&lt;br /&gt;
    Next Reload Apache:&lt;br /&gt;
&lt;br /&gt;
      $ /etc/init.d/httpd reload&lt;br /&gt;
&lt;br /&gt;
    (Reference TIP 213 limit access to certain directories based on IP address).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 17:&lt;br /&gt;
&lt;br /&gt;
     Working with &amp;quot;mt&amp;quot; Commands: reading and writing to tape.&lt;br /&gt;
&lt;br /&gt;
     The following assumes the tape device is &amp;quot;/dev/st0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     STEP 1 ( rewind the tape)&lt;br /&gt;
&lt;br /&gt;
          # mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (check to see if you are at block 0)&lt;br /&gt;
&lt;br /&gt;
          # mt -f /dev/nst0 tell&lt;br /&gt;
            At block 0.&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Backup &amp;quot;tar compress&amp;quot;  directories &amp;quot;one&amp;quot;  and &amp;quot;two&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
          # tar -czf /dev/nst0 one two&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Check to see what block you are at)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
&lt;br /&gt;
       You should get something like block 2 at this point.&lt;br /&gt;
&lt;br /&gt;
     STEP 5 (Rewind the tape)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
     STEP 6 (List the files)&lt;br /&gt;
&lt;br /&gt;
           # tar -tzf /dev/nst0&lt;br /&gt;
              one/&lt;br /&gt;
              one/test&lt;br /&gt;
              two/&lt;br /&gt;
&lt;br /&gt;
     STEP 7 (Restore directory &amp;quot;one&amp;quot;  into directory &amp;quot;junk&amp;quot;).  Note, you&lt;br /&gt;
          have to first rewind the tape, since the last operation moved&lt;br /&gt;
          ahead 2 blocks. Check this with &amp;quot;mt -f /dev/nst0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           # cd junk&lt;br /&gt;
           # mt -f /dev/nst0 rewind&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
              At block 0.&lt;br /&gt;
           # tar -xzf /dev/nst0 one&lt;br /&gt;
&lt;br /&gt;
     STEP 8 (Next, take a look to see what block the tape is at)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
              At block 2.&lt;br /&gt;
&lt;br /&gt;
     STEP 9 (Now backup directories three  and four)&lt;br /&gt;
&lt;br /&gt;
           # tar -czf /dev/nst0 three four&lt;br /&gt;
&lt;br /&gt;
       After backing up the files, the tape should be past block 2.&lt;br /&gt;
       Check this.&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
             At block 4.&lt;br /&gt;
&lt;br /&gt;
          Currently the following exist:&lt;br /&gt;
&lt;br /&gt;
                At block 1:&lt;br /&gt;
                     one/&lt;br /&gt;
                    one/test&lt;br /&gt;
                    two/&lt;br /&gt;
&lt;br /&gt;
                At block 2:&lt;br /&gt;
                    three/&lt;br /&gt;
                    three/samplehere&lt;br /&gt;
                    four/&lt;br /&gt;
&lt;br /&gt;
                At block 4:&lt;br /&gt;
                    (* This is empty *)&lt;br /&gt;
&lt;br /&gt;
     A few notes. You can set the blocking factor and a label&lt;br /&gt;
     with tar. For example:&lt;br /&gt;
&lt;br /&gt;
      $ tar --label=&amp;quot;temp label&amp;quot; --create  --blocking-factor=128 --file=/dev/nst0 Notes&lt;br /&gt;
&lt;br /&gt;
     But note if you try to read it with the default, incorrect blocking&lt;br /&gt;
     factor, then, you will get the following error:&lt;br /&gt;
&lt;br /&gt;
        $ tar -t   --file=/dev/nst0&lt;br /&gt;
        tar: /dev/nst0: Cannot read: Cannot allocate memory&lt;br /&gt;
        tar: At beginning of tape, quitting now&lt;br /&gt;
        tar: Error is not recoverable: exiting now&lt;br /&gt;
&lt;br /&gt;
     However this is easily fixed with the correct blocking factor&lt;br /&gt;
&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ tar -t --blocking-factor=128 --file=/dev/nst0&lt;br /&gt;
         temp label&lt;br /&gt;
         Notes&lt;br /&gt;
&lt;br /&gt;
     Take advantage of the label command.&lt;br /&gt;
&lt;br /&gt;
         $ MYCOMMENTS=&amp;quot;Big_important_tape&amp;quot;&lt;br /&gt;
         $ tar --label=&amp;quot;$(date +%F)&amp;quot;+&amp;quot;${MYCOMMENTS}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Writing to tape on a remote 192.168.1.155 computer&lt;br /&gt;
&lt;br /&gt;
         $ tar cvzf - ./tmp | ssh -l chirico 192.168.1.155 '(mt -f /dev/nst0 rewind; dd of=/dev/st0 )'&lt;br /&gt;
&lt;br /&gt;
     Restoring the contents from tape on a remote computer&lt;br /&gt;
&lt;br /&gt;
         $ ssh -l chirico 192.168.1.155 '(mt -f /dev/nst0 rewind; dd if=/dev/st0  )'|tar xzf -&lt;br /&gt;
&lt;br /&gt;
     Getting data off of tape with dd command with odd blocking factor. Just set ibs very high&lt;br /&gt;
&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ tar --label=&amp;quot;Contenets of Notes&amp;quot; --create  --blocking-factor=128 --file=/dev/nst0 Notes&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ dd ibs=1048576 if=/dev/st0 of=notes.tar&lt;br /&gt;
&lt;br /&gt;
     The above will probably work with ibs=64k as well&lt;br /&gt;
&lt;br /&gt;
        (Also see TIP 136)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 18:&lt;br /&gt;
&lt;br /&gt;
     Encrypting Data to Tape using &amp;quot;tar&amp;quot; and &amp;quot;openssl&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     The following shows an example of writing the contents of &amp;quot;tapetest&amp;quot; to tape:&lt;br /&gt;
&lt;br /&gt;
        $ tar zcvf - tapetest|openssl des3 -salt  -k secretpassword | dd of=/dev/st0&lt;br /&gt;
&lt;br /&gt;
     Reading the data back:&lt;br /&gt;
&lt;br /&gt;
        $ dd if=/dev/st0|openssl des3 -d -k secretpassword|tar xzf -&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 19:&lt;br /&gt;
&lt;br /&gt;
     Mounting an ISO Image as a Filesystem -- this is great if you don't have the DVD&lt;br /&gt;
         hardware, but, need to get at the data.  The following show an example of&lt;br /&gt;
         mounting the Fedora core 2 as a file.&lt;br /&gt;
&lt;br /&gt;
         $ mkdir /iso0&lt;br /&gt;
         $ mount -o loop -t iso9660 /FC2-i386-DVD.iso  /iso0&lt;br /&gt;
&lt;br /&gt;
     Or to mount automatically at boot, add the following to &amp;quot;/etc/fstab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         /FC2-i386-DVD.iso /iso0     iso9660 rw,loop  0 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Reference: http://umn.dl.sourceforge.net/sourceforge/souptonuts/README_fedora.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 20:&lt;br /&gt;
&lt;br /&gt;
     Getting Information about the Hard drive and list all PCI devices.&lt;br /&gt;
&lt;br /&gt;
                $ hdparm /dev/hda&lt;br /&gt;
&lt;br /&gt;
                  /dev/hda:&lt;br /&gt;
                   multcount    = 16 (on)&lt;br /&gt;
                   IO_support   =  0 (default 16-bit)&lt;br /&gt;
                   unmaskirq    =  0 (off)&lt;br /&gt;
                   using_dma    =  1 (on)&lt;br /&gt;
                   keepsettings =  0 (off)&lt;br /&gt;
                   readonly     =  0 (off)&lt;br /&gt;
                   readahead    = 256 (on)&lt;br /&gt;
                   geometry     = 16383/255/63, sectors = 234375000, start = 0&lt;br /&gt;
&lt;br /&gt;
            or for SCSI&lt;br /&gt;
&lt;br /&gt;
                $ hdparm /dev/sda&lt;br /&gt;
&lt;br /&gt;
            Try it with the -i option for information&lt;br /&gt;
&lt;br /&gt;
                $ hdparm -i /dev/hda&lt;br /&gt;
&lt;br /&gt;
                /dev/hda:&lt;br /&gt;
&lt;br /&gt;
                Model=IC35L120AVV207-1, FwRev=V24OA66A, SerialNo=VNVD09G4CZ6E0T&lt;br /&gt;
                Config={ HardSect NotMFM HdSw&amp;gt;15uSec Fixed DTR&amp;gt;10Mbs }&lt;br /&gt;
                RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=52&lt;br /&gt;
                BuffType=DualPortCache, BuffSize=7965kB, MaxMultSect=16, MultSect=16&lt;br /&gt;
                CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=234375000&lt;br /&gt;
                IORDY=on/off, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}&lt;br /&gt;
                PIO modes:  pio0 pio1 pio2 pio3 pio4&lt;br /&gt;
                DMA modes:  mdma0 mdma1 mdma2&lt;br /&gt;
                UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5&lt;br /&gt;
                AdvancedPM=yes: disabled (255) WriteCache=enabled&lt;br /&gt;
                Drive conforms to: ATA/ATAPI-6 T13 1410D revision 3a:  2 3 4 5 6&lt;br /&gt;
&lt;br /&gt;
            How fast is your drive?&lt;br /&gt;
&lt;br /&gt;
                $ hdparm -tT /dev/hda&lt;br /&gt;
&lt;br /&gt;
                /dev/hda:&lt;br /&gt;
                Timing buffer-cache reads:   128 MB in  0.41 seconds =315.32 MB/sec&lt;br /&gt;
                Timing buffered disk reads:  64 MB in  1.19 seconds = 53.65 MB/sec&lt;br /&gt;
&lt;br /&gt;
            Need to find your device?&lt;br /&gt;
&lt;br /&gt;
                $ mount&lt;br /&gt;
                   or&lt;br /&gt;
                $ cat /proc/partitions&lt;br /&gt;
                   or&lt;br /&gt;
                $ dmesg | egrep '^(s|h)d'&lt;br /&gt;
&lt;br /&gt;
                   which for my system lists:&lt;br /&gt;
&lt;br /&gt;
                      hda: IC35L120AVV207-1, ATA DISK drive&lt;br /&gt;
                      hdc: Lite-On LTN486S 48x Max, ATAPI CD/DVD-ROM drive&lt;br /&gt;
                      hda: max request size: 1024KiB&lt;br /&gt;
                      hda: 234375000 sectors (120000 MB) w/7965KiB Cache, CHS=16383/255/63, UDMA(100)&lt;br /&gt;
&lt;br /&gt;
             By the way, if you want to turn on dma&lt;br /&gt;
&lt;br /&gt;
                 $ hdparm -d1 /dev/hda&lt;br /&gt;
                   setting using_dma to 1 (on)&lt;br /&gt;
                   using_dma    =  1 (on)&lt;br /&gt;
&lt;br /&gt;
         (Also see TIP 122 )&lt;br /&gt;
&lt;br /&gt;
     List all PCI devices&lt;br /&gt;
&lt;br /&gt;
                $ lspci -v&lt;br /&gt;
&lt;br /&gt;
          00:00.0 Host bridge: Intel Corp. 82845G/GL [Brookdale-G] Chipset Host Bridge (rev&lt;br /&gt;
                  Subsystem: Dell Computer Corporation: Unknown device 0160&lt;br /&gt;
                  Flags: bus master, fast devsel, latency 0&lt;br /&gt;
                  Memory at f0000000 (32-bit, prefetchable) [size=128M]&lt;br /&gt;
                  Capabilities: &amp;lt;available only to root&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              ... lots more ...&lt;br /&gt;
&lt;br /&gt;
           Note, there is also lspci -vv for even more information.&lt;br /&gt;
&lt;br /&gt;
          (Also see TIP 200)&lt;br /&gt;
&lt;br /&gt;
TIP 21:&lt;br /&gt;
&lt;br /&gt;
     Setting up &amp;quot;cron&amp;quot; Jobs.&lt;br /&gt;
&lt;br /&gt;
     If you want to use the emacs editor for editing cron jobs, then,&lt;br /&gt;
     set the following in your &amp;quot;/home/user/.bash_profile&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        EDITOR=emacs&lt;br /&gt;
&lt;br /&gt;
     Then, to edit cron jobs&lt;br /&gt;
&lt;br /&gt;
        $ crontab -e&lt;br /&gt;
&lt;br /&gt;
     You may want to put in the following header&lt;br /&gt;
&lt;br /&gt;
        #MINUTE(0-59) HOUR(0-23) DAYOFMONTH(1-31) MONTHOFYEAR(1-12) DAYOFWEEK(0-6) Note 0=Sun and 7=Sun&lt;br /&gt;
        #&lt;br /&gt;
        #14,15 10 * * 0   /usr/bin/somecommmand  &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     The sample &amp;quot;commented out command&amp;quot; will run at 10:14 and 10:15 every Sunday.  There will&lt;br /&gt;
     be no &amp;quot;mail&amp;quot; sent to the user because of the &amp;quot;&amp;gt;/dev/null 2&amp;gt;&amp;amp;1&amp;quot; entry.&lt;br /&gt;
&lt;br /&gt;
        $ crontab -l&lt;br /&gt;
&lt;br /&gt;
     The above will list all cron jobs. Or if you're root&lt;br /&gt;
&lt;br /&gt;
        $ crontab -l -u &amp;lt;username&amp;gt;&lt;br /&gt;
        $ crontab -e -u &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Reference &amp;quot;man 5 crontab&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
        The time and date fields are:&lt;br /&gt;
&lt;br /&gt;
                     field          allowed values&lt;br /&gt;
                     -----          --------------&lt;br /&gt;
                     minute         0-59&lt;br /&gt;
                     hour           0-23&lt;br /&gt;
                     day of month   1-31&lt;br /&gt;
                     month          1-12 (or names, see below)&lt;br /&gt;
                     day of week    0-7 (0 or 7 is Sun, or use names)&lt;br /&gt;
&lt;br /&gt;
              A field may be an asterisk (*), which always stands for ``first-last''.&lt;br /&gt;
&lt;br /&gt;
              Ranges of numbers are allowed.  Ranges are two numbers separated with a&lt;br /&gt;
              hyphen.   The  specified  range is inclusive.  For example, 8-11 for an&lt;br /&gt;
              ``hours'' entry specifies execution at hours 8, 9, 10 and 11.&lt;br /&gt;
&lt;br /&gt;
              Lists are allowed.  A list is a set of numbers (or ranges) separated by&lt;br /&gt;
              commas.  Examples: ``1,2,5,9'', ``0-4,8-12''.&lt;br /&gt;
&lt;br /&gt;
              Ranges can include &amp;quot;steps&amp;quot;, so &amp;quot;1-9/2&amp;quot; is the same as &amp;quot;1,3,5,7,9&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Note, you can run just every 5 minutes as follows:&lt;br /&gt;
&lt;br /&gt;
              */5 * * * * /etc/mrtg/domrtg  &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     To run jobs hourly,daily,weekly or monthly you can add shell scripts into the&lt;br /&gt;
     appropriate directory:&lt;br /&gt;
&lt;br /&gt;
             /etc/cron.hourly/&lt;br /&gt;
             /etc/cron.daily/&lt;br /&gt;
             /etc/cron.weekly/&lt;br /&gt;
             /etc/cron.monthly/&lt;br /&gt;
&lt;br /&gt;
     Note that the above are pre-configured schedules set in &amp;quot;/etc/crontab&amp;quot;, so&lt;br /&gt;
     if you want, you can change the schedule. Below is my /etc/crontab:&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/crontab&lt;br /&gt;
           SHELL=/bin/bash&lt;br /&gt;
           PATH=/sbin:/bin:/usr/sbin:/usr/bin&lt;br /&gt;
           MAILTO=root&lt;br /&gt;
           HOME=/&lt;br /&gt;
&lt;br /&gt;
           # run-parts&lt;br /&gt;
           01 * * * * root run-parts /etc/cron.hourly&lt;br /&gt;
           02 4 * * * root run-parts /etc/cron.daily&lt;br /&gt;
           22 4 * * 0 root run-parts /etc/cron.weekly&lt;br /&gt;
           42 4 1 * * root run-parts /etc/cron.monthly&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 22:&lt;br /&gt;
&lt;br /&gt;
     Keeping Files in Sync Between Servers.&lt;br /&gt;
&lt;br /&gt;
     The remote computer is &amp;quot;192.168.1.171&amp;quot; and has the account &amp;quot;donkey&amp;quot;.  You want&lt;br /&gt;
     to &amp;quot;keep in sync&amp;quot; the files under &amp;quot;/home/cu2000/Logs&amp;quot; on the remote computer&lt;br /&gt;
     with files on &amp;quot;/home/chirico/dev/MEDIA_Server&amp;quot; on the local computer.&lt;br /&gt;
&lt;br /&gt;
       $ rsync  -Lae ssh  donkey@192.168.1.171:/home/cu2000/Logs /home/chirico/dev/MEDIA_Server&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;rsync&amp;quot; is a convient command for keeping files in sync, and as shown here will work&lt;br /&gt;
     through ssh.  The -L option tells rsync to treat symbolic links like ordinary files.&lt;br /&gt;
&lt;br /&gt;
        Also see [http://www.rsnapshot.org/]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 23:&lt;br /&gt;
&lt;br /&gt;
     Looking up the Spelling of a Word.&lt;br /&gt;
&lt;br /&gt;
        $ look &amp;lt;partial spelling&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     so the following will list all words that&lt;br /&gt;
     start with stuff&lt;br /&gt;
&lt;br /&gt;
        $ look stuff&lt;br /&gt;
           stuff&lt;br /&gt;
           stuffage&lt;br /&gt;
           stuffata&lt;br /&gt;
           stuffed&lt;br /&gt;
           stuffender&lt;br /&gt;
           stuffer&lt;br /&gt;
           stuffers&lt;br /&gt;
           stuffgownsman&lt;br /&gt;
           stuffier&lt;br /&gt;
           stuffiest&lt;br /&gt;
           stuffily&lt;br /&gt;
           stuffiness&lt;br /&gt;
           stuffinesses&lt;br /&gt;
           stuffiness's&lt;br /&gt;
           stuffing&lt;br /&gt;
           stuffings&lt;br /&gt;
           stuffing's&lt;br /&gt;
           stuffless&lt;br /&gt;
           stuffs&lt;br /&gt;
           stuffy&lt;br /&gt;
&lt;br /&gt;
     It helps to have a large &amp;quot;linuxwords&amp;quot; dictionary.  You can download&lt;br /&gt;
     a much bigger dictionary from the following:&lt;br /&gt;
&lt;br /&gt;
              http://prdownloads.sourceforge.net/souptonuts/linuxwords.1.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
     Note: vim users can setup the .vimrc file with the following. Now when you type &lt;br /&gt;
       CTL-X CTL-T in insert mode, you'll get a thesaurus lookup.&lt;br /&gt;
&lt;br /&gt;
           set dictionary+=/usr/share/dict/words&lt;br /&gt;
           set thesaurus+=/usr/share/dict/words&lt;br /&gt;
&lt;br /&gt;
     Or, you can call aspell with the F6 command after putting the folling entry in your&lt;br /&gt;
     .vimrc file&lt;br /&gt;
&lt;br /&gt;
           :nmap &amp;lt;F6&amp;gt; :w&amp;lt;CR&amp;gt;:!aspell -e -c %&amp;lt;CR&amp;gt;:e&amp;lt;CR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Now, hit F6 when you're in vim, and you'll get a spell checker.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     There is also an X Windows dictionary that runs with the following command.&lt;br /&gt;
&lt;br /&gt;
           $ gnome-dictionary&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 24:&lt;br /&gt;
&lt;br /&gt;
     Find out if a Command is Aliased.&lt;br /&gt;
&lt;br /&gt;
         $ type -all &amp;lt;command&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Example:&lt;br /&gt;
&lt;br /&gt;
         $ type -all ls&lt;br /&gt;
            ls is aliased to `ls --color=tty'&lt;br /&gt;
            ls is /bin/ls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 25:&lt;br /&gt;
&lt;br /&gt;
     Create a Terminal Calculator&lt;br /&gt;
&lt;br /&gt;
      Put the following in your .bashrc file&lt;br /&gt;
&lt;br /&gt;
            function calc&lt;br /&gt;
            {&lt;br /&gt;
             echo &amp;quot;${1}&amp;quot;|bc -l;&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
      Or, run it at the shell prompt. Now&lt;br /&gt;
      &amp;quot;calc&amp;quot; from the shell will work as follows:&lt;br /&gt;
&lt;br /&gt;
            $ calc 3+45&lt;br /&gt;
               48&lt;br /&gt;
&lt;br /&gt;
      All functions  with a &amp;quot;(&amp;quot; or &amp;quot;)&amp;quot; must be enclosed&lt;br /&gt;
      in quotes.  For instance, to get the sin of .4&lt;br /&gt;
&lt;br /&gt;
            $ calc &amp;quot;s(.4)&amp;quot;&lt;br /&gt;
              .38941834230865049166&lt;br /&gt;
&lt;br /&gt;
          (See TIP 115 using the expr command)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 26:&lt;br /&gt;
&lt;br /&gt;
     Kill a User and All Their Current Processes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        #  This program will kill all processes from a&lt;br /&gt;
        #  user.  The user name is read from the command line.&lt;br /&gt;
        #&lt;br /&gt;
        #  This program also demonstrates reading a bash variable&lt;br /&gt;
        #  into an awk script.&lt;br /&gt;
        #&lt;br /&gt;
        #  Usage: kill9user &amp;lt;user&amp;gt;&lt;br /&gt;
        #&lt;br /&gt;
        kill -9 `ps aux|awk -v var=$1 '$1==var { print $2 }'`&lt;br /&gt;
&lt;br /&gt;
    or if you want want to create the above script the command&lt;br /&gt;
    below will kill the user &amp;quot;donkey&amp;quot; and all of his processes.&lt;br /&gt;
&lt;br /&gt;
        $ kill -9 `ps aux|awk -v var=&amp;quot;donkey&amp;quot; '$1==var { print $2 }'`&lt;br /&gt;
&lt;br /&gt;
    Check their cron jobs and &amp;quot;at&amp;quot; jobs, if you have a security issue.&lt;br /&gt;
&lt;br /&gt;
          $ crontab -u &amp;lt;user&amp;gt; -e&lt;br /&gt;
&lt;br /&gt;
    Lock the account:&lt;br /&gt;
&lt;br /&gt;
          $ passwd -l &amp;lt;user&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Remove all authorized_keys&lt;br /&gt;
&lt;br /&gt;
          $ rm /home/user/.shosts&lt;br /&gt;
          $ rm /home/user/.rhosts&lt;br /&gt;
          $ rm -rf /home/user/.ssh&lt;br /&gt;
          $ rm /home/user/.forward&lt;br /&gt;
&lt;br /&gt;
      or consider&lt;br /&gt;
&lt;br /&gt;
          $ mv /home/user  /home/safeuser&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Change the shell&lt;br /&gt;
&lt;br /&gt;
          $ chsh -s /bin/true &amp;lt;user&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Do an inventory&lt;br /&gt;
&lt;br /&gt;
          $ find / -user &amp;lt;user&amp;gt;  &amp;gt; list_of_user_files&lt;br /&gt;
&lt;br /&gt;
    NOTE: Also see (TIP 10).&lt;br /&gt;
&lt;br /&gt;
    To see all users, except the current user. Do not use the&lt;br /&gt;
    dash &amp;quot;ps -aux&amp;quot; is wrong but the following is correct:&lt;br /&gt;
&lt;br /&gt;
          $ ps aux| awk '!/'${USER}'/{printf(&amp;quot;%s \n&amp;quot;,$0)}'&lt;br /&gt;
&lt;br /&gt;
     or (ww = wide, wide output)&lt;br /&gt;
&lt;br /&gt;
          $ ps auwwx| awk '!/'${USER}'/{printf(&amp;quot;%s \n&amp;quot;,$0)}'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    The following codes may be useful:&lt;br /&gt;
&lt;br /&gt;
       D    Uninterruptible sleep (usually IO)&lt;br /&gt;
       R    Running or runnable (on run queue)&lt;br /&gt;
       S    Interruptible sleep (waiting for an event to complete)&lt;br /&gt;
       T    Stopped, either by a job control signal or because it is being traced.&lt;br /&gt;
       W    paging (not valid since the 2.6.xx kernel)&lt;br /&gt;
       X    dead (should never be seen)&lt;br /&gt;
       Z    Defunct (&amp;quot;zombie&amp;quot;) process, terminated but not reaped by its parent.&lt;br /&gt;
&lt;br /&gt;
    For BSD formats and when the stat keyword is used, additional&lt;br /&gt;
       characters may be displayed:&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;    high-priority (not nice to other users)&lt;br /&gt;
       N    low-priority (nice to other users)&lt;br /&gt;
       L    has pages locked into memory (for real-time and custom IO)&lt;br /&gt;
       s    is a session leader&lt;br /&gt;
       l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)&lt;br /&gt;
       +    is in the foreground process group&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Also see TIP 28. and TIP 89.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 27:&lt;br /&gt;
&lt;br /&gt;
     Format Dates for Logs and Files&lt;br /&gt;
&lt;br /&gt;
         $ date &amp;quot;+%m%d%y %A,%B %d %Y %X&amp;quot;&lt;br /&gt;
             061704 Thursday,June 17 2004 07:13:40 PM&lt;br /&gt;
&lt;br /&gt;
         $ date &amp;quot;+%m%d%Y&amp;quot;&lt;br /&gt;
             06172004&lt;br /&gt;
&lt;br /&gt;
         $ date -d '1 day ago' &amp;quot;+%m%d%Y&amp;quot;&lt;br /&gt;
             06162004&lt;br /&gt;
&lt;br /&gt;
         $ date -d '3 months 1 day  2 hour  15 minutes 2 seconds ago'&lt;br /&gt;
&lt;br /&gt;
      or to go into the future remove the &amp;quot;ago&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         $ date -d '3 months 1 day  2 hour  15 minutes 2 seconds '&lt;br /&gt;
&lt;br /&gt;
            Also the following works:&lt;br /&gt;
&lt;br /&gt;
                $ date -d '+2 year +1 month -1 week  +3 day -8 hour +2 min -5 seconds'&lt;br /&gt;
&lt;br /&gt;
      Quick question: If there are 100,000,000 stars in the visible sky, and you can&lt;br /&gt;
      count them, round the clock, at a rate of a star per second starting now, when&lt;br /&gt;
      would you finish counting?  Would you still be alive?&lt;br /&gt;
&lt;br /&gt;
                $ date -d '+100000000 seconds'&lt;br /&gt;
&lt;br /&gt;
      Sooner than you think!&lt;br /&gt;
&lt;br /&gt;
      This can be assigned to variables&lt;br /&gt;
&lt;br /&gt;
         $ mdate=`date -d '3 months 1 day  2 hour  15 minutes 2 seconds ' &amp;quot;+%m%d%Y_%A_%B_%D_%Y_%X&amp;quot;  `&lt;br /&gt;
         $ echo $mdate&lt;br /&gt;
             09182004_Saturday_September_09/18/04_2004_09:40:41 PM&lt;br /&gt;
             ^---- Easy to sort   ^-------^----- Easy to read&lt;br /&gt;
&lt;br /&gt;
      See TIP 28 below.&lt;br /&gt;
&lt;br /&gt;
      See TIP 87 when working with large delta time changes -40 years, or -200 years ago, or even&lt;br /&gt;
      1,000,000 days into the future.&lt;br /&gt;
&lt;br /&gt;
      Also see (TIP 1) for working with time zones.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 28:&lt;br /&gt;
&lt;br /&gt;
     Need Ascii Codes? For instance, for printing quotes:&lt;br /&gt;
&lt;br /&gt;
                         awk 'BEGIN { msg = &amp;quot;Don\047t Panic!&amp;quot;; printf &amp;quot;%s \n&amp;quot;,msg }'&lt;br /&gt;
              or&lt;br /&gt;
                         awk 'BEGIN { msg = &amp;quot;Don\x027t Panic!&amp;quot;; printf &amp;quot;%s \n&amp;quot;,msg }'&lt;br /&gt;
&lt;br /&gt;
     It's better to use \047, because certain characters that follow \x027 may cause problems.&lt;br /&gt;
&lt;br /&gt;
     For example, take a look at the following two lines. The first line prints a &amp;quot;}&amp;quot; caused&lt;br /&gt;
     by the extra D in \x027D. The the line immediately below does not work as expected.&lt;br /&gt;
&lt;br /&gt;
                      awk 'BEGIN {printf(&amp;quot;The D causes problems \x027D\n&amp;quot;)}'&lt;br /&gt;
&lt;br /&gt;
            However, the line below works fine:&lt;br /&gt;
&lt;br /&gt;
                      awk 'BEGIN {printf(&amp;quot;The D does not cause problems \047D\n&amp;quot;)}'&lt;br /&gt;
&lt;br /&gt;
     Or if you wanted to use the date command in &amp;quot;awk&amp;quot; to print date.time.nanosecond.timezone for&lt;br /&gt;
     each line of a file &amp;quot;test&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     The following date can be used in awk because the single quotes are enclosed within the&lt;br /&gt;
     double quotes.&lt;br /&gt;
&lt;br /&gt;
             date '+%m%d%Y.%H%M%S.%N%z'&lt;br /&gt;
&lt;br /&gt;
       $ awk 'BEGIN { &amp;quot;date '+%m%d%Y.%H%M%S.%N%z'&amp;quot; | getline MyDate  } { print MyDate,$0 }' &amp;lt; data&lt;br /&gt;
&lt;br /&gt;
     But it's also possible to replace  &amp;quot;+&amp;quot;  with  \x2B,  &amp;quot;%&amp;quot; with \x25, and &amp;quot;d&amp;quot; with \x64 as follows:&lt;br /&gt;
&lt;br /&gt;
       $ awk 'BEGIN { &amp;quot;date \x27\x2B\x25m\x25\x64\x25Y.\x25H\x25M\x25S.\x25N\x25z\x27&amp;quot; | getline MyDate  } { print MyDate,$0 }' &amp;lt; test&lt;br /&gt;
&lt;br /&gt;
             07062004.113820.346033000-0400 bob 71&lt;br /&gt;
             07062004.113820.346033000-0400 tom 43&lt;br /&gt;
             07062004.113820.346033000-0400 sal 34&lt;br /&gt;
             07062004.113820.346033000-0400 bob 89&lt;br /&gt;
             07062004.113820.346033000-0400 tom 66&lt;br /&gt;
             07062004.113820.346033000-0400 sal 99&lt;br /&gt;
&lt;br /&gt;
     For this example it's not needed because single quotes are used inside of double quotes; however, there may be times when&lt;br /&gt;
     hex replacement is easier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ man ascii&lt;br /&gt;
&lt;br /&gt;
        Oct   Dec   Hex   Char           Oct   Dec   Hex   Char&lt;br /&gt;
            -----------------------------------------------------------&lt;br /&gt;
            000   0     00    NUL '\0'       100   64    40    @&lt;br /&gt;
            001   1     01    SOH            101   65    41    A&lt;br /&gt;
            002   2     02    STX            102   66    42    B&lt;br /&gt;
            003   3     03    ETX            103   67    43    C&lt;br /&gt;
            004   4     04    EOT            104   68    44    D&lt;br /&gt;
            005   5     05    ENQ            105   69    45    E&lt;br /&gt;
            006   6     06    ACK            106   70    46    F&lt;br /&gt;
            007   7     07    BEL '\a'       107   71    47    G&lt;br /&gt;
            010   8     08    BS  '\b'       110   72    48    H&lt;br /&gt;
            011   9     09    HT  '\t'       111   73    49    I&lt;br /&gt;
            012   10    0A    LF  '\n'       112   74    4A    J&lt;br /&gt;
            013   11    0B    VT  '\v'       113   75    4B    K&lt;br /&gt;
            014   12    0C    FF  '\f'       114   76    4C    L&lt;br /&gt;
            015   13    0D    CR  '\r'       115   77    4D    M&lt;br /&gt;
            016   14    0E    SO             116   78    4E    N&lt;br /&gt;
            017   15    0F    SI             117   79    4F    O&lt;br /&gt;
            020   16    10    DLE            120   80    50    P&lt;br /&gt;
            021   17    11    DC1            121   81    51    Q&lt;br /&gt;
            022   18    12    DC2            122   82    52    R&lt;br /&gt;
            023   19    13    DC3            123   83    53    S&lt;br /&gt;
            024   20    14    DC4            124   84    54    T&lt;br /&gt;
            025   21    15    NAK            125   85    55    U&lt;br /&gt;
            026   22    16    SYN            126   86    56    V&lt;br /&gt;
            027   23    17    ETB            127   87    57    W&lt;br /&gt;
            030   24    18    CAN            130   88    58    X&lt;br /&gt;
            031   25    19    EM             131   89    59    Y&lt;br /&gt;
            032   26    1A    SUB            132   90    5A    Z&lt;br /&gt;
            033   27    1B    ESC            133   91    5B    [&lt;br /&gt;
            034   28    1C    FS             134   92    5C    \   '\\'&lt;br /&gt;
            035   29    1D    GS             135   93    5D    ]&lt;br /&gt;
            036   30    1E    RS             136   94    5E    ^&lt;br /&gt;
            037   31    1F    US             137   95    5F    _&lt;br /&gt;
            040   32    20    SPACE          140   96    60    `&lt;br /&gt;
            041   33    21    !              141   97    61    a&lt;br /&gt;
            042   34    22    &amp;quot;              142   98    62    b&lt;br /&gt;
            043   35    23    #              143   99    63    c&lt;br /&gt;
            044   36    24    $              144   100   64    d&lt;br /&gt;
            045   37    25    %              145   101   65    e&lt;br /&gt;
            046   38    26    &amp;amp;              146   102   66    f&lt;br /&gt;
            047   39    27    '              147   103   67    g&lt;br /&gt;
            050   40    28    (              150   104   68    h&lt;br /&gt;
            051   41    29    )              151   105   69    i&lt;br /&gt;
            052   42    2A    *              152   106   6A    j&lt;br /&gt;
            053   43    2B    +              153   107   6B    k&lt;br /&gt;
            054   44    2C    ,              154   108   6C    l&lt;br /&gt;
            055   45    2D    -              155   109   6D    m&lt;br /&gt;
            056   46    2E    .              156   110   6E    n&lt;br /&gt;
            057   47    2F    /              157   111   6F    o&lt;br /&gt;
            060   48    30    0              160   112   70    p&lt;br /&gt;
            061   49    31    1              161   113   71    q&lt;br /&gt;
            062   50    32    2              162   114   72    r&lt;br /&gt;
            063   51    33    3              163   115   73    s&lt;br /&gt;
            064   52    34    4              164   116   74    t&lt;br /&gt;
            065   53    35    5              165   117   75    u&lt;br /&gt;
            066   54    36    6              166   118   76    v&lt;br /&gt;
            067   55    37    7              167   119   77    w&lt;br /&gt;
            070   56    38    8              170   120   78    x&lt;br /&gt;
            071   57    39    9              171   121   79    y&lt;br /&gt;
            072   58    3A    :              172   122   7A    z&lt;br /&gt;
            073   59    3B    ;              173   123   7B    {&lt;br /&gt;
            074   60    3C    &amp;lt;              174   124   7C    |&lt;br /&gt;
            075   61    3D    =              175   125   7D    }&lt;br /&gt;
            076   62    3E    &amp;gt;              176   126   7E    ~&lt;br /&gt;
            077   63    3F    ?              177   127   7F    DEL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 29:&lt;br /&gt;
&lt;br /&gt;
     Need a WWW Browser for the Terminal Session? Try lynx or elinks.&lt;br /&gt;
&lt;br /&gt;
         $ lynx&lt;br /&gt;
&lt;br /&gt;
     Or to read all these tips, with the latest updates&lt;br /&gt;
&lt;br /&gt;
      $ lynx http://umn.dl.sourceforge.net/sourceforge/souptonuts/How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Or, better yet elinks.&lt;br /&gt;
&lt;br /&gt;
         $ elinks http://somepage.&lt;br /&gt;
&lt;br /&gt;
     You can get elinks at the following site:&lt;br /&gt;
&lt;br /&gt;
             http://elinks.or.cz/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 30:&lt;br /&gt;
&lt;br /&gt;
    screen - screen manager with VT100/ANSI terminal emulation&lt;br /&gt;
&lt;br /&gt;
         This is an excellent utility. But if you work a lot in Emacs,&lt;br /&gt;
         then, you should place the following in your ~./.bashrc&lt;br /&gt;
&lt;br /&gt;
             alias s='screen -e^Pa -D -R'&lt;br /&gt;
&lt;br /&gt;
         After loging in again (or source .bashrc) ,&lt;br /&gt;
         type the following to load &amp;quot;screen&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
             $ s&lt;br /&gt;
&lt;br /&gt;
         If you're using the not using the alias command above, substitute&lt;br /&gt;
         CTL-a for CTL-p below. :&lt;br /&gt;
&lt;br /&gt;
             CTL-p CTL-C       To get a new session&lt;br /&gt;
             CTL-p  &amp;quot;           To list sessions, and arrow keys to move&lt;br /&gt;
             CTL-p SHFT-A      To name sessions&lt;br /&gt;
             CTL-p S            To split screens&lt;br /&gt;
             CLT-p Q            To unsplit screens&lt;br /&gt;
             CLT-p TAB          To switch between screens&lt;br /&gt;
             CLT-p :resize n    To resize screen to n rows, on split screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Screen is very powerful.  Should you become disconneced, you can&lt;br /&gt;
         still resume work after loggin in.&lt;br /&gt;
&lt;br /&gt;
             $ man screen&lt;br /&gt;
&lt;br /&gt;
         The above command will give you more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 31:&lt;br /&gt;
&lt;br /&gt;
     Need to Find the Factors of a Number?&lt;br /&gt;
&lt;br /&gt;
           $ factor 2345678992&lt;br /&gt;
                2345678992: 2 2 2 2 6581 22277&lt;br /&gt;
&lt;br /&gt;
     It's a quick way to find out if a number is prime&lt;br /&gt;
&lt;br /&gt;
           $ factor 7867&lt;br /&gt;
                7867: 7867&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 32:&lt;br /&gt;
&lt;br /&gt;
     Less is More -- piping to less to scroll backword and forward&lt;br /&gt;
&lt;br /&gt;
      For large &amp;quot;ls&amp;quot; listings try the followin, then, use the arrow key&lt;br /&gt;
      to move up and down the list.&lt;br /&gt;
&lt;br /&gt;
           $ ls /some_large_dir/ | less&lt;br /&gt;
&lt;br /&gt;
                 or&lt;br /&gt;
&lt;br /&gt;
           $ cat some_large_file | less&lt;br /&gt;
&lt;br /&gt;
                 or&lt;br /&gt;
&lt;br /&gt;
           $ less some_large_file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 33:&lt;br /&gt;
&lt;br /&gt;
     C &amp;quot;indent&amp;quot; Settings for Kernel Development&lt;br /&gt;
&lt;br /&gt;
           $ indent -kr -i8  program.c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 34:&lt;br /&gt;
&lt;br /&gt;
     FTP auto-login.  &amp;quot;ftp&amp;quot; to a site and have the password stored.&lt;br /&gt;
&lt;br /&gt;
     For instance, here's a sample &amp;quot;.net&amp;quot; file in a user's home&lt;br /&gt;
     directory for uploading to sourceforge. Note, sourceforge will&lt;br /&gt;
     take any password, so m@temp.com is used here for login &amp;quot;anonymous&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ cat ~/.netrc&lt;br /&gt;
               machine upload.sourceforge.net login anonymous password m@temp.com&lt;br /&gt;
               default login anonymous password user@site&lt;br /&gt;
&lt;br /&gt;
     It might be a good idea to change the rights on this file&lt;br /&gt;
&lt;br /&gt;
           $ chmod 0400 ~/.netrc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         #!/bin/bash&lt;br /&gt;
         #&lt;br /&gt;
         #  Sample ftp automated script to download&lt;br /&gt;
         #  file to ${dwnld}&lt;br /&gt;
         #&lt;br /&gt;
         dwnld=&amp;quot;/work/faq/unix-faq&amp;quot;&lt;br /&gt;
         cd ${dwnld}&lt;br /&gt;
         ftp &amp;lt;&amp;lt; FTPSTRING&lt;br /&gt;
         prompt off&lt;br /&gt;
         open rtfm.mit.edu&lt;br /&gt;
         cd /pub/usenet-by-group/news.answers/unix-faq/faq&lt;br /&gt;
         mget contents&lt;br /&gt;
         mget diff&lt;br /&gt;
         mget part*&lt;br /&gt;
         bye&lt;br /&gt;
         FTPSTRING&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      (Also see TIP 114 for ncftpget, which is a very powerful restarting&lt;br /&gt;
                            ftp program)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 35:&lt;br /&gt;
&lt;br /&gt;
     Bash Brace Expansion&lt;br /&gt;
&lt;br /&gt;
           $ echo f{ee,ie,oe,um}&lt;br /&gt;
                fee fie foe fum&lt;br /&gt;
&lt;br /&gt;
     This works with almost any command&lt;br /&gt;
&lt;br /&gt;
           $ mkdir -p /work/junk/{one,two,three,four}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 36:&lt;br /&gt;
&lt;br /&gt;
     Getting a List of Users on the System&lt;br /&gt;
&lt;br /&gt;
           $ cut -d: -f1 /etc/passwd | sort&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 37:&lt;br /&gt;
&lt;br /&gt;
     Editing a Bash Command&lt;br /&gt;
&lt;br /&gt;
      Try typing a long command say, then, type &amp;quot;fc&amp;quot; for an easy way&lt;br /&gt;
      to edit the command.&lt;br /&gt;
&lt;br /&gt;
           $ find /etc -iname '*.cnf' -exec grep -H 'log' {} \;&lt;br /&gt;
           $ fc&lt;br /&gt;
&lt;br /&gt;
      &amp;quot;fc&amp;quot; will bring the last command typed into an editor, &amp;quot;emacs&amp;quot; if&lt;br /&gt;
      that's the default editor. Type &amp;quot;fc -l&amp;quot; to list last few commands.&lt;br /&gt;
&lt;br /&gt;
      To seach for a command, try typing &amp;quot;CTL-r&amp;quot; at the shell prompt for&lt;br /&gt;
      searching. &amp;quot;CTL-t&amp;quot; to transpose, say &amp;quot;sl&amp;quot; was typed by you want &amp;quot;ls&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Hints when using &amp;quot;fc: in emacs:&lt;br /&gt;
&lt;br /&gt;
           ESC-b     move one word backward&lt;br /&gt;
           ESC-f     move one word forward&lt;br /&gt;
           ESC-DEL   kill one word backward&lt;br /&gt;
           CTL-k     kill point to end&lt;br /&gt;
           CTL-y     un-yank killed region at point&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 38:&lt;br /&gt;
&lt;br /&gt;
     Moving around Directories.&lt;br /&gt;
&lt;br /&gt;
     Change to the home directory:&lt;br /&gt;
          $ cd ~&lt;br /&gt;
            or&lt;br /&gt;
          $ cd&lt;br /&gt;
&lt;br /&gt;
     To go back to the last directory&lt;br /&gt;
          $ cd -&lt;br /&gt;
&lt;br /&gt;
     Instead of &amp;quot;cd&amp;quot; to a directory try &amp;quot;pushd&amp;quot; and look&lt;br /&gt;
     at the heading...you can see a list of directories.&lt;br /&gt;
&lt;br /&gt;
          $ pushd /etc&lt;br /&gt;
          $ pushd /usr/local&lt;br /&gt;
&lt;br /&gt;
      Then, to get back &amp;quot;popd&amp;quot; or &amp;quot;popd 1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      To list all the directories pushed on the stack&lt;br /&gt;
      use the &amp;quot;dirs -v&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
          $ dirs -v&lt;br /&gt;
           0  /usr/local&lt;br /&gt;
           1  /etc&lt;br /&gt;
           2  /work/souptonuts/documentation/theBook&lt;br /&gt;
&lt;br /&gt;
      Now, if you &amp;quot;pushd +1&amp;quot; you will be moved to &amp;quot;/etc&amp;quot;, since&lt;br /&gt;
      is number &amp;quot;1&amp;quot; on the stack, and this directory will become&lt;br /&gt;
      &amp;quot;0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ pwd&lt;br /&gt;
           /usr/local&lt;br /&gt;
          $ pushd +1&lt;br /&gt;
          $ pwd&lt;br /&gt;
           /etc&lt;br /&gt;
&lt;br /&gt;
          $ dirs -v&lt;br /&gt;
           0  /etc&lt;br /&gt;
           1  /work/souptonuts/documentation/theBook&lt;br /&gt;
           2  /usr/local&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 39:&lt;br /&gt;
&lt;br /&gt;
     Need an Underscore after a Variable?&lt;br /&gt;
&lt;br /&gt;
       Enclose the variable in &amp;quot;{}&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $echo ${UID}_&lt;br /&gt;
&lt;br /&gt;
       Compare to&lt;br /&gt;
&lt;br /&gt;
          $echo $UID_&lt;br /&gt;
&lt;br /&gt;
       Also try the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ m=&amp;quot;my stuff here&amp;quot;&lt;br /&gt;
                $ echo -e ${m// /'\n'}&lt;br /&gt;
                        my&lt;br /&gt;
                        stuff&lt;br /&gt;
                        here&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 40:&lt;br /&gt;
&lt;br /&gt;
     Bash Variable Offset and String Operators&lt;br /&gt;
&lt;br /&gt;
        $ r=&amp;quot;this is stuff&amp;quot;&lt;br /&gt;
        $ echo ${r:3}&lt;br /&gt;
        $ echo ${r:5:2}&lt;br /&gt;
&lt;br /&gt;
      Note, ${varname:offset:length}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         ${varname:?message}  If varname exist and isn't null return value, else,&lt;br /&gt;
                              print var and message.&lt;br /&gt;
&lt;br /&gt;
           $ r=&amp;quot;new stuff&amp;quot;&lt;br /&gt;
           $ echo ${r:? &amp;quot;that's r for you&amp;quot;}&lt;br /&gt;
               new stuff&lt;br /&gt;
           $ unset r&lt;br /&gt;
           $ echo ${r:? &amp;quot;that's r for you&amp;quot;}&lt;br /&gt;
               bash: r:  that's r for you&lt;br /&gt;
&lt;br /&gt;
         ${varname:+word}    If varname exist and not null return word. Else, return null.&lt;br /&gt;
&lt;br /&gt;
         ${varname:-word}    If varname exist and not null return value. Else, return word.&lt;br /&gt;
&lt;br /&gt;
      Working with arrays in bash - bash arrays.&lt;br /&gt;
&lt;br /&gt;
           $ unset p&lt;br /&gt;
           $ p=(one two three)&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[@]}&amp;quot;&lt;br /&gt;
           one two three&lt;br /&gt;
&lt;br /&gt;
      or&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[*]}&amp;quot;&lt;br /&gt;
           one two three&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${#p[@]}&amp;quot;&lt;br /&gt;
           3&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[0]}&amp;quot;&lt;br /&gt;
           one&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[1]}&amp;quot;&lt;br /&gt;
           two&lt;br /&gt;
&lt;br /&gt;
            Also see (TIP 95)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 41:&lt;br /&gt;
&lt;br /&gt;
     Loops in Bash&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The command below loops through directories listed in $PATH.&lt;br /&gt;
&lt;br /&gt;
          $ path=$PATH:&lt;br /&gt;
          $ while [ $path ]; do echo &amp;quot; ${path%%:*} &amp;quot;; path=${path#*:}; done&lt;br /&gt;
&lt;br /&gt;
       The command below will also loop through directories in your path.&lt;br /&gt;
&lt;br /&gt;
          $IFS=:&lt;br /&gt;
          $ for dir in $PATH&lt;br /&gt;
          &amp;gt; do&lt;br /&gt;
          &amp;gt; ls -ld $dir&lt;br /&gt;
          &amp;gt; done&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Jun 10 20:16 /usr/local/bin&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Jun 13 23:12 /bin&lt;br /&gt;
              drwxr-xr-x    3 root     root        40960 Jun 12 08:00 /usr/bin&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Feb 14 03:12 /usr/X11R6/bin&lt;br /&gt;
              drwxrwxr-x    2 chirico  chirico      4096 Jun  6 13:06 /home/chirico/bin&lt;br /&gt;
&lt;br /&gt;
     Other ways of doing loops:&lt;br /&gt;
&lt;br /&gt;
        for (( i=1; i &amp;lt;= 20; i++))&lt;br /&gt;
                do&lt;br /&gt;
                        echo -n &amp;quot;$i &amp;quot;&lt;br /&gt;
                done&lt;br /&gt;
&lt;br /&gt;
     Note, to do it all on one line, do the following:&lt;br /&gt;
&lt;br /&gt;
        $ for (( i=1; i &amp;lt;= 20; i++)); do echo -n &amp;quot;$i&amp;quot;; done&lt;br /&gt;
&lt;br /&gt;
     Below, is an example of declaring i an integer so that you do not&lt;br /&gt;
     have to preface with let.&lt;br /&gt;
&lt;br /&gt;
          $ declare -i i&lt;br /&gt;
          $ i=5;&lt;br /&gt;
          $ while (( $i &amp;gt; 1 )); do&lt;br /&gt;
          &amp;gt; i=i-1&lt;br /&gt;
          &amp;gt; echo $i&lt;br /&gt;
          &amp;gt; done&lt;br /&gt;
          4&lt;br /&gt;
          3&lt;br /&gt;
          2&lt;br /&gt;
&lt;br /&gt;
     You can also use &amp;quot;while [ $i -gt 1 ]; do&amp;quot;  in place of &amp;quot;while (( $i &amp;gt; 1 )); do&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     To get a listing of all declared values&lt;br /&gt;
&lt;br /&gt;
          $ declare -i&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Try putting a few words in the file &amp;quot;test&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         $ while read filename; do echo  &amp;quot;- $filename &amp;quot;; done &amp;lt; test |nl -w1&lt;br /&gt;
&lt;br /&gt;
     Or, using an array&lt;br /&gt;
&lt;br /&gt;
                declare -a Array&lt;br /&gt;
                Array[0]=&amp;quot;zero&amp;quot;&lt;br /&gt;
                Array[1]=&amp;quot;one&amp;quot;&lt;br /&gt;
                Array[2]=&amp;quot;two&amp;quot;&lt;br /&gt;
                for i in `seq ${#Array[@]}`&lt;br /&gt;
                do&lt;br /&gt;
                  echo $Array[$i-1]&lt;br /&gt;
                done&lt;br /&gt;
&lt;br /&gt;
         Also see (TIP 95 and TIP 133).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 42:&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;diff&amp;quot; and &amp;quot;patch&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
        You have created a program &amp;quot;prog.c&amp;quot;, saved as this name and also copied&lt;br /&gt;
        to  &amp;quot;prog.c.old&amp;quot;. You post &amp;quot;prog.c&amp;quot; to users.  Next, you make changes&lt;br /&gt;
        to prog.c&lt;br /&gt;
&lt;br /&gt;
          $ diff -c prog.c.old prog.c &amp;gt; prog.patch&lt;br /&gt;
&lt;br /&gt;
        Now, users can get the latest updates by running.&lt;br /&gt;
&lt;br /&gt;
          $ patch &amp;lt; prog.patch&lt;br /&gt;
&lt;br /&gt;
        By the way, you can make backups of your data easily.&lt;br /&gt;
&lt;br /&gt;
          $ cp /etc/fstab{,.bak}&lt;br /&gt;
&lt;br /&gt;
        Now, you do your edits to &amp;quot;/etc/fstab&amp;quot; and if you need&lt;br /&gt;
        to go back to the original, you can find it at&lt;br /&gt;
        &amp;quot;/etc/fstab.bak&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 43:&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;cat&amp;quot; the Contents of Files Listed in a File, in That Order.&lt;br /&gt;
&lt;br /&gt;
       SETUP (Assume you have the following)&lt;br /&gt;
&lt;br /&gt;
              $ cat file_of_files&lt;br /&gt;
                  file1&lt;br /&gt;
                  file2&lt;br /&gt;
&lt;br /&gt;
              $ cat file1&lt;br /&gt;
                  This is the data in file1&lt;br /&gt;
&lt;br /&gt;
              $ cat file 2&lt;br /&gt;
                  This is the data in file2&lt;br /&gt;
&lt;br /&gt;
       So there are 3 files here &amp;quot;file_of_files&amp;quot; which contains the name of&lt;br /&gt;
       other files.  In this case &amp;quot;file1&amp;quot; and &amp;quot;file2&amp;quot;. And the contents of&lt;br /&gt;
       &amp;quot;file1&amp;quot; and &amp;quot;file2&amp;quot; is shown above.&lt;br /&gt;
&lt;br /&gt;
               $ cat file_of_files|xargs cat&lt;br /&gt;
                    This is the data in  file1&lt;br /&gt;
                    This is the data in  file2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 44:&lt;br /&gt;
&lt;br /&gt;
     Columns and Rows -- getting anything you want.&lt;br /&gt;
&lt;br /&gt;
     Assume you have the following file.&lt;br /&gt;
&lt;br /&gt;
        $ cat data&lt;br /&gt;
           1 2 3&lt;br /&gt;
           4 5&lt;br /&gt;
           6 7 8 9 10&lt;br /&gt;
           11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
     How to you get everything in  2 columns?&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l2&lt;br /&gt;
           1 2&lt;br /&gt;
           3 4&lt;br /&gt;
           5 6&lt;br /&gt;
           7 8&lt;br /&gt;
           9 10&lt;br /&gt;
           11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
    Three columns?&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l3&lt;br /&gt;
           1 2 3&lt;br /&gt;
           4 5 6&lt;br /&gt;
           7 8 9&lt;br /&gt;
           10 11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
    What's the row sum of the &amp;quot;three columns?&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
           6&lt;br /&gt;
           15&lt;br /&gt;
           24&lt;br /&gt;
           33&lt;br /&gt;
           27&lt;br /&gt;
&lt;br /&gt;
    or&lt;br /&gt;
&lt;br /&gt;
        $ tr ' ' '\n' &amp;lt; data |xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
&lt;br /&gt;
    NOTE &amp;quot;Steven Heiner's rule&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
             cat one_file | program&lt;br /&gt;
&lt;br /&gt;
           can always be rewritten as&lt;br /&gt;
&lt;br /&gt;
             program &amp;lt; one_file&lt;br /&gt;
&lt;br /&gt;
   Note: thanks to Steven Heiner (http://www.shelldorado.com/) the above can be&lt;br /&gt;
       shortened as follows:&lt;br /&gt;
&lt;br /&gt;
               $ tr ' ' '\n' &amp;lt; data|xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
&lt;br /&gt;
          Need to &amp;quot;tr&amp;quot; from the stdin?&lt;br /&gt;
&lt;br /&gt;
               $ tr &amp;quot;xy&amp;quot; &amp;quot;yx&amp;quot;| ... | ...&lt;br /&gt;
&lt;br /&gt;
       But there is a the &amp;quot;Stephane CHAZELAS&amp;quot; condition here&lt;br /&gt;
&lt;br /&gt;
         &amp;quot;Note that tr, sed, and awk mail fail on files containing '\0'&lt;br /&gt;
          sed and awk have unspecified behaviors if the input&lt;br /&gt;
          doesn't end in a '\n' (or to sum up, cat works for&lt;br /&gt;
          binary and text files, text utilities such as sed or awk&lt;br /&gt;
          work only for text files).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 45:&lt;br /&gt;
&lt;br /&gt;
     Auto Directory Spelling Corrections.&lt;br /&gt;
&lt;br /&gt;
      To turn this on:&lt;br /&gt;
&lt;br /&gt;
           $ shopt -s cdspell&lt;br /&gt;
&lt;br /&gt;
      Now mispell a directory in the cd command.&lt;br /&gt;
&lt;br /&gt;
           $ cd /usk/local&lt;br /&gt;
                   ^-------- still gets you to --&lt;br /&gt;
                                                |&lt;br /&gt;
                                            /usr/local&lt;br /&gt;
&lt;br /&gt;
      What other options can you set? The following will list&lt;br /&gt;
      all the options:&lt;br /&gt;
&lt;br /&gt;
           $ shopt -p&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 46:&lt;br /&gt;
&lt;br /&gt;
     Record Eveything Printed on Your Terminal Screen.&lt;br /&gt;
&lt;br /&gt;
            $ script -a &amp;lt;filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Now start doing stuff and &amp;quot;everything&amp;quot; is appended to &amp;lt;filename&amp;gt;.&lt;br /&gt;
     For example&lt;br /&gt;
&lt;br /&gt;
            $ script installation&lt;br /&gt;
&lt;br /&gt;
            $ (command)&lt;br /&gt;
&lt;br /&gt;
            $ (result)&lt;br /&gt;
&lt;br /&gt;
            $ ...&lt;br /&gt;
&lt;br /&gt;
            $ ...&lt;br /&gt;
&lt;br /&gt;
            $ (command)&lt;br /&gt;
&lt;br /&gt;
            $ (result)&lt;br /&gt;
&lt;br /&gt;
            $ exit&lt;br /&gt;
&lt;br /&gt;
     The whole session log is in the installation file that you can later&lt;br /&gt;
     read and/or cleanup and add to a documentation.&lt;br /&gt;
&lt;br /&gt;
     This command can also be used to redirect the contents to another user,&lt;br /&gt;
     but you must be root to do this.&lt;br /&gt;
&lt;br /&gt;
     Step 1 - find out what pts they are using.&lt;br /&gt;
&lt;br /&gt;
            $ w&lt;br /&gt;
&lt;br /&gt;
     Step 2 - Run script on that pts. After running this command below&lt;br /&gt;
              everything you type will appear on their screen.&lt;br /&gt;
&lt;br /&gt;
            $ script /dev/pts/4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Thanks to Jacques.GARNIER-EXTERIEUR@EU.RHODIA.COM for his contribution&lt;br /&gt;
     to this tip.&lt;br /&gt;
&lt;br /&gt;
     Also reference TIP 208.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 47:&lt;br /&gt;
&lt;br /&gt;
     Monitor all Network Traffic Except Your Current ssh Connection.&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX -s 1500 port not 22&lt;br /&gt;
&lt;br /&gt;
       Or to filter out port 123 as well getting the full length of the packet&lt;br /&gt;
       (-s 0), use the following:&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX -s 0 port not 22  and port not 123&lt;br /&gt;
&lt;br /&gt;
       Or to filter only a certain host say 81.169.158.205&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX  port not 22 and host 81.169.158.205&lt;br /&gt;
&lt;br /&gt;
     Just want ip addresses and a little bit of data, then,&lt;br /&gt;
     use this. The &amp;quot;-c 20&amp;quot; is to stop after 20 packets.&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN  -s 1500 port not 22 -c 20&lt;br /&gt;
&lt;br /&gt;
     If you're looking for sign of DOS attacks, the following show just the SYN&lt;br /&gt;
     packets on all interfaces:&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump 'tcp[13] &amp;amp; 2 == 2'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 48:&lt;br /&gt;
&lt;br /&gt;
     Where are the GNU Reference Manuals?&lt;br /&gt;
&lt;br /&gt;
           http://www.gnu.org/manual/manual.html&lt;br /&gt;
&lt;br /&gt;
     Also worth a look the &amp;quot;Linux Documentation Project&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           http://en.tldp.org/&lt;br /&gt;
&lt;br /&gt;
     and Red Hat manuals&lt;br /&gt;
&lt;br /&gt;
           http://www.redhat.com/docs/manuals/enterprise/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 49:&lt;br /&gt;
&lt;br /&gt;
     Setting or Changing the Library Path.&lt;br /&gt;
&lt;br /&gt;
     The following contains the settings to be added or deleted&lt;br /&gt;
&lt;br /&gt;
           /etc/ld.so.conf&lt;br /&gt;
&lt;br /&gt;
     After this file is edited, you must run the following:&lt;br /&gt;
&lt;br /&gt;
           $ ldconfig&lt;br /&gt;
&lt;br /&gt;
     See &amp;quot;man ldconfig&amp;quot; for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 50:&lt;br /&gt;
&lt;br /&gt;
     Working with Libraries in C&lt;br /&gt;
&lt;br /&gt;
     Assume the following 3 programs:&lt;br /&gt;
&lt;br /&gt;
      $ cat ./src/test.c&lt;br /&gt;
&lt;br /&gt;
         int test(int t)&lt;br /&gt;
         {&lt;br /&gt;
           printf(&amp;quot;%d\n&amp;quot;,t);&lt;br /&gt;
           return t;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      $ cat ./src/prog1.c&lt;br /&gt;
&lt;br /&gt;
         /*&lt;br /&gt;
          program: prog1.c&lt;br /&gt;
          dependences: test.c&lt;br /&gt;
&lt;br /&gt;
          compiling this program:&lt;br /&gt;
          gcc -o prog test.c prog1.c&lt;br /&gt;
&lt;br /&gt;
          Note the libpersonal include&lt;br /&gt;
          should be remove if NOT using the&lt;br /&gt;
          library&lt;br /&gt;
         */&lt;br /&gt;
&lt;br /&gt;
         #include &amp;lt;libpersonal.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         int&lt;br /&gt;
         main(int argc, char **argv)&lt;br /&gt;
         {&lt;br /&gt;
           test(45);&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
      $ cat ./include/libpersonal.h&lt;br /&gt;
&lt;br /&gt;
         extern int test(int);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Prog1.c needs the test function in  test.c&lt;br /&gt;
     To compile, so that both programs work together, do the following:&lt;br /&gt;
&lt;br /&gt;
          $ cd src&lt;br /&gt;
          $ gcc -o prog test.c prog1.c -I../include&lt;br /&gt;
&lt;br /&gt;
     However, if you want to create your own static library, then, run the following:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p ../lib&lt;br /&gt;
          $ gcc -c test.c  -o ../lib/test.o&lt;br /&gt;
          $ cd ../lib&lt;br /&gt;
          $ ar r libpersonal.a test.o&lt;br /&gt;
          $ ranlib libpersonal.a&lt;br /&gt;
&lt;br /&gt;
     or, the ar and ranlib command can be combined as follows:&lt;br /&gt;
&lt;br /&gt;
          $ ar rs libpersonal.a test.o&lt;br /&gt;
&lt;br /&gt;
     To compile the program with the static library:&lt;br /&gt;
&lt;br /&gt;
          $ cd ../src&lt;br /&gt;
          $ gcc -I../include -L../lib -o prog1 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     The -I../include  tells  gcc to look in the ../include directory for&lt;br /&gt;
     libpersonal.h. and -L../lib, tells gcc to look for the&lt;br /&gt;
     &amp;quot;libpersonal.a&amp;quot; library.&lt;br /&gt;
&lt;br /&gt;
           $ cd ..&lt;br /&gt;
           $ tree src lib include&lt;br /&gt;
           src&lt;br /&gt;
           |-- prog&lt;br /&gt;
           |-- prog1&lt;br /&gt;
           |-- prog1.c&lt;br /&gt;
           `-- test.c&lt;br /&gt;
           lib&lt;br /&gt;
           |-- libpersonal.a&lt;br /&gt;
           `-- test.o&lt;br /&gt;
           include&lt;br /&gt;
           `-- libpersonal.h&lt;br /&gt;
&lt;br /&gt;
     This was a STATIC library. Often times you will want to use a SHARED&lt;br /&gt;
     or dynamic library.&lt;br /&gt;
&lt;br /&gt;
     SHARED LIBRARY:&lt;br /&gt;
&lt;br /&gt;
     You must recompile test.c with -fpic option.&lt;br /&gt;
&lt;br /&gt;
          $ cd ../lib&lt;br /&gt;
          $ gcc -c -fpic ../src/test.c -o test.o&lt;br /&gt;
&lt;br /&gt;
     Next create the libpersonal.so file.&lt;br /&gt;
&lt;br /&gt;
          $ gcc -shared -o libpersonal.so test.o&lt;br /&gt;
&lt;br /&gt;
     Now, compile the source prog1.c as follows:&lt;br /&gt;
&lt;br /&gt;
          $ cd ../src&lt;br /&gt;
          $ gcc -Wl,-R../lib -L../lib -I../include -o prog2 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
     This should work fine. But, take a look at prog2 using the ldd command.&lt;br /&gt;
&lt;br /&gt;
          $ ldd prog2&lt;br /&gt;
&lt;br /&gt;
        libpersonal.so =&amp;gt; ../lib/libpersonal.so (0x40017000)&lt;br /&gt;
        libc.so.6 =&amp;gt; /lib/tls/libc.so.6 (0x42000000)&lt;br /&gt;
        /lib/ld-linux.so.2 =&amp;gt; /lib/ld-linux.so.2 (0x40000000)&lt;br /&gt;
&lt;br /&gt;
     If you move the program prog2 to a different location, it will not run.&lt;br /&gt;
     Instead you will get the following error:&lt;br /&gt;
&lt;br /&gt;
           prog2: error while loading shared libraries: libpersonal.so:&lt;br /&gt;
                     cannot open shared object file: No such file or directory&lt;br /&gt;
&lt;br /&gt;
     To fix this, you should specify the direct path to the library. And in my&lt;br /&gt;
     case it is rather long&lt;br /&gt;
&lt;br /&gt;
      $  gcc -Wl,-R/work/souptonuts/documentation/theBook/lib -L../lib -I../include -o prog2 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE: The -R must always follow the -Wl.  (-Wl,-R&amp;lt;directory&amp;gt;) They always go together&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 51:&lt;br /&gt;
&lt;br /&gt;
     Actively Monitor a File and Send Email when Expression Occurs.&lt;br /&gt;
&lt;br /&gt;
     This is a way to monitor &amp;quot;/var/log/messages&amp;quot; or any file for certain changes.&lt;br /&gt;
     The example below actively monitors &amp;quot;stuff&amp;quot; for the work &amp;quot;now&amp;quot; and as soon as&lt;br /&gt;
     &amp;quot;now&amp;quot; is added to the file, the contents of msg are sent to the user&lt;br /&gt;
     mikechirico@hotmail.com&lt;br /&gt;
&lt;br /&gt;
          $ tail -f stuff | \&lt;br /&gt;
              awk ' /now/ { system(&amp;quot;mail -s \&amp;quot;This is working\&amp;quot;  mikechirico@hotmail.com &amp;lt; msg&amp;quot;) }'&lt;br /&gt;
&lt;br /&gt;
     Or, you can run a program, say get headings on slashdot from the program &amp;quot;getslash.php&amp;quot; which&lt;br /&gt;
     runs on  &amp;quot;192.168.1.155&amp;quot; with account &amp;quot;chirico&amp;quot;. Assuming you have ssh keys setup, then, the following&lt;br /&gt;
     will send mail from the output:&lt;br /&gt;
&lt;br /&gt;
          $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;|mail -s &amp;quot;Slash cron Headlines&amp;quot;  mchirico@comcast.net&lt;br /&gt;
&lt;br /&gt;
     See (TIP 80) for scraping the headings on slash dot and how to get a copy of &amp;quot;getslash.php&amp;quot;.  If you still&lt;br /&gt;
     want to use awk:&lt;br /&gt;
&lt;br /&gt;
           $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;| \&lt;br /&gt;
                      awk '{ print $0 | &amp;quot;mail -s \x27 Slash Topics \x27 mchirico@comcast.net &amp;quot;}'&lt;br /&gt;
&lt;br /&gt;
     Note the &amp;quot;\x27&amp;quot; is a quote.  Maybe you only want articles dealing with &amp;quot;Linux&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
           $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;| \&lt;br /&gt;
                      awk '/Linux/{ print $0 | &amp;quot;mail -s \x27 Slash Topics \x27 mchirico@comcast.net &amp;quot;}'&lt;br /&gt;
&lt;br /&gt;
     For $60, you can get a numeric display from &amp;quot;delcom engineering&amp;quot; that you can send messages and&lt;br /&gt;
     data to.  I get weather information off the internet and send it to this device.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/projects/delcom/&lt;br /&gt;
&lt;br /&gt;
     (Reference TIP 151 for ssh tips)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 52:&lt;br /&gt;
&lt;br /&gt;
     Need to Keep Secrets? Encrypt it.&lt;br /&gt;
&lt;br /&gt;
      To Encrypt:&lt;br /&gt;
&lt;br /&gt;
            $ openssl des3 -salt -in file.txt -out file.des3&lt;br /&gt;
&lt;br /&gt;
      The above will prompt for a password, or you can put it in&lt;br /&gt;
      with a -k option, assuming you're on a trusted server.&lt;br /&gt;
&lt;br /&gt;
      To Decrypt&lt;br /&gt;
&lt;br /&gt;
            $  openssl des3 -d -salt -in file.des3 -out file.txt -k mypassword&lt;br /&gt;
&lt;br /&gt;
      Need to encrypt what you type? Enter the following, then start typing&lt;br /&gt;
      and  ^D to end.&lt;br /&gt;
&lt;br /&gt;
            $ openssl des3 -salt -out stuff.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 53:&lt;br /&gt;
&lt;br /&gt;
     Check that a File has Not Been Tampered With: Use Cryptographic Hashing Function.&lt;br /&gt;
&lt;br /&gt;
     The md5sum is popular but dated&lt;br /&gt;
&lt;br /&gt;
              $ md5sum file&lt;br /&gt;
&lt;br /&gt;
     Instead, use one of the following;&lt;br /&gt;
&lt;br /&gt;
              $ openssl dgst -sha1 -c file&lt;br /&gt;
&lt;br /&gt;
              $ openssl dgst -ripemd160 -c  file&lt;br /&gt;
&lt;br /&gt;
     All calls give a fixed length string or &amp;quot;message digest&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 54:&lt;br /&gt;
&lt;br /&gt;
     Need to View Information About a Secure Web Server? A SSL/TLS test.&lt;br /&gt;
&lt;br /&gt;
           $ openssl s_client -connect www.sourceforge.net:443&lt;br /&gt;
&lt;br /&gt;
     Above will give a long listing of certificates.&lt;br /&gt;
&lt;br /&gt;
     Note, it is also possible to get certificate information about a mail server&lt;br /&gt;
&lt;br /&gt;
           $ openssl s_client -connect mail.comcast.net:995 -showcerts&lt;br /&gt;
&lt;br /&gt;
     When you do the above command you get two certificates. If you copy&lt;br /&gt;
     past both certificates by taking the following contents include the&lt;br /&gt;
     begin and end show below:&lt;br /&gt;
&lt;br /&gt;
                 -----BEGIN CERTIFICATE-----&lt;br /&gt;
                 ....&lt;br /&gt;
                 -----END CERTIFICATE-----&lt;br /&gt;
&lt;br /&gt;
     Then create files &amp;quot;comcast0.pem&amp;quot; and &amp;quot;comcast1.pem&amp;quot; out of these certificaties and&lt;br /&gt;
     put them in a directory &amp;quot;/home/donkey/.certs&amp;quot;, then, with the openssl src package, in&lt;br /&gt;
     the &amp;quot;./tools/c_rehash&amp;quot; run&lt;br /&gt;
&lt;br /&gt;
            $ c_rehash .certs&lt;br /&gt;
            Doing .certs&lt;br /&gt;
            comcast0.pem =&amp;gt; 72f90dc0.0&lt;br /&gt;
            comcast1.pem =&amp;gt; f73e89fd.0&lt;br /&gt;
&lt;br /&gt;
     Now it's possible to have fetchmail work with these certs.&lt;br /&gt;
&lt;br /&gt;
       #&lt;br /&gt;
       #&lt;br /&gt;
       # Sample .fetchmailrc file for Comcast&lt;br /&gt;
       #&lt;br /&gt;
       # Check mail every 90 seconds&lt;br /&gt;
       set daemon 90&lt;br /&gt;
       set syslog&lt;br /&gt;
       set postmaster donkey&lt;br /&gt;
       #set bouncemail&lt;br /&gt;
       #&lt;br /&gt;
       # Comcast email is zdonkey but computer account is  just donkey&lt;br /&gt;
       #&lt;br /&gt;
       poll mail.comcast.net with proto POP3 and options no dns&lt;br /&gt;
              user 'zdonkey' with pass &amp;quot;somethin35&amp;quot;  is 'donkey' here options ssl sslcertck sslcertpath '/home/donkey/.certs'&lt;br /&gt;
              smtphost comcast.net&lt;br /&gt;
       # currently not used&lt;br /&gt;
       mda '/usr/bin/procmail -d %T'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     REFERENCE: http://www.openssl.org/&lt;br /&gt;
                http://www.catb.org/~esr/fetchmail/fetchmail-6.2.5.tar.gz&lt;br /&gt;
                http://www.madboa.com/geek/openssl/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 55:&lt;br /&gt;
&lt;br /&gt;
     cp --parents. What does this option do?&lt;br /&gt;
&lt;br /&gt;
     Assume you have the following directory structure&lt;br /&gt;
&lt;br /&gt;
            .&lt;br /&gt;
            |-- a&lt;br /&gt;
            |   `-- b&lt;br /&gt;
            |       `-- c&lt;br /&gt;
            |           `-- d&lt;br /&gt;
            |               |-- file1&lt;br /&gt;
            |               `-- file2&lt;br /&gt;
            `-- newdir&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Issue the following command:&lt;br /&gt;
&lt;br /&gt;
         $ cp --parents ./a/b/c/d/* ./newdir/&lt;br /&gt;
&lt;br /&gt;
     Now you have the following:&lt;br /&gt;
&lt;br /&gt;
            .&lt;br /&gt;
            |-- a&lt;br /&gt;
            |   `-- b&lt;br /&gt;
            |       `-- c&lt;br /&gt;
            |           `-- d&lt;br /&gt;
            |               |-- file1&lt;br /&gt;
            |               `-- file2&lt;br /&gt;
            `-- newdir&lt;br /&gt;
                `-- a&lt;br /&gt;
                    `-- b&lt;br /&gt;
                        `-- c&lt;br /&gt;
                            `-- d&lt;br /&gt;
                                |-- file1&lt;br /&gt;
                                `-- file2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 56:&lt;br /&gt;
&lt;br /&gt;
     Quickly Locating files.&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;locate&amp;quot; command quickly searches the indexed database for files.  It just&lt;br /&gt;
     gives the name of the files; but, if you need more information use it as follows&lt;br /&gt;
&lt;br /&gt;
         $ locate document|xargs ls -l&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;locate&amp;quot; database may only get updated every 24 hours.  For more recent finds,&lt;br /&gt;
     use the &amp;quot;find&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 57:&lt;br /&gt;
&lt;br /&gt;
     Using the &amp;quot;find&amp;quot; Command.&lt;br /&gt;
&lt;br /&gt;
     List only directories, max 2 nodes down that have &amp;quot;net&amp;quot; in the name&lt;br /&gt;
&lt;br /&gt;
       $ find /proc -type d -maxdepth 2 -iname '*net*'&lt;br /&gt;
&lt;br /&gt;
     Find all *.c and *.h files starting from the current &amp;quot;.&amp;quot; position.&lt;br /&gt;
&lt;br /&gt;
       $ find . \( -iname '*.c'  -o -iname '*.h' \) -print&lt;br /&gt;
&lt;br /&gt;
     Find all, but skip what's in &amp;quot;/CVS&amp;quot; and &amp;quot;/junk&amp;quot;. Start from &amp;quot;/work&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ find /work \( -iregex '.*/CVS'  -o -iregex '.*/junk' \)  -prune -o -print&lt;br /&gt;
&lt;br /&gt;
     Note -regex and -iregex work on the directory as well, which means&lt;br /&gt;
     you must consider the &amp;quot;./&amp;quot; that comes before all listings.&lt;br /&gt;
&lt;br /&gt;
     Here is another example. Find all files except what is under the CVS, including&lt;br /&gt;
     CVS listings. Also exclude &amp;quot;#&amp;quot; and &amp;quot;~&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       $ find . -regex '.*' ! \( -regex '.*CVS.*'  -o -regex '.*[#|~].*' \)&lt;br /&gt;
&lt;br /&gt;
     Find a *.c file, then run grep on it looking for &amp;quot;stdio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       $ find . -iname '*.c' -exec grep -H 'stdio.h' {} \;&lt;br /&gt;
         sample output --&amp;gt;  ./prog1.c:#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
                            ./test.c:#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Looking for the disk-hog on the whole system?&lt;br /&gt;
&lt;br /&gt;
       $ find /  -size +10000k 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
     Looking for files changed in the last 24 hours? Make sure you add the&lt;br /&gt;
     minus sign &amp;quot;-1&amp;quot;, otherwise, you will only find files changed exactly&lt;br /&gt;
     24 hours from now. With the &amp;quot;-1&amp;quot; you get files changed from now to 24&lt;br /&gt;
     hours.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ find  . -ctime -1  -printf &amp;quot;%a %f\n&amp;quot;&lt;br /&gt;
       Wed Oct  6 12:51:56 2004 .&lt;br /&gt;
       Wed Oct  6 12:35:16 2004 How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
     Or if you just want files.&lt;br /&gt;
&lt;br /&gt;
       $ find . -type f -ctime -1  -printf &amp;quot;%a %f\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Details on file status change in the last 48 hours, current directory. Also note &amp;quot;-atime -2&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
       $ find . -ctime -2 -type f -exec ls -l {} \;&lt;br /&gt;
&lt;br /&gt;
             NOTE: if you don't use -type f, you make get &amp;quot;.&amp;quot; returned, which&lt;br /&gt;
             when run through ls &amp;quot;ls .&amp;quot; may list more than what you want.&lt;br /&gt;
&lt;br /&gt;
             Also you may only want the current directory&lt;br /&gt;
&lt;br /&gt;
       $ find . -ctime -2 -type f -maxdepth 1 -exec ls -l {} \;&lt;br /&gt;
&lt;br /&gt;
     To find files modified within the last 5 to 10 minutes&lt;br /&gt;
&lt;br /&gt;
       $ find . -mmin +5 -mmin -10 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     For more example &amp;quot;find&amp;quot; commands, reference the following looking&lt;br /&gt;
     for the latest version of &amp;quot;bashscripts.x.x.x.tar.gz&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79320&amp;amp;package_id=80711&lt;br /&gt;
&lt;br /&gt;
     See &amp;quot;TIP 71&amp;quot; for examples of find using the inode feature. &amp;quot; $ find . -inum &amp;lt;inode&amp;gt; -exec rm -- '{}' \; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     If you don't want error messages, or need to redirect error messages &amp;quot;&amp;gt; /dev/null 2&amp;gt;&amp;amp;1&amp;quot;, or see&lt;br /&gt;
     &amp;quot;TIP 81&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 58:&lt;br /&gt;
&lt;br /&gt;
     Using the &amp;quot;rm&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
     How do you remove a file that has the name &amp;quot;-&amp;quot;.  For instance, if you run the command&lt;br /&gt;
     &amp;quot;$ cat &amp;gt; - &amp;quot; and type some text followed by ^d, how does the &amp;quot;-&amp;quot; file get deleted?&lt;br /&gt;
&lt;br /&gt;
        $ rm -- -&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;--&amp;quot; nullifies any rm options.&lt;br /&gt;
&lt;br /&gt;
     How do you delete the directory &amp;quot;one&amp;quot;, all it's sub-directories, and any data?&lt;br /&gt;
&lt;br /&gt;
        $ rm -rf ./one&lt;br /&gt;
&lt;br /&gt;
     Note, to selectively delete stuff on a directory, use the find command &amp;quot;TIP 57&amp;quot;.&lt;br /&gt;
     To delete by inode, see &amp;quot;TIP 71&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 59:&lt;br /&gt;
&lt;br /&gt;
     Giving ownership.&lt;br /&gt;
&lt;br /&gt;
     How do you give the user &amp;quot;donkey&amp;quot; ownership to all directories and files under&lt;br /&gt;
     &amp;quot;./fordonkey&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          $ chown -R donkey ./fordonkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 60:&lt;br /&gt;
&lt;br /&gt;
     Only Permit root login -- give others a message when they try to login.&lt;br /&gt;
&lt;br /&gt;
     Create the file &amp;quot;/etc/nologin&amp;quot; with &amp;quot;nologin&amp;quot; containing the contents&lt;br /&gt;
     of the message.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 61:&lt;br /&gt;
&lt;br /&gt;
     Limits: file size, open files, pipe size, stack size, max memory size&lt;br /&gt;
             cpu time, plus others.&lt;br /&gt;
&lt;br /&gt;
     To get a listing of current limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -a&lt;br /&gt;
             core file size        (blocks, -c) 0&lt;br /&gt;
             data seg size         (kbytes, -d) unlimited&lt;br /&gt;
             file size             (blocks, -f) unlimited&lt;br /&gt;
             max locked memory     (kbytes, -l) unlimited&lt;br /&gt;
             max memory size       (kbytes, -m) unlimited&lt;br /&gt;
             open files                    (-n) 1024&lt;br /&gt;
             pipe size          (512 bytes, -p) 8&lt;br /&gt;
             stack size            (kbytes, -s) 8192&lt;br /&gt;
             cpu time             (seconds, -t) unlimited&lt;br /&gt;
             max user processes            (-u) 8179&lt;br /&gt;
             virtual memory        (kbytes, -v) unlimited&lt;br /&gt;
&lt;br /&gt;
     Note as a user you can decrease your limits in the current&lt;br /&gt;
     shell session; but, you cannot increase.  This can be ideal&lt;br /&gt;
     for testing programs.  But, first you may want to create&lt;br /&gt;
     another shell &amp;quot;sh&amp;quot; so that you can &amp;quot;go back to where started&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -f 10&lt;br /&gt;
&lt;br /&gt;
     Now try&lt;br /&gt;
&lt;br /&gt;
          $ yes &amp;gt;&amp;gt; out&lt;br /&gt;
             File size limit exceeded&lt;br /&gt;
&lt;br /&gt;
     To set limits on users, make changes to &amp;quot;/etc/security/limits.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           bozo   - maxlogins 1&lt;br /&gt;
&lt;br /&gt;
     Will keep bozo from loging in more than once.&lt;br /&gt;
&lt;br /&gt;
     To list hard limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -Ha&lt;br /&gt;
&lt;br /&gt;
     To list soft limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -Sa&lt;br /&gt;
&lt;br /&gt;
     To restrict user access by time, day make changes to&lt;br /&gt;
             &amp;quot;/etc/security/time.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Also take a look at &amp;quot;/etc/profile&amp;quot; to see what other changes&lt;br /&gt;
     can be made, plus take a look under &amp;quot;/etc/security/*.conf&amp;quot; for&lt;br /&gt;
     other configuration files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 62:&lt;br /&gt;
&lt;br /&gt;
     Stupid &amp;quot;cat&amp;quot; Tricks.&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 43).&lt;br /&gt;
&lt;br /&gt;
     If you have multiple blank lines, squeeze these lines down to one,&lt;br /&gt;
     then, try the following:&lt;br /&gt;
&lt;br /&gt;
          $ cat -s &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to number the lines?&lt;br /&gt;
&lt;br /&gt;
          $ cat -n &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to show tabs?&lt;br /&gt;
&lt;br /&gt;
          $ cat -t &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Need to mark end of lines by &amp;quot;$&amp;quot;? The following was suggested by  (Amos Shapira)&lt;br /&gt;
&lt;br /&gt;
          $ cat -e &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to see all the ctl characters?&lt;br /&gt;
&lt;br /&gt;
          /* ctlgen.c&lt;br /&gt;
            Program to generate ctl characters.&lt;br /&gt;
&lt;br /&gt;
            Compile:&lt;br /&gt;
&lt;br /&gt;
               gcc -o ctlgen ctlgen.c&lt;br /&gt;
&lt;br /&gt;
            Run:&lt;br /&gt;
&lt;br /&gt;
               ./ctlgen &amp;gt; mout&lt;br /&gt;
&lt;br /&gt;
            Now see the characters:&lt;br /&gt;
&lt;br /&gt;
               cat -v mout&lt;br /&gt;
&lt;br /&gt;
            Here's a sample output:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               $ cat -v mout|tail&lt;br /&gt;
                   test M-v&lt;br /&gt;
                   test M-w&lt;br /&gt;
                   test M-x&lt;br /&gt;
                   test M-y&lt;br /&gt;
                   test M-z&lt;br /&gt;
                   test M-{&lt;br /&gt;
                   test M-|&lt;br /&gt;
                   test M-}&lt;br /&gt;
                   test M-~&lt;br /&gt;
                   test M-^?&lt;br /&gt;
&lt;br /&gt;
          */&lt;br /&gt;
          #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
          #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
          int main()&lt;br /&gt;
          {&lt;br /&gt;
            int i;&lt;br /&gt;
&lt;br /&gt;
            for(i=0; i &amp;lt; 256; ++i)&lt;br /&gt;
              printf(&amp;quot;test %c \n&amp;quot;,i);&lt;br /&gt;
&lt;br /&gt;
            return 0;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 63:&lt;br /&gt;
&lt;br /&gt;
     Guard against SYN attacks and &amp;quot;ping&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     As root do the following:&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/tcp_syncookies&lt;br /&gt;
&lt;br /&gt;
     Want to disable &amp;quot;ping&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_all&lt;br /&gt;
&lt;br /&gt;
     Disable broadcast/multicast &amp;quot;ping&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts&lt;br /&gt;
&lt;br /&gt;
     And to enable again:&lt;br /&gt;
&lt;br /&gt;
          echo 0 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_all&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 64:&lt;br /&gt;
&lt;br /&gt;
     Make changes to .bash_profile and need to update the current session?&lt;br /&gt;
&lt;br /&gt;
       $ source .bash_profile&lt;br /&gt;
&lt;br /&gt;
     With the above command, the user does not have to logout.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 65:&lt;br /&gt;
&lt;br /&gt;
     What are the Special Shell Variables?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        $#   The number of arguments.&lt;br /&gt;
        $@   All arguments, as separate words.&lt;br /&gt;
        $*   All arguments, as one word.&lt;br /&gt;
        $$   ID of the current process.&lt;br /&gt;
        $?   Exit status of the last command.&lt;br /&gt;
        $0,$1,..$9,${10},${11}...${N}    Positional parameters. After &amp;quot;9&amp;quot; you must use the ${k} syntax.&lt;br /&gt;
&lt;br /&gt;
     Note that 0 is true. For example if you execute the following, which is true you get zero.&lt;br /&gt;
&lt;br /&gt;
         $  [[ -f /etc/passwd ]]&lt;br /&gt;
         $  echo $?&lt;br /&gt;
         0&lt;br /&gt;
     And the following is false, which returns a 1.&lt;br /&gt;
&lt;br /&gt;
         $  [[ -f /etc/passwdjabberwisnohere ]]&lt;br /&gt;
         $  echo $?&lt;br /&gt;
         1&lt;br /&gt;
&lt;br /&gt;
     So true=0 and false=1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Sample program &amp;quot;mdo&amp;quot;  to show the difference between &amp;quot;$@&amp;quot; and &amp;quot;$*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        function myarg&lt;br /&gt;
        {&lt;br /&gt;
            echo &amp;quot;$# in myarg function&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
        echo -e &amp;quot;$# parameters on the cmd line\n&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;calling: myarg \&amp;quot;\$@\&amp;quot; and myarg \&amp;quot;\$*\&amp;quot;\n&amp;quot;&lt;br /&gt;
        myarg &amp;quot;$@&amp;quot;&lt;br /&gt;
        myarg &amp;quot;$*&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;\ncalling: myarg \$@ and myarg \$* without quotes\n&amp;quot;&lt;br /&gt;
        myarg $@&lt;br /&gt;
        myarg $*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The result of running &amp;quot;./mdo one two&amp;quot;. Note that when quoted, myarg &amp;quot;$*&amp;quot;,&lt;br /&gt;
      returns 1 ... all parameters are smushed together as one word.&lt;br /&gt;
&lt;br /&gt;
            [chirico@third-fl-71 theBook]$ ./mdo one two&lt;br /&gt;
            2 parameters on the cmd line&lt;br /&gt;
&lt;br /&gt;
            calling: myarg &amp;quot;$@&amp;quot; and myarg &amp;quot;$*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
            1 in myarg function&lt;br /&gt;
&lt;br /&gt;
            calling: myarg $@ and myarg $* without quotes&lt;br /&gt;
&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
&lt;br /&gt;
      Example program &amp;quot;mdo2&amp;quot; shows how the input separator can be changed.&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        IFS=|&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=,&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=\;&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=$1&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            [chirico@third-fl-71 theBook]$ ./mdo2 one two three four five&lt;br /&gt;
            one two three four five&lt;br /&gt;
&lt;br /&gt;
            one,two,three,four,five&lt;br /&gt;
&lt;br /&gt;
            one;two;three;four;five&lt;br /&gt;
&lt;br /&gt;
            oneotwoothreeofourofive&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 66:&lt;br /&gt;
&lt;br /&gt;
     Replace all &amp;quot;x&amp;quot; with &amp;quot;y&amp;quot; and all &amp;quot;y&amp;quot; with &amp;quot;x&amp;quot; in file data.&lt;br /&gt;
&lt;br /&gt;
        $ cata data&lt;br /&gt;
          x y&lt;br /&gt;
          y x&lt;br /&gt;
&lt;br /&gt;
        $ tr &amp;quot;xy&amp;quot;  &amp;quot;yx&amp;quot; &amp;lt; data&lt;br /&gt;
          y x&lt;br /&gt;
          x y&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 67:&lt;br /&gt;
&lt;br /&gt;
     On a Linux 2.6.x Kernel, how do you directly measure disk activity,&lt;br /&gt;
     and where is this information documented?&lt;br /&gt;
&lt;br /&gt;
          o The information is documented in the kernel source&lt;br /&gt;
               ./Documentation/iostats.txt&lt;br /&gt;
&lt;br /&gt;
          o The new way of getting this info in 2.6.x is&lt;br /&gt;
              $ cat /sys/block/hda/stat&lt;br /&gt;
            151121 5694 1932358 796675 37867 76770 916994 8353762 0 800672 9150437&lt;br /&gt;
&lt;br /&gt;
             Field  1 -- # of reads issued&lt;br /&gt;
                 This is the total number of reads completed successfully.&lt;br /&gt;
             Field  2 -- # of reads merged, field 6 -- # of writes merged&lt;br /&gt;
                 Reads and writes which are adjacent to each other may be merged for&lt;br /&gt;
                 efficiency.  Thus two 4K reads may become one 8K read before it is&lt;br /&gt;
                 ultimately handed to the disk, and so it will be counted (and queued)&lt;br /&gt;
                 as only one I/O.  This field lets you know how often this was done.&lt;br /&gt;
             Field  3 -- # of sectors read&lt;br /&gt;
                 This is the total number of sectors read successfully.&lt;br /&gt;
             Field  4 -- # of milliseconds spent reading&lt;br /&gt;
                 This is the total number of milliseconds spent by all reads (as&lt;br /&gt;
                 measured from __make_request() to end_that_request_last()).&lt;br /&gt;
             Field  5 -- # of writes completed&lt;br /&gt;
                 This is the total number of writes completed successfully.&lt;br /&gt;
             Field  7 -- # of sectors written&lt;br /&gt;
                 This is the total number of sectors written successfully.&lt;br /&gt;
             Field  8 -- # of milliseconds spent writing&lt;br /&gt;
                 This is the total number of milliseconds spent by all writes (as&lt;br /&gt;
                 measured from __make_request() to end_that_request_last()).&lt;br /&gt;
             Field  9 -- # of I/Os currently in progress&lt;br /&gt;
                 The only field that should go to zero. Incremented as requests are&lt;br /&gt;
                 given to appropriate request_queue_t and decremented as they finish.&lt;br /&gt;
             Field 10 -- # of milliseconds spent doing I/Os&lt;br /&gt;
                 This field is increases so long as field 9 is nonzero.&lt;br /&gt;
             Field 11 -- weighted # of milliseconds spent doing I/Os&lt;br /&gt;
                 This field is incremented at each I/O start, I/O completion, I/O&lt;br /&gt;
                 merge, or read of these stats by the number of I/Os in progress&lt;br /&gt;
                 (field 9) times the number of milliseconds spent doing I/O since the&lt;br /&gt;
                 last update of this field.  This can provide an easy measure of both&lt;br /&gt;
                 I/O completion time and the backlog that may be accumulating.&lt;br /&gt;
&lt;br /&gt;
       Note, this is device specific.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 68:&lt;br /&gt;
&lt;br /&gt;
     Passing Outbound Mail, plus Masquerading User and Hostname.&lt;br /&gt;
&lt;br /&gt;
     Here's a specific example:&lt;br /&gt;
&lt;br /&gt;
         How does one send and receive Comcast email from a home Linux box,&lt;br /&gt;
         which uses Comcast as the ISP, if the local account on the Linux&lt;br /&gt;
         box is different from the Comcast email.  For instance, the&lt;br /&gt;
         account on the Linux box is &amp;quot;chirico@third-fl-71&amp;quot; and the Comcast&lt;br /&gt;
         email account is &amp;quot;mchirico@comcast.net&amp;quot;.  Note both the hostname and&lt;br /&gt;
         username are different.&lt;br /&gt;
&lt;br /&gt;
         So, the user &amp;quot;chirico&amp;quot; using &amp;quot;mutt&amp;quot;, &amp;quot;elm&amp;quot; or any email program would&lt;br /&gt;
         like to send out email to say &amp;quot;donkey@comcast.net&amp;quot;; yet, donkey would&lt;br /&gt;
         see the email from &amp;quot;mchirico@comcast.net&amp;quot; and not &amp;quot;chirico@third-fl-71&amp;quot;&lt;br /&gt;
         but chirico@third-fl-71 would get the replies.&lt;br /&gt;
&lt;br /&gt;
         For a full description of how to solve this problem, including related&lt;br /&gt;
         &amp;quot;sendmail.mc&amp;quot;, &amp;quot;site.config.m4&amp;quot;, &amp;quot;genericstable&amp;quot;, &amp;quot;genericsdomain&amp;quot;,&lt;br /&gt;
         &amp;quot;.procmailrc&amp;quot;, and &amp;quot;.forward&amp;quot; files,  reference the following:&lt;br /&gt;
&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/README_COMCAST_EMAIL.txt?download&lt;br /&gt;
&lt;br /&gt;
         Included in the above link are instructions for building sendmail with&lt;br /&gt;
         &amp;quot;SASL&amp;quot; and &amp;quot;STARTTLS&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 69:&lt;br /&gt;
&lt;br /&gt;
     How do you remove just the last 2 lines from a file and save the result?&lt;br /&gt;
&lt;br /&gt;
         $ sed  '$d' file | sed '$d' &amp;gt; savefile&lt;br /&gt;
&lt;br /&gt;
     Or, as Amos Shapira pointed out, it's much easier with the head command.&lt;br /&gt;
&lt;br /&gt;
         $ head -2 file&lt;br /&gt;
&lt;br /&gt;
      And, of course, removing just the last line&lt;br /&gt;
&lt;br /&gt;
         $ sed '$d' file &amp;gt; savefile&lt;br /&gt;
&lt;br /&gt;
         (See REFERENCES (13))&lt;br /&gt;
&lt;br /&gt;
     How do you remove extra spaces at the end of a line?&lt;br /&gt;
&lt;br /&gt;
         $ sed 's/[ ]*$//g'&lt;br /&gt;
&lt;br /&gt;
     How do you remove blank lines, or lines with just spaces and tabs,&lt;br /&gt;
     saving the origional file as file.backup?&lt;br /&gt;
&lt;br /&gt;
         $ perl -pi.backup -e &amp;quot;s/^(\s)*\n//&amp;quot;  file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 70:&lt;br /&gt;
&lt;br /&gt;
     Generating Random Numbers.&lt;br /&gt;
&lt;br /&gt;
         $ od -vAn -N4 -tu4 &amp;lt; /dev/urandom&lt;br /&gt;
             3905158199&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 71:&lt;br /&gt;
&lt;br /&gt;
     Deleting a File by it's Inode Value.&lt;br /&gt;
&lt;br /&gt;
       See (PROGRAMMING TIP 5) for creating the file, or&lt;br /&gt;
&lt;br /&gt;
       $ cat &amp;gt; '\n\n\n\n\n\n\n'&lt;br /&gt;
         type some text&lt;br /&gt;
         ^D&lt;br /&gt;
&lt;br /&gt;
     To list the inode and display the characters.&lt;br /&gt;
&lt;br /&gt;
       $ ls -libt *&lt;br /&gt;
&lt;br /&gt;
     To remove by inode. Note the &amp;quot;--&amp;quot; option.  This&lt;br /&gt;
     will keep any special characters in the file from being&lt;br /&gt;
     interpreted at &amp;quot;rm&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
       $ find . -inum &amp;lt;inode&amp;gt; -exec rm -- '{}' \;&lt;br /&gt;
&lt;br /&gt;
     Or to check contents&lt;br /&gt;
&lt;br /&gt;
       $ find . -inum &amp;lt;inode&amp;gt; -exec cat '{}' \;&lt;br /&gt;
&lt;br /&gt;
     Reference:&lt;br /&gt;
         http://www.faqs.org/ftp/usenet/news.answers/unix-faq/faq/part2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 72:&lt;br /&gt;
&lt;br /&gt;
     Sending Attachments Using Mutt -- On the Command Line.&lt;br /&gt;
&lt;br /&gt;
        $ mutt -s &amp;quot;See Attachment&amp;quot; -a file.doc user@domain.net &amp;lt; message.txt&lt;br /&gt;
&lt;br /&gt;
          or just the message:&lt;br /&gt;
&lt;br /&gt;
        $ echo | mutt -a sample.tar.gz user@domain.net&lt;br /&gt;
&lt;br /&gt;
      Reference:&lt;br /&gt;
          http://www.shelldorado.com/articles/mailattachments.html&lt;br /&gt;
&lt;br /&gt;
        Also see (TIP 51).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 73:&lt;br /&gt;
&lt;br /&gt;
     Want to find out what functions a program calls?&lt;br /&gt;
&lt;br /&gt;
         $ strace &amp;lt;program&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Try this with &amp;quot;topen.c&amp;quot; (see PROGRAMMING TIP 5)&lt;br /&gt;
&lt;br /&gt;
         $ strace  ./topen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 74:&lt;br /&gt;
&lt;br /&gt;
     RPM Usage Summary.&lt;br /&gt;
&lt;br /&gt;
     Install. Full filename is needed.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -ivh Fedora/RPMS/postgresql-libs-7.4.2-1.i386.rpm&lt;br /&gt;
&lt;br /&gt;
     To view list of files installed with a particular package.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -ql postgresql-libs&lt;br /&gt;
                /usr/lib/libecpg.so.4&lt;br /&gt;
                /usr/lib/libecpg.so.4.1&lt;br /&gt;
                /usr/lib/libecpg_compat.so.1&lt;br /&gt;
                /usr/lib/libecpg_compat.so.1.1&lt;br /&gt;
                /usr/lib/libpgtypes.so.1&lt;br /&gt;
                ...&lt;br /&gt;
&lt;br /&gt;
     Or, to get the file listing from a package that is not installed use the&lt;br /&gt;
     &amp;quot;-p&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -pql /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/CHANGES&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/LICENSE&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/README&lt;br /&gt;
               /usr/share/man/man3/pcap.3.gz&lt;br /&gt;
&lt;br /&gt;
     For dependencies listing, use the &amp;quot;R&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qpR /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /sbin/ldconfig&lt;br /&gt;
               /sbin/ldconfig&lt;br /&gt;
               kernel &amp;gt;= 2.2.0&lt;br /&gt;
               libc.so.6&lt;br /&gt;
               libc.so.6(GLIBC_2.0)&lt;br /&gt;
               libc.so.6(GLIBC_2.1)&lt;br /&gt;
               libc.so.6(GLIBC_2.1.3)&lt;br /&gt;
               libc.so.6(GLIBC_2.3)&lt;br /&gt;
               openssl&lt;br /&gt;
               rpmlib(CompressedFileNames) &amp;lt;= 3.0.4-1&lt;br /&gt;
               rpmlib(PayloadFilesHavePrefix) &amp;lt;= 4.0-1&lt;br /&gt;
&lt;br /&gt;
     To check the integrity, use the &amp;quot;-K&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -K /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm: (sha1) dsa sha1 md5 gpg OK&lt;br /&gt;
&lt;br /&gt;
     To list all packages installed.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qa&lt;br /&gt;
&lt;br /&gt;
     To find out which file a package belongs to.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qf /usr/lib/libecpg.so.4.1&lt;br /&gt;
&lt;br /&gt;
     To uninstall a package&lt;br /&gt;
&lt;br /&gt;
         $ rpm -e&lt;br /&gt;
&lt;br /&gt;
     For building rpm packages reference the following:&lt;br /&gt;
       http://www-106.ibm.com/developerworks/library/l-rpm1/&lt;br /&gt;
&lt;br /&gt;
     To verify md5 sum so that you know it downloaded ok&lt;br /&gt;
&lt;br /&gt;
         $ rpm -K  *.rpm&lt;br /&gt;
&lt;br /&gt;
     The following is a good reference:&lt;br /&gt;
        http://www.rpm.org/max-rpm/s1-rpm-install-additional-options.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 75:&lt;br /&gt;
&lt;br /&gt;
     Listing Output from a Bash Script.&lt;br /&gt;
&lt;br /&gt;
     Add &amp;quot;set -x&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          #!/bin/bash&lt;br /&gt;
          set -x&lt;br /&gt;
          ls&lt;br /&gt;
          date&lt;br /&gt;
&lt;br /&gt;
     Will list the files and output as follows:&lt;br /&gt;
&lt;br /&gt;
           + ls&lt;br /&gt;
           ChangeLog  CVS  data  test&lt;br /&gt;
           + date&lt;br /&gt;
           Thu Jul  1 20:41:04 EDT 2004&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 76:&lt;br /&gt;
&lt;br /&gt;
     Using wget.&lt;br /&gt;
&lt;br /&gt;
     Grap a webpage and pipe it to less. For example suppose you wanted to pipe the&lt;br /&gt;
     contents of all these tips, directly from the web.&lt;br /&gt;
&lt;br /&gt;
      $ wget -O - http://sourceforge.net/direct-dl/mchirico/souptonuts/How_to_Linux_and_Open_Source.txt|less&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 77:&lt;br /&gt;
&lt;br /&gt;
     Finding IP address and MAC address.&lt;br /&gt;
&lt;br /&gt;
       $ /sbin/ifconfig&lt;br /&gt;
&lt;br /&gt;
     Note the following output &amp;quot;eth0&amp;quot; and &amp;quot;eth0:1&amp;quot; which means&lt;br /&gt;
     two IP addresses are tied to 1 NIC (Network Interface Card).&lt;br /&gt;
&lt;br /&gt;
             eth0      Link encap:Ethernet  HWaddr 00:50:DA:60:5B:AD&lt;br /&gt;
                       inet addr:192.168.1.155  Bcast:192.168.99.255  Mask:255.255.252.0&lt;br /&gt;
                       UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
                       RX packets:982757 errors:116 dropped:0 overruns:0 frame:116&lt;br /&gt;
                       TX packets:439297 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:1000&lt;br /&gt;
                       RX bytes:693529078 (661.4 Mb)  TX bytes:78400296 (74.7 Mb)&lt;br /&gt;
                       Interrupt:10 Base address:0xa800&lt;br /&gt;
&lt;br /&gt;
             eth0:1    Link encap:Ethernet  HWaddr 00:50:DA:60:5B:AD&lt;br /&gt;
                       inet addr:192.168.1.182  Bcast:192.168.3.255  Mask:255.255.252.0&lt;br /&gt;
                       UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
                       RX packets:982757 errors:116 dropped:0 overruns:0 frame:116&lt;br /&gt;
                       TX packets:439299 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:1000&lt;br /&gt;
                       RX bytes:693529078 (661.4 Mb)  TX bytes:78400636 (74.7 Mb)&lt;br /&gt;
                       Interrupt:10 Base address:0xa800&lt;br /&gt;
&lt;br /&gt;
             lo        Link encap:Local Loopback&lt;br /&gt;
                       inet addr:127.0.0.1  Mask:255.0.0.0&lt;br /&gt;
                       UP LOOPBACK RUNNING  MTU:16436  Metric:1&lt;br /&gt;
                       RX packets:785 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
                       TX packets:785 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:0&lt;br /&gt;
                       RX bytes:2372833 (2.2 Mb)  TX bytes:2372833 (2.2 Mb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 78:&lt;br /&gt;
&lt;br /&gt;
     DOS to UNIX and UNIX to DOS.&lt;br /&gt;
&lt;br /&gt;
        $ dos2unix file.txt&lt;br /&gt;
&lt;br /&gt;
     And to go the other way from UNIX to DOS&lt;br /&gt;
&lt;br /&gt;
        $ unix2dos unixfile&lt;br /&gt;
&lt;br /&gt;
     See the man page, since there are MAC options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     NOTE: If you're working file DOS files, you'll probably want to use&lt;br /&gt;
           &amp;quot;zip&amp;quot; instead of &amp;quot;gzip&amp;quot; so users on Windows can unzip them.&lt;br /&gt;
&lt;br /&gt;
              $ zip test.zip test.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 79:&lt;br /&gt;
&lt;br /&gt;
     Need to Run Interactive Commands? Try &amp;quot;expect&amp;quot;.&lt;br /&gt;
       http://expect.nist.gov/expect.tar.gz&lt;br /&gt;
&lt;br /&gt;
     This simple example waits for the input &amp;quot;hi&amp;quot;, in some form before&lt;br /&gt;
     returning, immediately, &amp;quot;hello there!&amp;quot;. Otherwise, it will wait for&lt;br /&gt;
     60 seconds, then, return &amp;quot;hello there!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/expect&lt;br /&gt;
          set timeout 60&lt;br /&gt;
          expect &amp;quot;hi\n&amp;quot;&lt;br /&gt;
          send &amp;quot;hello there!\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference:&lt;br /&gt;
        http://www.oreilly.com/catalog/expect/chapter/ch03.html&lt;br /&gt;
&lt;br /&gt;
        http://www.cotse.com/dlf/man/expect/bulletproof1.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 80:&lt;br /&gt;
&lt;br /&gt;
     Using PHP as a Command Line Scripting Language.&lt;br /&gt;
&lt;br /&gt;
     The following will grab the complete file from slashdot.&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/php -q&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;?php&lt;br /&gt;
         $fileName = &amp;quot;http://slashdot.org/slashdot.xml&amp;quot;;&lt;br /&gt;
         $rss = file($fileName) or die (&amp;quot;Cannot open file $fileName\n&amp;quot;);&lt;br /&gt;
         for ($index=0; $index &amp;lt; count($rss); $index++)&lt;br /&gt;
              {&lt;br /&gt;
              echo $rss[$index];&lt;br /&gt;
              }&lt;br /&gt;
         ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       Note, if you want an example that parses the XML of&lt;br /&gt;
       slashdot, then, download the following:&lt;br /&gt;
&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/php_scripts.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 81:&lt;br /&gt;
&lt;br /&gt;
     Discarding all output -- including stderr messages.&lt;br /&gt;
&lt;br /&gt;
         $ ls  &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     Or sending all output to a file&lt;br /&gt;
&lt;br /&gt;
         $ someprog &amp;gt; /tmp/file 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     Sometimes, find displays a lot of errors when searching through&lt;br /&gt;
     directories that the user doesn't have access to. To discard&lt;br /&gt;
     error messages &amp;quot;stderr&amp;quot;, which is normally file descripter &amp;quot;2&amp;quot;&lt;br /&gt;
     work the following:&lt;br /&gt;
&lt;br /&gt;
         $ find / -iname 'stuff' 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
          or to pipe results elsewhere&lt;br /&gt;
&lt;br /&gt;
         $ find / -iname 'stuff' &amp;gt; /tmp/results_of_find  2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 118).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 82:&lt;br /&gt;
&lt;br /&gt;
     Using MIX.  D. Knuth's  assembly language/machine-code instruction set used in&lt;br /&gt;
     his books to illustrate his algorithms.&lt;br /&gt;
&lt;br /&gt;
     Download the source:&lt;br /&gt;
&lt;br /&gt;
       http://sourceforge.net/project/showfiles.php?group_id=13897&lt;br /&gt;
&lt;br /&gt;
       $ ./configure&lt;br /&gt;
       $ make&lt;br /&gt;
       $ make install&lt;br /&gt;
&lt;br /&gt;
     Documentation can be found at the following link. The link on&lt;br /&gt;
     sourceforge is not correct, but, the one below works.&lt;br /&gt;
&lt;br /&gt;
       http://www.gnu.org/software/mdk/manual/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 83:&lt;br /&gt;
&lt;br /&gt;
     Gnuplot [ http://sourceforge.net/projects/gnuplot/ ].&lt;br /&gt;
&lt;br /&gt;
     This software is ideal for printing graphs.&lt;br /&gt;
&lt;br /&gt;
         gnuplot&amp;gt; set term png&lt;br /&gt;
         gnuplot&amp;gt; set output 'testcos.png'&lt;br /&gt;
         gnuplot&amp;gt; plot cos(x)*sin(x)&lt;br /&gt;
         gnuplot&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
     Or the following command can be put into &amp;quot;file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            $ cat &amp;gt; file&lt;br /&gt;
            set term png&lt;br /&gt;
            set output 'testcos.png'&lt;br /&gt;
            plot cos(x)*sin(x)&lt;br /&gt;
            exit&lt;br /&gt;
            ^D&lt;br /&gt;
&lt;br /&gt;
     Then, run as follows:&lt;br /&gt;
&lt;br /&gt;
            $ gnuplot file&lt;br /&gt;
&lt;br /&gt;
     Or, suppose you have the following file &amp;quot;/home/chirico/data&amp;quot;. Comments&lt;br /&gt;
     with &amp;quot;#&amp;quot; are not read by gnuplot.&lt;br /&gt;
&lt;br /&gt;
            # File /home/chirico/data&lt;br /&gt;
            #&lt;br /&gt;
            2005-07-26  1    2.3    3&lt;br /&gt;
            2005-07-27  2    3.4    5&lt;br /&gt;
            2005-07-28  3    4    6.6&lt;br /&gt;
            2005-07-29  4    6    2.5&lt;br /&gt;
&lt;br /&gt;
     And you have the following new &amp;quot;file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            set term png&lt;br /&gt;
            set xdata time&lt;br /&gt;
            set timefmt &amp;quot;%Y-%m-%d &amp;quot;&lt;br /&gt;
            set format x &amp;quot;%Y/%m/%d&amp;quot;&lt;br /&gt;
            set output '/var/www/html/chirico/gnuplot/data.png'&lt;br /&gt;
            plot '/home/chirico/data' using 1:2 w linespoints  title '1st col', \&lt;br /&gt;
             '/home/chirico/data' using 1:3 w linespoints  title '2nd col', \&lt;br /&gt;
             '/home/chirico/data' using 1:4 w linespoints  title '3rd col'&lt;br /&gt;
            exit&lt;br /&gt;
&lt;br /&gt;
     You can now get a graph of this data running the following:&lt;br /&gt;
&lt;br /&gt;
            $ gnuplot file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 84:&lt;br /&gt;
&lt;br /&gt;
     CPU Information - speed, processor, cache.&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/cpuinfo&lt;br /&gt;
&lt;br /&gt;
               processor       : 0&lt;br /&gt;
               vendor_id       : GenuineIntel&lt;br /&gt;
               cpu family      : 15&lt;br /&gt;
               model           : 2&lt;br /&gt;
               model name      : Intel(R) Pentium(R) 4 CPU 2.20GHz&lt;br /&gt;
               stepping        : 9&lt;br /&gt;
               cpu MHz         : 2193.221&lt;br /&gt;
               cache size      : 512 KB&lt;br /&gt;
               fdiv_bug        : no&lt;br /&gt;
               hlt_bug         : no&lt;br /&gt;
               f00f_bug        : no&lt;br /&gt;
               coma_bug        : no&lt;br /&gt;
               fpu             : yes&lt;br /&gt;
               fpu_exception   : yes&lt;br /&gt;
               cpuid level     : 2&lt;br /&gt;
               wp              : yes&lt;br /&gt;
               flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr&lt;br /&gt;
               bogomips        : 4325.37&lt;br /&gt;
&lt;br /&gt;
      &amp;quot;bogomips&amp;quot; is a rough but good way to quickly compare two computer speeds. True it's a&lt;br /&gt;
      bogus reading; but, a &amp;quot;good enough&amp;quot; for government work calculation.  See (TIP 10) for&lt;br /&gt;
      &amp;quot;vmstat&amp;quot; and &amp;quot;iostat&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 85:&lt;br /&gt;
&lt;br /&gt;
     POVRAY - Making Animated GIFs&lt;br /&gt;
&lt;br /&gt;
     To see this in action, reference:&lt;br /&gt;
      http://souptonuts.sourceforge.net/povray/orbit.pov.html&lt;br /&gt;
&lt;br /&gt;
     These are the basic command to create:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        $ povray orbit.ini -Iorbit.pov&lt;br /&gt;
        $ convert -delay 20 *.ppm orbit.gif&lt;br /&gt;
&lt;br /&gt;
     By the way, convert is a program from imagemagick, and it can&lt;br /&gt;
     be downloaded from ( http://www.imagemagick.org ).&lt;br /&gt;
&lt;br /&gt;
    The following is &amp;quot;orbit.pov&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          #include &amp;quot;colors.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;finish.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;metals.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;textures.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;stones.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;skies.inc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          camera {&lt;br /&gt;
            location &amp;lt; 2, 3, -8 &amp;gt;&lt;br /&gt;
            look_at  &amp;lt; 0, 0, 0 &amp;gt;&lt;br /&gt;
            focal_point &amp;lt;0, 0, 0&amp;gt;&lt;br /&gt;
            blur_samples 20&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          light_source {&lt;br /&gt;
                  &amp;lt; 0, 10, 0&amp;gt;&lt;br /&gt;
                  color White&lt;br /&gt;
                  area_light &amp;lt;2,0,0&amp;gt;,&amp;lt;0,0,2&amp;gt;, 2, 2&lt;br /&gt;
                  adaptive 1&lt;br /&gt;
                  fade_distance 8&lt;br /&gt;
                  fade_power 1&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          sky_sphere {&lt;br /&gt;
            S_Cloud3&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          plane { &amp;lt;0, 1, 0&amp;gt;, -1&lt;br /&gt;
                  texture {&lt;br /&gt;
                          pigment {&lt;br /&gt;
                                  checker color Blue, color White&lt;br /&gt;
                          }&lt;br /&gt;
                          finish {Phong_Glossy}&lt;br /&gt;
                  }&lt;br /&gt;
          }&lt;br /&gt;
          #declare ball0=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;0.5, 0.5, 0&amp;gt;, 1&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Yellow}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          #declare ball1=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;3, 2, 0&amp;gt;, 0.5&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Blue}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          #declare ball2=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;3, 1, 0&amp;gt;, 1&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Green}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          object {ball0 rotate 360*clock*y}&lt;br /&gt;
          object {ball1 rotate 720*clock*y}&lt;br /&gt;
          object {ball2 rotate 360*(1 - clock)*y}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    And, &amp;quot;orbit.ini&amp;quot; follows:&lt;br /&gt;
&lt;br /&gt;
          Output_File_Type=P&lt;br /&gt;
&lt;br /&gt;
          Width=320&lt;br /&gt;
          Height=240&lt;br /&gt;
&lt;br /&gt;
          Initial_Frame=1&lt;br /&gt;
          Final_Frame=10&lt;br /&gt;
          Antialias=true&lt;br /&gt;
&lt;br /&gt;
          Subset_Start_Frame=1&lt;br /&gt;
          Subset_End_Frame=10&lt;br /&gt;
&lt;br /&gt;
          Cyclic_Animation=on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 86:&lt;br /&gt;
&lt;br /&gt;
     GPG --  GnuPG&lt;br /&gt;
&lt;br /&gt;
        Reference: http://www.gnupg.org/documentation/faqs.html&lt;br /&gt;
                   http://codesorcery.net/mutt/mutt-gnupg-howto&lt;br /&gt;
                   http://www.gnupg.org/(en)/download/index.html&lt;br /&gt;
                   (SCRIPT 4) on following link:&lt;br /&gt;
                   http://prdownloads.sourceforge.net/souptonuts/README_common_script_commands.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Generage key:&lt;br /&gt;
&lt;br /&gt;
        $ gpg --gen-key&lt;br /&gt;
&lt;br /&gt;
     Generate public key ID and fingerprint&lt;br /&gt;
&lt;br /&gt;
        $ gpg --fingerprint&lt;br /&gt;
&lt;br /&gt;
     Get a list of keys:&lt;br /&gt;
&lt;br /&gt;
        $ gpg --list-keys&lt;br /&gt;
&lt;br /&gt;
          pub  1024D/A11C1499 2004-07-15 Mike Chirico &amp;lt;mchirico@comcast.net&amp;gt;&lt;br /&gt;
          sub  1024g/E1A3C2B3 2004-07-15&lt;br /&gt;
&lt;br /&gt;
     Encrypt&lt;br /&gt;
&lt;br /&gt;
        $ gpg -r Mike  --encrypt sample.txt&lt;br /&gt;
&lt;br /&gt;
       This will produce &amp;quot;sample.txt.asc&amp;quot;, which is a binary file.  Note, I can use &amp;quot;Mike&amp;quot; because that's the&lt;br /&gt;
       name on the list of keys. Again, it will be a binary file.&lt;br /&gt;
&lt;br /&gt;
     Encrypt using &amp;quot;ASCII-armored text&amp;quot;  (--armor), which is probably what you want when sending &amp;quot;in&amp;quot; the body of an&lt;br /&gt;
     email, or some document.&lt;br /&gt;
&lt;br /&gt;
        $ gpg  -r Mike  --encrypt --armor sample.txt&lt;br /&gt;
            or&lt;br /&gt;
        $ gpg -r Mike -e -a sample.txt&lt;br /&gt;
            or&lt;br /&gt;
        $ gpg --output somefile.asc --armor -r Mike  --encrypt --armor sample.txt&lt;br /&gt;
&lt;br /&gt;
     The above 3 statements will still produce &amp;quot;sample.txt.asc&amp;quot;, but look at it, or &amp;quot;$ cat sample.txt.asc&amp;quot; without &lt;br /&gt;
     fear, since there are no binary characters. Yes, you could even compile a program &amp;quot;$ g++ -o test test.c&amp;quot; , then,&lt;br /&gt;
     &amp;quot;$ gpg --output test.asc  -r Mike --encrypt --armor test&amp;quot;. However, when decrypting make sure to pipe&lt;br /&gt;
     the results.&lt;br /&gt;
&lt;br /&gt;
            $ gpg --decrypt test.asc &amp;gt; test&lt;br /&gt;
&lt;br /&gt;
     Export &amp;quot;public&amp;quot; key:&lt;br /&gt;
&lt;br /&gt;
           $ gpg --armor --export Mike &amp;gt; m1.asc&lt;br /&gt;
&lt;br /&gt;
     Signing the file &amp;quot;message.txt&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
           $ gpg --clearsign message.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Sending the key to the &amp;quot;key-server&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        First, list the keys.&lt;br /&gt;
&lt;br /&gt;
                $ gpg --list-keys&lt;br /&gt;
                    /home/chirico/.gnupg/pubring.gpg&lt;br /&gt;
                                 v------------------ Use this with &amp;quot;0x&amp;quot; in front -------&lt;br /&gt;
                  pub  1024D/A11C1499 2004-07-15 Mike Chirico  &amp;lt;mchirico@comcast.net&amp;gt;   |&lt;br /&gt;
                  sub  1024g/E1A3C2B3 2004-07-15                                        |&lt;br /&gt;
                                                                                        |&lt;br /&gt;
                                   v----------------------------------------------------&lt;br /&gt;
                $ gpg --send-keys 0xA11C1499&lt;br /&gt;
&lt;br /&gt;
             The above sends it to the keyserver defined in &amp;quot;/home/chirico/.gnupg/gpg.conf&amp;quot;.  Other key servers:&lt;br /&gt;
&lt;br /&gt;
                            wwwkeys.pgp.net&lt;br /&gt;
                            search.keyserver.net&lt;br /&gt;
                            pgp.ai.mit.edu&lt;br /&gt;
&lt;br /&gt;
             When you go to your user-group meetings, you need to bring 2 forms of ID, and&lt;br /&gt;
             list your Key fingerprint. Shown below is the command for getting this fingerprint.&lt;br /&gt;
&lt;br /&gt;
                $ gpg --fingerprint mchirico@comcast.net&lt;br /&gt;
                 pub   1024D/A11C1499 2004-07-15&lt;br /&gt;
                 Key fingerprint = 9D7F C80D BB7B 4BAB CCA4  1BE9 9056 5BEC A11C 1499&lt;br /&gt;
                 uid   Mike Chirico (http://souptonuts.sourceforge.net/chirico/index.php) &amp;lt;mchirico@comcast.net&amp;gt;&lt;br /&gt;
                 sub   1024g/E1A3C2B3 2004-07-15&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Receving keys:&lt;br /&gt;
&lt;br /&gt;
        The following will retrieve my mchirico@comcast.net key&lt;br /&gt;
&lt;br /&gt;
               $ gpg --recv-keys 0xA11C1499&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Special Note: If you get the following error &amp;quot;GPG: Warning: Using Insecure Memory&amp;quot; , then,&lt;br /&gt;
                   &amp;quot; chmod 4755 /path/to/gpg&amp;quot;  to setuid(root) permissioins on the gpg binary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     NOTE: If using mutt, just before sending with the &amp;quot;y&amp;quot; option, hit &amp;quot;p&amp;quot; to sign or encrypt.&lt;br /&gt;
&lt;br /&gt;
     It's possible to create a gpg/pgp email from the command line. For a tutorial on this,&lt;br /&gt;
     reference (SCRIPT 4) at the following link:&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/README_common_script_commands.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 87:&lt;br /&gt;
&lt;br /&gt;
     Working with Dates: Steffen Beyer has developed a Perl and C module for working with dates&lt;br /&gt;
&lt;br /&gt;
     This softare can be downloaded from the following location:&lt;br /&gt;
        http://www.engelschall.com/u/sb/download/pkg/Date-Calc-5.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
         $ wget http://www.engelschall.com/u/sb/download/pkg/Date-Calc-5.3.tar.gz&lt;br /&gt;
         $ tar -xzvf Date-Calc-5.3.tar.gz&lt;br /&gt;
         $ cd Date-Calc-5.3&lt;br /&gt;
         $ cp ./examples/cal.c .&lt;br /&gt;
         $ gcc cal.c DateCalc.c -o mcal&lt;br /&gt;
&lt;br /&gt;
     The file cal.c contains sample function calls from DateCalc.c.  Note, &amp;quot;DateCalc.c&amp;quot;&lt;br /&gt;
     is just a list of functions and includes for &amp;quot;DateCalc.h&amp;quot; and &amp;quot;ToolBox.h&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Or, and this may be easier, just download the following:&lt;br /&gt;
         http://prdownloads.sourceforge.net/cpearls/date_calc.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
     The above link contains a few examples.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 88:&lt;br /&gt;
&lt;br /&gt;
     Color patterns for mutt.&lt;br /&gt;
&lt;br /&gt;
     The colors can be changed in the /home/user/.muttrc file. The first field begins with&lt;br /&gt;
     color, the second field is the foreground color, and the third field is the background&lt;br /&gt;
     color, or default.&lt;br /&gt;
&lt;br /&gt;
     An example .muttrc for colors:&lt;br /&gt;
&lt;br /&gt;
       # color patterns for mutt&lt;br /&gt;
       color normal     white          black # normal text&lt;br /&gt;
       color indicator  black          yellow  # actual message&lt;br /&gt;
       color tree       brightmagenta  default # thread arrows&lt;br /&gt;
       color status     brightyellow         default # status line&lt;br /&gt;
       color error      brightred      default # errors&lt;br /&gt;
       color message    magenta        default # info messages&lt;br /&gt;
       color signature  magenta        default # signature&lt;br /&gt;
       color attachment brightyellow   red     # MIME attachments&lt;br /&gt;
       color search     brightyellow   red     # search matches&lt;br /&gt;
       color tilde      brightmagenta  default # ~ at bottom of msg&lt;br /&gt;
       color markers    red            default # + at beginning of wrapped lines&lt;br /&gt;
       color hdrdefault cyan           default # default header lines&lt;br /&gt;
       color bold       red            default # hiliting bold patterns in body&lt;br /&gt;
       color underline  green          default # hiliting underlined patterns in body&lt;br /&gt;
       color quoted     cyan           default # quoted text&lt;br /&gt;
       color quoted1    magenta        default&lt;br /&gt;
       color quoted2    red            default&lt;br /&gt;
       color quoted3    green          default&lt;br /&gt;
       color quoted4    magenta           default&lt;br /&gt;
       color quoted5    cyan           default&lt;br /&gt;
       color quoted6    magenta        default&lt;br /&gt;
       color quoted7    red            default&lt;br /&gt;
       color quoted8    green          default&lt;br /&gt;
       color quoted9    cyan           default&lt;br /&gt;
       color body   cyan  default  &amp;quot;((ftp|http|https)://|news:)[^ &amp;gt;)\&amp;quot;\t]+&amp;quot;&lt;br /&gt;
       color body   cyan  default  &amp;quot;[-a-z_0-9.+]+@[-a-z_0-9.]+&amp;quot;&lt;br /&gt;
       color body   red   default  &amp;quot;(^| )\\*[-a-z0-9*]+\\*[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color body   green default  &amp;quot;(^| )_[-a-z0-9_]+_[,.?]?[\n]&amp;quot;&lt;br /&gt;
       color body   red   default  &amp;quot;(^| )\\*[-a-z0-9*]+\\*[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color body   green default  &amp;quot;(^| )_[-a-z0-9_]+_[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color index  cyan  default  ~F         # Flagged&lt;br /&gt;
       color index  red   default  ~N         # New&lt;br /&gt;
       color index  magenta    default  ~T         # Tagged&lt;br /&gt;
       color index  cyan       default  ~D         # Deleted&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 190)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 89:&lt;br /&gt;
&lt;br /&gt;
     ps command in detail&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Here are the possible codes when using state &amp;quot;$ ps -e -o state,cmd&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             PROCESS STATE CODES&lt;br /&gt;
                  D   uninterruptible sleep (usually IO)&lt;br /&gt;
                  R   runnable (on run queue)&lt;br /&gt;
                  S   sleeping&lt;br /&gt;
                  T   traced or stopped&lt;br /&gt;
                  Z   a defunct (&amp;quot;zombie&amp;quot;) process&lt;br /&gt;
&lt;br /&gt;
                  &amp;lt;    high-priority (not nice to other users)&lt;br /&gt;
                  N    low-priority (nice to other users)&lt;br /&gt;
                  L    has pages locked into memory (for real-time and custom IO)&lt;br /&gt;
                  s    is a session leader&lt;br /&gt;
                  l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)&lt;br /&gt;
                  +    is in the foreground process group&lt;br /&gt;
&lt;br /&gt;
    For instance:&lt;br /&gt;
&lt;br /&gt;
     Note that the -o is for user defined, and -e is for select&lt;br /&gt;
     all process.&lt;br /&gt;
&lt;br /&gt;
       $ ps -e -o pid,state,start,time,etime,cmd&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
             9946 S 15:40:45 00:00:00    02:23:29 /bin/bash -i&lt;br /&gt;
             9985 T 15:41:24 00:00:01    02:22:50 emacs mout2&lt;br /&gt;
            10003 T 15:43:59 00:00:00    02:20:15 emacs NOTES&lt;br /&gt;
            10320 T 17:38:42 00:00:00       25:32 emacs stuff.c&lt;br /&gt;
         ...&lt;br /&gt;
&lt;br /&gt;
     You may want to command below, without the -e, which will give the&lt;br /&gt;
     process only under the current terminal.&lt;br /&gt;
&lt;br /&gt;
       $ ps -o pid,state,start,time,etime,cmd&lt;br /&gt;
&lt;br /&gt;
     Want to find what 's impacting your load?&lt;br /&gt;
&lt;br /&gt;
       $ ps -e -o %cpu,pid,state,start,time,etime,%cpu,%mem,cmd|sort -rn|less&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ ps aux&lt;br /&gt;
&lt;br /&gt;
            USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND&lt;br /&gt;
            root         1  0.0  0.0  1380  480 ?        S    Aug04   0:00 init [3]&lt;br /&gt;
            root         2  0.0  0.0     0    0 ?        SWN  Aug04   0:00 [ksoftirqd/0]&lt;br /&gt;
            root         3  0.0  0.0     0    0 ?        SW&amp;lt;  Aug04   0:00 [events/0]&lt;br /&gt;
            root         4  0.0  0.0     0    0 ?        SW&amp;lt;  Aug04   0:00 [khelper]&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     Or, if you want to see the environment add the -e option&lt;br /&gt;
&lt;br /&gt;
       $ ps aeux&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
            chirico   2735  0.0  0.1  4400 1492 pts/0    S    Aug04   0:00 -bash USER=chirico LOGNAME=chirico HOME=/home/chirico PATH=/usr/&lt;br /&gt;
            chirico   2771  0.0  0.0  4328  924 pts/0    S    Aug04   0:00 screen -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm S&lt;br /&gt;
            chirico   2772  0.0  0.6  9476 6352 ?        S    Aug04   0:54 SCREEN -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm S&lt;br /&gt;
            chirico   2773  0.0  0.1  4432 1548 pts/1    S    Aug04   0:10 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            chirico   2797  0.0  0.1  4416 1496 pts/2    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            root      2821  0.0  0.0  4100  952 pts/2    S    Aug04   0:00 su -&lt;br /&gt;
            root      2822  0.0  0.1  4384 1480 pts/2    S    Aug04   0:00 -bash&lt;br /&gt;
            chirico   2862  0.0  0.1  4428 1524 pts/3    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            sporkey   2946  0.0  0.2  6836 2960 ?        S    Aug04   0:15 fetchmail&lt;br /&gt;
            chirico   2952  0.0  0.1  4436 1552 pts/5    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            chirico   3880  0.0  0.1  4416 1496 pts/6    S    Aug05   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            root      3904  0.0  0.0  4100  956 pts/6    S    Aug05   0:00 su - donkey&lt;br /&gt;
            donkey    3905  0.0  0.1  4336 1452 pts/6    S    Aug05   0:00 -bash&lt;br /&gt;
            donkey    3938  0.0  0.2  6732 2856 ?        S    Aug05   0:14 fetchmail&lt;br /&gt;
            chirico   3944  0.0  0.1  4416 1496 pts/7    S    Aug05   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     There is also a -f &amp;quot;forrest&amp;quot; option. Also note below &amp;quot; -bash&amp;quot; is the start of a login shell.&lt;br /&gt;
&lt;br /&gt;
      $ ps aeuxwwf &lt;br /&gt;
     &lt;br /&gt;
     The ww option above gives a wide format with all variables. Use the above command if you plan&lt;br /&gt;
     to parse through a Perl script. Otherwise, it may be easier to do a quick read using the command&lt;br /&gt;
     below, without &amp;quot;ww&amp;quot;.    &lt;br /&gt;
&lt;br /&gt;
      $ ps aeuxf&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
            root      2339  0.0  0.1  3512 1444 ?        S    Dec01   0:00 /usr/sbin/sshd&lt;br /&gt;
            root     25651  0.0  0.1  6764 1980 ?        S    Dec23   0:00  \_ /usr/sbin/sshd&lt;br /&gt;
            chirico  25653  0.0  0.2  6840 2236 ?        S    Dec23   0:14      \_ /usr/sbin/sshd&lt;br /&gt;
            chirico  25654  0.0  0.1  4364 1440 pts/4    S    Dec23   0:00          \_ -bash USER=chirico LOGNAME=chirico HOME=/home/chirico&lt;br /&gt;
            chirico  25690  0.0  0.0  4328  920 pts/4    S    Dec23   0:00              \_ screen -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm&lt;br /&gt;
            root      2355  0.0  0.0  2068  904 ?        S    Dec01   0:00 xinetd -stayalive -pidfile /var/run/xinetd.pid&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     It is also possible to list the process by command line. For example, the following command will only list the emacs&lt;br /&gt;
     processes.&lt;br /&gt;
&lt;br /&gt;
      $ ps -fC emacs&lt;br /&gt;
       UID        PID  PPID  C STIME TTY          TIME CMD&lt;br /&gt;
       chirico   5049  5020  0 May11 pts/13   00:00:00 emacs -nw Notes&lt;br /&gt;
       chirico  12368  5104  0 May12 pts/18   00:00:00 emacs -nw dnotify.c&lt;br /&gt;
       chirico  19792 18028  0 May13 pts/20   00:00:00 emacs -nw hello.c&lt;br /&gt;
       chirico  14034 27367  0 18:52 pts/8    00:00:00 emacs -nw How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
     You may also want to consider using top in batch mode. Here the &amp;quot;-n 1&amp;quot; means refresh once,&lt;br /&gt;
     and the &amp;quot;b&amp;quot; is for batch. The &amp;quot;fmt -s&amp;quot; is to put it in a more readable format.&lt;br /&gt;
&lt;br /&gt;
       $ top -n 1 b |fmt  -s &amp;gt;&amp;gt;statfile&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 90:&lt;br /&gt;
&lt;br /&gt;
     Learning Assembly.&lt;br /&gt;
&lt;br /&gt;
     Once you have written the source, assuming the file is &amp;quot;exit.s&amp;quot;, it can be compiled as follows:&lt;br /&gt;
&lt;br /&gt;
            $ as exit.s -o exit.o&lt;br /&gt;
            $ ld exit.o -o exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Here is the program:&lt;br /&gt;
&lt;br /&gt;
         #&lt;br /&gt;
         #INPUT:  none&lt;br /&gt;
         #&lt;br /&gt;
         #OUTPUT:         returns a status code. This can be viewed&lt;br /&gt;
         # by typing&lt;br /&gt;
         #&lt;br /&gt;
         # echo $?&lt;br /&gt;
         #&lt;br /&gt;
         # after running the program&lt;br /&gt;
         #&lt;br /&gt;
         #VARIABLES:&lt;br /&gt;
         # %eax holds the system call number&lt;br /&gt;
         # (this is always the case)&lt;br /&gt;
         #&lt;br /&gt;
         # %ebx holds the return status&lt;br /&gt;
         #&lt;br /&gt;
                 .section .data&lt;br /&gt;
                 .section .text&lt;br /&gt;
&lt;br /&gt;
                 .globl _start&lt;br /&gt;
         _start:&lt;br /&gt;
                 movl $1, %eax # this is the linux kernel command&lt;br /&gt;
                 # number (system call) for exiting&lt;br /&gt;
                 # a program&lt;br /&gt;
                 movl $0, %ebx # this is the status number we will&lt;br /&gt;
                 # return to the operating system.&lt;br /&gt;
                 # Change this around and it will&lt;br /&gt;
                 # return different things to&lt;br /&gt;
                 # echo $?&lt;br /&gt;
                 int $0x80 # this wakes up the kernel to run&lt;br /&gt;
                 # the exit command&lt;br /&gt;
&lt;br /&gt;
     After running this program, you can get the exit code.&lt;br /&gt;
&lt;br /&gt;
            $ exit $?&lt;br /&gt;
            0&lt;br /&gt;
&lt;br /&gt;
     That is about all it does; but, get the book for more details. The&lt;br /&gt;
     book is free.&lt;br /&gt;
&lt;br /&gt;
          http://savannah.nongnu.org/download/pgubook/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 91:&lt;br /&gt;
&lt;br /&gt;
     Creating a sandbox for reiserfstune,debugreiserfs and ACL.  Also see TIP 4.&lt;br /&gt;
&lt;br /&gt;
     Assume you have a reisers files system created from a disk file, which&lt;br /&gt;
     means you have done something like the following:&lt;br /&gt;
&lt;br /&gt;
          # dd if=/dev/zero of=disk-rfs count=102400&lt;br /&gt;
          # losetup  /dev/loop4 ./disk-rfs&lt;br /&gt;
          # mkfs -t reiserfs /dev/loop4&lt;br /&gt;
          # mkdir /fs2&lt;br /&gt;
          # mount -o loop,acl ./disk-rfs /fs2&lt;br /&gt;
&lt;br /&gt;
     Now, you can run reiserfstune. But, first you will need to umount fs2&lt;br /&gt;
&lt;br /&gt;
          # umount /fs2&lt;br /&gt;
          # reiserfstune ./disk-rfs&lt;br /&gt;
&lt;br /&gt;
     Or you can run the debug command&lt;br /&gt;
&lt;br /&gt;
          # debugreiserfs -J ./disk-rfs&lt;br /&gt;
&lt;br /&gt;
     Now, suppose you run through a lot of the debug options on&lt;br /&gt;
     http://www.namesys.com/ and you destroy this file.&lt;br /&gt;
&lt;br /&gt;
     You can recreate the file and delete the loop device.&lt;br /&gt;
&lt;br /&gt;
          # dd if=/dev/zero of=disk-rfs count=102400&lt;br /&gt;
          # losetup -d /dev/loop4&lt;br /&gt;
          # mount -o loop,acl ./disk-rfs /fs2&lt;br /&gt;
&lt;br /&gt;
     Now, try working with some of the ACL options - you can only do this&lt;br /&gt;
     with the latest kernel and tools -- Fedora Core 2 will work.&lt;br /&gt;
&lt;br /&gt;
     Assume you have 3 users, donkey, chirico and bozo2. You can give&lt;br /&gt;
     everyone rights to this file system as follows:&lt;br /&gt;
&lt;br /&gt;
          # setfacl -R -m d:u:donkey:rwx,d:u:chirico:rwx,d:u:bozo2:rwx /fs2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 92:&lt;br /&gt;
&lt;br /&gt;
     SpamAssassin - Setup.&lt;br /&gt;
&lt;br /&gt;
     Step 1.&lt;br /&gt;
&lt;br /&gt;
           Installing the SpamAssassin CPAN utility. You will need to do this&lt;br /&gt;
           as root.&lt;br /&gt;
        &lt;br /&gt;
              $ su -&lt;br /&gt;
&lt;br /&gt;
           Once you have root privileges invoke cpan.&lt;br /&gt;
        &lt;br /&gt;
              # perl -MCPAN -e shell&lt;br /&gt;
&lt;br /&gt;
              cpan&amp;gt;&lt;br /&gt;
&lt;br /&gt;
           Now install with prerequisites policy set to ask.&lt;br /&gt;
        &lt;br /&gt;
              cpan&amp;gt; o conf prerequisites_policy ask&lt;br /&gt;
        &lt;br /&gt;
              cpan&amp;gt; install Mail::SpamAssassin&lt;br /&gt;
        &lt;br /&gt;
           You will get lots of output as the necessary modules are downloaded and&lt;br /&gt;
           compiled and installed.&lt;br /&gt;
&lt;br /&gt;
     Step 2.&lt;br /&gt;
&lt;br /&gt;
            Configuration.&lt;br /&gt;
&lt;br /&gt;
            Edit the following &amp;quot;/etc/mail/spamassassin/local.cf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            Here is a look at my file&lt;br /&gt;
&lt;br /&gt;
                $ cat /etc/mail/spamassassin/local.cf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                # This is the right place to customize your installation of SpamAssassin.&lt;br /&gt;
                #&lt;br /&gt;
                # See 'perldoc Mail::SpamAssassin::Conf' for details of what can be&lt;br /&gt;
                # tweaked.&lt;br /&gt;
                #&lt;br /&gt;
                ###########################################################################&lt;br /&gt;
                #&lt;br /&gt;
                # rewrite_subject 0&lt;br /&gt;
                # report_safe 1&lt;br /&gt;
                # trusted_networks 212.17.35.&lt;br /&gt;
                #&lt;br /&gt;
                &lt;br /&gt;
                # Below added from book&lt;br /&gt;
                # You may want to set this to 5, then, work your way down.&lt;br /&gt;
                # Currently I have this 3&lt;br /&gt;
                required_hits 3&lt;br /&gt;
                &lt;br /&gt;
                # This determines how spam is reported. Currently safe email is reported&lt;br /&gt;
                # in the message.&lt;br /&gt;
                report_safe 1&lt;br /&gt;
                &lt;br /&gt;
                # The will rewrite the tag of the spam message.&lt;br /&gt;
                rewrite_subject 1&lt;br /&gt;
                &lt;br /&gt;
                # By default, SpamAssassin will run RBL checks.  If your ISP already&lt;br /&gt;
                # does this, set this to 1.&lt;br /&gt;
                skip_rbl_checks 0&lt;br /&gt;
&lt;br /&gt;
     Step 3.&lt;br /&gt;
&lt;br /&gt;
            Update .procmail.&lt;br /&gt;
&lt;br /&gt;
            You should update the .procmail file as follows. Here is my /home/chirico/.procmail file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ cat /home/chirico/.procmailrc&lt;br /&gt;
&lt;br /&gt;
                PATH=/bin:/usr/bin:/usr/local/bin&lt;br /&gt;
                MAILDIR=/var/spool/mail&lt;br /&gt;
                DEFAULT=/var/spool/mail/chirico&lt;br /&gt;
                LOGFILE=/home/chirico/MailBAG&lt;br /&gt;
                MYHOME=/home/chirico&lt;br /&gt;
                #  Must have folder MailTRASH&lt;br /&gt;
                TRASH=/home/chirico/MailTRASH&lt;br /&gt;
                &lt;br /&gt;
                # Will get everything from this mail&lt;br /&gt;
                :0&lt;br /&gt;
                * ^From:.*sporkey@comcast.net&lt;br /&gt;
                        $DEFAULT&lt;br /&gt;
                &lt;br /&gt;
                # Spamassassin&lt;br /&gt;
                :0fw&lt;br /&gt;
                * &amp;lt;300000&lt;br /&gt;
                |/usr/local/bin/spamassassin&lt;br /&gt;
&lt;br /&gt;
      Reference:&lt;br /&gt;
        http://pm-doc.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 93:&lt;br /&gt;
&lt;br /&gt;
     Make Graphs: using dot and neato.&lt;br /&gt;
&lt;br /&gt;
       $ dot -Tpng dotfile -o myout.png&lt;br /&gt;
&lt;br /&gt;
     To see the output reference the following:&lt;br /&gt;
       http://souptonuts.sourceforge.net/code/myout.png&lt;br /&gt;
&lt;br /&gt;
     Where &amp;quot;dotfile&amp;quot; is the following:&lt;br /&gt;
&lt;br /&gt;
       $ cat dotfile&lt;br /&gt;
&lt;br /&gt;
       digraph g&lt;br /&gt;
       {&lt;br /&gt;
               node [shape = record];&lt;br /&gt;
&lt;br /&gt;
               node0 [ label =&amp;quot;&amp;lt;f0&amp;gt; stuff | &amp;lt;f1&amp;gt; J | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node1 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; E | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node4 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; C | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node6 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; I | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node2 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; U | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node5 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; N | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node9 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; Y | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node8 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; W | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node10 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; Z | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node7 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; A | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node3 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; G | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node0&amp;quot;:f0 -&amp;gt; &amp;quot;node1&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node0&amp;quot;:f2 -&amp;gt; &amp;quot;node2&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node1&amp;quot;:f0 -&amp;gt; &amp;quot;node4&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node1&amp;quot;:f2 -&amp;gt; &amp;quot;node6&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node4&amp;quot;:f0 -&amp;gt; &amp;quot;node7&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node4&amp;quot;:f2 -&amp;gt; &amp;quot;node3&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node2&amp;quot;:f0 -&amp;gt; &amp;quot;node5&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node2&amp;quot;:f2 -&amp;gt; &amp;quot;node9&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node9&amp;quot;:f0 -&amp;gt; &amp;quot;node8&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node9&amp;quot;:f2 -&amp;gt; &amp;quot;node10&amp;quot;:f1;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
     Checkout the following article:&lt;br /&gt;
        http://www.linuxjournal.com/article.php?sid=7275&lt;br /&gt;
&lt;br /&gt;
     To download this software&lt;br /&gt;
        http://www.graphviz.org/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 94:&lt;br /&gt;
&lt;br /&gt;
     Makefile: working with conditions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     First note that all the indentations of the file must be&lt;br /&gt;
     a single tab. There cannot be any spaces, or make will&lt;br /&gt;
     not run.&lt;br /&gt;
&lt;br /&gt;
       $ cat Makefile&lt;br /&gt;
&lt;br /&gt;
        # Compiler flags&lt;br /&gt;
        sqliteLIB := $(shell ls /usr/local/lib/libsqlite.so)&lt;br /&gt;
        sqlite3LIB := $(shell ls /usr/local/lib/libsqlite3.so)&lt;br /&gt;
        # all assumes sqlite and sqlite3 are installed&lt;br /&gt;
        #&lt;br /&gt;
&lt;br /&gt;
        test:&lt;br /&gt;
        ifeq (&amp;quot;$(sqlite3LIB)&amp;quot;,&amp;quot;/usr/local/lib/libsqlite3.so&amp;quot;)&lt;br /&gt;
             @echo -e &amp;quot;True -- we found the file&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
             @echo &amp;quot;False -- we did not find the file&amp;quot;&lt;br /&gt;
        endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     So, if I run make I will get the following output.&lt;br /&gt;
&lt;br /&gt;
       $ make&lt;br /&gt;
       True -- we found the file&lt;br /&gt;
&lt;br /&gt;
     This is because I have a file /usr/local/lib/libsqlite3.so on my system.&lt;br /&gt;
     Note how the assignment is made, with the shell command&lt;br /&gt;
&lt;br /&gt;
           sqlite3LIB := $(shell ls /usr/local/lib/libsqlite3.so)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 95:&lt;br /&gt;
&lt;br /&gt;
     Bash: Conditional Expressions&lt;br /&gt;
&lt;br /&gt;
          if [ -e /etc/ntp.conf ]&lt;br /&gt;
            then&lt;br /&gt;
              echo &amp;quot;You have the ntp config file&amp;quot;&lt;br /&gt;
            else&lt;br /&gt;
              echo &amp;quot;You do not have the ntp config file&amp;quot;&lt;br /&gt;
          fi&lt;br /&gt;
&lt;br /&gt;
       Now using an AND condition inside the [ ]. By the way, above, you&lt;br /&gt;
       can put the &amp;quot;then&amp;quot; on the same line as the if &amp;quot;if [ -e /etc/ntp.conf ]; then&amp;quot;&lt;br /&gt;
       as long as you use the &amp;quot;;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           if [ \( -e /etc/ntp.conf \) -a \( -e /etc/ntp/ntpservers \) ]&lt;br /&gt;
             then&lt;br /&gt;
               echo &amp;quot;You have ntp config and ntpservers&amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp.conf ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntp.conf &amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp/ntpservers ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntpservers &amp;quot;&lt;br /&gt;
             else&lt;br /&gt;
               echo &amp;quot; you have neither ntp.conf or ntpservers&amp;quot;&lt;br /&gt;
           fi&lt;br /&gt;
&lt;br /&gt;
        A few things to note above. Else if statement is written as &amp;quot;elif&amp;quot;, and when&lt;br /&gt;
        dealing with &amp;quot;(&amp;quot; you will need to insert &amp;quot;\(&amp;quot;. By the way &amp;quot;-o&amp;quot; can replace &amp;quot;-a&amp;quot;&lt;br /&gt;
        and the &amp;quot;-o&amp;quot; is for OR condition. AND can be done as follows too.&lt;br /&gt;
&lt;br /&gt;
           if [ -e /etc/ntp.conf ] &amp;amp;&amp;amp; [ -e /etc/ntp/ntpservers ]&lt;br /&gt;
             then&lt;br /&gt;
               echo &amp;quot;You have ntp config and ntpservers&amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp.conf ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntp.conf &amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp/ntpservers ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntpservers &amp;quot;&lt;br /&gt;
             else&lt;br /&gt;
               echo &amp;quot; you have neither ntp.conf or ntpservers&amp;quot;&lt;br /&gt;
           fi&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (files).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             -b file      True if file exists and is a block file&lt;br /&gt;
             -c file      True if file exists and is a character device file&lt;br /&gt;
             -d file      True if file exists and is a directory&lt;br /&gt;
             -e file      True if file exists&lt;br /&gt;
             -f file      True if file exists and is a regular file&lt;br /&gt;
             -g file      True if file exists and is set goup id&lt;br /&gt;
             -G file      True if owned by the effective group ID&lt;br /&gt;
&lt;br /&gt;
             -k file      True if &amp;quot;sticky&amp;quot; bit is set and file exists&lt;br /&gt;
             -L file      True if file exists and is a symbolic link&lt;br /&gt;
             -n string    True if string is non-null&lt;br /&gt;
&lt;br /&gt;
             -O file      Ture if file exists and is owned by the effective user ID&lt;br /&gt;
&lt;br /&gt;
             -p file      True if file is a named pipe (FIFO)&lt;br /&gt;
             -r file      True if file is readable&lt;br /&gt;
             -s file      True if file has size &amp;gt; 0&lt;br /&gt;
             -S file      True if file exists and is a socket&lt;br /&gt;
&lt;br /&gt;
             -t file      True if file is open and refers to a terminal.&lt;br /&gt;
             -u file      True if setuid bit is set&lt;br /&gt;
             -w file      True if file exists and is writeable&lt;br /&gt;
             -x file      True if file executable&lt;br /&gt;
             -x dir       True if directory can be searched&lt;br /&gt;
&lt;br /&gt;
             file1 -nt file2     True if file1 modification date newer than file2&lt;br /&gt;
             file1 -ot file2     True if file1 modification date older than file2&lt;br /&gt;
             file1 -ef file2     True if file1 and file2 have same inode&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (Integers).&lt;br /&gt;
&lt;br /&gt;
             -lt  Less than&lt;br /&gt;
             -le  Less than or equal&lt;br /&gt;
             -eq  Equal&lt;br /&gt;
             -ge  Greater than or equal&lt;br /&gt;
             -gt  Greater than&lt;br /&gt;
             -ne  Not equal&lt;br /&gt;
&lt;br /&gt;
          Example usage.&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
             {&lt;br /&gt;
               while read num value; do&lt;br /&gt;
                if [ $num -gt  2 ]; then&lt;br /&gt;
                  echo $value&lt;br /&gt;
                fi&lt;br /&gt;
               done&lt;br /&gt;
             } &amp;lt; somefile&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (Strings).&lt;br /&gt;
&lt;br /&gt;
             str1 = str2      str1 matches str2&lt;br /&gt;
             str1 != str2     str1 does not matches str2&lt;br /&gt;
             str1 &amp;lt; str2      str1 is less than str2&lt;br /&gt;
             str1 &amp;gt;  str2     str1 is greater than str2&lt;br /&gt;
             -n str1          str1 is not null (length greater than 0)&lt;br /&gt;
             -z str1          str1 is null (las length 0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 96:&lt;br /&gt;
&lt;br /&gt;
     CVS: Working with cvs&lt;br /&gt;
&lt;br /&gt;
      INITIAL REPOSITORY:&lt;br /&gt;
&lt;br /&gt;
       To create a repository, and this is normally done by the system admin. This&lt;br /&gt;
       is NOT creating a project to checkout, but the location where everything&lt;br /&gt;
       will be stored! The initial repository!&lt;br /&gt;
&lt;br /&gt;
             cvs -d repository_root_directory init&lt;br /&gt;
&lt;br /&gt;
       Or here is a specific example:&lt;br /&gt;
&lt;br /&gt;
             cvs -d /work/cvsREPOSITORY/   init&lt;br /&gt;
&lt;br /&gt;
       Creating a directory tree from scratch. For a new project, the easiest thing to&lt;br /&gt;
       do is probably to create an empty directory structure, like this:&lt;br /&gt;
&lt;br /&gt;
             $ mkdir sqlite_examples&lt;br /&gt;
             $ mkdir sqlite_examples/man&lt;br /&gt;
             $ mkdir sqlite_examples/testing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       After that, you use the import command to create the&lt;br /&gt;
       corresponding (empty) directory structure inside the repository:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             $ cd &amp;lt;directory&amp;gt;&lt;br /&gt;
             $ cvs -d repository_root_directory import  -m &amp;quot;Created directory structure&amp;quot; yoyodyne/dir yoyo start&lt;br /&gt;
&lt;br /&gt;
       Or, here is a specific example.&lt;br /&gt;
&lt;br /&gt;
             $  cd sqlite_examples&lt;br /&gt;
             $  cvs  -d /work/cvsREPOSITORY/ import -m 'test SQlite'  sqlite_examples sqlite_examples start&lt;br /&gt;
&lt;br /&gt;
       Now, you can delete the directory sqlite_examples, or go to another directory and type&lt;br /&gt;
       the following:&lt;br /&gt;
&lt;br /&gt;
             $ cvs -d /work/cvsREPOSITORY/ co sqlite_examples&lt;br /&gt;
&lt;br /&gt;
     COOL TOOLS:&lt;br /&gt;
&lt;br /&gt;
           1. cvsps&lt;br /&gt;
           2. cvsreport&lt;br /&gt;
&lt;br /&gt;
         cvsps which you can find at http://www.cobite.com/cvsps/cvsps-2.0rc1.tar.gz&lt;br /&gt;
&lt;br /&gt;
             $ cvsps -f README_sqlite_tutorial.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 97:&lt;br /&gt;
&lt;br /&gt;
     Common vi and vim commands&lt;br /&gt;
&lt;br /&gt;
           Command mode ESC&lt;br /&gt;
&lt;br /&gt;
                dd       delete&lt;br /&gt;
                u        undelete&lt;br /&gt;
                y        yank (copy to buffer)&lt;br /&gt;
                p/P      p before cursor/P after cursor&lt;br /&gt;
&lt;br /&gt;
                Ctl-g    show current line number&lt;br /&gt;
                shft-G   end of file&lt;br /&gt;
              n shft-G   move to line n&lt;br /&gt;
&lt;br /&gt;
               /stuff/   search&lt;br /&gt;
                  n   repeat in same direction&lt;br /&gt;
                  N   repeat in opposite direction&lt;br /&gt;
                  /return  repeat seach forward&lt;br /&gt;
                  ?return  repeat seach backward&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;dyy  Yank current line to buffer d&lt;br /&gt;
               &amp;quot;a7yy Yank next 7 lines to buffer a&lt;br /&gt;
                    or&lt;br /&gt;
               :1,7ya a  Yank [ya] lines 1,7 to buffer a&lt;br /&gt;
               :1,7ya b  Yank [ya] lines 1,7 to buffer b&lt;br /&gt;
&lt;br /&gt;
               :5 pu b   Put [pu] buffer b after line 5&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;dP   Put the content of buffer d before cursor&lt;br /&gt;
               &amp;quot;ap   Put the contents of buffer a after cursor&lt;br /&gt;
&lt;br /&gt;
               :1,4 w! file2  Write lines 1,4 to file2&lt;br /&gt;
               :1,3&lt;br /&gt;
&lt;br /&gt;
               :set nu     Display line numbers&lt;br /&gt;
               :set nonum  Turns off display&lt;br /&gt;
&lt;br /&gt;
               :e &amp;lt;filename&amp;gt; Edit a file in a new buffer&lt;br /&gt;
&lt;br /&gt;
            vim&lt;br /&gt;
               :split&lt;br /&gt;
               :split &amp;lt;filename&amp;gt;&lt;br /&gt;
               :sp &amp;lt;filename&amp;gt;&lt;br /&gt;
               :split new&lt;br /&gt;
&lt;br /&gt;
                   ctl-w   To move between windows&lt;br /&gt;
                   ctl-w+&lt;br /&gt;
                   ctl-w-  To change size&lt;br /&gt;
                   ctl+wv  Split windows vertically&lt;br /&gt;
                   ctl-wq  Close window&lt;br /&gt;
&lt;br /&gt;
               :only       To view only 1 window&lt;br /&gt;
&lt;br /&gt;
            vim dictionary - put the following command in ~/.vimrc&lt;br /&gt;
&lt;br /&gt;
                   set dictionary+=/usr/share/dict/words&lt;br /&gt;
                   set thesaurus+=/usr/share/dict/words&lt;br /&gt;
              &lt;br /&gt;
               Now, after you type a word &amp;lt;ctl-x&amp;gt;&amp;lt;ctl-k&amp;gt;&amp;lt;ctl-n&amp;gt; and to &lt;br /&gt;
               go back in the listing &amp;lt;ctl-p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                   butter&amp;lt;ctl-x&amp;gt;&amp;lt;ctl-k&amp;gt;&amp;lt;ctl-n&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 98:&lt;br /&gt;
&lt;br /&gt;
     Using apt-get&lt;br /&gt;
&lt;br /&gt;
          $ apt-get update&lt;br /&gt;
          $ apt-get -s install &amp;lt;pkage&amp;gt;    &amp;lt;---- if everything is ok, then, remove the s&lt;br /&gt;
&lt;br /&gt;
     Note you may want to use dpkg to purge if you have to do a reinstall.&lt;br /&gt;
&lt;br /&gt;
          $ dpkg --purge exim4-base&lt;br /&gt;
          $ dpkg --purge exim4-config&lt;br /&gt;
          $ apt-get install exim4&lt;br /&gt;
&lt;br /&gt;
          $ dpkg-reconfigure exim4-config&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 99:&lt;br /&gt;
&lt;br /&gt;
     Mounting a cdrom on openbsd and installing packages&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /cdrom&lt;br /&gt;
          $ mount /dev/cd0a /cdrom&lt;br /&gt;
          $ cd /cdrom&lt;br /&gt;
&lt;br /&gt;
     To add packages&lt;br /&gt;
&lt;br /&gt;
          $ pkg_add -v  &amp;lt;directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Mounting a cdrom on linux to a user's home sub-directory:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /home/chirico/cdrom&lt;br /&gt;
          $ mount /dev/cdrom /home/chirico/cdrom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 100:&lt;br /&gt;
&lt;br /&gt;
    Creating a boot floppy for knoppix cd:&lt;br /&gt;
&lt;br /&gt;
          $ dd if=/mnt/cdrom/KNOPPIX/boot.img of=/dev/fd0 bs=1440k&lt;br /&gt;
&lt;br /&gt;
    References:&lt;br /&gt;
        http://www.knoppix.net/docs/index.php/BootFloppyHowTo&lt;br /&gt;
&lt;br /&gt;
    For a lot of the knoppix how-to's&lt;br /&gt;
        http://www.knoppix.net/docs/index.php/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 101:&lt;br /&gt;
&lt;br /&gt;
    Diction and Style Tools for Linux  http://ftp.gnu.org/gnu/diction/&lt;br /&gt;
&lt;br /&gt;
        $ diction mytext|less&lt;br /&gt;
&lt;br /&gt;
    Or, this can be done interactively&lt;br /&gt;
&lt;br /&gt;
        $ diction&lt;br /&gt;
        This is more text to read and you can do with it&lt;br /&gt;
        what you want.&lt;br /&gt;
        (stdin):1: This is more text to read and you [can -&amp;gt; (do not confuse with &amp;quot;may&amp;quot;)] do with it what you want.&lt;br /&gt;
&lt;br /&gt;
    DESCRIPTION&lt;br /&gt;
       Diction finds all sentences in a document, that contain phrases from  a&lt;br /&gt;
       database  of  frequently  misused,  bad  or  wordy diction.  It further&lt;br /&gt;
       checks for double words.  If no files are given, the document  is  read&lt;br /&gt;
       from  standard input.  Each found phrase is enclosed in [ ] (brackets).&lt;br /&gt;
       Suggestions and advice, if any, are printed headed by a right arrow -&amp;gt;.&lt;br /&gt;
       A  sentence is a sequence of words, that starts with a capitalised word&lt;br /&gt;
       and ends with a full stop, double colon, question mark or  exclaimation&lt;br /&gt;
       mark.  A single letter followed by a dot is considered an abbreviation,&lt;br /&gt;
       so it does not terminate a sentence.   Various  multi-letter  abbrevia-&lt;br /&gt;
       tions are recognized, they do not terminate a sentence as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 102:&lt;br /&gt;
&lt;br /&gt;
    Using a mail alias.&lt;br /&gt;
&lt;br /&gt;
       Suppose all root mail on your system to go to one root account root@main.com&lt;br /&gt;
&lt;br /&gt;
       In the following file:&lt;br /&gt;
&lt;br /&gt;
             /etc/aliases&lt;br /&gt;
&lt;br /&gt;
       Add this line&lt;br /&gt;
&lt;br /&gt;
             root:    root@main.com&lt;br /&gt;
&lt;br /&gt;
       Next, run newaliases [/usr/bin/newaliases] as follows:&lt;br /&gt;
&lt;br /&gt;
             $ newaliases&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Special note: It's possible to send mail to more than one address. Suppose you want&lt;br /&gt;
                     mail going to root@main.com above, plus you want it going to user donkey&lt;br /&gt;
                     on the local system.&lt;br /&gt;
&lt;br /&gt;
             root:  root@main.com donkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 103:&lt;br /&gt;
&lt;br /&gt;
    Chrony - this service is similiar to ntp. It keeps accurate time&lt;br /&gt;
            on your computer against a very accurate clock in across&lt;br /&gt;
            a network with various time delays.&lt;br /&gt;
&lt;br /&gt;
    Reference: http://go.to/chrony&lt;br /&gt;
&lt;br /&gt;
        In the file &amp;quot;/etc/chrony/chrony.conf&amp;quot; add/replace the following&lt;br /&gt;
&lt;br /&gt;
             server 146.186.218.60&lt;br /&gt;
             server 128.118.25.3&lt;br /&gt;
             server 128.2.129.21&lt;br /&gt;
&lt;br /&gt;
        Next start the chrony service&lt;br /&gt;
&lt;br /&gt;
           $ /etc/init.d/chrony restart&lt;br /&gt;
&lt;br /&gt;
     Next verify that this is working. It may take 20 or 30 minutes to update&lt;br /&gt;
     the clock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Shell command:&lt;br /&gt;
       # chronyc&lt;br /&gt;
       chronyc&amp;gt; sourcestats&lt;br /&gt;
       210 Number of sources = 3&lt;br /&gt;
       Name/IP Address            NP  NR  Span  Frequency   Freq Skew   Std Dev&lt;br /&gt;
       ========================================================================&lt;br /&gt;
       b50.cede.psu.edu            2   0    64       0.000    2000.000  4000ms&lt;br /&gt;
       otc2.psu.edu                2   0    66       0.000    2000.000  4000ms&lt;br /&gt;
       FS3.ECE.CMU.EDU             2   0    64       0.000    2000.000  4000ms&lt;br /&gt;
       chronyc&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    It is probably best to let chrony do its work. However, if you want to&lt;br /&gt;
    set both the hardware and software clock, the following will work:&lt;br /&gt;
&lt;br /&gt;
      Sets the hardware clock&lt;br /&gt;
        # hwclock --set --date=&amp;quot;12/10/04 10:18:05&amp;quot;&lt;br /&gt;
      Sync the hardware clock to software&lt;br /&gt;
        # hwclock --hctosys&lt;br /&gt;
&lt;br /&gt;
    Normally the system keep accurate time with the software clock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 104:&lt;br /&gt;
&lt;br /&gt;
    NFS mount&lt;br /&gt;
&lt;br /&gt;
     SERVER (192.168.1.182)&lt;br /&gt;
&lt;br /&gt;
       Make sure nfs is running on the server&lt;br /&gt;
 &lt;br /&gt;
           $ /etc/init.d/nfs restart&lt;br /&gt;
&lt;br /&gt;
       At the server the contents of /etc/exports for&lt;br /&gt;
       allowing 2 computers (192.168.1.171 and 192.168.1.71)&lt;br /&gt;
       to access the home directory of this server. Note that&lt;br /&gt;
       read write (rw) access is allowed.&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/exports&lt;br /&gt;
         /home   192.168.1.171(rw)&lt;br /&gt;
         /home   192.168.1.71(rw)&lt;br /&gt;
&lt;br /&gt;
       Or, if you have a lot of clients on 192.168.1.* then consider&lt;br /&gt;
       the following:&lt;br /&gt;
&lt;br /&gt;
          /home 192.168.1.0/255.255.252.0(rw)&lt;br /&gt;
&lt;br /&gt;
       Next, still at the server, run the exportfs command&lt;br /&gt;
&lt;br /&gt;
          $ exportfs -rv&lt;br /&gt;
&lt;br /&gt;
       IPTABLES (lokkit). If you're using fedora with default lokkit firewall&lt;br /&gt;
                then you can put the following under &amp;quot;Other ports&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                  Other ports nfs:tcp nfs:udp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       If the above does not work or you are not using lokkit&lt;br /&gt;
        IPTABLES (values in /etc/sysconfig/iptables on SERVER )&lt;br /&gt;
&lt;br /&gt;
        # NFS Need to accept fragmented packets and may not have header&lt;br /&gt;
        #             so you will not know where they are coming from&lt;br /&gt;
        -A INPUT -f -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -m tcp -s 192.168.1.171 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -s 192.168.1.171 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -m udp -s 192.168.1.171 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -s 192.168.1.171 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        &lt;br /&gt;
        -A INPUT -f -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -m tcp -s 192.168.1.71 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -s 192.168.1.71 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -m udp -s 192.168.1.71 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -s 192.168.1.71 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        (Reference: http://nfs.sourceforge.net/nfs-howto/server.html)&lt;br /&gt;
                  and&lt;br /&gt;
        (Reference: http://nfs.sourceforge.net/nfs-howto/security.html)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     CLIENT1 (192.168.1.171)&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /home2&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/fstab&lt;br /&gt;
         192.168.1.182:/home          /home2     nfs     rw 0 0&lt;br /&gt;
&lt;br /&gt;
          $ mount -a -t nfs&lt;br /&gt;
&lt;br /&gt;
        Or to do a one time mounting by hand&lt;br /&gt;
&lt;br /&gt;
          $ mount -t nfs 192.168.1.182:/home  /home2&lt;br /&gt;
&lt;br /&gt;
        Now /home2 on the client will be /home on the server&lt;br /&gt;
&lt;br /&gt;
        Reference:&lt;br /&gt;
          http://nfs.sourceforge.net/nfs-howto/index.html&lt;br /&gt;
&lt;br /&gt;
     MONITOR NFS:&lt;br /&gt;
&lt;br /&gt;
        To monitor the client:&lt;br /&gt;
&lt;br /&gt;
          $ nfsstat -c&lt;br /&gt;
&lt;br /&gt;
           Also note you can &amp;quot;cat /proc/net/rpc/nfs&amp;quot; as well.&lt;br /&gt;
&lt;br /&gt;
       To monitor the server (note the -s instead of the -c).&lt;br /&gt;
&lt;br /&gt;
         $ nfsstat -s&lt;br /&gt;
&lt;br /&gt;
           Also note you can &amp;quot;cat /proc/net/rpc/nfsd&amp;quot; as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       The following &amp;quot;cat&amp;quot; command is done on the NFS server, and shows which&lt;br /&gt;
       clients are mounting. This does not go with examples above. By the way,&lt;br /&gt;
       &amp;quot;root_squash&amp;quot; is the default, and means that root access on the clients is&lt;br /&gt;
       denied. So, how does the client root get access to these filesystems? You have&lt;br /&gt;
       to &amp;quot;su - &amp;lt;someuser&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
              $ cat /proc/fs/nfs/exports&lt;br /&gt;
              # Version 1.1&lt;br /&gt;
              # Path Client(Flags) # IPs&lt;br /&gt;
              /home   192.168.1.102(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   squeezel.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   192.168.1.106(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   livingroom.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   10.8.0.1(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   closet.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
&lt;br /&gt;
     (Reference: http://www.vanemery.com/Linux/NFSv4/NFSv4-no-rpcsec.html#automount )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 105:&lt;br /&gt;
&lt;br /&gt;
      Ports used for Microsoft products&lt;br /&gt;
               http://www.microsoft.com/canada/smallbiz/sgc/articles/ref_net_ports_ms_prod.mspx?pf=true&lt;br /&gt;
          Firewalling?&lt;br /&gt;
               http://www.microsoft.com/technet/prodtechnol/windowsserver2003/library/ServerHelp/428c1bbf-2ceb-4f76-a1ef-0219982eca10.mspx&lt;br /&gt;
&lt;br /&gt;
      To find out common port mappings, take a look at &amp;quot;/etc/services&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 106:&lt;br /&gt;
&lt;br /&gt;
      Man pages: If man pages are formatting incorrectly with PuTTY, try editing&lt;br /&gt;
      the &amp;quot;/etc/man.config&amp;quot; file with the following changes:&lt;br /&gt;
&lt;br /&gt;
           NROFF /usr/bin/groff -Tlatin1 -mandoc&lt;br /&gt;
           NEQN /usr/bin/geqn -Tlatin1&lt;br /&gt;
&lt;br /&gt;
         (Reference TIP 7 for using man)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 107:&lt;br /&gt;
&lt;br /&gt;
      Valgrind: check for memory leaks in your programs. (http://valgrind.org/)&lt;br /&gt;
&lt;br /&gt;
       This is how you can run it on the program &amp;quot;a.out&amp;quot; for valgrind version 2.2.0&lt;br /&gt;
&lt;br /&gt;
         $ valgrind --logfile=valgrind.output   --tool=memcheck ./a.out&lt;br /&gt;
&lt;br /&gt;
       This is how you write the logfile &amp;quot;--log-file&amp;quot; for valgrind-3.0.1&lt;br /&gt;
&lt;br /&gt;
         $ valgrind  --log-file=valgrind --leak-check=yes --tool=memcheck ./a.out&lt;br /&gt;
&lt;br /&gt;
       With C++ programs with gcc 3.4 and later that use STL, export GLIBCXX_FORCE_NEW &lt;br /&gt;
       only when testing to disable memory caching. Remember to enable for production&lt;br /&gt;
       as this will have a performance penalty. Reference  http://valgrind.org/docs/FAQ/ &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 108:&lt;br /&gt;
&lt;br /&gt;
      Runlevel Configuring.&lt;br /&gt;
&lt;br /&gt;
       These two programs, run as root give you a ncurses GUI to what will&lt;br /&gt;
       run on your system on boot.&lt;br /&gt;
&lt;br /&gt;
            # ntsysv&lt;br /&gt;
&lt;br /&gt;
            # chkconfig&lt;br /&gt;
&lt;br /&gt;
       Note, you can also set these manually. For example, normally you will&lt;br /&gt;
       have files in &amp;quot;/etc/init.d/&amp;quot; that will take parameters like &amp;quot;start&amp;quot;,&amp;quot;stop&amp;quot;&lt;br /&gt;
       &amp;quot;restart&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       Take a look at &amp;quot;/etc/init.d/mysql&amp;quot; this file will start and stop the&lt;br /&gt;
       mysql daemon. So, how does know which run levels, and the order it gets&lt;br /&gt;
       loaded in the run level to other programs? By the K&amp;lt;number&amp;gt; and S&amp;lt;number&amp;gt;&lt;br /&gt;
       values.&lt;br /&gt;
&lt;br /&gt;
            $ ls /etc/rc3.d/*mysql&lt;br /&gt;
&lt;br /&gt;
                /etc/rc3.d/K85mysql&lt;br /&gt;
                /etc/rc3.d/S85mysql&lt;br /&gt;
&lt;br /&gt;
       So here on my system the start value is 85. Looking in /etc/rc3.d, which is&lt;br /&gt;
       run level 3, any program with a lower number S84something will get loaded&lt;br /&gt;
       before mysql.&lt;br /&gt;
&lt;br /&gt;
       I manually set the run level as follows for mysql.&lt;br /&gt;
&lt;br /&gt;
            # cd /etc/rc3.d&lt;br /&gt;
            # ln -s ../init.d/mysql S85mysql&lt;br /&gt;
            # ln -s ../init.d/mysql K85mysql&lt;br /&gt;
&lt;br /&gt;
            # cd /etc/rc5.d&lt;br /&gt;
            # ln -s ../init.d/mysql S85mysql&lt;br /&gt;
            # ln -s ../init.d/mysql K85mysql&lt;br /&gt;
&lt;br /&gt;
       Note that I could have chose other numbers as well. &amp;quot;ntsysv&amp;quot; gives&lt;br /&gt;
       you a graphical interface.&lt;br /&gt;
&lt;br /&gt;
       This is a way of doing this with &amp;quot;chkconfig&amp;quot; at the command prompt.&lt;br /&gt;
&lt;br /&gt;
            # chkconfig --list mysqld&lt;br /&gt;
            mysqld          0:off   1:off   2:off   3:on    4:off   5:on    6:off&lt;br /&gt;
&lt;br /&gt;
       Above you can see it's on. Here's how we would have turned this on with chkconfig.&lt;br /&gt;
&lt;br /&gt;
            # chkconfig --level 35 mysqld on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 109:&lt;br /&gt;
&lt;br /&gt;
       File Alteration Monitor - Gamin a FAM replacement&lt;br /&gt;
        http://www.gnome.org/~veillard/gamin/&lt;br /&gt;
        http://www.gnome.org/~veillard/gamin/sources/&lt;br /&gt;
       ******  EXAMPLE NOT COMPLETE *****&lt;br /&gt;
&lt;br /&gt;
       Working with fam  - file alteration monitor.  Mail uses this to signify&lt;br /&gt;
           a change in a file's status.&lt;br /&gt;
&lt;br /&gt;
        Below is the sample C program ftest.c which can be compiled as&lt;br /&gt;
        follows:&lt;br /&gt;
&lt;br /&gt;
              $ gcc -o ftest ftest.c  -lfam&lt;br /&gt;
&lt;br /&gt;
        You will need to work with this as root&lt;br /&gt;
&lt;br /&gt;
              #  ./ftest &amp;lt;somefile absolute path&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Reference:&lt;br /&gt;
            http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?db=man&amp;amp;fname=/usr/share/catman/p_man/cat3x/fam.z&lt;br /&gt;
            http://www.devchannel.org/devtoolschannel/04/05/13/2146252.shtml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 110:&lt;br /&gt;
&lt;br /&gt;
       glibc - this is the main library used by C, and the following&lt;br /&gt;
        link below gives you examples on everything from sockets,math,&lt;br /&gt;
        date and time functions, user environment, and much more.&lt;br /&gt;
&lt;br /&gt;
         http://www.gnu.org/software/libc/manual/html_mono/libc.html&lt;br /&gt;
&lt;br /&gt;
       How do you know which version of glibc you are running?&lt;br /&gt;
&lt;br /&gt;
          #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
          #include &amp;lt;gnu/libc-version.h&amp;gt;&lt;br /&gt;
          int main (void)&lt;br /&gt;
           {&lt;br /&gt;
             puts (gnu_get_libc_version ());&lt;br /&gt;
             return 0;&lt;br /&gt;
           }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 111:&lt;br /&gt;
&lt;br /&gt;
       nslookup and dig - query Internet name servers interactively.&lt;br /&gt;
&lt;br /&gt;
         $ nslookup&lt;br /&gt;
         &amp;gt;chirico.org&lt;br /&gt;
         Server:        68.80.0.6&lt;br /&gt;
         Address:       68.80.0.6#53&lt;br /&gt;
&lt;br /&gt;
         Name: chirico.org&lt;br /&gt;
         Address: 66.35.250.210&lt;br /&gt;
         &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      The nslookup command will query the dns server is &amp;quot;/etc/resolve.conf&amp;quot;&lt;br /&gt;
      However, you can force a certain dns with &amp;quot;- server&amp;quot;.  For example the&lt;br /&gt;
      command below goes to the server named dilbert&lt;br /&gt;
&lt;br /&gt;
         $ nslookup - dilbert&lt;br /&gt;
         &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      dig:&lt;br /&gt;
&lt;br /&gt;
      dig gives you more information. You should probably use dig instead&lt;br /&gt;
      of nslookup.&lt;br /&gt;
&lt;br /&gt;
      Below I am forcing the lookup from DNS 68.80.0.6 of the name chirico.org, and&lt;br /&gt;
      note that the query time is return too.&lt;br /&gt;
&lt;br /&gt;
         $ dig @68.80.0.6  +qr chirico.org&lt;br /&gt;
&lt;br /&gt;
         ; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.2.1 &amp;lt;&amp;lt;&amp;gt;&amp;gt; @68.80.0.6 +qr chirico.org&lt;br /&gt;
         ;; global options:  printcmd&lt;br /&gt;
         ;; Sending:&lt;br /&gt;
         ;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 55908&lt;br /&gt;
         ;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0&lt;br /&gt;
        &lt;br /&gt;
         ;; QUESTION SECTION:&lt;br /&gt;
         ;chirico.org.                   IN      A&lt;br /&gt;
        &lt;br /&gt;
         ;; Got answer:&lt;br /&gt;
         ;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 55908&lt;br /&gt;
         ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
        &lt;br /&gt;
         ;; QUESTION SECTION:&lt;br /&gt;
         ;chirico.org.                   IN      A&lt;br /&gt;
        &lt;br /&gt;
         ;; ANSWER SECTION:&lt;br /&gt;
         chirico.org.            5538    IN      A       66.35.250.210&lt;br /&gt;
        &lt;br /&gt;
         ;; AUTHORITY SECTION:&lt;br /&gt;
         chirico.org.            30599   IN      NS      ns78.worldnic.com.&lt;br /&gt;
         chirico.org.            30599   IN      NS      ns77.worldnic.com.&lt;br /&gt;
        &lt;br /&gt;
         ;; ADDITIONAL SECTION:&lt;br /&gt;
         ns78.worldnic.com.      16022   IN      A       216.168.225.218&lt;br /&gt;
         ns77.worldnic.com.      7       IN      A       216.168.228.41&lt;br /&gt;
        &lt;br /&gt;
         ;; Query time: 155 msec&lt;br /&gt;
         ;; SERVER: 68.80.0.6#53(68.80.0.6)&lt;br /&gt;
         ;; WHEN: Thu Dec 23 07:48:23 2004&lt;br /&gt;
         ;; MSG SIZE  rcvd: 127&lt;br /&gt;
&lt;br /&gt;
      So what if you wanted to know what name the IP address 66.35.250.210&lt;br /&gt;
      resolves to, when using dns 68.80.0.12.&lt;br /&gt;
&lt;br /&gt;
          $ dig @68.80.0.12 -x 66.35.250.210&lt;br /&gt;
          ...&lt;br /&gt;
          ;; ANSWER SECTION:&lt;br /&gt;
          210.250.35.66.in-addr.arpa. 3600 IN   CNAME   210.0/24.250.35.66.in-addr.arpa.&lt;br /&gt;
          210.0/24.250.35.66.in-addr.arpa. 3600 IN PTR  vhost.sourceforge.net.&lt;br /&gt;
&lt;br /&gt;
      Above you can see it resolved to &amp;quot;vhost.sourceforge.net&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      Reference ( http://www.tldp.org/HOWTO/DNS-HOWTO-5.html )&lt;br /&gt;
        Also see TIP 223.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 112:&lt;br /&gt;
&lt;br /&gt;
       Using GNU Autotools - so you can produce the familiar &amp;quot;./configure&amp;quot;  &amp;quot;make&amp;quot;  and &amp;quot;make install&amp;quot;&lt;br /&gt;
                             commands. There is also a &amp;quot;make dist&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                The program sqlite3api.cc and the rest of this code can be found at&lt;br /&gt;
                 http://prdownloads.sourceforge.net/cpearls/autotools.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         A &amp;quot;Makefile.am&amp;quot; is required:&lt;br /&gt;
&lt;br /&gt;
            bin_PROGRAMS = sprog&lt;br /&gt;
            sprog_SOURCES = sqlite3api.cc&lt;br /&gt;
            sprog_LDADD = @INCLUDES@ @SQLIBOBJS@&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         In addition, a &amp;quot;configure.in&amp;quot; file is required. Note, AC_CHECK_LIB will&lt;br /&gt;
         check the &amp;quot;libsqlite3.so&amp;quot; file for the &amp;quot;sqlite3_open&amp;quot; file. Note that&lt;br /&gt;
         &amp;quot;sqlite3&amp;quot;, is a shortcut for &amp;quot;libsqlite3&amp;quot; by convention. If this file&lt;br /&gt;
         is not found, AC_CHECK_FILE looks for &amp;quot;/usr/local/lib/libsqlite3.a&amp;quot;. If&lt;br /&gt;
         this is found, then, &amp;quot;-lsqlite3&amp;quot; is added to the LIBS environment variable.&lt;br /&gt;
         Also, &amp;quot;-I/usr/local/include&amp;quot; and &amp;quot;-L/usr/local/lib&amp;quot; will be added on the&lt;br /&gt;
         command line. This is common when some one does not have the library in&lt;br /&gt;
         the path.  (See TIP 49)&lt;br /&gt;
&lt;br /&gt;
            dnl Process this file with autoconf to produce a configure script.&lt;br /&gt;
            AC_INIT(sqlite3api.cc)&lt;br /&gt;
            AM_INIT_AUTOMAKE(sqliteprog, 1.0)&lt;br /&gt;
            AC_PROG_CXX&lt;br /&gt;
            CXXFLAGS='-Wall -W -O2 -s -pipe'&lt;br /&gt;
            AC_CHECK_LIB(sqlite3,sqlite3_open,[],found=no)&lt;br /&gt;
             if test &amp;quot;$found&amp;quot; = &amp;quot;no&amp;quot;; then&lt;br /&gt;
               AC_CHECK_FILE(/usr/local/lib/libsqlite3.a, found=yes)&lt;br /&gt;
               if test &amp;quot;$found&amp;quot; = &amp;quot;yes&amp;quot;; then&lt;br /&gt;
                 LIBS=&amp;quot;$LIBS -lsqlite3&amp;quot;&lt;br /&gt;
                 INCLUDES=&amp;quot;$INCLUDES -I/usr/local/include&amp;quot;&lt;br /&gt;
                 EXTRALIB='-L/usr/local/lib'&lt;br /&gt;
                else&lt;br /&gt;
                 echo &amp;quot;Are you SURE sqlite3 is installed?&amp;quot;&lt;br /&gt;
               fi&lt;br /&gt;
             fi&lt;br /&gt;
            SQLIBOBJS='-Wl,-R/usr/local/lib'&lt;br /&gt;
            AC_SUBST(INCLUDES)&lt;br /&gt;
            AC_SUBST(SQLIBOBJS)&lt;br /&gt;
            AC_SUBST(EXTRALIB)&lt;br /&gt;
            AC_OUTPUT(Makefile)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         To build the configure file, just run the following:&lt;br /&gt;
&lt;br /&gt;
             $ aclocal&lt;br /&gt;
             $ autoconf&lt;br /&gt;
             $ touch NEWS README AUTHORS ChangeLog&lt;br /&gt;
             $ automake --add-missing&lt;br /&gt;
&lt;br /&gt;
         Now if you want to make a tar.gz file &amp;quot;sqliteprog-1.0.tar.gz&amp;quot;, then&lt;br /&gt;
         all you have to run is the following:&lt;br /&gt;
&lt;br /&gt;
             $ make dist&lt;br /&gt;
&lt;br /&gt;
         Note: did you ever want to save all the output from a ./configure? Well, it&lt;br /&gt;
               is automatically saved in the &amp;quot;config.log&amp;quot; file. In fact, this file may&lt;br /&gt;
               contain a lot more than what you saw on the screen.&lt;br /&gt;
&lt;br /&gt;
               Also, you may need to rerun ./configure. But before you do, delete&lt;br /&gt;
               the &amp;quot;config.cache&amp;quot; file to get a clean build.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 113:&lt;br /&gt;
&lt;br /&gt;
       EMACS - common emacs commands.&lt;br /&gt;
&lt;br /&gt;
         M is the ESC&lt;br /&gt;
         C or c is the Ctl&lt;br /&gt;
&lt;br /&gt;
        Shell - when working in a shell. &amp;quot;M-x rename-uniquely&amp;quot; is good for split screen editing.&lt;br /&gt;
&lt;br /&gt;
          M-x rename-uniquely   Use this for multiple shells (renames buffer so it's not the same shell)&lt;br /&gt;
          C-c C-z               Send job in background (when working in a shell)&lt;br /&gt;
          C-c C-o               commit-kill-output (gets rid of a lot of shell output)&lt;br /&gt;
          C-c C-r               reposition at beginning of output&lt;br /&gt;
          C-c C-e               reposition at end of output&lt;br /&gt;
          M-x send-invisible    Hide passwords - use this before typing a password&lt;br /&gt;
&lt;br /&gt;
         Note: if the shell prompt does not show up correctly, then, you may want to creat a &amp;quot;.emacs_bash&amp;quot;&lt;br /&gt;
               file with the following contents:&lt;br /&gt;
&lt;br /&gt;
                          PS1=&amp;quot;emacs:\W \$ &amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Directories  (C-x d) give you a directory listing. You know all those annoying &amp;quot;~&amp;quot; and &amp;quot;#&amp;quot;&lt;br /&gt;
                     file that you get? You can easily delete these when in &amp;quot;dired&amp;quot; mode by hitting&lt;br /&gt;
                     &amp;quot;~&amp;quot;, then  &amp;quot;d&amp;quot; to flag it for delete. Then, hit &amp;quot;x&amp;quot; to and confirm deletion.&lt;br /&gt;
&lt;br /&gt;
                     These are other command that work on highlighted files in &amp;quot;dired&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
                          R   rename&lt;br /&gt;
                          v   view&lt;br /&gt;
                          Z   compress the file&lt;br /&gt;
                          +   create directory&lt;br /&gt;
&lt;br /&gt;
        Other common commands:&lt;br /&gt;
&lt;br /&gt;
          c-x l          list the line you are on, and how many lines in the document.&lt;br /&gt;
                         You will get something like: Page has 4881 lines (4440 + 442),&lt;br /&gt;
                         which means you are on the 4440 line.&lt;br /&gt;
&lt;br /&gt;
          c-x rm bookmark make&lt;br /&gt;
          c-x rb bookmark bounce&lt;br /&gt;
        &lt;br /&gt;
          c-x rb notes&lt;br /&gt;
          c-x rb emacs&lt;br /&gt;
        &lt;br /&gt;
          c-x / &amp;lt;r&amp;gt; (save position in register &amp;lt;r&amp;gt;)&lt;br /&gt;
          c-x j &amp;lt;r&amp;gt; (jump to position in register &amp;lt;r&amp;gt;)&lt;br /&gt;
          c-x r SPC 1 (mark current point in register 1)&lt;br /&gt;
          c-x r j 1 (jump to marked point in register 1)&lt;br /&gt;
          c-x r t &amp;lt;string&amp;gt;  (insert string into register)&lt;br /&gt;
        &lt;br /&gt;
          c-x r s 1 (save marked region in register 1)&lt;br /&gt;
          c-x r i 1 (insert marked region)&lt;br /&gt;
        &lt;br /&gt;
          c-x c-o (delete all blank lines, except one)&lt;br /&gt;
        &lt;br /&gt;
          c-x z (repeat the last command ... stop with an a)&lt;br /&gt;
          c-x zz (repeat the last command twice)&lt;br /&gt;
&lt;br /&gt;
          rectangle&lt;br /&gt;
          ---------&lt;br /&gt;
          C-SPC&lt;br /&gt;
          goto the next region&lt;br /&gt;
          C-x&lt;br /&gt;
          C-x&lt;br /&gt;
          then, C-x r r &amp;quot;name of register&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
          to insert the register&lt;br /&gt;
          C-x r i &amp;quot;name of register&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
          macros:&lt;br /&gt;
          -------&lt;br /&gt;
          c-x (    start macro&lt;br /&gt;
          c-x )    end macro&lt;br /&gt;
          c-x e    execute macro&lt;br /&gt;
        &lt;br /&gt;
          mail:&lt;br /&gt;
          -----&lt;br /&gt;
          c-x m   mail&lt;br /&gt;
          c-c c-s send&lt;br /&gt;
        &lt;br /&gt;
          C-x C-e&lt;br /&gt;
          (insert &amp;quot;\n\nExtra Line of text&amp;quot;)&lt;br /&gt;
        &lt;br /&gt;
          ;; chirico functions in .emacs&lt;br /&gt;
          ;; This creates an html template&lt;br /&gt;
          (defun my-html ()&lt;br /&gt;
          (interactive)&lt;br /&gt;
          (insert &amp;quot;&amp;lt;html&amp;gt;&lt;br /&gt;
          &amp;lt;head&amp;gt;&lt;br /&gt;
          &amp;lt;META HTTP-EQUIV=\&amp;quot;Pragma\&amp;quot; CONTENT=\&amp;quot;no-cache\&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;META HTTP-EQUIV=\&amp;quot;Expires\&amp;quot; CONTENT=\&amp;quot;-1\&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;/head&amp;gt;&lt;br /&gt;
          &amp;lt;body bgcolor=\&amp;quot;#ffffff\&amp;quot;&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
          &amp;lt;/body&amp;gt;&lt;br /&gt;
          &amp;lt;/html&amp;gt;&amp;quot;)&lt;br /&gt;
          )&lt;br /&gt;
&lt;br /&gt;
     Backspace issues when using &amp;quot;emacs -nw&amp;quot;? They putting the following in your &amp;quot;~/.emacs&amp;quot; file&lt;br /&gt;
&lt;br /&gt;
             (global-set-key &amp;quot;\C-d&amp;quot; 'backward-delete-char)&lt;br /&gt;
             (global-set-key &amp;quot;\C-h&amp;quot; 'backward-delete-char)&lt;br /&gt;
             (global-set-key (kbd &amp;quot;DEL&amp;quot;) 'delete-char)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 114:&lt;br /&gt;
&lt;br /&gt;
        ncftpget - an intelligent ftp client (http://www.ncftp.com/). Also&lt;br /&gt;
                   check your fedora or debian install. This package allows&lt;br /&gt;
                   you to easily download packages from ftp sites.&lt;br /&gt;
&lt;br /&gt;
          This is an example of connect to an ftp site, with a subdirectory, and&lt;br /&gt;
          downloading all in one command.&lt;br /&gt;
&lt;br /&gt;
           $ ncftpget ftp://ftp.gnu.org/pub/gnu/gcc/gcc-3.2.3/gcc-3.2.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
          Of if you want to get the fedora core 3 installs&lt;br /&gt;
&lt;br /&gt;
           $ ncftpget ftp://ftp.linux.ncsu.edu/pub/fedora/linux/core/3/i386/iso/FC3*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 115:&lt;br /&gt;
&lt;br /&gt;
        expr - evaluate expressions. You can use this on the command line&lt;br /&gt;
&lt;br /&gt;
           $ expr 6 + 4&lt;br /&gt;
           10&lt;br /&gt;
&lt;br /&gt;
         Note the spaces. Without spaces, you get the following:&lt;br /&gt;
&lt;br /&gt;
           $ expr 6+4&lt;br /&gt;
           6+4&lt;br /&gt;
&lt;br /&gt;
         If you're using &amp;quot;*&amp;quot;, you'll need a &amp;quot;\&amp;quot; before it&lt;br /&gt;
&lt;br /&gt;
           $ expr 10 \* 10&lt;br /&gt;
           100&lt;br /&gt;
&lt;br /&gt;
         This also works for variables&lt;br /&gt;
&lt;br /&gt;
           $ var1=34&lt;br /&gt;
           $ expr $var1 + 3&lt;br /&gt;
           37&lt;br /&gt;
&lt;br /&gt;
         or&lt;br /&gt;
&lt;br /&gt;
           $ var1=2&lt;br /&gt;
           $ var1=`expr $var1 \* 2`&lt;br /&gt;
           $ echo $var1&lt;br /&gt;
           4&lt;br /&gt;
&lt;br /&gt;
         see (TIP 25) you can get the cosine(.23)&lt;br /&gt;
&lt;br /&gt;
           $ var1=`echo &amp;quot;c(.23)&amp;quot;|bc -l`&lt;br /&gt;
           $ echo $var1&lt;br /&gt;
           .97366639500537483696&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         You can also do substrings:&lt;br /&gt;
&lt;br /&gt;
           $ expr substr &amp;quot;BigBear&amp;quot; 4 4&lt;br /&gt;
           Bear&lt;br /&gt;
&lt;br /&gt;
         And length of strings&lt;br /&gt;
&lt;br /&gt;
           $ mstr=&amp;quot;12345&amp;quot;&lt;br /&gt;
           $ expr length $mstr&lt;br /&gt;
           5&lt;br /&gt;
&lt;br /&gt;
         Regular expressions&lt;br /&gt;
&lt;br /&gt;
           $ expr &amp;quot;a3&amp;quot; : [a-z][1-9]&lt;br /&gt;
           2&lt;br /&gt;
&lt;br /&gt;
         Or you can get a bit fancy&lt;br /&gt;
&lt;br /&gt;
           $ myexpr=&amp;quot;[a-z][1-9]&amp;quot;&lt;br /&gt;
           $ echo $myexpr&lt;br /&gt;
           [a-z][1-9]&lt;br /&gt;
&lt;br /&gt;
           $ expr &amp;quot;a3&amp;quot; : $myexpr&lt;br /&gt;
           2&lt;br /&gt;
&lt;br /&gt;
         This may not be the best way to find out if it is Friday, but&lt;br /&gt;
         it seems to work. It's more of an exercise in xargs.&lt;br /&gt;
&lt;br /&gt;
           $ date&lt;br /&gt;
           Fri Dec 31 16:44:47 EST 2004&lt;br /&gt;
           $ date|xargs -i expr {} : &amp;quot;[Fri]&amp;quot;&lt;br /&gt;
           1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 116:&lt;br /&gt;
&lt;br /&gt;
        eval&lt;br /&gt;
&lt;br /&gt;
           $ mypipe=&amp;quot;|&amp;quot;&lt;br /&gt;
           $ eval ls $mypipe wc&lt;br /&gt;
           6       6     129&lt;br /&gt;
&lt;br /&gt;
        Did you catch that? The above statement is the same as&lt;br /&gt;
&lt;br /&gt;
           $ ls | wc&lt;br /&gt;
&lt;br /&gt;
        Where &amp;quot;|&amp;quot; is put into the variable $mypipe&lt;br /&gt;
&lt;br /&gt;
        (also see TIP 118)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 117:&lt;br /&gt;
&lt;br /&gt;
        lxr, glimpse, patchset - tools for reading the kernel source&lt;br /&gt;
&lt;br /&gt;
          This example puts some of the files in /home/src since my home&lt;br /&gt;
          partition is the largest. Plus, you do not want to over write&lt;br /&gt;
          the source in /usr/src/ If you want to put your files elsewhere&lt;br /&gt;
          just substitute /home/src for your desired directory.&lt;br /&gt;
&lt;br /&gt;
         patchset -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ export SRCDIR=/home/src&lt;br /&gt;
            $ cd $SRCDIR&lt;br /&gt;
            $ wget http://www.csn.ul.ie/~mel/projects/patchset/patchset-0.5.tar.gz&lt;br /&gt;
            $ export PATH=$PATH:$SRCDIR/patchset-0.5/bin&lt;br /&gt;
&lt;br /&gt;
          Now edit &amp;quot;/home/src/patchset-0.5/etc/patchset.conf&amp;quot; and set WWW_USER to&lt;br /&gt;
          whatever your website runs as&lt;br /&gt;
&lt;br /&gt;
                  export WWW_USER=nobody&lt;br /&gt;
&lt;br /&gt;
          Getting kernel source. The last step builds and asks a lot of questions. Enter&lt;br /&gt;
          yes to things that interest you, since this is what you will see in the source&lt;br /&gt;
          code. It is not going to build for booting. The &amp;quot;downlaod -p&amp;quot; is for downloading&lt;br /&gt;
          a patch.&lt;br /&gt;
&lt;br /&gt;
            $ download 2.6.10&lt;br /&gt;
            $ createset 2.6.10&lt;br /&gt;
            $ make-kernel -b 2.6.10&lt;br /&gt;
&lt;br /&gt;
        glimpse -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ mkdir -p /home/src/glimpse&lt;br /&gt;
            $ cd /home/src/glimpse&lt;br /&gt;
            $ wget http://webglimpse.net/trial/glimpse-latest.tar.gz&lt;br /&gt;
            $ tar -xzf glimpse-latest.tar.gz&lt;br /&gt;
            $ cd glimpse-4.18.0&lt;br /&gt;
            $ ./configure; make&lt;br /&gt;
            $ make install&lt;br /&gt;
&lt;br /&gt;
        lxr -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ make -p /home/src/lxr&lt;br /&gt;
            $ cd /home/src/lxr&lt;br /&gt;
            $ wget http://heanet.dl.sourceforge.net/sourceforge/lxr/lxr-0.3.1.tar.gz&lt;br /&gt;
            $ cd lxr-0.3&lt;br /&gt;
&lt;br /&gt;
          Edit &amp;quot;Makefile&amp;quot; and set PERLBIN to &amp;quot;/usr/bin/perl&amp;quot; or the where perl is&lt;br /&gt;
          on your system. Also set INSTALLPREFIX to &amp;quot;/var/www/lxr&amp;quot;.  Then, as root&lt;br /&gt;
          do the following:&lt;br /&gt;
&lt;br /&gt;
            $ make install&lt;br /&gt;
&lt;br /&gt;
         Apache changes&lt;br /&gt;
&lt;br /&gt;
          Next edit the apache httpd.conf. On my system it is&lt;br /&gt;
          &amp;quot;/usr/local/apache2/conf/httpd.conf&amp;quot;, but if you did a fedora install&lt;br /&gt;
          I think this file is located at &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             Alias  /lxr/ &amp;quot;/var/www/lxr/&amp;quot;&lt;br /&gt;
             &amp;lt;Directory &amp;quot;/var/www/lxr/&amp;quot;&amp;gt;&lt;br /&gt;
               Options ExecCGI Indexes Includes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride all&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
&lt;br /&gt;
              &amp;lt;Files ~ (search|source|ident|diff|find)&amp;gt;&lt;br /&gt;
                    SetHandler cgi-script&lt;br /&gt;
              &amp;lt;/Files&amp;gt;&lt;br /&gt;
             &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          lxr - continued &amp;quot;/var/www/lxr/http/lxr.conf&amp;quot; changes.  The following contains&lt;br /&gt;
                my lxr.conf with changes made to almost every variable. Make sure you use&lt;br /&gt;
                your website in place of 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
                 # Configuration file.&lt;br /&gt;
                &lt;br /&gt;
                 # Define typed variable &amp;quot;v&amp;quot;, read valueset from file.&lt;br /&gt;
                 variable: v, Version, [/var/www/lxr/source/versions], [/var/www/lxr/source/defversion]&lt;br /&gt;
                &lt;br /&gt;
                 # Define typed variable &amp;quot;a&amp;quot;.  First value is default.&lt;br /&gt;
                 variable: a, Architecture, (i386, alpha, m68k, mips, ppc, sparc, sparc64)&lt;br /&gt;
                &lt;br /&gt;
                 # Define the base url for the LXR files.&lt;br /&gt;
                 baseurl: http://192.168.1.71/lxr/http/&lt;br /&gt;
                &lt;br /&gt;
                 # These are the templates for the HTML heading, directory listing and&lt;br /&gt;
                 # footer, respectively.&lt;br /&gt;
                 htmlhead: /var/www/lxr/http/template-head&lt;br /&gt;
                 htmltail: /var/www/lxr/http/template-tail&lt;br /&gt;
                 htmldir:  /var/www/lxr/http/template-dir&lt;br /&gt;
                &lt;br /&gt;
                 # The source is here.&lt;br /&gt;
                 sourceroot: /var/www/lxr/source/$v/&lt;br /&gt;
                 srcrootname: Linux&lt;br /&gt;
                &lt;br /&gt;
                 # &amp;quot;#include &amp;lt;foo.h&amp;gt;&amp;quot; is mapped to this directory (in the LXR source&lt;br /&gt;
                 # tree)&lt;br /&gt;
                 incprefix: /include&lt;br /&gt;
                &lt;br /&gt;
                 # The database files go here.&lt;br /&gt;
                 dbdir: /var/www/lxr/source/$v/&lt;br /&gt;
                &lt;br /&gt;
                 # Glimpse can be found here.&lt;br /&gt;
                 glimpsebin: /usr/local/bin/glimpse&lt;br /&gt;
                &lt;br /&gt;
                 # The power of regexps.  This is pretty Linux-specific, but quite&lt;br /&gt;
                 # useful.  Tinker with it and see what it does.  (How's that for&lt;br /&gt;
                 # documentation?)&lt;br /&gt;
                 map: /include/asm[^\/]*/ /include/asm-$a/&lt;br /&gt;
                 map: /arch/[^\/]+/ /arch/$a/&lt;br /&gt;
&lt;br /&gt;
         Now you should be ready to run &amp;quot;make-lxr&amp;quot;. Make sure the path is setup to patchset,&lt;br /&gt;
         which is repeated here. The last step take awhile.&lt;br /&gt;
&lt;br /&gt;
            $ export SRCDIR=/home/src&lt;br /&gt;
            $ cd $SRCDIR&lt;br /&gt;
            $ export PATH=$PATH:$SRCDIR/patchset-0.5/bin&lt;br /&gt;
&lt;br /&gt;
            $  make-lxr 2.6.10&lt;br /&gt;
&lt;br /&gt;
         Now you need to index the source. Below the ./glimpse_* file will be put in&lt;br /&gt;
         root. Checkout the -H option if you do not want them here on a temporary&lt;br /&gt;
         bases of if you run out of room.&lt;br /&gt;
&lt;br /&gt;
            $ glimpseindex -o -t -w 5000 /var/www/lxr/source/2.6.10 &amp;gt;&amp;amp; .glimpse_out&lt;br /&gt;
&lt;br /&gt;
         Since the above put the files under /root/.glimpse_* they should be moved&lt;br /&gt;
&lt;br /&gt;
            $ mv /root/.glimps_* /var/www/lxr/source/2.6.10/.&lt;br /&gt;
            $ chown -R nobody.nobody ./.glimpse_*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 118:&lt;br /&gt;
&lt;br /&gt;
        exec - you can change standard output and input without starting a new&lt;br /&gt;
               process.&lt;br /&gt;
&lt;br /&gt;
          The exec redirect the output from ls and date to a file. Nothing&lt;br /&gt;
          is show on the terminal until &amp;quot;exec &amp;gt; /dev/tty&amp;quot; is performed&lt;br /&gt;
&lt;br /&gt;
            $ exec &amp;gt; mfile&lt;br /&gt;
            $ ls&lt;br /&gt;
            $ date&lt;br /&gt;
            $ exec &amp;gt; /dev/tty&lt;br /&gt;
&lt;br /&gt;
          This is an example of assigning file descriptor 3 to file &amp;quot;output3&amp;quot; for&lt;br /&gt;
          output, then, redirecting &amp;quot;ls&amp;quot; to this descriptor. Finally, file descriptor&lt;br /&gt;
          3 is used for input, and the contents are read into the cat command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
            $ exec 3&amp;gt;output3&lt;br /&gt;
            $ ls  &amp;gt;&amp;amp; 3&lt;br /&gt;
            $ exec 3&amp;lt;output3&lt;br /&gt;
            $ cat &amp;lt;&amp;amp;3&lt;br /&gt;
            ChangeLog&lt;br /&gt;
            CVS&lt;br /&gt;
            How_to_Linux_and_Open_Source.txt&lt;br /&gt;
            How_to_Linux_and_Open_Source.txt.~1.193.~&lt;br /&gt;
            mfile&lt;br /&gt;
            mfile2&lt;br /&gt;
            mfile3&lt;br /&gt;
            mftp&lt;br /&gt;
            output3&lt;br /&gt;
&lt;br /&gt;
        Could you redirect the output to 3 files and stderr?&lt;br /&gt;
&lt;br /&gt;
            $ exec 3&amp;gt;output3&lt;br /&gt;
            $ exec 4&amp;gt;output4&lt;br /&gt;
            $ exec 5&amp;gt;output5&lt;br /&gt;
&lt;br /&gt;
            $ ls &amp;gt;&amp;amp; 3 &amp;gt;&amp;amp; 4 &amp;gt;&amp;amp; 5 &amp;gt;&amp;amp; 2   // Nope, can't do this.&lt;br /&gt;
            output3  output4  output5&lt;br /&gt;
&lt;br /&gt;
         Instead, you should do the following:&lt;br /&gt;
&lt;br /&gt;
            $ ls | tee output3 | tee output4 |tee output5&lt;br /&gt;
&lt;br /&gt;
         Closing the &amp;quot;output&amp;quot; file descriptor&lt;br /&gt;
&lt;br /&gt;
            $ &amp;gt;&amp;amp;3-&lt;br /&gt;
&lt;br /&gt;
         Closing the &amp;quot;input&amp;quot; file descriptor&lt;br /&gt;
&lt;br /&gt;
            $ 3&amp;lt;&amp;amp;-&lt;br /&gt;
&lt;br /&gt;
         See what is still open on 0-10&lt;br /&gt;
&lt;br /&gt;
            $ lsof -a -p $$ -d 0-10&lt;br /&gt;
&lt;br /&gt;
         Recursion - the following counts to 5, then, quits.&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
            sleep 1&lt;br /&gt;
            declare -x n&lt;br /&gt;
            let n=${n:=0}+1&lt;br /&gt;
            [ $n -le 5 ] &amp;amp;&amp;amp; echo &amp;quot;$n&amp;quot; &amp;amp;&amp;amp;  exec $0&lt;br /&gt;
&lt;br /&gt;
         There are some real-life applications for this technique, as follows:&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
            declare -x N&lt;br /&gt;
            declare -x n&lt;br /&gt;
            N=${N:=$(od -vAn -N1 -tu4 &amp;lt; /dev/urandom)}&lt;br /&gt;
            let n=${n:=0}+1&lt;br /&gt;
            [ $(($n%2)) -eq 0 ] &amp;amp;&amp;amp; echo &amp;quot;She Loves Me!&amp;quot; || echo &amp;quot;She Loves Me NOT!&amp;quot;&lt;br /&gt;
            [ $n -lt $N ] &amp;amp;&amp;amp;  exec $0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 119:&lt;br /&gt;
&lt;br /&gt;
        runlevel - need to know the current runlevel?&lt;br /&gt;
&lt;br /&gt;
           $ who -r&lt;br /&gt;
           run-level 3  Dec 31 19:02                   last=S&lt;br /&gt;
&lt;br /&gt;
        Need to know the architecture?&lt;br /&gt;
&lt;br /&gt;
          $ arch&lt;br /&gt;
          i686&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 120:&lt;br /&gt;
&lt;br /&gt;
        at - executes commands at a specified time.&lt;br /&gt;
&lt;br /&gt;
         A few examples here. The 1970 program will run&lt;br /&gt;
         next Auguest 2 even though the year 1970 has long past.&lt;br /&gt;
&lt;br /&gt;
          $ at 6:30am Jan 12 &amp;lt; program&lt;br /&gt;
          $ at noon tomorrow &amp;lt; program&lt;br /&gt;
          $ at 1970 pm August 2 &amp;lt; program&lt;br /&gt;
&lt;br /&gt;
        This is an interactive way to use the command:&lt;br /&gt;
&lt;br /&gt;
          $ at now + 6 minutes&lt;br /&gt;
          warning: commands will be executed using (in order) a) $SHELL b) login shell c) /bin/sh&lt;br /&gt;
          at&amp;gt; ls&lt;br /&gt;
          at&amp;gt; date &amp;gt; /tmp/5min&lt;br /&gt;
          at&amp;gt; ^D&lt;br /&gt;
          job 3 at 2005-01-01 08:50&lt;br /&gt;
&lt;br /&gt;
        What jobs are in the queue?&lt;br /&gt;
&lt;br /&gt;
          $ atq&lt;br /&gt;
&lt;br /&gt;
        or&lt;br /&gt;
&lt;br /&gt;
          $ at -l&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 121:&lt;br /&gt;
&lt;br /&gt;
        Creating a Manpage&lt;br /&gt;
&lt;br /&gt;
         As root you can copy the following to /usr/local/man/man1/soup.1 which will&lt;br /&gt;
         give you a manpage for soup.&lt;br /&gt;
&lt;br /&gt;
              .\&amp;quot; Manpage for souptonuts.&lt;br /&gt;
              .\&amp;quot; Contact mchirico@users.sourceforge.com to correct errors or omissions.&lt;br /&gt;
              .TH man 1 &amp;quot;04 January 2005&amp;quot; &amp;quot;1.0&amp;quot; &amp;quot;souptonuts man page&amp;quot;&lt;br /&gt;
              .SH NAME&lt;br /&gt;
              soup \- man page for souptonuts&lt;br /&gt;
              .SH SYNOPSIS&lt;br /&gt;
              soup&lt;br /&gt;
              .SH DESCRIPTION&lt;br /&gt;
              souptonuts is a collection of linux and open&lt;br /&gt;
              source tips.&lt;br /&gt;
              off for golf.&lt;br /&gt;
              .SH OPTIONS&lt;br /&gt;
              The souptonuts does not take any options.&lt;br /&gt;
              .SH SEE ALSO&lt;br /&gt;
              doughnut(1), golf(8)&lt;br /&gt;
              .SH BUGS&lt;br /&gt;
              No known bugs at this time.&lt;br /&gt;
              .SH AUTHOR&lt;br /&gt;
              Mike Chirico (mchirico@comcast.net mchirico@users.sourceforge.net)&lt;br /&gt;
&lt;br /&gt;
         So, to view this man page&lt;br /&gt;
&lt;br /&gt;
            $ man soup&lt;br /&gt;
&lt;br /&gt;
         It's also possible to compress&lt;br /&gt;
&lt;br /&gt;
            $ gzip /usr/local/man/man1/soup.1&lt;br /&gt;
&lt;br /&gt;
         For plenty of examples look at the other man pages. Also the following&lt;br /&gt;
         is helpful. The last one is a tutorial &amp;quot;man 7 mdoc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            $ man manpath&lt;br /&gt;
            $ man groff&lt;br /&gt;
            $ man 7 mdoc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 122:&lt;br /&gt;
&lt;br /&gt;
        dmesg - print out boot messages, or what is in the kernel ring buffer.&lt;br /&gt;
&lt;br /&gt;
          If you missed the messages on boot-up, you can use dmesg to print them.&lt;br /&gt;
&lt;br /&gt;
            $ dmesg &amp;gt; boot.msg&lt;br /&gt;
&lt;br /&gt;
          Or to print, then, clear the ring&lt;br /&gt;
&lt;br /&gt;
            # dmesg -c &amp;gt; boot.msg&lt;br /&gt;
&lt;br /&gt;
          (also see TIP 20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 123:&lt;br /&gt;
&lt;br /&gt;
        gnus - emacs email nntp news reader (comcast as example with NO TLS or SSL)&lt;br /&gt;
&lt;br /&gt;
          First check that you can connect to the news group:&lt;br /&gt;
&lt;br /&gt;
                 $ telnet newsgroups.comcast.net 119&lt;br /&gt;
                 Trying 216.196.97.136...&lt;br /&gt;
                 Connected to newsgroups.comcast.net.&lt;br /&gt;
                 Escape character is '^]'.&lt;br /&gt;
                 200 News.GigaNews.Com&lt;br /&gt;
&lt;br /&gt;
          If you want to check for TLS or SSL see (TIP 54).&lt;br /&gt;
&lt;br /&gt;
          Here is a very simple configuration example without encryption. It&lt;br /&gt;
          appears that comcast does not support ssl or TLS.&lt;br /&gt;
&lt;br /&gt;
          In the &amp;quot;~/.emacs&amp;quot; file you would add the following to get comcast&lt;br /&gt;
          news groups&lt;br /&gt;
&lt;br /&gt;
             (setq gnus-select-method '(nntp &amp;quot;newsgroups.comcast.net&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
          Then, create an &amp;quot;~/.authinfo&amp;quot; file with the following settings using&lt;br /&gt;
          you own username and password.&lt;br /&gt;
&lt;br /&gt;
             machine newsgroups.comcast.net login borkey@comcast.net  password borkeypass0rd&lt;br /&gt;
&lt;br /&gt;
          Next create a &amp;quot;~/.newsrc&amp;quot; with your groups&lt;br /&gt;
&lt;br /&gt;
             news.announce.newusers:&lt;br /&gt;
             comp.lang.c++.moderated! 1-500&lt;br /&gt;
             comp.unix.programmer! 1-500&lt;br /&gt;
             comp.unix.shell! 1-500&lt;br /&gt;
             gnu.emacs.gnus! 1-500&lt;br /&gt;
&lt;br /&gt;
          Finally, create a &amp;quot;~/.gnus&amp;quot; with the following email settings for you&lt;br /&gt;
&lt;br /&gt;
             (setq user-mail-address &amp;quot;mchirico@comcast.net&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
             (defun my-message-mode-setup ()&lt;br /&gt;
               (setq fill-column 72)&lt;br /&gt;
               (turn-on-auto-fill))&lt;br /&gt;
               (add-hook 'message-mode-hook 'my-message-mode-setup)&lt;br /&gt;
&lt;br /&gt;
          To get into gnus&lt;br /&gt;
&lt;br /&gt;
              E-x gnus&lt;br /&gt;
&lt;br /&gt;
          The following are common gnus commands&lt;br /&gt;
&lt;br /&gt;
                RET  view the article under the cursor&lt;br /&gt;
&lt;br /&gt;
                A A (shift-a, shift a): List all newsgroups known&lt;br /&gt;
                                        to the server.&lt;br /&gt;
&lt;br /&gt;
                l (lower-case L)      : List only  subscribed groups&lt;br /&gt;
                                        with unread articles.&lt;br /&gt;
&lt;br /&gt;
                L                     : List all newsgroups in .newsrc file.&lt;br /&gt;
&lt;br /&gt;
                g                     : See if new articles have arrived.&lt;br /&gt;
&lt;br /&gt;
            Some commands for reading&lt;br /&gt;
&lt;br /&gt;
                n  next unread article&lt;br /&gt;
&lt;br /&gt;
                p  previous article&lt;br /&gt;
&lt;br /&gt;
                SPC  scroll down  moves to next unread&lt;br /&gt;
                     when at the bottom of the article&lt;br /&gt;
&lt;br /&gt;
                del  scroll up&lt;br /&gt;
&lt;br /&gt;
                F  follow-up to group on the article you are&lt;br /&gt;
                   reading now.&lt;br /&gt;
&lt;br /&gt;
                f  follow-up to group without citing the article&lt;br /&gt;
&lt;br /&gt;
                R  reply by mail and cite the article&lt;br /&gt;
&lt;br /&gt;
                r  reply by mail without citing the article&lt;br /&gt;
&lt;br /&gt;
                m  new mail&lt;br /&gt;
&lt;br /&gt;
                a  new posting&lt;br /&gt;
&lt;br /&gt;
                c  Catchup&lt;br /&gt;
&lt;br /&gt;
                C-u / t  Show only young headers&lt;br /&gt;
                         / t without C-u limits the summary&lt;br /&gt;
                         to old headers&lt;br /&gt;
&lt;br /&gt;
                T T  toggle threading&lt;br /&gt;
&lt;br /&gt;
                C-u g  Display raw article&lt;br /&gt;
                       hit g to return to normal view&lt;br /&gt;
&lt;br /&gt;
                t  Show all headers  it's a toggle&lt;br /&gt;
&lt;br /&gt;
                W w  Wordwrap the current article&lt;br /&gt;
&lt;br /&gt;
                W r  Decode ROT13  a toggle&lt;br /&gt;
&lt;br /&gt;
                ^  fetch parent of article&lt;br /&gt;
&lt;br /&gt;
                L  create a scorefile-entry based&lt;br /&gt;
                   on the current article (low score)&lt;br /&gt;
                   ? gives you information what each char means&lt;br /&gt;
&lt;br /&gt;
                I  like L but high score&lt;br /&gt;
&lt;br /&gt;
          Commands to send email&lt;br /&gt;
&lt;br /&gt;
            C-c C-c  send message&lt;br /&gt;
&lt;br /&gt;
            C-c C-d  save message as draft&lt;br /&gt;
&lt;br /&gt;
            C-c C-k  kill message&lt;br /&gt;
&lt;br /&gt;
            C-c C-m f  attach file&lt;br /&gt;
&lt;br /&gt;
            M-q  reformat paragraph&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 124:&lt;br /&gt;
&lt;br /&gt;
        Sending Email from telnet&lt;br /&gt;
&lt;br /&gt;
           Note, if you are on the computer you can sometime use the local loopback.&lt;br /&gt;
           In fact, sometimes you can only use the local loop back 127.0.0.1 in&lt;br /&gt;
           place of &amp;quot;bozo.company.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            1     [mchirico@soup Notes]$ telnet bozo.company.com 25&lt;br /&gt;
            2     Trying 192.168.0.204...&lt;br /&gt;
            3     Connected to bozo.company.com.&lt;br /&gt;
            4     Escape character is '^]'.&lt;br /&gt;
            5     220 bozo.company.com ESMTP Postfix (Postfix-20010228-pl03) (Mandrake Linux)&lt;br /&gt;
            6     HELO fakedomain.com&lt;br /&gt;
            7     HELO fakedomain.com         // server echo&lt;br /&gt;
            8     250 bozo.company.com&lt;br /&gt;
            9     MAIL FROM: test@fakedomain.com&lt;br /&gt;
           10     MAIL FROM: test@fakedomain.com   // server echo&lt;br /&gt;
           11     250 Ok&lt;br /&gt;
           12     RCPT TO: mchirico@someother.com&lt;br /&gt;
           13     RCPT TO: mchirico@someother.com   // server echo&lt;br /&gt;
           14     250 Ok&lt;br /&gt;
           15     DATA&lt;br /&gt;
           16     DATA    // echo&lt;br /&gt;
           17     354 Enter mail, end with &amp;quot;.&amp;quot; on a line by itself&lt;br /&gt;
           18     This is a test message&lt;br /&gt;
           19     This is a test message&lt;br /&gt;
           20     to send&lt;br /&gt;
           21     to send&lt;br /&gt;
           22     .&lt;br /&gt;
           23     250 2.0.0 j0B0uH3L018469 Message accepted for delivery&lt;br /&gt;
&lt;br /&gt;
          Above on line 6 you can type in any domain name. Line 7 is an echo. All&lt;br /&gt;
          echos are listed in the comment field.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 125:&lt;br /&gt;
&lt;br /&gt;
          IP forwarding, IP Masquerade&lt;br /&gt;
&lt;br /&gt;
             # echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
             # ipchains -F forward&lt;br /&gt;
             # ipchains -P forward DENY&lt;br /&gt;
             # ipchains -A forward -s 192.168.0.0/24 -j MASQ&lt;br /&gt;
             # ipchains -A forward -i eth1 -j MASQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          This assumes that your internal network is 192.168.0.0 on eth1, and the&lt;br /&gt;
          internet is connected to eth0.&lt;br /&gt;
&lt;br /&gt;
          (Also See TIP 182)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 126:&lt;br /&gt;
&lt;br /&gt;
         Setting KDE as the default desktop manager&lt;br /&gt;
&lt;br /&gt;
               Edit &amp;quot;/etc/sysconfig/desktop&amp;quot; to include the two lines:&lt;br /&gt;
&lt;br /&gt;
                 DESKTOP=&amp;quot;KDE&amp;quot;&lt;br /&gt;
                 DISPLAYMANAGER=&amp;quot;KDE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 127:&lt;br /&gt;
&lt;br /&gt;
        Have a file and you do not know whay type it is (tar, gz, ASCII, binary) ?&lt;br /&gt;
        Use the file command.  Below it is used on the file &amp;quot;mftp&amp;quot;&lt;br /&gt;
&lt;br /&gt;
               $ file mftp&lt;br /&gt;
               mftp: Bourne-Again shell script text executable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 128:&lt;br /&gt;
&lt;br /&gt;
        Software RAID: Two good references&lt;br /&gt;
&lt;br /&gt;
          http://www.tldp.org/HOWTO/Software-RAID-HOWTO-1.html&lt;br /&gt;
          http://lists.us.dell.com/pipermail/linux-poweredge/2003-July/014331.html&lt;br /&gt;
&lt;br /&gt;
        Note, you must setup grub for each RAID 1 device. Suppose you have&lt;br /&gt;
        2 SCSI drives (sda and sdb). By default grub is setup on sda; but, you&lt;br /&gt;
        need to enable it for sdb (/dev/hdb for ide) as follows:&lt;br /&gt;
&lt;br /&gt;
           grub&amp;gt;device (hd0) /dev/sdb&lt;br /&gt;
           grub&amp;gt;root (hd0,0)&lt;br /&gt;
           grub&amp;gt;setup (hd0)&lt;br /&gt;
&lt;br /&gt;
           Checking if &amp;quot;/boot/grub/stage1&amp;quot; exists... no&lt;br /&gt;
           Checking if &amp;quot;/grub/stage1&amp;quot; exists... yes&lt;br /&gt;
           Checking if &amp;quot;/grub/stage2&amp;quot; exists... yes&lt;br /&gt;
           Checking if &amp;quot;/grub/e2fs_stage1_5&amp;quot; exists.. yes&lt;br /&gt;
           Running &amp;quot;embed /grub/e2fs_stage1_5 (hd0)&amp;quot;... 16 sectors are embedded.&lt;br /&gt;
          succeeded&lt;br /&gt;
           Running &amp;quot;install /grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/grub/stage2 /grub/grub&lt;br /&gt;
         .conf&amp;quot;... succeeded.&lt;br /&gt;
         Done.&lt;br /&gt;
&lt;br /&gt;
          grub&amp;gt;&lt;br /&gt;
          grub&amp;gt;quit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Checking to see if everything is working:&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
        Checking the drives&lt;br /&gt;
&lt;br /&gt;
          $ sfdisk -d /dev/sdb&lt;br /&gt;
          $ sfdisk -d /dev/sda&lt;br /&gt;
&lt;br /&gt;
          $ fdisk -l /dev/sda  &amp;quot;This will give general information&amp;quot;&lt;br /&gt;
          $ fdisk -l           &amp;quot;General information for all drives&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Adding raid (assume you want to add the first drive &amp;quot;sda1&amp;quot;, or if it is the second&lt;br /&gt;
                    drive then substitute &amp;quot;sda2&amp;quot; below )&lt;br /&gt;
&lt;br /&gt;
          $ raidhotadd /dev/md0 /dev/sda1&lt;br /&gt;
          $ raidhotadd /dev/md1 /dev/sda2&lt;br /&gt;
          $ raidhotadd /dev/md2 /dev/sda3&lt;br /&gt;
&lt;br /&gt;
        This is an example of an cat /proc/mdstat that is working. Note that&lt;br /&gt;
        there is a listing for both sda1[0] and sdb1[1]&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
                Personalities : [raid1]&lt;br /&gt;
                read_ahead 1024 sectors&lt;br /&gt;
                Event: 12&lt;br /&gt;
                md0 : active raid1 sda1[0] sdb1[1]&lt;br /&gt;
                      104320 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md1 : active raid1 sda2[0] sdb2[1]&lt;br /&gt;
                      1044160 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md2 : active raid1 sda3[0] sdb3[1]&lt;br /&gt;
                      34411136 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        Compare that to this where md2 is missing sdb3&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
                Personalities : [raid1]&lt;br /&gt;
                read_ahead 1024 sectors&lt;br /&gt;
                Event: 9&lt;br /&gt;
                md0 : active raid1 sda1[0] sdb1[1]&lt;br /&gt;
                      104320 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md1 : active raid1 sda2[0] sdb2[1]&lt;br /&gt;
                      1044160 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md2 : active raid1 sdb3[1]        &amp;lt;---- HERE&lt;br /&gt;
                      34411136 blocks [2/1] [_U]&lt;br /&gt;
&lt;br /&gt;
                unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        If you are rebuilding an array, you can watch it by doing the following:&lt;br /&gt;
&lt;br /&gt;
           $ watch -n1 cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
        Need to know the raid setup?&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/raidtab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 129:&lt;br /&gt;
&lt;br /&gt;
        Resetting Redhat Linux Passwords using GRUB&lt;br /&gt;
&lt;br /&gt;
           1. Press 'e'&lt;br /&gt;
           2. Press 'e' again&lt;br /&gt;
           3. Append 'single' to the kernel version listing&lt;br /&gt;
&lt;br /&gt;
          See&lt;br /&gt;
             http://linuxgazette.net/107/tomar.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 130:&lt;br /&gt;
&lt;br /&gt;
        mtr - matt's traceroute. This is an advanced traceroute that keeps&lt;br /&gt;
              [http://www.bitwizard.nl/mtr/]&lt;br /&gt;
                  $ mtr www.yahoo.com&lt;br /&gt;
&lt;br /&gt;
                                              Matt's traceroute  [v0.52]&lt;br /&gt;
                     third-fl-71.localdomain                            Thu Jan 20 11:05:57 2005&lt;br /&gt;
                     Keys:  D - Display mode    R - Restart statistics    Q - Quit&lt;br /&gt;
                                                            Packets               Pings&lt;br /&gt;
                     Hostname                            %Loss  Rcv  Snt  Last Best  Avg  Worst&lt;br /&gt;
                      1. 192.168.1.1                        0%    3    3     0    0    0      1&lt;br /&gt;
                      2. ???&lt;br /&gt;
                      3. fe-2-6-rr01.willogrove5.pa.pa01    0%    3    3     8    7    7      8&lt;br /&gt;
                      4. srp-8-1-ar01.willowgrove1.pa.pa    0%    2    2     8    8    8      8&lt;br /&gt;
                      5. pos7-3-cr01.torresdale.pa.core.    0%    2    2     8    8    8      8&lt;br /&gt;
                      6. 12.119.53.53                       0%    2    2    12   12   12     13&lt;br /&gt;
                      7. tbr1-p012401.phlpa.ip.att.net      0%    2    2    12   12   13     13&lt;br /&gt;
                      8. tbr1-cl8.n54ny.ip.att.net          0%    2    2    13   13   13     13&lt;br /&gt;
                      9. ggr2-p310.n54ny.ip.att.net         0%    2    2    12   12   13     14&lt;br /&gt;
                     10. so-1-0-0.gar4.NewYork1.Level3.n    0%    2    2    14   14   37     61&lt;br /&gt;
                     11. ae-1-54.bbr2.NewYork1.Level3.ne    0%    2    2    13   12   13     13&lt;br /&gt;
                     12. ge-0-3-0.bbr2.Washington1.Level    0%    2    2    19   19   19     19&lt;br /&gt;
                     13. ge-1-1-51.car1.Washington1.Leve    0%    2    2    18   18   19     20&lt;br /&gt;
                     14. 4.79.228.6                         0%    2    2    21   19   20     21&lt;br /&gt;
                     15. UNKNOWN-216-109-120-201.yahoo.c    0%    2    2    21   20   20     21&lt;br /&gt;
                     16. w2.rc.vip.dcn.yahoo.com            0%    2    2    23   21   22     23&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 131:&lt;br /&gt;
&lt;br /&gt;
        chfn - change finger information&lt;br /&gt;
&lt;br /&gt;
            $ chfn&lt;br /&gt;
&lt;br /&gt;
          Next you are asked for a password and user information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 132:&lt;br /&gt;
&lt;br /&gt;
        chsh - change login shell&lt;br /&gt;
&lt;br /&gt;
          First, you may want to get a listing of all the possible&lt;br /&gt;
          shells.&lt;br /&gt;
&lt;br /&gt;
             $ chsh -l&lt;br /&gt;
&lt;br /&gt;
               /bin/sh&lt;br /&gt;
               /bin/bash&lt;br /&gt;
               /sbin/nologin&lt;br /&gt;
               /bin/ash&lt;br /&gt;
               /bin/bsh&lt;br /&gt;
               /bin/ksh&lt;br /&gt;
               /usr/bin/ksh&lt;br /&gt;
               /usr/bin/pdksh&lt;br /&gt;
               /bin/tcsh&lt;br /&gt;
               /bin/csh&lt;br /&gt;
               /bin/zsh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 133:&lt;br /&gt;
&lt;br /&gt;
        bash - working with binary, hex and base 3.&lt;br /&gt;
&lt;br /&gt;
         For the variable must be declare as an integer. Then&lt;br /&gt;
         specify the  &amp;lt;base&amp;gt;#&amp;lt;value&amp;gt;. The example below is 22 in&lt;br /&gt;
         base 3.&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n&lt;br /&gt;
              $ n=3#22&lt;br /&gt;
              $ echo $n&lt;br /&gt;
                8&lt;br /&gt;
&lt;br /&gt;
           Base 16 (hex)&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n2&lt;br /&gt;
              $ n2=16#a&lt;br /&gt;
              $ echo $n2&lt;br /&gt;
                10&lt;br /&gt;
&lt;br /&gt;
           Base 8 (octal)&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n3&lt;br /&gt;
              $ n3=8#11&lt;br /&gt;
              $ echo $n3&lt;br /&gt;
                9   Note 8+1=9&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 134:&lt;br /&gt;
&lt;br /&gt;
        monitoring IP traffic. Try iptraf http://iptraf.seul.org/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 135:&lt;br /&gt;
&lt;br /&gt;
        enscript - convert text files to PostScript&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 136:&lt;br /&gt;
&lt;br /&gt;
        dd and tar - blocking factor. How to determine the blocking factor, block size&lt;br /&gt;
                   so that tar and dd can work together.&lt;br /&gt;
&lt;br /&gt;
        Step 1: Create a large file on local disk, in a directory &amp;quot;1&amp;quot; that will eventually&lt;br /&gt;
                be written to tape. This will be created with dd as follows:&lt;br /&gt;
&lt;br /&gt;
                $ mkdir 1&lt;br /&gt;
                $ dd if=/dev/zero of=disk-image count=40960&lt;br /&gt;
                  40960+0 records in&lt;br /&gt;
                  40960+0 records out&lt;br /&gt;
&lt;br /&gt;
                $ cd ..&lt;br /&gt;
&lt;br /&gt;
        Step 2: tar the directory and contents to tape. First rewind the tape. These examples&lt;br /&gt;
                use /dev/nst0 as the location of the tape. Make sure to substitute your values&lt;br /&gt;
                if needed.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ tar --label=&amp;quot;Test 1&amp;quot; --create --blocking-factor=128 --file=/dev/nst0 1&lt;br /&gt;
&lt;br /&gt;
        Step 3: Read data from the tape using a block size of 128k. If you get an I/O error, which&lt;br /&gt;
                could happend if you used a different blocking factor above, then, you may need&lt;br /&gt;
                to increase the bs to 256, or 512 etc. as needed.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=/dev/nst0 bs=128k of=testblocksz count=1&lt;br /&gt;
                 0+1 records in&lt;br /&gt;
                 0+1 records out&lt;br /&gt;
&lt;br /&gt;
                $ ls -l testblocksz&lt;br /&gt;
                 -rw-r--r--    1 root     root        65536 Feb  9 10:41 testblocksz&lt;br /&gt;
&lt;br /&gt;
                $ ls -lh testblocksz&lt;br /&gt;
                 -rw-r--r--    1 root     root          64k Feb  9 10:41 testblocksz&lt;br /&gt;
&lt;br /&gt;
               Note above that the size 65536 is equal to 64k. That &amp;quot;h&amp;quot; switch in &amp;quot;ls&amp;quot; is for&lt;br /&gt;
               human readable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 4: tar uses a multiplier of 512*blocking-factor to get block size. Again&lt;br /&gt;
&lt;br /&gt;
                 512 * blocking-factor = block size used in dd command.&lt;br /&gt;
&lt;br /&gt;
              Putting in the values, we see that&lt;br /&gt;
&lt;br /&gt;
                 512 * 128 = 65536&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 5: So what does this tell you? You can now use these numbers to &amp;quot;dd&amp;quot; files&lt;br /&gt;
              to tape. But, first tar will be used to create the file locally.&lt;br /&gt;
&lt;br /&gt;
                $ tar --label=&amp;quot;Test 1&amp;quot; --create --blocking-factor=128 --file=test.tar 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 6: Send this to tape with the dd command. Remember 64k is equal to 65536.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=test.tar bs=64k of=/dev/nst0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 7: Now test that it can be read with tar command using blocking-factor=128.&lt;br /&gt;
             Note the &amp;quot;t&amp;quot; command in tar is for tell. It will not write data.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ tar -tvf /dev/nst0 --blocking-factor=128&lt;br /&gt;
                 V--------- 0/0               0 2005-02-09 10:38:20 Test 1--Volume Header--&lt;br /&gt;
                 drwxr-xr-x root/root         0 2005-02-09 10:34:10 1/&lt;br /&gt;
                 -rw-r--r-- root/root  20971520 2005-02-09 10:34:11 1/disk-image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 8: Reading tape data with dd. Most of the time a high &amp;quot;ibs&amp;quot; input block size&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=/dev/nst0 of=outfromdd.tar ibs=64k&lt;br /&gt;
                 321+0 records in&lt;br /&gt;
                 41088+0 records out&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 9: Verify that outfromdd.tar can be read by tar with blocking-factor=128&lt;br /&gt;
&lt;br /&gt;
                $ tar -tvf outfromdd.tar --blocking-factor=128&lt;br /&gt;
                 V--------- 0/0               0 2005-02-09 10:38:20 Test 1--Volume Header--&lt;br /&gt;
                 drwxr-xr-x root/root         0 2005-02-09 10:34:10 1/&lt;br /&gt;
                 -rw-r--r-- root/root  20971520 2005-02-09 10:34:11 1/disk-image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       PULLING FILES:  The dd command can be used to pull files.&lt;br /&gt;
&lt;br /&gt;
              ssh target_address dd if=remotefile | dd of=localfile&lt;br /&gt;
&lt;br /&gt;
           Or, a specific example of getting a file from a computer called hamlet.&lt;br /&gt;
&lt;br /&gt;
              $ ssh root@hamlet  dd if=/home/cvs/test | dd of=/home/storage/test&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        GOING BACKWARD AND FORWARD ON TAPE:&lt;br /&gt;
&lt;br /&gt;
             Go to end of data&lt;br /&gt;
              $ mt -f /dev/nst0  eod&lt;br /&gt;
&lt;br /&gt;
             Previous record&lt;br /&gt;
              $ mt -f /dev/nst0  bsfm 1&lt;br /&gt;
&lt;br /&gt;
             Forward record&lt;br /&gt;
              $ mt -f /dev/nst0  fsf 1&lt;br /&gt;
&lt;br /&gt;
             Rewind&lt;br /&gt;
              $ mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
             Tell&lt;br /&gt;
              $ mt -f /dev/nst0 tell&lt;br /&gt;
&lt;br /&gt;
         (Reference TIP 151 - for how to get around firewalls)&lt;br /&gt;
&lt;br /&gt;
         Below is a script that I use to backup computers via ssh. The&lt;br /&gt;
         tape drive is on &amp;quot;nis&amp;quot; and the extra space is on &amp;quot;hamlet&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                #!/bin/bash&lt;br /&gt;
                # Program to backup server remotely&lt;br /&gt;
                # Assume remote server is nis, you are on squeezel&lt;br /&gt;
                #&lt;br /&gt;
                # Recover from tape&lt;br /&gt;
                #&lt;br /&gt;
                #   dd if=/dev/nst0 of=test.tar.gz bs=64k&lt;br /&gt;
                #&lt;br /&gt;
                filename=&amp;quot;support1.$(date &amp;quot;+%m%d%y%H%M&amp;quot;).tar.gz&amp;quot;&lt;br /&gt;
                DIRTOBACKUP=/var/www&lt;br /&gt;
                #tar cvzf - $DIRTOBACKUP | ssh  root@nis  '(mt -f /dev/nst0 rewind; dd of=/dev/nst0 bs=64k )'&lt;br /&gt;
                tar cvzf - $DIRTOBACKUP | ssh  support1@hamlet &amp;quot;dd of=/home/support1/backups/${filename} &amp;quot;&lt;br /&gt;
&lt;br /&gt;
         Another example program, below, pushes the last &amp;quot;.tar.gz&amp;quot; file to tape:&lt;br /&gt;
&lt;br /&gt;
                #!/bin/bash&lt;br /&gt;
                # Program to push files to tape&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                # Notes on recovering from tape&lt;br /&gt;
                #&lt;br /&gt;
                #   dd if=/dev/nst0 of=test.tar.gz ibs=64k&lt;br /&gt;
                #    or&lt;br /&gt;
                #  $ ssh root@tapeserver &amp;quot;mt -f /dev/nst0 rewind&amp;quot;&lt;br /&gt;
                #  $ ssh root@tapeserver &amp;quot;dd if=/dev/nst0 ibs=64k&amp;quot;|dd of=cvs1.tar.gz&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                # First rewind tape&lt;br /&gt;
                ssh root@tapeserver 'mt -f /dev/nst0 rewind'&lt;br /&gt;
                #&lt;br /&gt;
                # Grab only the last file&lt;br /&gt;
                file=$(find /home/cvs  -iname 'cvs*.tar.gz'|sort|tail -n 1)&lt;br /&gt;
                dd if=${file}|ssh root@tapeserver 'dd of=/dev/nst0 bs=64k'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 137:&lt;br /&gt;
&lt;br /&gt;
        Apache - redirecting pages. All changes are in httpd.conf&lt;br /&gt;
&lt;br /&gt;
               RedirectMatch (.*)\.gif$ http://www.anotherserver.com$1.jpg&lt;br /&gt;
&lt;br /&gt;
               Redirect /service http://foo2.bar.com/service&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 138:&lt;br /&gt;
&lt;br /&gt;
        samba mounts via ssh - mounting a samba share through an ssh tunnel, going&lt;br /&gt;
               through an intermediate computer, that accepts ssh. We'll call this&lt;br /&gt;
               intermediate computer middle [65.219.4.23], and we want to get to&lt;br /&gt;
               destination [192.168.0.81]. The user will be mchirico.&lt;br /&gt;
&lt;br /&gt;
          STEP 1:&lt;br /&gt;
&lt;br /&gt;
               $ mkdir -p /samba/share&lt;br /&gt;
&lt;br /&gt;
          STEP 2:&lt;br /&gt;
&lt;br /&gt;
            This has to be done as root, since we are using a lower port.&lt;br /&gt;
&lt;br /&gt;
               $ ssh -N -L 139:192.168.0.81:139 mchirico@65.219.4.23&lt;br /&gt;
&lt;br /&gt;
          STEP 3:&lt;br /&gt;
&lt;br /&gt;
              umount /samba/sales&lt;br /&gt;
              /bin/mount -t smbfs -o  username=donkey,workgroup=donkeydomain,&lt;br /&gt;
                      password=passw0rk1,port=139,dmask=770,fmask=660,&lt;br /&gt;
                      netbiosname=homecpu //localhost/share /samba/share&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 139:&lt;br /&gt;
&lt;br /&gt;
        Music on Fedora Core -- How to play music on http://magnatune.com with &amp;quot;xmms&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           The following command will show the sound driver:&lt;br /&gt;
&lt;br /&gt;
              $ lspci|grep -i audio&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          STEP 1:&lt;br /&gt;
&lt;br /&gt;
                Unmute amixer with the following command:&lt;br /&gt;
&lt;br /&gt;
              $ amixer set Master 100% unmute&lt;br /&gt;
              $ amixer set PCM 100%  unmute&lt;br /&gt;
&lt;br /&gt;
                Note you can also get a graphical interface with &amp;quot;alsamixer&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              $ alsamixer&lt;br /&gt;
&lt;br /&gt;
                 h,F1   -- for help&lt;br /&gt;
                 Esc    -- exit&lt;br /&gt;
                 Tab    -- move to selections&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          STEP 2:&lt;br /&gt;
&lt;br /&gt;
                Test a sound file &amp;quot;*.au&amp;quot; with aplay. To quickly find files on your system use&lt;br /&gt;
                the &amp;quot;locate *.au&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
                  $ aplay /usr/lib/python2.3/test/audiotest.au&lt;br /&gt;
&lt;br /&gt;
          STEP 3:&lt;br /&gt;
&lt;br /&gt;
                Install &amp;quot;xmms-mp3-1.2.10-9.2.1.fc3.rf.i386.rpm&amp;quot; which does not come with Fedora because&lt;br /&gt;
                of GPL license restrictions.  The latest version of this package can be found&lt;br /&gt;
                at the following url:&lt;br /&gt;
&lt;br /&gt;
                  http://rpmseek.com/rpm-pl/xmms-mp3.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                  $ rpm -ivh xmms-mp3-1.2.10-9.2.1.fc3.rf.i386.rpm&lt;br /&gt;
&lt;br /&gt;
          STEP 4:&lt;br /&gt;
&lt;br /&gt;
                Go to magnatun &amp;quot;http://magnatune.com/&amp;quot;, select genre and make sure xmms&lt;br /&gt;
                is the default player.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 140:&lt;br /&gt;
&lt;br /&gt;
        Routing -- getting access to a network 1 hop away. You are currently on the 192 network&lt;br /&gt;
                   and you want access to the 172.21.0.0 network that has a computer straddling&lt;br /&gt;
                   the two, with /proc/sys/net/ipv4/ip_forward set to 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               $ route add -net 172.21.0.0 netmask 255.255.255.0 gw 192.168.0.204&lt;br /&gt;
&lt;br /&gt;
         To undo:&lt;br /&gt;
&lt;br /&gt;
               $ route del -net 172.21.0.0 netmask 255.255.255.0 gw 192.168.0.204&lt;br /&gt;
&lt;br /&gt;
         Now you can ping 172.21.0.21.&lt;br /&gt;
&lt;br /&gt;
         Does not work?&lt;br /&gt;
&lt;br /&gt;
         Go on to 192.168.0.204 and execute the following commands:&lt;br /&gt;
&lt;br /&gt;
               $ echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
               $ cat /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
               1&lt;br /&gt;
&lt;br /&gt;
         To Look at the the gateway, execute the following command.&lt;br /&gt;
&lt;br /&gt;
               $ netstat -r&lt;br /&gt;
&lt;br /&gt;
         References: &lt;br /&gt;
&lt;br /&gt;
               http://lartc.org/lartc.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 141:&lt;br /&gt;
&lt;br /&gt;
        RAM disk -- creating a filesystem in RAM.&lt;br /&gt;
&lt;br /&gt;
               $ mkfs -t ext3 -q /dev/ram1 4096&lt;br /&gt;
               $ mkdir -p /fsram&lt;br /&gt;
               $ mount /dev/ram1 /fsram -o defaults,rw&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 142:&lt;br /&gt;
&lt;br /&gt;
        Create a Live Linux CDROM  using  BusyBox and OpenSSH.&lt;br /&gt;
&lt;br /&gt;
            These steps are rather long. A complete tutorial is given at&lt;br /&gt;
            the following link:&lt;br /&gt;
             http://prdownloads.sourceforge.net/souptonuts/instructions_boot_system.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 143:&lt;br /&gt;
&lt;br /&gt;
      SystemImager (http://www.systemimager.org/) SystemImager is software that automates Linux installs,&lt;br /&gt;
                       software distribution, and production deployment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 144:&lt;br /&gt;
&lt;br /&gt;
      Mounted a filesystem in rescue mode, yet, you cannot read and write?  Remount.&lt;br /&gt;
&lt;br /&gt;
             $ mount -o remount /&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 145:&lt;br /&gt;
&lt;br /&gt;
      Nmap commands to check for Microsoft VPN connection.&lt;br /&gt;
&lt;br /&gt;
         $ nmap -sO -p 47 vpn1.someserver.com&lt;br /&gt;
         $ nmap -sS -p T:1723 vpn1.someserver.com&lt;br /&gt;
&lt;br /&gt;
      By the way, with nmap you can specify multiple ports. Below&lt;br /&gt;
      is an example of multiple ports; but, use the commands above&lt;br /&gt;
      for Microsoft VPN services.&lt;br /&gt;
&lt;br /&gt;
         $ nmap -sS -p T:1723-3000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 146:&lt;br /&gt;
&lt;br /&gt;
      Perl and ssh - monitoring systems. The output from ssh can be parsed. Below is&lt;br /&gt;
      a simple procedure to just to read the ssh ouput into perl.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #&lt;br /&gt;
          $pid = open $readme, &amp;quot;ssh root\@hamlet df -lh|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
          while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
           print $_&lt;br /&gt;
          }&lt;br /&gt;
          close $readme&lt;br /&gt;
&lt;br /&gt;
      But note, you probably want to do something more complex. Below is a more robust&lt;br /&gt;
      example that bypassed all the fortune, heading junk that you may encounter when&lt;br /&gt;
      logging in.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #&lt;br /&gt;
          $pid = open $readme, &amp;quot;ssh root\@hamlet df -lh 2&amp;gt;/dev/null|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
          while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
           print $_&lt;br /&gt;
          }&lt;br /&gt;
          close $readme&lt;br /&gt;
&lt;br /&gt;
      NO! you CANNOT do bidirectional communication with the open statement. Note the &amp;quot;|&amp;quot; before&lt;br /&gt;
      and after below, which cannot be done.&lt;br /&gt;
&lt;br /&gt;
          # Cannot do this!&lt;br /&gt;
          $pid = open $readme, &amp;quot;|ssh root\@hamlet df -lh 2&amp;gt;/dev/null|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
      Below is a simple Perl example working with arrays:&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          @ArrayOfArray = (&lt;br /&gt;
                   [ &amp;quot;ant&amp;quot;, &amp;quot;bee&amp;quot; ],&lt;br /&gt;
                   [ &amp;quot;mouse&amp;quot;, &amp;quot;mole&amp;quot;, &amp;quot;rat&amp;quot; ],&lt;br /&gt;
                   [ &amp;quot;duck&amp;quot;, &amp;quot;goose&amp;quot;, &amp;quot;flamingo&amp;quot; ],&lt;br /&gt;
                   [  &amp;quot;rose&amp;quot;,&amp;quot;carnation&amp;quot;,&amp;quot;sunflower&amp;quot;],&lt;br /&gt;
                  );&lt;br /&gt;
&lt;br /&gt;
          for $i ( 0 .. $#ArrayOfArray ) {&lt;br /&gt;
              for $j ( 0 .. $#{$ArrayOfArray[$i]} ) {&lt;br /&gt;
                  print &amp;quot;Element $i $j is $ArrayOfArray[$i][$j]\n&amp;quot;;&lt;br /&gt;
              }&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          # Or this is another way to list elements&lt;br /&gt;
          foreach( @ArrayOfArray ) {&lt;br /&gt;
             foreach $i (0..$#$_) {&lt;br /&gt;
                print &amp;quot;$_-&amp;gt;[$i] &amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
             print &amp;quot;\n&amp;quot;;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Below is an example of working with Hash of Arrays:&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #  ./program &amp;lt; /etc/passwd&lt;br /&gt;
          while(&amp;lt;&amp;gt;){&lt;br /&gt;
              next unless s/^(.*?):\s*//;&lt;br /&gt;
              $HoA{$1} = [ split(/:/) ];&lt;br /&gt;
          }&lt;br /&gt;
          for $i (keys %HoA ) {&lt;br /&gt;
              print &amp;quot;$i: @{ $HoA{$i} } \n&amp;quot;;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
      Example of regular expression. This is my most used regular expression - I like&lt;br /&gt;
      this sample. See the &amp;quot;www.unix.org.ua&amp;quot; link at the end of this tip.&lt;br /&gt;
&lt;br /&gt;
          &amp;quot;hot cross buns&amp;quot; =~ /cross/;&lt;br /&gt;
          print &amp;quot;Matched: &amp;lt;$`&amp;gt; $&amp;amp; &amp;lt;$'&amp;gt;\n&amp;quot;;    # Matched: &amp;lt;hot &amp;gt; cross &amp;lt; buns&amp;gt;&lt;br /&gt;
          print &amp;quot;Left:    &amp;lt;$`&amp;gt;\n&amp;quot;;            # Left:    &amp;lt;hot &amp;gt;&lt;br /&gt;
          print &amp;quot;Match:   &amp;lt;$&amp;amp;&amp;gt;\n&amp;quot;;            # Match:   &amp;lt;cross&amp;gt;&lt;br /&gt;
          print &amp;quot;Right:   &amp;lt;$'&amp;gt;\n&amp;quot;;            # Right:   &amp;lt; buns&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      If you're looking for Perl information, type &amp;quot;man perl&amp;quot;, which will show you how&lt;br /&gt;
      to get even more information. Or better yet, take a look at the following&lt;br /&gt;
      link:&lt;br /&gt;
&lt;br /&gt;
          http://www.unix.org.ua/orelly/perl/prog3/ch09_01.htm&lt;br /&gt;
               also&lt;br /&gt;
          http://www.stonehenge.com/merlyn/UnixReview/&lt;br /&gt;
&lt;br /&gt;
      For a quick example on using Perl with SQLite, see the following links:&lt;br /&gt;
&lt;br /&gt;
          http://prdownloads.sourceforge.net/souptonuts/README_sqlite_tutorial.html?download&lt;br /&gt;
            or&lt;br /&gt;
          http://freshmeat.net/articles/view/1428/&lt;br /&gt;
            or&lt;br /&gt;
          http://www.perl.com/pub/a/1999/09/refererents.html&lt;br /&gt;
&lt;br /&gt;
      Standard input for files. This example will read from stdin, or open a file if given as&lt;br /&gt;
      an argument, and convert all &amp;quot;&amp;lt;&amp;quot; to &amp;quot;&amp;amp;lt;&amp;quot; and &amp;quot;&amp;gt;&amp;quot; to &amp;quot;&amp;amp;gt;&amp;quot;, which can be handy when&lt;br /&gt;
      converting text files to html files. Note the &amp;quot;while(&amp;lt;&amp;gt;)&amp;quot; will take multiple file names&lt;br /&gt;
      on the command line.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          while(&amp;lt;&amp;gt;) {&lt;br /&gt;
             s/&amp;amp;amp;/&amp;amp;amp;amp;/g;&lt;br /&gt;
             s/&amp;amp;lt;/&amp;amp;amp;lt;/g;&lt;br /&gt;
             s/&amp;amp;gt;/&amp;amp;amp;gt;/g;&lt;br /&gt;
             s/&amp;lt;/&amp;amp;lt;/g;&lt;br /&gt;
             s/&amp;gt;/&amp;amp;gt;/g;&lt;br /&gt;
             print;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
      Perl Debugger is very useful for testing commands and works like an interpreter, just&lt;br /&gt;
      like python. So to get into the Perl Debugger execute the command below, &amp;quot;q&amp;quot; to quit.&lt;br /&gt;
&lt;br /&gt;
          $ perl -de 0&lt;br /&gt;
&lt;br /&gt;
      Reference TIP 170&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 147:&lt;br /&gt;
&lt;br /&gt;
      Shutdown&lt;br /&gt;
&lt;br /&gt;
          # shutdown 8:00 -- Shutdown at 8:00&lt;br /&gt;
&lt;br /&gt;
          # shutdown +13  -- Shutdown after 13min&lt;br /&gt;
&lt;br /&gt;
          # shutdown -r now  -- Shutdown now and restart&lt;br /&gt;
&lt;br /&gt;
          # shutdown -k +2  -- &amp;quot;The system is going DOWN to maintenance mode in 2 minutes!&amp;quot;&lt;br /&gt;
                              The above is only a warning.&lt;br /&gt;
&lt;br /&gt;
          # shutdown -h now   -- Shutdown now and halt&lt;br /&gt;
&lt;br /&gt;
          # shutdown -c    -- Cancel shutdown&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 148:&lt;br /&gt;
&lt;br /&gt;
      ac -  print statistics about users connect time&lt;br /&gt;
&lt;br /&gt;
          $ ac -p    -- print hour usage by user (individual)&lt;br /&gt;
          $ ac -dy   -- print daily usage&lt;br /&gt;
&lt;br /&gt;
       Options can also be combined&lt;br /&gt;
&lt;br /&gt;
          $ ac -dyp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 149:&lt;br /&gt;
&lt;br /&gt;
      Smart Monitoring Tools:&lt;br /&gt;
      Disk failing? Or want to know the temperature of your hard-drive?&lt;br /&gt;
&lt;br /&gt;
         http://smartmontools.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
      For a good, quick tutorial, see the Linux Journal article&lt;br /&gt;
        http://www.linuxjournal.com/article/6983&lt;br /&gt;
&lt;br /&gt;
      Below are some common commands:&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -i /dev/hda&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -Hc /dev/hda&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -A /dev/hda&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 150:&lt;br /&gt;
&lt;br /&gt;
      Monitor dhcp trafic - dhcpdump and tcpdump.&lt;br /&gt;
&lt;br /&gt;
      Download dhcpdump&lt;br /&gt;
&lt;br /&gt;
         $ wget  http://voxel.dl.sourceforge.net/sourceforge/mavetju/dhcpdump-1.5.tar.gz&lt;br /&gt;
         $ ./configure&lt;br /&gt;
         $ make &amp;amp;&amp;amp; make install&lt;br /&gt;
&lt;br /&gt;
     Once it's installed, you can monitor all dhcp traffic as follows, if done with root.&lt;br /&gt;
&lt;br /&gt;
         $ tcpdump -lenx -i eth0 -s 1500 port bootps or port bootpc| dhcpdump&lt;br /&gt;
&lt;br /&gt;
     The above assumes you are using eth0 (ethernet port 0).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 151:&lt;br /&gt;
&lt;br /&gt;
      Breaking Firewalls with ssh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      A sample .ssh/config file (note this must have chmod 600 rights)&lt;br /&gt;
&lt;br /&gt;
           ## Server1 ##&lt;br /&gt;
           Host 130.21.19.227&lt;br /&gt;
               LocalForward 20000 192.168.0.66:80&lt;br /&gt;
               LocalForward 22000 192.168.0.66:22&lt;br /&gt;
&lt;br /&gt;
      With the above &amp;quot;~/.ssh/config&amp;quot; file, after sshing into 130.21.19.227 it&lt;br /&gt;
      is then possible to ssh into nearby computers directly.&lt;br /&gt;
&lt;br /&gt;
         $ ssh -l mchirico 130.21.19.227&lt;br /&gt;
         $ scp -P 22000 authorized_keys* mchirico@localhost:.&lt;br /&gt;
         $ ssh -l mchirico localhost -p 22000&lt;br /&gt;
&lt;br /&gt;
      For the complete article reference the following link:&lt;br /&gt;
        http://souptonuts.sourceforge.net/sshtips.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 152:&lt;br /&gt;
&lt;br /&gt;
      Renaming files - suppose you want to rename all the &amp;quot;.htm&amp;quot; files to &amp;quot;.html&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          $ rename .htm .html *.htm&lt;br /&gt;
&lt;br /&gt;
      Or, suppose you files file1, file2, file3 ...&lt;br /&gt;
&lt;br /&gt;
          $ touch file1 file2 file3 file4 file5 file6&lt;br /&gt;
          $ rename file file. file*&lt;br /&gt;
&lt;br /&gt;
      The above command will give you &amp;quot;file.1&amp;quot;, &amp;quot;file.2&amp;quot; ... &amp;quot;file.6&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 153:&lt;br /&gt;
&lt;br /&gt;
      Renaming files with Perl - this is taken from &amp;quot;Programming Perl 3rd Edition&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          # rename - change filenames&lt;br /&gt;
          $op = shift;&lt;br /&gt;
          for (@ARGV) {&lt;br /&gt;
              $was = $_;&lt;br /&gt;
              eval $op;&lt;br /&gt;
              die if $@;&lt;br /&gt;
              # next line calls built-in function, not the script&lt;br /&gt;
              rename($was,$_) unless $was eq $_;&lt;br /&gt;
           }&lt;br /&gt;
&lt;br /&gt;
      The above Perl program can be used as follows:&lt;br /&gt;
&lt;br /&gt;
           $ rename 's/\.orig$//'    *.orig&lt;br /&gt;
           $ rename 'y/A-Z/a-z/ unless /^Make/' *&lt;br /&gt;
&lt;br /&gt;
      Also reference:&lt;br /&gt;
           http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 154:&lt;br /&gt;
&lt;br /&gt;
      R project (http://www.r-project.org)&lt;br /&gt;
&lt;br /&gt;
      To start R, just type &amp;quot;R&amp;quot; at the command prompt and &amp;quot;q()&amp;quot; to quit. Below&lt;br /&gt;
      2 is raised to powers 0 through 6 and thrown into an array.&lt;br /&gt;
&lt;br /&gt;
           $ R&lt;br /&gt;
           &amp;gt; N &amp;lt;- 2^(0:6)&lt;br /&gt;
           &amp;gt; N&lt;br /&gt;
           [1]  1  2  4  8 16 32 64&lt;br /&gt;
           &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      There is a summary summary() command.&lt;br /&gt;
&lt;br /&gt;
           &amp;gt; summary(N)&lt;br /&gt;
           Min. 1st Qu.  Median    Mean 3rd Qu.    Max.&lt;br /&gt;
           1.00    3.00    8.00   18.14   24.00   64.00&lt;br /&gt;
&lt;br /&gt;
      Note that the array begins as 1 and not 0&lt;br /&gt;
&lt;br /&gt;
           &amp;gt; N[1:3]&lt;br /&gt;
           [1] 1 2 4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 155:&lt;br /&gt;
&lt;br /&gt;
      ls - listing files by size, with the biggest file listed last&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           $ ls --sort=size -lhr&lt;br /&gt;
&lt;br /&gt;
      The above command sorts files by size, listing the contents in&lt;br /&gt;
      &amp;quot;h&amp;quot; human readable format in reverse order.&lt;br /&gt;
&lt;br /&gt;
      Note the options:  --sort={none,time,size,extension}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 156:&lt;br /&gt;
&lt;br /&gt;
     Perl - program to clean up old versions of files&lt;br /&gt;
&lt;br /&gt;
       #!/usr/bin/perl&lt;br /&gt;
       #   Copyright (c) GPL 2005 Mike Chirico&lt;br /&gt;
       # This program deletes old files from several directories&lt;br /&gt;
       # and within each directory there must be x number of copies&lt;br /&gt;
       # each y number of bytes&lt;br /&gt;
       #&lt;br /&gt;
&lt;br /&gt;
       sub delete_old_ones {&lt;br /&gt;
           $directory_and_file=$_[0];&lt;br /&gt;
           $save_count=$_[1];&lt;br /&gt;
           $bytes_in_file=$_[2];&lt;br /&gt;
         # Don't change setting here of '-lt'&lt;br /&gt;
           $pid = open $readme, &amp;quot;ls -lt $directory_and_file|&amp;quot; or die &amp;quot;Could not execute\n&amp;quot;;&lt;br /&gt;
           while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
               my @fields = split;&lt;br /&gt;
              # Make sure we have $save_count good ones with data&lt;br /&gt;
               if ($fields[4] &amp;gt; $bytes_in_file &amp;amp;&amp;amp; $save_count &amp;gt; 0) {&lt;br /&gt;
                   $save_count--;&lt;br /&gt;
                   print &amp;quot;Kept files: $fields[4] $fields[8]\n&amp;quot;;&lt;br /&gt;
               }&lt;br /&gt;
              # delete the old ones&lt;br /&gt;
              if ($save_count &amp;lt;= 0 )&lt;br /&gt;
              {&lt;br /&gt;
                  print &amp;quot;Deleted files: $fields[4] $fields[8]\n&amp;quot;;&lt;br /&gt;
                  unlink $fields[8];&lt;br /&gt;
              }&lt;br /&gt;
           }&lt;br /&gt;
           close $readme;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       @AofA = (&lt;br /&gt;
          [ &amp;quot;/home/cvs/backups/*.gz&amp;quot;, &amp;quot;6&amp;quot;,196621 ],&lt;br /&gt;
          [ &amp;quot;/home/mail/backups/*.gz&amp;quot;,&amp;quot;5&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/snort/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/server1/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/actserver/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/server2/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
                );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       foreach( @AofA ) {&lt;br /&gt;
           &amp;amp;delete_old_ones($_-&amp;gt;[0],$_-&amp;gt;[1],$_-&amp;gt;[2]);&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
     Reference TIP 170 and the following link:&lt;br /&gt;
       http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 157:&lt;br /&gt;
&lt;br /&gt;
     Graphics and Visualization Software that runs on Linux&lt;br /&gt;
        http://www.tldp.org/HOWTO/Scientific-Computing-with-GNU-Linux/graphvis.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 158:&lt;br /&gt;
&lt;br /&gt;
     Keeping files in sync going both ways. Unlike rsync, this is not a one way mirror&lt;br /&gt;
     option.&lt;br /&gt;
&lt;br /&gt;
     You will need ocaml installed first.&lt;br /&gt;
&lt;br /&gt;
       $ wget http://caml.inria.fr/pub/distrib/ocaml-3.08/ocaml-3.08.3.tar.gz&lt;br /&gt;
       $ tar -xzf ocaml-3.08.3.tar.gz&lt;br /&gt;
       $ cd ocaml-3.08.3&lt;br /&gt;
&lt;br /&gt;
       $ ./configure&lt;br /&gt;
       $ make world&lt;br /&gt;
       $ make opt&lt;br /&gt;
       $ make install&lt;br /&gt;
&lt;br /&gt;
     Next, get unison and put it in a different directory.&lt;br /&gt;
     [http://www.cis.upenn.edu/~bcpierce/unison/]&lt;br /&gt;
&lt;br /&gt;
       $ wget http://www.cis.upenn.edu/~bcpierce/unison/download/stable/latest/unison-2.10.2.tar.gz&lt;br /&gt;
       $ tar -xzf unison-2.10.2.tar.gz&lt;br /&gt;
       $ cd unison-2.10.2&lt;br /&gt;
       $ make UISTYLE=text&lt;br /&gt;
       $ su&lt;br /&gt;
       # cp unison /usr/local/bin/.&lt;br /&gt;
&lt;br /&gt;
     Note, you have to copy the file manually.&lt;br /&gt;
&lt;br /&gt;
     See the following article [http://www.linuxjournal.com/article/7712]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 159:&lt;br /&gt;
&lt;br /&gt;
     Dump ext2/ext3 filesystem information with &amp;quot;dumpe2fs&amp;quot;. Perform the mount command&lt;br /&gt;
     and query away.&lt;br /&gt;
&lt;br /&gt;
       $ dumpe2fs /dev/sda1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 160:&lt;br /&gt;
&lt;br /&gt;
     sysreport - a script that generates an HTML report on the system configuration. It&lt;br /&gt;
     gathers information about the hardware and is somewhat redhat specific. The utility&lt;br /&gt;
     should be run as root.&lt;br /&gt;
&lt;br /&gt;
       $ /usr/sbin/sysreport&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 161:&lt;br /&gt;
&lt;br /&gt;
     Key Bindings Using bind.  You can bind, say, ctl-t to a command.&lt;br /&gt;
&lt;br /&gt;
     Add the following to you &amp;quot;~/.inputrc&amp;quot; file, just as it is typed below with quotes.&lt;br /&gt;
&lt;br /&gt;
           &amp;quot;\C-t&amp;quot;: ls -l&lt;br /&gt;
&lt;br /&gt;
     Next, run the command&lt;br /&gt;
&lt;br /&gt;
           $ bind -f .inputrc&lt;br /&gt;
&lt;br /&gt;
     Or, you can do everything on the command line; however, it won't be there the next time&lt;br /&gt;
     you log in. Below is the way to do everything on the command line.&lt;br /&gt;
&lt;br /&gt;
           $ bind -x '&amp;quot;\C-t&amp;quot;:ls -l'&lt;br /&gt;
&lt;br /&gt;
     To unbind use the &amp;quot;-r&amp;quot; option. Single quotes are not needed.&lt;br /&gt;
&lt;br /&gt;
           $ bind -r &amp;quot;\C-t&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Getting a list of all bindings can be done as follows, and not this can be redirected&lt;br /&gt;
     to the &amp;quot;.inputrc&amp;quot; file for further editing.&lt;br /&gt;
&lt;br /&gt;
           $ bind -p &amp;gt; .inputrc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 162:&lt;br /&gt;
&lt;br /&gt;
     awk - common awk commands.&lt;br /&gt;
&lt;br /&gt;
     Find device names &amp;quot;sd&amp;quot; or with major number 4 and device name &amp;quot;tty&amp;quot;. Print the&lt;br /&gt;
     record number NR, plus the major number and minor number.&lt;br /&gt;
&lt;br /&gt;
          $ awk '$2 == &amp;quot;sd&amp;quot;||$1 == 4 &amp;amp;&amp;amp; $2 == &amp;quot;tty&amp;quot; { print NR,$1,$2}' /proc/devices&lt;br /&gt;
&lt;br /&gt;
     Find device name equal to &amp;quot;sound&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ awk '/sound/{print NR,$1,$2}' /proc/devices&lt;br /&gt;
&lt;br /&gt;
     Print the 5th record, first field, in file test&lt;br /&gt;
&lt;br /&gt;
          $ awk 'NR==5{print $1}' test&lt;br /&gt;
&lt;br /&gt;
     Print a record, skip 4 records, print a record etc from file1&lt;br /&gt;
&lt;br /&gt;
          $ awk '(NR-1) % 4 == 0 {print $1}' file1&lt;br /&gt;
&lt;br /&gt;
     Print all records except the last one from file1&lt;br /&gt;
&lt;br /&gt;
          $ tac file1|awk 'NR &amp;gt; 1 {print $0}'|tac&lt;br /&gt;
&lt;br /&gt;
     Print A,B,C ..Z on each line, cycling back to A if greater than 26 lines&lt;br /&gt;
&lt;br /&gt;
          $ awk '{ print substr(&amp;quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&amp;quot;,(NR-1)%26+1,1),$0}' file1&lt;br /&gt;
&lt;br /&gt;
     Number of bytes in a directory.&lt;br /&gt;
&lt;br /&gt;
          $ ls -l|awk 'BEGIN{ c=0}{ c+=$5} END{ print c}'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 163:&lt;br /&gt;
&lt;br /&gt;
     Configuring Remote Logging.  If you have several servers on 192.168.1.0, you can setup remote logging&lt;br /&gt;
     as follows.&lt;br /&gt;
&lt;br /&gt;
     MAIN LOG SERVER (192.168.1.81):&lt;br /&gt;
&lt;br /&gt;
        Firewall - allow UDP port 514 on the main server that will receive the logs.&lt;br /&gt;
&lt;br /&gt;
          $ iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 514 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        Edit &amp;quot;/etc/sysconfig/syslog&amp;quot; and add the &amp;quot;-r&amp;quot; option to SYSLOGD_OPTIONS as shown below.&lt;br /&gt;
&lt;br /&gt;
          SYSLOGD_OPTIONS=&amp;quot;-r -m -0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Note, the &amp;quot;-r&amp;quot; is to allow remote logging and  &amp;quot;-m 0&amp;quot; specifies that that the syslog process should&lt;br /&gt;
        not write regular timestamps.  I prefer to only write timestamps for the clients.&lt;br /&gt;
&lt;br /&gt;
        Next, restart the logging process&lt;br /&gt;
&lt;br /&gt;
          $ service syslog restart&lt;br /&gt;
&lt;br /&gt;
     CLIENT LOG SERVER:&lt;br /&gt;
&lt;br /&gt;
        Edit &amp;quot;/etc/syslog.conf&amp;quot; and add the ip address of the log server, or put in the hostname.&lt;br /&gt;
&lt;br /&gt;
            *.* @192.168.1.81&lt;br /&gt;
&lt;br /&gt;
        Next, restart the logging process&lt;br /&gt;
&lt;br /&gt;
          $ service syslog restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 164:&lt;br /&gt;
&lt;br /&gt;
     kudzu - hardware on your system. To probe the hardware on your system without doing&lt;br /&gt;
             anything, issue the following command.&lt;br /&gt;
&lt;br /&gt;
          $ kudzu -p&lt;br /&gt;
&lt;br /&gt;
      But wait, a lot of this information is already recorded in the following file&lt;br /&gt;
&lt;br /&gt;
            /etc/sysconfig/hwconf&lt;br /&gt;
&lt;br /&gt;
      You can also use lspci to list all PCI devices.&lt;br /&gt;
&lt;br /&gt;
          $ lspci&lt;br /&gt;
&lt;br /&gt;
      Also, take a look at the script /etc/sbin/sysreport, since this script has a lot of&lt;br /&gt;
      info gathering commands. You can pick and choose what you want, or run the complete&lt;br /&gt;
      report.&lt;br /&gt;
&lt;br /&gt;
      If you just want information on the NIC&lt;br /&gt;
&lt;br /&gt;
          $ ip link show eth0&lt;br /&gt;
          2: eth0: &amp;lt;BROADCAST,MULTICAST,UP&amp;gt; mtu 1500 qdisc pfifo_fast qlen 1000&lt;br /&gt;
          link/ether 00:11:11:8a:be:3f brd ff:ff:ff:ff:ff:ff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 165:&lt;br /&gt;
&lt;br /&gt;
     cfengine - a very power agent for monitoring and administrating both a single computer&lt;br /&gt;
              and or multiple computers. [ http://www.cfengine.org/ ]&lt;br /&gt;
&lt;br /&gt;
     The following is a quick example on downloading and installing cfengine.&lt;br /&gt;
&lt;br /&gt;
          $ ncftpget ftp://ftp.iu.hio.no/pub/cfengine/cfengine-2.1.15.tar.gz&lt;br /&gt;
          $ md5sum cfengine-2.1.15.tar.gz&lt;br /&gt;
          f03de82709f84c3d6d916b6e557321f9  cfengine-2.1.15.tar.gz&lt;br /&gt;
&lt;br /&gt;
          $ tar -xzf cfengine-2.1.15.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You need to have a current version of BerkeleyDB (http://downloads.sleepycat.com/db-4.3.28.tar.gz).&lt;br /&gt;
     Note that BerkeleyDB has a funny install. You cd to the &amp;quot;build_unix&amp;quot; directory, then,&lt;br /&gt;
&lt;br /&gt;
          Installing BerkeleyDB if needed:&lt;br /&gt;
                 $ wget http://downloads.sleepycat.com/db-4.3.28.tar.gz&lt;br /&gt;
                 $ tar -xzf db-4.3.28.tar.gz&lt;br /&gt;
                 $ cd db-4.3.28/build_unix/&lt;br /&gt;
                 $ ../dist/configure&lt;br /&gt;
                 make&lt;br /&gt;
                 make install&lt;br /&gt;
&lt;br /&gt;
     You also need a current version of OpenSSL. For instructions on how to install OpenSSL see&lt;br /&gt;
     (http://souptonuts.sourceforge.net/postfix_tutorial.html).&lt;br /&gt;
&lt;br /&gt;
     See (TIP 49) on putting &amp;quot;/usr/local/BerkeleyDB.4.3/lib&amp;quot; in the &amp;quot;/etc/ld.so.conf&amp;quot; file. Or&lt;br /&gt;
     once BerkeleyDB is installed, you can put the location on the command line as follows:&lt;br /&gt;
&lt;br /&gt;
     Configuring cfengine with direct reference to BerkeleyDB.4.3.  First cd to the cfengine source.&lt;br /&gt;
&lt;br /&gt;
          $ ./configure --with-berkeleydb=/usr/local/BerkeleyDB.4.3/lib&lt;br /&gt;
          $ make&lt;br /&gt;
          $ make install&lt;br /&gt;
&lt;br /&gt;
     Next create the following directories:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /var/cfengine/bin&lt;br /&gt;
          $ mkdir -p /var/cfengine/inputs&lt;br /&gt;
&lt;br /&gt;
     Copy needed files (cfagent, cfdoc, cfenvd, cfenvgraph, cfexecd, cfkey, cfrun, cfservd, cfshow):&lt;br /&gt;
&lt;br /&gt;
          $ cp /usr/local/sbin/cf* /var/cfengine/bin&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You'll also need to generate keys. As root, execute the following:&lt;br /&gt;
&lt;br /&gt;
          $ cfkey&lt;br /&gt;
&lt;br /&gt;
     The command above will write the public and private keys in&lt;br /&gt;
     &amp;quot;/var/cfengine/ppkeys&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You probably want (cfexecd, cfservd, and cfenvd) running on all servers. If you&lt;br /&gt;
     add the following to &amp;quot;/etc/rc.local&amp;quot; these daemons will start on reboot.&lt;br /&gt;
&lt;br /&gt;
           # Lines in /etc/rc.local&lt;br /&gt;
           /usr/local/sbin/cfexecd&lt;br /&gt;
           /usr/local/sbin/cfservd&lt;br /&gt;
           /usr/local/sbin/cfenvd&lt;br /&gt;
&lt;br /&gt;
     Also, make sure you run each command now as follows:&lt;br /&gt;
&lt;br /&gt;
          $ /usr/local/sbin/cfexecd&lt;br /&gt;
          $ /usr/local/sbin/cfservd&lt;br /&gt;
          $ /usr/local/sbin/cfenvd&lt;br /&gt;
&lt;br /&gt;
     Firewall settings must be adjusted to allows 5308 for tcp/udp. My local network&lt;br /&gt;
     is 192.168.1.0, so I'm opening it up for all my computers.&lt;br /&gt;
&lt;br /&gt;
          $ iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 5308 -j ACCEPT&lt;br /&gt;
          $ iptables -A INPUT -p tcp -s 192.168.1.0/24  --dport 5308 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
     A set of keys needs to be on the server and hosts. For example, my key on &amp;quot;tape.squeezel.com&amp;quot;&lt;br /&gt;
     should be copied over to the server &amp;quot;squeezel.squeezel.com&amp;quot; as follows:&lt;br /&gt;
&lt;br /&gt;
     This is done from tape.squeezel.com&lt;br /&gt;
&lt;br /&gt;
          $ scp /var/cfengine/ppkeys/localhost.pub  root@squeezel.squeezel.com:/var/cfengine/ppkeys/root-tape.squeezel.com.pub&lt;br /&gt;
          $ scp root@squeezel.squeezel.com:/var/cfengine/ppkeys/localhost.pub /var/cfengine/ppkeys/root-squeezel.squeezel.com.pub&lt;br /&gt;
&lt;br /&gt;
     Also, &amp;quot;/var/cfengine/inputs/cfrun.hosts&amp;quot; on the server &amp;quot;squeezel.squeezel.com&amp;quot; must contain&lt;br /&gt;
     all the computers that will get updated. This is &amp;quot;cfrun.hosts&amp;quot; on &amp;quot;squeezel.squeezel.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          closet.squeezel.com&lt;br /&gt;
          tape.squeezel.com&lt;br /&gt;
&lt;br /&gt;
     Once I'm done, from &amp;quot;tape.squeezel.com&amp;quot; I can run the following test:&lt;br /&gt;
&lt;br /&gt;
          $ cfrun squeezel.squeezel.com -v&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 166:&lt;br /&gt;
&lt;br /&gt;
     cfengine - a quick example. This example will be run as root. You create the file &amp;quot;cfagent.conf&amp;quot; in&lt;br /&gt;
     &amp;quot;/var/cfengine/inputs/&amp;quot;. The example below will checksum all the files in /home/chirico/deleteme/tripwire,&lt;br /&gt;
     it will also comment out the line &amp;quot;finger&amp;quot; in any file located in /tmp/testdir/stuff, also appending&lt;br /&gt;
     the command in this file &amp;quot; Edit change with cfengine&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          # /var/cfengine/inputs/cfagent.conf&lt;br /&gt;
          #&lt;br /&gt;
          # You run this with the following:&lt;br /&gt;
          #   cfagent -vK&lt;br /&gt;
        &lt;br /&gt;
          control:&lt;br /&gt;
                 actionsequence = ( files tidy editfiles )&lt;br /&gt;
                 ChecksumDatabase = ( /var/cfengine/cache.db )&lt;br /&gt;
                 # Below, true to update md5&lt;br /&gt;
                 ChecksumUpdates = ( true )&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
          files:&lt;br /&gt;
                 /home/chirico/deleteme/tripwire checksum=md5 recurse=inf&lt;br /&gt;
                 /home/chirico/deleteme/tripwire/moredata checksum=md5 recurse=inf&lt;br /&gt;
                 #/home/chirico/deleteme/tripwire/compress  recurse=inf include=*.txt acti on=compress&lt;br /&gt;
                   # If the database isn't secure, nothing is secure...&lt;br /&gt;
                 /var/cfengine/cache.db  mode=600 owner=root action=fixall&lt;br /&gt;
        &lt;br /&gt;
          tidy:&lt;br /&gt;
                 /home/chirico/deleteme/tripwire pattern=*~ recurse=inf age=0&lt;br /&gt;
                 # You must put an age. 0 runs now.&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
          editfiles:&lt;br /&gt;
        &lt;br /&gt;
                {  /tmp/testdir/stuff&lt;br /&gt;
&lt;br /&gt;
                   HashCommentLinesContaining &amp;quot;finger&amp;quot;&lt;br /&gt;
                   AppendIfNoSuchLine &amp;quot;# Edit Change with cfengine &amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     A few further notes on the above. The command &amp;quot;actionsequence = ( files tidy editfiles) tells the order&lt;br /&gt;
     of what to execute. The heading &amp;quot;tidy:&amp;quot; deletes files, and of course, &amp;quot;editfiles&amp;quot; does the editing of files.&lt;br /&gt;
&lt;br /&gt;
     To run the example, execute the following command. The  &amp;quot;-K&amp;quot; causes the lock file to be ignored.&lt;br /&gt;
&lt;br /&gt;
            $ cfagent -vK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 167:&lt;br /&gt;
&lt;br /&gt;
     Implementing Disk Quotas - a quick example that can easily be done on a live system for testing. There&lt;br /&gt;
     is no need to reboot, since you'll be creating a virtual filesystem.&lt;br /&gt;
&lt;br /&gt;
     Do the following as root. First create a mount point.&lt;br /&gt;
&lt;br /&gt;
            # mkdir -p /quota&lt;br /&gt;
&lt;br /&gt;
     Next, create 20M file. Since I have many of these files, I created a special directory &amp;quot;/usr/disk-img&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            # mkdir -p /usr/disk-img&lt;br /&gt;
            # dd if=/dev/zero of=/usr/disk-img/disk-quota.ext3 count=40960&lt;br /&gt;
&lt;br /&gt;
     The dd command above create a 20 MB file because, by default, dd uses a block size of 512 bytes. That makes&lt;br /&gt;
     the size: 40960*512=20971520.&lt;br /&gt;
&lt;br /&gt;
     Next, format this as an ext3 filesystem&lt;br /&gt;
&lt;br /&gt;
            # /sbin/mkfs -t ext3 -q /usr/disk-img/disk-quota.ext3 -F&lt;br /&gt;
&lt;br /&gt;
     Add the following line to &amp;quot;/etc/fstab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            /usr/disk-img/disk-quota.ext3    /quota ext3    rw,loop,usrquota,grpquota  0 0&lt;br /&gt;
&lt;br /&gt;
     Now, mount this filesystem&lt;br /&gt;
&lt;br /&gt;
            # mount /quota&lt;br /&gt;
&lt;br /&gt;
     Take a look at it:&lt;br /&gt;
&lt;br /&gt;
            # ls -l /quota&lt;br /&gt;
            lost+found&lt;br /&gt;
&lt;br /&gt;
     Now, run &amp;quot;quotacheck&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            # quotacheck -vug /quota&lt;br /&gt;
&lt;br /&gt;
     You'll get errors the first time this is run, because you have no quota files.&lt;br /&gt;
     But, run it a second time and you'll see something similiar to the following:&lt;br /&gt;
&lt;br /&gt;
            # quotacheck -vug /quota&lt;br /&gt;
            quotacheck: Scanning /dev/loop2 [/quota] done&lt;br /&gt;
            quotacheck: Checked 3 directories and 4 files&lt;br /&gt;
&lt;br /&gt;
     Now take a look at the files:&lt;br /&gt;
&lt;br /&gt;
            # ls -l /quota&lt;br /&gt;
            total 26&lt;br /&gt;
            -rw-------  1 root root  6144 Jun 14 12:23 aquota.group&lt;br /&gt;
            -rw-------  1 root root  6144 Jun 14 12:23 aquota.user&lt;br /&gt;
            drwx------  2 root root 12288 Jun 14 12:18 lost+found&lt;br /&gt;
&lt;br /&gt;
     Next use &amp;quot;edquota&amp;quot; to grant the user &amp;quot;chirico&amp;quot; a certain quota&lt;br /&gt;
&lt;br /&gt;
            # edquota -f /quota chirico&lt;br /&gt;
&lt;br /&gt;
     This will bring up a menu, and here I have edited so that user &amp;quot;chirico&amp;quot;&lt;br /&gt;
     has a soft limit of 120*512=61K, and a soft limit of 2 inodes and a hard limit of 5.&lt;br /&gt;
&lt;br /&gt;
             Disk quotas for user chirico (uid 500):&lt;br /&gt;
             Filesystem                   blocks       soft       hard     inodes     soft     hard&lt;br /&gt;
             /dev/loop2                        2        120        150         1        2         3&lt;br /&gt;
&lt;br /&gt;
     Next, turn quotas on with the following command:&lt;br /&gt;
&lt;br /&gt;
             $ quotaon /quota&lt;br /&gt;
&lt;br /&gt;
     If you need to turn off quotas, the command is &amp;quot;quotaoff -a&amp;quot; for all filesystems. You'll run into&lt;br /&gt;
     errors if you try to run quotacheck, say &amp;quot;quotacheck -avug&amp;quot; because this tries to unmount and mount&lt;br /&gt;
     the filesystem. You need to turn off quotas first &amp;quot;quotaoff /quota&amp;quot;. Note you only need to run&lt;br /&gt;
     quotacheck once, or when doing maintenance after a system crash.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      To get a report on the quote, runn &amp;quot;repquota&amp;quot; as follows:&lt;br /&gt;
&lt;br /&gt;
           $ repquota /quota&lt;br /&gt;
            *** Report for user quotas on device /dev/loop0&lt;br /&gt;
            Block grace time: 7days; Inode grace time: 7days&lt;br /&gt;
                                    Block limits                File limits&lt;br /&gt;
            User            used    soft    hard  grace    used  soft  hard  grace&lt;br /&gt;
            ----------------------------------------------------------------------&lt;br /&gt;
            root      --    1189       0       0              2     0     0&lt;br /&gt;
            chirico   -+      93       0       0              4     2     5  6days&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Note above that user &amp;quot;chirico&amp;quot; has used 4 on the file limits. This user has a hard&lt;br /&gt;
      limit of 5. So when this user tries to create 2 more files (bring this over the limit of 5)&lt;br /&gt;
      then he will get the following error as demonstrated below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           [chirico@squeezel chirico]$ touch one&lt;br /&gt;
           [chirico@squeezel chirico]$ touch two&lt;br /&gt;
           loop0: write failed, user file limit reached.&lt;br /&gt;
           touch: cannot touch `two': Disk quota exceeded&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Now, if repquota (run by root) is executed it shows the following:&lt;br /&gt;
&lt;br /&gt;
           $ repquota /quota&lt;br /&gt;
           *** Report for user quotas on device /dev/loop0&lt;br /&gt;
           Block grace time: 7days; Inode grace time: 7days&lt;br /&gt;
                                   Block limits                File limits&lt;br /&gt;
           User            used    soft    hard  grace    used  soft  hard  grace&lt;br /&gt;
           ----------------------------------------------------------------------&lt;br /&gt;
           root      --    1189       0       0              2     0     0&lt;br /&gt;
           chirico   -+      94       0       0              5     2     5  6days&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Note the &amp;quot;+&amp;quot; sign above. User &amp;quot;chirico&amp;quot; is above the File soft limits, and in this case&lt;br /&gt;
      above the hard limits.&lt;br /&gt;
&lt;br /&gt;
      To warn user by sending email to them, run &amp;quot;warnquota&amp;quot;, but you need check that&lt;br /&gt;
      &amp;quot;/etc/warnquota.conf&amp;quot; is setup correctly. For the example above, this file should&lt;br /&gt;
      look as follows:&lt;br /&gt;
&lt;br /&gt;
            $ cat /etc/quotatab&lt;br /&gt;
            #&lt;br /&gt;
            #  This is sample quotatab (/etc/quotatab)&lt;br /&gt;
            #  Here you can specify description of each device for user&lt;br /&gt;
            #&lt;br /&gt;
            #  Comments begin with hash in the beginning of the line&lt;br /&gt;
&lt;br /&gt;
            # Example of description&lt;br /&gt;
            /dev/loop0: This is loopback device&lt;br /&gt;
&lt;br /&gt;
      Just run the following as root:&lt;br /&gt;
&lt;br /&gt;
            $ warnquota&lt;br /&gt;
&lt;br /&gt;
      By the way, if you want to change the grace period, it can only be done on a filesystem&lt;br /&gt;
      basis. Not per user.&lt;br /&gt;
&lt;br /&gt;
            $  edquota -t&lt;br /&gt;
&lt;br /&gt;
      Users can run &amp;quot;quota&amp;quot; to see their usage as follows:&lt;br /&gt;
&lt;br /&gt;
            [chirico@squeezel ~]$ quota&lt;br /&gt;
            Disk quotas for user chirico (uid 500):&lt;br /&gt;
                 Filesystem  blocks   quota   limit   grace   files   quota   limit   grace&lt;br /&gt;
                 /dev/loop0      94       0       0               5      10      50&lt;br /&gt;
&lt;br /&gt;
      As you can see from above, I changed my inode limit to 50.&lt;br /&gt;
&lt;br /&gt;
      What about running this on the whole filesystem? Yes, below is an example where I'm running&lt;br /&gt;
      this on FC3, on the root of the filesystem &amp;quot;/&amp;quot;. This assumes that you have installed the&lt;br /&gt;
      quota package. Try doing &amp;quot;rpm -q quota&amp;quot; to see if this package is installed.&lt;br /&gt;
&lt;br /&gt;
        Step 1:&lt;br /&gt;
&lt;br /&gt;
           Check to make sure the quota software is installed. You can either do a &amp;quot;whereis quota&amp;quot;,&lt;br /&gt;
           or check for the rpm package.&lt;br /&gt;
&lt;br /&gt;
             $ whereis quota&lt;br /&gt;
             whereis quota&lt;br /&gt;
             quota: /usr/bin/quota /usr/share/man/man1/quota.1.gz&lt;br /&gt;
&lt;br /&gt;
           Checking for the rpm package.&lt;br /&gt;
&lt;br /&gt;
            $ rpm -q quota&lt;br /&gt;
            quota-3.12-5&lt;br /&gt;
&lt;br /&gt;
        Step 2:&lt;br /&gt;
&lt;br /&gt;
           Edit /etc/fstab and add usrquota and grpquota options for &amp;quot;/dev/VolGroup00/LogVol00&amp;quot;,&lt;br /&gt;
           which is shown on the first line below:&lt;br /&gt;
&lt;br /&gt;
             /dev/VolGroup00/LogVol00 /                      ext3    defaults,usrquota,grpquota        1 1&lt;br /&gt;
             LABEL=/boot             /boot                   ext3    defaults        1 2&lt;br /&gt;
             none                    /dev/pts                devpts  gid=5,mode=620  0 0&lt;br /&gt;
             none                    /dev/shm                tmpfs   defaults        0 0&lt;br /&gt;
             none                    /proc                   proc    defaults        0 0&lt;br /&gt;
             none                    /sys                    sysfs   defaults        0 0&lt;br /&gt;
             /dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0&lt;br /&gt;
&lt;br /&gt;
        Step 3:&lt;br /&gt;
&lt;br /&gt;
           Remount the filesystem as follows:&lt;br /&gt;
&lt;br /&gt;
             $ mount -o remount /&lt;br /&gt;
&lt;br /&gt;
        Step 4:&lt;br /&gt;
&lt;br /&gt;
           Run quotacheck with the &amp;quot;-m&amp;quot; option. Like the above statement, this will have to be run with&lt;br /&gt;
           root priviliges. This creates the quota database files, and it can take a long time if it is&lt;br /&gt;
           a large full filesystem.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             $ quotacheck -cugm /&lt;br /&gt;
&lt;br /&gt;
        Step 5:&lt;br /&gt;
&lt;br /&gt;
           This step is optional, but it's good to know if you need to recalculate quotas because of a&lt;br /&gt;
           system crash. It's demonstrated here, because at this point quota's have not been turned on.&lt;br /&gt;
           Again, note the &amp;quot;m&amp;quot; option below.&lt;br /&gt;
&lt;br /&gt;
             $ quotacheck -avumg&lt;br /&gt;
&lt;br /&gt;
        Step 6:&lt;br /&gt;
&lt;br /&gt;
           Set limits for specific users or groups using the &amp;quot;edquota&amp;quot; command. Shown below is the command&lt;br /&gt;
           to setup quotas for user &amp;quot;chirico&amp;quot;. Shown below this user has used 161560 blocks, he has a soft&lt;br /&gt;
           limit of 1161560 and a hard limit of 900000. He has used 3085 inodes and has a soft limit of 10000&lt;br /&gt;
           and a hard limit of 12000.&lt;br /&gt;
&lt;br /&gt;
             $ edquota -f / chirico&lt;br /&gt;
&lt;br /&gt;
             Disk quotas for user chirico (uid 500):&lt;br /&gt;
               Filesystem                   blocks       soft       hard     inodes     soft     hard&lt;br /&gt;
               /dev/mapper/VolGroup00-LogVol00     161560    1161560     900000       3085    10000    12000&lt;br /&gt;
&lt;br /&gt;
           You can put quotas on groups as well. The following is done as root. See (TIP 186 and TIP 6) for creating&lt;br /&gt;
           groups and adding users to groups.&lt;br /&gt;
&lt;br /&gt;
             $ edquota -g share&lt;br /&gt;
&lt;br /&gt;
           If you create a sharable directory for anyone in the group &amp;quot;share&amp;quot; (TIP 6), quota restrictions against&lt;br /&gt;
           group &amp;quot;share&amp;quot; will only apply to files added in the &amp;quot;/home/share&amp;quot; directory. When user &amp;quot;chirico&amp;quot; creates&lt;br /&gt;
           files in &amp;quot;/home/share&amp;quot; they also go against this user quota as well. However, when files are created in&lt;br /&gt;
           his home directory they do not go against the &amp;quot;share&amp;quot; group.&lt;br /&gt;
&lt;br /&gt;
           Note - if you get errors when trying to run &amp;quot;edquota -g share&amp;quot;, turn quotas off &amp;quot;quotaoff /&amp;quot; and&lt;br /&gt;
                  run &amp;quot;quotacheck -avugm&amp;quot;. Then, turn the quotas back on &amp;quot;quotaon /&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           You can see the status of the group quota with the following command:&lt;br /&gt;
&lt;br /&gt;
             $ quota -g share&lt;br /&gt;
&lt;br /&gt;
        Step 7:&lt;br /&gt;
&lt;br /&gt;
           Turn on quotas with the &amp;quot;qutoaon&amp;quot; command. This command needs to be done with root privileges.&lt;br /&gt;
&lt;br /&gt;
             $ quotaon /&lt;br /&gt;
&lt;br /&gt;
        Step 8:&lt;br /&gt;
&lt;br /&gt;
           Check &amp;quot;/etc/quotatab&amp;quot; file for the correct entries. Note that when you do the &amp;quot;mount&amp;quot; command&lt;br /&gt;
           the filesystem returned needs to match what is in the &amp;quot;quotatab&amp;quot; file. I have noticed that this&lt;br /&gt;
           is not the case by default.&lt;br /&gt;
&lt;br /&gt;
             $ mount&lt;br /&gt;
             /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw,usrquota,grpquota)&lt;br /&gt;
&lt;br /&gt;
           So the &amp;quot;/etc/quotatab&amp;quot; must contain the following line.&lt;br /&gt;
&lt;br /&gt;
             /dev/mapper/VolGroup00-LogVol00: This is the Volume group&lt;br /&gt;
&lt;br /&gt;
        Step 9:&lt;br /&gt;
&lt;br /&gt;
           Run &amp;quot;warnquota&amp;quot; as a check that the &amp;quot;/etc/quotatab&amp;quot; files is setup correctly.&lt;br /&gt;
&lt;br /&gt;
              $ warnquota&lt;br /&gt;
&lt;br /&gt;
        Step 10:&lt;br /&gt;
&lt;br /&gt;
           Setup a daily cron job for running &amp;quot;warnquota&amp;quot;. The following should be placed&lt;br /&gt;
           in &amp;quot;/etc/cron.daily&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              #!/bin/sh&lt;br /&gt;
              # Place this file in /etc/cron.daily&lt;br /&gt;
              # with rights 0755&lt;br /&gt;
              /usr/sbin/warnquota&lt;br /&gt;
              EXITVALUE=$?&lt;br /&gt;
              if [ $EXITVALUE != 0 ]; then&lt;br /&gt;
                 /usr/bin/logger -t warnquota &amp;quot;ALERT exited abnormally with [$EXITVALUE]&amp;quot;&lt;br /&gt;
              fi&lt;br /&gt;
              exit 0&lt;br /&gt;
&lt;br /&gt;
      References:&lt;br /&gt;
        http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/sysadmin-guide/ch-disk-quotas.html&lt;br /&gt;
        (TIP 6, TIP 186, and TIP 205)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 168:&lt;br /&gt;
&lt;br /&gt;
     rdist - remote file distribution client program. You can use this program in combination with&lt;br /&gt;
     ssh. This program does more than just copy files. Once a file has been copied, you can dictate&lt;br /&gt;
     other actions to be performed. Or you can hold off copying all together if the destination is&lt;br /&gt;
     running low on inodes, or disk space.&lt;br /&gt;
&lt;br /&gt;
     For the purpose of this example, all commands will been run on &amp;quot;squeezel.squeezel.com&amp;quot;, and the&lt;br /&gt;
     computers that will be updated are &amp;quot;tape.squeezel.com&amp;quot; and &amp;quot;closet.squeezel.com&amp;quot;. Obviously, you&lt;br /&gt;
     would substitute your computer names.&lt;br /&gt;
&lt;br /&gt;
     It helps to setup ssh keys on each computer first. Reference [http://souptonuts.sourceforge.net/sshtips.htm]&lt;br /&gt;
     and (TIP 12).&lt;br /&gt;
&lt;br /&gt;
     Step 1: Create the Configuration file myDistfile&lt;br /&gt;
&lt;br /&gt;
       Below is my sample &amp;quot;myDistfile&amp;quot;. This file will access hosts &amp;quot;tape.squeezel.com&amp;quot; using username chirico&lt;br /&gt;
       and &amp;quot;closet.squeezel.com&amp;quot; with the username running this command, and copy the&lt;br /&gt;
       files &amp;quot;/home/chirico/file1&amp;quot; and &amp;quot;/home/chirico/file2&amp;quot; to the these two servers creating the&lt;br /&gt;
       directory ~/tmpdir if it doesn't exist. Once these files are updated, a mail check (&amp;quot;sendmail -bv&amp;quot;)&lt;br /&gt;
       will be performed, and mail will be sent to &amp;quot;chirico@squeezel&amp;quot;. This happens twice, once for each file.&lt;br /&gt;
&lt;br /&gt;
       Note, the line &amp;quot;/home/chirico/file2 -&amp;gt; tape.squeezel.com&amp;quot; which moves the file &amp;quot;file2&amp;quot; to&lt;br /&gt;
       tape.squeezel.com renaming the file to &amp;quot;tapedest&amp;quot; in the directory &amp;quot;/home/chirico&amp;quot;. Once this file&lt;br /&gt;
       is copied, the rights are modified to &amp;quot;chmod +r&amp;quot;.  Likewise, &amp;quot;/home/chirico/file2 -&amp;gt; closet.squeezel.com&amp;quot;&lt;br /&gt;
       copies the file file2, which is renamed as closetdest.&lt;br /&gt;
&lt;br /&gt;
                 # Contents of myDistfile&lt;br /&gt;
                 HOSTS = ( chirico@tape.squeezel.com closet.squeezel.com )&lt;br /&gt;
&lt;br /&gt;
                 FILES = ( /home/chirico/file1 /home/chirico/file2 )&lt;br /&gt;
&lt;br /&gt;
                 ${FILES} -&amp;gt; ${HOSTS}&lt;br /&gt;
                    # Directory tmpdir will be created if it doesn't exist&lt;br /&gt;
                    install tmpdir ;&lt;br /&gt;
                    special /home/chirico/file1  &amp;quot;/usr/sbin/sendmail -bv mchirico@gmail.com&amp;quot;;&lt;br /&gt;
                    notify chirico@squeezel;&lt;br /&gt;
&lt;br /&gt;
                 /home/chirico/file2 -&amp;gt; tape.squeezel.com&lt;br /&gt;
                    install  /home/chirico/tapedest;&lt;br /&gt;
                    special  /home/chirico/tapedest &amp;quot;chmod +r /home/chirico/tapedest&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
                 /home/chirico/file2 -&amp;gt; closet.squeezel.com&lt;br /&gt;
                    install /home/chirico/closetdest;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 2: Command from squeezel.squeezel.com to run myDistfile above&lt;br /&gt;
&lt;br /&gt;
       Below is the command that will execute the contents in &amp;quot;myDistfile&amp;quot;. This command is run from the&lt;br /&gt;
       computer &amp;quot;squeezel.squeezel.com&amp;quot;. All output will go in the file &amp;quot;cmd1rdist.log&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ rdist -P /usr/local/bin/ssh -f ./myDistfile -l file=./cmd1rdist.log=all&lt;br /&gt;
&lt;br /&gt;
       Obviously you want a secure copy (using scp), so the -P option uses ssh as your secure&lt;br /&gt;
       transport mechanism.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 169:&lt;br /&gt;
&lt;br /&gt;
     Restricting root logins (/etc/securetty). ctl-alt-F4 will give you a prompt for tty3. Note&lt;br /&gt;
     that it is one number less. Take a look at the contents of &amp;quot;/etc/securetty&amp;quot;. To prevent&lt;br /&gt;
     root from logging in on this device, take out tty3 from this listing. Note, you can always&lt;br /&gt;
     login as another user, then, su to root.  Below is an example of the default&lt;br /&gt;
     &amp;quot;/etc/securetty&amp;quot; that allows root to login to everything.&lt;br /&gt;
&lt;br /&gt;
         [root@squeezel ~]# cat /etc/securetty&lt;br /&gt;
         console&lt;br /&gt;
         vc/1&lt;br /&gt;
         vc/2&lt;br /&gt;
         vc/3&lt;br /&gt;
         vc/4&lt;br /&gt;
         vc/5&lt;br /&gt;
         vc/6&lt;br /&gt;
         vc/7&lt;br /&gt;
         vc/8&lt;br /&gt;
         vc/9&lt;br /&gt;
         vc/10&lt;br /&gt;
         vc/11&lt;br /&gt;
         tty1&lt;br /&gt;
         tty2&lt;br /&gt;
         tty3&lt;br /&gt;
         tty4&lt;br /&gt;
         tty5&lt;br /&gt;
         tty6&lt;br /&gt;
         tty7&lt;br /&gt;
         tty8&lt;br /&gt;
         tty9&lt;br /&gt;
         tty10&lt;br /&gt;
         tty11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 170:&lt;br /&gt;
&lt;br /&gt;
     Perl map function. Try the following to get a quick take on this function,&lt;br /&gt;
     which increments each value in the array a;&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map {$_++} @a;&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot; } @a;&lt;br /&gt;
&lt;br /&gt;
     or&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     And you can easily make modifications, like reversing the order&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     Plus there is a grep() function that works on each element as well&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse grep{ $_ &amp;gt; 3} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     To get only odd numbers in reverse order:&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse grep{ !($_ % 2)} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference: http://www-128.ibm.com/developerworks/linux/library/l-road4.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 171:&lt;br /&gt;
&lt;br /&gt;
     Perl - subroutine call and shifting through variables. A simple and useful&lt;br /&gt;
     technique.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          sub test {&lt;br /&gt;
            local $mval;&lt;br /&gt;
            while( $mval = shift ) {&lt;br /&gt;
              print &amp;quot; $mval\n&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          test(&amp;quot;one&amp;quot;,&amp;quot;two&amp;quot;,&amp;quot;three&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 172:&lt;br /&gt;
&lt;br /&gt;
     Tcp wrappers - First &amp;quot;/etc/hosts.allow&amp;quot; is check, and if there is an entry in this file, no more&lt;br /&gt;
     checking it done.  If are no matches in &amp;quot;/etc/hosts.allow&amp;quot;, the &amp;quot;/etc/hosts.deny&amp;quot; file is checked&lt;br /&gt;
     and if a match is found, that service is blocked for that host.&lt;br /&gt;
&lt;br /&gt;
     Example &amp;quot;/etc/hosts.deny&amp;quot; file:&lt;br /&gt;
&lt;br /&gt;
         sshd: 192.168.1.171&lt;br /&gt;
&lt;br /&gt;
     The above file blocks access to computer 192.168.1.171. It's also possible to run commands when&lt;br /&gt;
     someone from this computer tries to ssh in. This example sends mail.&lt;br /&gt;
&lt;br /&gt;
         sshd: 192.168.1.171: spawn (echo -e &amp;quot;%d %h %H %u&amp;quot;| /bin/mail -s 'hosts.deny entry' root)&lt;br /&gt;
&lt;br /&gt;
     Of course, you can also run commands in the &amp;quot;/etc/hosts.allow&amp;quot; if you wanted mail sent for a successful&lt;br /&gt;
     login.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 173:&lt;br /&gt;
&lt;br /&gt;
     pgrep, pkill - look up or signal process based on name and other attributes.&lt;br /&gt;
&lt;br /&gt;
     To quick find all instances of ssh running, for user root, execute the following&lt;br /&gt;
     command:&lt;br /&gt;
&lt;br /&gt;
           $ pgrep -u root -l ssh&lt;br /&gt;
&lt;br /&gt;
     To kill a process, or send a signal use the &amp;quot;pkill&amp;quot; option. For example, to&lt;br /&gt;
     make syslog reread its configuration file:&lt;br /&gt;
&lt;br /&gt;
           $ pkill -HUP syslogd&lt;br /&gt;
&lt;br /&gt;
     Another command command is &amp;quot;pidof&amp;quot; that can tell you how many processes are running.&lt;br /&gt;
     This can be useful for detecting DOS attacks.&lt;br /&gt;
&lt;br /&gt;
           $ pidof sshd&lt;br /&gt;
           4783 4781 30008 30006 29888 29886 2246&lt;br /&gt;
&lt;br /&gt;
     Above there are 7 sshd's running. Reference &amp;quot;Tcpdump, Raw Socket and Libpap Tutorial&amp;quot;&lt;br /&gt;
     at [http://souptonuts.sourceforge.net/tcpdump_tutorial.html].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 174:&lt;br /&gt;
&lt;br /&gt;
     Password Cracking - tools to check your users passwords:&lt;br /&gt;
&lt;br /&gt;
      John The Ripper&lt;br /&gt;
        http://www.openwall.com/john/&lt;br /&gt;
&lt;br /&gt;
      Crack&lt;br /&gt;
        http://www.crypticide.com/users/alecm/&lt;br /&gt;
&lt;br /&gt;
      Slurpie&lt;br /&gt;
        http://www.ussrback.com/distributed.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 175:&lt;br /&gt;
&lt;br /&gt;
     Password Aging - setting the number of days a password is valid.&lt;br /&gt;
&lt;br /&gt;
         $ chage -M 90 &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 176:&lt;br /&gt;
&lt;br /&gt;
     Kernel Performance Tuning - /Documentation/sysctl/vm.txt documents kernel settings to&lt;br /&gt;
     improve performance. Below are some examples.&lt;br /&gt;
&lt;br /&gt;
       overcommit_memory:  0 -- default estimates the amount of memory for malloc&lt;br /&gt;
                           1 -- kernel pretends there is always enough memory until it runs out&lt;br /&gt;
                           3 -- never overcommit&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/overcommit_memory&lt;br /&gt;
          0&lt;br /&gt;
&lt;br /&gt;
       page-cluster:&lt;br /&gt;
            The Linux VM subsystem avoids excessive disk seeks by reading&lt;br /&gt;
            multiple pages on a page fault. The number of pages it reads&lt;br /&gt;
            is dependent on the amount of memory in your machine.&lt;br /&gt;
        &lt;br /&gt;
            The number of pages the kernel reads in at once is equal to&lt;br /&gt;
            2 ^ page-cluster. Values above 2 ^ 5 don't make much sense&lt;br /&gt;
            for swap because we only cluster swap data in 32-page groups.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/page-cluster&lt;br /&gt;
          3&lt;br /&gt;
&lt;br /&gt;
       min_free_kbytes:&lt;br /&gt;
            This is used to force the Linux VM to keep a minimum number&lt;br /&gt;
            of kilobytes free.  The VM uses this number to compute a pages_min&lt;br /&gt;
            value for each lowmem zone in the system.  Each lowmem zone gets&lt;br /&gt;
            a number of reserved free pages based proportionally on its size.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/min_free_kbytes&lt;br /&gt;
          3831&lt;br /&gt;
&lt;br /&gt;
       max_map_count:&lt;br /&gt;
            This file contains the maximum number of memory map areas a process&lt;br /&gt;
            may have. Memory map areas are used as a side-effect of calling&lt;br /&gt;
            malloc, directly by mmap and mprotect, and also when loading shared&lt;br /&gt;
            libraries.&lt;br /&gt;
&lt;br /&gt;
            While most applications need less than a thousand maps, certain&lt;br /&gt;
            programs, particularly malloc debuggers, may consume lots of them,&lt;br /&gt;
            e.g., up to one or two maps per allocation.&lt;br /&gt;
&lt;br /&gt;
            The default value is 65536.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/max_map_count&lt;br /&gt;
          65536&lt;br /&gt;
&lt;br /&gt;
        Also see http://people.redhat.com/alikins/system_tuning.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 177:&lt;br /&gt;
&lt;br /&gt;
     IO Scheduler - /Documentation/block/as-iosched.txt documents kernel settings for disk&lt;br /&gt;
     performance.&lt;br /&gt;
&lt;br /&gt;
     If you're not sure what partitions you have &amp;quot;$ cat /proc/partitions&amp;quot;. This example&lt;br /&gt;
     assumes hda, and you can see some of the kernel settings:&lt;br /&gt;
&lt;br /&gt;
          $ ls /sys/block/hda/queue/iosched&lt;br /&gt;
          back_seek_max  back_seek_penalty  clear_elapsed  fifo_batch_expire  fifo_expire_async&lt;br /&gt;
           fifo_expire_sync  find_best_crq  key_type  quantum  queued&lt;br /&gt;
&lt;br /&gt;
     References: http://lwn.net/Articles/102505/&lt;br /&gt;
                 http://bhhdoa.org.au/pipermail/ck/2004-September/000961.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 178:&lt;br /&gt;
&lt;br /&gt;
     iozone -- getting data on disk performance (http://www.iozone.org/). This is a very&lt;br /&gt;
     comprehensive package.&lt;br /&gt;
&lt;br /&gt;
           $ wget http://www.iozone.org/src/current/iozone3_242.tar&lt;br /&gt;
           $ tar -xf iozone3_242.tar&lt;br /&gt;
           $ cd iozone3_242/src/current&lt;br /&gt;
           $ make linux&lt;br /&gt;
&lt;br /&gt;
     At this point you should read the documentation. There is no &amp;quot;make install&amp;quot;. You&lt;br /&gt;
     copy it to each filesystem you want to run this program on. Below are some quick&lt;br /&gt;
     start commands.&lt;br /&gt;
&lt;br /&gt;
       Good comprehensive test.&lt;br /&gt;
&lt;br /&gt;
           $ iozone -a&lt;br /&gt;
&lt;br /&gt;
       I prefer this for small filesystems. It limits the record size to 10000 and does&lt;br /&gt;
       the output in operations per second (higher numbers mean faster drive).&lt;br /&gt;
&lt;br /&gt;
           $ ./iozone -a -s 10000 -O&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 179:&lt;br /&gt;
&lt;br /&gt;
     history - bash command to get a history of all commands typed. But, here is a way&lt;br /&gt;
     that you can get date and time listed as well.&lt;br /&gt;
&lt;br /&gt;
           $ HISTTIMEFORMAT=&amp;quot;%y/%m/%d %T &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Defining the environment variable above give you the date/time info when you&lt;br /&gt;
     execute history:&lt;br /&gt;
&lt;br /&gt;
           $ history&lt;br /&gt;
              ...&lt;br /&gt;
               175  05/06/30 12:51:46 grep '141.162.' mout &amp;gt; mout2&lt;br /&gt;
               176  05/06/30 12:51:48 e mout2&lt;br /&gt;
               177  05/06/30 12:56:59 ls&lt;br /&gt;
               178  05/06/30 12:57:02 ls&lt;br /&gt;
               179  05/06/30 12:57:39 ls&lt;br /&gt;
               180  05/06/30 12:57:49 ls -l&lt;br /&gt;
               181  05/06/30 13:01:10 history&lt;br /&gt;
               182  05/06/30 13:01:20 HISTTIMEFORMAT=&amp;quot;%y/%m/%d %T &amp;quot;&lt;br /&gt;
               183  05/06/30 13:01:23 history&lt;br /&gt;
              ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 180:&lt;br /&gt;
&lt;br /&gt;
     .config - Fedora Core getting the .config to rebuild the kernel. You can find&lt;br /&gt;
     this file, the &amp;quot;.config&amp;quot; file at the following location:&lt;br /&gt;
&lt;br /&gt;
          $ ls &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Or, to see the contents&lt;br /&gt;
&lt;br /&gt;
          $ cat &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     This can be important, if you're planning to build your own kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 181:&lt;br /&gt;
&lt;br /&gt;
     Listing control key settings.&lt;br /&gt;
&lt;br /&gt;
          $ stty -a&lt;br /&gt;
          speed 38400 baud; rows 0; columns 0; line = 0;&lt;br /&gt;
          intr = ^C; quit = ^\; erase = &amp;lt;undef&amp;gt;; kill = &amp;lt;undef&amp;gt;; eof = ^D; eol = &amp;lt;undef&amp;gt;; eol2 = &amp;lt;undef&amp;gt;; start = ^Q;&lt;br /&gt;
          stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;&lt;br /&gt;
          -parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts&lt;br /&gt;
          -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel&lt;br /&gt;
          opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0&lt;br /&gt;
          isig icanon iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 182:&lt;br /&gt;
&lt;br /&gt;
     iptables DNAT and SNAT. You have a webserver on 192.168.1.71. When people query this webserver, you want them&lt;br /&gt;
     to goto 192.168.1.81, with no indication that they are going to another web server. In fact, they always make&lt;br /&gt;
     their web hits to 192.168.1.71.&lt;br /&gt;
&lt;br /&gt;
     The following is the iptables commands:&lt;br /&gt;
&lt;br /&gt;
        $ echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
        $ iptables -t nat -A PREROUTING -d 192.168.1.71 -p tcp --dport 80 -j DNAT --to 192.168.1.81&lt;br /&gt;
        $ iptables -t nat -A POSTROUTING -d 192.168.1.81 -s 192.168.1.0/24 -p tcp --dport 80 -j SNAT --to 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
     Change 192.168.1.0/24 to whatever source you expect the web browser to come in on. Below is the tcpdump showing&lt;br /&gt;
     all traffic is relayed via 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
         [root@closet iptables]# tcpdump -nN port 80&lt;br /&gt;
&lt;br /&gt;
         17:34:58.790398 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: S 3620106373:3620106373(0) win 16384 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790465 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: S 3620106373:3620106373(0) win 16384 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790703 IP 192.168.1.81.80 &amp;gt; 192.168.1.71.1158: S 1973665156:1973665156(0) ack 3620106374 win 5840 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790720 IP 192.168.1.71.80 &amp;gt; 192.168.1.102.1158: S 1973665156:1973665156(0) ack 3620106374 win 5840 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790951 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: . ack 1 win 17520&lt;br /&gt;
         17:34:58.790965 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: . ack 1 win 17520&lt;br /&gt;
         17:34:58.791451 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: P 1:327(326) ack 1 win 17520&lt;br /&gt;
         17:34:58.791472 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: P 1:327(326) ack 1 win 17520&lt;br /&gt;
         17:34:58.791973 IP 192.168.1.81.80 &amp;gt; 192.168.1.71.1158: . ack 327 win 6432&lt;br /&gt;
&lt;br /&gt;
     Above the web client is on &amp;quot;192.168.1.102&amp;quot;. You can see that the 1st server &amp;quot;192.168.1.71&amp;quot; then goes out to&lt;br /&gt;
     the 2nd server &amp;quot;192.168.1.81&amp;quot; on the second line. The third line shows the 2nd server &amp;quot;192.168.1.81&amp;quot; responding to&lt;br /&gt;
     the 1st server, and the forth line passes this data back to the web client &amp;quot;192.168.1.102&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Note: You can save your current iptables setting with the following command:&lt;br /&gt;
&lt;br /&gt;
         $ iptables-save &amp;gt; iptables_store&lt;br /&gt;
&lt;br /&gt;
       The big advantage is that you can store the counters as well.&lt;br /&gt;
&lt;br /&gt;
         $ iptables-save -c &amp;gt; iptables_store_w_cnts&lt;br /&gt;
&lt;br /&gt;
       To restore the file, use the following:&lt;br /&gt;
&lt;br /&gt;
         $ iptables-restore -c &amp;lt; iptables_store_w_cnts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 183:&lt;br /&gt;
&lt;br /&gt;
     mailstats - display mail statistics. This file reads data from &amp;quot;/var/log/mail/statistics&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         [root@closet ~]# mailstats&lt;br /&gt;
         Statistics from Sat Jun 25 15:59:52 2005&lt;br /&gt;
          M   msgsfr  bytes_from   msgsto    bytes_to  msgsrej msgsdis msgsqur  Mailer&lt;br /&gt;
          4        1          2K        0          0K        0       0       0  esmtp&lt;br /&gt;
          9        0          0K        1          2K        0       0       0  local&lt;br /&gt;
         =====================================================================&lt;br /&gt;
          T        1          2K        1          2K        0       0       0&lt;br /&gt;
          C        1                    0                    0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 184:&lt;br /&gt;
&lt;br /&gt;
     Profiling C Applications - Assume you have the following program p1.c:&lt;br /&gt;
&lt;br /&gt;
         /* Program  p1.c */&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
         t1(int i)&lt;br /&gt;
         {&lt;br /&gt;
                 printf(&amp;quot;t1:%d\n&amp;quot;, i);&lt;br /&gt;
         }&lt;br /&gt;
        &lt;br /&gt;
         t2(int j)&lt;br /&gt;
         {&lt;br /&gt;
                 printf(&amp;quot;t2:%d\n&amp;quot;, j);&lt;br /&gt;
         }&lt;br /&gt;
        &lt;br /&gt;
         int main(void)&lt;br /&gt;
         {&lt;br /&gt;
                 int i, j;&lt;br /&gt;
        &lt;br /&gt;
                 for (i = 0; i &amp;lt; 5; ++i) {&lt;br /&gt;
                         t1(i);&lt;br /&gt;
                         for (j = 0; j &amp;lt; 2; ++j) {&lt;br /&gt;
                                 t2(j);&lt;br /&gt;
                         }&lt;br /&gt;
                 }&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
     Compile the program as follows:&lt;br /&gt;
&lt;br /&gt;
        $ gcc -pg -g -o p1 p1.c&lt;br /&gt;
        $ ./p1&lt;br /&gt;
        t1:0&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:1&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:2&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:3&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:4&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
&lt;br /&gt;
     Next, to get the profile graph.&lt;br /&gt;
&lt;br /&gt;
        $ gprof -p -b p1&lt;br /&gt;
        Flat profile:&lt;br /&gt;
        &lt;br /&gt;
        Each sample counts as 0.01 seconds.&lt;br /&gt;
         no time accumulated&lt;br /&gt;
        &lt;br /&gt;
          %   cumulative   self              self     total&lt;br /&gt;
         time   seconds   seconds    calls  Ts/call  Ts/call  name&lt;br /&gt;
          0.00      0.00     0.00       10     0.00     0.00  t2&lt;br /&gt;
          0.00      0.00     0.00        5     0.00     0.00  t1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Above note the 10 calls to t2 and 5 calls to t1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 185:&lt;br /&gt;
&lt;br /&gt;
     CDPATH - this is a bash variable like PATH that defines a search path&lt;br /&gt;
              for the cd command.&lt;br /&gt;
&lt;br /&gt;
     Suppose you have the following directory structure:&lt;br /&gt;
&lt;br /&gt;
             /home/chirico/stuff&lt;br /&gt;
                               |-- dirA&lt;br /&gt;
                               `-- dirB&lt;br /&gt;
&lt;br /&gt;
     Assume you define CDPATH as follows:&lt;br /&gt;
&lt;br /&gt;
             CDPATH=/home/chirico/stuff&lt;br /&gt;
&lt;br /&gt;
     Now, no matter what directory you are in if you use the cd command below&lt;br /&gt;
     you will automatically move to &amp;quot;/home/chirico/stuff/dirA&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             $ cd dirA&lt;br /&gt;
&lt;br /&gt;
     Note you could be in &amp;quot;/etc&amp;quot; and will move directly to &amp;quot;/home/chirico/stuff/dirA&amp;quot;.&lt;br /&gt;
     This command has the same format as PATH - multiple entries are separated by a colon.&lt;br /&gt;
     If the current directory contain a sub-directory dirA, then, it gets priority.&lt;br /&gt;
&lt;br /&gt;
     The following is part of my .bash_profile&lt;br /&gt;
&lt;br /&gt;
             CDPATH=/work/cpearls/src/posted_on_sf/:/work/souptonuts/documentation/:/home/chirico/deleteme/&lt;br /&gt;
             export PATH CVS_RSH EDITOR JAVA_HOME CDPATH&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 186:&lt;br /&gt;
&lt;br /&gt;
     Groups - add groups and users to groups. The following shows how to create the group &amp;quot;share&amp;quot;&lt;br /&gt;
              and add the user &amp;quot;chirico&amp;quot; to this group. The following should be done as root, and&lt;br /&gt;
              assumes the account &amp;quot;chirico&amp;quot; already exits.&lt;br /&gt;
&lt;br /&gt;
             $ groupadd share&lt;br /&gt;
             $ usermod -G share chirico&lt;br /&gt;
&lt;br /&gt;
     Note the change made to &amp;quot;/etc/group&amp;quot; below:&lt;br /&gt;
&lt;br /&gt;
             $ cat /etc/group|grep 'share'&lt;br /&gt;
             share:x:616:chirico&lt;br /&gt;
&lt;br /&gt;
     If the user chirico is currently logged in, he should run the following&lt;br /&gt;
     command to immediately have group &amp;quot;share&amp;quot; rights. Or, the next time he logs&lt;br /&gt;
     in he will have access to this group.&lt;br /&gt;
&lt;br /&gt;
             $ newgrp share&lt;br /&gt;
&lt;br /&gt;
     Reference the following (TIP 6, TIP 167).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 187:&lt;br /&gt;
&lt;br /&gt;
     oprofile - steps for running oprofile on Fedora.&lt;br /&gt;
&lt;br /&gt;
     Step 1:&lt;br /&gt;
&lt;br /&gt;
       Find out what version of the kernel you are running.&lt;br /&gt;
&lt;br /&gt;
           $ uname -a&lt;br /&gt;
           Linux closet.squeezel.com 2.6.12-1.1398_FC4 #1 Fri Jul 15 00:52:32 EDT 2005 i686 i686 i386 GNU/Linux&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 2:&lt;br /&gt;
&lt;br /&gt;
       Download the source in a chosen directory. Above, I'm running 2.6.12-1, but I'm going to go for 2.6.12.3, since&lt;br /&gt;
       it's a little later. You want the signed file as well.&lt;br /&gt;
&lt;br /&gt;
           $ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.12.3.tar.gz&lt;br /&gt;
           $ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.12.3.tar.gz.sign&lt;br /&gt;
&lt;br /&gt;
       Now, check the signature.&lt;br /&gt;
&lt;br /&gt;
           $ gpg --verify linux-2.6.12.3.tar.gz.sign linux-2.6.12.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 3:&lt;br /&gt;
&lt;br /&gt;
       Unpack the file.&lt;br /&gt;
&lt;br /&gt;
           $ tar -xzf linux-2.6.12.3.tar.gz&lt;br /&gt;
           $ cd cd linux-2.6.12.3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 4:&lt;br /&gt;
&lt;br /&gt;
       Copy the &amp;quot;.config&amp;quot; used to compile your previous kernel. You should find it&lt;br /&gt;
       in the following direcotry &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       Copy it to the linux-2.6.12.3 directory.&lt;br /&gt;
&lt;br /&gt;
           $ cp &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot; .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 5:&lt;br /&gt;
&lt;br /&gt;
       Run make as follows. It will ask for a few questions on &amp;quot;make oldconfig&amp;quot;. The&lt;br /&gt;
       make installs below will have to be done with root privileges.&lt;br /&gt;
&lt;br /&gt;
          $ make oldconfig&lt;br /&gt;
          $ make bzImage&lt;br /&gt;
          $ make modules&lt;br /&gt;
          $ make modules_install&lt;br /&gt;
          $ make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 6:&lt;br /&gt;
&lt;br /&gt;
       Edit the &amp;quot;/boot/grub/grub.conf&amp;quot; and set default = 0  as shown below in this&lt;br /&gt;
       file.&lt;br /&gt;
&lt;br /&gt;
            default=0&lt;br /&gt;
            timeout=5&lt;br /&gt;
            splashimage=(hd0,2)/grub/splash.xpm.gz&lt;br /&gt;
            hiddenmenu&lt;br /&gt;
            title Fedora Core (2.6.12.3)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.12.3 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.12.3.img&lt;br /&gt;
            title Fedora Core (2.6.12-1.1398_FC4)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.12-1.1398_FC4 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.12-1.1398_FC4.img&lt;br /&gt;
            title Fedora Core (2.6.11-1.1369_FC4)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.11-1.1369_FC4 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.11-1.1369_FC4.img&lt;br /&gt;
            title Other&lt;br /&gt;
                    rootnoverify (hd0,1)&lt;br /&gt;
                    chainloader +1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 7:&lt;br /&gt;
&lt;br /&gt;
       Shutdown with the restart option.&lt;br /&gt;
&lt;br /&gt;
           $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 8:&lt;br /&gt;
&lt;br /&gt;
       Run opcontrol. The commands below are done as root.  My kernel was compiled in the following&lt;br /&gt;
       directory &amp;quot;/home/kernel/linux-2.6.12.3/&amp;quot;, so I'll run opcontrol as follows:&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --vmlinux=/home/kernel/linux-2.6.12.3/vmlinux&lt;br /&gt;
&lt;br /&gt;
       Now start.&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --start&lt;br /&gt;
           Using 2.6+ OProfile kernel interface.&lt;br /&gt;
           Reading module info.&lt;br /&gt;
           Using log file /var/lib/oprofile/oprofiled.log&lt;br /&gt;
           Daemon started.&lt;br /&gt;
           Profiler running.&lt;br /&gt;
&lt;br /&gt;
       Shutdown opcontrol.&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --shutdown&lt;br /&gt;
&lt;br /&gt;
       Run report.&lt;br /&gt;
&lt;br /&gt;
           $ opreport&lt;br /&gt;
&lt;br /&gt;
           CPU: CPU with timer interrupt, speed 0 MHz (estimated)&lt;br /&gt;
           Profiling through timer interrupt&lt;br /&gt;
                     TIMER:0|&lt;br /&gt;
             samples|      %|&lt;br /&gt;
           ------------------&lt;br /&gt;
              156088 99.8746 vmlinux&lt;br /&gt;
                  60  0.0384 libc-2.3.5.so&lt;br /&gt;
                  30  0.0192 oprofiled&lt;br /&gt;
                  23  0.0147 libcrypto.so.0.9.7f&lt;br /&gt;
                  13  0.0083 bash&lt;br /&gt;
                  12  0.0077 screen&lt;br /&gt;
                  10  0.0064 sshd&lt;br /&gt;
                   9  0.0058 ssh&lt;br /&gt;
                   6  0.0038 ip_tables&lt;br /&gt;
                   6  0.0038 libncurses.so.5.4&lt;br /&gt;
                   5  0.0032 b44&lt;br /&gt;
                   5  0.0032 ext3&lt;br /&gt;
                   5  0.0032 ld-2.3.5.so&lt;br /&gt;
                   4  0.0026 ip_conntrack&lt;br /&gt;
                   4  0.0026 jbd&lt;br /&gt;
                   2  0.0013 grep&lt;br /&gt;
                   1 6.4e-04 libdns.so.20.0.2&lt;br /&gt;
                   1 6.4e-04 libisc.so.9.1.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Reference the following for more documentation:&lt;br /&gt;
             http://oprofile.sourceforge.net/doc/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 188:&lt;br /&gt;
&lt;br /&gt;
     cyrus-imapd with Postfix using sasldb for authentication. For this example&lt;br /&gt;
     the server is tape.squeezel.com and the user is chirico.&lt;br /&gt;
&lt;br /&gt;
        Step 1:&lt;br /&gt;
        &lt;br /&gt;
                   $ yum install cyrus-imapd&lt;br /&gt;
                   $ yum install cyrus-imapd-utils&lt;br /&gt;
        &lt;br /&gt;
            You need &amp;quot;cyrus-imapd-utils&amp;quot; for cyradm.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 2:&lt;br /&gt;
        &lt;br /&gt;
          Edit /etc/imapd.conf&lt;br /&gt;
        &lt;br /&gt;
               configdirectory: /var/lib/imap&lt;br /&gt;
               partition-default: /var/spool/imap&lt;br /&gt;
               admins: cyrus&lt;br /&gt;
               sievedir: /var/lib/imap/sieve&lt;br /&gt;
               sendmail: /usr/sbin/sendmail&lt;br /&gt;
               hashimapspool: true&lt;br /&gt;
               # Chirico Commented the below line&lt;br /&gt;
               # sasl_pwcheck_method: saslauthd&lt;br /&gt;
               # Because using sasldb&lt;br /&gt;
               sasl_pwcheck_method: auxprop&lt;br /&gt;
               sasl_auxprop_plugin: sasldb&lt;br /&gt;
               #  Chirico end change&lt;br /&gt;
               sasl_mech_list: PLAIN&lt;br /&gt;
               tls_cert_file: /usr/share/ssl/certs/cyrus-imapd.pem&lt;br /&gt;
               tls_key_file: /usr/share/ssl/certs/cyrus-imapd.pem&lt;br /&gt;
               tls_ca_file: /usr/share/ssl/certs/ca-bundle.crt&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 3:&lt;br /&gt;
        &lt;br /&gt;
           Create a user and password:&lt;br /&gt;
        &lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` cyrus&lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` chirico&lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` allmail&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
           This will automatically create the file /etc/sasldb2. But look&lt;br /&gt;
           at the default rights, assuming you ran saslpasswd2 as root:&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /etc/sasldb2&lt;br /&gt;
                 -rw-r-----  1 root root 12288 Jul 31 09:50 /etc/sasldb2&lt;br /&gt;
        &lt;br /&gt;
           We need to correct this in step 4.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 4:&lt;br /&gt;
        &lt;br /&gt;
                 $ chown root.mail /etc/sasldb2&lt;br /&gt;
                 $ ls -l /etc/sasldb2&lt;br /&gt;
                 -rw-r-----  1 root mail 12288 Jul 31 09:50 /etc/sasldb2&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 5:&lt;br /&gt;
        &lt;br /&gt;
            Update &amp;quot;/etc/postfix/main.cf&amp;quot;. Note in /etc/imapd.conf the configdirectory&lt;br /&gt;
            points to /var/lib/imap, and if I look at this directory I see the&lt;br /&gt;
            socket directory. However, after staring /etc/init.d/cyrus-imapd  there&lt;br /&gt;
            will be a socket file &amp;quot;/var/lib/imap/socket/lmtp&amp;quot;. (See step 6).&lt;br /&gt;
        &lt;br /&gt;
                  mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp&lt;br /&gt;
                  mailbox_transport = cyrus&lt;br /&gt;
        &lt;br /&gt;
            Restart postfix.&lt;br /&gt;
        &lt;br /&gt;
                  /etc/init.d/postfix restart&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 6:&lt;br /&gt;
&lt;br /&gt;
            Start cyrus-imapd and look for the socket file.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
                   $ /etc/init.d/cyrus-imapd restart&lt;br /&gt;
                   Shutting down cyrus-imapd:                                 [  OK  ]&lt;br /&gt;
                   Starting cyrus-imapd: preparing databases... done.         [  OK  ]&lt;br /&gt;
        &lt;br /&gt;
            Now you should see the lmtp file:&lt;br /&gt;
        &lt;br /&gt;
                   $ ls -l /var/lib/imap/socket/lmtp&lt;br /&gt;
                   srwxrwxrwx  1 root root 0 Jul 31 10:04 /var/lib/imap/socket/lmtp&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 7:&lt;br /&gt;
        &lt;br /&gt;
            Add users. Note, you may have to go back to step 3 to add them to /etc/sasldb2&lt;br /&gt;
            as well.&lt;br /&gt;
        &lt;br /&gt;
                   $ su - cyrus&lt;br /&gt;
                   $ cyradm tape.squeezel.com&lt;br /&gt;
                   tape.squeezel.com&amp;gt; cm user.chirico&lt;br /&gt;
                   tape.squeezel.com&amp;gt; quit&lt;br /&gt;
        &lt;br /&gt;
            Now got back as root, and check that everything was created correctly.&lt;br /&gt;
        &lt;br /&gt;
                   $ ls /var/spool/imap/c/user/&lt;br /&gt;
                   total 8&lt;br /&gt;
                   drwx------  2 cyrus mail 4096 Jul 31 10:21 chirico&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 8:&lt;br /&gt;
        &lt;br /&gt;
             Run a mail test. We'll do this as root to the chirico account.&lt;br /&gt;
        &lt;br /&gt;
                   $ mail -s 'First test'  chirico&lt;br /&gt;
                   first test&lt;br /&gt;
                   .&lt;br /&gt;
        &lt;br /&gt;
             Now, still as root check the maillog. Normally everything should work.&lt;br /&gt;
        &lt;br /&gt;
                  $ tail /var/log/maillog&lt;br /&gt;
        &lt;br /&gt;
             However, I got the following error below.&lt;br /&gt;
&lt;br /&gt;
                     Jul 31 10:29:03 tape postfix/cleanup[30124]: AE7CB1B34A4: message-id=&amp;lt;20050731142903.AE7CB1B34A4@tape.squeezel.com&amp;gt;&lt;br /&gt;
                     Jul 31 10:29:03 tape postfix/qmgr[30120]: AE7CB1B34A4: from=&amp;lt;root@tape.squeezel.com&amp;gt;, size=315, nrcpt=1 (queue active)&lt;br /&gt;
                     Jul 31 10:29:03 tape pipe[30128]: fatal: pipe_comand: execvp /cyrus/bin/deliver: No such file or directory&lt;br /&gt;
&lt;br /&gt;
             If you get a similiar error, you may need to adjust the settting in /etc/postfix/master.cf&lt;br /&gt;
        &lt;br /&gt;
                 # This is the problem in /etc/postfix/master.cf&lt;br /&gt;
                 cyrus     unix  -       n       n       -       -       pipe&lt;br /&gt;
                   user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}&lt;br /&gt;
        &lt;br /&gt;
             My deliver file is the following&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
                 -rwxr-xr-x  1 root root 846228 Apr  4 18:59 /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
        &lt;br /&gt;
             So I need to change my /etc/postfix/master.cf as follows:&lt;br /&gt;
        &lt;br /&gt;
                 # Fix because by deliver file is under  /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
                 cyrus     unix  -       n       n       -       -       pipe&lt;br /&gt;
                   user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -r ${sender} -m ${extension} ${user}&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
             If changes were needed, like I had to do, restart postfix&lt;br /&gt;
        &lt;br /&gt;
                 $ /etc/init.d/postfix restart&lt;br /&gt;
        &lt;br /&gt;
             Now, if everything works, you should start to see numbers in the spool directory like &amp;quot;1.&amp;quot; and&lt;br /&gt;
             &amp;quot;2.&amp;quot;.&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /var/spool/imap/c/user/chirico/&lt;br /&gt;
                 total 40&lt;br /&gt;
                 -rw-------  1 cyrus mail  545 Jul 31 10:44 1.&lt;br /&gt;
                 -rw-------  1 cyrus mail  547 Jul 31 10:45 2.&lt;br /&gt;
                 -rw-------  1 cyrus mail 1276 Jul 31 10:45 cyrus.cache&lt;br /&gt;
                 -rw-------  1 cyrus mail  153 Jul 31 10:21 cyrus.header&lt;br /&gt;
                 -rw-------  1 cyrus mail  196 Jul 31 10:45 cyrus.index&lt;br /&gt;
&lt;br /&gt;
        Step 9:&lt;br /&gt;
        &lt;br /&gt;
             Local firewall.&lt;br /&gt;
        &lt;br /&gt;
                 # imap&lt;br /&gt;
                iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 143 -j ACCEPT&lt;br /&gt;
                iptables -A INPUT -p tcp -s 192.168.1.0/24  --dport 143 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        Step 10:&lt;br /&gt;
        &lt;br /&gt;
             Configure cyrus-imapd to start for run-level 3 and 5.&lt;br /&gt;
&lt;br /&gt;
                 # chkconfig --level 35 cyrus-imapd on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       HINTS - &lt;br /&gt;
&lt;br /&gt;
        Something to watch out for:&lt;br /&gt;
&lt;br /&gt;
              Something to watch out for: If a user creates a .forward file in their shell account with the&lt;br /&gt;
              following entry, then, mail will not get mail relayed to cyrus.&lt;br /&gt;
&lt;br /&gt;
                  &amp;quot;|exec /usr/bin/procmail&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             The /etc/maillog will show something like this:&lt;br /&gt;
&lt;br /&gt;
                    to=&amp;lt;chirico@squeezel.squeezel.com&amp;gt;, orig_to=&amp;lt;chirico&amp;gt;, relay=local, delay=0,&lt;br /&gt;
                          status=sent (delivered to command: exec /usr/bin/procmail)&lt;br /&gt;
&lt;br /&gt;
             Remove the &amp;quot;.forward&amp;quot; file from their home directory and you'll get the following:&lt;br /&gt;
&lt;br /&gt;
                    to=&amp;lt;chirico@squeezel.squeezel.com&amp;gt;, relay=cyrus, delay=0,&lt;br /&gt;
                          status=sent (squeezel.squeezel.com)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              mutt with IMAP?  (See TIP 190)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 189:&lt;br /&gt;
&lt;br /&gt;
     expand - convert tabs to spaces in a file.&lt;br /&gt;
&lt;br /&gt;
             $ expand How_to_Linux_and_Open_Source.txt &amp;gt; notabs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 190:&lt;br /&gt;
&lt;br /&gt;
     mutt with imap - assume you have setup imap (see tip 188). Now how do you configure&lt;br /&gt;
                      your &amp;quot;.muttrc&amp;quot; file to automatically connect, securely to the IMAP server?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       &lt;br /&gt;
     Below is an example of my &amp;quot;.muttrc&amp;quot; file. For this example, assume my password is &amp;quot;S0m3paSSw0r9&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             $ cat .muttrc&lt;br /&gt;
             set spoolfile = &amp;quot;imaps://chirico:S0m3paSSw0r9@squeezel.squeezel.com/&lt;br /&gt;
             set imap_force_ssl=yes&lt;br /&gt;
             set certificate_file=~/.mutt/certificates/72d31154.0&lt;br /&gt;
&lt;br /&gt;
     Now, you want to copy the certificate as a &amp;quot;file.pem&amp;quot; and run &amp;quot;c_rehash&amp;quot; to convert this&lt;br /&gt;
     file to a number. See the article. See the following article on how to do this under the &lt;br /&gt;
     fetchmail section.&lt;br /&gt;
&lt;br /&gt;
          http://souptonuts.sourceforge.net/postfix_tutorial.html&lt;br /&gt;
&lt;br /&gt;
     This is a quick summary of creating this key.&lt;br /&gt;
&lt;br /&gt;
             $ openssl s_client -connect squeezel.squeezel.com:995 -showcerts &amp;gt; file.pem&lt;br /&gt;
             $ c_rehash ~/.mutt/certificates&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 191:&lt;br /&gt;
&lt;br /&gt;
     Apache - CGI scripts.  There are two ways to enable CGI scripts. The second method is the&lt;br /&gt;
              prefered method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           First way, the easy way. Look for the &amp;quot;http.conf&amp;quot; file. On Fedora Core, this file can be&lt;br /&gt;
           found under &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;. Edit this file as follows to make &lt;br /&gt;
           &amp;quot;http://squeezel.squeezel.com/chirico-cgi/&amp;quot; execute scripts.&lt;br /&gt;
&lt;br /&gt;
                     ScriptAlias /chirico-cgi/ &amp;quot;/home/chirico/cgi-bin/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           Second way, the better way. Instead of doing the above, make the following change in &lt;br /&gt;
           &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                     &amp;lt;Directory /home/chirico/cgi-bin&amp;gt;&lt;br /&gt;
                      Options +ExecCGI&lt;br /&gt;
                      SetHandler chirico-cgi&lt;br /&gt;
                     &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Running a test script. Now copy the following test script into the directory &amp;quot;/home/chirico/cgi-bin&amp;quot;&lt;br /&gt;
        and change the rights to execute for the user running this.&lt;br /&gt;
&lt;br /&gt;
                  #!/bin/sh&lt;br /&gt;
                  # Save as test.cgi&lt;br /&gt;
                  #  chown apache.apache test.cgi&lt;br /&gt;
                  #  chmod 700 test.cgi&lt;br /&gt;
                  echo &amp;quot;Content-Type: text/html&amp;quot;&lt;br /&gt;
                  echo&lt;br /&gt;
                  echo &amp;quot;Hello world from user &amp;lt;b&amp;gt;`whoami`&amp;lt;/b&amp;gt;! &amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 192:&lt;br /&gt;
&lt;br /&gt;
     Bash - using getopts for your bash scripts.&lt;br /&gt;
&lt;br /&gt;
                   #!/bin/bash&lt;br /&gt;
                   while getopts &amp;quot;ab:cd:&amp;quot; Option&lt;br /&gt;
                   # b and d take arguments&lt;br /&gt;
                   #&lt;br /&gt;
                   do&lt;br /&gt;
                     case $Option in&lt;br /&gt;
                       a) echo -e &amp;quot;a = $OPTIND&amp;quot;;;&lt;br /&gt;
                       b) echo -e &amp;quot;b = $OPTIND $OPTARG&amp;quot;;;&lt;br /&gt;
                       c) echo -e &amp;quot;c = $OPTIND&amp;quot;;;&lt;br /&gt;
                       d) echo -e &amp;quot;d = $OPTIND $OPTARG&amp;quot;;;&lt;br /&gt;
                    esac&lt;br /&gt;
                  done&lt;br /&gt;
                  shift $(($OPTIND - 1))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 193:&lt;br /&gt;
&lt;br /&gt;
     Sieve - creating sieve recipes with &amp;quot;sieveshell&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     The following sieve script put all jefferson.edu mail into the &lt;br /&gt;
     folder jefferson. This assumes that I have already created the IMP &lt;br /&gt;
     directory, or mail box (INBOX.jefferson), which can be done in mutt &lt;br /&gt;
     with the &amp;quot;C&amp;quot; command. Below is an example of finding &amp;quot;jefferson.edu&amp;quot;&lt;br /&gt;
     anywhere in the header. &lt;br /&gt;
&lt;br /&gt;
         # This is a file named jefferson.siv&lt;br /&gt;
         require [&amp;quot;fileinto&amp;quot;];&lt;br /&gt;
         if header :contains &amp;quot;Received&amp;quot; &amp;quot;from jefferson.edu&amp;quot; {&lt;br /&gt;
           fileinto &amp;quot;INBOX.jefferson&amp;quot;;&lt;br /&gt;
           stop;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
     Now, from the command propt execute &amp;quot;sieveshell&amp;quot; with the hostname of the&lt;br /&gt;
     imap server. My server is squeezel.squeezel.com, so I would execute the &lt;br /&gt;
     following:&lt;br /&gt;
&lt;br /&gt;
          $ sieveshell squeezel.squeezel.com&lt;br /&gt;
          connecting to squeezel.squeezel.com&lt;br /&gt;
          Please enter your password:****&lt;br /&gt;
          &amp;gt; put jefferson.siv&lt;br /&gt;
          &amp;gt; activate jefferson.siv&lt;br /&gt;
          &amp;gt; list&lt;br /&gt;
          jefferson.siv  &amp;lt;- active script&lt;br /&gt;
          &amp;gt; quit&lt;br /&gt;
&lt;br /&gt;
     Note the put brings in the script. And you need to activiate it.&lt;br /&gt;
&lt;br /&gt;
     You can activate a sieve script for any user on your system if you are&lt;br /&gt;
     root. This is an example of activating a script for user chirico. Assume&lt;br /&gt;
     below the root prompt is &amp;quot;#&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          # sieveshell -a chirico -u chirico squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
     You can also automate everything from a bash script. But note after&lt;br /&gt;
     the -e the commands, and not a file with the commands, follows within&lt;br /&gt;
     quotes. This is the script I use for my home system.&lt;br /&gt;
&lt;br /&gt;
         #!/bin/bash&lt;br /&gt;
         sieveshell -a chirico -u chirico -e 'deactivate&lt;br /&gt;
         delete chirico.siv&lt;br /&gt;
         put chirico.siv&lt;br /&gt;
         activate chirico.siv&lt;br /&gt;
         list&lt;br /&gt;
         '  squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     References:&lt;br /&gt;
         http://wiki.fastmail.fm/index.php/SieveRecipes&lt;br /&gt;
         http://www.cyrusoft.com/sieve/#documents&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 194:&lt;br /&gt;
&lt;br /&gt;
     emacs - editing files remotely with tramp. Tramp comes with the latest version of emacs.&lt;br /&gt;
             That means if you're using Fedora core 4, with emacs, you have tramp. This is &lt;br /&gt;
             ideal for editing files on remote computers that do not use emacs.&lt;br /&gt;
&lt;br /&gt;
             Edit the &amp;quot;.emacs&amp;quot; file and add the following line:&lt;br /&gt;
&lt;br /&gt;
                 (require 'tramp)&lt;br /&gt;
                 (setq tramp-default-method &amp;quot;scp&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
             Now, to edit a file on computer tape.squeezel.com (C-x, C-f) and&lt;br /&gt;
             enter the following in Find file:&lt;br /&gt;
&lt;br /&gt;
                 Find file:/chirico@tape.squeezel.com:test.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             References:&lt;br /&gt;
&lt;br /&gt;
                    http://savannah.gnu.org/projects/tramp/&lt;br /&gt;
&lt;br /&gt;
             &lt;br /&gt;
&lt;br /&gt;
TIP 195:&lt;br /&gt;
&lt;br /&gt;
     trusted X11 forwarding - running gnome and KDE both on one screen, at the same&lt;br /&gt;
             time securely. The following assumes gnome is running on the current&lt;br /&gt;
             computer and &amp;quot;closet.squeezel.com&amp;quot; has KDE&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y  closet.squeezel.com&lt;br /&gt;
              $ startkde&lt;br /&gt;
&lt;br /&gt;
          Or assume you want to run gnome on &amp;quot;closet.squeezel.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y  closet.squeezel.com&lt;br /&gt;
              $ gnome-session&lt;br /&gt;
&lt;br /&gt;
          By default Fedora Core allows ForwardX11 over ssh. Note you want to use&lt;br /&gt;
          the -Y option above and NOT -X. &lt;br /&gt;
&lt;br /&gt;
          Suppose you want a remote &amp;quot;gnome-session&amp;quot; on ctl-alt-F12. Below is an &lt;br /&gt;
          example of getting the remote computer closet.squeezel.com, and you&lt;br /&gt;
          can still have the above configuration.&lt;br /&gt;
&lt;br /&gt;
          First you must allow magic cookies for each server connection.&lt;br /&gt;
             &lt;br /&gt;
              $ MCOOKIE=$(mcookie)&lt;br /&gt;
              $ xauth add $(hostname)/unix:1 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
              $ xauth add localhost/unix:1 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
  &lt;br /&gt;
          Again, note that you have to add this for EACH connection. So if you wanted 2 as well&lt;br /&gt;
&lt;br /&gt;
              $ MCOOKIE=$(mcookie)&lt;br /&gt;
              $ xauth add $(hostname)/unix:2 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
              $ xauth add localhost/unix:2 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
&lt;br /&gt;
          On squeezel.squeezel.com create a new xterm. If :1 is take below&lt;br /&gt;
          try :2. The vt12 is for switching to ctl-alt-F12.&lt;br /&gt;
&lt;br /&gt;
              $ xinit -- :1 vt12&lt;br /&gt;
&lt;br /&gt;
          Note, if you do not add the above cookies, you will get the follow error:&lt;br /&gt;
         &lt;br /&gt;
               Xlib: connection to &amp;quot;:1.0&amp;quot; refused by server&lt;br /&gt;
               Xlib: No protocol specified&lt;br /&gt;
&lt;br /&gt;
          The screen may be hard to read. At this point ssh -Y to the remote computer.&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y closet.squeezel.com&lt;br /&gt;
              $ gnome-session&lt;br /&gt;
&lt;br /&gt;
          Yes, you will get errors about sound and some custom drivers is the remove &lt;br /&gt;
          computer has different hardware. After is loads, you can switch back and&lt;br /&gt;
          forth between session with (ctl-alt-F12)  and (ctl-alt-F7)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 196:&lt;br /&gt;
&lt;br /&gt;
     Suspend ssh session - you have just sshed into a computer &amp;quot;ssh -l user example.com&amp;quot;, and you&lt;br /&gt;
          want to get back to the terminal prompt of the computer you started with. Escapte, by &lt;br /&gt;
          default with ssh is &amp;quot;~&amp;quot;, so enter &amp;quot;~&amp;quot; followed by &amp;quot;ctl-z&amp;quot; to suspend.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 197:&lt;br /&gt;
&lt;br /&gt;
     Quick way to send a text file &lt;br /&gt;
&lt;br /&gt;
              $ sendmail -f mike.chirico@gmail.com mchirico@comcast.net &amp;lt; /etc/fstab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 198:&lt;br /&gt;
&lt;br /&gt;
     size - determining the size of the text segment, data segment, and &amp;quot;bss&amp;quot; or uninitialized data segment.&lt;br /&gt;
&lt;br /&gt;
              $ size /bin/sh /bin/bash&lt;br /&gt;
               text        data     bss     dec     hex filename&lt;br /&gt;
              586946      22444   18784  628174   995ce /bin/sh&lt;br /&gt;
              586946      22444   18784  628174   995ce /bin/bash&lt;br /&gt;
&lt;br /&gt;
          Note above that &amp;quot;/bin/sh&amp;quot; and &amp;quot;/bin/bash&amp;quot; have equal text,data and bss numbers. It's&lt;br /&gt;
          highly likely that these are the same programs.&lt;br /&gt;
&lt;br /&gt;
              $ ls -l /bin/sh&lt;br /&gt;
               lrwxrwxrwx  1 root root 4 Jan 14  2005 /bin/sh -&amp;gt; bash&lt;br /&gt;
&lt;br /&gt;
          Yep, it's the same program. Here's a further definition of each segment.&lt;br /&gt;
&lt;br /&gt;
              Text segment: The machine instructions that the CPU executes. This is usually&lt;br /&gt;
                            read only and sharable.&lt;br /&gt;
&lt;br /&gt;
              Data segment: Contains initialized variables in a program. You also know these&lt;br /&gt;
                            as declarations and definitions.&lt;br /&gt;
&lt;br /&gt;
                               int max = 200;&lt;br /&gt;
&lt;br /&gt;
              Uninitialized data segment: Think of this as a declaration only, or data that&lt;br /&gt;
                            is only initialized by the kernel to arithmetic 0 or null pointers&lt;br /&gt;
                            before program execution.&lt;br /&gt;
&lt;br /&gt;
                               char s[10];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 199:&lt;br /&gt;
&lt;br /&gt;
     Using the at command.&lt;br /&gt;
&lt;br /&gt;
       Below is a simple example if running the ls command at 11:42am that&lt;br /&gt;
       will send mail -m to the user that executed it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       We'll execute job1 defined as follows and set to be executable. &lt;br /&gt;
&lt;br /&gt;
           $ cat ./job1&lt;br /&gt;
           #!/bin/bash&lt;br /&gt;
           date &amp;gt;&amp;gt; /tmp/job1&lt;br /&gt;
&lt;br /&gt;
       The at command is listed below. For queue &amp;quot;-q&amp;quot; names you can only&lt;br /&gt;
       specify one letter. Here we're using x. The letter determines the&lt;br /&gt;
       priority with &amp;quot;a&amp;quot; the highest.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x  -f ./job1 -m  11:54am&lt;br /&gt;
           job 3 at 2005-10-04 11:54&lt;br /&gt;
&lt;br /&gt;
       Now, if you execute the atq command, you'll get the following.&lt;br /&gt;
&lt;br /&gt;
           $ atq&lt;br /&gt;
           3       2005-10-04 11:54 x chirico&lt;br /&gt;
&lt;br /&gt;
       It's also possible to execute jobs at the command line entering&lt;br /&gt;
       a ctl-d at the end of the input.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x  -m 12:08pm&lt;br /&gt;
           at&amp;gt; ls -l&lt;br /&gt;
           at&amp;gt; who&lt;br /&gt;
           at&amp;gt; date&lt;br /&gt;
           at&amp;gt; ^D&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Or for a job to execute 1 minute from now.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x -m `date -d '1 minute' +&amp;quot;%H:%M&amp;quot;`&lt;br /&gt;
           at&amp;gt; ls -l&lt;br /&gt;
           at&amp;gt; date&lt;br /&gt;
     &lt;br /&gt;
&lt;br /&gt;
     Important points: The atd daemon must be running. To check if&lt;br /&gt;
      it's running do the following:&lt;br /&gt;
&lt;br /&gt;
            $ /etc/init.d/atd status&lt;br /&gt;
&lt;br /&gt;
      Also, if there is an /etc/at.allow file, then only users in that&lt;br /&gt;
      file will be allowed to execute at.&lt;br /&gt;
&lt;br /&gt;
      If /etc/at.deny exists but is empty and there is no /etc/at.allow,&lt;br /&gt;
      then, everyone can execute the at command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 200:&lt;br /&gt;
&lt;br /&gt;
     lsusb - command will display all USB buses and all devices connected.&lt;br /&gt;
&lt;br /&gt;
        $ lsusb&lt;br /&gt;
        Bus 005 Device 003: ID 413c:2010 Dell Computer Corp.&lt;br /&gt;
        Bus 005 Device 002: ID 413c:1003 Dell Computer Corp.&lt;br /&gt;
        Bus 005 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 004 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 003 Device 003: ID 0fc5:1227 Delcom Engineering&lt;br /&gt;
        Bus 003 Device 002: ID 046d:c016 Logitech, Inc. Optical Mouse&lt;br /&gt;
        Bus 003 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 002 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 001 Device 001: ID 0000:0000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 201:&lt;br /&gt;
&lt;br /&gt;
     Memory fragmentation - if you suspect workload memory fragmentation issues&lt;br /&gt;
     and you want to monitor the current state of you system, then, consider&lt;br /&gt;
     looking at the output from /proc/buddyinfo on recent kernels.&lt;br /&gt;
&lt;br /&gt;
        $ cat /proc/buddyinfo&lt;br /&gt;
      Node 0, zone      DMA    541    218     42      2      0      0      0      1      1      1      0 &lt;br /&gt;
      Node 0, zone   Normal   2508   2614     52      1      5      5      0      1      1      1      0 &lt;br /&gt;
      Node 0, zone  HighMem      0      1      3      0      1      0      0      0      0      0      0 &lt;br /&gt;
&lt;br /&gt;
     The following definition is taken from  ./Documentation/filesystems/proc.txt in the &lt;br /&gt;
     Linux kernel source.&lt;br /&gt;
&lt;br /&gt;
       Each column represents the number of pages of a certain order which are&lt;br /&gt;
       available.  In this case, there are 0 chunks of 2^0*PAGE_SIZE available in&lt;br /&gt;
       ZONE_DMA, 4 chunks of 2^1*PAGE_SIZE in ZONE_DMA, 101 chunks of 2^4*PAGE_SIZE&lt;br /&gt;
       available in ZONE_NORMAL, etc...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 202:&lt;br /&gt;
&lt;br /&gt;
     arp - Linux ARP kernel moduel.  This command implements the Address Resolution Protocol.&lt;br /&gt;
&lt;br /&gt;
     This is an example of the command.&lt;br /&gt;
&lt;br /&gt;
        $ arp&lt;br /&gt;
        Address                  HWtype  HWaddress           Flags Mask            Iface&lt;br /&gt;
        tape.squeezel.com        ether   00:50:DA:60:5B:AD   C                     eth0&lt;br /&gt;
        squeezel.squeezel.com    ether   00:11:11:8A:BE:3F   C                     eth0&lt;br /&gt;
        gw.squeezel.com          ether   00:0F:66:47:15:73   C                     eth0&lt;br /&gt;
&lt;br /&gt;
       &lt;br /&gt;
TIP 203:&lt;br /&gt;
&lt;br /&gt;
     dbench - performance monitoring. &lt;br /&gt;
&lt;br /&gt;
     So, how does your system react when the load average is above 600. Have you even seen a &lt;br /&gt;
     computer with a load average of 600? Well, this could be your chance. &lt;br /&gt;
&lt;br /&gt;
         Reference: http://freshmeat.net/projects/dbench/&lt;br /&gt;
&lt;br /&gt;
     The following gives a load average of 10 on my system.&lt;br /&gt;
&lt;br /&gt;
        $ dbench 34&lt;br /&gt;
&lt;br /&gt;
     If you want a higher load, just increase the number.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 204:&lt;br /&gt;
&lt;br /&gt;
     /etc guide - a listing of common files in the /etc directory.&lt;br /&gt;
&lt;br /&gt;
        /etc/exports: this file is used to configure NFS.&lt;br /&gt;
&lt;br /&gt;
        /etc/ftpusers: the users on your system who are restricted from FTP login.&lt;br /&gt;
&lt;br /&gt;
        /etc/motd: message of the day, which users see after login.&lt;br /&gt;
&lt;br /&gt;
        /etc/named.conf: DNS config file.&lt;br /&gt;
&lt;br /&gt;
        /etc/profile: common user information.&lt;br /&gt;
&lt;br /&gt;
        /etc/inittab: this file contains runlevel start information.&lt;br /&gt;
&lt;br /&gt;
        /etc/services: the services and their respective ports.&lt;br /&gt;
&lt;br /&gt;
        /etc/shells: this contains the names of all shells installed on the system.&lt;br /&gt;
&lt;br /&gt;
        /etc/passwd: this file contains user information.&lt;br /&gt;
&lt;br /&gt;
        /etc/group: security group rights.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
TIP 205: &lt;br /&gt;
&lt;br /&gt;
     logger - is a bash command utility for writing to /var/log/messages or the&lt;br /&gt;
            other files defined in /etc/syslog.conf.&lt;br /&gt;
&lt;br /&gt;
            $ logger -t TEST more of a test here&lt;br /&gt;
&lt;br /&gt;
         This is what shows up in /var/log/messages&lt;br /&gt;
  &lt;br /&gt;
            Oct 28 07:15:50 squeezel TEST: more of a test here&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
TIP 206: &lt;br /&gt;
&lt;br /&gt;
     accton, lastcomm - accouting on and last command. This is &lt;br /&gt;
         a way to monitor users on your system. As root, you &lt;br /&gt;
         would implement this as follows:&lt;br /&gt;
&lt;br /&gt;
           $ accton -h&lt;br /&gt;
            Usage: accton [-hV] [file]&lt;br /&gt;
            [--help] [--version]&lt;br /&gt;
&lt;br /&gt;
            The system's default process accounting file is /var/account/pacct.&lt;br /&gt;
&lt;br /&gt;
         Note the default file location is /var/account/pacct so we'll turn&lt;br /&gt;
         it on system wide with the following command.&lt;br /&gt;
&lt;br /&gt;
           $ accton /var/account/pacct&lt;br /&gt;
&lt;br /&gt;
         Now take a look at this file. It will grow. To see command that&lt;br /&gt;
         are executed, use the lastcomm command.&lt;br /&gt;
&lt;br /&gt;
           $ lastcomm&lt;br /&gt;
&lt;br /&gt;
         The above command gives output for all users. To get the data&lt;br /&gt;
         for user &amp;quot;chirico&amp;quot; execute the following command:&lt;br /&gt;
&lt;br /&gt;
           $ lastcomm --user chirico&lt;br /&gt;
&lt;br /&gt;
         You can also get a summary of commands with sa.&lt;br /&gt;
&lt;br /&gt;
           [chirico@big ~]$ sa&lt;br /&gt;
           30       5.23re       0.00cp    10185k&lt;br /&gt;
           11       4.83re       0.00cp     8961k   ***other&lt;br /&gt;
            8       0.13re       0.00cp    19744k   nagios*&lt;br /&gt;
            4       0.00re       0.00cp     2542k   automount*&lt;br /&gt;
            3       0.00re       0.00cp      680k   sa&lt;br /&gt;
            2       0.13re       0.00cp    17424k   check_ping&lt;br /&gt;
            2       0.13re       0.00cp      978k   ping&lt;br /&gt;
&lt;br /&gt;
         To turn off accounting, execute accton without a filename.&lt;br /&gt;
&lt;br /&gt;
           $ accton&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 207:&lt;br /&gt;
&lt;br /&gt;
     CPU Temperature on a laptop. The following is the temperature&lt;br /&gt;
       of my Dell laptop. &lt;br /&gt;
&lt;br /&gt;
           $ cat /proc/acpi/thermal_zone/THM/temperature&lt;br /&gt;
           temperature:             58 C&lt;br /&gt;
&lt;br /&gt;
      &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 208:&lt;br /&gt;
&lt;br /&gt;
     script -f with mkfifo to allow another user to view what you type&lt;br /&gt;
          in real-time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Step 1.  Create a fifo (first in first out) file that the other&lt;br /&gt;
              user can view. For this example create the file /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
               [chirico@laptop ~]$ mkfifo /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
        Step 2.  Have the second user, voyeur user, cat this file. Output will block&lt;br /&gt;
              for them until you complete step 3. The other user, voyer,&lt;br /&gt;
              is executing the command below.&lt;br /&gt;
 &lt;br /&gt;
               [voyeur@laptop ~]$ cat /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
        Step 3.  The original user runs the following command.&lt;br /&gt;
&lt;br /&gt;
               [chirico@laptop ~]$ script -f  /tmp/scriptout&lt;br /&gt;
               Script started, file is /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
             Now anything typed, including a vi session, will be displayed to the&lt;br /&gt;
             voyeur user in step 2. &lt;br /&gt;
&lt;br /&gt;
        See TIP 46.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 209:&lt;br /&gt;
&lt;br /&gt;
     fsck forced on next reboot.  To do this, as root issue the following commands.&lt;br /&gt;
&lt;br /&gt;
            $ cd /&lt;br /&gt;
            $ touch forcefsck&lt;br /&gt;
&lt;br /&gt;
          Now reboot the system, and when it comes up fsck will be forced on the system.&lt;br /&gt;
&lt;br /&gt;
            $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 210:&lt;br /&gt;
&lt;br /&gt;
     /dev/random and /dev/urandom differ in their random generating properties. /dev/random&lt;br /&gt;
        only returns bytes when enough noise has been generated from the entropy pool. In&lt;br /&gt;
        contrast /dev/urandom will always return bytes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference: http://sourceforge.net/direct-dl/mchirico/cpearls/simple_but_common.tar.gz (rand.c)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 211:&lt;br /&gt;
&lt;br /&gt;
     Want to find out the speed of your NIC?  (Full Duplex or Half), then use ethtool.&lt;br /&gt;
&lt;br /&gt;
               [root@squeezel ~]# ethtool eth0&lt;br /&gt;
               Settings for eth0:&lt;br /&gt;
                       Supported ports: [ MII ]&lt;br /&gt;
                       Supported link modes:   10baseT/Half 10baseT/Full&lt;br /&gt;
                                               100baseT/Half 100baseT/Full&lt;br /&gt;
                                               1000baseT/Half 1000baseT/Full&lt;br /&gt;
                       Supports auto-negotiation: Yes&lt;br /&gt;
                       Advertised link modes:  10baseT/Half 10baseT/Full&lt;br /&gt;
                                               100baseT/Half 100baseT/Full&lt;br /&gt;
                                               1000baseT/Half 1000baseT/Full&lt;br /&gt;
                       Advertised auto-negotiation: Yes&lt;br /&gt;
                       Speed: 100Mb/s&lt;br /&gt;
                       Duplex: Full&lt;br /&gt;
                       Port: Twisted Pair&lt;br /&gt;
                       PHYAD: 1&lt;br /&gt;
                       Transceiver: internal&lt;br /&gt;
                       Auto-negotiation: on&lt;br /&gt;
                       Supports Wake-on: g&lt;br /&gt;
                       Wake-on: d&lt;br /&gt;
                       Current message level: 0x000000ff (255)&lt;br /&gt;
                       Link detected: yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 212:&lt;br /&gt;
&lt;br /&gt;
     rpm install hang? You might need to delete the lock state information. &lt;br /&gt;
&lt;br /&gt;
        $ nl /etc/rc.d/rc.sysinit | grep rpm&lt;br /&gt;
        720   rm -f /var/lib/rpm/__db* &amp;amp;&amp;gt; /dev/null&lt;br /&gt;
&lt;br /&gt;
     Note the command &lt;br /&gt;
&lt;br /&gt;
        $ rm -f /var/lib/rpm/__db*&lt;br /&gt;
&lt;br /&gt;
     Because sometimes you will run &amp;quot;rpm -ivh somerpm&amp;quot; and it will just sit&lt;br /&gt;
     there.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 213:&lt;br /&gt;
&lt;br /&gt;
     Apache - limit access to certain directories based on IP address in the&lt;br /&gt;
         httpd.conf file.&lt;br /&gt;
&lt;br /&gt;
          You can do this completely from /etc/httpd/conf/httpd.conf which&lt;br /&gt;
          are shown below for multiple IP addresses. Note that all 3 setting&lt;br /&gt;
          are the same.&lt;br /&gt;
&lt;br /&gt;
                10.0.0.0/255.0.0.0&lt;br /&gt;
                10.0.0.0/8&lt;br /&gt;
                10&lt;br /&gt;
&lt;br /&gt;
          However, the following is different&lt;br /&gt;
&lt;br /&gt;
                10.0.0.0/24   only allows 10.0.0.1 to 10.0.0.254&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Some complete settings in /etc/httpd/conf/httpd.conf &lt;br /&gt;
&lt;br /&gt;
             &amp;lt;Directory /var/www/html/chirico/&amp;gt;&lt;br /&gt;
                 Order allow,deny&lt;br /&gt;
                 Allow from 10.0.0.0/8      # All 10.&lt;br /&gt;
                 Allow from 192.168.0.0/16  # All 192.168&lt;br /&gt;
                 Allow from 127             # All 127.&lt;br /&gt;
             &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          Don't forget to reload httpd with the following command.&lt;br /&gt;
        &lt;br /&gt;
             $ /etc/init.d/httpd reload&lt;br /&gt;
&lt;br /&gt;
          &lt;br /&gt;
&lt;br /&gt;
TIP 214:&lt;br /&gt;
&lt;br /&gt;
     Open Files - determining how many files are currently open.&lt;br /&gt;
&lt;br /&gt;
             $ cat /proc/sys/fs/file-nr&lt;br /&gt;
             2030    263     104851&lt;br /&gt;
              |       |        \- maximum open file descriptors &lt;br /&gt;
              |       |         &lt;br /&gt;
              |       \- total free allocated file descriptors&lt;br /&gt;
              |&lt;br /&gt;
              (Total allocated file descriptors since boot)&lt;br /&gt;
&lt;br /&gt;
        Note the maximum number can be set or changed.&lt;br /&gt;
&lt;br /&gt;
              $ cat /proc/sys/fs/file-max&lt;br /&gt;
              104851&lt;br /&gt;
&lt;br /&gt;
        To change this&lt;br /&gt;
&lt;br /&gt;
              $ echo &amp;quot;804854&amp;quot; &amp;gt; /proc/sys/fs/file-max&lt;br /&gt;
 &lt;br /&gt;
        Note lsof | wc -l will report higher numbers because this includes&lt;br /&gt;
        open files that are not using file descriptors such as directories,&lt;br /&gt;
        memory mapped files, and executable text files.&lt;br /&gt;
&lt;br /&gt;
        (Reference http://www.netadmintools.com/art295.html&lt;br /&gt;
         and also see the man page for this: man 5 proc )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 215:&lt;br /&gt;
&lt;br /&gt;
     Ctrl-Alt-Del will cause an immediate reboot, without syncing dirty buffers by&lt;br /&gt;
     setting the value &amp;gt; 0 in /proc/sys/kernel/ctrl-alt-del.&lt;br /&gt;
&lt;br /&gt;
               $ echo 1 &amp;gt; /proc/sys/kernel/ctrl-alt-del&lt;br /&gt;
       &lt;br /&gt;
&lt;br /&gt;
        (Reference: man 5 proc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 216:&lt;br /&gt;
&lt;br /&gt;
     Redefining keys in X using xev and xmodmap.  The program xev, used in an X window &lt;br /&gt;
     terminal screen will display information on mouse movements, keys pressed and &lt;br /&gt;
     released.&lt;br /&gt;
&lt;br /&gt;
        $ xev&lt;br /&gt;
&lt;br /&gt;
     Now type shift-4 and you'll notice the event details below:&lt;br /&gt;
&lt;br /&gt;
        KeyPress event, serial 29, synthetic NO, window 0x3800001,&lt;br /&gt;
            root 0x60, subw 0x0, time 55307049, (418,242), root:(428,339),&lt;br /&gt;
            state 0x1, keycode 13 (keysym 0x24, dollar), same_screen YES,&lt;br /&gt;
            XLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
            XmbLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
            XFilterEvent returns: False&lt;br /&gt;
        &lt;br /&gt;
        KeyRelease event, serial 29, synthetic NO, window 0x3800001,&lt;br /&gt;
            root 0x60, subw 0x0, time 55307184, (418,242), root:(428,339),&lt;br /&gt;
            state 0x1, keycode 13 (keysym 0x24, dollar), same_screen YES,&lt;br /&gt;
            XLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
       &lt;br /&gt;
     So, if you want to redefine this key to say copyright, see (/usr/X11R6/include/X11/keysymdef.h)&lt;br /&gt;
     you would type the following.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 copyright'&lt;br /&gt;
&lt;br /&gt;
     To get the key back to the dollar, issue the following command.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 dollar'&lt;br /&gt;
&lt;br /&gt;
     By the way it's possible to define multiple key codes for a sigle key. You'll need&lt;br /&gt;
     to have a key defined as the Mode_switch. Perhaps you'd like to use the Windows key,&lt;br /&gt;
     or the key with the Microsoft logo on it, since you're using Linux. This key is&lt;br /&gt;
     keycode 115&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 115 = Mode_switch'&lt;br /&gt;
&lt;br /&gt;
     Now you could define 3 values to the shift-4. For this example use ld, Yen and dollar.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 dollar sterling yen'&lt;br /&gt;
&lt;br /&gt;
     So pressing the keys gives you the following:&lt;br /&gt;
&lt;br /&gt;
          shift-$          (dollar sign)&lt;br /&gt;
          Windows-$        (lb sign)&lt;br /&gt;
          Windows-shift-$  (Yen sign)&lt;br /&gt;
&lt;br /&gt;
     You could go crazy and redefine all you keys.&lt;br /&gt;
&lt;br /&gt;
     (Thanks to hisham for this tip).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 217:&lt;br /&gt;
&lt;br /&gt;
     Threads - which version of threads are you using?&lt;br /&gt;
&lt;br /&gt;
          $ getconf GNU_LIBPTHREAD_VERSION&lt;br /&gt;
          NPTL 2.3.90&lt;br /&gt;
&lt;br /&gt;
     For a history on threads used with gcc reference the following:&lt;br /&gt;
          &lt;br /&gt;
          http://en.wikipedia.org/wiki/NPTL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 218:&lt;br /&gt;
&lt;br /&gt;
     Screenshots using ImageMagick. &lt;br /&gt;
&lt;br /&gt;
        If you want the entire screen, execute the following:&lt;br /&gt;
&lt;br /&gt;
            $ import -window root screen.png&lt;br /&gt;
&lt;br /&gt;
        Or to crosshair select the region with your mouse, execute &lt;br /&gt;
        the following instead.&lt;br /&gt;
&lt;br /&gt;
            $ import screen.png&lt;br /&gt;
&lt;br /&gt;
        KDE has the ability to take screenshots with the command below.&lt;br /&gt;
&lt;br /&gt;
            $ ksnapshot&lt;br /&gt;
&lt;br /&gt;
        GNOME likewise has a command too.&lt;br /&gt;
&lt;br /&gt;
            $ gnome-panel-screenshot --delay 6&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Visting ImageMagick again, the xwininfo command give window information and the id can be&lt;br /&gt;
        used to capture images with the import command.&lt;br /&gt;
&lt;br /&gt;
            $ xwininfo&lt;br /&gt;
&lt;br /&gt;
          xwininfo: Please select the window about which you&lt;br /&gt;
          would like information by clicking the&lt;br /&gt;
          mouse in that window.&lt;br /&gt;
&lt;br /&gt;
          xwininfo: Window id: 0x1e00007 &amp;quot;chirico@squeezel:/work/svn/souptonuts - Shell - Konsole&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          Absolute upper-left X:  4&lt;br /&gt;
          Absolute upper-left Y:  21&lt;br /&gt;
          Relative upper-left X:  0&lt;br /&gt;
          Relative upper-left Y:  0&lt;br /&gt;
          Width: 880&lt;br /&gt;
          Height: 510&lt;br /&gt;
          Depth: 24&lt;br /&gt;
          Visual Class: TrueColor&lt;br /&gt;
          Border width: 0&lt;br /&gt;
          Class: InputOutput&lt;br /&gt;
          Colormap: 0x20 (installed)&lt;br /&gt;
          Bit Gravity State: NorthWestGravity&lt;br /&gt;
          Window Gravity State: NorthWestGravity&lt;br /&gt;
          Backing Store State: NotUseful&lt;br /&gt;
          Save Under State: no&lt;br /&gt;
          Map State: IsViewable&lt;br /&gt;
          Override Redirect State: no&lt;br /&gt;
          Corners:  +4+21  -396+21  -396-493  +4-493&lt;br /&gt;
          -geometry 880x510+0+0&lt;br /&gt;
&lt;br /&gt;
        Now use the import command with the Window id. My example is shown below.&lt;br /&gt;
&lt;br /&gt;
             $ import -window 0x1e00007  id.miff&lt;br /&gt;
&lt;br /&gt;
        And to quickly display this image that you just saved, use the display command.&lt;br /&gt;
&lt;br /&gt;
             $ display id.miff &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 219:&lt;br /&gt;
&lt;br /&gt;
     File Access over SSH using FUSE (Filesystem in USErspace). This is a very good way to &lt;br /&gt;
     mount a remote filesystem locally. It's  like a secure NFS mount, but you don't require &lt;br /&gt;
     admin privileges on the remote computer. You do need to have fuse-sshfs installed on &lt;br /&gt;
     the local computer that will perform the filesystem mount.&lt;br /&gt;
&lt;br /&gt;
     The following works with Fedora Core 5. Only the users added to the fuse group can mout &lt;br /&gt;
     external drives. Below the user chirico is being added to the group fuse.&lt;br /&gt;
&lt;br /&gt;
             $ yum install fuse-sshfs&lt;br /&gt;
             $ usermod -a -G fuse chirico&lt;br /&gt;
     &lt;br /&gt;
     You'll need to reboot.&lt;br /&gt;
&lt;br /&gt;
             $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
             &lt;br /&gt;
     Next I'm going to mount the remote filesystem v0.squeezel.com. This is done as user chirico&lt;br /&gt;
     on the local computer. I'm using root on the remote computer v0.squeezel.com because I&lt;br /&gt;
     want to mount the complete drive.&lt;br /&gt;
&lt;br /&gt;
             $ mkdir v0&lt;br /&gt;
             $ sshfs root@v0.squeezel.com:/  v0&lt;br /&gt;
             $ cd v0&lt;br /&gt;
             $ ls -l&lt;br /&gt;
               bin   dev  home  lost+found     media  mnt  opt   q     sbin     srv  tmp  var&lt;br /&gt;
               boot  etc  lib   master_backup  misc   net  proc  root  selinux  sys  usr&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
     Now to unmount the filesystem&lt;br /&gt;
&lt;br /&gt;
             $ fusermount -u /home/chirico/v0&lt;br /&gt;
&lt;br /&gt;
     Yes, you can mount the filesystem on boot. Below shows an example entry for /etc/fstab, but&lt;br /&gt;
     this only allows user on the current system to view what is is /mnt/v0. &lt;br /&gt;
&lt;br /&gt;
             sshfs#root@v0.squeezel.com:/var/log             /mnt/v0 fuse defaults    0 0&lt;br /&gt;
&lt;br /&gt;
     References:&lt;br /&gt;
        (http://fuse.sourceforge.net/sshfs.html)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 220:&lt;br /&gt;
&lt;br /&gt;
     OpenVPN - A full-featured SSL VPN solution. The following demonstrates&lt;br /&gt;
               a very simple OpenVPN setup between two Fedora Core 5 computers&lt;br /&gt;
               big.squeezel.com 192.168.1.12 and tape.squeezel.com 192.168.1.155&lt;br /&gt;
&lt;br /&gt;
               As root install the package on both computers.&lt;br /&gt;
&lt;br /&gt;
                  $ yum -y install openvpn&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Setup on big.squeezel.com 192.168.1.12&lt;br /&gt;
&lt;br /&gt;
                  $ iptables -A INPUT -p udp -s 192.168.1.155  --dport 1194 -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tun+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A FORWARD -i tap+ -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
             Note - make sure you have commented out the following line &lt;br /&gt;
                    in /etc/sysconfig/iptables&lt;br /&gt;
&lt;br /&gt;
                  # -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
&lt;br /&gt;
             Now from continuting with the commands that need to be executed on &lt;br /&gt;
             big.squeezel.com 192.168.1.12 do one of the following&lt;br /&gt;
           &lt;br /&gt;
                  $ openvpn --remote tape.squeezel.com  --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 --verb 9&lt;br /&gt;
&lt;br /&gt;
             The above statement gives lots of errors. Once it's working you may want&lt;br /&gt;
             the following statement without the --verb 9 option.&lt;br /&gt;
&lt;br /&gt;
                  $ openvpn --remote tape.squeezel.com  --dev tun1 --ifconfig 10.4.0.1 10.4.0.2&lt;br /&gt;
&lt;br /&gt;
             After you finish the setup commands for tape.squeezel.com immediately below, you'll be&lt;br /&gt;
             able to access tape.squeezel.com as 10.4.0.2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Setup on tape.squeezel.com 192.168.1.155&lt;br /&gt;
&lt;br /&gt;
                  $ iptables -A INPUT -p udp -s 192.168.1.12  --dport 1194 -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tun+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A FORWARD -i tap+ -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
             Note - again, make sure you have commented out the following line &lt;br /&gt;
                    in /etc/sysconfig/iptables&lt;br /&gt;
&lt;br /&gt;
                  # -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
&lt;br /&gt;
             The openvpn commands are tape.squeezel.com are reversed from what is shown&lt;br /&gt;
             above.&lt;br /&gt;
&lt;br /&gt;
                  $ openvpn --remote big.squeezel.com --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 --verb 9&lt;br /&gt;
&lt;br /&gt;
             Or&lt;br /&gt;
                  $ openvpn --remote big.squeezel.com --dev tun1 --ifconfig 10.4.0.2 10.4.0.1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             Now you can access all services and ports from big.squeezel.com on 10.4.0.1 for &lt;br /&gt;
             such services as MySQL, secure Web, imap, etc. A quick test is nmap as follows:&lt;br /&gt;
&lt;br /&gt;
                  $ nmap -A -T4 10.4.0.1&lt;br /&gt;
&lt;br /&gt;
                  Starting Nmap 4.03 ( http://www.insecure.org/nmap/ ) at 2006-05-20 13:54 EDT&lt;br /&gt;
                  Interesting ports on 10.4.0.1:&lt;br /&gt;
                  (The 1671 ports scanned but not shown below are in state: closed)&lt;br /&gt;
                  PORT     STATE SERVICE VERSION&lt;br /&gt;
                  22/tcp   open  ssh     OpenSSH 4.3 (protocol 2.0)&lt;br /&gt;
                  111/tcp  open  rpcbind  2 (rpc #100000)&lt;br /&gt;
                  3306/tcp open  mysql   MySQL (unauthorized)&lt;br /&gt;
&lt;br /&gt;
                  Nmap finished: 1 IP address (1 host up) scanned in 7.116 seconds&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 221:&lt;br /&gt;
&lt;br /&gt;
     openssl - Some common commands.&lt;br /&gt;
&lt;br /&gt;
             Finding the openssldir (Directory for OpenSSL files).&lt;br /&gt;
&lt;br /&gt;
                  $ openssl version -a|grep OPENSSLDIR&lt;br /&gt;
                  OPENSSLDIR: &amp;quot;/etc/pki/tls&amp;quot;&lt;br /&gt;
&lt;br /&gt;
             Connect to a secure SMTP server with STARTTLS, assuming the server name is&lt;br /&gt;
             squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
                  $ openssl s_client -connect squeezel.squeezel.com:25 -starttls&lt;br /&gt;
&lt;br /&gt;
         &lt;br /&gt;
&lt;br /&gt;
      Reference (http://www.madboa.com/geek/openssl/)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 222:&lt;br /&gt;
&lt;br /&gt;
     Bash functions. This is easy, and I find it very useful to create bash functions&lt;br /&gt;
     for repeated commands. For example, suppose you want to create a quick bash function&lt;br /&gt;
     to cd to /var/log, tail messages and tail secure. You can create this function as&lt;br /&gt;
     follows:&lt;br /&gt;
&lt;br /&gt;
                  [root@v5 log]# m()&lt;br /&gt;
                  m()&lt;br /&gt;
                  &amp;gt; { cd /var/log&lt;br /&gt;
                  { cd /var/log&lt;br /&gt;
                  &amp;gt; tail messages&lt;br /&gt;
                  tail messages&lt;br /&gt;
                  &amp;gt; tail secure&lt;br /&gt;
                  tail secure&lt;br /&gt;
                  &amp;gt; }&lt;br /&gt;
                  }&lt;br /&gt;
                  &lt;br /&gt;
     Above I'm typing m() then hitting return. Note the echo on the next line followed&lt;br /&gt;
     by the prompt &amp;gt;. I then enter {. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 223:&lt;br /&gt;
&lt;br /&gt;
     Stats on DNS Server. You can get stats on your DNS server. &lt;br /&gt;
&lt;br /&gt;
       The following works for BIND 9:&lt;br /&gt;
&lt;br /&gt;
                  $ rndc stats&lt;br /&gt;
&lt;br /&gt;
         On my system I see the output in &amp;quot;/var/named/chroot/var/named/data/named_stats.txt&amp;quot;, which&lt;br /&gt;
         if an FC4 system. By the way, if you're using BIND 8, the command is &amp;quot;ndc stats&amp;quot;, but that&lt;br /&gt;
         has a completely different format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Format of the output&lt;br /&gt;
&lt;br /&gt;
            +++ Statistics Dump +++ (1153791199)&lt;br /&gt;
            success 297621&lt;br /&gt;
            referral 32&lt;br /&gt;
            nxrrset 21953&lt;br /&gt;
            nxdomain 33742&lt;br /&gt;
            recursion 28243&lt;br /&gt;
            failure 54&lt;br /&gt;
            --- Statistics Dump --- (1153791199)&lt;br /&gt;
&lt;br /&gt;
      The number (1153791199) can be converted with the date command.&lt;br /&gt;
&lt;br /&gt;
                  $ date -d '1970-01-01 1153791199 sec'&lt;br /&gt;
                  Tue Jul 25 02:33:19 EDT 2006&lt;br /&gt;
&lt;br /&gt;
      That's 1153791199 seconds since 1970-01-01 UCT. Which is 4 hours fast,&lt;br /&gt;
      from EDT.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 224:&lt;br /&gt;
&lt;br /&gt;
     snmp - simple network monitoring protocol. The following steps setup snmp on Fedora Core 5.&lt;br /&gt;
&lt;br /&gt;
                  $ yum install net-snmp*&lt;br /&gt;
&lt;br /&gt;
         Next add the following line in &amp;quot;/etc/snmp/snmpd.conf&amp;quot; at the bottom.&lt;br /&gt;
&lt;br /&gt;
                  rocommunity pA33worD&lt;br /&gt;
&lt;br /&gt;
         Start the snmp service.&lt;br /&gt;
&lt;br /&gt;
                  $ /etc/init.d/snmpd restart&lt;br /&gt;
&lt;br /&gt;
         Once started, from the command prompt, it's possible to get stats on the computer.&lt;br /&gt;
&lt;br /&gt;
                  $ snmpwalk -v 1 -c pA33worD localhost system&lt;br /&gt;
         Or&lt;br /&gt;
                  $ snmpwalk -v 1 -c pA33worD localhost interface&lt;br /&gt;
&lt;br /&gt;
         Or&lt;br /&gt;
                  $ snmpgetnext -v 1 -c pA33worD localhost sysUpTime&lt;br /&gt;
                  DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (26452) 0:04:24.52&lt;br /&gt;
&lt;br /&gt;
         Note the Timeticks is in 100th of a second. So the computer above has been running&lt;br /&gt;
         for 264.52 seconds.&lt;br /&gt;
&lt;br /&gt;
         Reference( TIP 225 shows how to use MRTG for gathering snmp stats).&lt;br /&gt;
                  http://www.net-snmp.org/tutorial/tutorial-5/commands/snmpv3.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 225:&lt;br /&gt;
&lt;br /&gt;
     MRTG - Multi Router Traffic Grapher.  &lt;br /&gt;
&lt;br /&gt;
                  $ cfgmaker --output=/etc/mrtg/v5.squeezel.com \&lt;br /&gt;
                    ifref=ip --global &amp;quot;workdir:/var/www/html/mrtg/stats&amp;quot;\&lt;br /&gt;
                    pA33worD@v5.squeezel.com&lt;br /&gt;
&lt;br /&gt;
        Reference: http://www.chinalinuxpub.com/doc/www.siliconvalleyccie.com/linux-hn/mrtg.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 226:&lt;br /&gt;
&lt;br /&gt;
     Back Trace - This is a method of getting a back trace for all processes on the system.&lt;br /&gt;
                  it assumes the following: a. Kernel was build with CONFIG_MAGIC_SYS-REQ &lt;br /&gt;
                  enabled (which Fedora 5 kernels are) b. You can get direct access to the &lt;br /&gt;
                  monitor.&lt;br /&gt;
&lt;br /&gt;
             Step 1.&lt;br /&gt;
&lt;br /&gt;
                  Ctl-Alt-F1 (This brings you to the text console)&lt;br /&gt;
&lt;br /&gt;
             Step 2.&lt;br /&gt;
&lt;br /&gt;
                  Alt-ScrollLock &lt;br /&gt;
                  Ctl-ScrollLock&lt;br /&gt;
          &lt;br /&gt;
                  Note above that's Alt-ScrollLock followed by Ctl-ScrollLock. You should see&lt;br /&gt;
                  a lot of text on the screen. To fast to read, but don't worry the text will&lt;br /&gt;
                  be in /var/log/messages at the end.&lt;br /&gt;
&lt;br /&gt;
                  On my system the ScrollLock key is next to the NumLock key. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 227:&lt;br /&gt;
&lt;br /&gt;
     Ext3 Tuning - One advantage of Ext3 over Ext2 is directory indexing, which  imporves file&lt;br /&gt;
                  access in directories containing large files or when the directory contains&lt;br /&gt;
                  many files. Directory indexing improves performance by using hashed binary &lt;br /&gt;
                  trees. &lt;br /&gt;
&lt;br /&gt;
                  There are two ways to enable dir_index. First, find the device using the mount&lt;br /&gt;
                  command.&lt;br /&gt;
&lt;br /&gt;
                      $ mount&lt;br /&gt;
&lt;br /&gt;
                      /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)&lt;br /&gt;
                      proc on /proc type proc (rw)&lt;br /&gt;
                      sysfs on /sys type sysfs (rw)&lt;br /&gt;
                      devpts on /dev/pts type devpts (rw,gid=5,mode=620)&lt;br /&gt;
                      /dev/sda1 on /boot type ext3 (rw) &amp;lt;--- This is the one you want&lt;br /&gt;
                      tmpfs on /dev/shm type tmpfs (rw)&lt;br /&gt;
                      none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)&lt;br /&gt;
                      sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)&lt;br /&gt;
                      automount(pid2001) on /net type autofs (rw,fd=4,pgrp=2001,minproto=2,maxproto=4)                   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                  From the above command, the device used is /dev/sda1.  Using the tune2fs command,&lt;br /&gt;
                  directory indexing will only apply to directories created after running the &lt;br /&gt;
                  command below.               &lt;br /&gt;
&lt;br /&gt;
                       $ tune2fs -O dir_index /dev/sda1&lt;br /&gt;
&lt;br /&gt;
                  However, if you want it to apply to all directories, use the e2fsck command as  &lt;br /&gt;
                  shown below:&lt;br /&gt;
&lt;br /&gt;
                       $ e2fsck -D -f /dev/sda1&lt;br /&gt;
&lt;br /&gt;
                  You'll need to bypass the warning message.&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
     Reference: &amp;quot;Tuning Journaling File Systems: A small amount of effort an dtime can yield big&lt;br /&gt;
                results&amp;quot;,by Steve Best. Linux Magazine, September 10, 2006. This author as has&lt;br /&gt;
                a very good book titled: &amp;quot;Linux Debugging and Performance Tuning.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 228:&lt;br /&gt;
&lt;br /&gt;
     NIC bonding - binding two or more NICs to one IP address to improve performance. The following&lt;br /&gt;
                instructions were done on Fedora Core 5.&lt;br /&gt;
&lt;br /&gt;
         Step 1.&lt;br /&gt;
             &lt;br /&gt;
            Create the file ifcfg-bond0 with the IP address, netmask and gateway. Shown&lt;br /&gt;
            below is my file.&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-bond0&lt;br /&gt;
&lt;br /&gt;
                   DEVICE=bond0&lt;br /&gt;
                   IPADDR=192.168.1.12&lt;br /&gt;
                   NETMASK=255.255.255.0&lt;br /&gt;
                   GATEWAY=192.168.1.1&lt;br /&gt;
                   USERCTL=no&lt;br /&gt;
                   BOOTPROTO=none&lt;br /&gt;
                   ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
         Step 2.&lt;br /&gt;
&lt;br /&gt;
            Modify eth0, eth1 and eth2. Shown below are each one of my files. Note that&lt;br /&gt;
            you must comment out, or remove the ip address, netmask, gateway and hardware&lt;br /&gt;
            address from each one of these files, since settings should only come from&lt;br /&gt;
            the ifcfg-bond0 file above. I've chosen to comment out the lines, instead of &lt;br /&gt;
            removing, should I decide to unbond my NICS sometime in the future.&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth0&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:9D&lt;br /&gt;
                  #IPADDR=192.168.1.12&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  #GATEWAY=192.168.1.1&lt;br /&gt;
                  #USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  # Settings for Bond&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth1&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth1&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:C9&lt;br /&gt;
                  #IPADDR=192.168.1.13&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  #&lt;br /&gt;
                  # Settings for bonding&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth2&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth2&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:9D&lt;br /&gt;
                  #IPADDR=192.168.1.12&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  #GATEWAY=192.168.1.1&lt;br /&gt;
                  #USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
         Step 3.&lt;br /&gt;
&lt;br /&gt;
            Set the load parameters for bond0 bonding kernel module. Append the&lt;br /&gt;
            following lines to /etc/modprobe.conf &lt;br /&gt;
&lt;br /&gt;
                 # bonding commands &lt;br /&gt;
                 alias bond0 bonding&lt;br /&gt;
                 options bond0 mode=balance-alb miimon=100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Step 4.&lt;br /&gt;
&lt;br /&gt;
            Load the bond driver module from the command prompt.&lt;br /&gt;
&lt;br /&gt;
                 $ modprobe bonding&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Step 5.&lt;br /&gt;
&lt;br /&gt;
            Restart the network, or restart the computer. Note I restarted to computer,&lt;br /&gt;
            since my NICs above had MAC assignments.&lt;br /&gt;
&lt;br /&gt;
                 $ service network restart   # Or restart computer&lt;br /&gt;
&lt;br /&gt;
             Take a look at the proc settings. &lt;br /&gt;
&lt;br /&gt;
                 $ cat /proc/net/bonding/bond0 &lt;br /&gt;
                 Ethernet Channel Bonding Driver: v3.0.3 (March 23, 2006)&lt;br /&gt;
&lt;br /&gt;
                 Bonding Mode: adaptive load balancing&lt;br /&gt;
                 Primary Slave: None&lt;br /&gt;
                 Currently Active Slave: eth2&lt;br /&gt;
                 MII Status: up&lt;br /&gt;
                 MII Polling Interval (ms): 100&lt;br /&gt;
                 Up Delay (ms): 0&lt;br /&gt;
                 Down Delay (ms): 0&lt;br /&gt;
&lt;br /&gt;
                 Slave Interface: eth2&lt;br /&gt;
                 MII Status: up&lt;br /&gt;
                 Link Failure Count: 0&lt;br /&gt;
                 Permanent HW addr: 00:13:72:80:62:f0&lt;br /&gt;
            &lt;br /&gt;
     References:&lt;br /&gt;
&lt;br /&gt;
         http://www.cyberciti.biz/nixcraft/vivek/blogger/2006/04/linux-bond-or-team-multiple-network.php&lt;br /&gt;
          Good, well written article describing the steps above.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=24692&amp;amp;package_id=146474&lt;br /&gt;
          Documentation for bonding that can also be found in the kernel&lt;br /&gt;
          ./Documentation/networking/bonding.txt&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 229:&lt;br /&gt;
&lt;br /&gt;
     /etc/nsswitch.conf - System Databases and Name Service Switch configuration file. &lt;br /&gt;
&lt;br /&gt;
         This file determines lookup order of services. For example, to match a name&lt;br /&gt;
         to an IP address, an entry can be put into the /etc/hosts file. Or a DNS query&lt;br /&gt;
         can be made. What's the order?  Normally, it's the entry in the /etc/hosts file.&lt;br /&gt;
         because /etc/nsswitch.conf contains the following setting&lt;br /&gt;
        &lt;br /&gt;
            hosts:      files dns&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	 See man nsswitch.conf for more settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
THE FOLLOWING SECTIONS STARTS THE PROGRAMMING TIPS&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 1:&lt;br /&gt;
&lt;br /&gt;
     Simple open command that restarts the close if a signal&lt;br /&gt;
     occurs.  Also note, the POSIX standards committee decided&lt;br /&gt;
     all new functions would not use errno and would instead&lt;br /&gt;
     directly return the error number in the function.&lt;br /&gt;
&lt;br /&gt;
     A lot of functions return -1 on an error condition, then,&lt;br /&gt;
     set errno to the value of the error.  This will still work&lt;br /&gt;
     for all the well known functions; but, it's changing.&lt;br /&gt;
&lt;br /&gt;
     /* start of code open.c&lt;br /&gt;
        Compile gcc -o open open.c&lt;br /&gt;
&lt;br /&gt;
        Reference (Look for simple_but_common_x.x.x.tar.gz):&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79066&lt;br /&gt;
&lt;br /&gt;
                             */&lt;br /&gt;
     #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     #include &amp;lt;string.h&amp;gt;             /* for strerror(int errno) */&lt;br /&gt;
     #include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     #define BUFLEN 100&lt;br /&gt;
     extern int errno;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     int&lt;br /&gt;
     main (void)&lt;br /&gt;
     {&lt;br /&gt;
       int fp,error;&lt;br /&gt;
       char buf[BUFLEN+1];&lt;br /&gt;
&lt;br /&gt;
       if ((fp = open (&amp;quot;data&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1)&lt;br /&gt;
         {&lt;br /&gt;
           fprintf (stderr, &amp;quot;Can't open data: %s\n&amp;quot;, strerror (errno));&lt;br /&gt;
           return 1;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
       snprintf (buf, BUFLEN, &amp;quot;123&amp;quot;);&lt;br /&gt;
       write (fp, buf, strlen (buf));&lt;br /&gt;
&lt;br /&gt;
       // Restart close should a signal occur */&lt;br /&gt;
       while((( error = close (fp) ) == -1) &amp;amp;&amp;amp; (errno == EINTR));&lt;br /&gt;
       if(error == -1)&lt;br /&gt;
         perror(&amp;quot;Failed to close the file\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
       return 0;&lt;br /&gt;
      }&lt;br /&gt;
     /* end of open.c */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 2:&lt;br /&gt;
&lt;br /&gt;
     Example of setting the effective UID on a file&lt;br /&gt;
&lt;br /&gt;
     /*  start of code&lt;br /&gt;
       gcc uid_open.c -o uid_open&lt;br /&gt;
       su&lt;br /&gt;
       chown root.chirico uid_open&lt;br /&gt;
       chmod u+s uid_open&lt;br /&gt;
       exit&lt;br /&gt;
&lt;br /&gt;
       Now you can run this as chirico and write to the&lt;br /&gt;
       root directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     */&lt;br /&gt;
     #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;string.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     int main()&lt;br /&gt;
     {&lt;br /&gt;
             int fd;&lt;br /&gt;
&lt;br /&gt;
             if ((fd = open(&amp;quot;/root/datajunk&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1) {&lt;br /&gt;
                     fprintf(stderr, &amp;quot;Can't open file \n&amp;quot;);&lt;br /&gt;
                     return 1;&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
             write(fd, &amp;quot;0123456&amp;quot;, strlen(&amp;quot;0123456&amp;quot;));&lt;br /&gt;
             close(fd);&lt;br /&gt;
             return 0;&lt;br /&gt;
     }&lt;br /&gt;
&lt;br /&gt;
     /* end of code */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 3:&lt;br /&gt;
&lt;br /&gt;
     Writing a C http post.&lt;br /&gt;
&lt;br /&gt;
     For downloads reference:&lt;br /&gt;
      http://prdownloads.sourceforge.net/cpearls/spider.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 4:&lt;br /&gt;
&lt;br /&gt;
     Writing a 2.6.x Kernel Module:&lt;br /&gt;
&lt;br /&gt;
       Look for the latest version of &amp;quot;procreadwrite&amp;quot;.  This is a 2.6 kernel&lt;br /&gt;
       modules that demonstrates how to create /proc entires and write directly&lt;br /&gt;
       to user-land via tty.  It's updated to reflect replacement of &amp;quot;current-&amp;gt;tty&amp;quot;&lt;br /&gt;
       with &amp;quot;current-&amp;gt;signal-&amp;gt;tty&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79066&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 5:&lt;br /&gt;
&lt;br /&gt;
     Creating a filename with '\n'.  This goes with (TIP 71)&lt;br /&gt;
&lt;br /&gt;
         /**** topen.c ***********************************************************&lt;br /&gt;
           Filenames can be created with any character except the null character&lt;br /&gt;
           and a slash.&lt;br /&gt;
&lt;br /&gt;
           This example creates a file with returns '\n\n'&lt;br /&gt;
&lt;br /&gt;
           There's a way to remove a file by inode:&lt;br /&gt;
&lt;br /&gt;
               $ ls -libt *&lt;br /&gt;
&lt;br /&gt;
           And, once you know the inode&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec mv '{}' goodstuff \;&lt;br /&gt;
&lt;br /&gt;
           or&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec rm '{}' goodstuff \;&lt;br /&gt;
&lt;br /&gt;
           or&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec cat '{}' \;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Compile:&lt;br /&gt;
&lt;br /&gt;
             gcc -o topen -Wall -W -O2 -s -pipe  topen.c&lt;br /&gt;
&lt;br /&gt;
         Reference:&lt;br /&gt;
           http://prdownloads.sourceforge.net/cpearls/simple_but_common_0.0.14.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
         */&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         #include &amp;lt;string.h&amp;gt;             /* for strerror(int errno) */&lt;br /&gt;
         #include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         #define BUFLEN 100&lt;br /&gt;
         extern int errno;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         int&lt;br /&gt;
         main (void)&lt;br /&gt;
         {&lt;br /&gt;
           int fp,error;&lt;br /&gt;
           char buf[BUFLEN+1];&lt;br /&gt;
&lt;br /&gt;
           if ((fp = open (&amp;quot;\n\n\n\n\n\n\n\n\n&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1)&lt;br /&gt;
             {&lt;br /&gt;
               fprintf (stderr, &amp;quot;Can't open data: %s\n&amp;quot;, strerror (errno));&lt;br /&gt;
               return 1;&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
           snprintf (buf, BUFLEN, &amp;quot;123&amp;quot;);&lt;br /&gt;
           write (fp, buf, strlen (buf));&lt;br /&gt;
&lt;br /&gt;
           // Restart close should a signal occur */&lt;br /&gt;
           while((( error = close (fp) ) == -1) &amp;amp;&amp;amp; (errno == EINTR));&lt;br /&gt;
           if(error == -1)&lt;br /&gt;
             perror(&amp;quot;Failed to close the file\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
           return 0;&lt;br /&gt;
&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  **Note, if you want email notification after every 50 new tips have been&lt;br /&gt;
    added, then, click on the following link:&lt;br /&gt;
&lt;br /&gt;
     https://sourceforge.net/project/filemodule_monitor.php?filemodule_id=120838&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 6:&lt;br /&gt;
&lt;br /&gt;
     Working With The Lemon Parser Generator.&lt;br /&gt;
     http://prdownloads.sourceforge.net/souptonuts/lemon_examples.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 7:&lt;br /&gt;
&lt;br /&gt;
     copy command for std container output.&lt;br /&gt;
&lt;br /&gt;
        #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
        #include &amp;lt;list&amp;gt;&lt;br /&gt;
        #include &amp;lt;vector&amp;gt;&lt;br /&gt;
        #include &amp;lt;iterator&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        using namespace std;&lt;br /&gt;
        int main(void)&lt;br /&gt;
        {&lt;br /&gt;
          vector&amp;lt;int&amp;gt; v;&lt;br /&gt;
          list&amp;lt;int&amp;gt; l;&lt;br /&gt;
&lt;br /&gt;
          v.push_back(1);&lt;br /&gt;
          v.push_back(2);&lt;br /&gt;
          copy(v.begin(),v.end(),ostream_iterator&amp;lt;int&amp;gt;(cout,&amp;quot;\n&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          l.push_back(23);&lt;br /&gt;
          l.push_back(12);&lt;br /&gt;
          copy(l.begin(),l.end(),ostream_iterator&amp;lt;int&amp;gt;(cout,&amp;quot;\n&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 8:&lt;br /&gt;
&lt;br /&gt;
  /* Copyright (c) 2005 Mike Chirico mchirico@comcast.net mchirico@users.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Example of using virtual functions. Note the use of &amp;quot;initialization lists&amp;quot;&lt;br /&gt;
              for assinging the variable first and last.&lt;br /&gt;
&lt;br /&gt;
      Compile:&lt;br /&gt;
        g++ -o virtualfunc -Wall -W -O2 -s -pipe  virtual_function.cc&lt;br /&gt;
&lt;br /&gt;
      Download:&lt;br /&gt;
        http://prdownloads.sourceforge.net/cpearls/simple_but_common_cpp.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  */&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
  #include &amp;lt;string&amp;gt;&lt;br /&gt;
  #include &amp;lt;list&amp;gt;&lt;br /&gt;
  #include &amp;lt;algorithm&amp;gt;&lt;br /&gt;
  #include &amp;lt;iterator&amp;gt;&lt;br /&gt;
  #include &amp;lt;functional&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  using namespace std;&lt;br /&gt;
&lt;br /&gt;
  class Employee {&lt;br /&gt;
  string first,last;&lt;br /&gt;
  public:&lt;br /&gt;
    Employee(const string&amp;amp; fn=&amp;quot;John&amp;quot;,const  string&amp;amp; ln=&amp;quot;Smith&amp;quot;): first(fn),last(ln) {}&lt;br /&gt;
    virtual void print() const {&lt;br /&gt;
    cout &amp;lt;&amp;lt; &amp;quot;First name: &amp;quot; &amp;lt;&amp;lt; first &amp;lt;&amp;lt; &amp;quot;, Last name: &amp;quot; &amp;lt;&amp;lt; last &amp;lt;&amp;lt; endl;&lt;br /&gt;
    }&lt;br /&gt;
    virtual ~Employee() {}&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  class Manager : public Employee {&lt;br /&gt;
    int level;&lt;br /&gt;
    list&amp;lt;Employee*&amp;gt; subordinates;&lt;br /&gt;
  public:&lt;br /&gt;
    Manager(const string&amp;amp; fn=&amp;quot;Ivan&amp;quot;,const string&amp;amp; ln=&amp;quot;Stedwick&amp;quot;, int lvl=1): Employee(fn,ln), level(lvl) {}&lt;br /&gt;
    void print() {&lt;br /&gt;
      cout &amp;lt;&amp;lt; &amp;quot;Manager level: &amp;quot; &amp;lt;&amp;lt; level &amp;lt;&amp;lt; &amp;quot;  &amp;quot;;&lt;br /&gt;
      Employee::print();&lt;br /&gt;
      cout &amp;lt;&amp;lt; &amp;quot;Supervises:&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
      for_each(subordinates.begin(),subordinates.end(),mem_fun(&amp;amp;Employee::print));&lt;br /&gt;
      cout &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; endl;&lt;br /&gt;
    }&lt;br /&gt;
    void addstaff(Employee&amp;amp; staff){&lt;br /&gt;
      subordinates.push_front(&amp;amp;staff);&lt;br /&gt;
    }&lt;br /&gt;
    void addstaff(Employee* staff){&lt;br /&gt;
      subordinates.push_front(staff);&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   int main()&lt;br /&gt;
   {&lt;br /&gt;
     Employee p0(&amp;quot;Lisa&amp;quot;,&amp;quot;Payne&amp;quot;);&lt;br /&gt;
     Manager m0;&lt;br /&gt;
&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Zoe&amp;quot;,&amp;quot;Bear&amp;quot;)); /* uses void addstaff(Employee* staff) */&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Leah&amp;quot;,&amp;quot;Bopper&amp;quot;));&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Abby&amp;quot;,&amp;quot;Chicken&amp;quot;));&lt;br /&gt;
     m0.addstaff(p0);  /* void addstaff(Employee&amp;amp; staff)  needed for this one */&lt;br /&gt;
     m0.addstaff(new Employee());&lt;br /&gt;
     m0.print();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     return 0;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 9:&lt;br /&gt;
&lt;br /&gt;
   /*  Named Constructor Idiom.&lt;br /&gt;
       Reference: http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.6&lt;br /&gt;
&lt;br /&gt;
   */&lt;br /&gt;
   #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
   #include &amp;lt;cmath&amp;gt;&lt;br /&gt;
   using namespace std;&lt;br /&gt;
&lt;br /&gt;
   class Point {&lt;br /&gt;
&lt;br /&gt;
   public:&lt;br /&gt;
     static Point rectangular(float x, float y);&lt;br /&gt;
     static Point polar(float radius, float angle);&lt;br /&gt;
     float get_x() { return x_; }&lt;br /&gt;
     float get_y() { return y_; }&lt;br /&gt;
&lt;br /&gt;
   private:&lt;br /&gt;
     Point(float x, float y);&lt;br /&gt;
     float x_, y_;&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
   inline Point::Point(float x, float y)&lt;br /&gt;
     : x_(x), y_(y) {}&lt;br /&gt;
&lt;br /&gt;
   inline Point Point::rectangular(float x, float y)&lt;br /&gt;
   { return Point(x,y); }&lt;br /&gt;
&lt;br /&gt;
   inline Point Point::polar(float radius, float angle)&lt;br /&gt;
   { return Point(radius*cos(angle),radius*sin(angle)); }&lt;br /&gt;
&lt;br /&gt;
   int main(void)&lt;br /&gt;
   {&lt;br /&gt;
     Point p1 = Point::rectangular(5.7,1.2);&lt;br /&gt;
     Point p2 = Point::polar(5.7,1.2);&lt;br /&gt;
&lt;br /&gt;
     cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; p1.get_x() &amp;lt;&amp;lt; &amp;quot;, &amp;quot; &amp;lt;&amp;lt; p1.get_y() &amp;lt;&amp;lt; &amp;quot;)&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
     cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; p2.get_x() &amp;lt;&amp;lt; &amp;quot;, &amp;quot; &amp;lt;&amp;lt; p2.get_y() &amp;lt;&amp;lt; &amp;quot;)&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 10:&lt;br /&gt;
&lt;br /&gt;
   /* Copy_constructor_assignment.cc&lt;br /&gt;
      Copyright (c) 2004 GPL Mike Chirico, mchirico@comcast.net or mchirico@users.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
      Reference: &amp;quot;The C++ Programming Language&amp;quot;, 3rd ed, by Stroustrup&lt;br /&gt;
      pg. 246.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Download:&lt;br /&gt;
      http://prdownloads.sourceforge.net/cpearls/simple_but_common.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
   */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   class Name {&lt;br /&gt;
   public:&lt;br /&gt;
     char* s;&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   class Table {&lt;br /&gt;
     Name *p;&lt;br /&gt;
     size_t sz;&lt;br /&gt;
   public:&lt;br /&gt;
     Table(size_t s=15) {&lt;br /&gt;
               p = new Name[sz=s];&lt;br /&gt;
               for(size_t i=0; i&amp;lt; sz; ++i) p[i].s=&amp;quot;****&amp;quot;;&lt;br /&gt;
                          }&lt;br /&gt;
     Table(const Table &amp;amp;t);&lt;br /&gt;
     Table&amp;amp; operator=(const Table&amp;amp;);&lt;br /&gt;
     int prt();&lt;br /&gt;
     void asgn(char* ts,size_t index);&lt;br /&gt;
     ~Table(){ delete[] p; }&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Table&amp;amp; Table::operator=(const Table &amp;amp;t)&lt;br /&gt;
   {&lt;br /&gt;
     if( this != &amp;amp;t) {&lt;br /&gt;
       delete[] p;&lt;br /&gt;
       p = new Name[sz=t.sz];&lt;br /&gt;
       for(size_t i=0; i&amp;lt; t.sz; ++i) p[i]=t.p[i];&lt;br /&gt;
     }&lt;br /&gt;
     return *this;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   int Table::prt()&lt;br /&gt;
   {&lt;br /&gt;
     for(size_t i=0; i&amp;lt; sz; ++i) std::cout &amp;lt;&amp;lt; p[i].s &amp;lt;&amp;lt; &amp;quot; &amp;quot;;&lt;br /&gt;
     std::cout &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
     return 0;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   /*&lt;br /&gt;
     asgn will increase the array of strings, if needed&lt;br /&gt;
     to size index+1, and add the string ts to position&lt;br /&gt;
     index.&lt;br /&gt;
   */&lt;br /&gt;
   void Table::asgn(char* ts,size_t index)&lt;br /&gt;
   {&lt;br /&gt;
     if(index &amp;lt; sz ) {&lt;br /&gt;
        p[index].s=ts;&lt;br /&gt;
     }else if ( index &amp;gt;= sz ){&lt;br /&gt;
        Name *tp;&lt;br /&gt;
        tp=p;&lt;br /&gt;
&lt;br /&gt;
        p = new Name[index+1];&lt;br /&gt;
&lt;br /&gt;
        for(size_t i=0; i&amp;lt; sz; ++i) p[i].s=tp[i].s;&lt;br /&gt;
        delete [] tp;&lt;br /&gt;
        for(size_t i=sz; i &amp;lt; index; ++i)p[i].s=&amp;quot;****&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
        p[index].s=ts;&lt;br /&gt;
        sz=index+1;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   int main(void)&lt;br /&gt;
   {&lt;br /&gt;
&lt;br /&gt;
     Table t1;&lt;br /&gt;
     Table t2(5);&lt;br /&gt;
&lt;br /&gt;
     // this is bigger than initial sz&lt;br /&gt;
     t1.asgn(&amp;quot;myname&amp;quot;,20);&lt;br /&gt;
     t1.prt();&lt;br /&gt;
     t2.prt();&lt;br /&gt;
&lt;br /&gt;
     t1=t2;&lt;br /&gt;
&lt;br /&gt;
     t1.prt();&lt;br /&gt;
     t2.prt();&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REFERENCES:&lt;br /&gt;
&lt;br /&gt;
  (1)  http://www.tldp.org/LDP/abs/html/index.html&lt;br /&gt;
  (2)  http://www.shelldorado.com/&lt;br /&gt;
  (3)  http://www.faqs.org/ftp/usenet/news.answers/unix-faq/faq/part1&lt;br /&gt;
  (4)  http://www-106.ibm.com/developerworks/library/l-rpm1/&lt;br /&gt;
  (5)  http://www-136.ibm.com/developerworks/linux/&lt;br /&gt;
  (6)  http://www.gnu.org/manual/manual.html&lt;br /&gt;
  (7)  http://fedora.redhat.com/&lt;br /&gt;
  (8)  http://souptonuts.sourceforge.net/chirico/index.php&lt;br /&gt;
  (9)  http://www.faqs.org/faqs/&lt;br /&gt;
 (10)  http://www.faqs.org/docs/linux_network/&lt;br /&gt;
 (11)  http://www.tml.hut.fi/~viu/linux/sag/sag-0.6.2.html/index.html&lt;br /&gt;
 (12)  http://www.yolinux.com/TUTORIALS/LinuxTutorialSysAdmin.html&lt;br /&gt;
 (13)  http://sed.sourceforge.net/grabbag/scripts/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  SUMMARY:&lt;br /&gt;
   (1)(2)(3) Excellent resource for bash scripts.&lt;br /&gt;
   (4)       rpm resource&lt;br /&gt;
   (6)       GNU Manuals Online&lt;br /&gt;
   (7)       Fedora&lt;br /&gt;
   (8)       Authors Website&lt;br /&gt;
   (11)(12)  System Admin&lt;br /&gt;
   (13)      Excellent source of sed scripts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
HIGHLY RECOMMENDED BOOKS:&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX Network Programming, The Sockets Networking API&amp;quot;, Volume 1, Third Edition.&lt;br /&gt;
        W. Richard Stevens, Bill Fenner, Andrew M. Rudoff.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX Network Programming, Interprocess Communications&amp;quot;, Volume 2, Second Edition.&lt;br /&gt;
        W. Richard Stevens.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX SYSTEMS Programming, Communication, Concurrency, and Threads&amp;quot;, Kay A. Robbins,&lt;br /&gt;
        Steven Robbins&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming with POSIX Threads&amp;quot;, David R. Butenhof. Addison-Wesley&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;The C++ Programming Language&amp;quot; Third Edition. Bjarne Stroustrup. Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C Programming Language&amp;quot; (2nd Edition), Second Edition, Kernighan and Ritchie&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Advanced Linux Programming&amp;quot; by Mark Mitchell, Jeffrey Oldham, and Alex Samuel, of&lt;br /&gt;
        CodeSourcery LL. This book if free at the following resource:&lt;br /&gt;
        http://www.advancedlinuxprogramming.com/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Accelerated C++, Practical Programming by Example&amp;quot; Andrew Koenig, Barbara E. Moo.&lt;br /&gt;
        Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C: A Reference Manual&amp;quot;, Fifth Edition, Samuel P. Harbison, Guy L. Steele.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Standard Library: A Tutorial and Reference, The&amp;quot;, Nicolai M. Josuttis. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Templates: The Complete Guide&amp;quot;, David Vandevoorde, Nicolai M. Josuttis. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Exceptional C++: 47 Engineering Puzzles, Programming Problems, and Solutions&amp;quot;, Herb Sutter.&lt;br /&gt;
     Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;More Exceptional C++&amp;quot;, Herb Sutter.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Exceptional C++ Style: 40 New Engineering Puzzles, Programming Problems, and Solutions&amp;quot;,&lt;br /&gt;
       Herb Sutter. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;The Art of Computer Programming (TAOCP)&amp;quot;, Vol 1,Vol 2, Vol 3. Donald E. Knuth. Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming Perl, 3rd Edition&amp;quot;, Tom Christiansen, Jon Orwant, Larry Wall. O'Reilly.&lt;br /&gt;
       http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming from the Ground Up&amp;quot;, Jonathan Bartlett, Edited by Dominick Bruno, Jr.&lt;br /&gt;
       http://savannah.nongnu.org/download/pgubook/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Expert C Programming&amp;quot;, Peter van der Linden, Prentice Hall PTR.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Coding Standards 101 Rules, Guidelines, and Best Practices&amp;quot;, by Herb Sutter and&lt;br /&gt;
       Andrei Alexandrescu.  http://www.gotw.ca/publications/c++cs/bibliography.htm&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Linux Kernel Development: A practical guide to the design and implementation of&lt;br /&gt;
       the Linux kernel&amp;quot;, by Robert Love, Sams Publishing.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond&amp;quot;, by&lt;br /&gt;
       David Abrahams and Aleksey Gurtovoy. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
HIGHLY RECOMMENDED: PHILOSOPHICAL&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;Zen and the Art of Motorcycle Maintenance: An Inquiry into Values&amp;quot;, Robert Pirsig.&lt;br /&gt;
        http://www.virtualschool.edu/mon/Quality/PirsigZen/index.html&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;Lila: An Inquiry Into Morals&amp;quot;, Robert Pirsig.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RECOMMENDED BOOKS:&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Structure and Interpretation of Computer Programs&amp;quot;, Harold Abelson, Gerald Jay Sussman,&lt;br /&gt;
      Julie Sussman. This book is free:&lt;br /&gt;
        http://mitpress.mit.edu/sicp/full-text/book/book.html&lt;br /&gt;
              and&lt;br /&gt;
        http://www.gnu.org/software/mit-scheme/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RECOMMENDED HOTOS:&lt;br /&gt;
&lt;br /&gt;
    Linux Networking-HOWTO (Previously the Net-3 Howto)&lt;br /&gt;
     http://en.tldp.org/HOWTO/NET3-4-HOWTO.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CORRECTIONS:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following people made suggestions and corrections:&lt;br /&gt;
  - Jorge Fabregas &amp;lt;fabregasj@prtc.net&amp;gt; TIP 21&lt;br /&gt;
  - Malcolm Parsons &amp;lt;malcolm.parsons@gmail.com&amp;gt; TIP 44&lt;br /&gt;
  - Andreas Haunschmidt &amp;lt;Andreas.Haunschmidt@utanet.at&amp;gt; TIP 102, TIP 90&lt;br /&gt;
  - P@draigBrady.com (Following links )&lt;br /&gt;
  - Jacques.GARNIER-EXTERIEUR@EU.RHODIA.COM TIP 46&lt;br /&gt;
&lt;br /&gt;
                http://www.pixelbeat.org/cmdline.html&lt;br /&gt;
                http://www.pixelbeat.org/rotagator/linux.tips/rotagator.fortune&lt;br /&gt;
                http://www.pixelbeat.org/scripts/&lt;br /&gt;
&lt;br /&gt;
  - Tobias Nix &amp;lt;tobias.nix@gmail.com&amp;gt; TIP 12&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>C4tboCcdro</name></author>	</entry>

	<entry>
		<id>https://wiki.gacq.com/index.php?title=Linux_tips&amp;diff=2730</id>
		<title>Linux tips</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacq.com/index.php?title=Linux_tips&amp;diff=2730"/>
				<updated>2008-12-26T03:23:56Z</updated>
		
		<summary type="html">&lt;p&gt;C4tboCcdro: liraca&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;capasoule&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Mike Chirico (mchirico@users.sourceforge.net) or (mchirico@comcast.net)&lt;br /&gt;
Copyright (C) 2004 (GNU Free Documentation License)&lt;br /&gt;
Last Updated: Thu Dec 28 16:42:50 EST 2006&lt;br /&gt;
&lt;br /&gt;
The latest version of this document can be found at:&lt;br /&gt;
http://souptonuts.sourceforge.net/how_to_linux_and_open_source.htm&lt;br /&gt;
  or text version ( if you have trouble downloading the full document: over 140 pages )&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/How_to_Linux_and_Open_Source.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on Gmail with Postix and Fetchmail&lt;br /&gt;
http://souptonuts.sourceforge.net/postfix_tutorial.html&lt;br /&gt;
&lt;br /&gt;
For tips on using SQLite (over 25 pages)&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_sqlite_tutorial.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on MySQL reference:&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_mysql.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For a recommended reading list&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/Recommended_Reading.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on upgrading RedHat 9 or 8.0 to 2.6.x src kernel&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_26.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For tips on Comcast Email with Home Linux Box&lt;br /&gt;
http://prdownloads.sourceforge.net/souptonuts/README_COMCAST_EMAIL.txt?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  **Note, if you want email notification after every 50 new tips have been&lt;br /&gt;
    added, then, click on the following link:&lt;br /&gt;
     https://sourceforge.net/project/filemodule_monitor.php?filemodule_id=120838&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 1:&lt;br /&gt;
&lt;br /&gt;
     Is NTP Working?&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Test the current server):&lt;br /&gt;
&lt;br /&gt;
          Try issuing the following command:&lt;br /&gt;
&lt;br /&gt;
          $ ntpq -pn&lt;br /&gt;
&lt;br /&gt;
           remote refid st t when poll reach delay offset jitter&lt;br /&gt;
           ===================================================&lt;br /&gt;
           tock.usno.navy 0.0.0.0 16 u - 64 0 0.000 0.000 4000.00&lt;br /&gt;
&lt;br /&gt;
          The above is an example of a problem.&lt;br /&gt;
          Compare it to a working configuration.&lt;br /&gt;
&lt;br /&gt;
          $ ntpq -pn&lt;br /&gt;
&lt;br /&gt;
           remote refid st t when poll reach delay offset jitter&lt;br /&gt;
           ========================================================&lt;br /&gt;
           +128.4.40.12 128.4.40.10 2 u 107 128 377 25.642 3.350 1.012&lt;br /&gt;
           127.127.1.0 127.127.1.0 10 l 40 64 377 0.000 0.000 0.008&lt;br /&gt;
           +128.91.2.13 128.4.40.12 3 u 34 128 377 21.138 6.118 0.398&lt;br /&gt;
           *192.5.41.41 .USNO. 1 u 110 128 377 33.69 9.533 3.534&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Configure the /etc/ntp.conf):&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/ntp.conf&lt;br /&gt;
&lt;br /&gt;
            # My simple client-only ntp configuration.&lt;br /&gt;
            server timeserver1.upenn.edu&lt;br /&gt;
            # ping -a timeserver1.upenn.edu shows the IP address 128.91.2.13&lt;br /&gt;
            # which is used in the restrict below&lt;br /&gt;
            restrict 128.91.2.13&lt;br /&gt;
            server tock.usno.navy.mil&lt;br /&gt;
            restrict 192.5.41.41&lt;br /&gt;
            server 128.4.40.12&lt;br /&gt;
            restrict 128.4.40.12&lt;br /&gt;
            server 127.127.1.0 # local clock&lt;br /&gt;
            fudge 127.127.1.0 stratum 10&lt;br /&gt;
            driftfile /etc/ntp/drift&lt;br /&gt;
            restrict default ignore&lt;br /&gt;
            restrict 127.0.0.0 mask 255.0.0.0&lt;br /&gt;
            authenticate no&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Configure /etc/ntp/step-tickers):&lt;br /&gt;
&lt;br /&gt;
          The values for server above are placed in the &amp;quot;/etc/ntp/step-tickers&amp;quot; file&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/ntp/step-tickers&lt;br /&gt;
&lt;br /&gt;
              timeserver1.upenn.edu&lt;br /&gt;
              tock.usno.navy.mil&lt;br /&gt;
              128.4.40.12&lt;br /&gt;
&lt;br /&gt;
          The startup script /etc/rc.d/init.d/ntpd will grab the servers in this&lt;br /&gt;
          file and execute the ntpdate command as follows:&lt;br /&gt;
&lt;br /&gt;
             /usr/sbin/ntpdate -s -b -p 8 timeserver1.upenn.edu&lt;br /&gt;
&lt;br /&gt;
          Why? Because if the time is off ntpd will not start. The command above set the&lt;br /&gt;
          clock. If System Time deviates from true time by more than 1000 seconds, then,&lt;br /&gt;
          the ntpd daemon  will enter panic mode and exit.&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Restart the service and check):&lt;br /&gt;
&lt;br /&gt;
          Issue the restart command&lt;br /&gt;
&lt;br /&gt;
            /etc/init.d/ntpd restart&lt;br /&gt;
&lt;br /&gt;
          check the values for &amp;quot;ntpq -pn&amp;quot;,&lt;br /&gt;
          which should match step 1.&lt;br /&gt;
&lt;br /&gt;
             ntpq -pn&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE:&lt;br /&gt;
&lt;br /&gt;
          Time is always stored in the kernel as the number of seconds since&lt;br /&gt;
          midnight of the 1st of January 1970 UTC, regardless of whether the&lt;br /&gt;
          hardware clock is stored as UTC or not.  Conversions to local time&lt;br /&gt;
          are done at run-time. So, it's easy to get the time in different&lt;br /&gt;
          timezones for only the current session as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ export TZ=EST&lt;br /&gt;
              $ date&lt;br /&gt;
              Mon Aug  2 10:34:04 EST 2004&lt;br /&gt;
&lt;br /&gt;
              $ export TZ=NET&lt;br /&gt;
              $ date&lt;br /&gt;
              Mon Aug  2 15:34:18 NET 2004&lt;br /&gt;
&lt;br /&gt;
          The following are possible values for TZ:&lt;br /&gt;
&lt;br /&gt;
              Hours From Greenwich Mean Time (GMT) Value Description&lt;br /&gt;
              0 GMT Greenwich Mean Time&lt;br /&gt;
              +1 ECT European Central Time&lt;br /&gt;
              +2 EET European Eastern Time&lt;br /&gt;
              +2 ART&lt;br /&gt;
              +3 EAT Saudi Arabia&lt;br /&gt;
              +3.5 MET Iran&lt;br /&gt;
              +4 NET&lt;br /&gt;
              +5 PLT West Asia&lt;br /&gt;
              +5.5 IST India&lt;br /&gt;
              +6 BST Central Asia&lt;br /&gt;
              +7 VST Bangkok&lt;br /&gt;
              +8 CTT China&lt;br /&gt;
              +9 JST Japan&lt;br /&gt;
              +9.5 ACT Central Australia&lt;br /&gt;
              +10 AET Eastern Australia&lt;br /&gt;
              +11 SST Central Pacific&lt;br /&gt;
              +12 NST New Zealand&lt;br /&gt;
              -11 MIT Samoa&lt;br /&gt;
              -10 HST Hawaii&lt;br /&gt;
              -9 AST Alaska&lt;br /&gt;
              -8 PST Pacific Standard Time&lt;br /&gt;
              -7 PNT Arizona&lt;br /&gt;
              -7 MST Mountain Standard Time&lt;br /&gt;
              -6 CST Central Standard Time&lt;br /&gt;
              -5 EST Eastern Standard Time&lt;br /&gt;
              -5 IET Indiana East&lt;br /&gt;
              -4 PRT Atlantic Standard Time&lt;br /&gt;
              -3.5 CNT Newfoundland&lt;br /&gt;
              -3 AGT Eastern South America&lt;br /&gt;
              -3 BET Eastern South America&lt;br /&gt;
              -1 CAT Azores&lt;br /&gt;
&lt;br /&gt;
              DST timezone&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              0      BST for British Summer.&lt;br /&gt;
              +400   ADT for Atlantic Daylight.&lt;br /&gt;
              +500   EDT for Eastern Daylight.&lt;br /&gt;
              +600   CDT for Central Daylight.&lt;br /&gt;
              +700   MDT for Mountain Daylight.&lt;br /&gt;
              +800   PDT for Pacific Daylight.&lt;br /&gt;
              +900   YDT for Yukon Daylight.&lt;br /&gt;
              +1000  HDT for Hawaii Daylight.&lt;br /&gt;
              -100   MEST for Middle European Summer,&lt;br /&gt;
                         MESZ for Middle European Summer,&lt;br /&gt;
                         SST for Swedish Summer and FST for French Summer.&lt;br /&gt;
              -700   WADT for West Australian Daylight.&lt;br /&gt;
              -1000  EADT for Eastern Australian Daylight.&lt;br /&gt;
              -1200  NZDT for New Zealand Daylight.&lt;br /&gt;
&lt;br /&gt;
     The following is an example of setting the TZ environment variable&lt;br /&gt;
     for the timezone, only when timezone changes go into effect.&lt;br /&gt;
&lt;br /&gt;
               $ export TZ=EST+5EDT,M4.1.0/2,M10.5.0/2&lt;br /&gt;
&lt;br /&gt;
     Take a look at the last line &amp;quot;M10.5.0/2&amp;quot;. What does it mean? Here is the&lt;br /&gt;
     documentation&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Mm.w.d This  specifies  day  d (0 &amp;lt;= d &amp;lt;= 6) of week w (1 &amp;lt;= w &amp;lt;= 5) of&lt;br /&gt;
              month m (1 &amp;lt;= m &amp;lt;= 12).  Week 1 is the first week in which day d&lt;br /&gt;
              occurs and week 5 is the last week in which day d occurs.  Day 0&lt;br /&gt;
              is a Sunday.&lt;br /&gt;
&lt;br /&gt;
              The time fields specify when, in the local time  currently  in&lt;br /&gt;
              effect, the  change  to  the  other  time  occurs.   If omitted,&lt;br /&gt;
              the default is  02:00:00.&lt;br /&gt;
&lt;br /&gt;
      So this is what it means. M10 stands for October, the 5 is the fifth week&lt;br /&gt;
      that includes a Sunday (note 0 in M10.5.0/2 is Sunday). To see that it is&lt;br /&gt;
      the fifth week see the calendar below. The time change occurs a 2am in&lt;br /&gt;
      the morning.&lt;br /&gt;
&lt;br /&gt;
                                October&lt;br /&gt;
                         Su Mo Tu We Th Fr Sa&lt;br /&gt;
                                         1  2&lt;br /&gt;
                          3  4  5  6  7  8  9&lt;br /&gt;
                         10 11 12 13 14 15 16&lt;br /&gt;
                         17 18 19 20 21 22 23&lt;br /&gt;
                         24 25 26 27 28 29 30&lt;br /&gt;
                         31&lt;br /&gt;
&lt;br /&gt;
       Prove it. Take the following program sunrise, which can calcuates sunrise&lt;br /&gt;
       and sunset for an latitude and longitude. This program can be downloaded&lt;br /&gt;
       from the following location:&lt;br /&gt;
           http://sourceforge.net/direct-dl/mchirico/souptonuts/working_with_time.tar.gz&lt;br /&gt;
&lt;br /&gt;
       Below is a bash script that will run the program for the next 100 days.&lt;br /&gt;
&lt;br /&gt;
          #!/bin/bash&lt;br /&gt;
          #  program: next100days  Mike Chirico&lt;br /&gt;
          #  download:&lt;br /&gt;
          #  http://sourceforge.net/direct-dl/mchirico/souptonuts/working_with_time.tar.gz&lt;br /&gt;
          #&lt;br /&gt;
          #  This will calculate the sunrise and sunset for&lt;br /&gt;
          #  latitude     39.95  Note must convert to degrees&lt;br /&gt;
          #  longitude  75.15  Note must convert to degrees&lt;br /&gt;
          lat=39.95&lt;br /&gt;
          long=75.15&lt;br /&gt;
          for (( i=0; i &amp;lt;= 100; i++))&lt;br /&gt;
          do&lt;br /&gt;
            sunrise    `date -d &amp;quot;+$i day&amp;quot; &amp;quot;+%Y %m %d&amp;quot;` $lat $long&lt;br /&gt;
          done&lt;br /&gt;
&lt;br /&gt;
       Take a look at the following sample output.&lt;br /&gt;
&lt;br /&gt;
           $ export TZ=EST+5EDT,M4.1.0/2,M10.5.0/2&lt;br /&gt;
           $ ./next100days&lt;br /&gt;
&lt;br /&gt;
          Sunrise  08-24-2004  06:21:12   Sunset 08-24-2004  19:43:42&lt;br /&gt;
          Sunrise  08-25-2004  06:22:09   Sunset 08-25-2004  19:42:12&lt;br /&gt;
          Sunrise  08-26-2004  06:23:06   Sunset 08-26-2004  19:40:41&lt;br /&gt;
          Sunrise  08-27-2004  06:24:03   Sunset 08-27-2004  19:39:09&lt;br /&gt;
          Sunrise  08-28-2004  06:25:00   Sunset 08-28-2004  19:37:37&lt;br /&gt;
          Sunrise  08-29-2004  06:25:56   Sunset 08-29-2004  19:36:04&lt;br /&gt;
          Sunrise  08-30-2004  06:26:53   Sunset 08-30-2004  19:34:31&lt;br /&gt;
          Sunrise  08-31-2004  06:27:50   Sunset 08-31-2004  19:32:57&lt;br /&gt;
          Sunrise  09-01-2004  06:28:46   Sunset 09-01-2004  19:31:22&lt;br /&gt;
          Sunrise  09-02-2004  06:29:43   Sunset 09-02-2004  19:29:47&lt;br /&gt;
          ..[values omitted ]&lt;br /&gt;
          Sunrise  10-28-2004  07:25:31   Sunset 10-28-2004  18:02:34&lt;br /&gt;
          Sunrise  10-29-2004  07:26:38   Sunset 10-29-2004  18:01:19&lt;br /&gt;
          Sunrise  10-30-2004  07:27:46   Sunset 10-30-2004  18:00:06&lt;br /&gt;
          Sunrise  10-31-2004  06:28:53   Sunset 10-31-2004  16:58:54&lt;br /&gt;
          Sunrise  11-01-2004  06:30:01   Sunset 11-01-2004  16:57:44&lt;br /&gt;
          Sunrise  11-02-2004  06:31:10   Sunset 11-02-2004  16:56:35&lt;br /&gt;
&lt;br /&gt;
       Compare 10-30-2004 with 10-31-2004. Sunrise is an hour earlier because&lt;br /&gt;
       daylight saving time has ended, just as predicted.&lt;br /&gt;
&lt;br /&gt;
       There is an easier way to switch between timezones. Take a look at the&lt;br /&gt;
       directory zoneinfo as follows:&lt;br /&gt;
&lt;br /&gt;
            $ ls /usr/share/zoneinfo&lt;br /&gt;
&lt;br /&gt;
            Africa      Chile    Factory    Iceland      Mexico    posix       UCT&lt;br /&gt;
            America     CST6CDT  GB         Indian       Mideast   posixrules  Universal&lt;br /&gt;
            Antarctica  Cuba     GB-Eire    Iran         MST       PRC         US&lt;br /&gt;
            Arctic      EET      GMT        iso3166.tab  MST7MDT   PST8PDT     UTC&lt;br /&gt;
            Asia        Egypt    GMT0       Israel       Navajo    right       WET&lt;br /&gt;
            Atlantic    Eire     GMT-0      Jamaica      NZ        ROC         W-SU&lt;br /&gt;
            Australia   EST      GMT+0      Japan        NZ-CHAT   ROK         zone.tab&lt;br /&gt;
            Brazil      EST5EDT  Greenwich  Kwajalein    Pacific   Singapore   Zulu&lt;br /&gt;
            Canada      Etc      Hongkong   Libya        Poland    SystemV&lt;br /&gt;
            CET         Europe   HST        MET          Portugal  Turkey&lt;br /&gt;
&lt;br /&gt;
       TZ can be set to any one of these files. Some of these are directories and contain&lt;br /&gt;
       subdirectories, such as ./posix/America. This way you don not have to enter the&lt;br /&gt;
       timezone, offset, and range for dst, since it has already been calculated.&lt;br /&gt;
&lt;br /&gt;
           $ export TZ=:/usr/share/zoneinfo/posix/America/Aruba&lt;br /&gt;
           $ export TZ=:/usr/share/zoneinfo/Egypt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Reference:&lt;br /&gt;
          http://prdownloads.sourceforge.net/cpearls/date_calc.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
          Also see  (TIP 27).&lt;br /&gt;
          Also see  (TIP 103) using chrony which is very similiar to ntpd.&lt;br /&gt;
          Note time settings can usually be found in /etc/sysconfig/clock&lt;br /&gt;
         &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 2:&lt;br /&gt;
&lt;br /&gt;
     cpio works like tar, only better.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Create two directories with data ../dir1 an ../dir2)&lt;br /&gt;
&lt;br /&gt;
          mkdir -p ../dir1&lt;br /&gt;
          mkdir -p ../dir2&lt;br /&gt;
          cp /etc/*.conf ../dir1/.&lt;br /&gt;
          cp /etc/*.cnf ../dir2/.&lt;br /&gt;
&lt;br /&gt;
          Which will backup all your cnf and conf files.&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Piping the files to tar)&lt;br /&gt;
&lt;br /&gt;
          cpio works like tar but can take input&lt;br /&gt;
          from the &amp;quot;find&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar &amp;gt; test.tar&lt;br /&gt;
               or&lt;br /&gt;
           $ find ../dir1/ | cpio -o -H tar &amp;gt; test2.tar&lt;br /&gt;
&lt;br /&gt;
          Same command without the &amp;quot;&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar -F test.tar&lt;br /&gt;
              or&lt;br /&gt;
           $ find ../dir1/ | cpio -o -H tar -F test2.tar&lt;br /&gt;
&lt;br /&gt;
          Using append&lt;br /&gt;
&lt;br /&gt;
           $ find ../dir1/ | cpio -o --format=tar -F test.tar&lt;br /&gt;
             or&lt;br /&gt;
           $ find ../dir2/ | cpio -o --format=tar --append -F test.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (List contents of the tar file)&lt;br /&gt;
&lt;br /&gt;
          $ cpio -it &amp;lt; test.tar&lt;br /&gt;
                or&lt;br /&gt;
          $ cpio -it -F test.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Extract the contents)&lt;br /&gt;
&lt;br /&gt;
          $ cpio -i -F test.tar&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 3:&lt;br /&gt;
&lt;br /&gt;
     Working with tar. The basics with encryption.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Using the tar command on the directory /stuff)&lt;br /&gt;
&lt;br /&gt;
          Suppose you have a directory /stuff&lt;br /&gt;
          To tar everything in stuff to create a &amp;quot;.tar&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
          $ tar -cvf stuff.tar stuff&lt;br /&gt;
&lt;br /&gt;
          Which will create &amp;quot;stuff.tar&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Using the tar command to create a &amp;quot;.tar.gz&amp;quot; of /stuff)&lt;br /&gt;
&lt;br /&gt;
          $ tar -czf stuff.tar.gz stuff&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (List the files in the archive)&lt;br /&gt;
&lt;br /&gt;
          $ tar -tzf stuff.tar.gz&lt;br /&gt;
               or&lt;br /&gt;
          $ tar -tf stuff.tar&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (A way to list specific files)&lt;br /&gt;
&lt;br /&gt;
          Note, pipe the results to a file and edit&lt;br /&gt;
&lt;br /&gt;
           $ tar -tzf stuff.tar.gz &amp;gt; mout&lt;br /&gt;
&lt;br /&gt;
          Then, edit mout to only include the files you want&lt;br /&gt;
&lt;br /&gt;
           $ tar -T mout -xzf stuff.tar.gz&lt;br /&gt;
&lt;br /&gt;
          The above command will only get the files in mout.&lt;br /&gt;
          Of couse, if you want them all&lt;br /&gt;
&lt;br /&gt;
           $ tar -xzf stuff.tar.gz&lt;br /&gt;
&lt;br /&gt;
     STEP 5 (ENCRYPTION)&lt;br /&gt;
&lt;br /&gt;
           $ tar -zcvf - stuff|openssl des3 -salt -k secretpassword | dd of=stuff.des3&lt;br /&gt;
&lt;br /&gt;
          This will create stuff.des3...don't forget the password you&lt;br /&gt;
          put in place of  secretpassword. This can be done interactively as&lt;br /&gt;
          well.&lt;br /&gt;
&lt;br /&gt;
            $ dd if=stuff.des3 |openssl des3 -d -k secretpassword|tar zxf -&lt;br /&gt;
&lt;br /&gt;
     NOTE:  above there is a &amp;quot;-&amp;quot; at the end... this will&lt;br /&gt;
            extract everything.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 4:&lt;br /&gt;
&lt;br /&gt;
     Creating a Virtual File System and Mounting it with a Loopback Device.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (Construct a 10MB file)&lt;br /&gt;
&lt;br /&gt;
           $ dd if=/dev/zero of=/tmp/disk-image count=20480&lt;br /&gt;
&lt;br /&gt;
          By default dd uses block of 512 so the size will be 20480*512&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (Make an ext2 or ext3 file system) -- ext2 shown here.&lt;br /&gt;
&lt;br /&gt;
           $ mke2fs -q&lt;br /&gt;
&lt;br /&gt;
          or if you want ext3&lt;br /&gt;
&lt;br /&gt;
           $ mkfs -t ext3 -q /tmp/disk-image&lt;br /&gt;
&lt;br /&gt;
          yes, you can even use reiser, but you'll need to create a bigger&lt;br /&gt;
          disk image. Something like &amp;quot;dd if=/dev/zero of=/tmp/disk-image count=50480&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ mkfs -t reiserfs -q /tmp/disk-image&lt;br /&gt;
&lt;br /&gt;
          Hit yes for confirmation.  It only asks this because it's a file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Create a directory &amp;quot;virtual-fs&amp;quot; and mount. This has to be done as root)&lt;br /&gt;
&lt;br /&gt;
           $ mkdir /virtual-fs&lt;br /&gt;
           $ mount -o loop=/dev/loop0 /tmp/disk-image /virtual-fs&lt;br /&gt;
&lt;br /&gt;
         SPECIAL NOTE: if you mount a second device you will have to increase the&lt;br /&gt;
                       loop count: loop=/dev/loop1, loop=/dev/loop2, ... loop=/dev/loopn&lt;br /&gt;
&lt;br /&gt;
          Now it operates just like a disk. This virtual filesystem can be mounted&lt;br /&gt;
          when the system boots by adding the following to the &amp;quot;/etc/fstab&amp;quot; file. Then,&lt;br /&gt;
          to mount, just type &amp;quot;mount /virtual-fs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                 /tmp/disk-image /virtual-fs ext2               rw,loop=/dev/loop0 0 0&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (When done, umount it)&lt;br /&gt;
&lt;br /&gt;
           $ umount /virtual-fs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE: If you are using Fedora core 2, in the /etc/fstab you can take&lt;br /&gt;
              advantage of acl properties for this mount. Note the acl next to the&lt;br /&gt;
              rw entry. This is shown here with ext3.&lt;br /&gt;
&lt;br /&gt;
                 /tmp/disk-image     /virtual-fs ext3    rw,acl,loop=/dev/loop1 0 0&lt;br /&gt;
&lt;br /&gt;
              Also, if you are using Fedora core 2 and above, you can mount the file&lt;br /&gt;
              on a cryptoloop.&lt;br /&gt;
&lt;br /&gt;
                $ dd if=/dev/urandom of=disk-aes count=20480&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ modprobe loop&lt;br /&gt;
                $ modprobe cryptoloop&lt;br /&gt;
                $ modprobe aes&lt;br /&gt;
&lt;br /&gt;
                $ losetup -e aes /dev/loop0 disk-aes&lt;br /&gt;
                $ mkfs -t ext2 /dev/loop0&lt;br /&gt;
                $ mount -o loop,encryption=aes disk-aes &amp;lt;mount point&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              If you do not have Fedora core 2, then, you can build the kernel from source&lt;br /&gt;
              with some of the following options (not complete, yet)&lt;br /&gt;
               reference:&lt;br /&gt;
     http://cvs.sourceforge.net/viewcvs.py/cpearls/cpearls/src/posted_on_sf/acl/ehd.pdf?rev=1.1&amp;amp;view=log&lt;br /&gt;
&lt;br /&gt;
                      Cryptographic API Support (CONFIG_CRYPTO)&lt;br /&gt;
                      generic loop cryptographic (CONFIG_CRYPTOLOOP)&lt;br /&gt;
                      Cryptographic ciphers (CONFIG_CIPHERS)&lt;br /&gt;
                      Enable one or more  ciphers  (CONFIG CIPHER .*) such as AES.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     HELPFUL INFORMATION: It is possible to bind mount partitions, or associate the&lt;br /&gt;
                     mounted partition to a directory name.&lt;br /&gt;
&lt;br /&gt;
                  # mount --bind  /virtual-fs      /home/mchirico/vfs&lt;br /&gt;
&lt;br /&gt;
             Also, if you want to see what filesystems are currently mounted, &amp;quot;cat&amp;quot; the&lt;br /&gt;
             file &amp;quot;/etc/mtab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
                  $ cat /etc/mtab&lt;br /&gt;
&lt;br /&gt;
     Also see TIP 91.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 5:&lt;br /&gt;
&lt;br /&gt;
     Setting up 2 IP address on &amp;quot;One&amp;quot; NIC. This example is on ethernet.&lt;br /&gt;
&lt;br /&gt;
     STEP 1 (The settings for the initial IP address)&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
&lt;br /&gt;
            DEVICE=eth0&lt;br /&gt;
            BOOTPROTO=static&lt;br /&gt;
            BROADCAST=192.168.99.255&lt;br /&gt;
            IPADDR=192.168.1.155&lt;br /&gt;
            NETMASK=255.255.252.0&lt;br /&gt;
            NETWORK=192.168.1.0&lt;br /&gt;
            ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (2nd IP address: )&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/sysconfig/network-scripts/ifcfg-eth0:1&lt;br /&gt;
&lt;br /&gt;
            DEVICE=eth0:1&lt;br /&gt;
            BOOTPROTO=static&lt;br /&gt;
            BROADCAST=192.168.99.255&lt;br /&gt;
            IPADDR=192.168.1.182&lt;br /&gt;
            NETMASK=255.255.252.0&lt;br /&gt;
            NETWORK=192.168.1.0&lt;br /&gt;
            ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
     SUMMARY  Note, in STEP 1 the filename is &amp;quot;ifcfg-eth0&amp;quot;, whereas in&lt;br /&gt;
              STEP 2 it's &amp;quot;ifcfg-eth0:1&amp;quot; and also not the matching&lt;br /&gt;
              entries for &amp;quot;DEVICE=...&amp;quot;.  Also, obviously, the&lt;br /&gt;
              &amp;quot;IPADDR&amp;quot; is different as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 6:&lt;br /&gt;
&lt;br /&gt;
     Sharing Directories Among Several Users.&lt;br /&gt;
&lt;br /&gt;
     Several people are working on a project in &amp;quot;/home/share&amp;quot;&lt;br /&gt;
     and they need to create documents and programs so that&lt;br /&gt;
     others in the group can edit and execute these documents&lt;br /&gt;
     as needed. Also see (TIP 186) for adding existing users&lt;br /&gt;
     to groups.&lt;br /&gt;
&lt;br /&gt;
       $  /usr/sbin/groupadd share&lt;br /&gt;
       $  chown -R root.share /home/share&lt;br /&gt;
       $  /usr/bin/gpasswd -a &amp;lt;username&amp;gt; share&lt;br /&gt;
       $  chmod 2775 /home/share&lt;br /&gt;
&lt;br /&gt;
       $  ls -ld /home/share&lt;br /&gt;
             drwxrwsr-x    2 root     share        4096 Nov  8 16:19 /home/share&lt;br /&gt;
                   ^---------- Note the s bit, which was set with the chmod 2775&lt;br /&gt;
&lt;br /&gt;
       $  cat /etc/group&lt;br /&gt;
          ...&lt;br /&gt;
           share:x:502:chirico,donkey,zoe&lt;br /&gt;
          ...          ^------- users are added to this group.&lt;br /&gt;
&lt;br /&gt;
     The user may need to login again to get access. Or, if the user is currently&lt;br /&gt;
     logged in, they can run the following command:&lt;br /&gt;
&lt;br /&gt;
       $ su - &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Note, the above step is recommended over  &amp;quot;newgrp - share&amp;quot; since currently&lt;br /&gt;
     newgrp in FC2,FC3, and FC4 gets access to the group but the umask is not&lt;br /&gt;
     correctly formed.&lt;br /&gt;
&lt;br /&gt;
     As root you  can test their account.&lt;br /&gt;
&lt;br /&gt;
       $ su - &amp;lt;username&amp;gt;   &amp;quot;You need to '-' to pickup thier environment  '$ su - chirico' &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Note: SUID, SGID, Sticky bit. Only the left most octet is examined, and &amp;quot;chmod 755&amp;quot; is used&lt;br /&gt;
          as an example of the full command. But, anything else could be used as well. Normally&lt;br /&gt;
          you'd want executable permissions.&lt;br /&gt;
&lt;br /&gt;
        Octal digit  Binary value      Meaning                           Example usage&lt;br /&gt;
            0           000       all cleared                             $ chmod 0755 or chmod 755&lt;br /&gt;
            1           001       sticky                                  $ chmod 1755&lt;br /&gt;
            2           010       setgid                                  $ chmod 2755&lt;br /&gt;
            3           011       setgid, sticky                          $ chmod 3755&lt;br /&gt;
            4           100       setuid                                  $ chmod 4755&lt;br /&gt;
            5           101       setuid, sticky                          $ chmod 5755&lt;br /&gt;
            6           110       setuid, setgid                          $ chmod 6755&lt;br /&gt;
            7           111       setuid, setgid, sticky                  $ chmod 7755&lt;br /&gt;
&lt;br /&gt;
     A few examples applied to a directory below. In the first example all users in the group can&lt;br /&gt;
     add files to directory &amp;quot;dirA&amp;quot; and they can delete their own files. Users cannot delete other&lt;br /&gt;
     user's files.&lt;br /&gt;
&lt;br /&gt;
        Sticky bit:&lt;br /&gt;
           $ chmod 1770  dirA&lt;br /&gt;
&lt;br /&gt;
     Below files created within the directory have the group ID of the directory, rather than that&lt;br /&gt;
     of the default group setting for the user who created the file.&lt;br /&gt;
&lt;br /&gt;
        Set group ID bit:&lt;br /&gt;
           $ chmod 2755  dirB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 7:&lt;br /&gt;
&lt;br /&gt;
     Getting Infomation on Commands&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;info&amp;quot; is a great utility for getting information about the system.&lt;br /&gt;
     Here's a quick key on using &amp;quot;info&amp;quot; from the terminal prompt.&lt;br /&gt;
&lt;br /&gt;
       'q' exits.&lt;br /&gt;
       'u' moves up to the table of contents of the current section.&lt;br /&gt;
       'n' moves to the next chapter.&lt;br /&gt;
       'p' moves to the previous chapter.&lt;br /&gt;
       'space' goes into the selected section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The following is a good starting point:&lt;br /&gt;
&lt;br /&gt;
        $ info coreutils&lt;br /&gt;
&lt;br /&gt;
      Need to find out what a certain program does?&lt;br /&gt;
&lt;br /&gt;
        $ whatis  open&lt;br /&gt;
       open   (2)  - open and possibly create a file or device&lt;br /&gt;
       open   (3)  - perl pragma to set default PerlIO layers for input and output&lt;br /&gt;
       open   (3pm)  - perl pragma to set default PerlIO layers for input and output&lt;br /&gt;
       open   (n)  - Open a file-based or command pipeline channel&lt;br /&gt;
&lt;br /&gt;
      To get specific information about the open commmand&lt;br /&gt;
&lt;br /&gt;
        $ man 2 open&lt;br /&gt;
&lt;br /&gt;
       also try 'keyword' search, which is the same as the apropos command.&lt;br /&gt;
       For example, to find all the man pages on selinux, type the following:&lt;br /&gt;
&lt;br /&gt;
        $ man -k selinux&lt;br /&gt;
&lt;br /&gt;
       or the man full word search. Same as whatis command.&lt;br /&gt;
&lt;br /&gt;
        $ man -f &amp;lt;some string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       This is a hint once you are inside man.&lt;br /&gt;
&lt;br /&gt;
        space      moves forward one page&lt;br /&gt;
        b          moves backward&lt;br /&gt;
        y          scrolls up one line &amp;quot;yikes, I missed it!&amp;quot;&lt;br /&gt;
        g          goes to the beginning&lt;br /&gt;
        q          quits&lt;br /&gt;
        /&amp;lt;string&amp;gt;  search, repeat seach n&lt;br /&gt;
        m          mark, enter a letter like &amp;quot;a&amp;quot;, then, ' to go back&lt;br /&gt;
        '          enter a letter that is marked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       To get section numbers&lt;br /&gt;
&lt;br /&gt;
        $ man 8 ping&lt;br /&gt;
&lt;br /&gt;
       Note the numbers are used as follows&lt;br /&gt;
         (This is OpenBSD)&lt;br /&gt;
&lt;br /&gt;
         1  General Commands&lt;br /&gt;
         2  System Calls and Error Numbers&lt;br /&gt;
         3  C Libraries&lt;br /&gt;
         3p perl&lt;br /&gt;
         4  Devices and device drivers&lt;br /&gt;
         5  File Formats and config files&lt;br /&gt;
         6  Game instructions&lt;br /&gt;
         7  Miscellaneous information&lt;br /&gt;
         8  System maintenance&lt;br /&gt;
         9  Kernel internals&lt;br /&gt;
&lt;br /&gt;
       To find the man page directly, &amp;quot;ls&amp;quot; command:&lt;br /&gt;
&lt;br /&gt;
         $ whereis -m ls&lt;br /&gt;
         ls: /usr/share/man/man1/ls.1.gz /usr/share/man/man1/ls.1 /usr/share/man/man1p/ls.1p&lt;br /&gt;
&lt;br /&gt;
       To read this file directly, do the following:&lt;br /&gt;
&lt;br /&gt;
         $ man /usr/share/man/man1/ls.1.gz&lt;br /&gt;
&lt;br /&gt;
       If you want to know the manpath, execute manpath.&lt;br /&gt;
&lt;br /&gt;
         $ manpath&lt;br /&gt;
         /usr/share/man:/usr/X11R6/man:/usr/local/share/man:/usr/local/pgsql/man:/usr/man:/usr/local/man&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 8:&lt;br /&gt;
&lt;br /&gt;
     How to Put a &amp;quot;Running Job&amp;quot; in the Background.&lt;br /&gt;
&lt;br /&gt;
     You're running a job at the terminal prompt, and it's taking&lt;br /&gt;
     a very long time. You want to put the job in the backgroud.&lt;br /&gt;
&lt;br /&gt;
       &amp;quot;CTL - z&amp;quot; Temporarily suspends the job&lt;br /&gt;
       $ jobs     This will list all the jobs&lt;br /&gt;
       $ bg %jobnumber (bg %1)  To run in the background&lt;br /&gt;
       $ fg %jobnumber          To bring back in the foreground&lt;br /&gt;
&lt;br /&gt;
     Need to kill all jobs -- say you're using several suspended&lt;br /&gt;
     emacs sessions and you just want everything to exit.&lt;br /&gt;
&lt;br /&gt;
       $ kill -9  `jobs -p`&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;jobs -p&amp;quot; gives the process number of each job, and the&lt;br /&gt;
     kill -9 kills everything. Yes, sometimes &amp;quot;kill -9&amp;quot; is excessive&lt;br /&gt;
     and you should issue a &amp;quot;kill -15&amp;quot; that allows jobs to clean-up.&lt;br /&gt;
     However, for exacs session, I prefer &amp;quot;kill -9&amp;quot; and haven't had&lt;br /&gt;
     a problem.&lt;br /&gt;
&lt;br /&gt;
     Sometimes you need to list the process id along with job&lt;br /&gt;
     information. For instance, here's process id with the listing.&lt;br /&gt;
&lt;br /&gt;
       $ jobs -l&lt;br /&gt;
&lt;br /&gt;
     Note you can also renice a job, or give it lower priority.&lt;br /&gt;
&lt;br /&gt;
       $ nice -n +15 find . -ctime 2 -type f  -exec ls {} \; &amp;gt; last48hours&lt;br /&gt;
        ^z&lt;br /&gt;
       $  bg&lt;br /&gt;
&lt;br /&gt;
     So above that was a ctl-z to suppend. Then, bg to run it in&lt;br /&gt;
     the background. Now, if you want to change the priority lower&lt;br /&gt;
     you just renice it, once you know the process id.&lt;br /&gt;
&lt;br /&gt;
       $ jobs -pl&lt;br /&gt;
   [1]+ 29388 Running                 nice -n +15 find . -ctime 2 -exec ls -l {} \; &amp;gt;mout &amp;amp;&lt;br /&gt;
&lt;br /&gt;
       $ renice +30 -p 29388&lt;br /&gt;
        29388: old priority 15, new priority 19&lt;br /&gt;
&lt;br /&gt;
      19 was the lowest priority for this job. You cannot increase&lt;br /&gt;
      the priority unless you are root.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 9:&lt;br /&gt;
&lt;br /&gt;
     Need to Delete a File for Good -- not even GOD can recover.&lt;br /&gt;
&lt;br /&gt;
     You have a file &amp;quot;secret&amp;quot;.  The following makes it so no one&lt;br /&gt;
     can read it.  If the file was 12 bytes, it's now 4096 after it&lt;br /&gt;
     has been over written 100 times.  There's no way to recover this.&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z secret&lt;br /&gt;
&lt;br /&gt;
     Want to remove the file? Use the &amp;quot;u&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z -u test2&lt;br /&gt;
&lt;br /&gt;
     It can be applied to a device&lt;br /&gt;
&lt;br /&gt;
       $ shred -n 100 -z -u /dev/fd0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       CAUTION: Note that shred relies on a very important assumption: that the file system  overwrites  data&lt;br /&gt;
       in  place.   This is the traditional way to do things, but many modern file system designs do not sat-&lt;br /&gt;
       isfy this assumption.  The following are examples of file systems on which shred is not effective,  or&lt;br /&gt;
       is not guaranteed to be effective in all file system modes:&lt;br /&gt;
&lt;br /&gt;
       * log-structured or journaled file systems, such as those supplied with&lt;br /&gt;
&lt;br /&gt;
              AIX and Solaris (and JFS, ReiserFS, XFS, Ext3, etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 52).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 10:&lt;br /&gt;
&lt;br /&gt;
     Who and What is doing What on Your System - finding open sockets,&lt;br /&gt;
     files etc.&lt;br /&gt;
&lt;br /&gt;
       $ lsof&lt;br /&gt;
          or as root&lt;br /&gt;
       $ watch lsof -i&lt;br /&gt;
&lt;br /&gt;
     To list all open Internet files, use:&lt;br /&gt;
&lt;br /&gt;
       $ lsof -i -U&lt;br /&gt;
&lt;br /&gt;
       (See TIP 118)&lt;br /&gt;
&lt;br /&gt;
     Also try fuser. Suppose you have a mounted file-system, and you need&lt;br /&gt;
     to umount it. To list the users on the file-system /work&lt;br /&gt;
&lt;br /&gt;
       $ fuser -u /work&lt;br /&gt;
&lt;br /&gt;
     To kill all processes accessing the file system /work  in  any way.&lt;br /&gt;
&lt;br /&gt;
       $ fuser -km /work&lt;br /&gt;
&lt;br /&gt;
     Or better yet, maybe you want to eject a cdrom on /mnt/cdrom&lt;br /&gt;
&lt;br /&gt;
       $ fuser -km /mnt/cdrom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     If you need IO load information about your system, you can execute&lt;br /&gt;
     iostat. But note, the very first iostat gives a snapshot since&lt;br /&gt;
     the last boot. You typically want the following command, which gives&lt;br /&gt;
     you 3 outputs every 5 seconds.&lt;br /&gt;
&lt;br /&gt;
       $ iostat -xtc 5 3&lt;br /&gt;
       Linux 2.6.12-1.1376_FC3smp (squeezel.squeezel.com) 	10/05/2005&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:04 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  0.97    0.06    1.94    0.62   96.41&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:09 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  0.60    0.00    1.70    0.00   97.70&lt;br /&gt;
&lt;br /&gt;
       Time: 07:05:14 PM&lt;br /&gt;
       avg-cpu:  %user   %nice %system %iowait   %idle&lt;br /&gt;
                  1.00    0.00    1.60    0.00   97.39&lt;br /&gt;
&lt;br /&gt;
     vmstat reports memory statistics.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ vmstat&lt;br /&gt;
       $ ifconfig&lt;br /&gt;
       $ cat /proc/sys/vm/.. (entries under here)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      *NOTE: (TIP 77) shows sample usage of &amp;quot;ifconfig&amp;quot;. Also&lt;br /&gt;
       (TIP 84) shows sample output of &amp;quot;$ cat /proc/cpuinfo&amp;quot;. You can download iostat&lt;br /&gt;
       and other packages from (http://perso.wanadoo.fr/sebastien.godard/download_en.html).&lt;br /&gt;
       You also may want to look at iozone (TIP 178).&lt;br /&gt;
&lt;br /&gt;
     Also&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/meminfo&lt;br /&gt;
       $ cat /proc/stat&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/uptime&lt;br /&gt;
       1078623.55 1048008.34       First number is the number of seconds since boot.&lt;br /&gt;
                                   The second number is the number of idle seconds.&lt;br /&gt;
&lt;br /&gt;
       $ cat /proc/loadavg&lt;br /&gt;
       0.25 0.14 0.10 1/166 7778   This shows load at 1,5, and 15 minutes,&lt;br /&gt;
                                   a total of 1 current running process out&lt;br /&gt;
                                   from a total of 166. The 7778 is the last&lt;br /&gt;
                                   process id used.&lt;br /&gt;
                                   Ref: http://www.teamquest.com/resources/gunther/ldavg1.shtml&lt;br /&gt;
&lt;br /&gt;
     Or current process open file descriptors&lt;br /&gt;
&lt;br /&gt;
        $ ls -l /proc/self/fd/0&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lrwx------    1 chirico  chirico        64 Jun 29 13:17 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            lr-x------    1 chirico  chirico        64 Jun 29 13:17 3 -&amp;gt; /proc/26667/fd&lt;br /&gt;
&lt;br /&gt;
      So you could, $ echo &amp;quot;stuff&amp;quot; &amp;gt; /dev/pts/51, to get output. Note, tree is also&lt;br /&gt;
      helpful here:&lt;br /&gt;
&lt;br /&gt;
         $ tree /proc/self&lt;br /&gt;
&lt;br /&gt;
            /proc/self&lt;br /&gt;
            |-- auxv&lt;br /&gt;
            |-- cmdline&lt;br /&gt;
            |-- cwd -&amp;gt; /work/souptonuts/documentation/theBook&lt;br /&gt;
            |-- environ&lt;br /&gt;
            |-- exe -&amp;gt; /usr/bin/tree&lt;br /&gt;
            |-- fd&lt;br /&gt;
            |   |-- 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   |-- 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   |-- 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |   `-- 3 -&amp;gt; /proc/26668/fd&lt;br /&gt;
            |-- maps&lt;br /&gt;
            |-- mem&lt;br /&gt;
            |-- mounts&lt;br /&gt;
            |-- root -&amp;gt; /&lt;br /&gt;
            |-- stat&lt;br /&gt;
            |-- statm&lt;br /&gt;
            |-- status&lt;br /&gt;
            |-- task&lt;br /&gt;
            |   `-- 26668&lt;br /&gt;
            |       |-- auxv&lt;br /&gt;
            |       |-- cmdline&lt;br /&gt;
            |       |-- cwd -&amp;gt; /work/souptonuts/documentation/theBook&lt;br /&gt;
            |       |-- environ&lt;br /&gt;
            |       |-- exe -&amp;gt; /usr/bin/tree&lt;br /&gt;
            |       |-- fd&lt;br /&gt;
            |       |   |-- 0 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   |-- 1 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   |-- 2 -&amp;gt; /dev/pts/51&lt;br /&gt;
            |       |   `-- 3 -&amp;gt; /proc/26668/task/26668/fd&lt;br /&gt;
            |       |-- maps&lt;br /&gt;
            |       |-- mem&lt;br /&gt;
            |       |-- mounts&lt;br /&gt;
            |       |-- root -&amp;gt; /&lt;br /&gt;
            |       |-- stat&lt;br /&gt;
            |       |-- statm&lt;br /&gt;
            |       |-- status&lt;br /&gt;
            |       `-- wchan&lt;br /&gt;
            `-- wchan&lt;br /&gt;
&lt;br /&gt;
            10 directories, 28 files&lt;br /&gt;
&lt;br /&gt;
     Need a listing of the system settings?&lt;br /&gt;
&lt;br /&gt;
       $ sysctl -a&lt;br /&gt;
&lt;br /&gt;
     Need IPC (Shared Memory Segments, Semaphore Arrays, Message Queue) status&lt;br /&gt;
     etc?&lt;br /&gt;
&lt;br /&gt;
       $ ipcs&lt;br /&gt;
       $ ipcs -l  &amp;quot;This gives limits&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Need to &amp;quot;watch&amp;quot; everything a user does?  The following watches donkey.&lt;br /&gt;
&lt;br /&gt;
       $ watch lsof -u donkey&lt;br /&gt;
&lt;br /&gt;
     Or, to see what in  going on in directory &amp;quot;/work/junk&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       $ watch lsof +D /work/junk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 11:&lt;br /&gt;
&lt;br /&gt;
     How to make a File &amp;quot;immutable&amp;quot; or &amp;quot;unalterable&amp;quot; -- it cannot be changed&lt;br /&gt;
     or deleted even by root. Note this works on (ext2/ext3) filesystems.&lt;br /&gt;
     And, yes, root can delete after it's changed back.&lt;br /&gt;
&lt;br /&gt;
     As root:&lt;br /&gt;
&lt;br /&gt;
       $ chattr +i filename&lt;br /&gt;
&lt;br /&gt;
     And to change it back:&lt;br /&gt;
&lt;br /&gt;
       $ chattr -i filename&lt;br /&gt;
&lt;br /&gt;
     List attributes&lt;br /&gt;
&lt;br /&gt;
       $ lsattr filename&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 12:&lt;br /&gt;
&lt;br /&gt;
     SSH - How to Generate the Key Pair.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     On the local server&lt;br /&gt;
&lt;br /&gt;
       $  ssh-keygen -t dsa -b 2048&lt;br /&gt;
&lt;br /&gt;
     This will create the two files:&lt;br /&gt;
&lt;br /&gt;
            .ssh/id_dsa (Private key)&lt;br /&gt;
            .ssh/id_dsa.pub  (Public key you can share)&lt;br /&gt;
&lt;br /&gt;
     Next insert &amp;quot;.ssh/id_dsa.pub&amp;quot; on the remote server&lt;br /&gt;
     in the file  &amp;quot;.ssh/authorized_keys&amp;quot; and &amp;quot;.ssh/authorized_keys2&amp;quot;&lt;br /&gt;
     and change the  permission of each file to (chmod 600). Plus, make&lt;br /&gt;
     sure the directory &amp;quot;.ssh&amp;quot; exists on the remote computer with 700 rights.&lt;br /&gt;
     Ok, assuming  192.168.1.155 is the remote server and &amp;quot;donkey&amp;quot; is the&lt;br /&gt;
     account on that remote server.&lt;br /&gt;
&lt;br /&gt;
       $ ssh donkey@192.168.1.155 &amp;quot;mkdir -p .ssh&amp;quot;&lt;br /&gt;
       $ ssh donkey@192.168.1.155 &amp;quot;chmod 700 .ssh&amp;quot;&lt;br /&gt;
       $ scp ./.ssh/id_dsa.pub  donkey@192.168.1.155:.ssh/newkey.pub&lt;br /&gt;
&lt;br /&gt;
     Now connect to that remote server &amp;quot;192.168.1.155&amp;quot; and add .ssh/newkey.pub&lt;br /&gt;
     to both &amp;quot;authorized_keys&amp;quot; and &amp;quot;authorized_keys2&amp;quot;.  When done, the permission&lt;br /&gt;
     on&lt;br /&gt;
       (This is on the remote server)&lt;br /&gt;
&lt;br /&gt;
        $chmod 600 .ssh/authorized_key*&lt;br /&gt;
&lt;br /&gt;
     Next, go back to the local server and issue the following:&lt;br /&gt;
&lt;br /&gt;
        $ ssh-agent $SHELL&lt;br /&gt;
        $ ssh-add&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;ssh-add&amp;quot; will allow you to enter the passphrase and it will&lt;br /&gt;
     save it for the current login session.&lt;br /&gt;
&lt;br /&gt;
     You don't have to enter a password when running &amp;quot;ssh-keygen&amp;quot; above. But,&lt;br /&gt;
     remember anyone with root access can &amp;quot;su - &amp;lt;username&amp;gt;&amp;quot; and then connect&lt;br /&gt;
     to your computers.  It's harder, however, not impossible, for root to do&lt;br /&gt;
     this if  you have a password.&lt;br /&gt;
&lt;br /&gt;
     (Reference TIP 151)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 13:&lt;br /&gt;
&lt;br /&gt;
     Securing the System: Don't allow root to login remotely.  Instead,&lt;br /&gt;
     the admin could login as another account, then, &amp;quot;su -&amp;quot;.  However,&lt;br /&gt;
     root can still login &amp;quot;from the local terminal&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     In the &amp;quot;/etc/ssh/sshd_config&amp;quot; file change the following lines:&lt;br /&gt;
&lt;br /&gt;
        Protocol 2&lt;br /&gt;
        PermitRootLogin no&lt;br /&gt;
        PermitEmptyPasswords no&lt;br /&gt;
&lt;br /&gt;
     Then, restart ssh&lt;br /&gt;
&lt;br /&gt;
        /etc/init.d/sshd restart&lt;br /&gt;
&lt;br /&gt;
     Why would you want to do this?  It's not possible for anyone to guess&lt;br /&gt;
     or keep trying the root account.  This is especially good for computers&lt;br /&gt;
     on the Internet. So, even if the &amp;quot;root&amp;quot; passwords is known, they can't&lt;br /&gt;
     get access to the system remotely.  Only from the terminal, which is locked&lt;br /&gt;
     in your computer room. However, if anyone has a account on the server,&lt;br /&gt;
     then, they can login under their  account then &amp;quot;su -&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Suppose you only want a limited number of users:  &amp;quot;mchirico&amp;quot; and &amp;quot;donkey&amp;quot;.&lt;br /&gt;
     Add the following line to &amp;quot;/etc/ssh/sshd_config&amp;quot;. Note, this allows access&lt;br /&gt;
     for chirico and donkey, but everyone else is denied.&lt;br /&gt;
&lt;br /&gt;
         #  Once you add AllowUsers - everyone else is denied.&lt;br /&gt;
         AllowUsers mchirico donkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 14:&lt;br /&gt;
&lt;br /&gt;
     Keep Logs Longer with Less Space.&lt;br /&gt;
&lt;br /&gt;
     Normally logs rotate monthly, over writing all the old data.  Here's a&lt;br /&gt;
     sample &amp;quot;/etc/logrotate.conf&amp;quot; that will keep 12 months of backup&lt;br /&gt;
     compressing the logfiles&lt;br /&gt;
&lt;br /&gt;
       $ cat /etc/logrotate.conf&lt;br /&gt;
&lt;br /&gt;
             # see &amp;quot;man logrotate&amp;quot; for details&lt;br /&gt;
             # rotate log files weekly&lt;br /&gt;
             #chirico changes to monthly&lt;br /&gt;
             monthly&lt;br /&gt;
&lt;br /&gt;
             # keep 4 weeks worth of backlogs&lt;br /&gt;
             # keep 12 months of backup&lt;br /&gt;
             rotate 12&lt;br /&gt;
&lt;br /&gt;
             # create new (empty) log files after rotating old ones&lt;br /&gt;
             create&lt;br /&gt;
&lt;br /&gt;
             # uncomment this if you want your log files compressed&lt;br /&gt;
             compress&lt;br /&gt;
&lt;br /&gt;
             # RPM packages drop log rotation information into this directory&lt;br /&gt;
             include /etc/logrotate.d&lt;br /&gt;
&lt;br /&gt;
             # no packages own wtmp -- we'll rotate them here&lt;br /&gt;
             /var/log/wtmp {&lt;br /&gt;
                 monthly&lt;br /&gt;
                 create 0664 root utmp&lt;br /&gt;
                 rotate 1&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
             # system-specific logs may be also be configured here.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Note: see tip 1. The clock should always be correctly set.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 15:&lt;br /&gt;
&lt;br /&gt;
     What Network Services are Running?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -atup&lt;br /&gt;
&lt;br /&gt;
     or&lt;br /&gt;
&lt;br /&gt;
          $ netstat -ap|grep LISTEN|less&lt;br /&gt;
&lt;br /&gt;
     This can be helpful to determine the services running.&lt;br /&gt;
&lt;br /&gt;
     Need stats on dropped UDP packets?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s -u&lt;br /&gt;
&lt;br /&gt;
     or TCP&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s -t&lt;br /&gt;
&lt;br /&gt;
     or summary of everything&lt;br /&gt;
&lt;br /&gt;
          $ netstat -s&lt;br /&gt;
&lt;br /&gt;
     or looking for error rates on the interface?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -i&lt;br /&gt;
&lt;br /&gt;
     Listening interfaces?&lt;br /&gt;
&lt;br /&gt;
          $ netstat -l&lt;br /&gt;
&lt;br /&gt;
     (Tip above provided by Amos Shapira)&lt;br /&gt;
&lt;br /&gt;
     Also see TIP 77.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 16:&lt;br /&gt;
&lt;br /&gt;
     Apache: Creating and Using an &amp;quot;.htaccess&amp;quot; File&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Below is a sample &amp;quot;.htaccess&amp;quot; file which goes in&lt;br /&gt;
     &amp;quot;/usr/local/apache/htdocs/chirico/alpha/.htaccess&amp;quot; for this&lt;br /&gt;
     example&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         AuthUserFile /usr/local/apache/htdocs/chirico/alpha/.htpasswd&lt;br /&gt;
         AuthGroupFile /dev/null&lt;br /&gt;
         AuthName &amp;quot;Your Name and regular password required&amp;quot;&lt;br /&gt;
         AuthType Basic&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;Limit GET POST&amp;gt;&lt;br /&gt;
         require valid-user&lt;br /&gt;
         &amp;lt;/Limit&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    In order for this to work /usr/local/apache/conf/httpd.conf must&lt;br /&gt;
    have the following line in it:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       #&lt;br /&gt;
       &amp;lt;Directory /usr/local/apache/htdocs/chirico/alpha&amp;gt;&lt;br /&gt;
           AllowOverride FileInfo AuthConfig Limit&lt;br /&gt;
           Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec&lt;br /&gt;
           &amp;lt;Limit GET POST OPTIONS PROPFIND&amp;gt;&lt;br /&gt;
               Order allow,deny&lt;br /&gt;
               Allow from all&lt;br /&gt;
           &amp;lt;/Limit&amp;gt;&lt;br /&gt;
           &amp;lt;LimitExcept GET POST OPTIONS PROPFIND&amp;gt;&lt;br /&gt;
               Order deny,allow&lt;br /&gt;
               Deny from all&lt;br /&gt;
           &amp;lt;/LimitExcept&amp;gt;&lt;br /&gt;
       &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Also, a password file must be created&lt;br /&gt;
&lt;br /&gt;
      $ /usr/local/apache/bin/htpasswd -c .htpasswd chirico&lt;br /&gt;
&lt;br /&gt;
    And enter the user names and passwords.&lt;br /&gt;
&lt;br /&gt;
    Next Reload Apache:&lt;br /&gt;
&lt;br /&gt;
      $ /etc/init.d/httpd reload&lt;br /&gt;
&lt;br /&gt;
    (Reference TIP 213 limit access to certain directories based on IP address).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 17:&lt;br /&gt;
&lt;br /&gt;
     Working with &amp;quot;mt&amp;quot; Commands: reading and writing to tape.&lt;br /&gt;
&lt;br /&gt;
     The following assumes the tape device is &amp;quot;/dev/st0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     STEP 1 ( rewind the tape)&lt;br /&gt;
&lt;br /&gt;
          # mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
     STEP 2 (check to see if you are at block 0)&lt;br /&gt;
&lt;br /&gt;
          # mt -f /dev/nst0 tell&lt;br /&gt;
            At block 0.&lt;br /&gt;
&lt;br /&gt;
     STEP 3 (Backup &amp;quot;tar compress&amp;quot;  directories &amp;quot;one&amp;quot;  and &amp;quot;two&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
          # tar -czf /dev/nst0 one two&lt;br /&gt;
&lt;br /&gt;
     STEP 4 (Check to see what block you are at)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
&lt;br /&gt;
       You should get something like block 2 at this point.&lt;br /&gt;
&lt;br /&gt;
     STEP 5 (Rewind the tape)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
     STEP 6 (List the files)&lt;br /&gt;
&lt;br /&gt;
           # tar -tzf /dev/nst0&lt;br /&gt;
              one/&lt;br /&gt;
              one/test&lt;br /&gt;
              two/&lt;br /&gt;
&lt;br /&gt;
     STEP 7 (Restore directory &amp;quot;one&amp;quot;  into directory &amp;quot;junk&amp;quot;).  Note, you&lt;br /&gt;
          have to first rewind the tape, since the last operation moved&lt;br /&gt;
          ahead 2 blocks. Check this with &amp;quot;mt -f /dev/nst0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           # cd junk&lt;br /&gt;
           # mt -f /dev/nst0 rewind&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
              At block 0.&lt;br /&gt;
           # tar -xzf /dev/nst0 one&lt;br /&gt;
&lt;br /&gt;
     STEP 8 (Next, take a look to see what block the tape is at)&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
              At block 2.&lt;br /&gt;
&lt;br /&gt;
     STEP 9 (Now backup directories three  and four)&lt;br /&gt;
&lt;br /&gt;
           # tar -czf /dev/nst0 three four&lt;br /&gt;
&lt;br /&gt;
       After backing up the files, the tape should be past block 2.&lt;br /&gt;
       Check this.&lt;br /&gt;
&lt;br /&gt;
           # mt -f /dev/nst0 tell&lt;br /&gt;
             At block 4.&lt;br /&gt;
&lt;br /&gt;
          Currently the following exist:&lt;br /&gt;
&lt;br /&gt;
                At block 1:&lt;br /&gt;
                     one/&lt;br /&gt;
                    one/test&lt;br /&gt;
                    two/&lt;br /&gt;
&lt;br /&gt;
                At block 2:&lt;br /&gt;
                    three/&lt;br /&gt;
                    three/samplehere&lt;br /&gt;
                    four/&lt;br /&gt;
&lt;br /&gt;
                At block 4:&lt;br /&gt;
                    (* This is empty *)&lt;br /&gt;
&lt;br /&gt;
     A few notes. You can set the blocking factor and a label&lt;br /&gt;
     with tar. For example:&lt;br /&gt;
&lt;br /&gt;
      $ tar --label=&amp;quot;temp label&amp;quot; --create  --blocking-factor=128 --file=/dev/nst0 Notes&lt;br /&gt;
&lt;br /&gt;
     But note if you try to read it with the default, incorrect blocking&lt;br /&gt;
     factor, then, you will get the following error:&lt;br /&gt;
&lt;br /&gt;
        $ tar -t   --file=/dev/nst0&lt;br /&gt;
        tar: /dev/nst0: Cannot read: Cannot allocate memory&lt;br /&gt;
        tar: At beginning of tape, quitting now&lt;br /&gt;
        tar: Error is not recoverable: exiting now&lt;br /&gt;
&lt;br /&gt;
     However this is easily fixed with the correct blocking factor&lt;br /&gt;
&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ tar -t --blocking-factor=128 --file=/dev/nst0&lt;br /&gt;
         temp label&lt;br /&gt;
         Notes&lt;br /&gt;
&lt;br /&gt;
     Take advantage of the label command.&lt;br /&gt;
&lt;br /&gt;
         $ MYCOMMENTS=&amp;quot;Big_important_tape&amp;quot;&lt;br /&gt;
         $ tar --label=&amp;quot;$(date +%F)&amp;quot;+&amp;quot;${MYCOMMENTS}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Writing to tape on a remote 192.168.1.155 computer&lt;br /&gt;
&lt;br /&gt;
         $ tar cvzf - ./tmp | ssh -l chirico 192.168.1.155 '(mt -f /dev/nst0 rewind; dd of=/dev/st0 )'&lt;br /&gt;
&lt;br /&gt;
     Restoring the contents from tape on a remote computer&lt;br /&gt;
&lt;br /&gt;
         $ ssh -l chirico 192.168.1.155 '(mt -f /dev/nst0 rewind; dd if=/dev/st0  )'|tar xzf -&lt;br /&gt;
&lt;br /&gt;
     Getting data off of tape with dd command with odd blocking factor. Just set ibs very high&lt;br /&gt;
&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ tar --label=&amp;quot;Contenets of Notes&amp;quot; --create  --blocking-factor=128 --file=/dev/nst0 Notes&lt;br /&gt;
         $ mt -f /dev/nst0 rewind&lt;br /&gt;
         $ dd ibs=1048576 if=/dev/st0 of=notes.tar&lt;br /&gt;
&lt;br /&gt;
     The above will probably work with ibs=64k as well&lt;br /&gt;
&lt;br /&gt;
        (Also see TIP 136)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 18:&lt;br /&gt;
&lt;br /&gt;
     Encrypting Data to Tape using &amp;quot;tar&amp;quot; and &amp;quot;openssl&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     The following shows an example of writing the contents of &amp;quot;tapetest&amp;quot; to tape:&lt;br /&gt;
&lt;br /&gt;
        $ tar zcvf - tapetest|openssl des3 -salt  -k secretpassword | dd of=/dev/st0&lt;br /&gt;
&lt;br /&gt;
     Reading the data back:&lt;br /&gt;
&lt;br /&gt;
        $ dd if=/dev/st0|openssl des3 -d -k secretpassword|tar xzf -&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 19:&lt;br /&gt;
&lt;br /&gt;
     Mounting an ISO Image as a Filesystem -- this is great if you don't have the DVD&lt;br /&gt;
         hardware, but, need to get at the data.  The following show an example of&lt;br /&gt;
         mounting the Fedora core 2 as a file.&lt;br /&gt;
&lt;br /&gt;
         $ mkdir /iso0&lt;br /&gt;
         $ mount -o loop -t iso9660 /FC2-i386-DVD.iso  /iso0&lt;br /&gt;
&lt;br /&gt;
     Or to mount automatically at boot, add the following to &amp;quot;/etc/fstab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         /FC2-i386-DVD.iso /iso0     iso9660 rw,loop  0 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Reference: http://umn.dl.sourceforge.net/sourceforge/souptonuts/README_fedora.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 20:&lt;br /&gt;
&lt;br /&gt;
     Getting Information about the Hard drive and list all PCI devices.&lt;br /&gt;
&lt;br /&gt;
                $ hdparm /dev/hda&lt;br /&gt;
&lt;br /&gt;
                  /dev/hda:&lt;br /&gt;
                   multcount    = 16 (on)&lt;br /&gt;
                   IO_support   =  0 (default 16-bit)&lt;br /&gt;
                   unmaskirq    =  0 (off)&lt;br /&gt;
                   using_dma    =  1 (on)&lt;br /&gt;
                   keepsettings =  0 (off)&lt;br /&gt;
                   readonly     =  0 (off)&lt;br /&gt;
                   readahead    = 256 (on)&lt;br /&gt;
                   geometry     = 16383/255/63, sectors = 234375000, start = 0&lt;br /&gt;
&lt;br /&gt;
            or for SCSI&lt;br /&gt;
&lt;br /&gt;
                $ hdparm /dev/sda&lt;br /&gt;
&lt;br /&gt;
            Try it with the -i option for information&lt;br /&gt;
&lt;br /&gt;
                $ hdparm -i /dev/hda&lt;br /&gt;
&lt;br /&gt;
                /dev/hda:&lt;br /&gt;
&lt;br /&gt;
                Model=IC35L120AVV207-1, FwRev=V24OA66A, SerialNo=VNVD09G4CZ6E0T&lt;br /&gt;
                Config={ HardSect NotMFM HdSw&amp;gt;15uSec Fixed DTR&amp;gt;10Mbs }&lt;br /&gt;
                RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=52&lt;br /&gt;
                BuffType=DualPortCache, BuffSize=7965kB, MaxMultSect=16, MultSect=16&lt;br /&gt;
                CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=234375000&lt;br /&gt;
                IORDY=on/off, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}&lt;br /&gt;
                PIO modes:  pio0 pio1 pio2 pio3 pio4&lt;br /&gt;
                DMA modes:  mdma0 mdma1 mdma2&lt;br /&gt;
                UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5&lt;br /&gt;
                AdvancedPM=yes: disabled (255) WriteCache=enabled&lt;br /&gt;
                Drive conforms to: ATA/ATAPI-6 T13 1410D revision 3a:  2 3 4 5 6&lt;br /&gt;
&lt;br /&gt;
            How fast is your drive?&lt;br /&gt;
&lt;br /&gt;
                $ hdparm -tT /dev/hda&lt;br /&gt;
&lt;br /&gt;
                /dev/hda:&lt;br /&gt;
                Timing buffer-cache reads:   128 MB in  0.41 seconds =315.32 MB/sec&lt;br /&gt;
                Timing buffered disk reads:  64 MB in  1.19 seconds = 53.65 MB/sec&lt;br /&gt;
&lt;br /&gt;
            Need to find your device?&lt;br /&gt;
&lt;br /&gt;
                $ mount&lt;br /&gt;
                   or&lt;br /&gt;
                $ cat /proc/partitions&lt;br /&gt;
                   or&lt;br /&gt;
                $ dmesg | egrep '^(s|h)d'&lt;br /&gt;
&lt;br /&gt;
                   which for my system lists:&lt;br /&gt;
&lt;br /&gt;
                      hda: IC35L120AVV207-1, ATA DISK drive&lt;br /&gt;
                      hdc: Lite-On LTN486S 48x Max, ATAPI CD/DVD-ROM drive&lt;br /&gt;
                      hda: max request size: 1024KiB&lt;br /&gt;
                      hda: 234375000 sectors (120000 MB) w/7965KiB Cache, CHS=16383/255/63, UDMA(100)&lt;br /&gt;
&lt;br /&gt;
             By the way, if you want to turn on dma&lt;br /&gt;
&lt;br /&gt;
                 $ hdparm -d1 /dev/hda&lt;br /&gt;
                   setting using_dma to 1 (on)&lt;br /&gt;
                   using_dma    =  1 (on)&lt;br /&gt;
&lt;br /&gt;
         (Also see TIP 122 )&lt;br /&gt;
&lt;br /&gt;
     List all PCI devices&lt;br /&gt;
&lt;br /&gt;
                $ lspci -v&lt;br /&gt;
&lt;br /&gt;
          00:00.0 Host bridge: Intel Corp. 82845G/GL [Brookdale-G] Chipset Host Bridge (rev&lt;br /&gt;
                  Subsystem: Dell Computer Corporation: Unknown device 0160&lt;br /&gt;
                  Flags: bus master, fast devsel, latency 0&lt;br /&gt;
                  Memory at f0000000 (32-bit, prefetchable) [size=128M]&lt;br /&gt;
                  Capabilities: &amp;lt;available only to root&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              ... lots more ...&lt;br /&gt;
&lt;br /&gt;
           Note, there is also lspci -vv for even more information.&lt;br /&gt;
&lt;br /&gt;
          (Also see TIP 200)&lt;br /&gt;
&lt;br /&gt;
TIP 21:&lt;br /&gt;
&lt;br /&gt;
     Setting up &amp;quot;cron&amp;quot; Jobs.&lt;br /&gt;
&lt;br /&gt;
     If you want to use the emacs editor for editing cron jobs, then,&lt;br /&gt;
     set the following in your &amp;quot;/home/user/.bash_profile&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        EDITOR=emacs&lt;br /&gt;
&lt;br /&gt;
     Then, to edit cron jobs&lt;br /&gt;
&lt;br /&gt;
        $ crontab -e&lt;br /&gt;
&lt;br /&gt;
     You may want to put in the following header&lt;br /&gt;
&lt;br /&gt;
        #MINUTE(0-59) HOUR(0-23) DAYOFMONTH(1-31) MONTHOFYEAR(1-12) DAYOFWEEK(0-6) Note 0=Sun and 7=Sun&lt;br /&gt;
        #&lt;br /&gt;
        #14,15 10 * * 0   /usr/bin/somecommmand  &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     The sample &amp;quot;commented out command&amp;quot; will run at 10:14 and 10:15 every Sunday.  There will&lt;br /&gt;
     be no &amp;quot;mail&amp;quot; sent to the user because of the &amp;quot;&amp;gt;/dev/null 2&amp;gt;&amp;amp;1&amp;quot; entry.&lt;br /&gt;
&lt;br /&gt;
        $ crontab -l&lt;br /&gt;
&lt;br /&gt;
     The above will list all cron jobs. Or if you're root&lt;br /&gt;
&lt;br /&gt;
        $ crontab -l -u &amp;lt;username&amp;gt;&lt;br /&gt;
        $ crontab -e -u &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Reference &amp;quot;man 5 crontab&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
        The time and date fields are:&lt;br /&gt;
&lt;br /&gt;
                     field          allowed values&lt;br /&gt;
                     -----          --------------&lt;br /&gt;
                     minute         0-59&lt;br /&gt;
                     hour           0-23&lt;br /&gt;
                     day of month   1-31&lt;br /&gt;
                     month          1-12 (or names, see below)&lt;br /&gt;
                     day of week    0-7 (0 or 7 is Sun, or use names)&lt;br /&gt;
&lt;br /&gt;
              A field may be an asterisk (*), which always stands for ``first-last''.&lt;br /&gt;
&lt;br /&gt;
              Ranges of numbers are allowed.  Ranges are two numbers separated with a&lt;br /&gt;
              hyphen.   The  specified  range is inclusive.  For example, 8-11 for an&lt;br /&gt;
              ``hours'' entry specifies execution at hours 8, 9, 10 and 11.&lt;br /&gt;
&lt;br /&gt;
              Lists are allowed.  A list is a set of numbers (or ranges) separated by&lt;br /&gt;
              commas.  Examples: ``1,2,5,9'', ``0-4,8-12''.&lt;br /&gt;
&lt;br /&gt;
              Ranges can include &amp;quot;steps&amp;quot;, so &amp;quot;1-9/2&amp;quot; is the same as &amp;quot;1,3,5,7,9&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Note, you can run just every 5 minutes as follows:&lt;br /&gt;
&lt;br /&gt;
              */5 * * * * /etc/mrtg/domrtg  &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     To run jobs hourly,daily,weekly or monthly you can add shell scripts into the&lt;br /&gt;
     appropriate directory:&lt;br /&gt;
&lt;br /&gt;
             /etc/cron.hourly/&lt;br /&gt;
             /etc/cron.daily/&lt;br /&gt;
             /etc/cron.weekly/&lt;br /&gt;
             /etc/cron.monthly/&lt;br /&gt;
&lt;br /&gt;
     Note that the above are pre-configured schedules set in &amp;quot;/etc/crontab&amp;quot;, so&lt;br /&gt;
     if you want, you can change the schedule. Below is my /etc/crontab:&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/crontab&lt;br /&gt;
           SHELL=/bin/bash&lt;br /&gt;
           PATH=/sbin:/bin:/usr/sbin:/usr/bin&lt;br /&gt;
           MAILTO=root&lt;br /&gt;
           HOME=/&lt;br /&gt;
&lt;br /&gt;
           # run-parts&lt;br /&gt;
           01 * * * * root run-parts /etc/cron.hourly&lt;br /&gt;
           02 4 * * * root run-parts /etc/cron.daily&lt;br /&gt;
           22 4 * * 0 root run-parts /etc/cron.weekly&lt;br /&gt;
           42 4 1 * * root run-parts /etc/cron.monthly&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 22:&lt;br /&gt;
&lt;br /&gt;
     Keeping Files in Sync Between Servers.&lt;br /&gt;
&lt;br /&gt;
     The remote computer is &amp;quot;192.168.1.171&amp;quot; and has the account &amp;quot;donkey&amp;quot;.  You want&lt;br /&gt;
     to &amp;quot;keep in sync&amp;quot; the files under &amp;quot;/home/cu2000/Logs&amp;quot; on the remote computer&lt;br /&gt;
     with files on &amp;quot;/home/chirico/dev/MEDIA_Server&amp;quot; on the local computer.&lt;br /&gt;
&lt;br /&gt;
       $ rsync  -Lae ssh  donkey@192.168.1.171:/home/cu2000/Logs /home/chirico/dev/MEDIA_Server&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;rsync&amp;quot; is a convient command for keeping files in sync, and as shown here will work&lt;br /&gt;
     through ssh.  The -L option tells rsync to treat symbolic links like ordinary files.&lt;br /&gt;
&lt;br /&gt;
        Also see [http://www.rsnapshot.org/]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 23:&lt;br /&gt;
&lt;br /&gt;
     Looking up the Spelling of a Word.&lt;br /&gt;
&lt;br /&gt;
        $ look &amp;lt;partial spelling&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     so the following will list all words that&lt;br /&gt;
     start with stuff&lt;br /&gt;
&lt;br /&gt;
        $ look stuff&lt;br /&gt;
           stuff&lt;br /&gt;
           stuffage&lt;br /&gt;
           stuffata&lt;br /&gt;
           stuffed&lt;br /&gt;
           stuffender&lt;br /&gt;
           stuffer&lt;br /&gt;
           stuffers&lt;br /&gt;
           stuffgownsman&lt;br /&gt;
           stuffier&lt;br /&gt;
           stuffiest&lt;br /&gt;
           stuffily&lt;br /&gt;
           stuffiness&lt;br /&gt;
           stuffinesses&lt;br /&gt;
           stuffiness's&lt;br /&gt;
           stuffing&lt;br /&gt;
           stuffings&lt;br /&gt;
           stuffing's&lt;br /&gt;
           stuffless&lt;br /&gt;
           stuffs&lt;br /&gt;
           stuffy&lt;br /&gt;
&lt;br /&gt;
     It helps to have a large &amp;quot;linuxwords&amp;quot; dictionary.  You can download&lt;br /&gt;
     a much bigger dictionary from the following:&lt;br /&gt;
&lt;br /&gt;
              http://prdownloads.sourceforge.net/souptonuts/linuxwords.1.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
     Note: vim users can setup the .vimrc file with the following. Now when you type &lt;br /&gt;
       CTL-X CTL-T in insert mode, you'll get a thesaurus lookup.&lt;br /&gt;
&lt;br /&gt;
           set dictionary+=/usr/share/dict/words&lt;br /&gt;
           set thesaurus+=/usr/share/dict/words&lt;br /&gt;
&lt;br /&gt;
     Or, you can call aspell with the F6 command after putting the folling entry in your&lt;br /&gt;
     .vimrc file&lt;br /&gt;
&lt;br /&gt;
           :nmap &amp;lt;F6&amp;gt; :w&amp;lt;CR&amp;gt;:!aspell -e -c %&amp;lt;CR&amp;gt;:e&amp;lt;CR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Now, hit F6 when you're in vim, and you'll get a spell checker.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     There is also an X Windows dictionary that runs with the following command.&lt;br /&gt;
&lt;br /&gt;
           $ gnome-dictionary&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 24:&lt;br /&gt;
&lt;br /&gt;
     Find out if a Command is Aliased.&lt;br /&gt;
&lt;br /&gt;
         $ type -all &amp;lt;command&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Example:&lt;br /&gt;
&lt;br /&gt;
         $ type -all ls&lt;br /&gt;
            ls is aliased to `ls --color=tty'&lt;br /&gt;
            ls is /bin/ls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 25:&lt;br /&gt;
&lt;br /&gt;
     Create a Terminal Calculator&lt;br /&gt;
&lt;br /&gt;
      Put the following in your .bashrc file&lt;br /&gt;
&lt;br /&gt;
            function calc&lt;br /&gt;
            {&lt;br /&gt;
             echo &amp;quot;${1}&amp;quot;|bc -l;&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
      Or, run it at the shell prompt. Now&lt;br /&gt;
      &amp;quot;calc&amp;quot; from the shell will work as follows:&lt;br /&gt;
&lt;br /&gt;
            $ calc 3+45&lt;br /&gt;
               48&lt;br /&gt;
&lt;br /&gt;
      All functions  with a &amp;quot;(&amp;quot; or &amp;quot;)&amp;quot; must be enclosed&lt;br /&gt;
      in quotes.  For instance, to get the sin of .4&lt;br /&gt;
&lt;br /&gt;
            $ calc &amp;quot;s(.4)&amp;quot;&lt;br /&gt;
              .38941834230865049166&lt;br /&gt;
&lt;br /&gt;
          (See TIP 115 using the expr command)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 26:&lt;br /&gt;
&lt;br /&gt;
     Kill a User and All Their Current Processes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        #  This program will kill all processes from a&lt;br /&gt;
        #  user.  The user name is read from the command line.&lt;br /&gt;
        #&lt;br /&gt;
        #  This program also demonstrates reading a bash variable&lt;br /&gt;
        #  into an awk script.&lt;br /&gt;
        #&lt;br /&gt;
        #  Usage: kill9user &amp;lt;user&amp;gt;&lt;br /&gt;
        #&lt;br /&gt;
        kill -9 `ps aux|awk -v var=$1 '$1==var { print $2 }'`&lt;br /&gt;
&lt;br /&gt;
    or if you want want to create the above script the command&lt;br /&gt;
    below will kill the user &amp;quot;donkey&amp;quot; and all of his processes.&lt;br /&gt;
&lt;br /&gt;
        $ kill -9 `ps aux|awk -v var=&amp;quot;donkey&amp;quot; '$1==var { print $2 }'`&lt;br /&gt;
&lt;br /&gt;
    Check their cron jobs and &amp;quot;at&amp;quot; jobs, if you have a security issue.&lt;br /&gt;
&lt;br /&gt;
          $ crontab -u &amp;lt;user&amp;gt; -e&lt;br /&gt;
&lt;br /&gt;
    Lock the account:&lt;br /&gt;
&lt;br /&gt;
          $ passwd -l &amp;lt;user&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Remove all authorized_keys&lt;br /&gt;
&lt;br /&gt;
          $ rm /home/user/.shosts&lt;br /&gt;
          $ rm /home/user/.rhosts&lt;br /&gt;
          $ rm -rf /home/user/.ssh&lt;br /&gt;
          $ rm /home/user/.forward&lt;br /&gt;
&lt;br /&gt;
      or consider&lt;br /&gt;
&lt;br /&gt;
          $ mv /home/user  /home/safeuser&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Change the shell&lt;br /&gt;
&lt;br /&gt;
          $ chsh -s /bin/true &amp;lt;user&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Do an inventory&lt;br /&gt;
&lt;br /&gt;
          $ find / -user &amp;lt;user&amp;gt;  &amp;gt; list_of_user_files&lt;br /&gt;
&lt;br /&gt;
    NOTE: Also see (TIP 10).&lt;br /&gt;
&lt;br /&gt;
    To see all users, except the current user. Do not use the&lt;br /&gt;
    dash &amp;quot;ps -aux&amp;quot; is wrong but the following is correct:&lt;br /&gt;
&lt;br /&gt;
          $ ps aux| awk '!/'${USER}'/{printf(&amp;quot;%s \n&amp;quot;,$0)}'&lt;br /&gt;
&lt;br /&gt;
     or (ww = wide, wide output)&lt;br /&gt;
&lt;br /&gt;
          $ ps auwwx| awk '!/'${USER}'/{printf(&amp;quot;%s \n&amp;quot;,$0)}'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    The following codes may be useful:&lt;br /&gt;
&lt;br /&gt;
       D    Uninterruptible sleep (usually IO)&lt;br /&gt;
       R    Running or runnable (on run queue)&lt;br /&gt;
       S    Interruptible sleep (waiting for an event to complete)&lt;br /&gt;
       T    Stopped, either by a job control signal or because it is being traced.&lt;br /&gt;
       W    paging (not valid since the 2.6.xx kernel)&lt;br /&gt;
       X    dead (should never be seen)&lt;br /&gt;
       Z    Defunct (&amp;quot;zombie&amp;quot;) process, terminated but not reaped by its parent.&lt;br /&gt;
&lt;br /&gt;
    For BSD formats and when the stat keyword is used, additional&lt;br /&gt;
       characters may be displayed:&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;    high-priority (not nice to other users)&lt;br /&gt;
       N    low-priority (nice to other users)&lt;br /&gt;
       L    has pages locked into memory (for real-time and custom IO)&lt;br /&gt;
       s    is a session leader&lt;br /&gt;
       l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)&lt;br /&gt;
       +    is in the foreground process group&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Also see TIP 28. and TIP 89.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 27:&lt;br /&gt;
&lt;br /&gt;
     Format Dates for Logs and Files&lt;br /&gt;
&lt;br /&gt;
         $ date &amp;quot;+%m%d%y %A,%B %d %Y %X&amp;quot;&lt;br /&gt;
             061704 Thursday,June 17 2004 07:13:40 PM&lt;br /&gt;
&lt;br /&gt;
         $ date &amp;quot;+%m%d%Y&amp;quot;&lt;br /&gt;
             06172004&lt;br /&gt;
&lt;br /&gt;
         $ date -d '1 day ago' &amp;quot;+%m%d%Y&amp;quot;&lt;br /&gt;
             06162004&lt;br /&gt;
&lt;br /&gt;
         $ date -d '3 months 1 day  2 hour  15 minutes 2 seconds ago'&lt;br /&gt;
&lt;br /&gt;
      or to go into the future remove the &amp;quot;ago&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         $ date -d '3 months 1 day  2 hour  15 minutes 2 seconds '&lt;br /&gt;
&lt;br /&gt;
            Also the following works:&lt;br /&gt;
&lt;br /&gt;
                $ date -d '+2 year +1 month -1 week  +3 day -8 hour +2 min -5 seconds'&lt;br /&gt;
&lt;br /&gt;
      Quick question: If there are 100,000,000 stars in the visible sky, and you can&lt;br /&gt;
      count them, round the clock, at a rate of a star per second starting now, when&lt;br /&gt;
      would you finish counting?  Would you still be alive?&lt;br /&gt;
&lt;br /&gt;
                $ date -d '+100000000 seconds'&lt;br /&gt;
&lt;br /&gt;
      Sooner than you think!&lt;br /&gt;
&lt;br /&gt;
      This can be assigned to variables&lt;br /&gt;
&lt;br /&gt;
         $ mdate=`date -d '3 months 1 day  2 hour  15 minutes 2 seconds ' &amp;quot;+%m%d%Y_%A_%B_%D_%Y_%X&amp;quot;  `&lt;br /&gt;
         $ echo $mdate&lt;br /&gt;
             09182004_Saturday_September_09/18/04_2004_09:40:41 PM&lt;br /&gt;
             ^---- Easy to sort   ^-------^----- Easy to read&lt;br /&gt;
&lt;br /&gt;
      See TIP 28 below.&lt;br /&gt;
&lt;br /&gt;
      See TIP 87 when working with large delta time changes -40 years, or -200 years ago, or even&lt;br /&gt;
      1,000,000 days into the future.&lt;br /&gt;
&lt;br /&gt;
      Also see (TIP 1) for working with time zones.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 28:&lt;br /&gt;
&lt;br /&gt;
     Need Ascii Codes? For instance, for printing quotes:&lt;br /&gt;
&lt;br /&gt;
                         awk 'BEGIN { msg = &amp;quot;Don\047t Panic!&amp;quot;; printf &amp;quot;%s \n&amp;quot;,msg }'&lt;br /&gt;
              or&lt;br /&gt;
                         awk 'BEGIN { msg = &amp;quot;Don\x027t Panic!&amp;quot;; printf &amp;quot;%s \n&amp;quot;,msg }'&lt;br /&gt;
&lt;br /&gt;
     It's better to use \047, because certain characters that follow \x027 may cause problems.&lt;br /&gt;
&lt;br /&gt;
     For example, take a look at the following two lines. The first line prints a &amp;quot;}&amp;quot; caused&lt;br /&gt;
     by the extra D in \x027D. The the line immediately below does not work as expected.&lt;br /&gt;
&lt;br /&gt;
                      awk 'BEGIN {printf(&amp;quot;The D causes problems \x027D\n&amp;quot;)}'&lt;br /&gt;
&lt;br /&gt;
            However, the line below works fine:&lt;br /&gt;
&lt;br /&gt;
                      awk 'BEGIN {printf(&amp;quot;The D does not cause problems \047D\n&amp;quot;)}'&lt;br /&gt;
&lt;br /&gt;
     Or if you wanted to use the date command in &amp;quot;awk&amp;quot; to print date.time.nanosecond.timezone for&lt;br /&gt;
     each line of a file &amp;quot;test&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     The following date can be used in awk because the single quotes are enclosed within the&lt;br /&gt;
     double quotes.&lt;br /&gt;
&lt;br /&gt;
             date '+%m%d%Y.%H%M%S.%N%z'&lt;br /&gt;
&lt;br /&gt;
       $ awk 'BEGIN { &amp;quot;date '+%m%d%Y.%H%M%S.%N%z'&amp;quot; | getline MyDate  } { print MyDate,$0 }' &amp;lt; data&lt;br /&gt;
&lt;br /&gt;
     But it's also possible to replace  &amp;quot;+&amp;quot;  with  \x2B,  &amp;quot;%&amp;quot; with \x25, and &amp;quot;d&amp;quot; with \x64 as follows:&lt;br /&gt;
&lt;br /&gt;
       $ awk 'BEGIN { &amp;quot;date \x27\x2B\x25m\x25\x64\x25Y.\x25H\x25M\x25S.\x25N\x25z\x27&amp;quot; | getline MyDate  } { print MyDate,$0 }' &amp;lt; test&lt;br /&gt;
&lt;br /&gt;
             07062004.113820.346033000-0400 bob 71&lt;br /&gt;
             07062004.113820.346033000-0400 tom 43&lt;br /&gt;
             07062004.113820.346033000-0400 sal 34&lt;br /&gt;
             07062004.113820.346033000-0400 bob 89&lt;br /&gt;
             07062004.113820.346033000-0400 tom 66&lt;br /&gt;
             07062004.113820.346033000-0400 sal 99&lt;br /&gt;
&lt;br /&gt;
     For this example it's not needed because single quotes are used inside of double quotes; however, there may be times when&lt;br /&gt;
     hex replacement is easier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ man ascii&lt;br /&gt;
&lt;br /&gt;
        Oct   Dec   Hex   Char           Oct   Dec   Hex   Char&lt;br /&gt;
            -----------------------------------------------------------&lt;br /&gt;
            000   0     00    NUL '\0'       100   64    40    @&lt;br /&gt;
            001   1     01    SOH            101   65    41    A&lt;br /&gt;
            002   2     02    STX            102   66    42    B&lt;br /&gt;
            003   3     03    ETX            103   67    43    C&lt;br /&gt;
            004   4     04    EOT            104   68    44    D&lt;br /&gt;
            005   5     05    ENQ            105   69    45    E&lt;br /&gt;
            006   6     06    ACK            106   70    46    F&lt;br /&gt;
            007   7     07    BEL '\a'       107   71    47    G&lt;br /&gt;
            010   8     08    BS  '\b'       110   72    48    H&lt;br /&gt;
            011   9     09    HT  '\t'       111   73    49    I&lt;br /&gt;
            012   10    0A    LF  '\n'       112   74    4A    J&lt;br /&gt;
            013   11    0B    VT  '\v'       113   75    4B    K&lt;br /&gt;
            014   12    0C    FF  '\f'       114   76    4C    L&lt;br /&gt;
            015   13    0D    CR  '\r'       115   77    4D    M&lt;br /&gt;
            016   14    0E    SO             116   78    4E    N&lt;br /&gt;
            017   15    0F    SI             117   79    4F    O&lt;br /&gt;
            020   16    10    DLE            120   80    50    P&lt;br /&gt;
            021   17    11    DC1            121   81    51    Q&lt;br /&gt;
            022   18    12    DC2            122   82    52    R&lt;br /&gt;
            023   19    13    DC3            123   83    53    S&lt;br /&gt;
            024   20    14    DC4            124   84    54    T&lt;br /&gt;
            025   21    15    NAK            125   85    55    U&lt;br /&gt;
            026   22    16    SYN            126   86    56    V&lt;br /&gt;
            027   23    17    ETB            127   87    57    W&lt;br /&gt;
            030   24    18    CAN            130   88    58    X&lt;br /&gt;
            031   25    19    EM             131   89    59    Y&lt;br /&gt;
            032   26    1A    SUB            132   90    5A    Z&lt;br /&gt;
            033   27    1B    ESC            133   91    5B    [&lt;br /&gt;
            034   28    1C    FS             134   92    5C    \   '\\'&lt;br /&gt;
            035   29    1D    GS             135   93    5D    ]&lt;br /&gt;
            036   30    1E    RS             136   94    5E    ^&lt;br /&gt;
            037   31    1F    US             137   95    5F    _&lt;br /&gt;
            040   32    20    SPACE          140   96    60    `&lt;br /&gt;
            041   33    21    !              141   97    61    a&lt;br /&gt;
            042   34    22    &amp;quot;              142   98    62    b&lt;br /&gt;
            043   35    23    #              143   99    63    c&lt;br /&gt;
            044   36    24    $              144   100   64    d&lt;br /&gt;
            045   37    25    %              145   101   65    e&lt;br /&gt;
            046   38    26    &amp;amp;              146   102   66    f&lt;br /&gt;
            047   39    27    '              147   103   67    g&lt;br /&gt;
            050   40    28    (              150   104   68    h&lt;br /&gt;
            051   41    29    )              151   105   69    i&lt;br /&gt;
            052   42    2A    *              152   106   6A    j&lt;br /&gt;
            053   43    2B    +              153   107   6B    k&lt;br /&gt;
            054   44    2C    ,              154   108   6C    l&lt;br /&gt;
            055   45    2D    -              155   109   6D    m&lt;br /&gt;
            056   46    2E    .              156   110   6E    n&lt;br /&gt;
            057   47    2F    /              157   111   6F    o&lt;br /&gt;
            060   48    30    0              160   112   70    p&lt;br /&gt;
            061   49    31    1              161   113   71    q&lt;br /&gt;
            062   50    32    2              162   114   72    r&lt;br /&gt;
            063   51    33    3              163   115   73    s&lt;br /&gt;
            064   52    34    4              164   116   74    t&lt;br /&gt;
            065   53    35    5              165   117   75    u&lt;br /&gt;
            066   54    36    6              166   118   76    v&lt;br /&gt;
            067   55    37    7              167   119   77    w&lt;br /&gt;
            070   56    38    8              170   120   78    x&lt;br /&gt;
            071   57    39    9              171   121   79    y&lt;br /&gt;
            072   58    3A    :              172   122   7A    z&lt;br /&gt;
            073   59    3B    ;              173   123   7B    {&lt;br /&gt;
            074   60    3C    &amp;lt;              174   124   7C    |&lt;br /&gt;
            075   61    3D    =              175   125   7D    }&lt;br /&gt;
            076   62    3E    &amp;gt;              176   126   7E    ~&lt;br /&gt;
            077   63    3F    ?              177   127   7F    DEL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 29:&lt;br /&gt;
&lt;br /&gt;
     Need a WWW Browser for the Terminal Session? Try lynx or elinks.&lt;br /&gt;
&lt;br /&gt;
         $ lynx&lt;br /&gt;
&lt;br /&gt;
     Or to read all these tips, with the latest updates&lt;br /&gt;
&lt;br /&gt;
      $ lynx http://umn.dl.sourceforge.net/sourceforge/souptonuts/How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Or, better yet elinks.&lt;br /&gt;
&lt;br /&gt;
         $ elinks http://somepage.&lt;br /&gt;
&lt;br /&gt;
     You can get elinks at the following site:&lt;br /&gt;
&lt;br /&gt;
             http://elinks.or.cz/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 30:&lt;br /&gt;
&lt;br /&gt;
    screen - screen manager with VT100/ANSI terminal emulation&lt;br /&gt;
&lt;br /&gt;
         This is an excellent utility. But if you work a lot in Emacs,&lt;br /&gt;
         then, you should place the following in your ~./.bashrc&lt;br /&gt;
&lt;br /&gt;
             alias s='screen -e^Pa -D -R'&lt;br /&gt;
&lt;br /&gt;
         After loging in again (or source .bashrc) ,&lt;br /&gt;
         type the following to load &amp;quot;screen&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
             $ s&lt;br /&gt;
&lt;br /&gt;
         If you're using the not using the alias command above, substitute&lt;br /&gt;
         CTL-a for CTL-p below. :&lt;br /&gt;
&lt;br /&gt;
             CTL-p CTL-C       To get a new session&lt;br /&gt;
             CTL-p  &amp;quot;           To list sessions, and arrow keys to move&lt;br /&gt;
             CTL-p SHFT-A      To name sessions&lt;br /&gt;
             CTL-p S            To split screens&lt;br /&gt;
             CLT-p Q            To unsplit screens&lt;br /&gt;
             CLT-p TAB          To switch between screens&lt;br /&gt;
             CLT-p :resize n    To resize screen to n rows, on split screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Screen is very powerful.  Should you become disconneced, you can&lt;br /&gt;
         still resume work after loggin in.&lt;br /&gt;
&lt;br /&gt;
             $ man screen&lt;br /&gt;
&lt;br /&gt;
         The above command will give you more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 31:&lt;br /&gt;
&lt;br /&gt;
     Need to Find the Factors of a Number?&lt;br /&gt;
&lt;br /&gt;
           $ factor 2345678992&lt;br /&gt;
                2345678992: 2 2 2 2 6581 22277&lt;br /&gt;
&lt;br /&gt;
     It's a quick way to find out if a number is prime&lt;br /&gt;
&lt;br /&gt;
           $ factor 7867&lt;br /&gt;
                7867: 7867&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 32:&lt;br /&gt;
&lt;br /&gt;
     Less is More -- piping to less to scroll backword and forward&lt;br /&gt;
&lt;br /&gt;
      For large &amp;quot;ls&amp;quot; listings try the followin, then, use the arrow key&lt;br /&gt;
      to move up and down the list.&lt;br /&gt;
&lt;br /&gt;
           $ ls /some_large_dir/ | less&lt;br /&gt;
&lt;br /&gt;
                 or&lt;br /&gt;
&lt;br /&gt;
           $ cat some_large_file | less&lt;br /&gt;
&lt;br /&gt;
                 or&lt;br /&gt;
&lt;br /&gt;
           $ less some_large_file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 33:&lt;br /&gt;
&lt;br /&gt;
     C &amp;quot;indent&amp;quot; Settings for Kernel Development&lt;br /&gt;
&lt;br /&gt;
           $ indent -kr -i8  program.c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 34:&lt;br /&gt;
&lt;br /&gt;
     FTP auto-login.  &amp;quot;ftp&amp;quot; to a site and have the password stored.&lt;br /&gt;
&lt;br /&gt;
     For instance, here's a sample &amp;quot;.net&amp;quot; file in a user's home&lt;br /&gt;
     directory for uploading to sourceforge. Note, sourceforge will&lt;br /&gt;
     take any password, so m@temp.com is used here for login &amp;quot;anonymous&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ cat ~/.netrc&lt;br /&gt;
               machine upload.sourceforge.net login anonymous password m@temp.com&lt;br /&gt;
               default login anonymous password user@site&lt;br /&gt;
&lt;br /&gt;
     It might be a good idea to change the rights on this file&lt;br /&gt;
&lt;br /&gt;
           $ chmod 0400 ~/.netrc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         #!/bin/bash&lt;br /&gt;
         #&lt;br /&gt;
         #  Sample ftp automated script to download&lt;br /&gt;
         #  file to ${dwnld}&lt;br /&gt;
         #&lt;br /&gt;
         dwnld=&amp;quot;/work/faq/unix-faq&amp;quot;&lt;br /&gt;
         cd ${dwnld}&lt;br /&gt;
         ftp &amp;lt;&amp;lt; FTPSTRING&lt;br /&gt;
         prompt off&lt;br /&gt;
         open rtfm.mit.edu&lt;br /&gt;
         cd /pub/usenet-by-group/news.answers/unix-faq/faq&lt;br /&gt;
         mget contents&lt;br /&gt;
         mget diff&lt;br /&gt;
         mget part*&lt;br /&gt;
         bye&lt;br /&gt;
         FTPSTRING&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      (Also see TIP 114 for ncftpget, which is a very powerful restarting&lt;br /&gt;
                            ftp program)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 35:&lt;br /&gt;
&lt;br /&gt;
     Bash Brace Expansion&lt;br /&gt;
&lt;br /&gt;
           $ echo f{ee,ie,oe,um}&lt;br /&gt;
                fee fie foe fum&lt;br /&gt;
&lt;br /&gt;
     This works with almost any command&lt;br /&gt;
&lt;br /&gt;
           $ mkdir -p /work/junk/{one,two,three,four}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 36:&lt;br /&gt;
&lt;br /&gt;
     Getting a List of Users on the System&lt;br /&gt;
&lt;br /&gt;
           $ cut -d: -f1 /etc/passwd | sort&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 37:&lt;br /&gt;
&lt;br /&gt;
     Editing a Bash Command&lt;br /&gt;
&lt;br /&gt;
      Try typing a long command say, then, type &amp;quot;fc&amp;quot; for an easy way&lt;br /&gt;
      to edit the command.&lt;br /&gt;
&lt;br /&gt;
           $ find /etc -iname '*.cnf' -exec grep -H 'log' {} \;&lt;br /&gt;
           $ fc&lt;br /&gt;
&lt;br /&gt;
      &amp;quot;fc&amp;quot; will bring the last command typed into an editor, &amp;quot;emacs&amp;quot; if&lt;br /&gt;
      that's the default editor. Type &amp;quot;fc -l&amp;quot; to list last few commands.&lt;br /&gt;
&lt;br /&gt;
      To seach for a command, try typing &amp;quot;CTL-r&amp;quot; at the shell prompt for&lt;br /&gt;
      searching. &amp;quot;CTL-t&amp;quot; to transpose, say &amp;quot;sl&amp;quot; was typed by you want &amp;quot;ls&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Hints when using &amp;quot;fc: in emacs:&lt;br /&gt;
&lt;br /&gt;
           ESC-b     move one word backward&lt;br /&gt;
           ESC-f     move one word forward&lt;br /&gt;
           ESC-DEL   kill one word backward&lt;br /&gt;
           CTL-k     kill point to end&lt;br /&gt;
           CTL-y     un-yank killed region at point&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 38:&lt;br /&gt;
&lt;br /&gt;
     Moving around Directories.&lt;br /&gt;
&lt;br /&gt;
     Change to the home directory:&lt;br /&gt;
          $ cd ~&lt;br /&gt;
            or&lt;br /&gt;
          $ cd&lt;br /&gt;
&lt;br /&gt;
     To go back to the last directory&lt;br /&gt;
          $ cd -&lt;br /&gt;
&lt;br /&gt;
     Instead of &amp;quot;cd&amp;quot; to a directory try &amp;quot;pushd&amp;quot; and look&lt;br /&gt;
     at the heading...you can see a list of directories.&lt;br /&gt;
&lt;br /&gt;
          $ pushd /etc&lt;br /&gt;
          $ pushd /usr/local&lt;br /&gt;
&lt;br /&gt;
      Then, to get back &amp;quot;popd&amp;quot; or &amp;quot;popd 1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      To list all the directories pushed on the stack&lt;br /&gt;
      use the &amp;quot;dirs -v&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
          $ dirs -v&lt;br /&gt;
           0  /usr/local&lt;br /&gt;
           1  /etc&lt;br /&gt;
           2  /work/souptonuts/documentation/theBook&lt;br /&gt;
&lt;br /&gt;
      Now, if you &amp;quot;pushd +1&amp;quot; you will be moved to &amp;quot;/etc&amp;quot;, since&lt;br /&gt;
      is number &amp;quot;1&amp;quot; on the stack, and this directory will become&lt;br /&gt;
      &amp;quot;0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ pwd&lt;br /&gt;
           /usr/local&lt;br /&gt;
          $ pushd +1&lt;br /&gt;
          $ pwd&lt;br /&gt;
           /etc&lt;br /&gt;
&lt;br /&gt;
          $ dirs -v&lt;br /&gt;
           0  /etc&lt;br /&gt;
           1  /work/souptonuts/documentation/theBook&lt;br /&gt;
           2  /usr/local&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 39:&lt;br /&gt;
&lt;br /&gt;
     Need an Underscore after a Variable?&lt;br /&gt;
&lt;br /&gt;
       Enclose the variable in &amp;quot;{}&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $echo ${UID}_&lt;br /&gt;
&lt;br /&gt;
       Compare to&lt;br /&gt;
&lt;br /&gt;
          $echo $UID_&lt;br /&gt;
&lt;br /&gt;
       Also try the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ m=&amp;quot;my stuff here&amp;quot;&lt;br /&gt;
                $ echo -e ${m// /'\n'}&lt;br /&gt;
                        my&lt;br /&gt;
                        stuff&lt;br /&gt;
                        here&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 40:&lt;br /&gt;
&lt;br /&gt;
     Bash Variable Offset and String Operators&lt;br /&gt;
&lt;br /&gt;
        $ r=&amp;quot;this is stuff&amp;quot;&lt;br /&gt;
        $ echo ${r:3}&lt;br /&gt;
        $ echo ${r:5:2}&lt;br /&gt;
&lt;br /&gt;
      Note, ${varname:offset:length}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         ${varname:?message}  If varname exist and isn't null return value, else,&lt;br /&gt;
                              print var and message.&lt;br /&gt;
&lt;br /&gt;
           $ r=&amp;quot;new stuff&amp;quot;&lt;br /&gt;
           $ echo ${r:? &amp;quot;that's r for you&amp;quot;}&lt;br /&gt;
               new stuff&lt;br /&gt;
           $ unset r&lt;br /&gt;
           $ echo ${r:? &amp;quot;that's r for you&amp;quot;}&lt;br /&gt;
               bash: r:  that's r for you&lt;br /&gt;
&lt;br /&gt;
         ${varname:+word}    If varname exist and not null return word. Else, return null.&lt;br /&gt;
&lt;br /&gt;
         ${varname:-word}    If varname exist and not null return value. Else, return word.&lt;br /&gt;
&lt;br /&gt;
      Working with arrays in bash - bash arrays.&lt;br /&gt;
&lt;br /&gt;
           $ unset p&lt;br /&gt;
           $ p=(one two three)&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[@]}&amp;quot;&lt;br /&gt;
           one two three&lt;br /&gt;
&lt;br /&gt;
      or&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[*]}&amp;quot;&lt;br /&gt;
           one two three&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${#p[@]}&amp;quot;&lt;br /&gt;
           3&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[0]}&amp;quot;&lt;br /&gt;
           one&lt;br /&gt;
&lt;br /&gt;
           $ echo -e &amp;quot;${p[1]}&amp;quot;&lt;br /&gt;
           two&lt;br /&gt;
&lt;br /&gt;
            Also see (TIP 95)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 41:&lt;br /&gt;
&lt;br /&gt;
     Loops in Bash&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The command below loops through directories listed in $PATH.&lt;br /&gt;
&lt;br /&gt;
          $ path=$PATH:&lt;br /&gt;
          $ while [ $path ]; do echo &amp;quot; ${path%%:*} &amp;quot;; path=${path#*:}; done&lt;br /&gt;
&lt;br /&gt;
       The command below will also loop through directories in your path.&lt;br /&gt;
&lt;br /&gt;
          $IFS=:&lt;br /&gt;
          $ for dir in $PATH&lt;br /&gt;
          &amp;gt; do&lt;br /&gt;
          &amp;gt; ls -ld $dir&lt;br /&gt;
          &amp;gt; done&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Jun 10 20:16 /usr/local/bin&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Jun 13 23:12 /bin&lt;br /&gt;
              drwxr-xr-x    3 root     root        40960 Jun 12 08:00 /usr/bin&lt;br /&gt;
              drwxr-xr-x    2 root     root         4096 Feb 14 03:12 /usr/X11R6/bin&lt;br /&gt;
              drwxrwxr-x    2 chirico  chirico      4096 Jun  6 13:06 /home/chirico/bin&lt;br /&gt;
&lt;br /&gt;
     Other ways of doing loops:&lt;br /&gt;
&lt;br /&gt;
        for (( i=1; i &amp;lt;= 20; i++))&lt;br /&gt;
                do&lt;br /&gt;
                        echo -n &amp;quot;$i &amp;quot;&lt;br /&gt;
                done&lt;br /&gt;
&lt;br /&gt;
     Note, to do it all on one line, do the following:&lt;br /&gt;
&lt;br /&gt;
        $ for (( i=1; i &amp;lt;= 20; i++)); do echo -n &amp;quot;$i&amp;quot;; done&lt;br /&gt;
&lt;br /&gt;
     Below, is an example of declaring i an integer so that you do not&lt;br /&gt;
     have to preface with let.&lt;br /&gt;
&lt;br /&gt;
          $ declare -i i&lt;br /&gt;
          $ i=5;&lt;br /&gt;
          $ while (( $i &amp;gt; 1 )); do&lt;br /&gt;
          &amp;gt; i=i-1&lt;br /&gt;
          &amp;gt; echo $i&lt;br /&gt;
          &amp;gt; done&lt;br /&gt;
          4&lt;br /&gt;
          3&lt;br /&gt;
          2&lt;br /&gt;
&lt;br /&gt;
     You can also use &amp;quot;while [ $i -gt 1 ]; do&amp;quot;  in place of &amp;quot;while (( $i &amp;gt; 1 )); do&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     To get a listing of all declared values&lt;br /&gt;
&lt;br /&gt;
          $ declare -i&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Try putting a few words in the file &amp;quot;test&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         $ while read filename; do echo  &amp;quot;- $filename &amp;quot;; done &amp;lt; test |nl -w1&lt;br /&gt;
&lt;br /&gt;
     Or, using an array&lt;br /&gt;
&lt;br /&gt;
                declare -a Array&lt;br /&gt;
                Array[0]=&amp;quot;zero&amp;quot;&lt;br /&gt;
                Array[1]=&amp;quot;one&amp;quot;&lt;br /&gt;
                Array[2]=&amp;quot;two&amp;quot;&lt;br /&gt;
                for i in `seq ${#Array[@]}`&lt;br /&gt;
                do&lt;br /&gt;
                  echo $Array[$i-1]&lt;br /&gt;
                done&lt;br /&gt;
&lt;br /&gt;
         Also see (TIP 95 and TIP 133).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 42:&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;diff&amp;quot; and &amp;quot;patch&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
        You have created a program &amp;quot;prog.c&amp;quot;, saved as this name and also copied&lt;br /&gt;
        to  &amp;quot;prog.c.old&amp;quot;. You post &amp;quot;prog.c&amp;quot; to users.  Next, you make changes&lt;br /&gt;
        to prog.c&lt;br /&gt;
&lt;br /&gt;
          $ diff -c prog.c.old prog.c &amp;gt; prog.patch&lt;br /&gt;
&lt;br /&gt;
        Now, users can get the latest updates by running.&lt;br /&gt;
&lt;br /&gt;
          $ patch &amp;lt; prog.patch&lt;br /&gt;
&lt;br /&gt;
        By the way, you can make backups of your data easily.&lt;br /&gt;
&lt;br /&gt;
          $ cp /etc/fstab{,.bak}&lt;br /&gt;
&lt;br /&gt;
        Now, you do your edits to &amp;quot;/etc/fstab&amp;quot; and if you need&lt;br /&gt;
        to go back to the original, you can find it at&lt;br /&gt;
        &amp;quot;/etc/fstab.bak&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 43:&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;cat&amp;quot; the Contents of Files Listed in a File, in That Order.&lt;br /&gt;
&lt;br /&gt;
       SETUP (Assume you have the following)&lt;br /&gt;
&lt;br /&gt;
              $ cat file_of_files&lt;br /&gt;
                  file1&lt;br /&gt;
                  file2&lt;br /&gt;
&lt;br /&gt;
              $ cat file1&lt;br /&gt;
                  This is the data in file1&lt;br /&gt;
&lt;br /&gt;
              $ cat file 2&lt;br /&gt;
                  This is the data in file2&lt;br /&gt;
&lt;br /&gt;
       So there are 3 files here &amp;quot;file_of_files&amp;quot; which contains the name of&lt;br /&gt;
       other files.  In this case &amp;quot;file1&amp;quot; and &amp;quot;file2&amp;quot;. And the contents of&lt;br /&gt;
       &amp;quot;file1&amp;quot; and &amp;quot;file2&amp;quot; is shown above.&lt;br /&gt;
&lt;br /&gt;
               $ cat file_of_files|xargs cat&lt;br /&gt;
                    This is the data in  file1&lt;br /&gt;
                    This is the data in  file2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 44:&lt;br /&gt;
&lt;br /&gt;
     Columns and Rows -- getting anything you want.&lt;br /&gt;
&lt;br /&gt;
     Assume you have the following file.&lt;br /&gt;
&lt;br /&gt;
        $ cat data&lt;br /&gt;
           1 2 3&lt;br /&gt;
           4 5&lt;br /&gt;
           6 7 8 9 10&lt;br /&gt;
           11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
     How to you get everything in  2 columns?&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l2&lt;br /&gt;
           1 2&lt;br /&gt;
           3 4&lt;br /&gt;
           5 6&lt;br /&gt;
           7 8&lt;br /&gt;
           9 10&lt;br /&gt;
           11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
    Three columns?&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l3&lt;br /&gt;
           1 2 3&lt;br /&gt;
           4 5 6&lt;br /&gt;
           7 8 9&lt;br /&gt;
           10 11 12&lt;br /&gt;
           13 14&lt;br /&gt;
&lt;br /&gt;
    What's the row sum of the &amp;quot;three columns?&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        $ cat data|tr ' ' '\n'|xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
           6&lt;br /&gt;
           15&lt;br /&gt;
           24&lt;br /&gt;
           33&lt;br /&gt;
           27&lt;br /&gt;
&lt;br /&gt;
    or&lt;br /&gt;
&lt;br /&gt;
        $ tr ' ' '\n' &amp;lt; data |xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
&lt;br /&gt;
    NOTE &amp;quot;Steven Heiner's rule&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
             cat one_file | program&lt;br /&gt;
&lt;br /&gt;
           can always be rewritten as&lt;br /&gt;
&lt;br /&gt;
             program &amp;lt; one_file&lt;br /&gt;
&lt;br /&gt;
   Note: thanks to Steven Heiner (http://www.shelldorado.com/) the above can be&lt;br /&gt;
       shortened as follows:&lt;br /&gt;
&lt;br /&gt;
               $ tr ' ' '\n' &amp;lt; data|xargs -l3|tr ' ' '+'|bc&lt;br /&gt;
&lt;br /&gt;
          Need to &amp;quot;tr&amp;quot; from the stdin?&lt;br /&gt;
&lt;br /&gt;
               $ tr &amp;quot;xy&amp;quot; &amp;quot;yx&amp;quot;| ... | ...&lt;br /&gt;
&lt;br /&gt;
       But there is a the &amp;quot;Stephane CHAZELAS&amp;quot; condition here&lt;br /&gt;
&lt;br /&gt;
         &amp;quot;Note that tr, sed, and awk mail fail on files containing '\0'&lt;br /&gt;
          sed and awk have unspecified behaviors if the input&lt;br /&gt;
          doesn't end in a '\n' (or to sum up, cat works for&lt;br /&gt;
          binary and text files, text utilities such as sed or awk&lt;br /&gt;
          work only for text files).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 45:&lt;br /&gt;
&lt;br /&gt;
     Auto Directory Spelling Corrections.&lt;br /&gt;
&lt;br /&gt;
      To turn this on:&lt;br /&gt;
&lt;br /&gt;
           $ shopt -s cdspell&lt;br /&gt;
&lt;br /&gt;
      Now mispell a directory in the cd command.&lt;br /&gt;
&lt;br /&gt;
           $ cd /usk/local&lt;br /&gt;
                   ^-------- still gets you to --&lt;br /&gt;
                                                |&lt;br /&gt;
                                            /usr/local&lt;br /&gt;
&lt;br /&gt;
      What other options can you set? The following will list&lt;br /&gt;
      all the options:&lt;br /&gt;
&lt;br /&gt;
           $ shopt -p&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 46:&lt;br /&gt;
&lt;br /&gt;
     Record Eveything Printed on Your Terminal Screen.&lt;br /&gt;
&lt;br /&gt;
            $ script -a &amp;lt;filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Now start doing stuff and &amp;quot;everything&amp;quot; is appended to &amp;lt;filename&amp;gt;.&lt;br /&gt;
     For example&lt;br /&gt;
&lt;br /&gt;
            $ script installation&lt;br /&gt;
&lt;br /&gt;
            $ (command)&lt;br /&gt;
&lt;br /&gt;
            $ (result)&lt;br /&gt;
&lt;br /&gt;
            $ ...&lt;br /&gt;
&lt;br /&gt;
            $ ...&lt;br /&gt;
&lt;br /&gt;
            $ (command)&lt;br /&gt;
&lt;br /&gt;
            $ (result)&lt;br /&gt;
&lt;br /&gt;
            $ exit&lt;br /&gt;
&lt;br /&gt;
     The whole session log is in the installation file that you can later&lt;br /&gt;
     read and/or cleanup and add to a documentation.&lt;br /&gt;
&lt;br /&gt;
     This command can also be used to redirect the contents to another user,&lt;br /&gt;
     but you must be root to do this.&lt;br /&gt;
&lt;br /&gt;
     Step 1 - find out what pts they are using.&lt;br /&gt;
&lt;br /&gt;
            $ w&lt;br /&gt;
&lt;br /&gt;
     Step 2 - Run script on that pts. After running this command below&lt;br /&gt;
              everything you type will appear on their screen.&lt;br /&gt;
&lt;br /&gt;
            $ script /dev/pts/4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Thanks to Jacques.GARNIER-EXTERIEUR@EU.RHODIA.COM for his contribution&lt;br /&gt;
     to this tip.&lt;br /&gt;
&lt;br /&gt;
     Also reference TIP 208.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 47:&lt;br /&gt;
&lt;br /&gt;
     Monitor all Network Traffic Except Your Current ssh Connection.&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX -s 1500 port not 22&lt;br /&gt;
&lt;br /&gt;
       Or to filter out port 123 as well getting the full length of the packet&lt;br /&gt;
       (-s 0), use the following:&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX -s 0 port not 22  and port not 123&lt;br /&gt;
&lt;br /&gt;
       Or to filter only a certain host say 81.169.158.205&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN -vvv -xX  port not 22 and host 81.169.158.205&lt;br /&gt;
&lt;br /&gt;
     Just want ip addresses and a little bit of data, then,&lt;br /&gt;
     use this. The &amp;quot;-c 20&amp;quot; is to stop after 20 packets.&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump -i eth0 -nN  -s 1500 port not 22 -c 20&lt;br /&gt;
&lt;br /&gt;
     If you're looking for sign of DOS attacks, the following show just the SYN&lt;br /&gt;
     packets on all interfaces:&lt;br /&gt;
&lt;br /&gt;
           $ tcpdump 'tcp[13] &amp;amp; 2 == 2'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 48:&lt;br /&gt;
&lt;br /&gt;
     Where are the GNU Reference Manuals?&lt;br /&gt;
&lt;br /&gt;
           http://www.gnu.org/manual/manual.html&lt;br /&gt;
&lt;br /&gt;
     Also worth a look the &amp;quot;Linux Documentation Project&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           http://en.tldp.org/&lt;br /&gt;
&lt;br /&gt;
     and Red Hat manuals&lt;br /&gt;
&lt;br /&gt;
           http://www.redhat.com/docs/manuals/enterprise/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 49:&lt;br /&gt;
&lt;br /&gt;
     Setting or Changing the Library Path.&lt;br /&gt;
&lt;br /&gt;
     The following contains the settings to be added or deleted&lt;br /&gt;
&lt;br /&gt;
           /etc/ld.so.conf&lt;br /&gt;
&lt;br /&gt;
     After this file is edited, you must run the following:&lt;br /&gt;
&lt;br /&gt;
           $ ldconfig&lt;br /&gt;
&lt;br /&gt;
     See &amp;quot;man ldconfig&amp;quot; for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 50:&lt;br /&gt;
&lt;br /&gt;
     Working with Libraries in C&lt;br /&gt;
&lt;br /&gt;
     Assume the following 3 programs:&lt;br /&gt;
&lt;br /&gt;
      $ cat ./src/test.c&lt;br /&gt;
&lt;br /&gt;
         int test(int t)&lt;br /&gt;
         {&lt;br /&gt;
           printf(&amp;quot;%d\n&amp;quot;,t);&lt;br /&gt;
           return t;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      $ cat ./src/prog1.c&lt;br /&gt;
&lt;br /&gt;
         /*&lt;br /&gt;
          program: prog1.c&lt;br /&gt;
          dependences: test.c&lt;br /&gt;
&lt;br /&gt;
          compiling this program:&lt;br /&gt;
          gcc -o prog test.c prog1.c&lt;br /&gt;
&lt;br /&gt;
          Note the libpersonal include&lt;br /&gt;
          should be remove if NOT using the&lt;br /&gt;
          library&lt;br /&gt;
         */&lt;br /&gt;
&lt;br /&gt;
         #include &amp;lt;libpersonal.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         int&lt;br /&gt;
         main(int argc, char **argv)&lt;br /&gt;
         {&lt;br /&gt;
           test(45);&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
      $ cat ./include/libpersonal.h&lt;br /&gt;
&lt;br /&gt;
         extern int test(int);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Prog1.c needs the test function in  test.c&lt;br /&gt;
     To compile, so that both programs work together, do the following:&lt;br /&gt;
&lt;br /&gt;
          $ cd src&lt;br /&gt;
          $ gcc -o prog test.c prog1.c -I../include&lt;br /&gt;
&lt;br /&gt;
     However, if you want to create your own static library, then, run the following:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p ../lib&lt;br /&gt;
          $ gcc -c test.c  -o ../lib/test.o&lt;br /&gt;
          $ cd ../lib&lt;br /&gt;
          $ ar r libpersonal.a test.o&lt;br /&gt;
          $ ranlib libpersonal.a&lt;br /&gt;
&lt;br /&gt;
     or, the ar and ranlib command can be combined as follows:&lt;br /&gt;
&lt;br /&gt;
          $ ar rs libpersonal.a test.o&lt;br /&gt;
&lt;br /&gt;
     To compile the program with the static library:&lt;br /&gt;
&lt;br /&gt;
          $ cd ../src&lt;br /&gt;
          $ gcc -I../include -L../lib -o prog1 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     The -I../include  tells  gcc to look in the ../include directory for&lt;br /&gt;
     libpersonal.h. and -L../lib, tells gcc to look for the&lt;br /&gt;
     &amp;quot;libpersonal.a&amp;quot; library.&lt;br /&gt;
&lt;br /&gt;
           $ cd ..&lt;br /&gt;
           $ tree src lib include&lt;br /&gt;
           src&lt;br /&gt;
           |-- prog&lt;br /&gt;
           |-- prog1&lt;br /&gt;
           |-- prog1.c&lt;br /&gt;
           `-- test.c&lt;br /&gt;
           lib&lt;br /&gt;
           |-- libpersonal.a&lt;br /&gt;
           `-- test.o&lt;br /&gt;
           include&lt;br /&gt;
           `-- libpersonal.h&lt;br /&gt;
&lt;br /&gt;
     This was a STATIC library. Often times you will want to use a SHARED&lt;br /&gt;
     or dynamic library.&lt;br /&gt;
&lt;br /&gt;
     SHARED LIBRARY:&lt;br /&gt;
&lt;br /&gt;
     You must recompile test.c with -fpic option.&lt;br /&gt;
&lt;br /&gt;
          $ cd ../lib&lt;br /&gt;
          $ gcc -c -fpic ../src/test.c -o test.o&lt;br /&gt;
&lt;br /&gt;
     Next create the libpersonal.so file.&lt;br /&gt;
&lt;br /&gt;
          $ gcc -shared -o libpersonal.so test.o&lt;br /&gt;
&lt;br /&gt;
     Now, compile the source prog1.c as follows:&lt;br /&gt;
&lt;br /&gt;
          $ cd ../src&lt;br /&gt;
          $ gcc -Wl,-R../lib -L../lib -I../include -o prog2 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
     This should work fine. But, take a look at prog2 using the ldd command.&lt;br /&gt;
&lt;br /&gt;
          $ ldd prog2&lt;br /&gt;
&lt;br /&gt;
        libpersonal.so =&amp;gt; ../lib/libpersonal.so (0x40017000)&lt;br /&gt;
        libc.so.6 =&amp;gt; /lib/tls/libc.so.6 (0x42000000)&lt;br /&gt;
        /lib/ld-linux.so.2 =&amp;gt; /lib/ld-linux.so.2 (0x40000000)&lt;br /&gt;
&lt;br /&gt;
     If you move the program prog2 to a different location, it will not run.&lt;br /&gt;
     Instead you will get the following error:&lt;br /&gt;
&lt;br /&gt;
           prog2: error while loading shared libraries: libpersonal.so:&lt;br /&gt;
                     cannot open shared object file: No such file or directory&lt;br /&gt;
&lt;br /&gt;
     To fix this, you should specify the direct path to the library. And in my&lt;br /&gt;
     case it is rather long&lt;br /&gt;
&lt;br /&gt;
      $  gcc -Wl,-R/work/souptonuts/documentation/theBook/lib -L../lib -I../include -o prog2 prog1.c -lpersonal&lt;br /&gt;
&lt;br /&gt;
     SPECIAL NOTE: The -R must always follow the -Wl.  (-Wl,-R&amp;lt;directory&amp;gt;) They always go together&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 51:&lt;br /&gt;
&lt;br /&gt;
     Actively Monitor a File and Send Email when Expression Occurs.&lt;br /&gt;
&lt;br /&gt;
     This is a way to monitor &amp;quot;/var/log/messages&amp;quot; or any file for certain changes.&lt;br /&gt;
     The example below actively monitors &amp;quot;stuff&amp;quot; for the work &amp;quot;now&amp;quot; and as soon as&lt;br /&gt;
     &amp;quot;now&amp;quot; is added to the file, the contents of msg are sent to the user&lt;br /&gt;
     mikechirico@hotmail.com&lt;br /&gt;
&lt;br /&gt;
          $ tail -f stuff | \&lt;br /&gt;
              awk ' /now/ { system(&amp;quot;mail -s \&amp;quot;This is working\&amp;quot;  mikechirico@hotmail.com &amp;lt; msg&amp;quot;) }'&lt;br /&gt;
&lt;br /&gt;
     Or, you can run a program, say get headings on slashdot from the program &amp;quot;getslash.php&amp;quot; which&lt;br /&gt;
     runs on  &amp;quot;192.168.1.155&amp;quot; with account &amp;quot;chirico&amp;quot;. Assuming you have ssh keys setup, then, the following&lt;br /&gt;
     will send mail from the output:&lt;br /&gt;
&lt;br /&gt;
          $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;|mail -s &amp;quot;Slash cron Headlines&amp;quot;  mchirico@comcast.net&lt;br /&gt;
&lt;br /&gt;
     See (TIP 80) for scraping the headings on slash dot and how to get a copy of &amp;quot;getslash.php&amp;quot;.  If you still&lt;br /&gt;
     want to use awk:&lt;br /&gt;
&lt;br /&gt;
           $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;| \&lt;br /&gt;
                      awk '{ print $0 | &amp;quot;mail -s \x27 Slash Topics \x27 mchirico@comcast.net &amp;quot;}'&lt;br /&gt;
&lt;br /&gt;
     Note the &amp;quot;\x27&amp;quot; is a quote.  Maybe you only want articles dealing with &amp;quot;Linux&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
           $ ssh chirico@192.168.1.155 &amp;quot;./bin/getslash.php&amp;quot;| \&lt;br /&gt;
                      awk '/Linux/{ print $0 | &amp;quot;mail -s \x27 Slash Topics \x27 mchirico@comcast.net &amp;quot;}'&lt;br /&gt;
&lt;br /&gt;
     For $60, you can get a numeric display from &amp;quot;delcom engineering&amp;quot; that you can send messages and&lt;br /&gt;
     data to.  I get weather information off the internet and send it to this device.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/projects/delcom/&lt;br /&gt;
&lt;br /&gt;
     (Reference TIP 151 for ssh tips)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 52:&lt;br /&gt;
&lt;br /&gt;
     Need to Keep Secrets? Encrypt it.&lt;br /&gt;
&lt;br /&gt;
      To Encrypt:&lt;br /&gt;
&lt;br /&gt;
            $ openssl des3 -salt -in file.txt -out file.des3&lt;br /&gt;
&lt;br /&gt;
      The above will prompt for a password, or you can put it in&lt;br /&gt;
      with a -k option, assuming you're on a trusted server.&lt;br /&gt;
&lt;br /&gt;
      To Decrypt&lt;br /&gt;
&lt;br /&gt;
            $  openssl des3 -d -salt -in file.des3 -out file.txt -k mypassword&lt;br /&gt;
&lt;br /&gt;
      Need to encrypt what you type? Enter the following, then start typing&lt;br /&gt;
      and  ^D to end.&lt;br /&gt;
&lt;br /&gt;
            $ openssl des3 -salt -out stuff.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 53:&lt;br /&gt;
&lt;br /&gt;
     Check that a File has Not Been Tampered With: Use Cryptographic Hashing Function.&lt;br /&gt;
&lt;br /&gt;
     The md5sum is popular but dated&lt;br /&gt;
&lt;br /&gt;
              $ md5sum file&lt;br /&gt;
&lt;br /&gt;
     Instead, use one of the following;&lt;br /&gt;
&lt;br /&gt;
              $ openssl dgst -sha1 -c file&lt;br /&gt;
&lt;br /&gt;
              $ openssl dgst -ripemd160 -c  file&lt;br /&gt;
&lt;br /&gt;
     All calls give a fixed length string or &amp;quot;message digest&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 54:&lt;br /&gt;
&lt;br /&gt;
     Need to View Information About a Secure Web Server? A SSL/TLS test.&lt;br /&gt;
&lt;br /&gt;
           $ openssl s_client -connect www.sourceforge.net:443&lt;br /&gt;
&lt;br /&gt;
     Above will give a long listing of certificates.&lt;br /&gt;
&lt;br /&gt;
     Note, it is also possible to get certificate information about a mail server&lt;br /&gt;
&lt;br /&gt;
           $ openssl s_client -connect mail.comcast.net:995 -showcerts&lt;br /&gt;
&lt;br /&gt;
     When you do the above command you get two certificates. If you copy&lt;br /&gt;
     past both certificates by taking the following contents include the&lt;br /&gt;
     begin and end show below:&lt;br /&gt;
&lt;br /&gt;
                 -----BEGIN CERTIFICATE-----&lt;br /&gt;
                 ....&lt;br /&gt;
                 -----END CERTIFICATE-----&lt;br /&gt;
&lt;br /&gt;
     Then create files &amp;quot;comcast0.pem&amp;quot; and &amp;quot;comcast1.pem&amp;quot; out of these certificaties and&lt;br /&gt;
     put them in a directory &amp;quot;/home/donkey/.certs&amp;quot;, then, with the openssl src package, in&lt;br /&gt;
     the &amp;quot;./tools/c_rehash&amp;quot; run&lt;br /&gt;
&lt;br /&gt;
            $ c_rehash .certs&lt;br /&gt;
            Doing .certs&lt;br /&gt;
            comcast0.pem =&amp;gt; 72f90dc0.0&lt;br /&gt;
            comcast1.pem =&amp;gt; f73e89fd.0&lt;br /&gt;
&lt;br /&gt;
     Now it's possible to have fetchmail work with these certs.&lt;br /&gt;
&lt;br /&gt;
       #&lt;br /&gt;
       #&lt;br /&gt;
       # Sample .fetchmailrc file for Comcast&lt;br /&gt;
       #&lt;br /&gt;
       # Check mail every 90 seconds&lt;br /&gt;
       set daemon 90&lt;br /&gt;
       set syslog&lt;br /&gt;
       set postmaster donkey&lt;br /&gt;
       #set bouncemail&lt;br /&gt;
       #&lt;br /&gt;
       # Comcast email is zdonkey but computer account is  just donkey&lt;br /&gt;
       #&lt;br /&gt;
       poll mail.comcast.net with proto POP3 and options no dns&lt;br /&gt;
              user 'zdonkey' with pass &amp;quot;somethin35&amp;quot;  is 'donkey' here options ssl sslcertck sslcertpath '/home/donkey/.certs'&lt;br /&gt;
              smtphost comcast.net&lt;br /&gt;
       # currently not used&lt;br /&gt;
       mda '/usr/bin/procmail -d %T'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     REFERENCE: http://www.openssl.org/&lt;br /&gt;
                http://www.catb.org/~esr/fetchmail/fetchmail-6.2.5.tar.gz&lt;br /&gt;
                http://www.madboa.com/geek/openssl/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 55:&lt;br /&gt;
&lt;br /&gt;
     cp --parents. What does this option do?&lt;br /&gt;
&lt;br /&gt;
     Assume you have the following directory structure&lt;br /&gt;
&lt;br /&gt;
            .&lt;br /&gt;
            |-- a&lt;br /&gt;
            |   `-- b&lt;br /&gt;
            |       `-- c&lt;br /&gt;
            |           `-- d&lt;br /&gt;
            |               |-- file1&lt;br /&gt;
            |               `-- file2&lt;br /&gt;
            `-- newdir&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Issue the following command:&lt;br /&gt;
&lt;br /&gt;
         $ cp --parents ./a/b/c/d/* ./newdir/&lt;br /&gt;
&lt;br /&gt;
     Now you have the following:&lt;br /&gt;
&lt;br /&gt;
            .&lt;br /&gt;
            |-- a&lt;br /&gt;
            |   `-- b&lt;br /&gt;
            |       `-- c&lt;br /&gt;
            |           `-- d&lt;br /&gt;
            |               |-- file1&lt;br /&gt;
            |               `-- file2&lt;br /&gt;
            `-- newdir&lt;br /&gt;
                `-- a&lt;br /&gt;
                    `-- b&lt;br /&gt;
                        `-- c&lt;br /&gt;
                            `-- d&lt;br /&gt;
                                |-- file1&lt;br /&gt;
                                `-- file2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 56:&lt;br /&gt;
&lt;br /&gt;
     Quickly Locating files.&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;locate&amp;quot; command quickly searches the indexed database for files.  It just&lt;br /&gt;
     gives the name of the files; but, if you need more information use it as follows&lt;br /&gt;
&lt;br /&gt;
         $ locate document|xargs ls -l&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;locate&amp;quot; database may only get updated every 24 hours.  For more recent finds,&lt;br /&gt;
     use the &amp;quot;find&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 57:&lt;br /&gt;
&lt;br /&gt;
     Using the &amp;quot;find&amp;quot; Command.&lt;br /&gt;
&lt;br /&gt;
     List only directories, max 2 nodes down that have &amp;quot;net&amp;quot; in the name&lt;br /&gt;
&lt;br /&gt;
       $ find /proc -type d -maxdepth 2 -iname '*net*'&lt;br /&gt;
&lt;br /&gt;
     Find all *.c and *.h files starting from the current &amp;quot;.&amp;quot; position.&lt;br /&gt;
&lt;br /&gt;
       $ find . \( -iname '*.c'  -o -iname '*.h' \) -print&lt;br /&gt;
&lt;br /&gt;
     Find all, but skip what's in &amp;quot;/CVS&amp;quot; and &amp;quot;/junk&amp;quot;. Start from &amp;quot;/work&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ find /work \( -iregex '.*/CVS'  -o -iregex '.*/junk' \)  -prune -o -print&lt;br /&gt;
&lt;br /&gt;
     Note -regex and -iregex work on the directory as well, which means&lt;br /&gt;
     you must consider the &amp;quot;./&amp;quot; that comes before all listings.&lt;br /&gt;
&lt;br /&gt;
     Here is another example. Find all files except what is under the CVS, including&lt;br /&gt;
     CVS listings. Also exclude &amp;quot;#&amp;quot; and &amp;quot;~&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       $ find . -regex '.*' ! \( -regex '.*CVS.*'  -o -regex '.*[#|~].*' \)&lt;br /&gt;
&lt;br /&gt;
     Find a *.c file, then run grep on it looking for &amp;quot;stdio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       $ find . -iname '*.c' -exec grep -H 'stdio.h' {} \;&lt;br /&gt;
         sample output --&amp;gt;  ./prog1.c:#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
                            ./test.c:#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Looking for the disk-hog on the whole system?&lt;br /&gt;
&lt;br /&gt;
       $ find /  -size +10000k 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
     Looking for files changed in the last 24 hours? Make sure you add the&lt;br /&gt;
     minus sign &amp;quot;-1&amp;quot;, otherwise, you will only find files changed exactly&lt;br /&gt;
     24 hours from now. With the &amp;quot;-1&amp;quot; you get files changed from now to 24&lt;br /&gt;
     hours.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ find  . -ctime -1  -printf &amp;quot;%a %f\n&amp;quot;&lt;br /&gt;
       Wed Oct  6 12:51:56 2004 .&lt;br /&gt;
       Wed Oct  6 12:35:16 2004 How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
     Or if you just want files.&lt;br /&gt;
&lt;br /&gt;
       $ find . -type f -ctime -1  -printf &amp;quot;%a %f\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Details on file status change in the last 48 hours, current directory. Also note &amp;quot;-atime -2&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
       $ find . -ctime -2 -type f -exec ls -l {} \;&lt;br /&gt;
&lt;br /&gt;
             NOTE: if you don't use -type f, you make get &amp;quot;.&amp;quot; returned, which&lt;br /&gt;
             when run through ls &amp;quot;ls .&amp;quot; may list more than what you want.&lt;br /&gt;
&lt;br /&gt;
             Also you may only want the current directory&lt;br /&gt;
&lt;br /&gt;
       $ find . -ctime -2 -type f -maxdepth 1 -exec ls -l {} \;&lt;br /&gt;
&lt;br /&gt;
     To find files modified within the last 5 to 10 minutes&lt;br /&gt;
&lt;br /&gt;
       $ find . -mmin +5 -mmin -10 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     For more example &amp;quot;find&amp;quot; commands, reference the following looking&lt;br /&gt;
     for the latest version of &amp;quot;bashscripts.x.x.x.tar.gz&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79320&amp;amp;package_id=80711&lt;br /&gt;
&lt;br /&gt;
     See &amp;quot;TIP 71&amp;quot; for examples of find using the inode feature. &amp;quot; $ find . -inum &amp;lt;inode&amp;gt; -exec rm -- '{}' \; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     If you don't want error messages, or need to redirect error messages &amp;quot;&amp;gt; /dev/null 2&amp;gt;&amp;amp;1&amp;quot;, or see&lt;br /&gt;
     &amp;quot;TIP 81&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 58:&lt;br /&gt;
&lt;br /&gt;
     Using the &amp;quot;rm&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
     How do you remove a file that has the name &amp;quot;-&amp;quot;.  For instance, if you run the command&lt;br /&gt;
     &amp;quot;$ cat &amp;gt; - &amp;quot; and type some text followed by ^d, how does the &amp;quot;-&amp;quot; file get deleted?&lt;br /&gt;
&lt;br /&gt;
        $ rm -- -&lt;br /&gt;
&lt;br /&gt;
     The &amp;quot;--&amp;quot; nullifies any rm options.&lt;br /&gt;
&lt;br /&gt;
     How do you delete the directory &amp;quot;one&amp;quot;, all it's sub-directories, and any data?&lt;br /&gt;
&lt;br /&gt;
        $ rm -rf ./one&lt;br /&gt;
&lt;br /&gt;
     Note, to selectively delete stuff on a directory, use the find command &amp;quot;TIP 57&amp;quot;.&lt;br /&gt;
     To delete by inode, see &amp;quot;TIP 71&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 59:&lt;br /&gt;
&lt;br /&gt;
     Giving ownership.&lt;br /&gt;
&lt;br /&gt;
     How do you give the user &amp;quot;donkey&amp;quot; ownership to all directories and files under&lt;br /&gt;
     &amp;quot;./fordonkey&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          $ chown -R donkey ./fordonkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 60:&lt;br /&gt;
&lt;br /&gt;
     Only Permit root login -- give others a message when they try to login.&lt;br /&gt;
&lt;br /&gt;
     Create the file &amp;quot;/etc/nologin&amp;quot; with &amp;quot;nologin&amp;quot; containing the contents&lt;br /&gt;
     of the message.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 61:&lt;br /&gt;
&lt;br /&gt;
     Limits: file size, open files, pipe size, stack size, max memory size&lt;br /&gt;
             cpu time, plus others.&lt;br /&gt;
&lt;br /&gt;
     To get a listing of current limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -a&lt;br /&gt;
             core file size        (blocks, -c) 0&lt;br /&gt;
             data seg size         (kbytes, -d) unlimited&lt;br /&gt;
             file size             (blocks, -f) unlimited&lt;br /&gt;
             max locked memory     (kbytes, -l) unlimited&lt;br /&gt;
             max memory size       (kbytes, -m) unlimited&lt;br /&gt;
             open files                    (-n) 1024&lt;br /&gt;
             pipe size          (512 bytes, -p) 8&lt;br /&gt;
             stack size            (kbytes, -s) 8192&lt;br /&gt;
             cpu time             (seconds, -t) unlimited&lt;br /&gt;
             max user processes            (-u) 8179&lt;br /&gt;
             virtual memory        (kbytes, -v) unlimited&lt;br /&gt;
&lt;br /&gt;
     Note as a user you can decrease your limits in the current&lt;br /&gt;
     shell session; but, you cannot increase.  This can be ideal&lt;br /&gt;
     for testing programs.  But, first you may want to create&lt;br /&gt;
     another shell &amp;quot;sh&amp;quot; so that you can &amp;quot;go back to where started&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -f 10&lt;br /&gt;
&lt;br /&gt;
     Now try&lt;br /&gt;
&lt;br /&gt;
          $ yes &amp;gt;&amp;gt; out&lt;br /&gt;
             File size limit exceeded&lt;br /&gt;
&lt;br /&gt;
     To set limits on users, make changes to &amp;quot;/etc/security/limits.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
           bozo   - maxlogins 1&lt;br /&gt;
&lt;br /&gt;
     Will keep bozo from loging in more than once.&lt;br /&gt;
&lt;br /&gt;
     To list hard limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -Ha&lt;br /&gt;
&lt;br /&gt;
     To list soft limits:&lt;br /&gt;
&lt;br /&gt;
          $ ulimit -Sa&lt;br /&gt;
&lt;br /&gt;
     To restrict user access by time, day make changes to&lt;br /&gt;
             &amp;quot;/etc/security/time.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Also take a look at &amp;quot;/etc/profile&amp;quot; to see what other changes&lt;br /&gt;
     can be made, plus take a look under &amp;quot;/etc/security/*.conf&amp;quot; for&lt;br /&gt;
     other configuration files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 62:&lt;br /&gt;
&lt;br /&gt;
     Stupid &amp;quot;cat&amp;quot; Tricks.&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 43).&lt;br /&gt;
&lt;br /&gt;
     If you have multiple blank lines, squeeze these lines down to one,&lt;br /&gt;
     then, try the following:&lt;br /&gt;
&lt;br /&gt;
          $ cat -s &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to number the lines?&lt;br /&gt;
&lt;br /&gt;
          $ cat -n &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to show tabs?&lt;br /&gt;
&lt;br /&gt;
          $ cat -t &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Need to mark end of lines by &amp;quot;$&amp;quot;? The following was suggested by  (Amos Shapira)&lt;br /&gt;
&lt;br /&gt;
          $ cat -e &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Want to see all the ctl characters?&lt;br /&gt;
&lt;br /&gt;
          /* ctlgen.c&lt;br /&gt;
            Program to generate ctl characters.&lt;br /&gt;
&lt;br /&gt;
            Compile:&lt;br /&gt;
&lt;br /&gt;
               gcc -o ctlgen ctlgen.c&lt;br /&gt;
&lt;br /&gt;
            Run:&lt;br /&gt;
&lt;br /&gt;
               ./ctlgen &amp;gt; mout&lt;br /&gt;
&lt;br /&gt;
            Now see the characters:&lt;br /&gt;
&lt;br /&gt;
               cat -v mout&lt;br /&gt;
&lt;br /&gt;
            Here's a sample output:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               $ cat -v mout|tail&lt;br /&gt;
                   test M-v&lt;br /&gt;
                   test M-w&lt;br /&gt;
                   test M-x&lt;br /&gt;
                   test M-y&lt;br /&gt;
                   test M-z&lt;br /&gt;
                   test M-{&lt;br /&gt;
                   test M-|&lt;br /&gt;
                   test M-}&lt;br /&gt;
                   test M-~&lt;br /&gt;
                   test M-^?&lt;br /&gt;
&lt;br /&gt;
          */&lt;br /&gt;
          #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
          #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
          int main()&lt;br /&gt;
          {&lt;br /&gt;
            int i;&lt;br /&gt;
&lt;br /&gt;
            for(i=0; i &amp;lt; 256; ++i)&lt;br /&gt;
              printf(&amp;quot;test %c \n&amp;quot;,i);&lt;br /&gt;
&lt;br /&gt;
            return 0;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 63:&lt;br /&gt;
&lt;br /&gt;
     Guard against SYN attacks and &amp;quot;ping&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     As root do the following:&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/tcp_syncookies&lt;br /&gt;
&lt;br /&gt;
     Want to disable &amp;quot;ping&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_all&lt;br /&gt;
&lt;br /&gt;
     Disable broadcast/multicast &amp;quot;ping&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
          echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts&lt;br /&gt;
&lt;br /&gt;
     And to enable again:&lt;br /&gt;
&lt;br /&gt;
          echo 0 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_all&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 64:&lt;br /&gt;
&lt;br /&gt;
     Make changes to .bash_profile and need to update the current session?&lt;br /&gt;
&lt;br /&gt;
       $ source .bash_profile&lt;br /&gt;
&lt;br /&gt;
     With the above command, the user does not have to logout.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 65:&lt;br /&gt;
&lt;br /&gt;
     What are the Special Shell Variables?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        $#   The number of arguments.&lt;br /&gt;
        $@   All arguments, as separate words.&lt;br /&gt;
        $*   All arguments, as one word.&lt;br /&gt;
        $$   ID of the current process.&lt;br /&gt;
        $?   Exit status of the last command.&lt;br /&gt;
        $0,$1,..$9,${10},${11}...${N}    Positional parameters. After &amp;quot;9&amp;quot; you must use the ${k} syntax.&lt;br /&gt;
&lt;br /&gt;
     Note that 0 is true. For example if you execute the following, which is true you get zero.&lt;br /&gt;
&lt;br /&gt;
         $  [[ -f /etc/passwd ]]&lt;br /&gt;
         $  echo $?&lt;br /&gt;
         0&lt;br /&gt;
     And the following is false, which returns a 1.&lt;br /&gt;
&lt;br /&gt;
         $  [[ -f /etc/passwdjabberwisnohere ]]&lt;br /&gt;
         $  echo $?&lt;br /&gt;
         1&lt;br /&gt;
&lt;br /&gt;
     So true=0 and false=1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Sample program &amp;quot;mdo&amp;quot;  to show the difference between &amp;quot;$@&amp;quot; and &amp;quot;$*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        function myarg&lt;br /&gt;
        {&lt;br /&gt;
            echo &amp;quot;$# in myarg function&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
        echo -e &amp;quot;$# parameters on the cmd line\n&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;calling: myarg \&amp;quot;\$@\&amp;quot; and myarg \&amp;quot;\$*\&amp;quot;\n&amp;quot;&lt;br /&gt;
        myarg &amp;quot;$@&amp;quot;&lt;br /&gt;
        myarg &amp;quot;$*&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;\ncalling: myarg \$@ and myarg \$* without quotes\n&amp;quot;&lt;br /&gt;
        myarg $@&lt;br /&gt;
        myarg $*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      The result of running &amp;quot;./mdo one two&amp;quot;. Note that when quoted, myarg &amp;quot;$*&amp;quot;,&lt;br /&gt;
      returns 1 ... all parameters are smushed together as one word.&lt;br /&gt;
&lt;br /&gt;
            [chirico@third-fl-71 theBook]$ ./mdo one two&lt;br /&gt;
            2 parameters on the cmd line&lt;br /&gt;
&lt;br /&gt;
            calling: myarg &amp;quot;$@&amp;quot; and myarg &amp;quot;$*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
            1 in myarg function&lt;br /&gt;
&lt;br /&gt;
            calling: myarg $@ and myarg $* without quotes&lt;br /&gt;
&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
            2 in myarg function&lt;br /&gt;
&lt;br /&gt;
      Example program &amp;quot;mdo2&amp;quot; shows how the input separator can be changed.&lt;br /&gt;
&lt;br /&gt;
        #!/bin/bash&lt;br /&gt;
        IFS=|&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=,&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=\;&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
        IFS=$1&lt;br /&gt;
        echo -e &amp;quot;$*\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            [chirico@third-fl-71 theBook]$ ./mdo2 one two three four five&lt;br /&gt;
            one two three four five&lt;br /&gt;
&lt;br /&gt;
            one,two,three,four,five&lt;br /&gt;
&lt;br /&gt;
            one;two;three;four;five&lt;br /&gt;
&lt;br /&gt;
            oneotwoothreeofourofive&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 66:&lt;br /&gt;
&lt;br /&gt;
     Replace all &amp;quot;x&amp;quot; with &amp;quot;y&amp;quot; and all &amp;quot;y&amp;quot; with &amp;quot;x&amp;quot; in file data.&lt;br /&gt;
&lt;br /&gt;
        $ cata data&lt;br /&gt;
          x y&lt;br /&gt;
          y x&lt;br /&gt;
&lt;br /&gt;
        $ tr &amp;quot;xy&amp;quot;  &amp;quot;yx&amp;quot; &amp;lt; data&lt;br /&gt;
          y x&lt;br /&gt;
          x y&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 67:&lt;br /&gt;
&lt;br /&gt;
     On a Linux 2.6.x Kernel, how do you directly measure disk activity,&lt;br /&gt;
     and where is this information documented?&lt;br /&gt;
&lt;br /&gt;
          o The information is documented in the kernel source&lt;br /&gt;
               ./Documentation/iostats.txt&lt;br /&gt;
&lt;br /&gt;
          o The new way of getting this info in 2.6.x is&lt;br /&gt;
              $ cat /sys/block/hda/stat&lt;br /&gt;
            151121 5694 1932358 796675 37867 76770 916994 8353762 0 800672 9150437&lt;br /&gt;
&lt;br /&gt;
             Field  1 -- # of reads issued&lt;br /&gt;
                 This is the total number of reads completed successfully.&lt;br /&gt;
             Field  2 -- # of reads merged, field 6 -- # of writes merged&lt;br /&gt;
                 Reads and writes which are adjacent to each other may be merged for&lt;br /&gt;
                 efficiency.  Thus two 4K reads may become one 8K read before it is&lt;br /&gt;
                 ultimately handed to the disk, and so it will be counted (and queued)&lt;br /&gt;
                 as only one I/O.  This field lets you know how often this was done.&lt;br /&gt;
             Field  3 -- # of sectors read&lt;br /&gt;
                 This is the total number of sectors read successfully.&lt;br /&gt;
             Field  4 -- # of milliseconds spent reading&lt;br /&gt;
                 This is the total number of milliseconds spent by all reads (as&lt;br /&gt;
                 measured from __make_request() to end_that_request_last()).&lt;br /&gt;
             Field  5 -- # of writes completed&lt;br /&gt;
                 This is the total number of writes completed successfully.&lt;br /&gt;
             Field  7 -- # of sectors written&lt;br /&gt;
                 This is the total number of sectors written successfully.&lt;br /&gt;
             Field  8 -- # of milliseconds spent writing&lt;br /&gt;
                 This is the total number of milliseconds spent by all writes (as&lt;br /&gt;
                 measured from __make_request() to end_that_request_last()).&lt;br /&gt;
             Field  9 -- # of I/Os currently in progress&lt;br /&gt;
                 The only field that should go to zero. Incremented as requests are&lt;br /&gt;
                 given to appropriate request_queue_t and decremented as they finish.&lt;br /&gt;
             Field 10 -- # of milliseconds spent doing I/Os&lt;br /&gt;
                 This field is increases so long as field 9 is nonzero.&lt;br /&gt;
             Field 11 -- weighted # of milliseconds spent doing I/Os&lt;br /&gt;
                 This field is incremented at each I/O start, I/O completion, I/O&lt;br /&gt;
                 merge, or read of these stats by the number of I/Os in progress&lt;br /&gt;
                 (field 9) times the number of milliseconds spent doing I/O since the&lt;br /&gt;
                 last update of this field.  This can provide an easy measure of both&lt;br /&gt;
                 I/O completion time and the backlog that may be accumulating.&lt;br /&gt;
&lt;br /&gt;
       Note, this is device specific.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 68:&lt;br /&gt;
&lt;br /&gt;
     Passing Outbound Mail, plus Masquerading User and Hostname.&lt;br /&gt;
&lt;br /&gt;
     Here's a specific example:&lt;br /&gt;
&lt;br /&gt;
         How does one send and receive Comcast email from a home Linux box,&lt;br /&gt;
         which uses Comcast as the ISP, if the local account on the Linux&lt;br /&gt;
         box is different from the Comcast email.  For instance, the&lt;br /&gt;
         account on the Linux box is &amp;quot;chirico@third-fl-71&amp;quot; and the Comcast&lt;br /&gt;
         email account is &amp;quot;mchirico@comcast.net&amp;quot;.  Note both the hostname and&lt;br /&gt;
         username are different.&lt;br /&gt;
&lt;br /&gt;
         So, the user &amp;quot;chirico&amp;quot; using &amp;quot;mutt&amp;quot;, &amp;quot;elm&amp;quot; or any email program would&lt;br /&gt;
         like to send out email to say &amp;quot;donkey@comcast.net&amp;quot;; yet, donkey would&lt;br /&gt;
         see the email from &amp;quot;mchirico@comcast.net&amp;quot; and not &amp;quot;chirico@third-fl-71&amp;quot;&lt;br /&gt;
         but chirico@third-fl-71 would get the replies.&lt;br /&gt;
&lt;br /&gt;
         For a full description of how to solve this problem, including related&lt;br /&gt;
         &amp;quot;sendmail.mc&amp;quot;, &amp;quot;site.config.m4&amp;quot;, &amp;quot;genericstable&amp;quot;, &amp;quot;genericsdomain&amp;quot;,&lt;br /&gt;
         &amp;quot;.procmailrc&amp;quot;, and &amp;quot;.forward&amp;quot; files,  reference the following:&lt;br /&gt;
&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/README_COMCAST_EMAIL.txt?download&lt;br /&gt;
&lt;br /&gt;
         Included in the above link are instructions for building sendmail with&lt;br /&gt;
         &amp;quot;SASL&amp;quot; and &amp;quot;STARTTLS&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 69:&lt;br /&gt;
&lt;br /&gt;
     How do you remove just the last 2 lines from a file and save the result?&lt;br /&gt;
&lt;br /&gt;
         $ sed  '$d' file | sed '$d' &amp;gt; savefile&lt;br /&gt;
&lt;br /&gt;
     Or, as Amos Shapira pointed out, it's much easier with the head command.&lt;br /&gt;
&lt;br /&gt;
         $ head -2 file&lt;br /&gt;
&lt;br /&gt;
      And, of course, removing just the last line&lt;br /&gt;
&lt;br /&gt;
         $ sed '$d' file &amp;gt; savefile&lt;br /&gt;
&lt;br /&gt;
         (See REFERENCES (13))&lt;br /&gt;
&lt;br /&gt;
     How do you remove extra spaces at the end of a line?&lt;br /&gt;
&lt;br /&gt;
         $ sed 's/[ ]*$//g'&lt;br /&gt;
&lt;br /&gt;
     How do you remove blank lines, or lines with just spaces and tabs,&lt;br /&gt;
     saving the origional file as file.backup?&lt;br /&gt;
&lt;br /&gt;
         $ perl -pi.backup -e &amp;quot;s/^(\s)*\n//&amp;quot;  file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 70:&lt;br /&gt;
&lt;br /&gt;
     Generating Random Numbers.&lt;br /&gt;
&lt;br /&gt;
         $ od -vAn -N4 -tu4 &amp;lt; /dev/urandom&lt;br /&gt;
             3905158199&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 71:&lt;br /&gt;
&lt;br /&gt;
     Deleting a File by it's Inode Value.&lt;br /&gt;
&lt;br /&gt;
       See (PROGRAMMING TIP 5) for creating the file, or&lt;br /&gt;
&lt;br /&gt;
       $ cat &amp;gt; '\n\n\n\n\n\n\n'&lt;br /&gt;
         type some text&lt;br /&gt;
         ^D&lt;br /&gt;
&lt;br /&gt;
     To list the inode and display the characters.&lt;br /&gt;
&lt;br /&gt;
       $ ls -libt *&lt;br /&gt;
&lt;br /&gt;
     To remove by inode. Note the &amp;quot;--&amp;quot; option.  This&lt;br /&gt;
     will keep any special characters in the file from being&lt;br /&gt;
     interpreted at &amp;quot;rm&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
       $ find . -inum &amp;lt;inode&amp;gt; -exec rm -- '{}' \;&lt;br /&gt;
&lt;br /&gt;
     Or to check contents&lt;br /&gt;
&lt;br /&gt;
       $ find . -inum &amp;lt;inode&amp;gt; -exec cat '{}' \;&lt;br /&gt;
&lt;br /&gt;
     Reference:&lt;br /&gt;
         http://www.faqs.org/ftp/usenet/news.answers/unix-faq/faq/part2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 72:&lt;br /&gt;
&lt;br /&gt;
     Sending Attachments Using Mutt -- On the Command Line.&lt;br /&gt;
&lt;br /&gt;
        $ mutt -s &amp;quot;See Attachment&amp;quot; -a file.doc user@domain.net &amp;lt; message.txt&lt;br /&gt;
&lt;br /&gt;
          or just the message:&lt;br /&gt;
&lt;br /&gt;
        $ echo | mutt -a sample.tar.gz user@domain.net&lt;br /&gt;
&lt;br /&gt;
      Reference:&lt;br /&gt;
          http://www.shelldorado.com/articles/mailattachments.html&lt;br /&gt;
&lt;br /&gt;
        Also see (TIP 51).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 73:&lt;br /&gt;
&lt;br /&gt;
     Want to find out what functions a program calls?&lt;br /&gt;
&lt;br /&gt;
         $ strace &amp;lt;program&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Try this with &amp;quot;topen.c&amp;quot; (see PROGRAMMING TIP 5)&lt;br /&gt;
&lt;br /&gt;
         $ strace  ./topen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 74:&lt;br /&gt;
&lt;br /&gt;
     RPM Usage Summary.&lt;br /&gt;
&lt;br /&gt;
     Install. Full filename is needed.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -ivh Fedora/RPMS/postgresql-libs-7.4.2-1.i386.rpm&lt;br /&gt;
&lt;br /&gt;
     To view list of files installed with a particular package.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -ql postgresql-libs&lt;br /&gt;
                /usr/lib/libecpg.so.4&lt;br /&gt;
                /usr/lib/libecpg.so.4.1&lt;br /&gt;
                /usr/lib/libecpg_compat.so.1&lt;br /&gt;
                /usr/lib/libecpg_compat.so.1.1&lt;br /&gt;
                /usr/lib/libpgtypes.so.1&lt;br /&gt;
                ...&lt;br /&gt;
&lt;br /&gt;
     Or, to get the file listing from a package that is not installed use the&lt;br /&gt;
     &amp;quot;-p&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -pql /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/CHANGES&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/LICENSE&lt;br /&gt;
               /usr/share/doc/libpcap-0.8.3/README&lt;br /&gt;
               /usr/share/man/man3/pcap.3.gz&lt;br /&gt;
&lt;br /&gt;
     For dependencies listing, use the &amp;quot;R&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qpR /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /sbin/ldconfig&lt;br /&gt;
               /sbin/ldconfig&lt;br /&gt;
               kernel &amp;gt;= 2.2.0&lt;br /&gt;
               libc.so.6&lt;br /&gt;
               libc.so.6(GLIBC_2.0)&lt;br /&gt;
               libc.so.6(GLIBC_2.1)&lt;br /&gt;
               libc.so.6(GLIBC_2.1.3)&lt;br /&gt;
               libc.so.6(GLIBC_2.3)&lt;br /&gt;
               openssl&lt;br /&gt;
               rpmlib(CompressedFileNames) &amp;lt;= 3.0.4-1&lt;br /&gt;
               rpmlib(PayloadFilesHavePrefix) &amp;lt;= 4.0-1&lt;br /&gt;
&lt;br /&gt;
     To check the integrity, use the &amp;quot;-K&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -K /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm&lt;br /&gt;
               /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm: (sha1) dsa sha1 md5 gpg OK&lt;br /&gt;
&lt;br /&gt;
     To list all packages installed.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qa&lt;br /&gt;
&lt;br /&gt;
     To find out which file a package belongs to.&lt;br /&gt;
&lt;br /&gt;
         $ rpm -qf /usr/lib/libecpg.so.4.1&lt;br /&gt;
&lt;br /&gt;
     To uninstall a package&lt;br /&gt;
&lt;br /&gt;
         $ rpm -e&lt;br /&gt;
&lt;br /&gt;
     For building rpm packages reference the following:&lt;br /&gt;
       http://www-106.ibm.com/developerworks/library/l-rpm1/&lt;br /&gt;
&lt;br /&gt;
     To verify md5 sum so that you know it downloaded ok&lt;br /&gt;
&lt;br /&gt;
         $ rpm -K  *.rpm&lt;br /&gt;
&lt;br /&gt;
     The following is a good reference:&lt;br /&gt;
        http://www.rpm.org/max-rpm/s1-rpm-install-additional-options.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 75:&lt;br /&gt;
&lt;br /&gt;
     Listing Output from a Bash Script.&lt;br /&gt;
&lt;br /&gt;
     Add &amp;quot;set -x&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          #!/bin/bash&lt;br /&gt;
          set -x&lt;br /&gt;
          ls&lt;br /&gt;
          date&lt;br /&gt;
&lt;br /&gt;
     Will list the files and output as follows:&lt;br /&gt;
&lt;br /&gt;
           + ls&lt;br /&gt;
           ChangeLog  CVS  data  test&lt;br /&gt;
           + date&lt;br /&gt;
           Thu Jul  1 20:41:04 EDT 2004&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 76:&lt;br /&gt;
&lt;br /&gt;
     Using wget.&lt;br /&gt;
&lt;br /&gt;
     Grap a webpage and pipe it to less. For example suppose you wanted to pipe the&lt;br /&gt;
     contents of all these tips, directly from the web.&lt;br /&gt;
&lt;br /&gt;
      $ wget -O - http://sourceforge.net/direct-dl/mchirico/souptonuts/How_to_Linux_and_Open_Source.txt|less&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 77:&lt;br /&gt;
&lt;br /&gt;
     Finding IP address and MAC address.&lt;br /&gt;
&lt;br /&gt;
       $ /sbin/ifconfig&lt;br /&gt;
&lt;br /&gt;
     Note the following output &amp;quot;eth0&amp;quot; and &amp;quot;eth0:1&amp;quot; which means&lt;br /&gt;
     two IP addresses are tied to 1 NIC (Network Interface Card).&lt;br /&gt;
&lt;br /&gt;
             eth0      Link encap:Ethernet  HWaddr 00:50:DA:60:5B:AD&lt;br /&gt;
                       inet addr:192.168.1.155  Bcast:192.168.99.255  Mask:255.255.252.0&lt;br /&gt;
                       UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
                       RX packets:982757 errors:116 dropped:0 overruns:0 frame:116&lt;br /&gt;
                       TX packets:439297 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:1000&lt;br /&gt;
                       RX bytes:693529078 (661.4 Mb)  TX bytes:78400296 (74.7 Mb)&lt;br /&gt;
                       Interrupt:10 Base address:0xa800&lt;br /&gt;
&lt;br /&gt;
             eth0:1    Link encap:Ethernet  HWaddr 00:50:DA:60:5B:AD&lt;br /&gt;
                       inet addr:192.168.1.182  Bcast:192.168.3.255  Mask:255.255.252.0&lt;br /&gt;
                       UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
                       RX packets:982757 errors:116 dropped:0 overruns:0 frame:116&lt;br /&gt;
                       TX packets:439299 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:1000&lt;br /&gt;
                       RX bytes:693529078 (661.4 Mb)  TX bytes:78400636 (74.7 Mb)&lt;br /&gt;
                       Interrupt:10 Base address:0xa800&lt;br /&gt;
&lt;br /&gt;
             lo        Link encap:Local Loopback&lt;br /&gt;
                       inet addr:127.0.0.1  Mask:255.0.0.0&lt;br /&gt;
                       UP LOOPBACK RUNNING  MTU:16436  Metric:1&lt;br /&gt;
                       RX packets:785 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
                       TX packets:785 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
                       collisions:0 txqueuelen:0&lt;br /&gt;
                       RX bytes:2372833 (2.2 Mb)  TX bytes:2372833 (2.2 Mb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 78:&lt;br /&gt;
&lt;br /&gt;
     DOS to UNIX and UNIX to DOS.&lt;br /&gt;
&lt;br /&gt;
        $ dos2unix file.txt&lt;br /&gt;
&lt;br /&gt;
     And to go the other way from UNIX to DOS&lt;br /&gt;
&lt;br /&gt;
        $ unix2dos unixfile&lt;br /&gt;
&lt;br /&gt;
     See the man page, since there are MAC options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     NOTE: If you're working file DOS files, you'll probably want to use&lt;br /&gt;
           &amp;quot;zip&amp;quot; instead of &amp;quot;gzip&amp;quot; so users on Windows can unzip them.&lt;br /&gt;
&lt;br /&gt;
              $ zip test.zip test.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 79:&lt;br /&gt;
&lt;br /&gt;
     Need to Run Interactive Commands? Try &amp;quot;expect&amp;quot;.&lt;br /&gt;
       http://expect.nist.gov/expect.tar.gz&lt;br /&gt;
&lt;br /&gt;
     This simple example waits for the input &amp;quot;hi&amp;quot;, in some form before&lt;br /&gt;
     returning, immediately, &amp;quot;hello there!&amp;quot;. Otherwise, it will wait for&lt;br /&gt;
     60 seconds, then, return &amp;quot;hello there!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/expect&lt;br /&gt;
          set timeout 60&lt;br /&gt;
          expect &amp;quot;hi\n&amp;quot;&lt;br /&gt;
          send &amp;quot;hello there!\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference:&lt;br /&gt;
        http://www.oreilly.com/catalog/expect/chapter/ch03.html&lt;br /&gt;
&lt;br /&gt;
        http://www.cotse.com/dlf/man/expect/bulletproof1.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 80:&lt;br /&gt;
&lt;br /&gt;
     Using PHP as a Command Line Scripting Language.&lt;br /&gt;
&lt;br /&gt;
     The following will grab the complete file from slashdot.&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/php -q&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;?php&lt;br /&gt;
         $fileName = &amp;quot;http://slashdot.org/slashdot.xml&amp;quot;;&lt;br /&gt;
         $rss = file($fileName) or die (&amp;quot;Cannot open file $fileName\n&amp;quot;);&lt;br /&gt;
         for ($index=0; $index &amp;lt; count($rss); $index++)&lt;br /&gt;
              {&lt;br /&gt;
              echo $rss[$index];&lt;br /&gt;
              }&lt;br /&gt;
         ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       Note, if you want an example that parses the XML of&lt;br /&gt;
       slashdot, then, download the following:&lt;br /&gt;
&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/php_scripts.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 81:&lt;br /&gt;
&lt;br /&gt;
     Discarding all output -- including stderr messages.&lt;br /&gt;
&lt;br /&gt;
         $ ls  &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     Or sending all output to a file&lt;br /&gt;
&lt;br /&gt;
         $ someprog &amp;gt; /tmp/file 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
     Sometimes, find displays a lot of errors when searching through&lt;br /&gt;
     directories that the user doesn't have access to. To discard&lt;br /&gt;
     error messages &amp;quot;stderr&amp;quot;, which is normally file descripter &amp;quot;2&amp;quot;&lt;br /&gt;
     work the following:&lt;br /&gt;
&lt;br /&gt;
         $ find / -iname 'stuff' 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
          or to pipe results elsewhere&lt;br /&gt;
&lt;br /&gt;
         $ find / -iname 'stuff' &amp;gt; /tmp/results_of_find  2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 118).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 82:&lt;br /&gt;
&lt;br /&gt;
     Using MIX.  D. Knuth's  assembly language/machine-code instruction set used in&lt;br /&gt;
     his books to illustrate his algorithms.&lt;br /&gt;
&lt;br /&gt;
     Download the source:&lt;br /&gt;
&lt;br /&gt;
       http://sourceforge.net/project/showfiles.php?group_id=13897&lt;br /&gt;
&lt;br /&gt;
       $ ./configure&lt;br /&gt;
       $ make&lt;br /&gt;
       $ make install&lt;br /&gt;
&lt;br /&gt;
     Documentation can be found at the following link. The link on&lt;br /&gt;
     sourceforge is not correct, but, the one below works.&lt;br /&gt;
&lt;br /&gt;
       http://www.gnu.org/software/mdk/manual/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 83:&lt;br /&gt;
&lt;br /&gt;
     Gnuplot [ http://sourceforge.net/projects/gnuplot/ ].&lt;br /&gt;
&lt;br /&gt;
     This software is ideal for printing graphs.&lt;br /&gt;
&lt;br /&gt;
         gnuplot&amp;gt; set term png&lt;br /&gt;
         gnuplot&amp;gt; set output 'testcos.png'&lt;br /&gt;
         gnuplot&amp;gt; plot cos(x)*sin(x)&lt;br /&gt;
         gnuplot&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
     Or the following command can be put into &amp;quot;file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            $ cat &amp;gt; file&lt;br /&gt;
            set term png&lt;br /&gt;
            set output 'testcos.png'&lt;br /&gt;
            plot cos(x)*sin(x)&lt;br /&gt;
            exit&lt;br /&gt;
            ^D&lt;br /&gt;
&lt;br /&gt;
     Then, run as follows:&lt;br /&gt;
&lt;br /&gt;
            $ gnuplot file&lt;br /&gt;
&lt;br /&gt;
     Or, suppose you have the following file &amp;quot;/home/chirico/data&amp;quot;. Comments&lt;br /&gt;
     with &amp;quot;#&amp;quot; are not read by gnuplot.&lt;br /&gt;
&lt;br /&gt;
            # File /home/chirico/data&lt;br /&gt;
            #&lt;br /&gt;
            2005-07-26  1    2.3    3&lt;br /&gt;
            2005-07-27  2    3.4    5&lt;br /&gt;
            2005-07-28  3    4    6.6&lt;br /&gt;
            2005-07-29  4    6    2.5&lt;br /&gt;
&lt;br /&gt;
     And you have the following new &amp;quot;file&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            set term png&lt;br /&gt;
            set xdata time&lt;br /&gt;
            set timefmt &amp;quot;%Y-%m-%d &amp;quot;&lt;br /&gt;
            set format x &amp;quot;%Y/%m/%d&amp;quot;&lt;br /&gt;
            set output '/var/www/html/chirico/gnuplot/data.png'&lt;br /&gt;
            plot '/home/chirico/data' using 1:2 w linespoints  title '1st col', \&lt;br /&gt;
             '/home/chirico/data' using 1:3 w linespoints  title '2nd col', \&lt;br /&gt;
             '/home/chirico/data' using 1:4 w linespoints  title '3rd col'&lt;br /&gt;
            exit&lt;br /&gt;
&lt;br /&gt;
     You can now get a graph of this data running the following:&lt;br /&gt;
&lt;br /&gt;
            $ gnuplot file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 84:&lt;br /&gt;
&lt;br /&gt;
     CPU Information - speed, processor, cache.&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/cpuinfo&lt;br /&gt;
&lt;br /&gt;
               processor       : 0&lt;br /&gt;
               vendor_id       : GenuineIntel&lt;br /&gt;
               cpu family      : 15&lt;br /&gt;
               model           : 2&lt;br /&gt;
               model name      : Intel(R) Pentium(R) 4 CPU 2.20GHz&lt;br /&gt;
               stepping        : 9&lt;br /&gt;
               cpu MHz         : 2193.221&lt;br /&gt;
               cache size      : 512 KB&lt;br /&gt;
               fdiv_bug        : no&lt;br /&gt;
               hlt_bug         : no&lt;br /&gt;
               f00f_bug        : no&lt;br /&gt;
               coma_bug        : no&lt;br /&gt;
               fpu             : yes&lt;br /&gt;
               fpu_exception   : yes&lt;br /&gt;
               cpuid level     : 2&lt;br /&gt;
               wp              : yes&lt;br /&gt;
               flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr&lt;br /&gt;
               bogomips        : 4325.37&lt;br /&gt;
&lt;br /&gt;
      &amp;quot;bogomips&amp;quot; is a rough but good way to quickly compare two computer speeds. True it's a&lt;br /&gt;
      bogus reading; but, a &amp;quot;good enough&amp;quot; for government work calculation.  See (TIP 10) for&lt;br /&gt;
      &amp;quot;vmstat&amp;quot; and &amp;quot;iostat&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 85:&lt;br /&gt;
&lt;br /&gt;
     POVRAY - Making Animated GIFs&lt;br /&gt;
&lt;br /&gt;
     To see this in action, reference:&lt;br /&gt;
      http://souptonuts.sourceforge.net/povray/orbit.pov.html&lt;br /&gt;
&lt;br /&gt;
     These are the basic command to create:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        $ povray orbit.ini -Iorbit.pov&lt;br /&gt;
        $ convert -delay 20 *.ppm orbit.gif&lt;br /&gt;
&lt;br /&gt;
     By the way, convert is a program from imagemagick, and it can&lt;br /&gt;
     be downloaded from ( http://www.imagemagick.org ).&lt;br /&gt;
&lt;br /&gt;
    The following is &amp;quot;orbit.pov&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          #include &amp;quot;colors.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;finish.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;metals.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;textures.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;stones.inc&amp;quot;&lt;br /&gt;
          #include &amp;quot;skies.inc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          camera {&lt;br /&gt;
            location &amp;lt; 2, 3, -8 &amp;gt;&lt;br /&gt;
            look_at  &amp;lt; 0, 0, 0 &amp;gt;&lt;br /&gt;
            focal_point &amp;lt;0, 0, 0&amp;gt;&lt;br /&gt;
            blur_samples 20&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          light_source {&lt;br /&gt;
                  &amp;lt; 0, 10, 0&amp;gt;&lt;br /&gt;
                  color White&lt;br /&gt;
                  area_light &amp;lt;2,0,0&amp;gt;,&amp;lt;0,0,2&amp;gt;, 2, 2&lt;br /&gt;
                  adaptive 1&lt;br /&gt;
                  fade_distance 8&lt;br /&gt;
                  fade_power 1&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          sky_sphere {&lt;br /&gt;
            S_Cloud3&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          plane { &amp;lt;0, 1, 0&amp;gt;, -1&lt;br /&gt;
                  texture {&lt;br /&gt;
                          pigment {&lt;br /&gt;
                                  checker color Blue, color White&lt;br /&gt;
                          }&lt;br /&gt;
                          finish {Phong_Glossy}&lt;br /&gt;
                  }&lt;br /&gt;
          }&lt;br /&gt;
          #declare ball0=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;0.5, 0.5, 0&amp;gt;, 1&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Yellow}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          #declare ball1=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;3, 2, 0&amp;gt;, 0.5&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Blue}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          #declare ball2=&lt;br /&gt;
                  sphere {&lt;br /&gt;
                  &amp;lt;3, 1, 0&amp;gt;, 1&lt;br /&gt;
                  texture {&lt;br /&gt;
                  T_Silver_1E&lt;br /&gt;
                  pigment {Green}&lt;br /&gt;
                          }&lt;br /&gt;
                  }&lt;br /&gt;
&lt;br /&gt;
          object {ball0 rotate 360*clock*y}&lt;br /&gt;
          object {ball1 rotate 720*clock*y}&lt;br /&gt;
          object {ball2 rotate 360*(1 - clock)*y}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    And, &amp;quot;orbit.ini&amp;quot; follows:&lt;br /&gt;
&lt;br /&gt;
          Output_File_Type=P&lt;br /&gt;
&lt;br /&gt;
          Width=320&lt;br /&gt;
          Height=240&lt;br /&gt;
&lt;br /&gt;
          Initial_Frame=1&lt;br /&gt;
          Final_Frame=10&lt;br /&gt;
          Antialias=true&lt;br /&gt;
&lt;br /&gt;
          Subset_Start_Frame=1&lt;br /&gt;
          Subset_End_Frame=10&lt;br /&gt;
&lt;br /&gt;
          Cyclic_Animation=on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 86:&lt;br /&gt;
&lt;br /&gt;
     GPG --  GnuPG&lt;br /&gt;
&lt;br /&gt;
        Reference: http://www.gnupg.org/documentation/faqs.html&lt;br /&gt;
                   http://codesorcery.net/mutt/mutt-gnupg-howto&lt;br /&gt;
                   http://www.gnupg.org/(en)/download/index.html&lt;br /&gt;
                   (SCRIPT 4) on following link:&lt;br /&gt;
                   http://prdownloads.sourceforge.net/souptonuts/README_common_script_commands.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Generage key:&lt;br /&gt;
&lt;br /&gt;
        $ gpg --gen-key&lt;br /&gt;
&lt;br /&gt;
     Generate public key ID and fingerprint&lt;br /&gt;
&lt;br /&gt;
        $ gpg --fingerprint&lt;br /&gt;
&lt;br /&gt;
     Get a list of keys:&lt;br /&gt;
&lt;br /&gt;
        $ gpg --list-keys&lt;br /&gt;
&lt;br /&gt;
          pub  1024D/A11C1499 2004-07-15 Mike Chirico &amp;lt;mchirico@comcast.net&amp;gt;&lt;br /&gt;
          sub  1024g/E1A3C2B3 2004-07-15&lt;br /&gt;
&lt;br /&gt;
     Encrypt&lt;br /&gt;
&lt;br /&gt;
        $ gpg -r Mike  --encrypt sample.txt&lt;br /&gt;
&lt;br /&gt;
       This will produce &amp;quot;sample.txt.asc&amp;quot;, which is a binary file.  Note, I can use &amp;quot;Mike&amp;quot; because that's the&lt;br /&gt;
       name on the list of keys. Again, it will be a binary file.&lt;br /&gt;
&lt;br /&gt;
     Encrypt using &amp;quot;ASCII-armored text&amp;quot;  (--armor), which is probably what you want when sending &amp;quot;in&amp;quot; the body of an&lt;br /&gt;
     email, or some document.&lt;br /&gt;
&lt;br /&gt;
        $ gpg  -r Mike  --encrypt --armor sample.txt&lt;br /&gt;
            or&lt;br /&gt;
        $ gpg -r Mike -e -a sample.txt&lt;br /&gt;
            or&lt;br /&gt;
        $ gpg --output somefile.asc --armor -r Mike  --encrypt --armor sample.txt&lt;br /&gt;
&lt;br /&gt;
     The above 3 statements will still produce &amp;quot;sample.txt.asc&amp;quot;, but look at it, or &amp;quot;$ cat sample.txt.asc&amp;quot; without &lt;br /&gt;
     fear, since there are no binary characters. Yes, you could even compile a program &amp;quot;$ g++ -o test test.c&amp;quot; , then,&lt;br /&gt;
     &amp;quot;$ gpg --output test.asc  -r Mike --encrypt --armor test&amp;quot;. However, when decrypting make sure to pipe&lt;br /&gt;
     the results.&lt;br /&gt;
&lt;br /&gt;
            $ gpg --decrypt test.asc &amp;gt; test&lt;br /&gt;
&lt;br /&gt;
     Export &amp;quot;public&amp;quot; key:&lt;br /&gt;
&lt;br /&gt;
           $ gpg --armor --export Mike &amp;gt; m1.asc&lt;br /&gt;
&lt;br /&gt;
     Signing the file &amp;quot;message.txt&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
           $ gpg --clearsign message.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Sending the key to the &amp;quot;key-server&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        First, list the keys.&lt;br /&gt;
&lt;br /&gt;
                $ gpg --list-keys&lt;br /&gt;
                    /home/chirico/.gnupg/pubring.gpg&lt;br /&gt;
                                 v------------------ Use this with &amp;quot;0x&amp;quot; in front -------&lt;br /&gt;
                  pub  1024D/A11C1499 2004-07-15 Mike Chirico  &amp;lt;mchirico@comcast.net&amp;gt;   |&lt;br /&gt;
                  sub  1024g/E1A3C2B3 2004-07-15                                        |&lt;br /&gt;
                                                                                        |&lt;br /&gt;
                                   v----------------------------------------------------&lt;br /&gt;
                $ gpg --send-keys 0xA11C1499&lt;br /&gt;
&lt;br /&gt;
             The above sends it to the keyserver defined in &amp;quot;/home/chirico/.gnupg/gpg.conf&amp;quot;.  Other key servers:&lt;br /&gt;
&lt;br /&gt;
                            wwwkeys.pgp.net&lt;br /&gt;
                            search.keyserver.net&lt;br /&gt;
                            pgp.ai.mit.edu&lt;br /&gt;
&lt;br /&gt;
             When you go to your user-group meetings, you need to bring 2 forms of ID, and&lt;br /&gt;
             list your Key fingerprint. Shown below is the command for getting this fingerprint.&lt;br /&gt;
&lt;br /&gt;
                $ gpg --fingerprint mchirico@comcast.net&lt;br /&gt;
                 pub   1024D/A11C1499 2004-07-15&lt;br /&gt;
                 Key fingerprint = 9D7F C80D BB7B 4BAB CCA4  1BE9 9056 5BEC A11C 1499&lt;br /&gt;
                 uid   Mike Chirico (http://souptonuts.sourceforge.net/chirico/index.php) &amp;lt;mchirico@comcast.net&amp;gt;&lt;br /&gt;
                 sub   1024g/E1A3C2B3 2004-07-15&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Receving keys:&lt;br /&gt;
&lt;br /&gt;
        The following will retrieve my mchirico@comcast.net key&lt;br /&gt;
&lt;br /&gt;
               $ gpg --recv-keys 0xA11C1499&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Special Note: If you get the following error &amp;quot;GPG: Warning: Using Insecure Memory&amp;quot; , then,&lt;br /&gt;
                   &amp;quot; chmod 4755 /path/to/gpg&amp;quot;  to setuid(root) permissioins on the gpg binary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     NOTE: If using mutt, just before sending with the &amp;quot;y&amp;quot; option, hit &amp;quot;p&amp;quot; to sign or encrypt.&lt;br /&gt;
&lt;br /&gt;
     It's possible to create a gpg/pgp email from the command line. For a tutorial on this,&lt;br /&gt;
     reference (SCRIPT 4) at the following link:&lt;br /&gt;
           http://prdownloads.sourceforge.net/souptonuts/README_common_script_commands.html?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 87:&lt;br /&gt;
&lt;br /&gt;
     Working with Dates: Steffen Beyer has developed a Perl and C module for working with dates&lt;br /&gt;
&lt;br /&gt;
     This softare can be downloaded from the following location:&lt;br /&gt;
        http://www.engelschall.com/u/sb/download/pkg/Date-Calc-5.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
         $ wget http://www.engelschall.com/u/sb/download/pkg/Date-Calc-5.3.tar.gz&lt;br /&gt;
         $ tar -xzvf Date-Calc-5.3.tar.gz&lt;br /&gt;
         $ cd Date-Calc-5.3&lt;br /&gt;
         $ cp ./examples/cal.c .&lt;br /&gt;
         $ gcc cal.c DateCalc.c -o mcal&lt;br /&gt;
&lt;br /&gt;
     The file cal.c contains sample function calls from DateCalc.c.  Note, &amp;quot;DateCalc.c&amp;quot;&lt;br /&gt;
     is just a list of functions and includes for &amp;quot;DateCalc.h&amp;quot; and &amp;quot;ToolBox.h&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Or, and this may be easier, just download the following:&lt;br /&gt;
         http://prdownloads.sourceforge.net/cpearls/date_calc.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
     The above link contains a few examples.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 88:&lt;br /&gt;
&lt;br /&gt;
     Color patterns for mutt.&lt;br /&gt;
&lt;br /&gt;
     The colors can be changed in the /home/user/.muttrc file. The first field begins with&lt;br /&gt;
     color, the second field is the foreground color, and the third field is the background&lt;br /&gt;
     color, or default.&lt;br /&gt;
&lt;br /&gt;
     An example .muttrc for colors:&lt;br /&gt;
&lt;br /&gt;
       # color patterns for mutt&lt;br /&gt;
       color normal     white          black # normal text&lt;br /&gt;
       color indicator  black          yellow  # actual message&lt;br /&gt;
       color tree       brightmagenta  default # thread arrows&lt;br /&gt;
       color status     brightyellow         default # status line&lt;br /&gt;
       color error      brightred      default # errors&lt;br /&gt;
       color message    magenta        default # info messages&lt;br /&gt;
       color signature  magenta        default # signature&lt;br /&gt;
       color attachment brightyellow   red     # MIME attachments&lt;br /&gt;
       color search     brightyellow   red     # search matches&lt;br /&gt;
       color tilde      brightmagenta  default # ~ at bottom of msg&lt;br /&gt;
       color markers    red            default # + at beginning of wrapped lines&lt;br /&gt;
       color hdrdefault cyan           default # default header lines&lt;br /&gt;
       color bold       red            default # hiliting bold patterns in body&lt;br /&gt;
       color underline  green          default # hiliting underlined patterns in body&lt;br /&gt;
       color quoted     cyan           default # quoted text&lt;br /&gt;
       color quoted1    magenta        default&lt;br /&gt;
       color quoted2    red            default&lt;br /&gt;
       color quoted3    green          default&lt;br /&gt;
       color quoted4    magenta           default&lt;br /&gt;
       color quoted5    cyan           default&lt;br /&gt;
       color quoted6    magenta        default&lt;br /&gt;
       color quoted7    red            default&lt;br /&gt;
       color quoted8    green          default&lt;br /&gt;
       color quoted9    cyan           default&lt;br /&gt;
       color body   cyan  default  &amp;quot;((ftp|http|https)://|news:)[^ &amp;gt;)\&amp;quot;\t]+&amp;quot;&lt;br /&gt;
       color body   cyan  default  &amp;quot;[-a-z_0-9.+]+@[-a-z_0-9.]+&amp;quot;&lt;br /&gt;
       color body   red   default  &amp;quot;(^| )\\*[-a-z0-9*]+\\*[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color body   green default  &amp;quot;(^| )_[-a-z0-9_]+_[,.?]?[\n]&amp;quot;&lt;br /&gt;
       color body   red   default  &amp;quot;(^| )\\*[-a-z0-9*]+\\*[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color body   green default  &amp;quot;(^| )_[-a-z0-9_]+_[,.?]?[ \n]&amp;quot;&lt;br /&gt;
       color index  cyan  default  ~F         # Flagged&lt;br /&gt;
       color index  red   default  ~N         # New&lt;br /&gt;
       color index  magenta    default  ~T         # Tagged&lt;br /&gt;
       color index  cyan       default  ~D         # Deleted&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Also see (TIP 190)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 89:&lt;br /&gt;
&lt;br /&gt;
     ps command in detail&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Here are the possible codes when using state &amp;quot;$ ps -e -o state,cmd&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             PROCESS STATE CODES&lt;br /&gt;
                  D   uninterruptible sleep (usually IO)&lt;br /&gt;
                  R   runnable (on run queue)&lt;br /&gt;
                  S   sleeping&lt;br /&gt;
                  T   traced or stopped&lt;br /&gt;
                  Z   a defunct (&amp;quot;zombie&amp;quot;) process&lt;br /&gt;
&lt;br /&gt;
                  &amp;lt;    high-priority (not nice to other users)&lt;br /&gt;
                  N    low-priority (nice to other users)&lt;br /&gt;
                  L    has pages locked into memory (for real-time and custom IO)&lt;br /&gt;
                  s    is a session leader&lt;br /&gt;
                  l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)&lt;br /&gt;
                  +    is in the foreground process group&lt;br /&gt;
&lt;br /&gt;
    For instance:&lt;br /&gt;
&lt;br /&gt;
     Note that the -o is for user defined, and -e is for select&lt;br /&gt;
     all process.&lt;br /&gt;
&lt;br /&gt;
       $ ps -e -o pid,state,start,time,etime,cmd&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
             9946 S 15:40:45 00:00:00    02:23:29 /bin/bash -i&lt;br /&gt;
             9985 T 15:41:24 00:00:01    02:22:50 emacs mout2&lt;br /&gt;
            10003 T 15:43:59 00:00:00    02:20:15 emacs NOTES&lt;br /&gt;
            10320 T 17:38:42 00:00:00       25:32 emacs stuff.c&lt;br /&gt;
         ...&lt;br /&gt;
&lt;br /&gt;
     You may want to command below, without the -e, which will give the&lt;br /&gt;
     process only under the current terminal.&lt;br /&gt;
&lt;br /&gt;
       $ ps -o pid,state,start,time,etime,cmd&lt;br /&gt;
&lt;br /&gt;
     Want to find what 's impacting your load?&lt;br /&gt;
&lt;br /&gt;
       $ ps -e -o %cpu,pid,state,start,time,etime,%cpu,%mem,cmd|sort -rn|less&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       $ ps aux&lt;br /&gt;
&lt;br /&gt;
            USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND&lt;br /&gt;
            root         1  0.0  0.0  1380  480 ?        S    Aug04   0:00 init [3]&lt;br /&gt;
            root         2  0.0  0.0     0    0 ?        SWN  Aug04   0:00 [ksoftirqd/0]&lt;br /&gt;
            root         3  0.0  0.0     0    0 ?        SW&amp;lt;  Aug04   0:00 [events/0]&lt;br /&gt;
            root         4  0.0  0.0     0    0 ?        SW&amp;lt;  Aug04   0:00 [khelper]&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     Or, if you want to see the environment add the -e option&lt;br /&gt;
&lt;br /&gt;
       $ ps aeux&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
            chirico   2735  0.0  0.1  4400 1492 pts/0    S    Aug04   0:00 -bash USER=chirico LOGNAME=chirico HOME=/home/chirico PATH=/usr/&lt;br /&gt;
            chirico   2771  0.0  0.0  4328  924 pts/0    S    Aug04   0:00 screen -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm S&lt;br /&gt;
            chirico   2772  0.0  0.6  9476 6352 ?        S    Aug04   0:54 SCREEN -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm S&lt;br /&gt;
            chirico   2773  0.0  0.1  4432 1548 pts/1    S    Aug04   0:10 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            chirico   2797  0.0  0.1  4416 1496 pts/2    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            root      2821  0.0  0.0  4100  952 pts/2    S    Aug04   0:00 su -&lt;br /&gt;
            root      2822  0.0  0.1  4384 1480 pts/2    S    Aug04   0:00 -bash&lt;br /&gt;
            chirico   2862  0.0  0.1  4428 1524 pts/3    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            sporkey   2946  0.0  0.2  6836 2960 ?        S    Aug04   0:15 fetchmail&lt;br /&gt;
            chirico   2952  0.0  0.1  4436 1552 pts/5    S    Aug04   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            chirico   3880  0.0  0.1  4416 1496 pts/6    S    Aug05   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
            root      3904  0.0  0.0  4100  956 pts/6    S    Aug05   0:00 su - donkey&lt;br /&gt;
            donkey    3905  0.0  0.1  4336 1452 pts/6    S    Aug05   0:00 -bash&lt;br /&gt;
            donkey    3938  0.0  0.2  6732 2856 ?        S    Aug05   0:14 fetchmail&lt;br /&gt;
            chirico   3944  0.0  0.1  4416 1496 pts/7    S    Aug05   0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     There is also a -f &amp;quot;forrest&amp;quot; option. Also note below &amp;quot; -bash&amp;quot; is the start of a login shell.&lt;br /&gt;
&lt;br /&gt;
      $ ps aeuxwwf &lt;br /&gt;
     &lt;br /&gt;
     The ww option above gives a wide format with all variables. Use the above command if you plan&lt;br /&gt;
     to parse through a Perl script. Otherwise, it may be easier to do a quick read using the command&lt;br /&gt;
     below, without &amp;quot;ww&amp;quot;.    &lt;br /&gt;
&lt;br /&gt;
      $ ps aeuxf&lt;br /&gt;
&lt;br /&gt;
          ...&lt;br /&gt;
            root      2339  0.0  0.1  3512 1444 ?        S    Dec01   0:00 /usr/sbin/sshd&lt;br /&gt;
            root     25651  0.0  0.1  6764 1980 ?        S    Dec23   0:00  \_ /usr/sbin/sshd&lt;br /&gt;
            chirico  25653  0.0  0.2  6840 2236 ?        S    Dec23   0:14      \_ /usr/sbin/sshd&lt;br /&gt;
            chirico  25654  0.0  0.1  4364 1440 pts/4    S    Dec23   0:00          \_ -bash USER=chirico LOGNAME=chirico HOME=/home/chirico&lt;br /&gt;
            chirico  25690  0.0  0.0  4328  920 pts/4    S    Dec23   0:00              \_ screen -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm&lt;br /&gt;
            root      2355  0.0  0.0  2068  904 ?        S    Dec01   0:00 xinetd -stayalive -pidfile /var/run/xinetd.pid&lt;br /&gt;
          ...&lt;br /&gt;
&lt;br /&gt;
     It is also possible to list the process by command line. For example, the following command will only list the emacs&lt;br /&gt;
     processes.&lt;br /&gt;
&lt;br /&gt;
      $ ps -fC emacs&lt;br /&gt;
       UID        PID  PPID  C STIME TTY          TIME CMD&lt;br /&gt;
       chirico   5049  5020  0 May11 pts/13   00:00:00 emacs -nw Notes&lt;br /&gt;
       chirico  12368  5104  0 May12 pts/18   00:00:00 emacs -nw dnotify.c&lt;br /&gt;
       chirico  19792 18028  0 May13 pts/20   00:00:00 emacs -nw hello.c&lt;br /&gt;
       chirico  14034 27367  0 18:52 pts/8    00:00:00 emacs -nw How_to_Linux_and_Open_Source.txt&lt;br /&gt;
&lt;br /&gt;
     You may also want to consider using top in batch mode. Here the &amp;quot;-n 1&amp;quot; means refresh once,&lt;br /&gt;
     and the &amp;quot;b&amp;quot; is for batch. The &amp;quot;fmt -s&amp;quot; is to put it in a more readable format.&lt;br /&gt;
&lt;br /&gt;
       $ top -n 1 b |fmt  -s &amp;gt;&amp;gt;statfile&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 90:&lt;br /&gt;
&lt;br /&gt;
     Learning Assembly.&lt;br /&gt;
&lt;br /&gt;
     Once you have written the source, assuming the file is &amp;quot;exit.s&amp;quot;, it can be compiled as follows:&lt;br /&gt;
&lt;br /&gt;
            $ as exit.s -o exit.o&lt;br /&gt;
            $ ld exit.o -o exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Here is the program:&lt;br /&gt;
&lt;br /&gt;
         #&lt;br /&gt;
         #INPUT:  none&lt;br /&gt;
         #&lt;br /&gt;
         #OUTPUT:         returns a status code. This can be viewed&lt;br /&gt;
         # by typing&lt;br /&gt;
         #&lt;br /&gt;
         # echo $?&lt;br /&gt;
         #&lt;br /&gt;
         # after running the program&lt;br /&gt;
         #&lt;br /&gt;
         #VARIABLES:&lt;br /&gt;
         # %eax holds the system call number&lt;br /&gt;
         # (this is always the case)&lt;br /&gt;
         #&lt;br /&gt;
         # %ebx holds the return status&lt;br /&gt;
         #&lt;br /&gt;
                 .section .data&lt;br /&gt;
                 .section .text&lt;br /&gt;
&lt;br /&gt;
                 .globl _start&lt;br /&gt;
         _start:&lt;br /&gt;
                 movl $1, %eax # this is the linux kernel command&lt;br /&gt;
                 # number (system call) for exiting&lt;br /&gt;
                 # a program&lt;br /&gt;
                 movl $0, %ebx # this is the status number we will&lt;br /&gt;
                 # return to the operating system.&lt;br /&gt;
                 # Change this around and it will&lt;br /&gt;
                 # return different things to&lt;br /&gt;
                 # echo $?&lt;br /&gt;
                 int $0x80 # this wakes up the kernel to run&lt;br /&gt;
                 # the exit command&lt;br /&gt;
&lt;br /&gt;
     After running this program, you can get the exit code.&lt;br /&gt;
&lt;br /&gt;
            $ exit $?&lt;br /&gt;
            0&lt;br /&gt;
&lt;br /&gt;
     That is about all it does; but, get the book for more details. The&lt;br /&gt;
     book is free.&lt;br /&gt;
&lt;br /&gt;
          http://savannah.nongnu.org/download/pgubook/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 91:&lt;br /&gt;
&lt;br /&gt;
     Creating a sandbox for reiserfstune,debugreiserfs and ACL.  Also see TIP 4.&lt;br /&gt;
&lt;br /&gt;
     Assume you have a reisers files system created from a disk file, which&lt;br /&gt;
     means you have done something like the following:&lt;br /&gt;
&lt;br /&gt;
          # dd if=/dev/zero of=disk-rfs count=102400&lt;br /&gt;
          # losetup  /dev/loop4 ./disk-rfs&lt;br /&gt;
          # mkfs -t reiserfs /dev/loop4&lt;br /&gt;
          # mkdir /fs2&lt;br /&gt;
          # mount -o loop,acl ./disk-rfs /fs2&lt;br /&gt;
&lt;br /&gt;
     Now, you can run reiserfstune. But, first you will need to umount fs2&lt;br /&gt;
&lt;br /&gt;
          # umount /fs2&lt;br /&gt;
          # reiserfstune ./disk-rfs&lt;br /&gt;
&lt;br /&gt;
     Or you can run the debug command&lt;br /&gt;
&lt;br /&gt;
          # debugreiserfs -J ./disk-rfs&lt;br /&gt;
&lt;br /&gt;
     Now, suppose you run through a lot of the debug options on&lt;br /&gt;
     http://www.namesys.com/ and you destroy this file.&lt;br /&gt;
&lt;br /&gt;
     You can recreate the file and delete the loop device.&lt;br /&gt;
&lt;br /&gt;
          # dd if=/dev/zero of=disk-rfs count=102400&lt;br /&gt;
          # losetup -d /dev/loop4&lt;br /&gt;
          # mount -o loop,acl ./disk-rfs /fs2&lt;br /&gt;
&lt;br /&gt;
     Now, try working with some of the ACL options - you can only do this&lt;br /&gt;
     with the latest kernel and tools -- Fedora Core 2 will work.&lt;br /&gt;
&lt;br /&gt;
     Assume you have 3 users, donkey, chirico and bozo2. You can give&lt;br /&gt;
     everyone rights to this file system as follows:&lt;br /&gt;
&lt;br /&gt;
          # setfacl -R -m d:u:donkey:rwx,d:u:chirico:rwx,d:u:bozo2:rwx /fs2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 92:&lt;br /&gt;
&lt;br /&gt;
     SpamAssassin - Setup.&lt;br /&gt;
&lt;br /&gt;
     Step 1.&lt;br /&gt;
&lt;br /&gt;
           Installing the SpamAssassin CPAN utility. You will need to do this&lt;br /&gt;
           as root.&lt;br /&gt;
        &lt;br /&gt;
              $ su -&lt;br /&gt;
&lt;br /&gt;
           Once you have root privileges invoke cpan.&lt;br /&gt;
        &lt;br /&gt;
              # perl -MCPAN -e shell&lt;br /&gt;
&lt;br /&gt;
              cpan&amp;gt;&lt;br /&gt;
&lt;br /&gt;
           Now install with prerequisites policy set to ask.&lt;br /&gt;
        &lt;br /&gt;
              cpan&amp;gt; o conf prerequisites_policy ask&lt;br /&gt;
        &lt;br /&gt;
              cpan&amp;gt; install Mail::SpamAssassin&lt;br /&gt;
        &lt;br /&gt;
           You will get lots of output as the necessary modules are downloaded and&lt;br /&gt;
           compiled and installed.&lt;br /&gt;
&lt;br /&gt;
     Step 2.&lt;br /&gt;
&lt;br /&gt;
            Configuration.&lt;br /&gt;
&lt;br /&gt;
            Edit the following &amp;quot;/etc/mail/spamassassin/local.cf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            Here is a look at my file&lt;br /&gt;
&lt;br /&gt;
                $ cat /etc/mail/spamassassin/local.cf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                # This is the right place to customize your installation of SpamAssassin.&lt;br /&gt;
                #&lt;br /&gt;
                # See 'perldoc Mail::SpamAssassin::Conf' for details of what can be&lt;br /&gt;
                # tweaked.&lt;br /&gt;
                #&lt;br /&gt;
                ###########################################################################&lt;br /&gt;
                #&lt;br /&gt;
                # rewrite_subject 0&lt;br /&gt;
                # report_safe 1&lt;br /&gt;
                # trusted_networks 212.17.35.&lt;br /&gt;
                #&lt;br /&gt;
                &lt;br /&gt;
                # Below added from book&lt;br /&gt;
                # You may want to set this to 5, then, work your way down.&lt;br /&gt;
                # Currently I have this 3&lt;br /&gt;
                required_hits 3&lt;br /&gt;
                &lt;br /&gt;
                # This determines how spam is reported. Currently safe email is reported&lt;br /&gt;
                # in the message.&lt;br /&gt;
                report_safe 1&lt;br /&gt;
                &lt;br /&gt;
                # The will rewrite the tag of the spam message.&lt;br /&gt;
                rewrite_subject 1&lt;br /&gt;
                &lt;br /&gt;
                # By default, SpamAssassin will run RBL checks.  If your ISP already&lt;br /&gt;
                # does this, set this to 1.&lt;br /&gt;
                skip_rbl_checks 0&lt;br /&gt;
&lt;br /&gt;
     Step 3.&lt;br /&gt;
&lt;br /&gt;
            Update .procmail.&lt;br /&gt;
&lt;br /&gt;
            You should update the .procmail file as follows. Here is my /home/chirico/.procmail file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                $ cat /home/chirico/.procmailrc&lt;br /&gt;
&lt;br /&gt;
                PATH=/bin:/usr/bin:/usr/local/bin&lt;br /&gt;
                MAILDIR=/var/spool/mail&lt;br /&gt;
                DEFAULT=/var/spool/mail/chirico&lt;br /&gt;
                LOGFILE=/home/chirico/MailBAG&lt;br /&gt;
                MYHOME=/home/chirico&lt;br /&gt;
                #  Must have folder MailTRASH&lt;br /&gt;
                TRASH=/home/chirico/MailTRASH&lt;br /&gt;
                &lt;br /&gt;
                # Will get everything from this mail&lt;br /&gt;
                :0&lt;br /&gt;
                * ^From:.*sporkey@comcast.net&lt;br /&gt;
                        $DEFAULT&lt;br /&gt;
                &lt;br /&gt;
                # Spamassassin&lt;br /&gt;
                :0fw&lt;br /&gt;
                * &amp;lt;300000&lt;br /&gt;
                |/usr/local/bin/spamassassin&lt;br /&gt;
&lt;br /&gt;
      Reference:&lt;br /&gt;
        http://pm-doc.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 93:&lt;br /&gt;
&lt;br /&gt;
     Make Graphs: using dot and neato.&lt;br /&gt;
&lt;br /&gt;
       $ dot -Tpng dotfile -o myout.png&lt;br /&gt;
&lt;br /&gt;
     To see the output reference the following:&lt;br /&gt;
       http://souptonuts.sourceforge.net/code/myout.png&lt;br /&gt;
&lt;br /&gt;
     Where &amp;quot;dotfile&amp;quot; is the following:&lt;br /&gt;
&lt;br /&gt;
       $ cat dotfile&lt;br /&gt;
&lt;br /&gt;
       digraph g&lt;br /&gt;
       {&lt;br /&gt;
               node [shape = record];&lt;br /&gt;
&lt;br /&gt;
               node0 [ label =&amp;quot;&amp;lt;f0&amp;gt; stuff | &amp;lt;f1&amp;gt; J | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node1 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; E | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node4 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; C | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node6 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; I | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node2 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; U | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node5 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; N | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node9 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; Y | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node8 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; W | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node10 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; Z | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node7 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; A | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
               node3 [ label =&amp;quot;&amp;lt;f0&amp;gt; | &amp;lt;f1&amp;gt; G | &amp;lt;f2&amp;gt; &amp;quot;];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node0&amp;quot;:f0 -&amp;gt; &amp;quot;node1&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node0&amp;quot;:f2 -&amp;gt; &amp;quot;node2&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node1&amp;quot;:f0 -&amp;gt; &amp;quot;node4&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node1&amp;quot;:f2 -&amp;gt; &amp;quot;node6&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node4&amp;quot;:f0 -&amp;gt; &amp;quot;node7&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node4&amp;quot;:f2 -&amp;gt; &amp;quot;node3&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node2&amp;quot;:f0 -&amp;gt; &amp;quot;node5&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node2&amp;quot;:f2 -&amp;gt; &amp;quot;node9&amp;quot;:f1;&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;node9&amp;quot;:f0 -&amp;gt; &amp;quot;node8&amp;quot;:f1;&lt;br /&gt;
               &amp;quot;node9&amp;quot;:f2 -&amp;gt; &amp;quot;node10&amp;quot;:f1;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
     Checkout the following article:&lt;br /&gt;
        http://www.linuxjournal.com/article.php?sid=7275&lt;br /&gt;
&lt;br /&gt;
     To download this software&lt;br /&gt;
        http://www.graphviz.org/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 94:&lt;br /&gt;
&lt;br /&gt;
     Makefile: working with conditions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     First note that all the indentations of the file must be&lt;br /&gt;
     a single tab. There cannot be any spaces, or make will&lt;br /&gt;
     not run.&lt;br /&gt;
&lt;br /&gt;
       $ cat Makefile&lt;br /&gt;
&lt;br /&gt;
        # Compiler flags&lt;br /&gt;
        sqliteLIB := $(shell ls /usr/local/lib/libsqlite.so)&lt;br /&gt;
        sqlite3LIB := $(shell ls /usr/local/lib/libsqlite3.so)&lt;br /&gt;
        # all assumes sqlite and sqlite3 are installed&lt;br /&gt;
        #&lt;br /&gt;
&lt;br /&gt;
        test:&lt;br /&gt;
        ifeq (&amp;quot;$(sqlite3LIB)&amp;quot;,&amp;quot;/usr/local/lib/libsqlite3.so&amp;quot;)&lt;br /&gt;
             @echo -e &amp;quot;True -- we found the file&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
             @echo &amp;quot;False -- we did not find the file&amp;quot;&lt;br /&gt;
        endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     So, if I run make I will get the following output.&lt;br /&gt;
&lt;br /&gt;
       $ make&lt;br /&gt;
       True -- we found the file&lt;br /&gt;
&lt;br /&gt;
     This is because I have a file /usr/local/lib/libsqlite3.so on my system.&lt;br /&gt;
     Note how the assignment is made, with the shell command&lt;br /&gt;
&lt;br /&gt;
           sqlite3LIB := $(shell ls /usr/local/lib/libsqlite3.so)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 95:&lt;br /&gt;
&lt;br /&gt;
     Bash: Conditional Expressions&lt;br /&gt;
&lt;br /&gt;
          if [ -e /etc/ntp.conf ]&lt;br /&gt;
            then&lt;br /&gt;
              echo &amp;quot;You have the ntp config file&amp;quot;&lt;br /&gt;
            else&lt;br /&gt;
              echo &amp;quot;You do not have the ntp config file&amp;quot;&lt;br /&gt;
          fi&lt;br /&gt;
&lt;br /&gt;
       Now using an AND condition inside the [ ]. By the way, above, you&lt;br /&gt;
       can put the &amp;quot;then&amp;quot; on the same line as the if &amp;quot;if [ -e /etc/ntp.conf ]; then&amp;quot;&lt;br /&gt;
       as long as you use the &amp;quot;;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           if [ \( -e /etc/ntp.conf \) -a \( -e /etc/ntp/ntpservers \) ]&lt;br /&gt;
             then&lt;br /&gt;
               echo &amp;quot;You have ntp config and ntpservers&amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp.conf ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntp.conf &amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp/ntpservers ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntpservers &amp;quot;&lt;br /&gt;
             else&lt;br /&gt;
               echo &amp;quot; you have neither ntp.conf or ntpservers&amp;quot;&lt;br /&gt;
           fi&lt;br /&gt;
&lt;br /&gt;
        A few things to note above. Else if statement is written as &amp;quot;elif&amp;quot;, and when&lt;br /&gt;
        dealing with &amp;quot;(&amp;quot; you will need to insert &amp;quot;\(&amp;quot;. By the way &amp;quot;-o&amp;quot; can replace &amp;quot;-a&amp;quot;&lt;br /&gt;
        and the &amp;quot;-o&amp;quot; is for OR condition. AND can be done as follows too.&lt;br /&gt;
&lt;br /&gt;
           if [ -e /etc/ntp.conf ] &amp;amp;&amp;amp; [ -e /etc/ntp/ntpservers ]&lt;br /&gt;
             then&lt;br /&gt;
               echo &amp;quot;You have ntp config and ntpservers&amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp.conf ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntp.conf &amp;quot;&lt;br /&gt;
             elif [ -e /etc/ntp/ntpservers ]; then&lt;br /&gt;
               echo &amp;quot; You just have ntpservers &amp;quot;&lt;br /&gt;
             else&lt;br /&gt;
               echo &amp;quot; you have neither ntp.conf or ntpservers&amp;quot;&lt;br /&gt;
           fi&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (files).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             -b file      True if file exists and is a block file&lt;br /&gt;
             -c file      True if file exists and is a character device file&lt;br /&gt;
             -d file      True if file exists and is a directory&lt;br /&gt;
             -e file      True if file exists&lt;br /&gt;
             -f file      True if file exists and is a regular file&lt;br /&gt;
             -g file      True if file exists and is set goup id&lt;br /&gt;
             -G file      True if owned by the effective group ID&lt;br /&gt;
&lt;br /&gt;
             -k file      True if &amp;quot;sticky&amp;quot; bit is set and file exists&lt;br /&gt;
             -L file      True if file exists and is a symbolic link&lt;br /&gt;
             -n string    True if string is non-null&lt;br /&gt;
&lt;br /&gt;
             -O file      Ture if file exists and is owned by the effective user ID&lt;br /&gt;
&lt;br /&gt;
             -p file      True if file is a named pipe (FIFO)&lt;br /&gt;
             -r file      True if file is readable&lt;br /&gt;
             -s file      True if file has size &amp;gt; 0&lt;br /&gt;
             -S file      True if file exists and is a socket&lt;br /&gt;
&lt;br /&gt;
             -t file      True if file is open and refers to a terminal.&lt;br /&gt;
             -u file      True if setuid bit is set&lt;br /&gt;
             -w file      True if file exists and is writeable&lt;br /&gt;
             -x file      True if file executable&lt;br /&gt;
             -x dir       True if directory can be searched&lt;br /&gt;
&lt;br /&gt;
             file1 -nt file2     True if file1 modification date newer than file2&lt;br /&gt;
             file1 -ot file2     True if file1 modification date older than file2&lt;br /&gt;
             file1 -ef file2     True if file1 and file2 have same inode&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (Integers).&lt;br /&gt;
&lt;br /&gt;
             -lt  Less than&lt;br /&gt;
             -le  Less than or equal&lt;br /&gt;
             -eq  Equal&lt;br /&gt;
             -ge  Greater than or equal&lt;br /&gt;
             -gt  Greater than&lt;br /&gt;
             -ne  Not equal&lt;br /&gt;
&lt;br /&gt;
          Example usage.&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
             {&lt;br /&gt;
               while read num value; do&lt;br /&gt;
                if [ $num -gt  2 ]; then&lt;br /&gt;
                  echo $value&lt;br /&gt;
                fi&lt;br /&gt;
               done&lt;br /&gt;
             } &amp;lt; somefile&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Conditional Expressions (Strings).&lt;br /&gt;
&lt;br /&gt;
             str1 = str2      str1 matches str2&lt;br /&gt;
             str1 != str2     str1 does not matches str2&lt;br /&gt;
             str1 &amp;lt; str2      str1 is less than str2&lt;br /&gt;
             str1 &amp;gt;  str2     str1 is greater than str2&lt;br /&gt;
             -n str1          str1 is not null (length greater than 0)&lt;br /&gt;
             -z str1          str1 is null (las length 0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 96:&lt;br /&gt;
&lt;br /&gt;
     CVS: Working with cvs&lt;br /&gt;
&lt;br /&gt;
      INITIAL REPOSITORY:&lt;br /&gt;
&lt;br /&gt;
       To create a repository, and this is normally done by the system admin. This&lt;br /&gt;
       is NOT creating a project to checkout, but the location where everything&lt;br /&gt;
       will be stored! The initial repository!&lt;br /&gt;
&lt;br /&gt;
             cvs -d repository_root_directory init&lt;br /&gt;
&lt;br /&gt;
       Or here is a specific example:&lt;br /&gt;
&lt;br /&gt;
             cvs -d /work/cvsREPOSITORY/   init&lt;br /&gt;
&lt;br /&gt;
       Creating a directory tree from scratch. For a new project, the easiest thing to&lt;br /&gt;
       do is probably to create an empty directory structure, like this:&lt;br /&gt;
&lt;br /&gt;
             $ mkdir sqlite_examples&lt;br /&gt;
             $ mkdir sqlite_examples/man&lt;br /&gt;
             $ mkdir sqlite_examples/testing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       After that, you use the import command to create the&lt;br /&gt;
       corresponding (empty) directory structure inside the repository:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             $ cd &amp;lt;directory&amp;gt;&lt;br /&gt;
             $ cvs -d repository_root_directory import  -m &amp;quot;Created directory structure&amp;quot; yoyodyne/dir yoyo start&lt;br /&gt;
&lt;br /&gt;
       Or, here is a specific example.&lt;br /&gt;
&lt;br /&gt;
             $  cd sqlite_examples&lt;br /&gt;
             $  cvs  -d /work/cvsREPOSITORY/ import -m 'test SQlite'  sqlite_examples sqlite_examples start&lt;br /&gt;
&lt;br /&gt;
       Now, you can delete the directory sqlite_examples, or go to another directory and type&lt;br /&gt;
       the following:&lt;br /&gt;
&lt;br /&gt;
             $ cvs -d /work/cvsREPOSITORY/ co sqlite_examples&lt;br /&gt;
&lt;br /&gt;
     COOL TOOLS:&lt;br /&gt;
&lt;br /&gt;
           1. cvsps&lt;br /&gt;
           2. cvsreport&lt;br /&gt;
&lt;br /&gt;
         cvsps which you can find at http://www.cobite.com/cvsps/cvsps-2.0rc1.tar.gz&lt;br /&gt;
&lt;br /&gt;
             $ cvsps -f README_sqlite_tutorial.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 97:&lt;br /&gt;
&lt;br /&gt;
     Common vi and vim commands&lt;br /&gt;
&lt;br /&gt;
           Command mode ESC&lt;br /&gt;
&lt;br /&gt;
                dd       delete&lt;br /&gt;
                u        undelete&lt;br /&gt;
                y        yank (copy to buffer)&lt;br /&gt;
                p/P      p before cursor/P after cursor&lt;br /&gt;
&lt;br /&gt;
                Ctl-g    show current line number&lt;br /&gt;
                shft-G   end of file&lt;br /&gt;
              n shft-G   move to line n&lt;br /&gt;
&lt;br /&gt;
               /stuff/   search&lt;br /&gt;
                  n   repeat in same direction&lt;br /&gt;
                  N   repeat in opposite direction&lt;br /&gt;
                  /return  repeat seach forward&lt;br /&gt;
                  ?return  repeat seach backward&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;dyy  Yank current line to buffer d&lt;br /&gt;
               &amp;quot;a7yy Yank next 7 lines to buffer a&lt;br /&gt;
                    or&lt;br /&gt;
               :1,7ya a  Yank [ya] lines 1,7 to buffer a&lt;br /&gt;
               :1,7ya b  Yank [ya] lines 1,7 to buffer b&lt;br /&gt;
&lt;br /&gt;
               :5 pu b   Put [pu] buffer b after line 5&lt;br /&gt;
&lt;br /&gt;
               &amp;quot;dP   Put the content of buffer d before cursor&lt;br /&gt;
               &amp;quot;ap   Put the contents of buffer a after cursor&lt;br /&gt;
&lt;br /&gt;
               :1,4 w! file2  Write lines 1,4 to file2&lt;br /&gt;
               :1,3&lt;br /&gt;
&lt;br /&gt;
               :set nu     Display line numbers&lt;br /&gt;
               :set nonum  Turns off display&lt;br /&gt;
&lt;br /&gt;
               :e &amp;lt;filename&amp;gt; Edit a file in a new buffer&lt;br /&gt;
&lt;br /&gt;
            vim&lt;br /&gt;
               :split&lt;br /&gt;
               :split &amp;lt;filename&amp;gt;&lt;br /&gt;
               :sp &amp;lt;filename&amp;gt;&lt;br /&gt;
               :split new&lt;br /&gt;
&lt;br /&gt;
                   ctl-w   To move between windows&lt;br /&gt;
                   ctl-w+&lt;br /&gt;
                   ctl-w-  To change size&lt;br /&gt;
                   ctl+wv  Split windows vertically&lt;br /&gt;
                   ctl-wq  Close window&lt;br /&gt;
&lt;br /&gt;
               :only       To view only 1 window&lt;br /&gt;
&lt;br /&gt;
            vim dictionary - put the following command in ~/.vimrc&lt;br /&gt;
&lt;br /&gt;
                   set dictionary+=/usr/share/dict/words&lt;br /&gt;
                   set thesaurus+=/usr/share/dict/words&lt;br /&gt;
              &lt;br /&gt;
               Now, after you type a word &amp;lt;ctl-x&amp;gt;&amp;lt;ctl-k&amp;gt;&amp;lt;ctl-n&amp;gt; and to &lt;br /&gt;
               go back in the listing &amp;lt;ctl-p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                   butter&amp;lt;ctl-x&amp;gt;&amp;lt;ctl-k&amp;gt;&amp;lt;ctl-n&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 98:&lt;br /&gt;
&lt;br /&gt;
     Using apt-get&lt;br /&gt;
&lt;br /&gt;
          $ apt-get update&lt;br /&gt;
          $ apt-get -s install &amp;lt;pkage&amp;gt;    &amp;lt;---- if everything is ok, then, remove the s&lt;br /&gt;
&lt;br /&gt;
     Note you may want to use dpkg to purge if you have to do a reinstall.&lt;br /&gt;
&lt;br /&gt;
          $ dpkg --purge exim4-base&lt;br /&gt;
          $ dpkg --purge exim4-config&lt;br /&gt;
          $ apt-get install exim4&lt;br /&gt;
&lt;br /&gt;
          $ dpkg-reconfigure exim4-config&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 99:&lt;br /&gt;
&lt;br /&gt;
     Mounting a cdrom on openbsd and installing packages&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /cdrom&lt;br /&gt;
          $ mount /dev/cd0a /cdrom&lt;br /&gt;
          $ cd /cdrom&lt;br /&gt;
&lt;br /&gt;
     To add packages&lt;br /&gt;
&lt;br /&gt;
          $ pkg_add -v  &amp;lt;directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     Mounting a cdrom on linux to a user's home sub-directory:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /home/chirico/cdrom&lt;br /&gt;
          $ mount /dev/cdrom /home/chirico/cdrom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 100:&lt;br /&gt;
&lt;br /&gt;
    Creating a boot floppy for knoppix cd:&lt;br /&gt;
&lt;br /&gt;
          $ dd if=/mnt/cdrom/KNOPPIX/boot.img of=/dev/fd0 bs=1440k&lt;br /&gt;
&lt;br /&gt;
    References:&lt;br /&gt;
        http://www.knoppix.net/docs/index.php/BootFloppyHowTo&lt;br /&gt;
&lt;br /&gt;
    For a lot of the knoppix how-to's&lt;br /&gt;
        http://www.knoppix.net/docs/index.php/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 101:&lt;br /&gt;
&lt;br /&gt;
    Diction and Style Tools for Linux  http://ftp.gnu.org/gnu/diction/&lt;br /&gt;
&lt;br /&gt;
        $ diction mytext|less&lt;br /&gt;
&lt;br /&gt;
    Or, this can be done interactively&lt;br /&gt;
&lt;br /&gt;
        $ diction&lt;br /&gt;
        This is more text to read and you can do with it&lt;br /&gt;
        what you want.&lt;br /&gt;
        (stdin):1: This is more text to read and you [can -&amp;gt; (do not confuse with &amp;quot;may&amp;quot;)] do with it what you want.&lt;br /&gt;
&lt;br /&gt;
    DESCRIPTION&lt;br /&gt;
       Diction finds all sentences in a document, that contain phrases from  a&lt;br /&gt;
       database  of  frequently  misused,  bad  or  wordy diction.  It further&lt;br /&gt;
       checks for double words.  If no files are given, the document  is  read&lt;br /&gt;
       from  standard input.  Each found phrase is enclosed in [ ] (brackets).&lt;br /&gt;
       Suggestions and advice, if any, are printed headed by a right arrow -&amp;gt;.&lt;br /&gt;
       A  sentence is a sequence of words, that starts with a capitalised word&lt;br /&gt;
       and ends with a full stop, double colon, question mark or  exclaimation&lt;br /&gt;
       mark.  A single letter followed by a dot is considered an abbreviation,&lt;br /&gt;
       so it does not terminate a sentence.   Various  multi-letter  abbrevia-&lt;br /&gt;
       tions are recognized, they do not terminate a sentence as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 102:&lt;br /&gt;
&lt;br /&gt;
    Using a mail alias.&lt;br /&gt;
&lt;br /&gt;
       Suppose all root mail on your system to go to one root account root@main.com&lt;br /&gt;
&lt;br /&gt;
       In the following file:&lt;br /&gt;
&lt;br /&gt;
             /etc/aliases&lt;br /&gt;
&lt;br /&gt;
       Add this line&lt;br /&gt;
&lt;br /&gt;
             root:    root@main.com&lt;br /&gt;
&lt;br /&gt;
       Next, run newaliases [/usr/bin/newaliases] as follows:&lt;br /&gt;
&lt;br /&gt;
             $ newaliases&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Special note: It's possible to send mail to more than one address. Suppose you want&lt;br /&gt;
                     mail going to root@main.com above, plus you want it going to user donkey&lt;br /&gt;
                     on the local system.&lt;br /&gt;
&lt;br /&gt;
             root:  root@main.com donkey&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 103:&lt;br /&gt;
&lt;br /&gt;
    Chrony - this service is similiar to ntp. It keeps accurate time&lt;br /&gt;
            on your computer against a very accurate clock in across&lt;br /&gt;
            a network with various time delays.&lt;br /&gt;
&lt;br /&gt;
    Reference: http://go.to/chrony&lt;br /&gt;
&lt;br /&gt;
        In the file &amp;quot;/etc/chrony/chrony.conf&amp;quot; add/replace the following&lt;br /&gt;
&lt;br /&gt;
             server 146.186.218.60&lt;br /&gt;
             server 128.118.25.3&lt;br /&gt;
             server 128.2.129.21&lt;br /&gt;
&lt;br /&gt;
        Next start the chrony service&lt;br /&gt;
&lt;br /&gt;
           $ /etc/init.d/chrony restart&lt;br /&gt;
&lt;br /&gt;
     Next verify that this is working. It may take 20 or 30 minutes to update&lt;br /&gt;
     the clock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Shell command:&lt;br /&gt;
       # chronyc&lt;br /&gt;
       chronyc&amp;gt; sourcestats&lt;br /&gt;
       210 Number of sources = 3&lt;br /&gt;
       Name/IP Address            NP  NR  Span  Frequency   Freq Skew   Std Dev&lt;br /&gt;
       ========================================================================&lt;br /&gt;
       b50.cede.psu.edu            2   0    64       0.000    2000.000  4000ms&lt;br /&gt;
       otc2.psu.edu                2   0    66       0.000    2000.000  4000ms&lt;br /&gt;
       FS3.ECE.CMU.EDU             2   0    64       0.000    2000.000  4000ms&lt;br /&gt;
       chronyc&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    It is probably best to let chrony do its work. However, if you want to&lt;br /&gt;
    set both the hardware and software clock, the following will work:&lt;br /&gt;
&lt;br /&gt;
      Sets the hardware clock&lt;br /&gt;
        # hwclock --set --date=&amp;quot;12/10/04 10:18:05&amp;quot;&lt;br /&gt;
      Sync the hardware clock to software&lt;br /&gt;
        # hwclock --hctosys&lt;br /&gt;
&lt;br /&gt;
    Normally the system keep accurate time with the software clock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 104:&lt;br /&gt;
&lt;br /&gt;
    NFS mount&lt;br /&gt;
&lt;br /&gt;
     SERVER (192.168.1.182)&lt;br /&gt;
&lt;br /&gt;
       Make sure nfs is running on the server&lt;br /&gt;
 &lt;br /&gt;
           $ /etc/init.d/nfs restart&lt;br /&gt;
&lt;br /&gt;
       At the server the contents of /etc/exports for&lt;br /&gt;
       allowing 2 computers (192.168.1.171 and 192.168.1.71)&lt;br /&gt;
       to access the home directory of this server. Note that&lt;br /&gt;
       read write (rw) access is allowed.&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/exports&lt;br /&gt;
         /home   192.168.1.171(rw)&lt;br /&gt;
         /home   192.168.1.71(rw)&lt;br /&gt;
&lt;br /&gt;
       Or, if you have a lot of clients on 192.168.1.* then consider&lt;br /&gt;
       the following:&lt;br /&gt;
&lt;br /&gt;
          /home 192.168.1.0/255.255.252.0(rw)&lt;br /&gt;
&lt;br /&gt;
       Next, still at the server, run the exportfs command&lt;br /&gt;
&lt;br /&gt;
          $ exportfs -rv&lt;br /&gt;
&lt;br /&gt;
       IPTABLES (lokkit). If you're using fedora with default lokkit firewall&lt;br /&gt;
                then you can put the following under &amp;quot;Other ports&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                  Other ports nfs:tcp nfs:udp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       If the above does not work or you are not using lokkit&lt;br /&gt;
        IPTABLES (values in /etc/sysconfig/iptables on SERVER )&lt;br /&gt;
&lt;br /&gt;
        # NFS Need to accept fragmented packets and may not have header&lt;br /&gt;
        #             so you will not know where they are coming from&lt;br /&gt;
        -A INPUT -f -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -m tcp -s 192.168.1.171 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -s 192.168.1.171 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -m udp -s 192.168.1.171 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -s 192.168.1.171 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        &lt;br /&gt;
        -A INPUT -f -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -m tcp -s 192.168.1.71 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p tcp -s 192.168.1.71 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -m udp -s 192.168.1.71 -m multiport --dports 111,683,686,685,1026,2049,2219  -j ACCEPT&lt;br /&gt;
        -A INPUT -p udp -s 192.168.1.71 -d 0/0 --dport 32765:32768  -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        (Reference: http://nfs.sourceforge.net/nfs-howto/server.html)&lt;br /&gt;
                  and&lt;br /&gt;
        (Reference: http://nfs.sourceforge.net/nfs-howto/security.html)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     CLIENT1 (192.168.1.171)&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /home2&lt;br /&gt;
&lt;br /&gt;
          $ cat /etc/fstab&lt;br /&gt;
         192.168.1.182:/home          /home2     nfs     rw 0 0&lt;br /&gt;
&lt;br /&gt;
          $ mount -a -t nfs&lt;br /&gt;
&lt;br /&gt;
        Or to do a one time mounting by hand&lt;br /&gt;
&lt;br /&gt;
          $ mount -t nfs 192.168.1.182:/home  /home2&lt;br /&gt;
&lt;br /&gt;
        Now /home2 on the client will be /home on the server&lt;br /&gt;
&lt;br /&gt;
        Reference:&lt;br /&gt;
          http://nfs.sourceforge.net/nfs-howto/index.html&lt;br /&gt;
&lt;br /&gt;
     MONITOR NFS:&lt;br /&gt;
&lt;br /&gt;
        To monitor the client:&lt;br /&gt;
&lt;br /&gt;
          $ nfsstat -c&lt;br /&gt;
&lt;br /&gt;
           Also note you can &amp;quot;cat /proc/net/rpc/nfs&amp;quot; as well.&lt;br /&gt;
&lt;br /&gt;
       To monitor the server (note the -s instead of the -c).&lt;br /&gt;
&lt;br /&gt;
         $ nfsstat -s&lt;br /&gt;
&lt;br /&gt;
           Also note you can &amp;quot;cat /proc/net/rpc/nfsd&amp;quot; as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       The following &amp;quot;cat&amp;quot; command is done on the NFS server, and shows which&lt;br /&gt;
       clients are mounting. This does not go with examples above. By the way,&lt;br /&gt;
       &amp;quot;root_squash&amp;quot; is the default, and means that root access on the clients is&lt;br /&gt;
       denied. So, how does the client root get access to these filesystems? You have&lt;br /&gt;
       to &amp;quot;su - &amp;lt;someuser&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
              $ cat /proc/fs/nfs/exports&lt;br /&gt;
              # Version 1.1&lt;br /&gt;
              # Path Client(Flags) # IPs&lt;br /&gt;
              /home   192.168.1.102(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   squeezel.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   192.168.1.106(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   livingroom.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   10.8.0.1(rw,root_squash,sync,wdelay)&lt;br /&gt;
              /home   closet.squeezel.com(rw,root_squash,sync,wdelay)&lt;br /&gt;
&lt;br /&gt;
     (Reference: http://www.vanemery.com/Linux/NFSv4/NFSv4-no-rpcsec.html#automount )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 105:&lt;br /&gt;
&lt;br /&gt;
      Ports used for Microsoft products&lt;br /&gt;
               http://www.microsoft.com/canada/smallbiz/sgc/articles/ref_net_ports_ms_prod.mspx?pf=true&lt;br /&gt;
          Firewalling?&lt;br /&gt;
               http://www.microsoft.com/technet/prodtechnol/windowsserver2003/library/ServerHelp/428c1bbf-2ceb-4f76-a1ef-0219982eca10.mspx&lt;br /&gt;
&lt;br /&gt;
      To find out common port mappings, take a look at &amp;quot;/etc/services&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 106:&lt;br /&gt;
&lt;br /&gt;
      Man pages: If man pages are formatting incorrectly with PuTTY, try editing&lt;br /&gt;
      the &amp;quot;/etc/man.config&amp;quot; file with the following changes:&lt;br /&gt;
&lt;br /&gt;
           NROFF /usr/bin/groff -Tlatin1 -mandoc&lt;br /&gt;
           NEQN /usr/bin/geqn -Tlatin1&lt;br /&gt;
&lt;br /&gt;
         (Reference TIP 7 for using man)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 107:&lt;br /&gt;
&lt;br /&gt;
      Valgrind: check for memory leaks in your programs. (http://valgrind.org/)&lt;br /&gt;
&lt;br /&gt;
       This is how you can run it on the program &amp;quot;a.out&amp;quot; for valgrind version 2.2.0&lt;br /&gt;
&lt;br /&gt;
         $ valgrind --logfile=valgrind.output   --tool=memcheck ./a.out&lt;br /&gt;
&lt;br /&gt;
       This is how you write the logfile &amp;quot;--log-file&amp;quot; for valgrind-3.0.1&lt;br /&gt;
&lt;br /&gt;
         $ valgrind  --log-file=valgrind --leak-check=yes --tool=memcheck ./a.out&lt;br /&gt;
&lt;br /&gt;
       With C++ programs with gcc 3.4 and later that use STL, export GLIBCXX_FORCE_NEW &lt;br /&gt;
       only when testing to disable memory caching. Remember to enable for production&lt;br /&gt;
       as this will have a performance penalty. Reference  http://valgrind.org/docs/FAQ/ &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 108:&lt;br /&gt;
&lt;br /&gt;
      Runlevel Configuring.&lt;br /&gt;
&lt;br /&gt;
       These two programs, run as root give you a ncurses GUI to what will&lt;br /&gt;
       run on your system on boot.&lt;br /&gt;
&lt;br /&gt;
            # ntsysv&lt;br /&gt;
&lt;br /&gt;
            # chkconfig&lt;br /&gt;
&lt;br /&gt;
       Note, you can also set these manually. For example, normally you will&lt;br /&gt;
       have files in &amp;quot;/etc/init.d/&amp;quot; that will take parameters like &amp;quot;start&amp;quot;,&amp;quot;stop&amp;quot;&lt;br /&gt;
       &amp;quot;restart&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       Take a look at &amp;quot;/etc/init.d/mysql&amp;quot; this file will start and stop the&lt;br /&gt;
       mysql daemon. So, how does know which run levels, and the order it gets&lt;br /&gt;
       loaded in the run level to other programs? By the K&amp;lt;number&amp;gt; and S&amp;lt;number&amp;gt;&lt;br /&gt;
       values.&lt;br /&gt;
&lt;br /&gt;
            $ ls /etc/rc3.d/*mysql&lt;br /&gt;
&lt;br /&gt;
                /etc/rc3.d/K85mysql&lt;br /&gt;
                /etc/rc3.d/S85mysql&lt;br /&gt;
&lt;br /&gt;
       So here on my system the start value is 85. Looking in /etc/rc3.d, which is&lt;br /&gt;
       run level 3, any program with a lower number S84something will get loaded&lt;br /&gt;
       before mysql.&lt;br /&gt;
&lt;br /&gt;
       I manually set the run level as follows for mysql.&lt;br /&gt;
&lt;br /&gt;
            # cd /etc/rc3.d&lt;br /&gt;
            # ln -s ../init.d/mysql S85mysql&lt;br /&gt;
            # ln -s ../init.d/mysql K85mysql&lt;br /&gt;
&lt;br /&gt;
            # cd /etc/rc5.d&lt;br /&gt;
            # ln -s ../init.d/mysql S85mysql&lt;br /&gt;
            # ln -s ../init.d/mysql K85mysql&lt;br /&gt;
&lt;br /&gt;
       Note that I could have chose other numbers as well. &amp;quot;ntsysv&amp;quot; gives&lt;br /&gt;
       you a graphical interface.&lt;br /&gt;
&lt;br /&gt;
       This is a way of doing this with &amp;quot;chkconfig&amp;quot; at the command prompt.&lt;br /&gt;
&lt;br /&gt;
            # chkconfig --list mysqld&lt;br /&gt;
            mysqld          0:off   1:off   2:off   3:on    4:off   5:on    6:off&lt;br /&gt;
&lt;br /&gt;
       Above you can see it's on. Here's how we would have turned this on with chkconfig.&lt;br /&gt;
&lt;br /&gt;
            # chkconfig --level 35 mysqld on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 109:&lt;br /&gt;
&lt;br /&gt;
       File Alteration Monitor - Gamin a FAM replacement&lt;br /&gt;
        http://www.gnome.org/~veillard/gamin/&lt;br /&gt;
        http://www.gnome.org/~veillard/gamin/sources/&lt;br /&gt;
       ******  EXAMPLE NOT COMPLETE *****&lt;br /&gt;
&lt;br /&gt;
       Working with fam  - file alteration monitor.  Mail uses this to signify&lt;br /&gt;
           a change in a file's status.&lt;br /&gt;
&lt;br /&gt;
        Below is the sample C program ftest.c which can be compiled as&lt;br /&gt;
        follows:&lt;br /&gt;
&lt;br /&gt;
              $ gcc -o ftest ftest.c  -lfam&lt;br /&gt;
&lt;br /&gt;
        You will need to work with this as root&lt;br /&gt;
&lt;br /&gt;
              #  ./ftest &amp;lt;somefile absolute path&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Reference:&lt;br /&gt;
            http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?db=man&amp;amp;fname=/usr/share/catman/p_man/cat3x/fam.z&lt;br /&gt;
            http://www.devchannel.org/devtoolschannel/04/05/13/2146252.shtml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 110:&lt;br /&gt;
&lt;br /&gt;
       glibc - this is the main library used by C, and the following&lt;br /&gt;
        link below gives you examples on everything from sockets,math,&lt;br /&gt;
        date and time functions, user environment, and much more.&lt;br /&gt;
&lt;br /&gt;
         http://www.gnu.org/software/libc/manual/html_mono/libc.html&lt;br /&gt;
&lt;br /&gt;
       How do you know which version of glibc you are running?&lt;br /&gt;
&lt;br /&gt;
          #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
          #include &amp;lt;gnu/libc-version.h&amp;gt;&lt;br /&gt;
          int main (void)&lt;br /&gt;
           {&lt;br /&gt;
             puts (gnu_get_libc_version ());&lt;br /&gt;
             return 0;&lt;br /&gt;
           }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 111:&lt;br /&gt;
&lt;br /&gt;
       nslookup and dig - query Internet name servers interactively.&lt;br /&gt;
&lt;br /&gt;
         $ nslookup&lt;br /&gt;
         &amp;gt;chirico.org&lt;br /&gt;
         Server:        68.80.0.6&lt;br /&gt;
         Address:       68.80.0.6#53&lt;br /&gt;
&lt;br /&gt;
         Name: chirico.org&lt;br /&gt;
         Address: 66.35.250.210&lt;br /&gt;
         &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      The nslookup command will query the dns server is &amp;quot;/etc/resolve.conf&amp;quot;&lt;br /&gt;
      However, you can force a certain dns with &amp;quot;- server&amp;quot;.  For example the&lt;br /&gt;
      command below goes to the server named dilbert&lt;br /&gt;
&lt;br /&gt;
         $ nslookup - dilbert&lt;br /&gt;
         &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      dig:&lt;br /&gt;
&lt;br /&gt;
      dig gives you more information. You should probably use dig instead&lt;br /&gt;
      of nslookup.&lt;br /&gt;
&lt;br /&gt;
      Below I am forcing the lookup from DNS 68.80.0.6 of the name chirico.org, and&lt;br /&gt;
      note that the query time is return too.&lt;br /&gt;
&lt;br /&gt;
         $ dig @68.80.0.6  +qr chirico.org&lt;br /&gt;
&lt;br /&gt;
         ; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.2.1 &amp;lt;&amp;lt;&amp;gt;&amp;gt; @68.80.0.6 +qr chirico.org&lt;br /&gt;
         ;; global options:  printcmd&lt;br /&gt;
         ;; Sending:&lt;br /&gt;
         ;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 55908&lt;br /&gt;
         ;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0&lt;br /&gt;
        &lt;br /&gt;
         ;; QUESTION SECTION:&lt;br /&gt;
         ;chirico.org.                   IN      A&lt;br /&gt;
        &lt;br /&gt;
         ;; Got answer:&lt;br /&gt;
         ;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 55908&lt;br /&gt;
         ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
        &lt;br /&gt;
         ;; QUESTION SECTION:&lt;br /&gt;
         ;chirico.org.                   IN      A&lt;br /&gt;
        &lt;br /&gt;
         ;; ANSWER SECTION:&lt;br /&gt;
         chirico.org.            5538    IN      A       66.35.250.210&lt;br /&gt;
        &lt;br /&gt;
         ;; AUTHORITY SECTION:&lt;br /&gt;
         chirico.org.            30599   IN      NS      ns78.worldnic.com.&lt;br /&gt;
         chirico.org.            30599   IN      NS      ns77.worldnic.com.&lt;br /&gt;
        &lt;br /&gt;
         ;; ADDITIONAL SECTION:&lt;br /&gt;
         ns78.worldnic.com.      16022   IN      A       216.168.225.218&lt;br /&gt;
         ns77.worldnic.com.      7       IN      A       216.168.228.41&lt;br /&gt;
        &lt;br /&gt;
         ;; Query time: 155 msec&lt;br /&gt;
         ;; SERVER: 68.80.0.6#53(68.80.0.6)&lt;br /&gt;
         ;; WHEN: Thu Dec 23 07:48:23 2004&lt;br /&gt;
         ;; MSG SIZE  rcvd: 127&lt;br /&gt;
&lt;br /&gt;
      So what if you wanted to know what name the IP address 66.35.250.210&lt;br /&gt;
      resolves to, when using dns 68.80.0.12.&lt;br /&gt;
&lt;br /&gt;
          $ dig @68.80.0.12 -x 66.35.250.210&lt;br /&gt;
          ...&lt;br /&gt;
          ;; ANSWER SECTION:&lt;br /&gt;
          210.250.35.66.in-addr.arpa. 3600 IN   CNAME   210.0/24.250.35.66.in-addr.arpa.&lt;br /&gt;
          210.0/24.250.35.66.in-addr.arpa. 3600 IN PTR  vhost.sourceforge.net.&lt;br /&gt;
&lt;br /&gt;
      Above you can see it resolved to &amp;quot;vhost.sourceforge.net&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      Reference ( http://www.tldp.org/HOWTO/DNS-HOWTO-5.html )&lt;br /&gt;
        Also see TIP 223.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 112:&lt;br /&gt;
&lt;br /&gt;
       Using GNU Autotools - so you can produce the familiar &amp;quot;./configure&amp;quot;  &amp;quot;make&amp;quot;  and &amp;quot;make install&amp;quot;&lt;br /&gt;
                             commands. There is also a &amp;quot;make dist&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                The program sqlite3api.cc and the rest of this code can be found at&lt;br /&gt;
                 http://prdownloads.sourceforge.net/cpearls/autotools.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         A &amp;quot;Makefile.am&amp;quot; is required:&lt;br /&gt;
&lt;br /&gt;
            bin_PROGRAMS = sprog&lt;br /&gt;
            sprog_SOURCES = sqlite3api.cc&lt;br /&gt;
            sprog_LDADD = @INCLUDES@ @SQLIBOBJS@&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         In addition, a &amp;quot;configure.in&amp;quot; file is required. Note, AC_CHECK_LIB will&lt;br /&gt;
         check the &amp;quot;libsqlite3.so&amp;quot; file for the &amp;quot;sqlite3_open&amp;quot; file. Note that&lt;br /&gt;
         &amp;quot;sqlite3&amp;quot;, is a shortcut for &amp;quot;libsqlite3&amp;quot; by convention. If this file&lt;br /&gt;
         is not found, AC_CHECK_FILE looks for &amp;quot;/usr/local/lib/libsqlite3.a&amp;quot;. If&lt;br /&gt;
         this is found, then, &amp;quot;-lsqlite3&amp;quot; is added to the LIBS environment variable.&lt;br /&gt;
         Also, &amp;quot;-I/usr/local/include&amp;quot; and &amp;quot;-L/usr/local/lib&amp;quot; will be added on the&lt;br /&gt;
         command line. This is common when some one does not have the library in&lt;br /&gt;
         the path.  (See TIP 49)&lt;br /&gt;
&lt;br /&gt;
            dnl Process this file with autoconf to produce a configure script.&lt;br /&gt;
            AC_INIT(sqlite3api.cc)&lt;br /&gt;
            AM_INIT_AUTOMAKE(sqliteprog, 1.0)&lt;br /&gt;
            AC_PROG_CXX&lt;br /&gt;
            CXXFLAGS='-Wall -W -O2 -s -pipe'&lt;br /&gt;
            AC_CHECK_LIB(sqlite3,sqlite3_open,[],found=no)&lt;br /&gt;
             if test &amp;quot;$found&amp;quot; = &amp;quot;no&amp;quot;; then&lt;br /&gt;
               AC_CHECK_FILE(/usr/local/lib/libsqlite3.a, found=yes)&lt;br /&gt;
               if test &amp;quot;$found&amp;quot; = &amp;quot;yes&amp;quot;; then&lt;br /&gt;
                 LIBS=&amp;quot;$LIBS -lsqlite3&amp;quot;&lt;br /&gt;
                 INCLUDES=&amp;quot;$INCLUDES -I/usr/local/include&amp;quot;&lt;br /&gt;
                 EXTRALIB='-L/usr/local/lib'&lt;br /&gt;
                else&lt;br /&gt;
                 echo &amp;quot;Are you SURE sqlite3 is installed?&amp;quot;&lt;br /&gt;
               fi&lt;br /&gt;
             fi&lt;br /&gt;
            SQLIBOBJS='-Wl,-R/usr/local/lib'&lt;br /&gt;
            AC_SUBST(INCLUDES)&lt;br /&gt;
            AC_SUBST(SQLIBOBJS)&lt;br /&gt;
            AC_SUBST(EXTRALIB)&lt;br /&gt;
            AC_OUTPUT(Makefile)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         To build the configure file, just run the following:&lt;br /&gt;
&lt;br /&gt;
             $ aclocal&lt;br /&gt;
             $ autoconf&lt;br /&gt;
             $ touch NEWS README AUTHORS ChangeLog&lt;br /&gt;
             $ automake --add-missing&lt;br /&gt;
&lt;br /&gt;
         Now if you want to make a tar.gz file &amp;quot;sqliteprog-1.0.tar.gz&amp;quot;, then&lt;br /&gt;
         all you have to run is the following:&lt;br /&gt;
&lt;br /&gt;
             $ make dist&lt;br /&gt;
&lt;br /&gt;
         Note: did you ever want to save all the output from a ./configure? Well, it&lt;br /&gt;
               is automatically saved in the &amp;quot;config.log&amp;quot; file. In fact, this file may&lt;br /&gt;
               contain a lot more than what you saw on the screen.&lt;br /&gt;
&lt;br /&gt;
               Also, you may need to rerun ./configure. But before you do, delete&lt;br /&gt;
               the &amp;quot;config.cache&amp;quot; file to get a clean build.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 113:&lt;br /&gt;
&lt;br /&gt;
       EMACS - common emacs commands.&lt;br /&gt;
&lt;br /&gt;
         M is the ESC&lt;br /&gt;
         C or c is the Ctl&lt;br /&gt;
&lt;br /&gt;
        Shell - when working in a shell. &amp;quot;M-x rename-uniquely&amp;quot; is good for split screen editing.&lt;br /&gt;
&lt;br /&gt;
          M-x rename-uniquely   Use this for multiple shells (renames buffer so it's not the same shell)&lt;br /&gt;
          C-c C-z               Send job in background (when working in a shell)&lt;br /&gt;
          C-c C-o               commit-kill-output (gets rid of a lot of shell output)&lt;br /&gt;
          C-c C-r               reposition at beginning of output&lt;br /&gt;
          C-c C-e               reposition at end of output&lt;br /&gt;
          M-x send-invisible    Hide passwords - use this before typing a password&lt;br /&gt;
&lt;br /&gt;
         Note: if the shell prompt does not show up correctly, then, you may want to creat a &amp;quot;.emacs_bash&amp;quot;&lt;br /&gt;
               file with the following contents:&lt;br /&gt;
&lt;br /&gt;
                          PS1=&amp;quot;emacs:\W \$ &amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Directories  (C-x d) give you a directory listing. You know all those annoying &amp;quot;~&amp;quot; and &amp;quot;#&amp;quot;&lt;br /&gt;
                     file that you get? You can easily delete these when in &amp;quot;dired&amp;quot; mode by hitting&lt;br /&gt;
                     &amp;quot;~&amp;quot;, then  &amp;quot;d&amp;quot; to flag it for delete. Then, hit &amp;quot;x&amp;quot; to and confirm deletion.&lt;br /&gt;
&lt;br /&gt;
                     These are other command that work on highlighted files in &amp;quot;dired&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
                          R   rename&lt;br /&gt;
                          v   view&lt;br /&gt;
                          Z   compress the file&lt;br /&gt;
                          +   create directory&lt;br /&gt;
&lt;br /&gt;
        Other common commands:&lt;br /&gt;
&lt;br /&gt;
          c-x l          list the line you are on, and how many lines in the document.&lt;br /&gt;
                         You will get something like: Page has 4881 lines (4440 + 442),&lt;br /&gt;
                         which means you are on the 4440 line.&lt;br /&gt;
&lt;br /&gt;
          c-x rm bookmark make&lt;br /&gt;
          c-x rb bookmark bounce&lt;br /&gt;
        &lt;br /&gt;
          c-x rb notes&lt;br /&gt;
          c-x rb emacs&lt;br /&gt;
        &lt;br /&gt;
          c-x / &amp;lt;r&amp;gt; (save position in register &amp;lt;r&amp;gt;)&lt;br /&gt;
          c-x j &amp;lt;r&amp;gt; (jump to position in register &amp;lt;r&amp;gt;)&lt;br /&gt;
          c-x r SPC 1 (mark current point in register 1)&lt;br /&gt;
          c-x r j 1 (jump to marked point in register 1)&lt;br /&gt;
          c-x r t &amp;lt;string&amp;gt;  (insert string into register)&lt;br /&gt;
        &lt;br /&gt;
          c-x r s 1 (save marked region in register 1)&lt;br /&gt;
          c-x r i 1 (insert marked region)&lt;br /&gt;
        &lt;br /&gt;
          c-x c-o (delete all blank lines, except one)&lt;br /&gt;
        &lt;br /&gt;
          c-x z (repeat the last command ... stop with an a)&lt;br /&gt;
          c-x zz (repeat the last command twice)&lt;br /&gt;
&lt;br /&gt;
          rectangle&lt;br /&gt;
          ---------&lt;br /&gt;
          C-SPC&lt;br /&gt;
          goto the next region&lt;br /&gt;
          C-x&lt;br /&gt;
          C-x&lt;br /&gt;
          then, C-x r r &amp;quot;name of register&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
          to insert the register&lt;br /&gt;
          C-x r i &amp;quot;name of register&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
          macros:&lt;br /&gt;
          -------&lt;br /&gt;
          c-x (    start macro&lt;br /&gt;
          c-x )    end macro&lt;br /&gt;
          c-x e    execute macro&lt;br /&gt;
        &lt;br /&gt;
          mail:&lt;br /&gt;
          -----&lt;br /&gt;
          c-x m   mail&lt;br /&gt;
          c-c c-s send&lt;br /&gt;
        &lt;br /&gt;
          C-x C-e&lt;br /&gt;
          (insert &amp;quot;\n\nExtra Line of text&amp;quot;)&lt;br /&gt;
        &lt;br /&gt;
          ;; chirico functions in .emacs&lt;br /&gt;
          ;; This creates an html template&lt;br /&gt;
          (defun my-html ()&lt;br /&gt;
          (interactive)&lt;br /&gt;
          (insert &amp;quot;&amp;lt;html&amp;gt;&lt;br /&gt;
          &amp;lt;head&amp;gt;&lt;br /&gt;
          &amp;lt;META HTTP-EQUIV=\&amp;quot;Pragma\&amp;quot; CONTENT=\&amp;quot;no-cache\&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;META HTTP-EQUIV=\&amp;quot;Expires\&amp;quot; CONTENT=\&amp;quot;-1\&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;/head&amp;gt;&lt;br /&gt;
          &amp;lt;body bgcolor=\&amp;quot;#ffffff\&amp;quot;&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
          &amp;lt;/body&amp;gt;&lt;br /&gt;
          &amp;lt;/html&amp;gt;&amp;quot;)&lt;br /&gt;
          )&lt;br /&gt;
&lt;br /&gt;
     Backspace issues when using &amp;quot;emacs -nw&amp;quot;? They putting the following in your &amp;quot;~/.emacs&amp;quot; file&lt;br /&gt;
&lt;br /&gt;
             (global-set-key &amp;quot;\C-d&amp;quot; 'backward-delete-char)&lt;br /&gt;
             (global-set-key &amp;quot;\C-h&amp;quot; 'backward-delete-char)&lt;br /&gt;
             (global-set-key (kbd &amp;quot;DEL&amp;quot;) 'delete-char)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 114:&lt;br /&gt;
&lt;br /&gt;
        ncftpget - an intelligent ftp client (http://www.ncftp.com/). Also&lt;br /&gt;
                   check your fedora or debian install. This package allows&lt;br /&gt;
                   you to easily download packages from ftp sites.&lt;br /&gt;
&lt;br /&gt;
          This is an example of connect to an ftp site, with a subdirectory, and&lt;br /&gt;
          downloading all in one command.&lt;br /&gt;
&lt;br /&gt;
           $ ncftpget ftp://ftp.gnu.org/pub/gnu/gcc/gcc-3.2.3/gcc-3.2.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
          Of if you want to get the fedora core 3 installs&lt;br /&gt;
&lt;br /&gt;
           $ ncftpget ftp://ftp.linux.ncsu.edu/pub/fedora/linux/core/3/i386/iso/FC3*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 115:&lt;br /&gt;
&lt;br /&gt;
        expr - evaluate expressions. You can use this on the command line&lt;br /&gt;
&lt;br /&gt;
           $ expr 6 + 4&lt;br /&gt;
           10&lt;br /&gt;
&lt;br /&gt;
         Note the spaces. Without spaces, you get the following:&lt;br /&gt;
&lt;br /&gt;
           $ expr 6+4&lt;br /&gt;
           6+4&lt;br /&gt;
&lt;br /&gt;
         If you're using &amp;quot;*&amp;quot;, you'll need a &amp;quot;\&amp;quot; before it&lt;br /&gt;
&lt;br /&gt;
           $ expr 10 \* 10&lt;br /&gt;
           100&lt;br /&gt;
&lt;br /&gt;
         This also works for variables&lt;br /&gt;
&lt;br /&gt;
           $ var1=34&lt;br /&gt;
           $ expr $var1 + 3&lt;br /&gt;
           37&lt;br /&gt;
&lt;br /&gt;
         or&lt;br /&gt;
&lt;br /&gt;
           $ var1=2&lt;br /&gt;
           $ var1=`expr $var1 \* 2`&lt;br /&gt;
           $ echo $var1&lt;br /&gt;
           4&lt;br /&gt;
&lt;br /&gt;
         see (TIP 25) you can get the cosine(.23)&lt;br /&gt;
&lt;br /&gt;
           $ var1=`echo &amp;quot;c(.23)&amp;quot;|bc -l`&lt;br /&gt;
           $ echo $var1&lt;br /&gt;
           .97366639500537483696&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         You can also do substrings:&lt;br /&gt;
&lt;br /&gt;
           $ expr substr &amp;quot;BigBear&amp;quot; 4 4&lt;br /&gt;
           Bear&lt;br /&gt;
&lt;br /&gt;
         And length of strings&lt;br /&gt;
&lt;br /&gt;
           $ mstr=&amp;quot;12345&amp;quot;&lt;br /&gt;
           $ expr length $mstr&lt;br /&gt;
           5&lt;br /&gt;
&lt;br /&gt;
         Regular expressions&lt;br /&gt;
&lt;br /&gt;
           $ expr &amp;quot;a3&amp;quot; : [a-z][1-9]&lt;br /&gt;
           2&lt;br /&gt;
&lt;br /&gt;
         Or you can get a bit fancy&lt;br /&gt;
&lt;br /&gt;
           $ myexpr=&amp;quot;[a-z][1-9]&amp;quot;&lt;br /&gt;
           $ echo $myexpr&lt;br /&gt;
           [a-z][1-9]&lt;br /&gt;
&lt;br /&gt;
           $ expr &amp;quot;a3&amp;quot; : $myexpr&lt;br /&gt;
           2&lt;br /&gt;
&lt;br /&gt;
         This may not be the best way to find out if it is Friday, but&lt;br /&gt;
         it seems to work. It's more of an exercise in xargs.&lt;br /&gt;
&lt;br /&gt;
           $ date&lt;br /&gt;
           Fri Dec 31 16:44:47 EST 2004&lt;br /&gt;
           $ date|xargs -i expr {} : &amp;quot;[Fri]&amp;quot;&lt;br /&gt;
           1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 116:&lt;br /&gt;
&lt;br /&gt;
        eval&lt;br /&gt;
&lt;br /&gt;
           $ mypipe=&amp;quot;|&amp;quot;&lt;br /&gt;
           $ eval ls $mypipe wc&lt;br /&gt;
           6       6     129&lt;br /&gt;
&lt;br /&gt;
        Did you catch that? The above statement is the same as&lt;br /&gt;
&lt;br /&gt;
           $ ls | wc&lt;br /&gt;
&lt;br /&gt;
        Where &amp;quot;|&amp;quot; is put into the variable $mypipe&lt;br /&gt;
&lt;br /&gt;
        (also see TIP 118)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 117:&lt;br /&gt;
&lt;br /&gt;
        lxr, glimpse, patchset - tools for reading the kernel source&lt;br /&gt;
&lt;br /&gt;
          This example puts some of the files in /home/src since my home&lt;br /&gt;
          partition is the largest. Plus, you do not want to over write&lt;br /&gt;
          the source in /usr/src/ If you want to put your files elsewhere&lt;br /&gt;
          just substitute /home/src for your desired directory.&lt;br /&gt;
&lt;br /&gt;
         patchset -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ export SRCDIR=/home/src&lt;br /&gt;
            $ cd $SRCDIR&lt;br /&gt;
            $ wget http://www.csn.ul.ie/~mel/projects/patchset/patchset-0.5.tar.gz&lt;br /&gt;
            $ export PATH=$PATH:$SRCDIR/patchset-0.5/bin&lt;br /&gt;
&lt;br /&gt;
          Now edit &amp;quot;/home/src/patchset-0.5/etc/patchset.conf&amp;quot; and set WWW_USER to&lt;br /&gt;
          whatever your website runs as&lt;br /&gt;
&lt;br /&gt;
                  export WWW_USER=nobody&lt;br /&gt;
&lt;br /&gt;
          Getting kernel source. The last step builds and asks a lot of questions. Enter&lt;br /&gt;
          yes to things that interest you, since this is what you will see in the source&lt;br /&gt;
          code. It is not going to build for booting. The &amp;quot;downlaod -p&amp;quot; is for downloading&lt;br /&gt;
          a patch.&lt;br /&gt;
&lt;br /&gt;
            $ download 2.6.10&lt;br /&gt;
            $ createset 2.6.10&lt;br /&gt;
            $ make-kernel -b 2.6.10&lt;br /&gt;
&lt;br /&gt;
        glimpse -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ mkdir -p /home/src/glimpse&lt;br /&gt;
            $ cd /home/src/glimpse&lt;br /&gt;
            $ wget http://webglimpse.net/trial/glimpse-latest.tar.gz&lt;br /&gt;
            $ tar -xzf glimpse-latest.tar.gz&lt;br /&gt;
            $ cd glimpse-4.18.0&lt;br /&gt;
            $ ./configure; make&lt;br /&gt;
            $ make install&lt;br /&gt;
&lt;br /&gt;
        lxr -- download and setup&lt;br /&gt;
&lt;br /&gt;
            $ make -p /home/src/lxr&lt;br /&gt;
            $ cd /home/src/lxr&lt;br /&gt;
            $ wget http://heanet.dl.sourceforge.net/sourceforge/lxr/lxr-0.3.1.tar.gz&lt;br /&gt;
            $ cd lxr-0.3&lt;br /&gt;
&lt;br /&gt;
          Edit &amp;quot;Makefile&amp;quot; and set PERLBIN to &amp;quot;/usr/bin/perl&amp;quot; or the where perl is&lt;br /&gt;
          on your system. Also set INSTALLPREFIX to &amp;quot;/var/www/lxr&amp;quot;.  Then, as root&lt;br /&gt;
          do the following:&lt;br /&gt;
&lt;br /&gt;
            $ make install&lt;br /&gt;
&lt;br /&gt;
         Apache changes&lt;br /&gt;
&lt;br /&gt;
          Next edit the apache httpd.conf. On my system it is&lt;br /&gt;
          &amp;quot;/usr/local/apache2/conf/httpd.conf&amp;quot;, but if you did a fedora install&lt;br /&gt;
          I think this file is located at &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             Alias  /lxr/ &amp;quot;/var/www/lxr/&amp;quot;&lt;br /&gt;
             &amp;lt;Directory &amp;quot;/var/www/lxr/&amp;quot;&amp;gt;&lt;br /&gt;
               Options ExecCGI Indexes Includes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride all&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
&lt;br /&gt;
              &amp;lt;Files ~ (search|source|ident|diff|find)&amp;gt;&lt;br /&gt;
                    SetHandler cgi-script&lt;br /&gt;
              &amp;lt;/Files&amp;gt;&lt;br /&gt;
             &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          lxr - continued &amp;quot;/var/www/lxr/http/lxr.conf&amp;quot; changes.  The following contains&lt;br /&gt;
                my lxr.conf with changes made to almost every variable. Make sure you use&lt;br /&gt;
                your website in place of 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
                 # Configuration file.&lt;br /&gt;
                &lt;br /&gt;
                 # Define typed variable &amp;quot;v&amp;quot;, read valueset from file.&lt;br /&gt;
                 variable: v, Version, [/var/www/lxr/source/versions], [/var/www/lxr/source/defversion]&lt;br /&gt;
                &lt;br /&gt;
                 # Define typed variable &amp;quot;a&amp;quot;.  First value is default.&lt;br /&gt;
                 variable: a, Architecture, (i386, alpha, m68k, mips, ppc, sparc, sparc64)&lt;br /&gt;
                &lt;br /&gt;
                 # Define the base url for the LXR files.&lt;br /&gt;
                 baseurl: http://192.168.1.71/lxr/http/&lt;br /&gt;
                &lt;br /&gt;
                 # These are the templates for the HTML heading, directory listing and&lt;br /&gt;
                 # footer, respectively.&lt;br /&gt;
                 htmlhead: /var/www/lxr/http/template-head&lt;br /&gt;
                 htmltail: /var/www/lxr/http/template-tail&lt;br /&gt;
                 htmldir:  /var/www/lxr/http/template-dir&lt;br /&gt;
                &lt;br /&gt;
                 # The source is here.&lt;br /&gt;
                 sourceroot: /var/www/lxr/source/$v/&lt;br /&gt;
                 srcrootname: Linux&lt;br /&gt;
                &lt;br /&gt;
                 # &amp;quot;#include &amp;lt;foo.h&amp;gt;&amp;quot; is mapped to this directory (in the LXR source&lt;br /&gt;
                 # tree)&lt;br /&gt;
                 incprefix: /include&lt;br /&gt;
                &lt;br /&gt;
                 # The database files go here.&lt;br /&gt;
                 dbdir: /var/www/lxr/source/$v/&lt;br /&gt;
                &lt;br /&gt;
                 # Glimpse can be found here.&lt;br /&gt;
                 glimpsebin: /usr/local/bin/glimpse&lt;br /&gt;
                &lt;br /&gt;
                 # The power of regexps.  This is pretty Linux-specific, but quite&lt;br /&gt;
                 # useful.  Tinker with it and see what it does.  (How's that for&lt;br /&gt;
                 # documentation?)&lt;br /&gt;
                 map: /include/asm[^\/]*/ /include/asm-$a/&lt;br /&gt;
                 map: /arch/[^\/]+/ /arch/$a/&lt;br /&gt;
&lt;br /&gt;
         Now you should be ready to run &amp;quot;make-lxr&amp;quot;. Make sure the path is setup to patchset,&lt;br /&gt;
         which is repeated here. The last step take awhile.&lt;br /&gt;
&lt;br /&gt;
            $ export SRCDIR=/home/src&lt;br /&gt;
            $ cd $SRCDIR&lt;br /&gt;
            $ export PATH=$PATH:$SRCDIR/patchset-0.5/bin&lt;br /&gt;
&lt;br /&gt;
            $  make-lxr 2.6.10&lt;br /&gt;
&lt;br /&gt;
         Now you need to index the source. Below the ./glimpse_* file will be put in&lt;br /&gt;
         root. Checkout the -H option if you do not want them here on a temporary&lt;br /&gt;
         bases of if you run out of room.&lt;br /&gt;
&lt;br /&gt;
            $ glimpseindex -o -t -w 5000 /var/www/lxr/source/2.6.10 &amp;gt;&amp;amp; .glimpse_out&lt;br /&gt;
&lt;br /&gt;
         Since the above put the files under /root/.glimpse_* they should be moved&lt;br /&gt;
&lt;br /&gt;
            $ mv /root/.glimps_* /var/www/lxr/source/2.6.10/.&lt;br /&gt;
            $ chown -R nobody.nobody ./.glimpse_*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 118:&lt;br /&gt;
&lt;br /&gt;
        exec - you can change standard output and input without starting a new&lt;br /&gt;
               process.&lt;br /&gt;
&lt;br /&gt;
          The exec redirect the output from ls and date to a file. Nothing&lt;br /&gt;
          is show on the terminal until &amp;quot;exec &amp;gt; /dev/tty&amp;quot; is performed&lt;br /&gt;
&lt;br /&gt;
            $ exec &amp;gt; mfile&lt;br /&gt;
            $ ls&lt;br /&gt;
            $ date&lt;br /&gt;
            $ exec &amp;gt; /dev/tty&lt;br /&gt;
&lt;br /&gt;
          This is an example of assigning file descriptor 3 to file &amp;quot;output3&amp;quot; for&lt;br /&gt;
          output, then, redirecting &amp;quot;ls&amp;quot; to this descriptor. Finally, file descriptor&lt;br /&gt;
          3 is used for input, and the contents are read into the cat command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
            $ exec 3&amp;gt;output3&lt;br /&gt;
            $ ls  &amp;gt;&amp;amp; 3&lt;br /&gt;
            $ exec 3&amp;lt;output3&lt;br /&gt;
            $ cat &amp;lt;&amp;amp;3&lt;br /&gt;
            ChangeLog&lt;br /&gt;
            CVS&lt;br /&gt;
            How_to_Linux_and_Open_Source.txt&lt;br /&gt;
            How_to_Linux_and_Open_Source.txt.~1.193.~&lt;br /&gt;
            mfile&lt;br /&gt;
            mfile2&lt;br /&gt;
            mfile3&lt;br /&gt;
            mftp&lt;br /&gt;
            output3&lt;br /&gt;
&lt;br /&gt;
        Could you redirect the output to 3 files and stderr?&lt;br /&gt;
&lt;br /&gt;
            $ exec 3&amp;gt;output3&lt;br /&gt;
            $ exec 4&amp;gt;output4&lt;br /&gt;
            $ exec 5&amp;gt;output5&lt;br /&gt;
&lt;br /&gt;
            $ ls &amp;gt;&amp;amp; 3 &amp;gt;&amp;amp; 4 &amp;gt;&amp;amp; 5 &amp;gt;&amp;amp; 2   // Nope, can't do this.&lt;br /&gt;
            output3  output4  output5&lt;br /&gt;
&lt;br /&gt;
         Instead, you should do the following:&lt;br /&gt;
&lt;br /&gt;
            $ ls | tee output3 | tee output4 |tee output5&lt;br /&gt;
&lt;br /&gt;
         Closing the &amp;quot;output&amp;quot; file descriptor&lt;br /&gt;
&lt;br /&gt;
            $ &amp;gt;&amp;amp;3-&lt;br /&gt;
&lt;br /&gt;
         Closing the &amp;quot;input&amp;quot; file descriptor&lt;br /&gt;
&lt;br /&gt;
            $ 3&amp;lt;&amp;amp;-&lt;br /&gt;
&lt;br /&gt;
         See what is still open on 0-10&lt;br /&gt;
&lt;br /&gt;
            $ lsof -a -p $$ -d 0-10&lt;br /&gt;
&lt;br /&gt;
         Recursion - the following counts to 5, then, quits.&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
            sleep 1&lt;br /&gt;
            declare -x n&lt;br /&gt;
            let n=${n:=0}+1&lt;br /&gt;
            [ $n -le 5 ] &amp;amp;&amp;amp; echo &amp;quot;$n&amp;quot; &amp;amp;&amp;amp;  exec $0&lt;br /&gt;
&lt;br /&gt;
         There are some real-life applications for this technique, as follows:&lt;br /&gt;
&lt;br /&gt;
            #!/bin/bash&lt;br /&gt;
            declare -x N&lt;br /&gt;
            declare -x n&lt;br /&gt;
            N=${N:=$(od -vAn -N1 -tu4 &amp;lt; /dev/urandom)}&lt;br /&gt;
            let n=${n:=0}+1&lt;br /&gt;
            [ $(($n%2)) -eq 0 ] &amp;amp;&amp;amp; echo &amp;quot;She Loves Me!&amp;quot; || echo &amp;quot;She Loves Me NOT!&amp;quot;&lt;br /&gt;
            [ $n -lt $N ] &amp;amp;&amp;amp;  exec $0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 119:&lt;br /&gt;
&lt;br /&gt;
        runlevel - need to know the current runlevel?&lt;br /&gt;
&lt;br /&gt;
           $ who -r&lt;br /&gt;
           run-level 3  Dec 31 19:02                   last=S&lt;br /&gt;
&lt;br /&gt;
        Need to know the architecture?&lt;br /&gt;
&lt;br /&gt;
          $ arch&lt;br /&gt;
          i686&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 120:&lt;br /&gt;
&lt;br /&gt;
        at - executes commands at a specified time.&lt;br /&gt;
&lt;br /&gt;
         A few examples here. The 1970 program will run&lt;br /&gt;
         next Auguest 2 even though the year 1970 has long past.&lt;br /&gt;
&lt;br /&gt;
          $ at 6:30am Jan 12 &amp;lt; program&lt;br /&gt;
          $ at noon tomorrow &amp;lt; program&lt;br /&gt;
          $ at 1970 pm August 2 &amp;lt; program&lt;br /&gt;
&lt;br /&gt;
        This is an interactive way to use the command:&lt;br /&gt;
&lt;br /&gt;
          $ at now + 6 minutes&lt;br /&gt;
          warning: commands will be executed using (in order) a) $SHELL b) login shell c) /bin/sh&lt;br /&gt;
          at&amp;gt; ls&lt;br /&gt;
          at&amp;gt; date &amp;gt; /tmp/5min&lt;br /&gt;
          at&amp;gt; ^D&lt;br /&gt;
          job 3 at 2005-01-01 08:50&lt;br /&gt;
&lt;br /&gt;
        What jobs are in the queue?&lt;br /&gt;
&lt;br /&gt;
          $ atq&lt;br /&gt;
&lt;br /&gt;
        or&lt;br /&gt;
&lt;br /&gt;
          $ at -l&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 121:&lt;br /&gt;
&lt;br /&gt;
        Creating a Manpage&lt;br /&gt;
&lt;br /&gt;
         As root you can copy the following to /usr/local/man/man1/soup.1 which will&lt;br /&gt;
         give you a manpage for soup.&lt;br /&gt;
&lt;br /&gt;
              .\&amp;quot; Manpage for souptonuts.&lt;br /&gt;
              .\&amp;quot; Contact mchirico@users.sourceforge.com to correct errors or omissions.&lt;br /&gt;
              .TH man 1 &amp;quot;04 January 2005&amp;quot; &amp;quot;1.0&amp;quot; &amp;quot;souptonuts man page&amp;quot;&lt;br /&gt;
              .SH NAME&lt;br /&gt;
              soup \- man page for souptonuts&lt;br /&gt;
              .SH SYNOPSIS&lt;br /&gt;
              soup&lt;br /&gt;
              .SH DESCRIPTION&lt;br /&gt;
              souptonuts is a collection of linux and open&lt;br /&gt;
              source tips.&lt;br /&gt;
              off for golf.&lt;br /&gt;
              .SH OPTIONS&lt;br /&gt;
              The souptonuts does not take any options.&lt;br /&gt;
              .SH SEE ALSO&lt;br /&gt;
              doughnut(1), golf(8)&lt;br /&gt;
              .SH BUGS&lt;br /&gt;
              No known bugs at this time.&lt;br /&gt;
              .SH AUTHOR&lt;br /&gt;
              Mike Chirico (mchirico@comcast.net mchirico@users.sourceforge.net)&lt;br /&gt;
&lt;br /&gt;
         So, to view this man page&lt;br /&gt;
&lt;br /&gt;
            $ man soup&lt;br /&gt;
&lt;br /&gt;
         It's also possible to compress&lt;br /&gt;
&lt;br /&gt;
            $ gzip /usr/local/man/man1/soup.1&lt;br /&gt;
&lt;br /&gt;
         For plenty of examples look at the other man pages. Also the following&lt;br /&gt;
         is helpful. The last one is a tutorial &amp;quot;man 7 mdoc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            $ man manpath&lt;br /&gt;
            $ man groff&lt;br /&gt;
            $ man 7 mdoc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 122:&lt;br /&gt;
&lt;br /&gt;
        dmesg - print out boot messages, or what is in the kernel ring buffer.&lt;br /&gt;
&lt;br /&gt;
          If you missed the messages on boot-up, you can use dmesg to print them.&lt;br /&gt;
&lt;br /&gt;
            $ dmesg &amp;gt; boot.msg&lt;br /&gt;
&lt;br /&gt;
          Or to print, then, clear the ring&lt;br /&gt;
&lt;br /&gt;
            # dmesg -c &amp;gt; boot.msg&lt;br /&gt;
&lt;br /&gt;
          (also see TIP 20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 123:&lt;br /&gt;
&lt;br /&gt;
        gnus - emacs email nntp news reader (comcast as example with NO TLS or SSL)&lt;br /&gt;
&lt;br /&gt;
          First check that you can connect to the news group:&lt;br /&gt;
&lt;br /&gt;
                 $ telnet newsgroups.comcast.net 119&lt;br /&gt;
                 Trying 216.196.97.136...&lt;br /&gt;
                 Connected to newsgroups.comcast.net.&lt;br /&gt;
                 Escape character is '^]'.&lt;br /&gt;
                 200 News.GigaNews.Com&lt;br /&gt;
&lt;br /&gt;
          If you want to check for TLS or SSL see (TIP 54).&lt;br /&gt;
&lt;br /&gt;
          Here is a very simple configuration example without encryption. It&lt;br /&gt;
          appears that comcast does not support ssl or TLS.&lt;br /&gt;
&lt;br /&gt;
          In the &amp;quot;~/.emacs&amp;quot; file you would add the following to get comcast&lt;br /&gt;
          news groups&lt;br /&gt;
&lt;br /&gt;
             (setq gnus-select-method '(nntp &amp;quot;newsgroups.comcast.net&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
          Then, create an &amp;quot;~/.authinfo&amp;quot; file with the following settings using&lt;br /&gt;
          you own username and password.&lt;br /&gt;
&lt;br /&gt;
             machine newsgroups.comcast.net login borkey@comcast.net  password borkeypass0rd&lt;br /&gt;
&lt;br /&gt;
          Next create a &amp;quot;~/.newsrc&amp;quot; with your groups&lt;br /&gt;
&lt;br /&gt;
             news.announce.newusers:&lt;br /&gt;
             comp.lang.c++.moderated! 1-500&lt;br /&gt;
             comp.unix.programmer! 1-500&lt;br /&gt;
             comp.unix.shell! 1-500&lt;br /&gt;
             gnu.emacs.gnus! 1-500&lt;br /&gt;
&lt;br /&gt;
          Finally, create a &amp;quot;~/.gnus&amp;quot; with the following email settings for you&lt;br /&gt;
&lt;br /&gt;
             (setq user-mail-address &amp;quot;mchirico@comcast.net&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
             (defun my-message-mode-setup ()&lt;br /&gt;
               (setq fill-column 72)&lt;br /&gt;
               (turn-on-auto-fill))&lt;br /&gt;
               (add-hook 'message-mode-hook 'my-message-mode-setup)&lt;br /&gt;
&lt;br /&gt;
          To get into gnus&lt;br /&gt;
&lt;br /&gt;
              E-x gnus&lt;br /&gt;
&lt;br /&gt;
          The following are common gnus commands&lt;br /&gt;
&lt;br /&gt;
                RET  view the article under the cursor&lt;br /&gt;
&lt;br /&gt;
                A A (shift-a, shift a): List all newsgroups known&lt;br /&gt;
                                        to the server.&lt;br /&gt;
&lt;br /&gt;
                l (lower-case L)      : List only  subscribed groups&lt;br /&gt;
                                        with unread articles.&lt;br /&gt;
&lt;br /&gt;
                L                     : List all newsgroups in .newsrc file.&lt;br /&gt;
&lt;br /&gt;
                g                     : See if new articles have arrived.&lt;br /&gt;
&lt;br /&gt;
            Some commands for reading&lt;br /&gt;
&lt;br /&gt;
                n  next unread article&lt;br /&gt;
&lt;br /&gt;
                p  previous article&lt;br /&gt;
&lt;br /&gt;
                SPC  scroll down  moves to next unread&lt;br /&gt;
                     when at the bottom of the article&lt;br /&gt;
&lt;br /&gt;
                del  scroll up&lt;br /&gt;
&lt;br /&gt;
                F  follow-up to group on the article you are&lt;br /&gt;
                   reading now.&lt;br /&gt;
&lt;br /&gt;
                f  follow-up to group without citing the article&lt;br /&gt;
&lt;br /&gt;
                R  reply by mail and cite the article&lt;br /&gt;
&lt;br /&gt;
                r  reply by mail without citing the article&lt;br /&gt;
&lt;br /&gt;
                m  new mail&lt;br /&gt;
&lt;br /&gt;
                a  new posting&lt;br /&gt;
&lt;br /&gt;
                c  Catchup&lt;br /&gt;
&lt;br /&gt;
                C-u / t  Show only young headers&lt;br /&gt;
                         / t without C-u limits the summary&lt;br /&gt;
                         to old headers&lt;br /&gt;
&lt;br /&gt;
                T T  toggle threading&lt;br /&gt;
&lt;br /&gt;
                C-u g  Display raw article&lt;br /&gt;
                       hit g to return to normal view&lt;br /&gt;
&lt;br /&gt;
                t  Show all headers  it's a toggle&lt;br /&gt;
&lt;br /&gt;
                W w  Wordwrap the current article&lt;br /&gt;
&lt;br /&gt;
                W r  Decode ROT13  a toggle&lt;br /&gt;
&lt;br /&gt;
                ^  fetch parent of article&lt;br /&gt;
&lt;br /&gt;
                L  create a scorefile-entry based&lt;br /&gt;
                   on the current article (low score)&lt;br /&gt;
                   ? gives you information what each char means&lt;br /&gt;
&lt;br /&gt;
                I  like L but high score&lt;br /&gt;
&lt;br /&gt;
          Commands to send email&lt;br /&gt;
&lt;br /&gt;
            C-c C-c  send message&lt;br /&gt;
&lt;br /&gt;
            C-c C-d  save message as draft&lt;br /&gt;
&lt;br /&gt;
            C-c C-k  kill message&lt;br /&gt;
&lt;br /&gt;
            C-c C-m f  attach file&lt;br /&gt;
&lt;br /&gt;
            M-q  reformat paragraph&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 124:&lt;br /&gt;
&lt;br /&gt;
        Sending Email from telnet&lt;br /&gt;
&lt;br /&gt;
           Note, if you are on the computer you can sometime use the local loopback.&lt;br /&gt;
           In fact, sometimes you can only use the local loop back 127.0.0.1 in&lt;br /&gt;
           place of &amp;quot;bozo.company.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            1     [mchirico@soup Notes]$ telnet bozo.company.com 25&lt;br /&gt;
            2     Trying 192.168.0.204...&lt;br /&gt;
            3     Connected to bozo.company.com.&lt;br /&gt;
            4     Escape character is '^]'.&lt;br /&gt;
            5     220 bozo.company.com ESMTP Postfix (Postfix-20010228-pl03) (Mandrake Linux)&lt;br /&gt;
            6     HELO fakedomain.com&lt;br /&gt;
            7     HELO fakedomain.com         // server echo&lt;br /&gt;
            8     250 bozo.company.com&lt;br /&gt;
            9     MAIL FROM: test@fakedomain.com&lt;br /&gt;
           10     MAIL FROM: test@fakedomain.com   // server echo&lt;br /&gt;
           11     250 Ok&lt;br /&gt;
           12     RCPT TO: mchirico@someother.com&lt;br /&gt;
           13     RCPT TO: mchirico@someother.com   // server echo&lt;br /&gt;
           14     250 Ok&lt;br /&gt;
           15     DATA&lt;br /&gt;
           16     DATA    // echo&lt;br /&gt;
           17     354 Enter mail, end with &amp;quot;.&amp;quot; on a line by itself&lt;br /&gt;
           18     This is a test message&lt;br /&gt;
           19     This is a test message&lt;br /&gt;
           20     to send&lt;br /&gt;
           21     to send&lt;br /&gt;
           22     .&lt;br /&gt;
           23     250 2.0.0 j0B0uH3L018469 Message accepted for delivery&lt;br /&gt;
&lt;br /&gt;
          Above on line 6 you can type in any domain name. Line 7 is an echo. All&lt;br /&gt;
          echos are listed in the comment field.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 125:&lt;br /&gt;
&lt;br /&gt;
          IP forwarding, IP Masquerade&lt;br /&gt;
&lt;br /&gt;
             # echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
             # ipchains -F forward&lt;br /&gt;
             # ipchains -P forward DENY&lt;br /&gt;
             # ipchains -A forward -s 192.168.0.0/24 -j MASQ&lt;br /&gt;
             # ipchains -A forward -i eth1 -j MASQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          This assumes that your internal network is 192.168.0.0 on eth1, and the&lt;br /&gt;
          internet is connected to eth0.&lt;br /&gt;
&lt;br /&gt;
          (Also See TIP 182)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 126:&lt;br /&gt;
&lt;br /&gt;
         Setting KDE as the default desktop manager&lt;br /&gt;
&lt;br /&gt;
               Edit &amp;quot;/etc/sysconfig/desktop&amp;quot; to include the two lines:&lt;br /&gt;
&lt;br /&gt;
                 DESKTOP=&amp;quot;KDE&amp;quot;&lt;br /&gt;
                 DISPLAYMANAGER=&amp;quot;KDE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 127:&lt;br /&gt;
&lt;br /&gt;
        Have a file and you do not know whay type it is (tar, gz, ASCII, binary) ?&lt;br /&gt;
        Use the file command.  Below it is used on the file &amp;quot;mftp&amp;quot;&lt;br /&gt;
&lt;br /&gt;
               $ file mftp&lt;br /&gt;
               mftp: Bourne-Again shell script text executable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 128:&lt;br /&gt;
&lt;br /&gt;
        Software RAID: Two good references&lt;br /&gt;
&lt;br /&gt;
          http://www.tldp.org/HOWTO/Software-RAID-HOWTO-1.html&lt;br /&gt;
          http://lists.us.dell.com/pipermail/linux-poweredge/2003-July/014331.html&lt;br /&gt;
&lt;br /&gt;
        Note, you must setup grub for each RAID 1 device. Suppose you have&lt;br /&gt;
        2 SCSI drives (sda and sdb). By default grub is setup on sda; but, you&lt;br /&gt;
        need to enable it for sdb (/dev/hdb for ide) as follows:&lt;br /&gt;
&lt;br /&gt;
           grub&amp;gt;device (hd0) /dev/sdb&lt;br /&gt;
           grub&amp;gt;root (hd0,0)&lt;br /&gt;
           grub&amp;gt;setup (hd0)&lt;br /&gt;
&lt;br /&gt;
           Checking if &amp;quot;/boot/grub/stage1&amp;quot; exists... no&lt;br /&gt;
           Checking if &amp;quot;/grub/stage1&amp;quot; exists... yes&lt;br /&gt;
           Checking if &amp;quot;/grub/stage2&amp;quot; exists... yes&lt;br /&gt;
           Checking if &amp;quot;/grub/e2fs_stage1_5&amp;quot; exists.. yes&lt;br /&gt;
           Running &amp;quot;embed /grub/e2fs_stage1_5 (hd0)&amp;quot;... 16 sectors are embedded.&lt;br /&gt;
          succeeded&lt;br /&gt;
           Running &amp;quot;install /grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/grub/stage2 /grub/grub&lt;br /&gt;
         .conf&amp;quot;... succeeded.&lt;br /&gt;
         Done.&lt;br /&gt;
&lt;br /&gt;
          grub&amp;gt;&lt;br /&gt;
          grub&amp;gt;quit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Checking to see if everything is working:&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
        Checking the drives&lt;br /&gt;
&lt;br /&gt;
          $ sfdisk -d /dev/sdb&lt;br /&gt;
          $ sfdisk -d /dev/sda&lt;br /&gt;
&lt;br /&gt;
          $ fdisk -l /dev/sda  &amp;quot;This will give general information&amp;quot;&lt;br /&gt;
          $ fdisk -l           &amp;quot;General information for all drives&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Adding raid (assume you want to add the first drive &amp;quot;sda1&amp;quot;, or if it is the second&lt;br /&gt;
                    drive then substitute &amp;quot;sda2&amp;quot; below )&lt;br /&gt;
&lt;br /&gt;
          $ raidhotadd /dev/md0 /dev/sda1&lt;br /&gt;
          $ raidhotadd /dev/md1 /dev/sda2&lt;br /&gt;
          $ raidhotadd /dev/md2 /dev/sda3&lt;br /&gt;
&lt;br /&gt;
        This is an example of an cat /proc/mdstat that is working. Note that&lt;br /&gt;
        there is a listing for both sda1[0] and sdb1[1]&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
                Personalities : [raid1]&lt;br /&gt;
                read_ahead 1024 sectors&lt;br /&gt;
                Event: 12&lt;br /&gt;
                md0 : active raid1 sda1[0] sdb1[1]&lt;br /&gt;
                      104320 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md1 : active raid1 sda2[0] sdb2[1]&lt;br /&gt;
                      1044160 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md2 : active raid1 sda3[0] sdb3[1]&lt;br /&gt;
                      34411136 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        Compare that to this where md2 is missing sdb3&lt;br /&gt;
&lt;br /&gt;
            $ cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
                Personalities : [raid1]&lt;br /&gt;
                read_ahead 1024 sectors&lt;br /&gt;
                Event: 9&lt;br /&gt;
                md0 : active raid1 sda1[0] sdb1[1]&lt;br /&gt;
                      104320 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md1 : active raid1 sda2[0] sdb2[1]&lt;br /&gt;
                      1044160 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
                md2 : active raid1 sdb3[1]        &amp;lt;---- HERE&lt;br /&gt;
                      34411136 blocks [2/1] [_U]&lt;br /&gt;
&lt;br /&gt;
                unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        If you are rebuilding an array, you can watch it by doing the following:&lt;br /&gt;
&lt;br /&gt;
           $ watch -n1 cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
        Need to know the raid setup?&lt;br /&gt;
&lt;br /&gt;
           $ cat /etc/raidtab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 129:&lt;br /&gt;
&lt;br /&gt;
        Resetting Redhat Linux Passwords using GRUB&lt;br /&gt;
&lt;br /&gt;
           1. Press 'e'&lt;br /&gt;
           2. Press 'e' again&lt;br /&gt;
           3. Append 'single' to the kernel version listing&lt;br /&gt;
&lt;br /&gt;
          See&lt;br /&gt;
             http://linuxgazette.net/107/tomar.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 130:&lt;br /&gt;
&lt;br /&gt;
        mtr - matt's traceroute. This is an advanced traceroute that keeps&lt;br /&gt;
              [http://www.bitwizard.nl/mtr/]&lt;br /&gt;
                  $ mtr www.yahoo.com&lt;br /&gt;
&lt;br /&gt;
                                              Matt's traceroute  [v0.52]&lt;br /&gt;
                     third-fl-71.localdomain                            Thu Jan 20 11:05:57 2005&lt;br /&gt;
                     Keys:  D - Display mode    R - Restart statistics    Q - Quit&lt;br /&gt;
                                                            Packets               Pings&lt;br /&gt;
                     Hostname                            %Loss  Rcv  Snt  Last Best  Avg  Worst&lt;br /&gt;
                      1. 192.168.1.1                        0%    3    3     0    0    0      1&lt;br /&gt;
                      2. ???&lt;br /&gt;
                      3. fe-2-6-rr01.willogrove5.pa.pa01    0%    3    3     8    7    7      8&lt;br /&gt;
                      4. srp-8-1-ar01.willowgrove1.pa.pa    0%    2    2     8    8    8      8&lt;br /&gt;
                      5. pos7-3-cr01.torresdale.pa.core.    0%    2    2     8    8    8      8&lt;br /&gt;
                      6. 12.119.53.53                       0%    2    2    12   12   12     13&lt;br /&gt;
                      7. tbr1-p012401.phlpa.ip.att.net      0%    2    2    12   12   13     13&lt;br /&gt;
                      8. tbr1-cl8.n54ny.ip.att.net          0%    2    2    13   13   13     13&lt;br /&gt;
                      9. ggr2-p310.n54ny.ip.att.net         0%    2    2    12   12   13     14&lt;br /&gt;
                     10. so-1-0-0.gar4.NewYork1.Level3.n    0%    2    2    14   14   37     61&lt;br /&gt;
                     11. ae-1-54.bbr2.NewYork1.Level3.ne    0%    2    2    13   12   13     13&lt;br /&gt;
                     12. ge-0-3-0.bbr2.Washington1.Level    0%    2    2    19   19   19     19&lt;br /&gt;
                     13. ge-1-1-51.car1.Washington1.Leve    0%    2    2    18   18   19     20&lt;br /&gt;
                     14. 4.79.228.6                         0%    2    2    21   19   20     21&lt;br /&gt;
                     15. UNKNOWN-216-109-120-201.yahoo.c    0%    2    2    21   20   20     21&lt;br /&gt;
                     16. w2.rc.vip.dcn.yahoo.com            0%    2    2    23   21   22     23&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 131:&lt;br /&gt;
&lt;br /&gt;
        chfn - change finger information&lt;br /&gt;
&lt;br /&gt;
            $ chfn&lt;br /&gt;
&lt;br /&gt;
          Next you are asked for a password and user information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 132:&lt;br /&gt;
&lt;br /&gt;
        chsh - change login shell&lt;br /&gt;
&lt;br /&gt;
          First, you may want to get a listing of all the possible&lt;br /&gt;
          shells.&lt;br /&gt;
&lt;br /&gt;
             $ chsh -l&lt;br /&gt;
&lt;br /&gt;
               /bin/sh&lt;br /&gt;
               /bin/bash&lt;br /&gt;
               /sbin/nologin&lt;br /&gt;
               /bin/ash&lt;br /&gt;
               /bin/bsh&lt;br /&gt;
               /bin/ksh&lt;br /&gt;
               /usr/bin/ksh&lt;br /&gt;
               /usr/bin/pdksh&lt;br /&gt;
               /bin/tcsh&lt;br /&gt;
               /bin/csh&lt;br /&gt;
               /bin/zsh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 133:&lt;br /&gt;
&lt;br /&gt;
        bash - working with binary, hex and base 3.&lt;br /&gt;
&lt;br /&gt;
         For the variable must be declare as an integer. Then&lt;br /&gt;
         specify the  &amp;lt;base&amp;gt;#&amp;lt;value&amp;gt;. The example below is 22 in&lt;br /&gt;
         base 3.&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n&lt;br /&gt;
              $ n=3#22&lt;br /&gt;
              $ echo $n&lt;br /&gt;
                8&lt;br /&gt;
&lt;br /&gt;
           Base 16 (hex)&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n2&lt;br /&gt;
              $ n2=16#a&lt;br /&gt;
              $ echo $n2&lt;br /&gt;
                10&lt;br /&gt;
&lt;br /&gt;
           Base 8 (octal)&lt;br /&gt;
&lt;br /&gt;
              $ declare -i n3&lt;br /&gt;
              $ n3=8#11&lt;br /&gt;
              $ echo $n3&lt;br /&gt;
                9   Note 8+1=9&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 134:&lt;br /&gt;
&lt;br /&gt;
        monitoring IP traffic. Try iptraf http://iptraf.seul.org/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 135:&lt;br /&gt;
&lt;br /&gt;
        enscript - convert text files to PostScript&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 136:&lt;br /&gt;
&lt;br /&gt;
        dd and tar - blocking factor. How to determine the blocking factor, block size&lt;br /&gt;
                   so that tar and dd can work together.&lt;br /&gt;
&lt;br /&gt;
        Step 1: Create a large file on local disk, in a directory &amp;quot;1&amp;quot; that will eventually&lt;br /&gt;
                be written to tape. This will be created with dd as follows:&lt;br /&gt;
&lt;br /&gt;
                $ mkdir 1&lt;br /&gt;
                $ dd if=/dev/zero of=disk-image count=40960&lt;br /&gt;
                  40960+0 records in&lt;br /&gt;
                  40960+0 records out&lt;br /&gt;
&lt;br /&gt;
                $ cd ..&lt;br /&gt;
&lt;br /&gt;
        Step 2: tar the directory and contents to tape. First rewind the tape. These examples&lt;br /&gt;
                use /dev/nst0 as the location of the tape. Make sure to substitute your values&lt;br /&gt;
                if needed.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ tar --label=&amp;quot;Test 1&amp;quot; --create --blocking-factor=128 --file=/dev/nst0 1&lt;br /&gt;
&lt;br /&gt;
        Step 3: Read data from the tape using a block size of 128k. If you get an I/O error, which&lt;br /&gt;
                could happend if you used a different blocking factor above, then, you may need&lt;br /&gt;
                to increase the bs to 256, or 512 etc. as needed.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=/dev/nst0 bs=128k of=testblocksz count=1&lt;br /&gt;
                 0+1 records in&lt;br /&gt;
                 0+1 records out&lt;br /&gt;
&lt;br /&gt;
                $ ls -l testblocksz&lt;br /&gt;
                 -rw-r--r--    1 root     root        65536 Feb  9 10:41 testblocksz&lt;br /&gt;
&lt;br /&gt;
                $ ls -lh testblocksz&lt;br /&gt;
                 -rw-r--r--    1 root     root          64k Feb  9 10:41 testblocksz&lt;br /&gt;
&lt;br /&gt;
               Note above that the size 65536 is equal to 64k. That &amp;quot;h&amp;quot; switch in &amp;quot;ls&amp;quot; is for&lt;br /&gt;
               human readable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 4: tar uses a multiplier of 512*blocking-factor to get block size. Again&lt;br /&gt;
&lt;br /&gt;
                 512 * blocking-factor = block size used in dd command.&lt;br /&gt;
&lt;br /&gt;
              Putting in the values, we see that&lt;br /&gt;
&lt;br /&gt;
                 512 * 128 = 65536&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 5: So what does this tell you? You can now use these numbers to &amp;quot;dd&amp;quot; files&lt;br /&gt;
              to tape. But, first tar will be used to create the file locally.&lt;br /&gt;
&lt;br /&gt;
                $ tar --label=&amp;quot;Test 1&amp;quot; --create --blocking-factor=128 --file=test.tar 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 6: Send this to tape with the dd command. Remember 64k is equal to 65536.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=test.tar bs=64k of=/dev/nst0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 7: Now test that it can be read with tar command using blocking-factor=128.&lt;br /&gt;
             Note the &amp;quot;t&amp;quot; command in tar is for tell. It will not write data.&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ tar -tvf /dev/nst0 --blocking-factor=128&lt;br /&gt;
                 V--------- 0/0               0 2005-02-09 10:38:20 Test 1--Volume Header--&lt;br /&gt;
                 drwxr-xr-x root/root         0 2005-02-09 10:34:10 1/&lt;br /&gt;
                 -rw-r--r-- root/root  20971520 2005-02-09 10:34:11 1/disk-image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 8: Reading tape data with dd. Most of the time a high &amp;quot;ibs&amp;quot; input block size&lt;br /&gt;
&lt;br /&gt;
                $ mt -f /dev/nst0 rewind&lt;br /&gt;
                $ dd if=/dev/nst0 of=outfromdd.tar ibs=64k&lt;br /&gt;
                 321+0 records in&lt;br /&gt;
                 41088+0 records out&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Step 9: Verify that outfromdd.tar can be read by tar with blocking-factor=128&lt;br /&gt;
&lt;br /&gt;
                $ tar -tvf outfromdd.tar --blocking-factor=128&lt;br /&gt;
                 V--------- 0/0               0 2005-02-09 10:38:20 Test 1--Volume Header--&lt;br /&gt;
                 drwxr-xr-x root/root         0 2005-02-09 10:34:10 1/&lt;br /&gt;
                 -rw-r--r-- root/root  20971520 2005-02-09 10:34:11 1/disk-image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       PULLING FILES:  The dd command can be used to pull files.&lt;br /&gt;
&lt;br /&gt;
              ssh target_address dd if=remotefile | dd of=localfile&lt;br /&gt;
&lt;br /&gt;
           Or, a specific example of getting a file from a computer called hamlet.&lt;br /&gt;
&lt;br /&gt;
              $ ssh root@hamlet  dd if=/home/cvs/test | dd of=/home/storage/test&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        GOING BACKWARD AND FORWARD ON TAPE:&lt;br /&gt;
&lt;br /&gt;
             Go to end of data&lt;br /&gt;
              $ mt -f /dev/nst0  eod&lt;br /&gt;
&lt;br /&gt;
             Previous record&lt;br /&gt;
              $ mt -f /dev/nst0  bsfm 1&lt;br /&gt;
&lt;br /&gt;
             Forward record&lt;br /&gt;
              $ mt -f /dev/nst0  fsf 1&lt;br /&gt;
&lt;br /&gt;
             Rewind&lt;br /&gt;
              $ mt -f /dev/nst0 rewind&lt;br /&gt;
&lt;br /&gt;
             Tell&lt;br /&gt;
              $ mt -f /dev/nst0 tell&lt;br /&gt;
&lt;br /&gt;
         (Reference TIP 151 - for how to get around firewalls)&lt;br /&gt;
&lt;br /&gt;
         Below is a script that I use to backup computers via ssh. The&lt;br /&gt;
         tape drive is on &amp;quot;nis&amp;quot; and the extra space is on &amp;quot;hamlet&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                #!/bin/bash&lt;br /&gt;
                # Program to backup server remotely&lt;br /&gt;
                # Assume remote server is nis, you are on squeezel&lt;br /&gt;
                #&lt;br /&gt;
                # Recover from tape&lt;br /&gt;
                #&lt;br /&gt;
                #   dd if=/dev/nst0 of=test.tar.gz bs=64k&lt;br /&gt;
                #&lt;br /&gt;
                filename=&amp;quot;support1.$(date &amp;quot;+%m%d%y%H%M&amp;quot;).tar.gz&amp;quot;&lt;br /&gt;
                DIRTOBACKUP=/var/www&lt;br /&gt;
                #tar cvzf - $DIRTOBACKUP | ssh  root@nis  '(mt -f /dev/nst0 rewind; dd of=/dev/nst0 bs=64k )'&lt;br /&gt;
                tar cvzf - $DIRTOBACKUP | ssh  support1@hamlet &amp;quot;dd of=/home/support1/backups/${filename} &amp;quot;&lt;br /&gt;
&lt;br /&gt;
         Another example program, below, pushes the last &amp;quot;.tar.gz&amp;quot; file to tape:&lt;br /&gt;
&lt;br /&gt;
                #!/bin/bash&lt;br /&gt;
                # Program to push files to tape&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                # Notes on recovering from tape&lt;br /&gt;
                #&lt;br /&gt;
                #   dd if=/dev/nst0 of=test.tar.gz ibs=64k&lt;br /&gt;
                #    or&lt;br /&gt;
                #  $ ssh root@tapeserver &amp;quot;mt -f /dev/nst0 rewind&amp;quot;&lt;br /&gt;
                #  $ ssh root@tapeserver &amp;quot;dd if=/dev/nst0 ibs=64k&amp;quot;|dd of=cvs1.tar.gz&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                #&lt;br /&gt;
                # First rewind tape&lt;br /&gt;
                ssh root@tapeserver 'mt -f /dev/nst0 rewind'&lt;br /&gt;
                #&lt;br /&gt;
                # Grab only the last file&lt;br /&gt;
                file=$(find /home/cvs  -iname 'cvs*.tar.gz'|sort|tail -n 1)&lt;br /&gt;
                dd if=${file}|ssh root@tapeserver 'dd of=/dev/nst0 bs=64k'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 137:&lt;br /&gt;
&lt;br /&gt;
        Apache - redirecting pages. All changes are in httpd.conf&lt;br /&gt;
&lt;br /&gt;
               RedirectMatch (.*)\.gif$ http://www.anotherserver.com$1.jpg&lt;br /&gt;
&lt;br /&gt;
               Redirect /service http://foo2.bar.com/service&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 138:&lt;br /&gt;
&lt;br /&gt;
        samba mounts via ssh - mounting a samba share through an ssh tunnel, going&lt;br /&gt;
               through an intermediate computer, that accepts ssh. We'll call this&lt;br /&gt;
               intermediate computer middle [65.219.4.23], and we want to get to&lt;br /&gt;
               destination [192.168.0.81]. The user will be mchirico.&lt;br /&gt;
&lt;br /&gt;
          STEP 1:&lt;br /&gt;
&lt;br /&gt;
               $ mkdir -p /samba/share&lt;br /&gt;
&lt;br /&gt;
          STEP 2:&lt;br /&gt;
&lt;br /&gt;
            This has to be done as root, since we are using a lower port.&lt;br /&gt;
&lt;br /&gt;
               $ ssh -N -L 139:192.168.0.81:139 mchirico@65.219.4.23&lt;br /&gt;
&lt;br /&gt;
          STEP 3:&lt;br /&gt;
&lt;br /&gt;
              umount /samba/sales&lt;br /&gt;
              /bin/mount -t smbfs -o  username=donkey,workgroup=donkeydomain,&lt;br /&gt;
                      password=passw0rk1,port=139,dmask=770,fmask=660,&lt;br /&gt;
                      netbiosname=homecpu //localhost/share /samba/share&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 139:&lt;br /&gt;
&lt;br /&gt;
        Music on Fedora Core -- How to play music on http://magnatune.com with &amp;quot;xmms&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           The following command will show the sound driver:&lt;br /&gt;
&lt;br /&gt;
              $ lspci|grep -i audio&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          STEP 1:&lt;br /&gt;
&lt;br /&gt;
                Unmute amixer with the following command:&lt;br /&gt;
&lt;br /&gt;
              $ amixer set Master 100% unmute&lt;br /&gt;
              $ amixer set PCM 100%  unmute&lt;br /&gt;
&lt;br /&gt;
                Note you can also get a graphical interface with &amp;quot;alsamixer&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              $ alsamixer&lt;br /&gt;
&lt;br /&gt;
                 h,F1   -- for help&lt;br /&gt;
                 Esc    -- exit&lt;br /&gt;
                 Tab    -- move to selections&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          STEP 2:&lt;br /&gt;
&lt;br /&gt;
                Test a sound file &amp;quot;*.au&amp;quot; with aplay. To quickly find files on your system use&lt;br /&gt;
                the &amp;quot;locate *.au&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
                  $ aplay /usr/lib/python2.3/test/audiotest.au&lt;br /&gt;
&lt;br /&gt;
          STEP 3:&lt;br /&gt;
&lt;br /&gt;
                Install &amp;quot;xmms-mp3-1.2.10-9.2.1.fc3.rf.i386.rpm&amp;quot; which does not come with Fedora because&lt;br /&gt;
                of GPL license restrictions.  The latest version of this package can be found&lt;br /&gt;
                at the following url:&lt;br /&gt;
&lt;br /&gt;
                  http://rpmseek.com/rpm-pl/xmms-mp3.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                  $ rpm -ivh xmms-mp3-1.2.10-9.2.1.fc3.rf.i386.rpm&lt;br /&gt;
&lt;br /&gt;
          STEP 4:&lt;br /&gt;
&lt;br /&gt;
                Go to magnatun &amp;quot;http://magnatune.com/&amp;quot;, select genre and make sure xmms&lt;br /&gt;
                is the default player.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 140:&lt;br /&gt;
&lt;br /&gt;
        Routing -- getting access to a network 1 hop away. You are currently on the 192 network&lt;br /&gt;
                   and you want access to the 172.21.0.0 network that has a computer straddling&lt;br /&gt;
                   the two, with /proc/sys/net/ipv4/ip_forward set to 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               $ route add -net 172.21.0.0 netmask 255.255.255.0 gw 192.168.0.204&lt;br /&gt;
&lt;br /&gt;
         To undo:&lt;br /&gt;
&lt;br /&gt;
               $ route del -net 172.21.0.0 netmask 255.255.255.0 gw 192.168.0.204&lt;br /&gt;
&lt;br /&gt;
         Now you can ping 172.21.0.21.&lt;br /&gt;
&lt;br /&gt;
         Does not work?&lt;br /&gt;
&lt;br /&gt;
         Go on to 192.168.0.204 and execute the following commands:&lt;br /&gt;
&lt;br /&gt;
               $ echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
               $ cat /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
               1&lt;br /&gt;
&lt;br /&gt;
         To Look at the the gateway, execute the following command.&lt;br /&gt;
&lt;br /&gt;
               $ netstat -r&lt;br /&gt;
&lt;br /&gt;
         References: &lt;br /&gt;
&lt;br /&gt;
               http://lartc.org/lartc.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 141:&lt;br /&gt;
&lt;br /&gt;
        RAM disk -- creating a filesystem in RAM.&lt;br /&gt;
&lt;br /&gt;
               $ mkfs -t ext3 -q /dev/ram1 4096&lt;br /&gt;
               $ mkdir -p /fsram&lt;br /&gt;
               $ mount /dev/ram1 /fsram -o defaults,rw&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 142:&lt;br /&gt;
&lt;br /&gt;
        Create a Live Linux CDROM  using  BusyBox and OpenSSH.&lt;br /&gt;
&lt;br /&gt;
            These steps are rather long. A complete tutorial is given at&lt;br /&gt;
            the following link:&lt;br /&gt;
             http://prdownloads.sourceforge.net/souptonuts/instructions_boot_system.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 143:&lt;br /&gt;
&lt;br /&gt;
      SystemImager (http://www.systemimager.org/) SystemImager is software that automates Linux installs,&lt;br /&gt;
                       software distribution, and production deployment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 144:&lt;br /&gt;
&lt;br /&gt;
      Mounted a filesystem in rescue mode, yet, you cannot read and write?  Remount.&lt;br /&gt;
&lt;br /&gt;
             $ mount -o remount /&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 145:&lt;br /&gt;
&lt;br /&gt;
      Nmap commands to check for Microsoft VPN connection.&lt;br /&gt;
&lt;br /&gt;
         $ nmap -sO -p 47 vpn1.someserver.com&lt;br /&gt;
         $ nmap -sS -p T:1723 vpn1.someserver.com&lt;br /&gt;
&lt;br /&gt;
      By the way, with nmap you can specify multiple ports. Below&lt;br /&gt;
      is an example of multiple ports; but, use the commands above&lt;br /&gt;
      for Microsoft VPN services.&lt;br /&gt;
&lt;br /&gt;
         $ nmap -sS -p T:1723-3000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 146:&lt;br /&gt;
&lt;br /&gt;
      Perl and ssh - monitoring systems. The output from ssh can be parsed. Below is&lt;br /&gt;
      a simple procedure to just to read the ssh ouput into perl.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #&lt;br /&gt;
          $pid = open $readme, &amp;quot;ssh root\@hamlet df -lh|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
          while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
           print $_&lt;br /&gt;
          }&lt;br /&gt;
          close $readme&lt;br /&gt;
&lt;br /&gt;
      But note, you probably want to do something more complex. Below is a more robust&lt;br /&gt;
      example that bypassed all the fortune, heading junk that you may encounter when&lt;br /&gt;
      logging in.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #&lt;br /&gt;
          $pid = open $readme, &amp;quot;ssh root\@hamlet df -lh 2&amp;gt;/dev/null|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
          while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
           print $_&lt;br /&gt;
          }&lt;br /&gt;
          close $readme&lt;br /&gt;
&lt;br /&gt;
      NO! you CANNOT do bidirectional communication with the open statement. Note the &amp;quot;|&amp;quot; before&lt;br /&gt;
      and after below, which cannot be done.&lt;br /&gt;
&lt;br /&gt;
          # Cannot do this!&lt;br /&gt;
          $pid = open $readme, &amp;quot;|ssh root\@hamlet df -lh 2&amp;gt;/dev/null|&amp;quot; or die &amp;quot;Could not ssh\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
      Below is a simple Perl example working with arrays:&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          @ArrayOfArray = (&lt;br /&gt;
                   [ &amp;quot;ant&amp;quot;, &amp;quot;bee&amp;quot; ],&lt;br /&gt;
                   [ &amp;quot;mouse&amp;quot;, &amp;quot;mole&amp;quot;, &amp;quot;rat&amp;quot; ],&lt;br /&gt;
                   [ &amp;quot;duck&amp;quot;, &amp;quot;goose&amp;quot;, &amp;quot;flamingo&amp;quot; ],&lt;br /&gt;
                   [  &amp;quot;rose&amp;quot;,&amp;quot;carnation&amp;quot;,&amp;quot;sunflower&amp;quot;],&lt;br /&gt;
                  );&lt;br /&gt;
&lt;br /&gt;
          for $i ( 0 .. $#ArrayOfArray ) {&lt;br /&gt;
              for $j ( 0 .. $#{$ArrayOfArray[$i]} ) {&lt;br /&gt;
                  print &amp;quot;Element $i $j is $ArrayOfArray[$i][$j]\n&amp;quot;;&lt;br /&gt;
              }&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          # Or this is another way to list elements&lt;br /&gt;
          foreach( @ArrayOfArray ) {&lt;br /&gt;
             foreach $i (0..$#$_) {&lt;br /&gt;
                print &amp;quot;$_-&amp;gt;[$i] &amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
             print &amp;quot;\n&amp;quot;;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Below is an example of working with Hash of Arrays:&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          #  ./program &amp;lt; /etc/passwd&lt;br /&gt;
          while(&amp;lt;&amp;gt;){&lt;br /&gt;
              next unless s/^(.*?):\s*//;&lt;br /&gt;
              $HoA{$1} = [ split(/:/) ];&lt;br /&gt;
          }&lt;br /&gt;
          for $i (keys %HoA ) {&lt;br /&gt;
              print &amp;quot;$i: @{ $HoA{$i} } \n&amp;quot;;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
      Example of regular expression. This is my most used regular expression - I like&lt;br /&gt;
      this sample. See the &amp;quot;www.unix.org.ua&amp;quot; link at the end of this tip.&lt;br /&gt;
&lt;br /&gt;
          &amp;quot;hot cross buns&amp;quot; =~ /cross/;&lt;br /&gt;
          print &amp;quot;Matched: &amp;lt;$`&amp;gt; $&amp;amp; &amp;lt;$'&amp;gt;\n&amp;quot;;    # Matched: &amp;lt;hot &amp;gt; cross &amp;lt; buns&amp;gt;&lt;br /&gt;
          print &amp;quot;Left:    &amp;lt;$`&amp;gt;\n&amp;quot;;            # Left:    &amp;lt;hot &amp;gt;&lt;br /&gt;
          print &amp;quot;Match:   &amp;lt;$&amp;amp;&amp;gt;\n&amp;quot;;            # Match:   &amp;lt;cross&amp;gt;&lt;br /&gt;
          print &amp;quot;Right:   &amp;lt;$'&amp;gt;\n&amp;quot;;            # Right:   &amp;lt; buns&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      If you're looking for Perl information, type &amp;quot;man perl&amp;quot;, which will show you how&lt;br /&gt;
      to get even more information. Or better yet, take a look at the following&lt;br /&gt;
      link:&lt;br /&gt;
&lt;br /&gt;
          http://www.unix.org.ua/orelly/perl/prog3/ch09_01.htm&lt;br /&gt;
               also&lt;br /&gt;
          http://www.stonehenge.com/merlyn/UnixReview/&lt;br /&gt;
&lt;br /&gt;
      For a quick example on using Perl with SQLite, see the following links:&lt;br /&gt;
&lt;br /&gt;
          http://prdownloads.sourceforge.net/souptonuts/README_sqlite_tutorial.html?download&lt;br /&gt;
            or&lt;br /&gt;
          http://freshmeat.net/articles/view/1428/&lt;br /&gt;
            or&lt;br /&gt;
          http://www.perl.com/pub/a/1999/09/refererents.html&lt;br /&gt;
&lt;br /&gt;
      Standard input for files. This example will read from stdin, or open a file if given as&lt;br /&gt;
      an argument, and convert all &amp;quot;&amp;lt;&amp;quot; to &amp;quot;&amp;amp;lt;&amp;quot; and &amp;quot;&amp;gt;&amp;quot; to &amp;quot;&amp;amp;gt;&amp;quot;, which can be handy when&lt;br /&gt;
      converting text files to html files. Note the &amp;quot;while(&amp;lt;&amp;gt;)&amp;quot; will take multiple file names&lt;br /&gt;
      on the command line.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          while(&amp;lt;&amp;gt;) {&lt;br /&gt;
             s/&amp;amp;amp;/&amp;amp;amp;amp;/g;&lt;br /&gt;
             s/&amp;amp;lt;/&amp;amp;amp;lt;/g;&lt;br /&gt;
             s/&amp;amp;gt;/&amp;amp;amp;gt;/g;&lt;br /&gt;
             s/&amp;lt;/&amp;amp;lt;/g;&lt;br /&gt;
             s/&amp;gt;/&amp;amp;gt;/g;&lt;br /&gt;
             print;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
      Perl Debugger is very useful for testing commands and works like an interpreter, just&lt;br /&gt;
      like python. So to get into the Perl Debugger execute the command below, &amp;quot;q&amp;quot; to quit.&lt;br /&gt;
&lt;br /&gt;
          $ perl -de 0&lt;br /&gt;
&lt;br /&gt;
      Reference TIP 170&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 147:&lt;br /&gt;
&lt;br /&gt;
      Shutdown&lt;br /&gt;
&lt;br /&gt;
          # shutdown 8:00 -- Shutdown at 8:00&lt;br /&gt;
&lt;br /&gt;
          # shutdown +13  -- Shutdown after 13min&lt;br /&gt;
&lt;br /&gt;
          # shutdown -r now  -- Shutdown now and restart&lt;br /&gt;
&lt;br /&gt;
          # shutdown -k +2  -- &amp;quot;The system is going DOWN to maintenance mode in 2 minutes!&amp;quot;&lt;br /&gt;
                              The above is only a warning.&lt;br /&gt;
&lt;br /&gt;
          # shutdown -h now   -- Shutdown now and halt&lt;br /&gt;
&lt;br /&gt;
          # shutdown -c    -- Cancel shutdown&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 148:&lt;br /&gt;
&lt;br /&gt;
      ac -  print statistics about users connect time&lt;br /&gt;
&lt;br /&gt;
          $ ac -p    -- print hour usage by user (individual)&lt;br /&gt;
          $ ac -dy   -- print daily usage&lt;br /&gt;
&lt;br /&gt;
       Options can also be combined&lt;br /&gt;
&lt;br /&gt;
          $ ac -dyp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 149:&lt;br /&gt;
&lt;br /&gt;
      Smart Monitoring Tools:&lt;br /&gt;
      Disk failing? Or want to know the temperature of your hard-drive?&lt;br /&gt;
&lt;br /&gt;
         http://smartmontools.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
      For a good, quick tutorial, see the Linux Journal article&lt;br /&gt;
        http://www.linuxjournal.com/article/6983&lt;br /&gt;
&lt;br /&gt;
      Below are some common commands:&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -i /dev/hda&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -Hc /dev/hda&lt;br /&gt;
&lt;br /&gt;
          $ smartctl -A /dev/hda&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 150:&lt;br /&gt;
&lt;br /&gt;
      Monitor dhcp trafic - dhcpdump and tcpdump.&lt;br /&gt;
&lt;br /&gt;
      Download dhcpdump&lt;br /&gt;
&lt;br /&gt;
         $ wget  http://voxel.dl.sourceforge.net/sourceforge/mavetju/dhcpdump-1.5.tar.gz&lt;br /&gt;
         $ ./configure&lt;br /&gt;
         $ make &amp;amp;&amp;amp; make install&lt;br /&gt;
&lt;br /&gt;
     Once it's installed, you can monitor all dhcp traffic as follows, if done with root.&lt;br /&gt;
&lt;br /&gt;
         $ tcpdump -lenx -i eth0 -s 1500 port bootps or port bootpc| dhcpdump&lt;br /&gt;
&lt;br /&gt;
     The above assumes you are using eth0 (ethernet port 0).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 151:&lt;br /&gt;
&lt;br /&gt;
      Breaking Firewalls with ssh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      A sample .ssh/config file (note this must have chmod 600 rights)&lt;br /&gt;
&lt;br /&gt;
           ## Server1 ##&lt;br /&gt;
           Host 130.21.19.227&lt;br /&gt;
               LocalForward 20000 192.168.0.66:80&lt;br /&gt;
               LocalForward 22000 192.168.0.66:22&lt;br /&gt;
&lt;br /&gt;
      With the above &amp;quot;~/.ssh/config&amp;quot; file, after sshing into 130.21.19.227 it&lt;br /&gt;
      is then possible to ssh into nearby computers directly.&lt;br /&gt;
&lt;br /&gt;
         $ ssh -l mchirico 130.21.19.227&lt;br /&gt;
         $ scp -P 22000 authorized_keys* mchirico@localhost:.&lt;br /&gt;
         $ ssh -l mchirico localhost -p 22000&lt;br /&gt;
&lt;br /&gt;
      For the complete article reference the following link:&lt;br /&gt;
        http://souptonuts.sourceforge.net/sshtips.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 152:&lt;br /&gt;
&lt;br /&gt;
      Renaming files - suppose you want to rename all the &amp;quot;.htm&amp;quot; files to &amp;quot;.html&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          $ rename .htm .html *.htm&lt;br /&gt;
&lt;br /&gt;
      Or, suppose you files file1, file2, file3 ...&lt;br /&gt;
&lt;br /&gt;
          $ touch file1 file2 file3 file4 file5 file6&lt;br /&gt;
          $ rename file file. file*&lt;br /&gt;
&lt;br /&gt;
      The above command will give you &amp;quot;file.1&amp;quot;, &amp;quot;file.2&amp;quot; ... &amp;quot;file.6&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 153:&lt;br /&gt;
&lt;br /&gt;
      Renaming files with Perl - this is taken from &amp;quot;Programming Perl 3rd Edition&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          # rename - change filenames&lt;br /&gt;
          $op = shift;&lt;br /&gt;
          for (@ARGV) {&lt;br /&gt;
              $was = $_;&lt;br /&gt;
              eval $op;&lt;br /&gt;
              die if $@;&lt;br /&gt;
              # next line calls built-in function, not the script&lt;br /&gt;
              rename($was,$_) unless $was eq $_;&lt;br /&gt;
           }&lt;br /&gt;
&lt;br /&gt;
      The above Perl program can be used as follows:&lt;br /&gt;
&lt;br /&gt;
           $ rename 's/\.orig$//'    *.orig&lt;br /&gt;
           $ rename 'y/A-Z/a-z/ unless /^Make/' *&lt;br /&gt;
&lt;br /&gt;
      Also reference:&lt;br /&gt;
           http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 154:&lt;br /&gt;
&lt;br /&gt;
      R project (http://www.r-project.org)&lt;br /&gt;
&lt;br /&gt;
      To start R, just type &amp;quot;R&amp;quot; at the command prompt and &amp;quot;q()&amp;quot; to quit. Below&lt;br /&gt;
      2 is raised to powers 0 through 6 and thrown into an array.&lt;br /&gt;
&lt;br /&gt;
           $ R&lt;br /&gt;
           &amp;gt; N &amp;lt;- 2^(0:6)&lt;br /&gt;
           &amp;gt; N&lt;br /&gt;
           [1]  1  2  4  8 16 32 64&lt;br /&gt;
           &amp;gt;&lt;br /&gt;
&lt;br /&gt;
      There is a summary summary() command.&lt;br /&gt;
&lt;br /&gt;
           &amp;gt; summary(N)&lt;br /&gt;
           Min. 1st Qu.  Median    Mean 3rd Qu.    Max.&lt;br /&gt;
           1.00    3.00    8.00   18.14   24.00   64.00&lt;br /&gt;
&lt;br /&gt;
      Note that the array begins as 1 and not 0&lt;br /&gt;
&lt;br /&gt;
           &amp;gt; N[1:3]&lt;br /&gt;
           [1] 1 2 4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 155:&lt;br /&gt;
&lt;br /&gt;
      ls - listing files by size, with the biggest file listed last&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           $ ls --sort=size -lhr&lt;br /&gt;
&lt;br /&gt;
      The above command sorts files by size, listing the contents in&lt;br /&gt;
      &amp;quot;h&amp;quot; human readable format in reverse order.&lt;br /&gt;
&lt;br /&gt;
      Note the options:  --sort={none,time,size,extension}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 156:&lt;br /&gt;
&lt;br /&gt;
     Perl - program to clean up old versions of files&lt;br /&gt;
&lt;br /&gt;
       #!/usr/bin/perl&lt;br /&gt;
       #   Copyright (c) GPL 2005 Mike Chirico&lt;br /&gt;
       # This program deletes old files from several directories&lt;br /&gt;
       # and within each directory there must be x number of copies&lt;br /&gt;
       # each y number of bytes&lt;br /&gt;
       #&lt;br /&gt;
&lt;br /&gt;
       sub delete_old_ones {&lt;br /&gt;
           $directory_and_file=$_[0];&lt;br /&gt;
           $save_count=$_[1];&lt;br /&gt;
           $bytes_in_file=$_[2];&lt;br /&gt;
         # Don't change setting here of '-lt'&lt;br /&gt;
           $pid = open $readme, &amp;quot;ls -lt $directory_and_file|&amp;quot; or die &amp;quot;Could not execute\n&amp;quot;;&lt;br /&gt;
           while(&amp;lt;$readme&amp;gt;) {&lt;br /&gt;
               my @fields = split;&lt;br /&gt;
              # Make sure we have $save_count good ones with data&lt;br /&gt;
               if ($fields[4] &amp;gt; $bytes_in_file &amp;amp;&amp;amp; $save_count &amp;gt; 0) {&lt;br /&gt;
                   $save_count--;&lt;br /&gt;
                   print &amp;quot;Kept files: $fields[4] $fields[8]\n&amp;quot;;&lt;br /&gt;
               }&lt;br /&gt;
              # delete the old ones&lt;br /&gt;
              if ($save_count &amp;lt;= 0 )&lt;br /&gt;
              {&lt;br /&gt;
                  print &amp;quot;Deleted files: $fields[4] $fields[8]\n&amp;quot;;&lt;br /&gt;
                  unlink $fields[8];&lt;br /&gt;
              }&lt;br /&gt;
           }&lt;br /&gt;
           close $readme;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       @AofA = (&lt;br /&gt;
          [ &amp;quot;/home/cvs/backups/*.gz&amp;quot;, &amp;quot;6&amp;quot;,196621 ],&lt;br /&gt;
          [ &amp;quot;/home/mail/backups/*.gz&amp;quot;,&amp;quot;5&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/snort/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/server1/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/actserver/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
          [ &amp;quot;/home/server2/backups/*.gz&amp;quot;,&amp;quot;2&amp;quot;,34 ],&lt;br /&gt;
                );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       foreach( @AofA ) {&lt;br /&gt;
           &amp;amp;delete_old_ones($_-&amp;gt;[0],$_-&amp;gt;[1],$_-&amp;gt;[2]);&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
     Reference TIP 170 and the following link:&lt;br /&gt;
       http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 157:&lt;br /&gt;
&lt;br /&gt;
     Graphics and Visualization Software that runs on Linux&lt;br /&gt;
        http://www.tldp.org/HOWTO/Scientific-Computing-with-GNU-Linux/graphvis.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 158:&lt;br /&gt;
&lt;br /&gt;
     Keeping files in sync going both ways. Unlike rsync, this is not a one way mirror&lt;br /&gt;
     option.&lt;br /&gt;
&lt;br /&gt;
     You will need ocaml installed first.&lt;br /&gt;
&lt;br /&gt;
       $ wget http://caml.inria.fr/pub/distrib/ocaml-3.08/ocaml-3.08.3.tar.gz&lt;br /&gt;
       $ tar -xzf ocaml-3.08.3.tar.gz&lt;br /&gt;
       $ cd ocaml-3.08.3&lt;br /&gt;
&lt;br /&gt;
       $ ./configure&lt;br /&gt;
       $ make world&lt;br /&gt;
       $ make opt&lt;br /&gt;
       $ make install&lt;br /&gt;
&lt;br /&gt;
     Next, get unison and put it in a different directory.&lt;br /&gt;
     [http://www.cis.upenn.edu/~bcpierce/unison/]&lt;br /&gt;
&lt;br /&gt;
       $ wget http://www.cis.upenn.edu/~bcpierce/unison/download/stable/latest/unison-2.10.2.tar.gz&lt;br /&gt;
       $ tar -xzf unison-2.10.2.tar.gz&lt;br /&gt;
       $ cd unison-2.10.2&lt;br /&gt;
       $ make UISTYLE=text&lt;br /&gt;
       $ su&lt;br /&gt;
       # cp unison /usr/local/bin/.&lt;br /&gt;
&lt;br /&gt;
     Note, you have to copy the file manually.&lt;br /&gt;
&lt;br /&gt;
     See the following article [http://www.linuxjournal.com/article/7712]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 159:&lt;br /&gt;
&lt;br /&gt;
     Dump ext2/ext3 filesystem information with &amp;quot;dumpe2fs&amp;quot;. Perform the mount command&lt;br /&gt;
     and query away.&lt;br /&gt;
&lt;br /&gt;
       $ dumpe2fs /dev/sda1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 160:&lt;br /&gt;
&lt;br /&gt;
     sysreport - a script that generates an HTML report on the system configuration. It&lt;br /&gt;
     gathers information about the hardware and is somewhat redhat specific. The utility&lt;br /&gt;
     should be run as root.&lt;br /&gt;
&lt;br /&gt;
       $ /usr/sbin/sysreport&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 161:&lt;br /&gt;
&lt;br /&gt;
     Key Bindings Using bind.  You can bind, say, ctl-t to a command.&lt;br /&gt;
&lt;br /&gt;
     Add the following to you &amp;quot;~/.inputrc&amp;quot; file, just as it is typed below with quotes.&lt;br /&gt;
&lt;br /&gt;
           &amp;quot;\C-t&amp;quot;: ls -l&lt;br /&gt;
&lt;br /&gt;
     Next, run the command&lt;br /&gt;
&lt;br /&gt;
           $ bind -f .inputrc&lt;br /&gt;
&lt;br /&gt;
     Or, you can do everything on the command line; however, it won't be there the next time&lt;br /&gt;
     you log in. Below is the way to do everything on the command line.&lt;br /&gt;
&lt;br /&gt;
           $ bind -x '&amp;quot;\C-t&amp;quot;:ls -l'&lt;br /&gt;
&lt;br /&gt;
     To unbind use the &amp;quot;-r&amp;quot; option. Single quotes are not needed.&lt;br /&gt;
&lt;br /&gt;
           $ bind -r &amp;quot;\C-t&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Getting a list of all bindings can be done as follows, and not this can be redirected&lt;br /&gt;
     to the &amp;quot;.inputrc&amp;quot; file for further editing.&lt;br /&gt;
&lt;br /&gt;
           $ bind -p &amp;gt; .inputrc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 162:&lt;br /&gt;
&lt;br /&gt;
     awk - common awk commands.&lt;br /&gt;
&lt;br /&gt;
     Find device names &amp;quot;sd&amp;quot; or with major number 4 and device name &amp;quot;tty&amp;quot;. Print the&lt;br /&gt;
     record number NR, plus the major number and minor number.&lt;br /&gt;
&lt;br /&gt;
          $ awk '$2 == &amp;quot;sd&amp;quot;||$1 == 4 &amp;amp;&amp;amp; $2 == &amp;quot;tty&amp;quot; { print NR,$1,$2}' /proc/devices&lt;br /&gt;
&lt;br /&gt;
     Find device name equal to &amp;quot;sound&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          $ awk '/sound/{print NR,$1,$2}' /proc/devices&lt;br /&gt;
&lt;br /&gt;
     Print the 5th record, first field, in file test&lt;br /&gt;
&lt;br /&gt;
          $ awk 'NR==5{print $1}' test&lt;br /&gt;
&lt;br /&gt;
     Print a record, skip 4 records, print a record etc from file1&lt;br /&gt;
&lt;br /&gt;
          $ awk '(NR-1) % 4 == 0 {print $1}' file1&lt;br /&gt;
&lt;br /&gt;
     Print all records except the last one from file1&lt;br /&gt;
&lt;br /&gt;
          $ tac file1|awk 'NR &amp;gt; 1 {print $0}'|tac&lt;br /&gt;
&lt;br /&gt;
     Print A,B,C ..Z on each line, cycling back to A if greater than 26 lines&lt;br /&gt;
&lt;br /&gt;
          $ awk '{ print substr(&amp;quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&amp;quot;,(NR-1)%26+1,1),$0}' file1&lt;br /&gt;
&lt;br /&gt;
     Number of bytes in a directory.&lt;br /&gt;
&lt;br /&gt;
          $ ls -l|awk 'BEGIN{ c=0}{ c+=$5} END{ print c}'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 163:&lt;br /&gt;
&lt;br /&gt;
     Configuring Remote Logging.  If you have several servers on 192.168.1.0, you can setup remote logging&lt;br /&gt;
     as follows.&lt;br /&gt;
&lt;br /&gt;
     MAIN LOG SERVER (192.168.1.81):&lt;br /&gt;
&lt;br /&gt;
        Firewall - allow UDP port 514 on the main server that will receive the logs.&lt;br /&gt;
&lt;br /&gt;
          $ iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 514 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        Edit &amp;quot;/etc/sysconfig/syslog&amp;quot; and add the &amp;quot;-r&amp;quot; option to SYSLOGD_OPTIONS as shown below.&lt;br /&gt;
&lt;br /&gt;
          SYSLOGD_OPTIONS=&amp;quot;-r -m -0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Note, the &amp;quot;-r&amp;quot; is to allow remote logging and  &amp;quot;-m 0&amp;quot; specifies that that the syslog process should&lt;br /&gt;
        not write regular timestamps.  I prefer to only write timestamps for the clients.&lt;br /&gt;
&lt;br /&gt;
        Next, restart the logging process&lt;br /&gt;
&lt;br /&gt;
          $ service syslog restart&lt;br /&gt;
&lt;br /&gt;
     CLIENT LOG SERVER:&lt;br /&gt;
&lt;br /&gt;
        Edit &amp;quot;/etc/syslog.conf&amp;quot; and add the ip address of the log server, or put in the hostname.&lt;br /&gt;
&lt;br /&gt;
            *.* @192.168.1.81&lt;br /&gt;
&lt;br /&gt;
        Next, restart the logging process&lt;br /&gt;
&lt;br /&gt;
          $ service syslog restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 164:&lt;br /&gt;
&lt;br /&gt;
     kudzu - hardware on your system. To probe the hardware on your system without doing&lt;br /&gt;
             anything, issue the following command.&lt;br /&gt;
&lt;br /&gt;
          $ kudzu -p&lt;br /&gt;
&lt;br /&gt;
      But wait, a lot of this information is already recorded in the following file&lt;br /&gt;
&lt;br /&gt;
            /etc/sysconfig/hwconf&lt;br /&gt;
&lt;br /&gt;
      You can also use lspci to list all PCI devices.&lt;br /&gt;
&lt;br /&gt;
          $ lspci&lt;br /&gt;
&lt;br /&gt;
      Also, take a look at the script /etc/sbin/sysreport, since this script has a lot of&lt;br /&gt;
      info gathering commands. You can pick and choose what you want, or run the complete&lt;br /&gt;
      report.&lt;br /&gt;
&lt;br /&gt;
      If you just want information on the NIC&lt;br /&gt;
&lt;br /&gt;
          $ ip link show eth0&lt;br /&gt;
          2: eth0: &amp;lt;BROADCAST,MULTICAST,UP&amp;gt; mtu 1500 qdisc pfifo_fast qlen 1000&lt;br /&gt;
          link/ether 00:11:11:8a:be:3f brd ff:ff:ff:ff:ff:ff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 165:&lt;br /&gt;
&lt;br /&gt;
     cfengine - a very power agent for monitoring and administrating both a single computer&lt;br /&gt;
              and or multiple computers. [ http://www.cfengine.org/ ]&lt;br /&gt;
&lt;br /&gt;
     The following is a quick example on downloading and installing cfengine.&lt;br /&gt;
&lt;br /&gt;
          $ ncftpget ftp://ftp.iu.hio.no/pub/cfengine/cfengine-2.1.15.tar.gz&lt;br /&gt;
          $ md5sum cfengine-2.1.15.tar.gz&lt;br /&gt;
          f03de82709f84c3d6d916b6e557321f9  cfengine-2.1.15.tar.gz&lt;br /&gt;
&lt;br /&gt;
          $ tar -xzf cfengine-2.1.15.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You need to have a current version of BerkeleyDB (http://downloads.sleepycat.com/db-4.3.28.tar.gz).&lt;br /&gt;
     Note that BerkeleyDB has a funny install. You cd to the &amp;quot;build_unix&amp;quot; directory, then,&lt;br /&gt;
&lt;br /&gt;
          Installing BerkeleyDB if needed:&lt;br /&gt;
                 $ wget http://downloads.sleepycat.com/db-4.3.28.tar.gz&lt;br /&gt;
                 $ tar -xzf db-4.3.28.tar.gz&lt;br /&gt;
                 $ cd db-4.3.28/build_unix/&lt;br /&gt;
                 $ ../dist/configure&lt;br /&gt;
                 make&lt;br /&gt;
                 make install&lt;br /&gt;
&lt;br /&gt;
     You also need a current version of OpenSSL. For instructions on how to install OpenSSL see&lt;br /&gt;
     (http://souptonuts.sourceforge.net/postfix_tutorial.html).&lt;br /&gt;
&lt;br /&gt;
     See (TIP 49) on putting &amp;quot;/usr/local/BerkeleyDB.4.3/lib&amp;quot; in the &amp;quot;/etc/ld.so.conf&amp;quot; file. Or&lt;br /&gt;
     once BerkeleyDB is installed, you can put the location on the command line as follows:&lt;br /&gt;
&lt;br /&gt;
     Configuring cfengine with direct reference to BerkeleyDB.4.3.  First cd to the cfengine source.&lt;br /&gt;
&lt;br /&gt;
          $ ./configure --with-berkeleydb=/usr/local/BerkeleyDB.4.3/lib&lt;br /&gt;
          $ make&lt;br /&gt;
          $ make install&lt;br /&gt;
&lt;br /&gt;
     Next create the following directories:&lt;br /&gt;
&lt;br /&gt;
          $ mkdir -p /var/cfengine/bin&lt;br /&gt;
          $ mkdir -p /var/cfengine/inputs&lt;br /&gt;
&lt;br /&gt;
     Copy needed files (cfagent, cfdoc, cfenvd, cfenvgraph, cfexecd, cfkey, cfrun, cfservd, cfshow):&lt;br /&gt;
&lt;br /&gt;
          $ cp /usr/local/sbin/cf* /var/cfengine/bin&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You'll also need to generate keys. As root, execute the following:&lt;br /&gt;
&lt;br /&gt;
          $ cfkey&lt;br /&gt;
&lt;br /&gt;
     The command above will write the public and private keys in&lt;br /&gt;
     &amp;quot;/var/cfengine/ppkeys&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     You probably want (cfexecd, cfservd, and cfenvd) running on all servers. If you&lt;br /&gt;
     add the following to &amp;quot;/etc/rc.local&amp;quot; these daemons will start on reboot.&lt;br /&gt;
&lt;br /&gt;
           # Lines in /etc/rc.local&lt;br /&gt;
           /usr/local/sbin/cfexecd&lt;br /&gt;
           /usr/local/sbin/cfservd&lt;br /&gt;
           /usr/local/sbin/cfenvd&lt;br /&gt;
&lt;br /&gt;
     Also, make sure you run each command now as follows:&lt;br /&gt;
&lt;br /&gt;
          $ /usr/local/sbin/cfexecd&lt;br /&gt;
          $ /usr/local/sbin/cfservd&lt;br /&gt;
          $ /usr/local/sbin/cfenvd&lt;br /&gt;
&lt;br /&gt;
     Firewall settings must be adjusted to allows 5308 for tcp/udp. My local network&lt;br /&gt;
     is 192.168.1.0, so I'm opening it up for all my computers.&lt;br /&gt;
&lt;br /&gt;
          $ iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 5308 -j ACCEPT&lt;br /&gt;
          $ iptables -A INPUT -p tcp -s 192.168.1.0/24  --dport 5308 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
     A set of keys needs to be on the server and hosts. For example, my key on &amp;quot;tape.squeezel.com&amp;quot;&lt;br /&gt;
     should be copied over to the server &amp;quot;squeezel.squeezel.com&amp;quot; as follows:&lt;br /&gt;
&lt;br /&gt;
     This is done from tape.squeezel.com&lt;br /&gt;
&lt;br /&gt;
          $ scp /var/cfengine/ppkeys/localhost.pub  root@squeezel.squeezel.com:/var/cfengine/ppkeys/root-tape.squeezel.com.pub&lt;br /&gt;
          $ scp root@squeezel.squeezel.com:/var/cfengine/ppkeys/localhost.pub /var/cfengine/ppkeys/root-squeezel.squeezel.com.pub&lt;br /&gt;
&lt;br /&gt;
     Also, &amp;quot;/var/cfengine/inputs/cfrun.hosts&amp;quot; on the server &amp;quot;squeezel.squeezel.com&amp;quot; must contain&lt;br /&gt;
     all the computers that will get updated. This is &amp;quot;cfrun.hosts&amp;quot; on &amp;quot;squeezel.squeezel.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          closet.squeezel.com&lt;br /&gt;
          tape.squeezel.com&lt;br /&gt;
&lt;br /&gt;
     Once I'm done, from &amp;quot;tape.squeezel.com&amp;quot; I can run the following test:&lt;br /&gt;
&lt;br /&gt;
          $ cfrun squeezel.squeezel.com -v&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 166:&lt;br /&gt;
&lt;br /&gt;
     cfengine - a quick example. This example will be run as root. You create the file &amp;quot;cfagent.conf&amp;quot; in&lt;br /&gt;
     &amp;quot;/var/cfengine/inputs/&amp;quot;. The example below will checksum all the files in /home/chirico/deleteme/tripwire,&lt;br /&gt;
     it will also comment out the line &amp;quot;finger&amp;quot; in any file located in /tmp/testdir/stuff, also appending&lt;br /&gt;
     the command in this file &amp;quot; Edit change with cfengine&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          # /var/cfengine/inputs/cfagent.conf&lt;br /&gt;
          #&lt;br /&gt;
          # You run this with the following:&lt;br /&gt;
          #   cfagent -vK&lt;br /&gt;
        &lt;br /&gt;
          control:&lt;br /&gt;
                 actionsequence = ( files tidy editfiles )&lt;br /&gt;
                 ChecksumDatabase = ( /var/cfengine/cache.db )&lt;br /&gt;
                 # Below, true to update md5&lt;br /&gt;
                 ChecksumUpdates = ( true )&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
          files:&lt;br /&gt;
                 /home/chirico/deleteme/tripwire checksum=md5 recurse=inf&lt;br /&gt;
                 /home/chirico/deleteme/tripwire/moredata checksum=md5 recurse=inf&lt;br /&gt;
                 #/home/chirico/deleteme/tripwire/compress  recurse=inf include=*.txt acti on=compress&lt;br /&gt;
                   # If the database isn't secure, nothing is secure...&lt;br /&gt;
                 /var/cfengine/cache.db  mode=600 owner=root action=fixall&lt;br /&gt;
        &lt;br /&gt;
          tidy:&lt;br /&gt;
                 /home/chirico/deleteme/tripwire pattern=*~ recurse=inf age=0&lt;br /&gt;
                 # You must put an age. 0 runs now.&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
          editfiles:&lt;br /&gt;
        &lt;br /&gt;
                {  /tmp/testdir/stuff&lt;br /&gt;
&lt;br /&gt;
                   HashCommentLinesContaining &amp;quot;finger&amp;quot;&lt;br /&gt;
                   AppendIfNoSuchLine &amp;quot;# Edit Change with cfengine &amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     A few further notes on the above. The command &amp;quot;actionsequence = ( files tidy editfiles) tells the order&lt;br /&gt;
     of what to execute. The heading &amp;quot;tidy:&amp;quot; deletes files, and of course, &amp;quot;editfiles&amp;quot; does the editing of files.&lt;br /&gt;
&lt;br /&gt;
     To run the example, execute the following command. The  &amp;quot;-K&amp;quot; causes the lock file to be ignored.&lt;br /&gt;
&lt;br /&gt;
            $ cfagent -vK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 167:&lt;br /&gt;
&lt;br /&gt;
     Implementing Disk Quotas - a quick example that can easily be done on a live system for testing. There&lt;br /&gt;
     is no need to reboot, since you'll be creating a virtual filesystem.&lt;br /&gt;
&lt;br /&gt;
     Do the following as root. First create a mount point.&lt;br /&gt;
&lt;br /&gt;
            # mkdir -p /quota&lt;br /&gt;
&lt;br /&gt;
     Next, create 20M file. Since I have many of these files, I created a special directory &amp;quot;/usr/disk-img&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            # mkdir -p /usr/disk-img&lt;br /&gt;
            # dd if=/dev/zero of=/usr/disk-img/disk-quota.ext3 count=40960&lt;br /&gt;
&lt;br /&gt;
     The dd command above create a 20 MB file because, by default, dd uses a block size of 512 bytes. That makes&lt;br /&gt;
     the size: 40960*512=20971520.&lt;br /&gt;
&lt;br /&gt;
     Next, format this as an ext3 filesystem&lt;br /&gt;
&lt;br /&gt;
            # /sbin/mkfs -t ext3 -q /usr/disk-img/disk-quota.ext3 -F&lt;br /&gt;
&lt;br /&gt;
     Add the following line to &amp;quot;/etc/fstab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            /usr/disk-img/disk-quota.ext3    /quota ext3    rw,loop,usrquota,grpquota  0 0&lt;br /&gt;
&lt;br /&gt;
     Now, mount this filesystem&lt;br /&gt;
&lt;br /&gt;
            # mount /quota&lt;br /&gt;
&lt;br /&gt;
     Take a look at it:&lt;br /&gt;
&lt;br /&gt;
            # ls -l /quota&lt;br /&gt;
            lost+found&lt;br /&gt;
&lt;br /&gt;
     Now, run &amp;quot;quotacheck&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            # quotacheck -vug /quota&lt;br /&gt;
&lt;br /&gt;
     You'll get errors the first time this is run, because you have no quota files.&lt;br /&gt;
     But, run it a second time and you'll see something similiar to the following:&lt;br /&gt;
&lt;br /&gt;
            # quotacheck -vug /quota&lt;br /&gt;
            quotacheck: Scanning /dev/loop2 [/quota] done&lt;br /&gt;
            quotacheck: Checked 3 directories and 4 files&lt;br /&gt;
&lt;br /&gt;
     Now take a look at the files:&lt;br /&gt;
&lt;br /&gt;
            # ls -l /quota&lt;br /&gt;
            total 26&lt;br /&gt;
            -rw-------  1 root root  6144 Jun 14 12:23 aquota.group&lt;br /&gt;
            -rw-------  1 root root  6144 Jun 14 12:23 aquota.user&lt;br /&gt;
            drwx------  2 root root 12288 Jun 14 12:18 lost+found&lt;br /&gt;
&lt;br /&gt;
     Next use &amp;quot;edquota&amp;quot; to grant the user &amp;quot;chirico&amp;quot; a certain quota&lt;br /&gt;
&lt;br /&gt;
            # edquota -f /quota chirico&lt;br /&gt;
&lt;br /&gt;
     This will bring up a menu, and here I have edited so that user &amp;quot;chirico&amp;quot;&lt;br /&gt;
     has a soft limit of 120*512=61K, and a soft limit of 2 inodes and a hard limit of 5.&lt;br /&gt;
&lt;br /&gt;
             Disk quotas for user chirico (uid 500):&lt;br /&gt;
             Filesystem                   blocks       soft       hard     inodes     soft     hard&lt;br /&gt;
             /dev/loop2                        2        120        150         1        2         3&lt;br /&gt;
&lt;br /&gt;
     Next, turn quotas on with the following command:&lt;br /&gt;
&lt;br /&gt;
             $ quotaon /quota&lt;br /&gt;
&lt;br /&gt;
     If you need to turn off quotas, the command is &amp;quot;quotaoff -a&amp;quot; for all filesystems. You'll run into&lt;br /&gt;
     errors if you try to run quotacheck, say &amp;quot;quotacheck -avug&amp;quot; because this tries to unmount and mount&lt;br /&gt;
     the filesystem. You need to turn off quotas first &amp;quot;quotaoff /quota&amp;quot;. Note you only need to run&lt;br /&gt;
     quotacheck once, or when doing maintenance after a system crash.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      To get a report on the quote, runn &amp;quot;repquota&amp;quot; as follows:&lt;br /&gt;
&lt;br /&gt;
           $ repquota /quota&lt;br /&gt;
            *** Report for user quotas on device /dev/loop0&lt;br /&gt;
            Block grace time: 7days; Inode grace time: 7days&lt;br /&gt;
                                    Block limits                File limits&lt;br /&gt;
            User            used    soft    hard  grace    used  soft  hard  grace&lt;br /&gt;
            ----------------------------------------------------------------------&lt;br /&gt;
            root      --    1189       0       0              2     0     0&lt;br /&gt;
            chirico   -+      93       0       0              4     2     5  6days&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Note above that user &amp;quot;chirico&amp;quot; has used 4 on the file limits. This user has a hard&lt;br /&gt;
      limit of 5. So when this user tries to create 2 more files (bring this over the limit of 5)&lt;br /&gt;
      then he will get the following error as demonstrated below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           [chirico@squeezel chirico]$ touch one&lt;br /&gt;
           [chirico@squeezel chirico]$ touch two&lt;br /&gt;
           loop0: write failed, user file limit reached.&lt;br /&gt;
           touch: cannot touch `two': Disk quota exceeded&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Now, if repquota (run by root) is executed it shows the following:&lt;br /&gt;
&lt;br /&gt;
           $ repquota /quota&lt;br /&gt;
           *** Report for user quotas on device /dev/loop0&lt;br /&gt;
           Block grace time: 7days; Inode grace time: 7days&lt;br /&gt;
                                   Block limits                File limits&lt;br /&gt;
           User            used    soft    hard  grace    used  soft  hard  grace&lt;br /&gt;
           ----------------------------------------------------------------------&lt;br /&gt;
           root      --    1189       0       0              2     0     0&lt;br /&gt;
           chirico   -+      94       0       0              5     2     5  6days&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Note the &amp;quot;+&amp;quot; sign above. User &amp;quot;chirico&amp;quot; is above the File soft limits, and in this case&lt;br /&gt;
      above the hard limits.&lt;br /&gt;
&lt;br /&gt;
      To warn user by sending email to them, run &amp;quot;warnquota&amp;quot;, but you need check that&lt;br /&gt;
      &amp;quot;/etc/warnquota.conf&amp;quot; is setup correctly. For the example above, this file should&lt;br /&gt;
      look as follows:&lt;br /&gt;
&lt;br /&gt;
            $ cat /etc/quotatab&lt;br /&gt;
            #&lt;br /&gt;
            #  This is sample quotatab (/etc/quotatab)&lt;br /&gt;
            #  Here you can specify description of each device for user&lt;br /&gt;
            #&lt;br /&gt;
            #  Comments begin with hash in the beginning of the line&lt;br /&gt;
&lt;br /&gt;
            # Example of description&lt;br /&gt;
            /dev/loop0: This is loopback device&lt;br /&gt;
&lt;br /&gt;
      Just run the following as root:&lt;br /&gt;
&lt;br /&gt;
            $ warnquota&lt;br /&gt;
&lt;br /&gt;
      By the way, if you want to change the grace period, it can only be done on a filesystem&lt;br /&gt;
      basis. Not per user.&lt;br /&gt;
&lt;br /&gt;
            $  edquota -t&lt;br /&gt;
&lt;br /&gt;
      Users can run &amp;quot;quota&amp;quot; to see their usage as follows:&lt;br /&gt;
&lt;br /&gt;
            [chirico@squeezel ~]$ quota&lt;br /&gt;
            Disk quotas for user chirico (uid 500):&lt;br /&gt;
                 Filesystem  blocks   quota   limit   grace   files   quota   limit   grace&lt;br /&gt;
                 /dev/loop0      94       0       0               5      10      50&lt;br /&gt;
&lt;br /&gt;
      As you can see from above, I changed my inode limit to 50.&lt;br /&gt;
&lt;br /&gt;
      What about running this on the whole filesystem? Yes, below is an example where I'm running&lt;br /&gt;
      this on FC3, on the root of the filesystem &amp;quot;/&amp;quot;. This assumes that you have installed the&lt;br /&gt;
      quota package. Try doing &amp;quot;rpm -q quota&amp;quot; to see if this package is installed.&lt;br /&gt;
&lt;br /&gt;
        Step 1:&lt;br /&gt;
&lt;br /&gt;
           Check to make sure the quota software is installed. You can either do a &amp;quot;whereis quota&amp;quot;,&lt;br /&gt;
           or check for the rpm package.&lt;br /&gt;
&lt;br /&gt;
             $ whereis quota&lt;br /&gt;
             whereis quota&lt;br /&gt;
             quota: /usr/bin/quota /usr/share/man/man1/quota.1.gz&lt;br /&gt;
&lt;br /&gt;
           Checking for the rpm package.&lt;br /&gt;
&lt;br /&gt;
            $ rpm -q quota&lt;br /&gt;
            quota-3.12-5&lt;br /&gt;
&lt;br /&gt;
        Step 2:&lt;br /&gt;
&lt;br /&gt;
           Edit /etc/fstab and add usrquota and grpquota options for &amp;quot;/dev/VolGroup00/LogVol00&amp;quot;,&lt;br /&gt;
           which is shown on the first line below:&lt;br /&gt;
&lt;br /&gt;
             /dev/VolGroup00/LogVol00 /                      ext3    defaults,usrquota,grpquota        1 1&lt;br /&gt;
             LABEL=/boot             /boot                   ext3    defaults        1 2&lt;br /&gt;
             none                    /dev/pts                devpts  gid=5,mode=620  0 0&lt;br /&gt;
             none                    /dev/shm                tmpfs   defaults        0 0&lt;br /&gt;
             none                    /proc                   proc    defaults        0 0&lt;br /&gt;
             none                    /sys                    sysfs   defaults        0 0&lt;br /&gt;
             /dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0&lt;br /&gt;
&lt;br /&gt;
        Step 3:&lt;br /&gt;
&lt;br /&gt;
           Remount the filesystem as follows:&lt;br /&gt;
&lt;br /&gt;
             $ mount -o remount /&lt;br /&gt;
&lt;br /&gt;
        Step 4:&lt;br /&gt;
&lt;br /&gt;
           Run quotacheck with the &amp;quot;-m&amp;quot; option. Like the above statement, this will have to be run with&lt;br /&gt;
           root priviliges. This creates the quota database files, and it can take a long time if it is&lt;br /&gt;
           a large full filesystem.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             $ quotacheck -cugm /&lt;br /&gt;
&lt;br /&gt;
        Step 5:&lt;br /&gt;
&lt;br /&gt;
           This step is optional, but it's good to know if you need to recalculate quotas because of a&lt;br /&gt;
           system crash. It's demonstrated here, because at this point quota's have not been turned on.&lt;br /&gt;
           Again, note the &amp;quot;m&amp;quot; option below.&lt;br /&gt;
&lt;br /&gt;
             $ quotacheck -avumg&lt;br /&gt;
&lt;br /&gt;
        Step 6:&lt;br /&gt;
&lt;br /&gt;
           Set limits for specific users or groups using the &amp;quot;edquota&amp;quot; command. Shown below is the command&lt;br /&gt;
           to setup quotas for user &amp;quot;chirico&amp;quot;. Shown below this user has used 161560 blocks, he has a soft&lt;br /&gt;
           limit of 1161560 and a hard limit of 900000. He has used 3085 inodes and has a soft limit of 10000&lt;br /&gt;
           and a hard limit of 12000.&lt;br /&gt;
&lt;br /&gt;
             $ edquota -f / chirico&lt;br /&gt;
&lt;br /&gt;
             Disk quotas for user chirico (uid 500):&lt;br /&gt;
               Filesystem                   blocks       soft       hard     inodes     soft     hard&lt;br /&gt;
               /dev/mapper/VolGroup00-LogVol00     161560    1161560     900000       3085    10000    12000&lt;br /&gt;
&lt;br /&gt;
           You can put quotas on groups as well. The following is done as root. See (TIP 186 and TIP 6) for creating&lt;br /&gt;
           groups and adding users to groups.&lt;br /&gt;
&lt;br /&gt;
             $ edquota -g share&lt;br /&gt;
&lt;br /&gt;
           If you create a sharable directory for anyone in the group &amp;quot;share&amp;quot; (TIP 6), quota restrictions against&lt;br /&gt;
           group &amp;quot;share&amp;quot; will only apply to files added in the &amp;quot;/home/share&amp;quot; directory. When user &amp;quot;chirico&amp;quot; creates&lt;br /&gt;
           files in &amp;quot;/home/share&amp;quot; they also go against this user quota as well. However, when files are created in&lt;br /&gt;
           his home directory they do not go against the &amp;quot;share&amp;quot; group.&lt;br /&gt;
&lt;br /&gt;
           Note - if you get errors when trying to run &amp;quot;edquota -g share&amp;quot;, turn quotas off &amp;quot;quotaoff /&amp;quot; and&lt;br /&gt;
                  run &amp;quot;quotacheck -avugm&amp;quot;. Then, turn the quotas back on &amp;quot;quotaon /&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           You can see the status of the group quota with the following command:&lt;br /&gt;
&lt;br /&gt;
             $ quota -g share&lt;br /&gt;
&lt;br /&gt;
        Step 7:&lt;br /&gt;
&lt;br /&gt;
           Turn on quotas with the &amp;quot;qutoaon&amp;quot; command. This command needs to be done with root privileges.&lt;br /&gt;
&lt;br /&gt;
             $ quotaon /&lt;br /&gt;
&lt;br /&gt;
        Step 8:&lt;br /&gt;
&lt;br /&gt;
           Check &amp;quot;/etc/quotatab&amp;quot; file for the correct entries. Note that when you do the &amp;quot;mount&amp;quot; command&lt;br /&gt;
           the filesystem returned needs to match what is in the &amp;quot;quotatab&amp;quot; file. I have noticed that this&lt;br /&gt;
           is not the case by default.&lt;br /&gt;
&lt;br /&gt;
             $ mount&lt;br /&gt;
             /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw,usrquota,grpquota)&lt;br /&gt;
&lt;br /&gt;
           So the &amp;quot;/etc/quotatab&amp;quot; must contain the following line.&lt;br /&gt;
&lt;br /&gt;
             /dev/mapper/VolGroup00-LogVol00: This is the Volume group&lt;br /&gt;
&lt;br /&gt;
        Step 9:&lt;br /&gt;
&lt;br /&gt;
           Run &amp;quot;warnquota&amp;quot; as a check that the &amp;quot;/etc/quotatab&amp;quot; files is setup correctly.&lt;br /&gt;
&lt;br /&gt;
              $ warnquota&lt;br /&gt;
&lt;br /&gt;
        Step 10:&lt;br /&gt;
&lt;br /&gt;
           Setup a daily cron job for running &amp;quot;warnquota&amp;quot;. The following should be placed&lt;br /&gt;
           in &amp;quot;/etc/cron.daily&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              #!/bin/sh&lt;br /&gt;
              # Place this file in /etc/cron.daily&lt;br /&gt;
              # with rights 0755&lt;br /&gt;
              /usr/sbin/warnquota&lt;br /&gt;
              EXITVALUE=$?&lt;br /&gt;
              if [ $EXITVALUE != 0 ]; then&lt;br /&gt;
                 /usr/bin/logger -t warnquota &amp;quot;ALERT exited abnormally with [$EXITVALUE]&amp;quot;&lt;br /&gt;
              fi&lt;br /&gt;
              exit 0&lt;br /&gt;
&lt;br /&gt;
      References:&lt;br /&gt;
        http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/sysadmin-guide/ch-disk-quotas.html&lt;br /&gt;
        (TIP 6, TIP 186, and TIP 205)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 168:&lt;br /&gt;
&lt;br /&gt;
     rdist - remote file distribution client program. You can use this program in combination with&lt;br /&gt;
     ssh. This program does more than just copy files. Once a file has been copied, you can dictate&lt;br /&gt;
     other actions to be performed. Or you can hold off copying all together if the destination is&lt;br /&gt;
     running low on inodes, or disk space.&lt;br /&gt;
&lt;br /&gt;
     For the purpose of this example, all commands will been run on &amp;quot;squeezel.squeezel.com&amp;quot;, and the&lt;br /&gt;
     computers that will be updated are &amp;quot;tape.squeezel.com&amp;quot; and &amp;quot;closet.squeezel.com&amp;quot;. Obviously, you&lt;br /&gt;
     would substitute your computer names.&lt;br /&gt;
&lt;br /&gt;
     It helps to setup ssh keys on each computer first. Reference [http://souptonuts.sourceforge.net/sshtips.htm]&lt;br /&gt;
     and (TIP 12).&lt;br /&gt;
&lt;br /&gt;
     Step 1: Create the Configuration file myDistfile&lt;br /&gt;
&lt;br /&gt;
       Below is my sample &amp;quot;myDistfile&amp;quot;. This file will access hosts &amp;quot;tape.squeezel.com&amp;quot; using username chirico&lt;br /&gt;
       and &amp;quot;closet.squeezel.com&amp;quot; with the username running this command, and copy the&lt;br /&gt;
       files &amp;quot;/home/chirico/file1&amp;quot; and &amp;quot;/home/chirico/file2&amp;quot; to the these two servers creating the&lt;br /&gt;
       directory ~/tmpdir if it doesn't exist. Once these files are updated, a mail check (&amp;quot;sendmail -bv&amp;quot;)&lt;br /&gt;
       will be performed, and mail will be sent to &amp;quot;chirico@squeezel&amp;quot;. This happens twice, once for each file.&lt;br /&gt;
&lt;br /&gt;
       Note, the line &amp;quot;/home/chirico/file2 -&amp;gt; tape.squeezel.com&amp;quot; which moves the file &amp;quot;file2&amp;quot; to&lt;br /&gt;
       tape.squeezel.com renaming the file to &amp;quot;tapedest&amp;quot; in the directory &amp;quot;/home/chirico&amp;quot;. Once this file&lt;br /&gt;
       is copied, the rights are modified to &amp;quot;chmod +r&amp;quot;.  Likewise, &amp;quot;/home/chirico/file2 -&amp;gt; closet.squeezel.com&amp;quot;&lt;br /&gt;
       copies the file file2, which is renamed as closetdest.&lt;br /&gt;
&lt;br /&gt;
                 # Contents of myDistfile&lt;br /&gt;
                 HOSTS = ( chirico@tape.squeezel.com closet.squeezel.com )&lt;br /&gt;
&lt;br /&gt;
                 FILES = ( /home/chirico/file1 /home/chirico/file2 )&lt;br /&gt;
&lt;br /&gt;
                 ${FILES} -&amp;gt; ${HOSTS}&lt;br /&gt;
                    # Directory tmpdir will be created if it doesn't exist&lt;br /&gt;
                    install tmpdir ;&lt;br /&gt;
                    special /home/chirico/file1  &amp;quot;/usr/sbin/sendmail -bv mchirico@gmail.com&amp;quot;;&lt;br /&gt;
                    notify chirico@squeezel;&lt;br /&gt;
&lt;br /&gt;
                 /home/chirico/file2 -&amp;gt; tape.squeezel.com&lt;br /&gt;
                    install  /home/chirico/tapedest;&lt;br /&gt;
                    special  /home/chirico/tapedest &amp;quot;chmod +r /home/chirico/tapedest&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
                 /home/chirico/file2 -&amp;gt; closet.squeezel.com&lt;br /&gt;
                    install /home/chirico/closetdest;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 2: Command from squeezel.squeezel.com to run myDistfile above&lt;br /&gt;
&lt;br /&gt;
       Below is the command that will execute the contents in &amp;quot;myDistfile&amp;quot;. This command is run from the&lt;br /&gt;
       computer &amp;quot;squeezel.squeezel.com&amp;quot;. All output will go in the file &amp;quot;cmd1rdist.log&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
           $ rdist -P /usr/local/bin/ssh -f ./myDistfile -l file=./cmd1rdist.log=all&lt;br /&gt;
&lt;br /&gt;
       Obviously you want a secure copy (using scp), so the -P option uses ssh as your secure&lt;br /&gt;
       transport mechanism.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 169:&lt;br /&gt;
&lt;br /&gt;
     Restricting root logins (/etc/securetty). ctl-alt-F4 will give you a prompt for tty3. Note&lt;br /&gt;
     that it is one number less. Take a look at the contents of &amp;quot;/etc/securetty&amp;quot;. To prevent&lt;br /&gt;
     root from logging in on this device, take out tty3 from this listing. Note, you can always&lt;br /&gt;
     login as another user, then, su to root.  Below is an example of the default&lt;br /&gt;
     &amp;quot;/etc/securetty&amp;quot; that allows root to login to everything.&lt;br /&gt;
&lt;br /&gt;
         [root@squeezel ~]# cat /etc/securetty&lt;br /&gt;
         console&lt;br /&gt;
         vc/1&lt;br /&gt;
         vc/2&lt;br /&gt;
         vc/3&lt;br /&gt;
         vc/4&lt;br /&gt;
         vc/5&lt;br /&gt;
         vc/6&lt;br /&gt;
         vc/7&lt;br /&gt;
         vc/8&lt;br /&gt;
         vc/9&lt;br /&gt;
         vc/10&lt;br /&gt;
         vc/11&lt;br /&gt;
         tty1&lt;br /&gt;
         tty2&lt;br /&gt;
         tty3&lt;br /&gt;
         tty4&lt;br /&gt;
         tty5&lt;br /&gt;
         tty6&lt;br /&gt;
         tty7&lt;br /&gt;
         tty8&lt;br /&gt;
         tty9&lt;br /&gt;
         tty10&lt;br /&gt;
         tty11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 170:&lt;br /&gt;
&lt;br /&gt;
     Perl map function. Try the following to get a quick take on this function,&lt;br /&gt;
     which increments each value in the array a;&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map {$_++} @a;&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot; } @a;&lt;br /&gt;
&lt;br /&gt;
     or&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     And you can easily make modifications, like reversing the order&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     Plus there is a grep() function that works on each element as well&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse grep{ $_ &amp;gt; 3} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
     To get only odd numbers in reverse order:&lt;br /&gt;
&lt;br /&gt;
         #!/usr/bin/perl&lt;br /&gt;
         @a = (1,2,3);&lt;br /&gt;
         map { print &amp;quot;$_\n&amp;quot;} reverse grep{ !($_ % 2)} map {++$_} @a;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference: http://www-128.ibm.com/developerworks/linux/library/l-road4.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 171:&lt;br /&gt;
&lt;br /&gt;
     Perl - subroutine call and shifting through variables. A simple and useful&lt;br /&gt;
     technique.&lt;br /&gt;
&lt;br /&gt;
          #!/usr/bin/perl&lt;br /&gt;
          sub test {&lt;br /&gt;
            local $mval;&lt;br /&gt;
            while( $mval = shift ) {&lt;br /&gt;
              print &amp;quot; $mval\n&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          test(&amp;quot;one&amp;quot;,&amp;quot;two&amp;quot;,&amp;quot;three&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 172:&lt;br /&gt;
&lt;br /&gt;
     Tcp wrappers - First &amp;quot;/etc/hosts.allow&amp;quot; is check, and if there is an entry in this file, no more&lt;br /&gt;
     checking it done.  If are no matches in &amp;quot;/etc/hosts.allow&amp;quot;, the &amp;quot;/etc/hosts.deny&amp;quot; file is checked&lt;br /&gt;
     and if a match is found, that service is blocked for that host.&lt;br /&gt;
&lt;br /&gt;
     Example &amp;quot;/etc/hosts.deny&amp;quot; file:&lt;br /&gt;
&lt;br /&gt;
         sshd: 192.168.1.171&lt;br /&gt;
&lt;br /&gt;
     The above file blocks access to computer 192.168.1.171. It's also possible to run commands when&lt;br /&gt;
     someone from this computer tries to ssh in. This example sends mail.&lt;br /&gt;
&lt;br /&gt;
         sshd: 192.168.1.171: spawn (echo -e &amp;quot;%d %h %H %u&amp;quot;| /bin/mail -s 'hosts.deny entry' root)&lt;br /&gt;
&lt;br /&gt;
     Of course, you can also run commands in the &amp;quot;/etc/hosts.allow&amp;quot; if you wanted mail sent for a successful&lt;br /&gt;
     login.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 173:&lt;br /&gt;
&lt;br /&gt;
     pgrep, pkill - look up or signal process based on name and other attributes.&lt;br /&gt;
&lt;br /&gt;
     To quick find all instances of ssh running, for user root, execute the following&lt;br /&gt;
     command:&lt;br /&gt;
&lt;br /&gt;
           $ pgrep -u root -l ssh&lt;br /&gt;
&lt;br /&gt;
     To kill a process, or send a signal use the &amp;quot;pkill&amp;quot; option. For example, to&lt;br /&gt;
     make syslog reread its configuration file:&lt;br /&gt;
&lt;br /&gt;
           $ pkill -HUP syslogd&lt;br /&gt;
&lt;br /&gt;
     Another command command is &amp;quot;pidof&amp;quot; that can tell you how many processes are running.&lt;br /&gt;
     This can be useful for detecting DOS attacks.&lt;br /&gt;
&lt;br /&gt;
           $ pidof sshd&lt;br /&gt;
           4783 4781 30008 30006 29888 29886 2246&lt;br /&gt;
&lt;br /&gt;
     Above there are 7 sshd's running. Reference &amp;quot;Tcpdump, Raw Socket and Libpap Tutorial&amp;quot;&lt;br /&gt;
     at [http://souptonuts.sourceforge.net/tcpdump_tutorial.html].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 174:&lt;br /&gt;
&lt;br /&gt;
     Password Cracking - tools to check your users passwords:&lt;br /&gt;
&lt;br /&gt;
      John The Ripper&lt;br /&gt;
        http://www.openwall.com/john/&lt;br /&gt;
&lt;br /&gt;
      Crack&lt;br /&gt;
        http://www.crypticide.com/users/alecm/&lt;br /&gt;
&lt;br /&gt;
      Slurpie&lt;br /&gt;
        http://www.ussrback.com/distributed.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 175:&lt;br /&gt;
&lt;br /&gt;
     Password Aging - setting the number of days a password is valid.&lt;br /&gt;
&lt;br /&gt;
         $ chage -M 90 &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 176:&lt;br /&gt;
&lt;br /&gt;
     Kernel Performance Tuning - /Documentation/sysctl/vm.txt documents kernel settings to&lt;br /&gt;
     improve performance. Below are some examples.&lt;br /&gt;
&lt;br /&gt;
       overcommit_memory:  0 -- default estimates the amount of memory for malloc&lt;br /&gt;
                           1 -- kernel pretends there is always enough memory until it runs out&lt;br /&gt;
                           3 -- never overcommit&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/overcommit_memory&lt;br /&gt;
          0&lt;br /&gt;
&lt;br /&gt;
       page-cluster:&lt;br /&gt;
            The Linux VM subsystem avoids excessive disk seeks by reading&lt;br /&gt;
            multiple pages on a page fault. The number of pages it reads&lt;br /&gt;
            is dependent on the amount of memory in your machine.&lt;br /&gt;
        &lt;br /&gt;
            The number of pages the kernel reads in at once is equal to&lt;br /&gt;
            2 ^ page-cluster. Values above 2 ^ 5 don't make much sense&lt;br /&gt;
            for swap because we only cluster swap data in 32-page groups.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/page-cluster&lt;br /&gt;
          3&lt;br /&gt;
&lt;br /&gt;
       min_free_kbytes:&lt;br /&gt;
            This is used to force the Linux VM to keep a minimum number&lt;br /&gt;
            of kilobytes free.  The VM uses this number to compute a pages_min&lt;br /&gt;
            value for each lowmem zone in the system.  Each lowmem zone gets&lt;br /&gt;
            a number of reserved free pages based proportionally on its size.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/min_free_kbytes&lt;br /&gt;
          3831&lt;br /&gt;
&lt;br /&gt;
       max_map_count:&lt;br /&gt;
            This file contains the maximum number of memory map areas a process&lt;br /&gt;
            may have. Memory map areas are used as a side-effect of calling&lt;br /&gt;
            malloc, directly by mmap and mprotect, and also when loading shared&lt;br /&gt;
            libraries.&lt;br /&gt;
&lt;br /&gt;
            While most applications need less than a thousand maps, certain&lt;br /&gt;
            programs, particularly malloc debuggers, may consume lots of them,&lt;br /&gt;
            e.g., up to one or two maps per allocation.&lt;br /&gt;
&lt;br /&gt;
            The default value is 65536.&lt;br /&gt;
&lt;br /&gt;
          $ cat /proc/sys/vm/max_map_count&lt;br /&gt;
          65536&lt;br /&gt;
&lt;br /&gt;
        Also see http://people.redhat.com/alikins/system_tuning.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 177:&lt;br /&gt;
&lt;br /&gt;
     IO Scheduler - /Documentation/block/as-iosched.txt documents kernel settings for disk&lt;br /&gt;
     performance.&lt;br /&gt;
&lt;br /&gt;
     If you're not sure what partitions you have &amp;quot;$ cat /proc/partitions&amp;quot;. This example&lt;br /&gt;
     assumes hda, and you can see some of the kernel settings:&lt;br /&gt;
&lt;br /&gt;
          $ ls /sys/block/hda/queue/iosched&lt;br /&gt;
          back_seek_max  back_seek_penalty  clear_elapsed  fifo_batch_expire  fifo_expire_async&lt;br /&gt;
           fifo_expire_sync  find_best_crq  key_type  quantum  queued&lt;br /&gt;
&lt;br /&gt;
     References: http://lwn.net/Articles/102505/&lt;br /&gt;
                 http://bhhdoa.org.au/pipermail/ck/2004-September/000961.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 178:&lt;br /&gt;
&lt;br /&gt;
     iozone -- getting data on disk performance (http://www.iozone.org/). This is a very&lt;br /&gt;
     comprehensive package.&lt;br /&gt;
&lt;br /&gt;
           $ wget http://www.iozone.org/src/current/iozone3_242.tar&lt;br /&gt;
           $ tar -xf iozone3_242.tar&lt;br /&gt;
           $ cd iozone3_242/src/current&lt;br /&gt;
           $ make linux&lt;br /&gt;
&lt;br /&gt;
     At this point you should read the documentation. There is no &amp;quot;make install&amp;quot;. You&lt;br /&gt;
     copy it to each filesystem you want to run this program on. Below are some quick&lt;br /&gt;
     start commands.&lt;br /&gt;
&lt;br /&gt;
       Good comprehensive test.&lt;br /&gt;
&lt;br /&gt;
           $ iozone -a&lt;br /&gt;
&lt;br /&gt;
       I prefer this for small filesystems. It limits the record size to 10000 and does&lt;br /&gt;
       the output in operations per second (higher numbers mean faster drive).&lt;br /&gt;
&lt;br /&gt;
           $ ./iozone -a -s 10000 -O&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 179:&lt;br /&gt;
&lt;br /&gt;
     history - bash command to get a history of all commands typed. But, here is a way&lt;br /&gt;
     that you can get date and time listed as well.&lt;br /&gt;
&lt;br /&gt;
           $ HISTTIMEFORMAT=&amp;quot;%y/%m/%d %T &amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Defining the environment variable above give you the date/time info when you&lt;br /&gt;
     execute history:&lt;br /&gt;
&lt;br /&gt;
           $ history&lt;br /&gt;
              ...&lt;br /&gt;
               175  05/06/30 12:51:46 grep '141.162.' mout &amp;gt; mout2&lt;br /&gt;
               176  05/06/30 12:51:48 e mout2&lt;br /&gt;
               177  05/06/30 12:56:59 ls&lt;br /&gt;
               178  05/06/30 12:57:02 ls&lt;br /&gt;
               179  05/06/30 12:57:39 ls&lt;br /&gt;
               180  05/06/30 12:57:49 ls -l&lt;br /&gt;
               181  05/06/30 13:01:10 history&lt;br /&gt;
               182  05/06/30 13:01:20 HISTTIMEFORMAT=&amp;quot;%y/%m/%d %T &amp;quot;&lt;br /&gt;
               183  05/06/30 13:01:23 history&lt;br /&gt;
              ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 180:&lt;br /&gt;
&lt;br /&gt;
     .config - Fedora Core getting the .config to rebuild the kernel. You can find&lt;br /&gt;
     this file, the &amp;quot;.config&amp;quot; file at the following location:&lt;br /&gt;
&lt;br /&gt;
          $ ls &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     Or, to see the contents&lt;br /&gt;
&lt;br /&gt;
          $ cat &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     This can be important, if you're planning to build your own kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 181:&lt;br /&gt;
&lt;br /&gt;
     Listing control key settings.&lt;br /&gt;
&lt;br /&gt;
          $ stty -a&lt;br /&gt;
          speed 38400 baud; rows 0; columns 0; line = 0;&lt;br /&gt;
          intr = ^C; quit = ^\; erase = &amp;lt;undef&amp;gt;; kill = &amp;lt;undef&amp;gt;; eof = ^D; eol = &amp;lt;undef&amp;gt;; eol2 = &amp;lt;undef&amp;gt;; start = ^Q;&lt;br /&gt;
          stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;&lt;br /&gt;
          -parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts&lt;br /&gt;
          -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel&lt;br /&gt;
          opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0&lt;br /&gt;
          isig icanon iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 182:&lt;br /&gt;
&lt;br /&gt;
     iptables DNAT and SNAT. You have a webserver on 192.168.1.71. When people query this webserver, you want them&lt;br /&gt;
     to goto 192.168.1.81, with no indication that they are going to another web server. In fact, they always make&lt;br /&gt;
     their web hits to 192.168.1.71.&lt;br /&gt;
&lt;br /&gt;
     The following is the iptables commands:&lt;br /&gt;
&lt;br /&gt;
        $ echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
        $ iptables -t nat -A PREROUTING -d 192.168.1.71 -p tcp --dport 80 -j DNAT --to 192.168.1.81&lt;br /&gt;
        $ iptables -t nat -A POSTROUTING -d 192.168.1.81 -s 192.168.1.0/24 -p tcp --dport 80 -j SNAT --to 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
     Change 192.168.1.0/24 to whatever source you expect the web browser to come in on. Below is the tcpdump showing&lt;br /&gt;
     all traffic is relayed via 192.168.1.71&lt;br /&gt;
&lt;br /&gt;
         [root@closet iptables]# tcpdump -nN port 80&lt;br /&gt;
&lt;br /&gt;
         17:34:58.790398 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: S 3620106373:3620106373(0) win 16384 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790465 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: S 3620106373:3620106373(0) win 16384 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790703 IP 192.168.1.81.80 &amp;gt; 192.168.1.71.1158: S 1973665156:1973665156(0) ack 3620106374 win 5840 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790720 IP 192.168.1.71.80 &amp;gt; 192.168.1.102.1158: S 1973665156:1973665156(0) ack 3620106374 win 5840 &amp;lt;mss 1460,nop,nop,sackOK&amp;gt;&lt;br /&gt;
         17:34:58.790951 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: . ack 1 win 17520&lt;br /&gt;
         17:34:58.790965 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: . ack 1 win 17520&lt;br /&gt;
         17:34:58.791451 IP 192.168.1.102.1158 &amp;gt; 192.168.1.71.80: P 1:327(326) ack 1 win 17520&lt;br /&gt;
         17:34:58.791472 IP 192.168.1.71.1158 &amp;gt; 192.168.1.81.80: P 1:327(326) ack 1 win 17520&lt;br /&gt;
         17:34:58.791973 IP 192.168.1.81.80 &amp;gt; 192.168.1.71.1158: . ack 327 win 6432&lt;br /&gt;
&lt;br /&gt;
     Above the web client is on &amp;quot;192.168.1.102&amp;quot;. You can see that the 1st server &amp;quot;192.168.1.71&amp;quot; then goes out to&lt;br /&gt;
     the 2nd server &amp;quot;192.168.1.81&amp;quot; on the second line. The third line shows the 2nd server &amp;quot;192.168.1.81&amp;quot; responding to&lt;br /&gt;
     the 1st server, and the forth line passes this data back to the web client &amp;quot;192.168.1.102&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     Note: You can save your current iptables setting with the following command:&lt;br /&gt;
&lt;br /&gt;
         $ iptables-save &amp;gt; iptables_store&lt;br /&gt;
&lt;br /&gt;
       The big advantage is that you can store the counters as well.&lt;br /&gt;
&lt;br /&gt;
         $ iptables-save -c &amp;gt; iptables_store_w_cnts&lt;br /&gt;
&lt;br /&gt;
       To restore the file, use the following:&lt;br /&gt;
&lt;br /&gt;
         $ iptables-restore -c &amp;lt; iptables_store_w_cnts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 183:&lt;br /&gt;
&lt;br /&gt;
     mailstats - display mail statistics. This file reads data from &amp;quot;/var/log/mail/statistics&amp;quot;&lt;br /&gt;
&lt;br /&gt;
         [root@closet ~]# mailstats&lt;br /&gt;
         Statistics from Sat Jun 25 15:59:52 2005&lt;br /&gt;
          M   msgsfr  bytes_from   msgsto    bytes_to  msgsrej msgsdis msgsqur  Mailer&lt;br /&gt;
          4        1          2K        0          0K        0       0       0  esmtp&lt;br /&gt;
          9        0          0K        1          2K        0       0       0  local&lt;br /&gt;
         =====================================================================&lt;br /&gt;
          T        1          2K        1          2K        0       0       0&lt;br /&gt;
          C        1                    0                    0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 184:&lt;br /&gt;
&lt;br /&gt;
     Profiling C Applications - Assume you have the following program p1.c:&lt;br /&gt;
&lt;br /&gt;
         /* Program  p1.c */&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
         t1(int i)&lt;br /&gt;
         {&lt;br /&gt;
                 printf(&amp;quot;t1:%d\n&amp;quot;, i);&lt;br /&gt;
         }&lt;br /&gt;
        &lt;br /&gt;
         t2(int j)&lt;br /&gt;
         {&lt;br /&gt;
                 printf(&amp;quot;t2:%d\n&amp;quot;, j);&lt;br /&gt;
         }&lt;br /&gt;
        &lt;br /&gt;
         int main(void)&lt;br /&gt;
         {&lt;br /&gt;
                 int i, j;&lt;br /&gt;
        &lt;br /&gt;
                 for (i = 0; i &amp;lt; 5; ++i) {&lt;br /&gt;
                         t1(i);&lt;br /&gt;
                         for (j = 0; j &amp;lt; 2; ++j) {&lt;br /&gt;
                                 t2(j);&lt;br /&gt;
                         }&lt;br /&gt;
                 }&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
     Compile the program as follows:&lt;br /&gt;
&lt;br /&gt;
        $ gcc -pg -g -o p1 p1.c&lt;br /&gt;
        $ ./p1&lt;br /&gt;
        t1:0&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:1&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:2&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:3&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
        t1:4&lt;br /&gt;
        t2:0&lt;br /&gt;
        t2:1&lt;br /&gt;
&lt;br /&gt;
     Next, to get the profile graph.&lt;br /&gt;
&lt;br /&gt;
        $ gprof -p -b p1&lt;br /&gt;
        Flat profile:&lt;br /&gt;
        &lt;br /&gt;
        Each sample counts as 0.01 seconds.&lt;br /&gt;
         no time accumulated&lt;br /&gt;
        &lt;br /&gt;
          %   cumulative   self              self     total&lt;br /&gt;
         time   seconds   seconds    calls  Ts/call  Ts/call  name&lt;br /&gt;
          0.00      0.00     0.00       10     0.00     0.00  t2&lt;br /&gt;
          0.00      0.00     0.00        5     0.00     0.00  t1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Above note the 10 calls to t2 and 5 calls to t1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 185:&lt;br /&gt;
&lt;br /&gt;
     CDPATH - this is a bash variable like PATH that defines a search path&lt;br /&gt;
              for the cd command.&lt;br /&gt;
&lt;br /&gt;
     Suppose you have the following directory structure:&lt;br /&gt;
&lt;br /&gt;
             /home/chirico/stuff&lt;br /&gt;
                               |-- dirA&lt;br /&gt;
                               `-- dirB&lt;br /&gt;
&lt;br /&gt;
     Assume you define CDPATH as follows:&lt;br /&gt;
&lt;br /&gt;
             CDPATH=/home/chirico/stuff&lt;br /&gt;
&lt;br /&gt;
     Now, no matter what directory you are in if you use the cd command below&lt;br /&gt;
     you will automatically move to &amp;quot;/home/chirico/stuff/dirA&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             $ cd dirA&lt;br /&gt;
&lt;br /&gt;
     Note you could be in &amp;quot;/etc&amp;quot; and will move directly to &amp;quot;/home/chirico/stuff/dirA&amp;quot;.&lt;br /&gt;
     This command has the same format as PATH - multiple entries are separated by a colon.&lt;br /&gt;
     If the current directory contain a sub-directory dirA, then, it gets priority.&lt;br /&gt;
&lt;br /&gt;
     The following is part of my .bash_profile&lt;br /&gt;
&lt;br /&gt;
             CDPATH=/work/cpearls/src/posted_on_sf/:/work/souptonuts/documentation/:/home/chirico/deleteme/&lt;br /&gt;
             export PATH CVS_RSH EDITOR JAVA_HOME CDPATH&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 186:&lt;br /&gt;
&lt;br /&gt;
     Groups - add groups and users to groups. The following shows how to create the group &amp;quot;share&amp;quot;&lt;br /&gt;
              and add the user &amp;quot;chirico&amp;quot; to this group. The following should be done as root, and&lt;br /&gt;
              assumes the account &amp;quot;chirico&amp;quot; already exits.&lt;br /&gt;
&lt;br /&gt;
             $ groupadd share&lt;br /&gt;
             $ usermod -G share chirico&lt;br /&gt;
&lt;br /&gt;
     Note the change made to &amp;quot;/etc/group&amp;quot; below:&lt;br /&gt;
&lt;br /&gt;
             $ cat /etc/group|grep 'share'&lt;br /&gt;
             share:x:616:chirico&lt;br /&gt;
&lt;br /&gt;
     If the user chirico is currently logged in, he should run the following&lt;br /&gt;
     command to immediately have group &amp;quot;share&amp;quot; rights. Or, the next time he logs&lt;br /&gt;
     in he will have access to this group.&lt;br /&gt;
&lt;br /&gt;
             $ newgrp share&lt;br /&gt;
&lt;br /&gt;
     Reference the following (TIP 6, TIP 167).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 187:&lt;br /&gt;
&lt;br /&gt;
     oprofile - steps for running oprofile on Fedora.&lt;br /&gt;
&lt;br /&gt;
     Step 1:&lt;br /&gt;
&lt;br /&gt;
       Find out what version of the kernel you are running.&lt;br /&gt;
&lt;br /&gt;
           $ uname -a&lt;br /&gt;
           Linux closet.squeezel.com 2.6.12-1.1398_FC4 #1 Fri Jul 15 00:52:32 EDT 2005 i686 i686 i386 GNU/Linux&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 2:&lt;br /&gt;
&lt;br /&gt;
       Download the source in a chosen directory. Above, I'm running 2.6.12-1, but I'm going to go for 2.6.12.3, since&lt;br /&gt;
       it's a little later. You want the signed file as well.&lt;br /&gt;
&lt;br /&gt;
           $ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.12.3.tar.gz&lt;br /&gt;
           $ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.12.3.tar.gz.sign&lt;br /&gt;
&lt;br /&gt;
       Now, check the signature.&lt;br /&gt;
&lt;br /&gt;
           $ gpg --verify linux-2.6.12.3.tar.gz.sign linux-2.6.12.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 3:&lt;br /&gt;
&lt;br /&gt;
       Unpack the file.&lt;br /&gt;
&lt;br /&gt;
           $ tar -xzf linux-2.6.12.3.tar.gz&lt;br /&gt;
           $ cd cd linux-2.6.12.3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 4:&lt;br /&gt;
&lt;br /&gt;
       Copy the &amp;quot;.config&amp;quot; used to compile your previous kernel. You should find it&lt;br /&gt;
       in the following direcotry &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
       Copy it to the linux-2.6.12.3 directory.&lt;br /&gt;
&lt;br /&gt;
           $ cp &amp;quot;/lib/modules/$(uname -r)/build/.config&amp;quot; .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 5:&lt;br /&gt;
&lt;br /&gt;
       Run make as follows. It will ask for a few questions on &amp;quot;make oldconfig&amp;quot;. The&lt;br /&gt;
       make installs below will have to be done with root privileges.&lt;br /&gt;
&lt;br /&gt;
          $ make oldconfig&lt;br /&gt;
          $ make bzImage&lt;br /&gt;
          $ make modules&lt;br /&gt;
          $ make modules_install&lt;br /&gt;
          $ make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 6:&lt;br /&gt;
&lt;br /&gt;
       Edit the &amp;quot;/boot/grub/grub.conf&amp;quot; and set default = 0  as shown below in this&lt;br /&gt;
       file.&lt;br /&gt;
&lt;br /&gt;
            default=0&lt;br /&gt;
            timeout=5&lt;br /&gt;
            splashimage=(hd0,2)/grub/splash.xpm.gz&lt;br /&gt;
            hiddenmenu&lt;br /&gt;
            title Fedora Core (2.6.12.3)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.12.3 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.12.3.img&lt;br /&gt;
            title Fedora Core (2.6.12-1.1398_FC4)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.12-1.1398_FC4 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.12-1.1398_FC4.img&lt;br /&gt;
            title Fedora Core (2.6.11-1.1369_FC4)&lt;br /&gt;
                    root (hd0,2)&lt;br /&gt;
                    kernel /vmlinuz-2.6.11-1.1369_FC4 ro root=/dev/VolGroup00/LogVol00 rhgb quiet&lt;br /&gt;
                    initrd /initrd-2.6.11-1.1369_FC4.img&lt;br /&gt;
            title Other&lt;br /&gt;
                    rootnoverify (hd0,1)&lt;br /&gt;
                    chainloader +1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 7:&lt;br /&gt;
&lt;br /&gt;
       Shutdown with the restart option.&lt;br /&gt;
&lt;br /&gt;
           $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Step 8:&lt;br /&gt;
&lt;br /&gt;
       Run opcontrol. The commands below are done as root.  My kernel was compiled in the following&lt;br /&gt;
       directory &amp;quot;/home/kernel/linux-2.6.12.3/&amp;quot;, so I'll run opcontrol as follows:&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --vmlinux=/home/kernel/linux-2.6.12.3/vmlinux&lt;br /&gt;
&lt;br /&gt;
       Now start.&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --start&lt;br /&gt;
           Using 2.6+ OProfile kernel interface.&lt;br /&gt;
           Reading module info.&lt;br /&gt;
           Using log file /var/lib/oprofile/oprofiled.log&lt;br /&gt;
           Daemon started.&lt;br /&gt;
           Profiler running.&lt;br /&gt;
&lt;br /&gt;
       Shutdown opcontrol.&lt;br /&gt;
&lt;br /&gt;
           $ opcontrol --shutdown&lt;br /&gt;
&lt;br /&gt;
       Run report.&lt;br /&gt;
&lt;br /&gt;
           $ opreport&lt;br /&gt;
&lt;br /&gt;
           CPU: CPU with timer interrupt, speed 0 MHz (estimated)&lt;br /&gt;
           Profiling through timer interrupt&lt;br /&gt;
                     TIMER:0|&lt;br /&gt;
             samples|      %|&lt;br /&gt;
           ------------------&lt;br /&gt;
              156088 99.8746 vmlinux&lt;br /&gt;
                  60  0.0384 libc-2.3.5.so&lt;br /&gt;
                  30  0.0192 oprofiled&lt;br /&gt;
                  23  0.0147 libcrypto.so.0.9.7f&lt;br /&gt;
                  13  0.0083 bash&lt;br /&gt;
                  12  0.0077 screen&lt;br /&gt;
                  10  0.0064 sshd&lt;br /&gt;
                   9  0.0058 ssh&lt;br /&gt;
                   6  0.0038 ip_tables&lt;br /&gt;
                   6  0.0038 libncurses.so.5.4&lt;br /&gt;
                   5  0.0032 b44&lt;br /&gt;
                   5  0.0032 ext3&lt;br /&gt;
                   5  0.0032 ld-2.3.5.so&lt;br /&gt;
                   4  0.0026 ip_conntrack&lt;br /&gt;
                   4  0.0026 jbd&lt;br /&gt;
                   2  0.0013 grep&lt;br /&gt;
                   1 6.4e-04 libdns.so.20.0.2&lt;br /&gt;
                   1 6.4e-04 libisc.so.9.1.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Reference the following for more documentation:&lt;br /&gt;
             http://oprofile.sourceforge.net/doc/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 188:&lt;br /&gt;
&lt;br /&gt;
     cyrus-imapd with Postfix using sasldb for authentication. For this example&lt;br /&gt;
     the server is tape.squeezel.com and the user is chirico.&lt;br /&gt;
&lt;br /&gt;
        Step 1:&lt;br /&gt;
        &lt;br /&gt;
                   $ yum install cyrus-imapd&lt;br /&gt;
                   $ yum install cyrus-imapd-utils&lt;br /&gt;
        &lt;br /&gt;
            You need &amp;quot;cyrus-imapd-utils&amp;quot; for cyradm.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 2:&lt;br /&gt;
        &lt;br /&gt;
          Edit /etc/imapd.conf&lt;br /&gt;
        &lt;br /&gt;
               configdirectory: /var/lib/imap&lt;br /&gt;
               partition-default: /var/spool/imap&lt;br /&gt;
               admins: cyrus&lt;br /&gt;
               sievedir: /var/lib/imap/sieve&lt;br /&gt;
               sendmail: /usr/sbin/sendmail&lt;br /&gt;
               hashimapspool: true&lt;br /&gt;
               # Chirico Commented the below line&lt;br /&gt;
               # sasl_pwcheck_method: saslauthd&lt;br /&gt;
               # Because using sasldb&lt;br /&gt;
               sasl_pwcheck_method: auxprop&lt;br /&gt;
               sasl_auxprop_plugin: sasldb&lt;br /&gt;
               #  Chirico end change&lt;br /&gt;
               sasl_mech_list: PLAIN&lt;br /&gt;
               tls_cert_file: /usr/share/ssl/certs/cyrus-imapd.pem&lt;br /&gt;
               tls_key_file: /usr/share/ssl/certs/cyrus-imapd.pem&lt;br /&gt;
               tls_ca_file: /usr/share/ssl/certs/ca-bundle.crt&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 3:&lt;br /&gt;
        &lt;br /&gt;
           Create a user and password:&lt;br /&gt;
        &lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` cyrus&lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` chirico&lt;br /&gt;
              $ saslpasswd2 -c -u `postconf -h myhostname` allmail&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
           This will automatically create the file /etc/sasldb2. But look&lt;br /&gt;
           at the default rights, assuming you ran saslpasswd2 as root:&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /etc/sasldb2&lt;br /&gt;
                 -rw-r-----  1 root root 12288 Jul 31 09:50 /etc/sasldb2&lt;br /&gt;
        &lt;br /&gt;
           We need to correct this in step 4.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 4:&lt;br /&gt;
        &lt;br /&gt;
                 $ chown root.mail /etc/sasldb2&lt;br /&gt;
                 $ ls -l /etc/sasldb2&lt;br /&gt;
                 -rw-r-----  1 root mail 12288 Jul 31 09:50 /etc/sasldb2&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 5:&lt;br /&gt;
        &lt;br /&gt;
            Update &amp;quot;/etc/postfix/main.cf&amp;quot;. Note in /etc/imapd.conf the configdirectory&lt;br /&gt;
            points to /var/lib/imap, and if I look at this directory I see the&lt;br /&gt;
            socket directory. However, after staring /etc/init.d/cyrus-imapd  there&lt;br /&gt;
            will be a socket file &amp;quot;/var/lib/imap/socket/lmtp&amp;quot;. (See step 6).&lt;br /&gt;
        &lt;br /&gt;
                  mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp&lt;br /&gt;
                  mailbox_transport = cyrus&lt;br /&gt;
        &lt;br /&gt;
            Restart postfix.&lt;br /&gt;
        &lt;br /&gt;
                  /etc/init.d/postfix restart&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 6:&lt;br /&gt;
&lt;br /&gt;
            Start cyrus-imapd and look for the socket file.&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
                   $ /etc/init.d/cyrus-imapd restart&lt;br /&gt;
                   Shutting down cyrus-imapd:                                 [  OK  ]&lt;br /&gt;
                   Starting cyrus-imapd: preparing databases... done.         [  OK  ]&lt;br /&gt;
        &lt;br /&gt;
            Now you should see the lmtp file:&lt;br /&gt;
        &lt;br /&gt;
                   $ ls -l /var/lib/imap/socket/lmtp&lt;br /&gt;
                   srwxrwxrwx  1 root root 0 Jul 31 10:04 /var/lib/imap/socket/lmtp&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 7:&lt;br /&gt;
        &lt;br /&gt;
            Add users. Note, you may have to go back to step 3 to add them to /etc/sasldb2&lt;br /&gt;
            as well.&lt;br /&gt;
        &lt;br /&gt;
                   $ su - cyrus&lt;br /&gt;
                   $ cyradm tape.squeezel.com&lt;br /&gt;
                   tape.squeezel.com&amp;gt; cm user.chirico&lt;br /&gt;
                   tape.squeezel.com&amp;gt; quit&lt;br /&gt;
        &lt;br /&gt;
            Now got back as root, and check that everything was created correctly.&lt;br /&gt;
        &lt;br /&gt;
                   $ ls /var/spool/imap/c/user/&lt;br /&gt;
                   total 8&lt;br /&gt;
                   drwx------  2 cyrus mail 4096 Jul 31 10:21 chirico&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        Step 8:&lt;br /&gt;
        &lt;br /&gt;
             Run a mail test. We'll do this as root to the chirico account.&lt;br /&gt;
        &lt;br /&gt;
                   $ mail -s 'First test'  chirico&lt;br /&gt;
                   first test&lt;br /&gt;
                   .&lt;br /&gt;
        &lt;br /&gt;
             Now, still as root check the maillog. Normally everything should work.&lt;br /&gt;
        &lt;br /&gt;
                  $ tail /var/log/maillog&lt;br /&gt;
        &lt;br /&gt;
             However, I got the following error below.&lt;br /&gt;
&lt;br /&gt;
                     Jul 31 10:29:03 tape postfix/cleanup[30124]: AE7CB1B34A4: message-id=&amp;lt;20050731142903.AE7CB1B34A4@tape.squeezel.com&amp;gt;&lt;br /&gt;
                     Jul 31 10:29:03 tape postfix/qmgr[30120]: AE7CB1B34A4: from=&amp;lt;root@tape.squeezel.com&amp;gt;, size=315, nrcpt=1 (queue active)&lt;br /&gt;
                     Jul 31 10:29:03 tape pipe[30128]: fatal: pipe_comand: execvp /cyrus/bin/deliver: No such file or directory&lt;br /&gt;
&lt;br /&gt;
             If you get a similiar error, you may need to adjust the settting in /etc/postfix/master.cf&lt;br /&gt;
        &lt;br /&gt;
                 # This is the problem in /etc/postfix/master.cf&lt;br /&gt;
                 cyrus     unix  -       n       n       -       -       pipe&lt;br /&gt;
                   user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}&lt;br /&gt;
        &lt;br /&gt;
             My deliver file is the following&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
                 -rwxr-xr-x  1 root root 846228 Apr  4 18:59 /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
        &lt;br /&gt;
             So I need to change my /etc/postfix/master.cf as follows:&lt;br /&gt;
        &lt;br /&gt;
                 # Fix because by deliver file is under  /usr/lib/cyrus-imapd/deliver&lt;br /&gt;
                 cyrus     unix  -       n       n       -       -       pipe&lt;br /&gt;
                   user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -r ${sender} -m ${extension} ${user}&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
             If changes were needed, like I had to do, restart postfix&lt;br /&gt;
        &lt;br /&gt;
                 $ /etc/init.d/postfix restart&lt;br /&gt;
        &lt;br /&gt;
             Now, if everything works, you should start to see numbers in the spool directory like &amp;quot;1.&amp;quot; and&lt;br /&gt;
             &amp;quot;2.&amp;quot;.&lt;br /&gt;
        &lt;br /&gt;
                 $ ls -l /var/spool/imap/c/user/chirico/&lt;br /&gt;
                 total 40&lt;br /&gt;
                 -rw-------  1 cyrus mail  545 Jul 31 10:44 1.&lt;br /&gt;
                 -rw-------  1 cyrus mail  547 Jul 31 10:45 2.&lt;br /&gt;
                 -rw-------  1 cyrus mail 1276 Jul 31 10:45 cyrus.cache&lt;br /&gt;
                 -rw-------  1 cyrus mail  153 Jul 31 10:21 cyrus.header&lt;br /&gt;
                 -rw-------  1 cyrus mail  196 Jul 31 10:45 cyrus.index&lt;br /&gt;
&lt;br /&gt;
        Step 9:&lt;br /&gt;
        &lt;br /&gt;
             Local firewall.&lt;br /&gt;
        &lt;br /&gt;
                 # imap&lt;br /&gt;
                iptables -A INPUT -p udp -s 192.168.1.0/24  --dport 143 -j ACCEPT&lt;br /&gt;
                iptables -A INPUT -p tcp -s 192.168.1.0/24  --dport 143 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
        Step 10:&lt;br /&gt;
        &lt;br /&gt;
             Configure cyrus-imapd to start for run-level 3 and 5.&lt;br /&gt;
&lt;br /&gt;
                 # chkconfig --level 35 cyrus-imapd on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       HINTS - &lt;br /&gt;
&lt;br /&gt;
        Something to watch out for:&lt;br /&gt;
&lt;br /&gt;
              Something to watch out for: If a user creates a .forward file in their shell account with the&lt;br /&gt;
              following entry, then, mail will not get mail relayed to cyrus.&lt;br /&gt;
&lt;br /&gt;
                  &amp;quot;|exec /usr/bin/procmail&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             The /etc/maillog will show something like this:&lt;br /&gt;
&lt;br /&gt;
                    to=&amp;lt;chirico@squeezel.squeezel.com&amp;gt;, orig_to=&amp;lt;chirico&amp;gt;, relay=local, delay=0,&lt;br /&gt;
                          status=sent (delivered to command: exec /usr/bin/procmail)&lt;br /&gt;
&lt;br /&gt;
             Remove the &amp;quot;.forward&amp;quot; file from their home directory and you'll get the following:&lt;br /&gt;
&lt;br /&gt;
                    to=&amp;lt;chirico@squeezel.squeezel.com&amp;gt;, relay=cyrus, delay=0,&lt;br /&gt;
                          status=sent (squeezel.squeezel.com)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              mutt with IMAP?  (See TIP 190)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 189:&lt;br /&gt;
&lt;br /&gt;
     expand - convert tabs to spaces in a file.&lt;br /&gt;
&lt;br /&gt;
             $ expand How_to_Linux_and_Open_Source.txt &amp;gt; notabs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 190:&lt;br /&gt;
&lt;br /&gt;
     mutt with imap - assume you have setup imap (see tip 188). Now how do you configure&lt;br /&gt;
                      your &amp;quot;.muttrc&amp;quot; file to automatically connect, securely to the IMAP server?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       &lt;br /&gt;
     Below is an example of my &amp;quot;.muttrc&amp;quot; file. For this example, assume my password is &amp;quot;S0m3paSSw0r9&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
             $ cat .muttrc&lt;br /&gt;
             set spoolfile = &amp;quot;imaps://chirico:S0m3paSSw0r9@squeezel.squeezel.com/&lt;br /&gt;
             set imap_force_ssl=yes&lt;br /&gt;
             set certificate_file=~/.mutt/certificates/72d31154.0&lt;br /&gt;
&lt;br /&gt;
     Now, you want to copy the certificate as a &amp;quot;file.pem&amp;quot; and run &amp;quot;c_rehash&amp;quot; to convert this&lt;br /&gt;
     file to a number. See the article. See the following article on how to do this under the &lt;br /&gt;
     fetchmail section.&lt;br /&gt;
&lt;br /&gt;
          http://souptonuts.sourceforge.net/postfix_tutorial.html&lt;br /&gt;
&lt;br /&gt;
     This is a quick summary of creating this key.&lt;br /&gt;
&lt;br /&gt;
             $ openssl s_client -connect squeezel.squeezel.com:995 -showcerts &amp;gt; file.pem&lt;br /&gt;
             $ c_rehash ~/.mutt/certificates&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 191:&lt;br /&gt;
&lt;br /&gt;
     Apache - CGI scripts.  There are two ways to enable CGI scripts. The second method is the&lt;br /&gt;
              prefered method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           First way, the easy way. Look for the &amp;quot;http.conf&amp;quot; file. On Fedora Core, this file can be&lt;br /&gt;
           found under &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;. Edit this file as follows to make &lt;br /&gt;
           &amp;quot;http://squeezel.squeezel.com/chirico-cgi/&amp;quot; execute scripts.&lt;br /&gt;
&lt;br /&gt;
                     ScriptAlias /chirico-cgi/ &amp;quot;/home/chirico/cgi-bin/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           Second way, the better way. Instead of doing the above, make the following change in &lt;br /&gt;
           &amp;quot;/etc/httpd/conf/httpd.conf&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
                     &amp;lt;Directory /home/chirico/cgi-bin&amp;gt;&lt;br /&gt;
                      Options +ExecCGI&lt;br /&gt;
                      SetHandler chirico-cgi&lt;br /&gt;
                     &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Running a test script. Now copy the following test script into the directory &amp;quot;/home/chirico/cgi-bin&amp;quot;&lt;br /&gt;
        and change the rights to execute for the user running this.&lt;br /&gt;
&lt;br /&gt;
                  #!/bin/sh&lt;br /&gt;
                  # Save as test.cgi&lt;br /&gt;
                  #  chown apache.apache test.cgi&lt;br /&gt;
                  #  chmod 700 test.cgi&lt;br /&gt;
                  echo &amp;quot;Content-Type: text/html&amp;quot;&lt;br /&gt;
                  echo&lt;br /&gt;
                  echo &amp;quot;Hello world from user &amp;lt;b&amp;gt;`whoami`&amp;lt;/b&amp;gt;! &amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 192:&lt;br /&gt;
&lt;br /&gt;
     Bash - using getopts for your bash scripts.&lt;br /&gt;
&lt;br /&gt;
                   #!/bin/bash&lt;br /&gt;
                   while getopts &amp;quot;ab:cd:&amp;quot; Option&lt;br /&gt;
                   # b and d take arguments&lt;br /&gt;
                   #&lt;br /&gt;
                   do&lt;br /&gt;
                     case $Option in&lt;br /&gt;
                       a) echo -e &amp;quot;a = $OPTIND&amp;quot;;;&lt;br /&gt;
                       b) echo -e &amp;quot;b = $OPTIND $OPTARG&amp;quot;;;&lt;br /&gt;
                       c) echo -e &amp;quot;c = $OPTIND&amp;quot;;;&lt;br /&gt;
                       d) echo -e &amp;quot;d = $OPTIND $OPTARG&amp;quot;;;&lt;br /&gt;
                    esac&lt;br /&gt;
                  done&lt;br /&gt;
                  shift $(($OPTIND - 1))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 193:&lt;br /&gt;
&lt;br /&gt;
     Sieve - creating sieve recipes with &amp;quot;sieveshell&amp;quot;&lt;br /&gt;
&lt;br /&gt;
     The following sieve script put all jefferson.edu mail into the &lt;br /&gt;
     folder jefferson. This assumes that I have already created the IMP &lt;br /&gt;
     directory, or mail box (INBOX.jefferson), which can be done in mutt &lt;br /&gt;
     with the &amp;quot;C&amp;quot; command. Below is an example of finding &amp;quot;jefferson.edu&amp;quot;&lt;br /&gt;
     anywhere in the header. &lt;br /&gt;
&lt;br /&gt;
         # This is a file named jefferson.siv&lt;br /&gt;
         require [&amp;quot;fileinto&amp;quot;];&lt;br /&gt;
         if header :contains &amp;quot;Received&amp;quot; &amp;quot;from jefferson.edu&amp;quot; {&lt;br /&gt;
           fileinto &amp;quot;INBOX.jefferson&amp;quot;;&lt;br /&gt;
           stop;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
     Now, from the command propt execute &amp;quot;sieveshell&amp;quot; with the hostname of the&lt;br /&gt;
     imap server. My server is squeezel.squeezel.com, so I would execute the &lt;br /&gt;
     following:&lt;br /&gt;
&lt;br /&gt;
          $ sieveshell squeezel.squeezel.com&lt;br /&gt;
          connecting to squeezel.squeezel.com&lt;br /&gt;
          Please enter your password:****&lt;br /&gt;
          &amp;gt; put jefferson.siv&lt;br /&gt;
          &amp;gt; activate jefferson.siv&lt;br /&gt;
          &amp;gt; list&lt;br /&gt;
          jefferson.siv  &amp;lt;- active script&lt;br /&gt;
          &amp;gt; quit&lt;br /&gt;
&lt;br /&gt;
     Note the put brings in the script. And you need to activiate it.&lt;br /&gt;
&lt;br /&gt;
     You can activate a sieve script for any user on your system if you are&lt;br /&gt;
     root. This is an example of activating a script for user chirico. Assume&lt;br /&gt;
     below the root prompt is &amp;quot;#&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
          # sieveshell -a chirico -u chirico squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
     You can also automate everything from a bash script. But note after&lt;br /&gt;
     the -e the commands, and not a file with the commands, follows within&lt;br /&gt;
     quotes. This is the script I use for my home system.&lt;br /&gt;
&lt;br /&gt;
         #!/bin/bash&lt;br /&gt;
         sieveshell -a chirico -u chirico -e 'deactivate&lt;br /&gt;
         delete chirico.siv&lt;br /&gt;
         put chirico.siv&lt;br /&gt;
         activate chirico.siv&lt;br /&gt;
         list&lt;br /&gt;
         '  squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     References:&lt;br /&gt;
         http://wiki.fastmail.fm/index.php/SieveRecipes&lt;br /&gt;
         http://www.cyrusoft.com/sieve/#documents&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 194:&lt;br /&gt;
&lt;br /&gt;
     emacs - editing files remotely with tramp. Tramp comes with the latest version of emacs.&lt;br /&gt;
             That means if you're using Fedora core 4, with emacs, you have tramp. This is &lt;br /&gt;
             ideal for editing files on remote computers that do not use emacs.&lt;br /&gt;
&lt;br /&gt;
             Edit the &amp;quot;.emacs&amp;quot; file and add the following line:&lt;br /&gt;
&lt;br /&gt;
                 (require 'tramp)&lt;br /&gt;
                 (setq tramp-default-method &amp;quot;scp&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
             Now, to edit a file on computer tape.squeezel.com (C-x, C-f) and&lt;br /&gt;
             enter the following in Find file:&lt;br /&gt;
&lt;br /&gt;
                 Find file:/chirico@tape.squeezel.com:test.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             References:&lt;br /&gt;
&lt;br /&gt;
                    http://savannah.gnu.org/projects/tramp/&lt;br /&gt;
&lt;br /&gt;
             &lt;br /&gt;
&lt;br /&gt;
TIP 195:&lt;br /&gt;
&lt;br /&gt;
     trusted X11 forwarding - running gnome and KDE both on one screen, at the same&lt;br /&gt;
             time securely. The following assumes gnome is running on the current&lt;br /&gt;
             computer and &amp;quot;closet.squeezel.com&amp;quot; has KDE&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y  closet.squeezel.com&lt;br /&gt;
              $ startkde&lt;br /&gt;
&lt;br /&gt;
          Or assume you want to run gnome on &amp;quot;closet.squeezel.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y  closet.squeezel.com&lt;br /&gt;
              $ gnome-session&lt;br /&gt;
&lt;br /&gt;
          By default Fedora Core allows ForwardX11 over ssh. Note you want to use&lt;br /&gt;
          the -Y option above and NOT -X. &lt;br /&gt;
&lt;br /&gt;
          Suppose you want a remote &amp;quot;gnome-session&amp;quot; on ctl-alt-F12. Below is an &lt;br /&gt;
          example of getting the remote computer closet.squeezel.com, and you&lt;br /&gt;
          can still have the above configuration.&lt;br /&gt;
&lt;br /&gt;
          First you must allow magic cookies for each server connection.&lt;br /&gt;
             &lt;br /&gt;
              $ MCOOKIE=$(mcookie)&lt;br /&gt;
              $ xauth add $(hostname)/unix:1 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
              $ xauth add localhost/unix:1 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
  &lt;br /&gt;
          Again, note that you have to add this for EACH connection. So if you wanted 2 as well&lt;br /&gt;
&lt;br /&gt;
              $ MCOOKIE=$(mcookie)&lt;br /&gt;
              $ xauth add $(hostname)/unix:2 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
              $ xauth add localhost/unix:2 MIT-MAGIC-COOKIE-1 $MCOOKIE&lt;br /&gt;
&lt;br /&gt;
          On squeezel.squeezel.com create a new xterm. If :1 is take below&lt;br /&gt;
          try :2. The vt12 is for switching to ctl-alt-F12.&lt;br /&gt;
&lt;br /&gt;
              $ xinit -- :1 vt12&lt;br /&gt;
&lt;br /&gt;
          Note, if you do not add the above cookies, you will get the follow error:&lt;br /&gt;
         &lt;br /&gt;
               Xlib: connection to &amp;quot;:1.0&amp;quot; refused by server&lt;br /&gt;
               Xlib: No protocol specified&lt;br /&gt;
&lt;br /&gt;
          The screen may be hard to read. At this point ssh -Y to the remote computer.&lt;br /&gt;
&lt;br /&gt;
              $ ssh -Y closet.squeezel.com&lt;br /&gt;
              $ gnome-session&lt;br /&gt;
&lt;br /&gt;
          Yes, you will get errors about sound and some custom drivers is the remove &lt;br /&gt;
          computer has different hardware. After is loads, you can switch back and&lt;br /&gt;
          forth between session with (ctl-alt-F12)  and (ctl-alt-F7)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 196:&lt;br /&gt;
&lt;br /&gt;
     Suspend ssh session - you have just sshed into a computer &amp;quot;ssh -l user example.com&amp;quot;, and you&lt;br /&gt;
          want to get back to the terminal prompt of the computer you started with. Escapte, by &lt;br /&gt;
          default with ssh is &amp;quot;~&amp;quot;, so enter &amp;quot;~&amp;quot; followed by &amp;quot;ctl-z&amp;quot; to suspend.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 197:&lt;br /&gt;
&lt;br /&gt;
     Quick way to send a text file &lt;br /&gt;
&lt;br /&gt;
              $ sendmail -f mike.chirico@gmail.com mchirico@comcast.net &amp;lt; /etc/fstab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 198:&lt;br /&gt;
&lt;br /&gt;
     size - determining the size of the text segment, data segment, and &amp;quot;bss&amp;quot; or uninitialized data segment.&lt;br /&gt;
&lt;br /&gt;
              $ size /bin/sh /bin/bash&lt;br /&gt;
               text        data     bss     dec     hex filename&lt;br /&gt;
              586946      22444   18784  628174   995ce /bin/sh&lt;br /&gt;
              586946      22444   18784  628174   995ce /bin/bash&lt;br /&gt;
&lt;br /&gt;
          Note above that &amp;quot;/bin/sh&amp;quot; and &amp;quot;/bin/bash&amp;quot; have equal text,data and bss numbers. It's&lt;br /&gt;
          highly likely that these are the same programs.&lt;br /&gt;
&lt;br /&gt;
              $ ls -l /bin/sh&lt;br /&gt;
               lrwxrwxrwx  1 root root 4 Jan 14  2005 /bin/sh -&amp;gt; bash&lt;br /&gt;
&lt;br /&gt;
          Yep, it's the same program. Here's a further definition of each segment.&lt;br /&gt;
&lt;br /&gt;
              Text segment: The machine instructions that the CPU executes. This is usually&lt;br /&gt;
                            read only and sharable.&lt;br /&gt;
&lt;br /&gt;
              Data segment: Contains initialized variables in a program. You also know these&lt;br /&gt;
                            as declarations and definitions.&lt;br /&gt;
&lt;br /&gt;
                               int max = 200;&lt;br /&gt;
&lt;br /&gt;
              Uninitialized data segment: Think of this as a declaration only, or data that&lt;br /&gt;
                            is only initialized by the kernel to arithmetic 0 or null pointers&lt;br /&gt;
                            before program execution.&lt;br /&gt;
&lt;br /&gt;
                               char s[10];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 199:&lt;br /&gt;
&lt;br /&gt;
     Using the at command.&lt;br /&gt;
&lt;br /&gt;
       Below is a simple example if running the ls command at 11:42am that&lt;br /&gt;
       will send mail -m to the user that executed it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       We'll execute job1 defined as follows and set to be executable. &lt;br /&gt;
&lt;br /&gt;
           $ cat ./job1&lt;br /&gt;
           #!/bin/bash&lt;br /&gt;
           date &amp;gt;&amp;gt; /tmp/job1&lt;br /&gt;
&lt;br /&gt;
       The at command is listed below. For queue &amp;quot;-q&amp;quot; names you can only&lt;br /&gt;
       specify one letter. Here we're using x. The letter determines the&lt;br /&gt;
       priority with &amp;quot;a&amp;quot; the highest.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x  -f ./job1 -m  11:54am&lt;br /&gt;
           job 3 at 2005-10-04 11:54&lt;br /&gt;
&lt;br /&gt;
       Now, if you execute the atq command, you'll get the following.&lt;br /&gt;
&lt;br /&gt;
           $ atq&lt;br /&gt;
           3       2005-10-04 11:54 x chirico&lt;br /&gt;
&lt;br /&gt;
       It's also possible to execute jobs at the command line entering&lt;br /&gt;
       a ctl-d at the end of the input.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x  -m 12:08pm&lt;br /&gt;
           at&amp;gt; ls -l&lt;br /&gt;
           at&amp;gt; who&lt;br /&gt;
           at&amp;gt; date&lt;br /&gt;
           at&amp;gt; ^D&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Or for a job to execute 1 minute from now.&lt;br /&gt;
&lt;br /&gt;
           $ at -q x -m `date -d '1 minute' +&amp;quot;%H:%M&amp;quot;`&lt;br /&gt;
           at&amp;gt; ls -l&lt;br /&gt;
           at&amp;gt; date&lt;br /&gt;
     &lt;br /&gt;
&lt;br /&gt;
     Important points: The atd daemon must be running. To check if&lt;br /&gt;
      it's running do the following:&lt;br /&gt;
&lt;br /&gt;
            $ /etc/init.d/atd status&lt;br /&gt;
&lt;br /&gt;
      Also, if there is an /etc/at.allow file, then only users in that&lt;br /&gt;
      file will be allowed to execute at.&lt;br /&gt;
&lt;br /&gt;
      If /etc/at.deny exists but is empty and there is no /etc/at.allow,&lt;br /&gt;
      then, everyone can execute the at command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 200:&lt;br /&gt;
&lt;br /&gt;
     lsusb - command will display all USB buses and all devices connected.&lt;br /&gt;
&lt;br /&gt;
        $ lsusb&lt;br /&gt;
        Bus 005 Device 003: ID 413c:2010 Dell Computer Corp.&lt;br /&gt;
        Bus 005 Device 002: ID 413c:1003 Dell Computer Corp.&lt;br /&gt;
        Bus 005 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 004 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 003 Device 003: ID 0fc5:1227 Delcom Engineering&lt;br /&gt;
        Bus 003 Device 002: ID 046d:c016 Logitech, Inc. Optical Mouse&lt;br /&gt;
        Bus 003 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 002 Device 001: ID 0000:0000&lt;br /&gt;
        Bus 001 Device 001: ID 0000:0000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 201:&lt;br /&gt;
&lt;br /&gt;
     Memory fragmentation - if you suspect workload memory fragmentation issues&lt;br /&gt;
     and you want to monitor the current state of you system, then, consider&lt;br /&gt;
     looking at the output from /proc/buddyinfo on recent kernels.&lt;br /&gt;
&lt;br /&gt;
        $ cat /proc/buddyinfo&lt;br /&gt;
      Node 0, zone      DMA    541    218     42      2      0      0      0      1      1      1      0 &lt;br /&gt;
      Node 0, zone   Normal   2508   2614     52      1      5      5      0      1      1      1      0 &lt;br /&gt;
      Node 0, zone  HighMem      0      1      3      0      1      0      0      0      0      0      0 &lt;br /&gt;
&lt;br /&gt;
     The following definition is taken from  ./Documentation/filesystems/proc.txt in the &lt;br /&gt;
     Linux kernel source.&lt;br /&gt;
&lt;br /&gt;
       Each column represents the number of pages of a certain order which are&lt;br /&gt;
       available.  In this case, there are 0 chunks of 2^0*PAGE_SIZE available in&lt;br /&gt;
       ZONE_DMA, 4 chunks of 2^1*PAGE_SIZE in ZONE_DMA, 101 chunks of 2^4*PAGE_SIZE&lt;br /&gt;
       available in ZONE_NORMAL, etc...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 202:&lt;br /&gt;
&lt;br /&gt;
     arp - Linux ARP kernel moduel.  This command implements the Address Resolution Protocol.&lt;br /&gt;
&lt;br /&gt;
     This is an example of the command.&lt;br /&gt;
&lt;br /&gt;
        $ arp&lt;br /&gt;
        Address                  HWtype  HWaddress           Flags Mask            Iface&lt;br /&gt;
        tape.squeezel.com        ether   00:50:DA:60:5B:AD   C                     eth0&lt;br /&gt;
        squeezel.squeezel.com    ether   00:11:11:8A:BE:3F   C                     eth0&lt;br /&gt;
        gw.squeezel.com          ether   00:0F:66:47:15:73   C                     eth0&lt;br /&gt;
&lt;br /&gt;
       &lt;br /&gt;
TIP 203:&lt;br /&gt;
&lt;br /&gt;
     dbench - performance monitoring. &lt;br /&gt;
&lt;br /&gt;
     So, how does your system react when the load average is above 600. Have you even seen a &lt;br /&gt;
     computer with a load average of 600? Well, this could be your chance. &lt;br /&gt;
&lt;br /&gt;
         Reference: http://freshmeat.net/projects/dbench/&lt;br /&gt;
&lt;br /&gt;
     The following gives a load average of 10 on my system.&lt;br /&gt;
&lt;br /&gt;
        $ dbench 34&lt;br /&gt;
&lt;br /&gt;
     If you want a higher load, just increase the number.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 204:&lt;br /&gt;
&lt;br /&gt;
     /etc guide - a listing of common files in the /etc directory.&lt;br /&gt;
&lt;br /&gt;
        /etc/exports: this file is used to configure NFS.&lt;br /&gt;
&lt;br /&gt;
        /etc/ftpusers: the users on your system who are restricted from FTP login.&lt;br /&gt;
&lt;br /&gt;
        /etc/motd: message of the day, which users see after login.&lt;br /&gt;
&lt;br /&gt;
        /etc/named.conf: DNS config file.&lt;br /&gt;
&lt;br /&gt;
        /etc/profile: common user information.&lt;br /&gt;
&lt;br /&gt;
        /etc/inittab: this file contains runlevel start information.&lt;br /&gt;
&lt;br /&gt;
        /etc/services: the services and their respective ports.&lt;br /&gt;
&lt;br /&gt;
        /etc/shells: this contains the names of all shells installed on the system.&lt;br /&gt;
&lt;br /&gt;
        /etc/passwd: this file contains user information.&lt;br /&gt;
&lt;br /&gt;
        /etc/group: security group rights.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
TIP 205: &lt;br /&gt;
&lt;br /&gt;
     logger - is a bash command utility for writing to /var/log/messages or the&lt;br /&gt;
            other files defined in /etc/syslog.conf.&lt;br /&gt;
&lt;br /&gt;
            $ logger -t TEST more of a test here&lt;br /&gt;
&lt;br /&gt;
         This is what shows up in /var/log/messages&lt;br /&gt;
  &lt;br /&gt;
            Oct 28 07:15:50 squeezel TEST: more of a test here&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
TIP 206: &lt;br /&gt;
&lt;br /&gt;
     accton, lastcomm - accouting on and last command. This is &lt;br /&gt;
         a way to monitor users on your system. As root, you &lt;br /&gt;
         would implement this as follows:&lt;br /&gt;
&lt;br /&gt;
           $ accton -h&lt;br /&gt;
            Usage: accton [-hV] [file]&lt;br /&gt;
            [--help] [--version]&lt;br /&gt;
&lt;br /&gt;
            The system's default process accounting file is /var/account/pacct.&lt;br /&gt;
&lt;br /&gt;
         Note the default file location is /var/account/pacct so we'll turn&lt;br /&gt;
         it on system wide with the following command.&lt;br /&gt;
&lt;br /&gt;
           $ accton /var/account/pacct&lt;br /&gt;
&lt;br /&gt;
         Now take a look at this file. It will grow. To see command that&lt;br /&gt;
         are executed, use the lastcomm command.&lt;br /&gt;
&lt;br /&gt;
           $ lastcomm&lt;br /&gt;
&lt;br /&gt;
         The above command gives output for all users. To get the data&lt;br /&gt;
         for user &amp;quot;chirico&amp;quot; execute the following command:&lt;br /&gt;
&lt;br /&gt;
           $ lastcomm --user chirico&lt;br /&gt;
&lt;br /&gt;
         You can also get a summary of commands with sa.&lt;br /&gt;
&lt;br /&gt;
           [chirico@big ~]$ sa&lt;br /&gt;
           30       5.23re       0.00cp    10185k&lt;br /&gt;
           11       4.83re       0.00cp     8961k   ***other&lt;br /&gt;
            8       0.13re       0.00cp    19744k   nagios*&lt;br /&gt;
            4       0.00re       0.00cp     2542k   automount*&lt;br /&gt;
            3       0.00re       0.00cp      680k   sa&lt;br /&gt;
            2       0.13re       0.00cp    17424k   check_ping&lt;br /&gt;
            2       0.13re       0.00cp      978k   ping&lt;br /&gt;
&lt;br /&gt;
         To turn off accounting, execute accton without a filename.&lt;br /&gt;
&lt;br /&gt;
           $ accton&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 207:&lt;br /&gt;
&lt;br /&gt;
     CPU Temperature on a laptop. The following is the temperature&lt;br /&gt;
       of my Dell laptop. &lt;br /&gt;
&lt;br /&gt;
           $ cat /proc/acpi/thermal_zone/THM/temperature&lt;br /&gt;
           temperature:             58 C&lt;br /&gt;
&lt;br /&gt;
      &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 208:&lt;br /&gt;
&lt;br /&gt;
     script -f with mkfifo to allow another user to view what you type&lt;br /&gt;
          in real-time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Step 1.  Create a fifo (first in first out) file that the other&lt;br /&gt;
              user can view. For this example create the file /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
               [chirico@laptop ~]$ mkfifo /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
        Step 2.  Have the second user, voyeur user, cat this file. Output will block&lt;br /&gt;
              for them until you complete step 3. The other user, voyer,&lt;br /&gt;
              is executing the command below.&lt;br /&gt;
 &lt;br /&gt;
               [voyeur@laptop ~]$ cat /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
        Step 3.  The original user runs the following command.&lt;br /&gt;
&lt;br /&gt;
               [chirico@laptop ~]$ script -f  /tmp/scriptout&lt;br /&gt;
               Script started, file is /tmp/scriptout&lt;br /&gt;
&lt;br /&gt;
             Now anything typed, including a vi session, will be displayed to the&lt;br /&gt;
             voyeur user in step 2. &lt;br /&gt;
&lt;br /&gt;
        See TIP 46.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 209:&lt;br /&gt;
&lt;br /&gt;
     fsck forced on next reboot.  To do this, as root issue the following commands.&lt;br /&gt;
&lt;br /&gt;
            $ cd /&lt;br /&gt;
            $ touch forcefsck&lt;br /&gt;
&lt;br /&gt;
          Now reboot the system, and when it comes up fsck will be forced on the system.&lt;br /&gt;
&lt;br /&gt;
            $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 210:&lt;br /&gt;
&lt;br /&gt;
     /dev/random and /dev/urandom differ in their random generating properties. /dev/random&lt;br /&gt;
        only returns bytes when enough noise has been generated from the entropy pool. In&lt;br /&gt;
        contrast /dev/urandom will always return bytes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     Reference: http://sourceforge.net/direct-dl/mchirico/cpearls/simple_but_common.tar.gz (rand.c)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 211:&lt;br /&gt;
&lt;br /&gt;
     Want to find out the speed of your NIC?  (Full Duplex or Half), then use ethtool.&lt;br /&gt;
&lt;br /&gt;
               [root@squeezel ~]# ethtool eth0&lt;br /&gt;
               Settings for eth0:&lt;br /&gt;
                       Supported ports: [ MII ]&lt;br /&gt;
                       Supported link modes:   10baseT/Half 10baseT/Full&lt;br /&gt;
                                               100baseT/Half 100baseT/Full&lt;br /&gt;
                                               1000baseT/Half 1000baseT/Full&lt;br /&gt;
                       Supports auto-negotiation: Yes&lt;br /&gt;
                       Advertised link modes:  10baseT/Half 10baseT/Full&lt;br /&gt;
                                               100baseT/Half 100baseT/Full&lt;br /&gt;
                                               1000baseT/Half 1000baseT/Full&lt;br /&gt;
                       Advertised auto-negotiation: Yes&lt;br /&gt;
                       Speed: 100Mb/s&lt;br /&gt;
                       Duplex: Full&lt;br /&gt;
                       Port: Twisted Pair&lt;br /&gt;
                       PHYAD: 1&lt;br /&gt;
                       Transceiver: internal&lt;br /&gt;
                       Auto-negotiation: on&lt;br /&gt;
                       Supports Wake-on: g&lt;br /&gt;
                       Wake-on: d&lt;br /&gt;
                       Current message level: 0x000000ff (255)&lt;br /&gt;
                       Link detected: yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 212:&lt;br /&gt;
&lt;br /&gt;
     rpm install hang? You might need to delete the lock state information. &lt;br /&gt;
&lt;br /&gt;
        $ nl /etc/rc.d/rc.sysinit | grep rpm&lt;br /&gt;
        720   rm -f /var/lib/rpm/__db* &amp;amp;&amp;gt; /dev/null&lt;br /&gt;
&lt;br /&gt;
     Note the command &lt;br /&gt;
&lt;br /&gt;
        $ rm -f /var/lib/rpm/__db*&lt;br /&gt;
&lt;br /&gt;
     Because sometimes you will run &amp;quot;rpm -ivh somerpm&amp;quot; and it will just sit&lt;br /&gt;
     there.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 213:&lt;br /&gt;
&lt;br /&gt;
     Apache - limit access to certain directories based on IP address in the&lt;br /&gt;
         httpd.conf file.&lt;br /&gt;
&lt;br /&gt;
          You can do this completely from /etc/httpd/conf/httpd.conf which&lt;br /&gt;
          are shown below for multiple IP addresses. Note that all 3 setting&lt;br /&gt;
          are the same.&lt;br /&gt;
&lt;br /&gt;
                10.0.0.0/255.0.0.0&lt;br /&gt;
                10.0.0.0/8&lt;br /&gt;
                10&lt;br /&gt;
&lt;br /&gt;
          However, the following is different&lt;br /&gt;
&lt;br /&gt;
                10.0.0.0/24   only allows 10.0.0.1 to 10.0.0.254&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          Some complete settings in /etc/httpd/conf/httpd.conf &lt;br /&gt;
&lt;br /&gt;
             &amp;lt;Directory /var/www/html/chirico/&amp;gt;&lt;br /&gt;
                 Order allow,deny&lt;br /&gt;
                 Allow from 10.0.0.0/8      # All 10.&lt;br /&gt;
                 Allow from 192.168.0.0/16  # All 192.168&lt;br /&gt;
                 Allow from 127             # All 127.&lt;br /&gt;
             &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          Don't forget to reload httpd with the following command.&lt;br /&gt;
        &lt;br /&gt;
             $ /etc/init.d/httpd reload&lt;br /&gt;
&lt;br /&gt;
          &lt;br /&gt;
&lt;br /&gt;
TIP 214:&lt;br /&gt;
&lt;br /&gt;
     Open Files - determining how many files are currently open.&lt;br /&gt;
&lt;br /&gt;
             $ cat /proc/sys/fs/file-nr&lt;br /&gt;
             2030    263     104851&lt;br /&gt;
              |       |        \- maximum open file descriptors &lt;br /&gt;
              |       |         &lt;br /&gt;
              |       \- total free allocated file descriptors&lt;br /&gt;
              |&lt;br /&gt;
              (Total allocated file descriptors since boot)&lt;br /&gt;
&lt;br /&gt;
        Note the maximum number can be set or changed.&lt;br /&gt;
&lt;br /&gt;
              $ cat /proc/sys/fs/file-max&lt;br /&gt;
              104851&lt;br /&gt;
&lt;br /&gt;
        To change this&lt;br /&gt;
&lt;br /&gt;
              $ echo &amp;quot;804854&amp;quot; &amp;gt; /proc/sys/fs/file-max&lt;br /&gt;
 &lt;br /&gt;
        Note lsof | wc -l will report higher numbers because this includes&lt;br /&gt;
        open files that are not using file descriptors such as directories,&lt;br /&gt;
        memory mapped files, and executable text files.&lt;br /&gt;
&lt;br /&gt;
        (Reference http://www.netadmintools.com/art295.html&lt;br /&gt;
         and also see the man page for this: man 5 proc )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 215:&lt;br /&gt;
&lt;br /&gt;
     Ctrl-Alt-Del will cause an immediate reboot, without syncing dirty buffers by&lt;br /&gt;
     setting the value &amp;gt; 0 in /proc/sys/kernel/ctrl-alt-del.&lt;br /&gt;
&lt;br /&gt;
               $ echo 1 &amp;gt; /proc/sys/kernel/ctrl-alt-del&lt;br /&gt;
       &lt;br /&gt;
&lt;br /&gt;
        (Reference: man 5 proc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 216:&lt;br /&gt;
&lt;br /&gt;
     Redefining keys in X using xev and xmodmap.  The program xev, used in an X window &lt;br /&gt;
     terminal screen will display information on mouse movements, keys pressed and &lt;br /&gt;
     released.&lt;br /&gt;
&lt;br /&gt;
        $ xev&lt;br /&gt;
&lt;br /&gt;
     Now type shift-4 and you'll notice the event details below:&lt;br /&gt;
&lt;br /&gt;
        KeyPress event, serial 29, synthetic NO, window 0x3800001,&lt;br /&gt;
            root 0x60, subw 0x0, time 55307049, (418,242), root:(428,339),&lt;br /&gt;
            state 0x1, keycode 13 (keysym 0x24, dollar), same_screen YES,&lt;br /&gt;
            XLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
            XmbLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
            XFilterEvent returns: False&lt;br /&gt;
        &lt;br /&gt;
        KeyRelease event, serial 29, synthetic NO, window 0x3800001,&lt;br /&gt;
            root 0x60, subw 0x0, time 55307184, (418,242), root:(428,339),&lt;br /&gt;
            state 0x1, keycode 13 (keysym 0x24, dollar), same_screen YES,&lt;br /&gt;
            XLookupString gives 1 bytes: (24) &amp;quot;$&amp;quot;&lt;br /&gt;
       &lt;br /&gt;
     So, if you want to redefine this key to say copyright, see (/usr/X11R6/include/X11/keysymdef.h)&lt;br /&gt;
     you would type the following.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 copyright'&lt;br /&gt;
&lt;br /&gt;
     To get the key back to the dollar, issue the following command.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 dollar'&lt;br /&gt;
&lt;br /&gt;
     By the way it's possible to define multiple key codes for a sigle key. You'll need&lt;br /&gt;
     to have a key defined as the Mode_switch. Perhaps you'd like to use the Windows key,&lt;br /&gt;
     or the key with the Microsoft logo on it, since you're using Linux. This key is&lt;br /&gt;
     keycode 115&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 115 = Mode_switch'&lt;br /&gt;
&lt;br /&gt;
     Now you could define 3 values to the shift-4. For this example use ld, Yen and dollar.&lt;br /&gt;
&lt;br /&gt;
        $ xmodmap -e 'keycode 13 = 4 dollar sterling yen'&lt;br /&gt;
&lt;br /&gt;
     So pressing the keys gives you the following:&lt;br /&gt;
&lt;br /&gt;
          shift-$          (dollar sign)&lt;br /&gt;
          Windows-$        (lb sign)&lt;br /&gt;
          Windows-shift-$  (Yen sign)&lt;br /&gt;
&lt;br /&gt;
     You could go crazy and redefine all you keys.&lt;br /&gt;
&lt;br /&gt;
     (Thanks to hisham for this tip).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 217:&lt;br /&gt;
&lt;br /&gt;
     Threads - which version of threads are you using?&lt;br /&gt;
&lt;br /&gt;
          $ getconf GNU_LIBPTHREAD_VERSION&lt;br /&gt;
          NPTL 2.3.90&lt;br /&gt;
&lt;br /&gt;
     For a history on threads used with gcc reference the following:&lt;br /&gt;
          &lt;br /&gt;
          http://en.wikipedia.org/wiki/NPTL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 218:&lt;br /&gt;
&lt;br /&gt;
     Screenshots using ImageMagick. &lt;br /&gt;
&lt;br /&gt;
        If you want the entire screen, execute the following:&lt;br /&gt;
&lt;br /&gt;
            $ import -window root screen.png&lt;br /&gt;
&lt;br /&gt;
        Or to crosshair select the region with your mouse, execute &lt;br /&gt;
        the following instead.&lt;br /&gt;
&lt;br /&gt;
            $ import screen.png&lt;br /&gt;
&lt;br /&gt;
        KDE has the ability to take screenshots with the command below.&lt;br /&gt;
&lt;br /&gt;
            $ ksnapshot&lt;br /&gt;
&lt;br /&gt;
        GNOME likewise has a command too.&lt;br /&gt;
&lt;br /&gt;
            $ gnome-panel-screenshot --delay 6&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Visting ImageMagick again, the xwininfo command give window information and the id can be&lt;br /&gt;
        used to capture images with the import command.&lt;br /&gt;
&lt;br /&gt;
            $ xwininfo&lt;br /&gt;
&lt;br /&gt;
          xwininfo: Please select the window about which you&lt;br /&gt;
          would like information by clicking the&lt;br /&gt;
          mouse in that window.&lt;br /&gt;
&lt;br /&gt;
          xwininfo: Window id: 0x1e00007 &amp;quot;chirico@squeezel:/work/svn/souptonuts - Shell - Konsole&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          Absolute upper-left X:  4&lt;br /&gt;
          Absolute upper-left Y:  21&lt;br /&gt;
          Relative upper-left X:  0&lt;br /&gt;
          Relative upper-left Y:  0&lt;br /&gt;
          Width: 880&lt;br /&gt;
          Height: 510&lt;br /&gt;
          Depth: 24&lt;br /&gt;
          Visual Class: TrueColor&lt;br /&gt;
          Border width: 0&lt;br /&gt;
          Class: InputOutput&lt;br /&gt;
          Colormap: 0x20 (installed)&lt;br /&gt;
          Bit Gravity State: NorthWestGravity&lt;br /&gt;
          Window Gravity State: NorthWestGravity&lt;br /&gt;
          Backing Store State: NotUseful&lt;br /&gt;
          Save Under State: no&lt;br /&gt;
          Map State: IsViewable&lt;br /&gt;
          Override Redirect State: no&lt;br /&gt;
          Corners:  +4+21  -396+21  -396-493  +4-493&lt;br /&gt;
          -geometry 880x510+0+0&lt;br /&gt;
&lt;br /&gt;
        Now use the import command with the Window id. My example is shown below.&lt;br /&gt;
&lt;br /&gt;
             $ import -window 0x1e00007  id.miff&lt;br /&gt;
&lt;br /&gt;
        And to quickly display this image that you just saved, use the display command.&lt;br /&gt;
&lt;br /&gt;
             $ display id.miff &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 219:&lt;br /&gt;
&lt;br /&gt;
     File Access over SSH using FUSE (Filesystem in USErspace). This is a very good way to &lt;br /&gt;
     mount a remote filesystem locally. It's  like a secure NFS mount, but you don't require &lt;br /&gt;
     admin privileges on the remote computer. You do need to have fuse-sshfs installed on &lt;br /&gt;
     the local computer that will perform the filesystem mount.&lt;br /&gt;
&lt;br /&gt;
     The following works with Fedora Core 5. Only the users added to the fuse group can mout &lt;br /&gt;
     external drives. Below the user chirico is being added to the group fuse.&lt;br /&gt;
&lt;br /&gt;
             $ yum install fuse-sshfs&lt;br /&gt;
             $ usermod -a -G fuse chirico&lt;br /&gt;
     &lt;br /&gt;
     You'll need to reboot.&lt;br /&gt;
&lt;br /&gt;
             $ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
             &lt;br /&gt;
     Next I'm going to mount the remote filesystem v0.squeezel.com. This is done as user chirico&lt;br /&gt;
     on the local computer. I'm using root on the remote computer v0.squeezel.com because I&lt;br /&gt;
     want to mount the complete drive.&lt;br /&gt;
&lt;br /&gt;
             $ mkdir v0&lt;br /&gt;
             $ sshfs root@v0.squeezel.com:/  v0&lt;br /&gt;
             $ cd v0&lt;br /&gt;
             $ ls -l&lt;br /&gt;
               bin   dev  home  lost+found     media  mnt  opt   q     sbin     srv  tmp  var&lt;br /&gt;
               boot  etc  lib   master_backup  misc   net  proc  root  selinux  sys  usr&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
     Now to unmount the filesystem&lt;br /&gt;
&lt;br /&gt;
             $ fusermount -u /home/chirico/v0&lt;br /&gt;
&lt;br /&gt;
     Yes, you can mount the filesystem on boot. Below shows an example entry for /etc/fstab, but&lt;br /&gt;
     this only allows user on the current system to view what is is /mnt/v0. &lt;br /&gt;
&lt;br /&gt;
             sshfs#root@v0.squeezel.com:/var/log             /mnt/v0 fuse defaults    0 0&lt;br /&gt;
&lt;br /&gt;
     References:&lt;br /&gt;
        (http://fuse.sourceforge.net/sshfs.html)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 220:&lt;br /&gt;
&lt;br /&gt;
     OpenVPN - A full-featured SSL VPN solution. The following demonstrates&lt;br /&gt;
               a very simple OpenVPN setup between two Fedora Core 5 computers&lt;br /&gt;
               big.squeezel.com 192.168.1.12 and tape.squeezel.com 192.168.1.155&lt;br /&gt;
&lt;br /&gt;
               As root install the package on both computers.&lt;br /&gt;
&lt;br /&gt;
                  $ yum -y install openvpn&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Setup on big.squeezel.com 192.168.1.12&lt;br /&gt;
&lt;br /&gt;
                  $ iptables -A INPUT -p udp -s 192.168.1.155  --dport 1194 -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tun+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A FORWARD -i tap+ -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
             Note - make sure you have commented out the following line &lt;br /&gt;
                    in /etc/sysconfig/iptables&lt;br /&gt;
&lt;br /&gt;
                  # -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
&lt;br /&gt;
             Now from continuting with the commands that need to be executed on &lt;br /&gt;
             big.squeezel.com 192.168.1.12 do one of the following&lt;br /&gt;
           &lt;br /&gt;
                  $ openvpn --remote tape.squeezel.com  --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 --verb 9&lt;br /&gt;
&lt;br /&gt;
             The above statement gives lots of errors. Once it's working you may want&lt;br /&gt;
             the following statement without the --verb 9 option.&lt;br /&gt;
&lt;br /&gt;
                  $ openvpn --remote tape.squeezel.com  --dev tun1 --ifconfig 10.4.0.1 10.4.0.2&lt;br /&gt;
&lt;br /&gt;
             After you finish the setup commands for tape.squeezel.com immediately below, you'll be&lt;br /&gt;
             able to access tape.squeezel.com as 10.4.0.2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Setup on tape.squeezel.com 192.168.1.155&lt;br /&gt;
&lt;br /&gt;
                  $ iptables -A INPUT -p udp -s 192.168.1.12  --dport 1194 -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tun+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A INPUT -i tap+ -j ACCEPT&lt;br /&gt;
                  $ iptables -A FORWARD -i tap+ -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
             Note - again, make sure you have commented out the following line &lt;br /&gt;
                    in /etc/sysconfig/iptables&lt;br /&gt;
&lt;br /&gt;
                  # -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
&lt;br /&gt;
             The openvpn commands are tape.squeezel.com are reversed from what is shown&lt;br /&gt;
             above.&lt;br /&gt;
&lt;br /&gt;
                  $ openvpn --remote big.squeezel.com --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 --verb 9&lt;br /&gt;
&lt;br /&gt;
             Or&lt;br /&gt;
                  $ openvpn --remote big.squeezel.com --dev tun1 --ifconfig 10.4.0.2 10.4.0.1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             Now you can access all services and ports from big.squeezel.com on 10.4.0.1 for &lt;br /&gt;
             such services as MySQL, secure Web, imap, etc. A quick test is nmap as follows:&lt;br /&gt;
&lt;br /&gt;
                  $ nmap -A -T4 10.4.0.1&lt;br /&gt;
&lt;br /&gt;
                  Starting Nmap 4.03 ( http://www.insecure.org/nmap/ ) at 2006-05-20 13:54 EDT&lt;br /&gt;
                  Interesting ports on 10.4.0.1:&lt;br /&gt;
                  (The 1671 ports scanned but not shown below are in state: closed)&lt;br /&gt;
                  PORT     STATE SERVICE VERSION&lt;br /&gt;
                  22/tcp   open  ssh     OpenSSH 4.3 (protocol 2.0)&lt;br /&gt;
                  111/tcp  open  rpcbind  2 (rpc #100000)&lt;br /&gt;
                  3306/tcp open  mysql   MySQL (unauthorized)&lt;br /&gt;
&lt;br /&gt;
                  Nmap finished: 1 IP address (1 host up) scanned in 7.116 seconds&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 221:&lt;br /&gt;
&lt;br /&gt;
     openssl - Some common commands.&lt;br /&gt;
&lt;br /&gt;
             Finding the openssldir (Directory for OpenSSL files).&lt;br /&gt;
&lt;br /&gt;
                  $ openssl version -a|grep OPENSSLDIR&lt;br /&gt;
                  OPENSSLDIR: &amp;quot;/etc/pki/tls&amp;quot;&lt;br /&gt;
&lt;br /&gt;
             Connect to a secure SMTP server with STARTTLS, assuming the server name is&lt;br /&gt;
             squeezel.squeezel.com&lt;br /&gt;
&lt;br /&gt;
                  $ openssl s_client -connect squeezel.squeezel.com:25 -starttls&lt;br /&gt;
&lt;br /&gt;
         &lt;br /&gt;
&lt;br /&gt;
      Reference (http://www.madboa.com/geek/openssl/)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 222:&lt;br /&gt;
&lt;br /&gt;
     Bash functions. This is easy, and I find it very useful to create bash functions&lt;br /&gt;
     for repeated commands. For example, suppose you want to create a quick bash function&lt;br /&gt;
     to cd to /var/log, tail messages and tail secure. You can create this function as&lt;br /&gt;
     follows:&lt;br /&gt;
&lt;br /&gt;
                  [root@v5 log]# m()&lt;br /&gt;
                  m()&lt;br /&gt;
                  &amp;gt; { cd /var/log&lt;br /&gt;
                  { cd /var/log&lt;br /&gt;
                  &amp;gt; tail messages&lt;br /&gt;
                  tail messages&lt;br /&gt;
                  &amp;gt; tail secure&lt;br /&gt;
                  tail secure&lt;br /&gt;
                  &amp;gt; }&lt;br /&gt;
                  }&lt;br /&gt;
                  &lt;br /&gt;
     Above I'm typing m() then hitting return. Note the echo on the next line followed&lt;br /&gt;
     by the prompt &amp;gt;. I then enter {. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 223:&lt;br /&gt;
&lt;br /&gt;
     Stats on DNS Server. You can get stats on your DNS server. &lt;br /&gt;
&lt;br /&gt;
       The following works for BIND 9:&lt;br /&gt;
&lt;br /&gt;
                  $ rndc stats&lt;br /&gt;
&lt;br /&gt;
         On my system I see the output in &amp;quot;/var/named/chroot/var/named/data/named_stats.txt&amp;quot;, which&lt;br /&gt;
         if an FC4 system. By the way, if you're using BIND 8, the command is &amp;quot;ndc stats&amp;quot;, but that&lt;br /&gt;
         has a completely different format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Format of the output&lt;br /&gt;
&lt;br /&gt;
            +++ Statistics Dump +++ (1153791199)&lt;br /&gt;
            success 297621&lt;br /&gt;
            referral 32&lt;br /&gt;
            nxrrset 21953&lt;br /&gt;
            nxdomain 33742&lt;br /&gt;
            recursion 28243&lt;br /&gt;
            failure 54&lt;br /&gt;
            --- Statistics Dump --- (1153791199)&lt;br /&gt;
&lt;br /&gt;
      The number (1153791199) can be converted with the date command.&lt;br /&gt;
&lt;br /&gt;
                  $ date -d '1970-01-01 1153791199 sec'&lt;br /&gt;
                  Tue Jul 25 02:33:19 EDT 2006&lt;br /&gt;
&lt;br /&gt;
      That's 1153791199 seconds since 1970-01-01 UCT. Which is 4 hours fast,&lt;br /&gt;
      from EDT.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 224:&lt;br /&gt;
&lt;br /&gt;
     snmp - simple network monitoring protocol. The following steps setup snmp on Fedora Core 5.&lt;br /&gt;
&lt;br /&gt;
                  $ yum install net-snmp*&lt;br /&gt;
&lt;br /&gt;
         Next add the following line in &amp;quot;/etc/snmp/snmpd.conf&amp;quot; at the bottom.&lt;br /&gt;
&lt;br /&gt;
                  rocommunity pA33worD&lt;br /&gt;
&lt;br /&gt;
         Start the snmp service.&lt;br /&gt;
&lt;br /&gt;
                  $ /etc/init.d/snmpd restart&lt;br /&gt;
&lt;br /&gt;
         Once started, from the command prompt, it's possible to get stats on the computer.&lt;br /&gt;
&lt;br /&gt;
                  $ snmpwalk -v 1 -c pA33worD localhost system&lt;br /&gt;
         Or&lt;br /&gt;
                  $ snmpwalk -v 1 -c pA33worD localhost interface&lt;br /&gt;
&lt;br /&gt;
         Or&lt;br /&gt;
                  $ snmpgetnext -v 1 -c pA33worD localhost sysUpTime&lt;br /&gt;
                  DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (26452) 0:04:24.52&lt;br /&gt;
&lt;br /&gt;
         Note the Timeticks is in 100th of a second. So the computer above has been running&lt;br /&gt;
         for 264.52 seconds.&lt;br /&gt;
&lt;br /&gt;
         Reference( TIP 225 shows how to use MRTG for gathering snmp stats).&lt;br /&gt;
                  http://www.net-snmp.org/tutorial/tutorial-5/commands/snmpv3.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 225:&lt;br /&gt;
&lt;br /&gt;
     MRTG - Multi Router Traffic Grapher.  &lt;br /&gt;
&lt;br /&gt;
                  $ cfgmaker --output=/etc/mrtg/v5.squeezel.com \&lt;br /&gt;
                    ifref=ip --global &amp;quot;workdir:/var/www/html/mrtg/stats&amp;quot;\&lt;br /&gt;
                    pA33worD@v5.squeezel.com&lt;br /&gt;
&lt;br /&gt;
        Reference: http://www.chinalinuxpub.com/doc/www.siliconvalleyccie.com/linux-hn/mrtg.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 226:&lt;br /&gt;
&lt;br /&gt;
     Back Trace - This is a method of getting a back trace for all processes on the system.&lt;br /&gt;
                  it assumes the following: a. Kernel was build with CONFIG_MAGIC_SYS-REQ &lt;br /&gt;
                  enabled (which Fedora 5 kernels are) b. You can get direct access to the &lt;br /&gt;
                  monitor.&lt;br /&gt;
&lt;br /&gt;
             Step 1.&lt;br /&gt;
&lt;br /&gt;
                  Ctl-Alt-F1 (This brings you to the text console)&lt;br /&gt;
&lt;br /&gt;
             Step 2.&lt;br /&gt;
&lt;br /&gt;
                  Alt-ScrollLock &lt;br /&gt;
                  Ctl-ScrollLock&lt;br /&gt;
          &lt;br /&gt;
                  Note above that's Alt-ScrollLock followed by Ctl-ScrollLock. You should see&lt;br /&gt;
                  a lot of text on the screen. To fast to read, but don't worry the text will&lt;br /&gt;
                  be in /var/log/messages at the end.&lt;br /&gt;
&lt;br /&gt;
                  On my system the ScrollLock key is next to the NumLock key. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 227:&lt;br /&gt;
&lt;br /&gt;
     Ext3 Tuning - One advantage of Ext3 over Ext2 is directory indexing, which  imporves file&lt;br /&gt;
                  access in directories containing large files or when the directory contains&lt;br /&gt;
                  many files. Directory indexing improves performance by using hashed binary &lt;br /&gt;
                  trees. &lt;br /&gt;
&lt;br /&gt;
                  There are two ways to enable dir_index. First, find the device using the mount&lt;br /&gt;
                  command.&lt;br /&gt;
&lt;br /&gt;
                      $ mount&lt;br /&gt;
&lt;br /&gt;
                      /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)&lt;br /&gt;
                      proc on /proc type proc (rw)&lt;br /&gt;
                      sysfs on /sys type sysfs (rw)&lt;br /&gt;
                      devpts on /dev/pts type devpts (rw,gid=5,mode=620)&lt;br /&gt;
                      /dev/sda1 on /boot type ext3 (rw) &amp;lt;--- This is the one you want&lt;br /&gt;
                      tmpfs on /dev/shm type tmpfs (rw)&lt;br /&gt;
                      none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)&lt;br /&gt;
                      sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)&lt;br /&gt;
                      automount(pid2001) on /net type autofs (rw,fd=4,pgrp=2001,minproto=2,maxproto=4)                   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                  From the above command, the device used is /dev/sda1.  Using the tune2fs command,&lt;br /&gt;
                  directory indexing will only apply to directories created after running the &lt;br /&gt;
                  command below.               &lt;br /&gt;
&lt;br /&gt;
                       $ tune2fs -O dir_index /dev/sda1&lt;br /&gt;
&lt;br /&gt;
                  However, if you want it to apply to all directories, use the e2fsck command as  &lt;br /&gt;
                  shown below:&lt;br /&gt;
&lt;br /&gt;
                       $ e2fsck -D -f /dev/sda1&lt;br /&gt;
&lt;br /&gt;
                  You'll need to bypass the warning message.&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
     Reference: &amp;quot;Tuning Journaling File Systems: A small amount of effort an dtime can yield big&lt;br /&gt;
                results&amp;quot;,by Steve Best. Linux Magazine, September 10, 2006. This author as has&lt;br /&gt;
                a very good book titled: &amp;quot;Linux Debugging and Performance Tuning.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 228:&lt;br /&gt;
&lt;br /&gt;
     NIC bonding - binding two or more NICs to one IP address to improve performance. The following&lt;br /&gt;
                instructions were done on Fedora Core 5.&lt;br /&gt;
&lt;br /&gt;
         Step 1.&lt;br /&gt;
             &lt;br /&gt;
            Create the file ifcfg-bond0 with the IP address, netmask and gateway. Shown&lt;br /&gt;
            below is my file.&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-bond0&lt;br /&gt;
&lt;br /&gt;
                   DEVICE=bond0&lt;br /&gt;
                   IPADDR=192.168.1.12&lt;br /&gt;
                   NETMASK=255.255.255.0&lt;br /&gt;
                   GATEWAY=192.168.1.1&lt;br /&gt;
                   USERCTL=no&lt;br /&gt;
                   BOOTPROTO=none&lt;br /&gt;
                   ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
         Step 2.&lt;br /&gt;
&lt;br /&gt;
            Modify eth0, eth1 and eth2. Shown below are each one of my files. Note that&lt;br /&gt;
            you must comment out, or remove the ip address, netmask, gateway and hardware&lt;br /&gt;
            address from each one of these files, since settings should only come from&lt;br /&gt;
            the ifcfg-bond0 file above. I've chosen to comment out the lines, instead of &lt;br /&gt;
            removing, should I decide to unbond my NICS sometime in the future.&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth0&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:9D&lt;br /&gt;
                  #IPADDR=192.168.1.12&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  #GATEWAY=192.168.1.1&lt;br /&gt;
                  #USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  # Settings for Bond&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth1&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth1&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:C9&lt;br /&gt;
                  #IPADDR=192.168.1.13&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  #&lt;br /&gt;
                  # Settings for bonding&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              $ cat /etc/sysconfig/network-scripts/ifcfg-eth2&lt;br /&gt;
&lt;br /&gt;
                  # Linksys Gigabit Network Adapter&lt;br /&gt;
                  DEVICE=eth2&lt;br /&gt;
                  BOOTPROTO=none&lt;br /&gt;
                  #HWADDR=00:12:17:5C:A7:9D&lt;br /&gt;
                  #IPADDR=192.168.1.12&lt;br /&gt;
                  #NETMASK=255.255.255.0&lt;br /&gt;
                  ONBOOT=yes&lt;br /&gt;
                  #TYPE=Ethernet&lt;br /&gt;
                  #GATEWAY=192.168.1.1&lt;br /&gt;
                  #USERCTL=no&lt;br /&gt;
                  #IPV6INIT=no&lt;br /&gt;
                  #PEERDNS=yes&lt;br /&gt;
                  MASTER=bond0&lt;br /&gt;
                  SLAVE=yes&lt;br /&gt;
&lt;br /&gt;
         Step 3.&lt;br /&gt;
&lt;br /&gt;
            Set the load parameters for bond0 bonding kernel module. Append the&lt;br /&gt;
            following lines to /etc/modprobe.conf &lt;br /&gt;
&lt;br /&gt;
                 # bonding commands &lt;br /&gt;
                 alias bond0 bonding&lt;br /&gt;
                 options bond0 mode=balance-alb miimon=100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Step 4.&lt;br /&gt;
&lt;br /&gt;
            Load the bond driver module from the command prompt.&lt;br /&gt;
&lt;br /&gt;
                 $ modprobe bonding&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Step 5.&lt;br /&gt;
&lt;br /&gt;
            Restart the network, or restart the computer. Note I restarted to computer,&lt;br /&gt;
            since my NICs above had MAC assignments.&lt;br /&gt;
&lt;br /&gt;
                 $ service network restart   # Or restart computer&lt;br /&gt;
&lt;br /&gt;
             Take a look at the proc settings. &lt;br /&gt;
&lt;br /&gt;
                 $ cat /proc/net/bonding/bond0 &lt;br /&gt;
                 Ethernet Channel Bonding Driver: v3.0.3 (March 23, 2006)&lt;br /&gt;
&lt;br /&gt;
                 Bonding Mode: adaptive load balancing&lt;br /&gt;
                 Primary Slave: None&lt;br /&gt;
                 Currently Active Slave: eth2&lt;br /&gt;
                 MII Status: up&lt;br /&gt;
                 MII Polling Interval (ms): 100&lt;br /&gt;
                 Up Delay (ms): 0&lt;br /&gt;
                 Down Delay (ms): 0&lt;br /&gt;
&lt;br /&gt;
                 Slave Interface: eth2&lt;br /&gt;
                 MII Status: up&lt;br /&gt;
                 Link Failure Count: 0&lt;br /&gt;
                 Permanent HW addr: 00:13:72:80:62:f0&lt;br /&gt;
            &lt;br /&gt;
     References:&lt;br /&gt;
&lt;br /&gt;
         http://www.cyberciti.biz/nixcraft/vivek/blogger/2006/04/linux-bond-or-team-multiple-network.php&lt;br /&gt;
          Good, well written article describing the steps above.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=24692&amp;amp;package_id=146474&lt;br /&gt;
          Documentation for bonding that can also be found in the kernel&lt;br /&gt;
          ./Documentation/networking/bonding.txt&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIP 229:&lt;br /&gt;
&lt;br /&gt;
     /etc/nsswitch.conf - System Databases and Name Service Switch configuration file. &lt;br /&gt;
&lt;br /&gt;
         This file determines lookup order of services. For example, to match a name&lt;br /&gt;
         to an IP address, an entry can be put into the /etc/hosts file. Or a DNS query&lt;br /&gt;
         can be made. What's the order?  Normally, it's the entry in the /etc/hosts file.&lt;br /&gt;
         because /etc/nsswitch.conf contains the following setting&lt;br /&gt;
        &lt;br /&gt;
            hosts:      files dns&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	 See man nsswitch.conf for more settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
THE FOLLOWING SECTIONS STARTS THE PROGRAMMING TIPS&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 1:&lt;br /&gt;
&lt;br /&gt;
     Simple open command that restarts the close if a signal&lt;br /&gt;
     occurs.  Also note, the POSIX standards committee decided&lt;br /&gt;
     all new functions would not use errno and would instead&lt;br /&gt;
     directly return the error number in the function.&lt;br /&gt;
&lt;br /&gt;
     A lot of functions return -1 on an error condition, then,&lt;br /&gt;
     set errno to the value of the error.  This will still work&lt;br /&gt;
     for all the well known functions; but, it's changing.&lt;br /&gt;
&lt;br /&gt;
     /* start of code open.c&lt;br /&gt;
        Compile gcc -o open open.c&lt;br /&gt;
&lt;br /&gt;
        Reference (Look for simple_but_common_x.x.x.tar.gz):&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79066&lt;br /&gt;
&lt;br /&gt;
                             */&lt;br /&gt;
     #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     #include &amp;lt;string.h&amp;gt;             /* for strerror(int errno) */&lt;br /&gt;
     #include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     #define BUFLEN 100&lt;br /&gt;
     extern int errno;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     int&lt;br /&gt;
     main (void)&lt;br /&gt;
     {&lt;br /&gt;
       int fp,error;&lt;br /&gt;
       char buf[BUFLEN+1];&lt;br /&gt;
&lt;br /&gt;
       if ((fp = open (&amp;quot;data&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1)&lt;br /&gt;
         {&lt;br /&gt;
           fprintf (stderr, &amp;quot;Can't open data: %s\n&amp;quot;, strerror (errno));&lt;br /&gt;
           return 1;&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
       snprintf (buf, BUFLEN, &amp;quot;123&amp;quot;);&lt;br /&gt;
       write (fp, buf, strlen (buf));&lt;br /&gt;
&lt;br /&gt;
       // Restart close should a signal occur */&lt;br /&gt;
       while((( error = close (fp) ) == -1) &amp;amp;&amp;amp; (errno == EINTR));&lt;br /&gt;
       if(error == -1)&lt;br /&gt;
         perror(&amp;quot;Failed to close the file\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
       return 0;&lt;br /&gt;
      }&lt;br /&gt;
     /* end of open.c */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 2:&lt;br /&gt;
&lt;br /&gt;
     Example of setting the effective UID on a file&lt;br /&gt;
&lt;br /&gt;
     /*  start of code&lt;br /&gt;
       gcc uid_open.c -o uid_open&lt;br /&gt;
       su&lt;br /&gt;
       chown root.chirico uid_open&lt;br /&gt;
       chmod u+s uid_open&lt;br /&gt;
       exit&lt;br /&gt;
&lt;br /&gt;
       Now you can run this as chirico and write to the&lt;br /&gt;
       root directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     */&lt;br /&gt;
     #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;string.h&amp;gt;&lt;br /&gt;
     #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     int main()&lt;br /&gt;
     {&lt;br /&gt;
             int fd;&lt;br /&gt;
&lt;br /&gt;
             if ((fd = open(&amp;quot;/root/datajunk&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1) {&lt;br /&gt;
                     fprintf(stderr, &amp;quot;Can't open file \n&amp;quot;);&lt;br /&gt;
                     return 1;&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
             write(fd, &amp;quot;0123456&amp;quot;, strlen(&amp;quot;0123456&amp;quot;));&lt;br /&gt;
             close(fd);&lt;br /&gt;
             return 0;&lt;br /&gt;
     }&lt;br /&gt;
&lt;br /&gt;
     /* end of code */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 3:&lt;br /&gt;
&lt;br /&gt;
     Writing a C http post.&lt;br /&gt;
&lt;br /&gt;
     For downloads reference:&lt;br /&gt;
      http://prdownloads.sourceforge.net/cpearls/spider.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 4:&lt;br /&gt;
&lt;br /&gt;
     Writing a 2.6.x Kernel Module:&lt;br /&gt;
&lt;br /&gt;
       Look for the latest version of &amp;quot;procreadwrite&amp;quot;.  This is a 2.6 kernel&lt;br /&gt;
       modules that demonstrates how to create /proc entires and write directly&lt;br /&gt;
       to user-land via tty.  It's updated to reflect replacement of &amp;quot;current-&amp;gt;tty&amp;quot;&lt;br /&gt;
       with &amp;quot;current-&amp;gt;signal-&amp;gt;tty&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
         http://sourceforge.net/project/showfiles.php?group_id=79066&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 5:&lt;br /&gt;
&lt;br /&gt;
     Creating a filename with '\n'.  This goes with (TIP 71)&lt;br /&gt;
&lt;br /&gt;
         /**** topen.c ***********************************************************&lt;br /&gt;
           Filenames can be created with any character except the null character&lt;br /&gt;
           and a slash.&lt;br /&gt;
&lt;br /&gt;
           This example creates a file with returns '\n\n'&lt;br /&gt;
&lt;br /&gt;
           There's a way to remove a file by inode:&lt;br /&gt;
&lt;br /&gt;
               $ ls -libt *&lt;br /&gt;
&lt;br /&gt;
           And, once you know the inode&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec mv '{}' goodstuff \;&lt;br /&gt;
&lt;br /&gt;
           or&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec rm '{}' goodstuff \;&lt;br /&gt;
&lt;br /&gt;
           or&lt;br /&gt;
&lt;br /&gt;
               $ find . -inum &amp;lt;num&amp;gt; -exec cat '{}' \;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         Compile:&lt;br /&gt;
&lt;br /&gt;
             gcc -o topen -Wall -W -O2 -s -pipe  topen.c&lt;br /&gt;
&lt;br /&gt;
         Reference:&lt;br /&gt;
           http://prdownloads.sourceforge.net/cpearls/simple_but_common_0.0.14.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
         */&lt;br /&gt;
         #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
         #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         #include &amp;lt;string.h&amp;gt;             /* for strerror(int errno) */&lt;br /&gt;
         #include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         #define BUFLEN 100&lt;br /&gt;
         extern int errno;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         int&lt;br /&gt;
         main (void)&lt;br /&gt;
         {&lt;br /&gt;
           int fp,error;&lt;br /&gt;
           char buf[BUFLEN+1];&lt;br /&gt;
&lt;br /&gt;
           if ((fp = open (&amp;quot;\n\n\n\n\n\n\n\n\n&amp;quot;, O_RDWR | O_CREAT, 0600)) == -1)&lt;br /&gt;
             {&lt;br /&gt;
               fprintf (stderr, &amp;quot;Can't open data: %s\n&amp;quot;, strerror (errno));&lt;br /&gt;
               return 1;&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
           snprintf (buf, BUFLEN, &amp;quot;123&amp;quot;);&lt;br /&gt;
           write (fp, buf, strlen (buf));&lt;br /&gt;
&lt;br /&gt;
           // Restart close should a signal occur */&lt;br /&gt;
           while((( error = close (fp) ) == -1) &amp;amp;&amp;amp; (errno == EINTR));&lt;br /&gt;
           if(error == -1)&lt;br /&gt;
             perror(&amp;quot;Failed to close the file\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
           return 0;&lt;br /&gt;
&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  **Note, if you want email notification after every 50 new tips have been&lt;br /&gt;
    added, then, click on the following link:&lt;br /&gt;
&lt;br /&gt;
     https://sourceforge.net/project/filemodule_monitor.php?filemodule_id=120838&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 6:&lt;br /&gt;
&lt;br /&gt;
     Working With The Lemon Parser Generator.&lt;br /&gt;
     http://prdownloads.sourceforge.net/souptonuts/lemon_examples.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 7:&lt;br /&gt;
&lt;br /&gt;
     copy command for std container output.&lt;br /&gt;
&lt;br /&gt;
        #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
        #include &amp;lt;list&amp;gt;&lt;br /&gt;
        #include &amp;lt;vector&amp;gt;&lt;br /&gt;
        #include &amp;lt;iterator&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        using namespace std;&lt;br /&gt;
        int main(void)&lt;br /&gt;
        {&lt;br /&gt;
          vector&amp;lt;int&amp;gt; v;&lt;br /&gt;
          list&amp;lt;int&amp;gt; l;&lt;br /&gt;
&lt;br /&gt;
          v.push_back(1);&lt;br /&gt;
          v.push_back(2);&lt;br /&gt;
          copy(v.begin(),v.end(),ostream_iterator&amp;lt;int&amp;gt;(cout,&amp;quot;\n&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          l.push_back(23);&lt;br /&gt;
          l.push_back(12);&lt;br /&gt;
          copy(l.begin(),l.end(),ostream_iterator&amp;lt;int&amp;gt;(cout,&amp;quot;\n&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 8:&lt;br /&gt;
&lt;br /&gt;
  /* Copyright (c) 2005 Mike Chirico mchirico@comcast.net mchirico@users.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Example of using virtual functions. Note the use of &amp;quot;initialization lists&amp;quot;&lt;br /&gt;
              for assinging the variable first and last.&lt;br /&gt;
&lt;br /&gt;
      Compile:&lt;br /&gt;
        g++ -o virtualfunc -Wall -W -O2 -s -pipe  virtual_function.cc&lt;br /&gt;
&lt;br /&gt;
      Download:&lt;br /&gt;
        http://prdownloads.sourceforge.net/cpearls/simple_but_common_cpp.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  */&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
  #include &amp;lt;string&amp;gt;&lt;br /&gt;
  #include &amp;lt;list&amp;gt;&lt;br /&gt;
  #include &amp;lt;algorithm&amp;gt;&lt;br /&gt;
  #include &amp;lt;iterator&amp;gt;&lt;br /&gt;
  #include &amp;lt;functional&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  using namespace std;&lt;br /&gt;
&lt;br /&gt;
  class Employee {&lt;br /&gt;
  string first,last;&lt;br /&gt;
  public:&lt;br /&gt;
    Employee(const string&amp;amp; fn=&amp;quot;John&amp;quot;,const  string&amp;amp; ln=&amp;quot;Smith&amp;quot;): first(fn),last(ln) {}&lt;br /&gt;
    virtual void print() const {&lt;br /&gt;
    cout &amp;lt;&amp;lt; &amp;quot;First name: &amp;quot; &amp;lt;&amp;lt; first &amp;lt;&amp;lt; &amp;quot;, Last name: &amp;quot; &amp;lt;&amp;lt; last &amp;lt;&amp;lt; endl;&lt;br /&gt;
    }&lt;br /&gt;
    virtual ~Employee() {}&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  class Manager : public Employee {&lt;br /&gt;
    int level;&lt;br /&gt;
    list&amp;lt;Employee*&amp;gt; subordinates;&lt;br /&gt;
  public:&lt;br /&gt;
    Manager(const string&amp;amp; fn=&amp;quot;Ivan&amp;quot;,const string&amp;amp; ln=&amp;quot;Stedwick&amp;quot;, int lvl=1): Employee(fn,ln), level(lvl) {}&lt;br /&gt;
    void print() {&lt;br /&gt;
      cout &amp;lt;&amp;lt; &amp;quot;Manager level: &amp;quot; &amp;lt;&amp;lt; level &amp;lt;&amp;lt; &amp;quot;  &amp;quot;;&lt;br /&gt;
      Employee::print();&lt;br /&gt;
      cout &amp;lt;&amp;lt; &amp;quot;Supervises:&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
      for_each(subordinates.begin(),subordinates.end(),mem_fun(&amp;amp;Employee::print));&lt;br /&gt;
      cout &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; endl;&lt;br /&gt;
    }&lt;br /&gt;
    void addstaff(Employee&amp;amp; staff){&lt;br /&gt;
      subordinates.push_front(&amp;amp;staff);&lt;br /&gt;
    }&lt;br /&gt;
    void addstaff(Employee* staff){&lt;br /&gt;
      subordinates.push_front(staff);&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   int main()&lt;br /&gt;
   {&lt;br /&gt;
     Employee p0(&amp;quot;Lisa&amp;quot;,&amp;quot;Payne&amp;quot;);&lt;br /&gt;
     Manager m0;&lt;br /&gt;
&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Zoe&amp;quot;,&amp;quot;Bear&amp;quot;)); /* uses void addstaff(Employee* staff) */&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Leah&amp;quot;,&amp;quot;Bopper&amp;quot;));&lt;br /&gt;
     m0.addstaff(new Employee(&amp;quot;Abby&amp;quot;,&amp;quot;Chicken&amp;quot;));&lt;br /&gt;
     m0.addstaff(p0);  /* void addstaff(Employee&amp;amp; staff)  needed for this one */&lt;br /&gt;
     m0.addstaff(new Employee());&lt;br /&gt;
     m0.print();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     return 0;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 9:&lt;br /&gt;
&lt;br /&gt;
   /*  Named Constructor Idiom.&lt;br /&gt;
       Reference: http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.6&lt;br /&gt;
&lt;br /&gt;
   */&lt;br /&gt;
   #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
   #include &amp;lt;cmath&amp;gt;&lt;br /&gt;
   using namespace std;&lt;br /&gt;
&lt;br /&gt;
   class Point {&lt;br /&gt;
&lt;br /&gt;
   public:&lt;br /&gt;
     static Point rectangular(float x, float y);&lt;br /&gt;
     static Point polar(float radius, float angle);&lt;br /&gt;
     float get_x() { return x_; }&lt;br /&gt;
     float get_y() { return y_; }&lt;br /&gt;
&lt;br /&gt;
   private:&lt;br /&gt;
     Point(float x, float y);&lt;br /&gt;
     float x_, y_;&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
   inline Point::Point(float x, float y)&lt;br /&gt;
     : x_(x), y_(y) {}&lt;br /&gt;
&lt;br /&gt;
   inline Point Point::rectangular(float x, float y)&lt;br /&gt;
   { return Point(x,y); }&lt;br /&gt;
&lt;br /&gt;
   inline Point Point::polar(float radius, float angle)&lt;br /&gt;
   { return Point(radius*cos(angle),radius*sin(angle)); }&lt;br /&gt;
&lt;br /&gt;
   int main(void)&lt;br /&gt;
   {&lt;br /&gt;
     Point p1 = Point::rectangular(5.7,1.2);&lt;br /&gt;
     Point p2 = Point::polar(5.7,1.2);&lt;br /&gt;
&lt;br /&gt;
     cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; p1.get_x() &amp;lt;&amp;lt; &amp;quot;, &amp;quot; &amp;lt;&amp;lt; p1.get_y() &amp;lt;&amp;lt; &amp;quot;)&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
     cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; p2.get_x() &amp;lt;&amp;lt; &amp;quot;, &amp;quot; &amp;lt;&amp;lt; p2.get_y() &amp;lt;&amp;lt; &amp;quot;)&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING TIP 10:&lt;br /&gt;
&lt;br /&gt;
   /* Copy_constructor_assignment.cc&lt;br /&gt;
      Copyright (c) 2004 GPL Mike Chirico, mchirico@comcast.net or mchirico@users.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
      Reference: &amp;quot;The C++ Programming Language&amp;quot;, 3rd ed, by Stroustrup&lt;br /&gt;
      pg. 246.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      Download:&lt;br /&gt;
      http://prdownloads.sourceforge.net/cpearls/simple_but_common.tar.gz?download&lt;br /&gt;
&lt;br /&gt;
   */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   class Name {&lt;br /&gt;
   public:&lt;br /&gt;
     char* s;&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   class Table {&lt;br /&gt;
     Name *p;&lt;br /&gt;
     size_t sz;&lt;br /&gt;
   public:&lt;br /&gt;
     Table(size_t s=15) {&lt;br /&gt;
               p = new Name[sz=s];&lt;br /&gt;
               for(size_t i=0; i&amp;lt; sz; ++i) p[i].s=&amp;quot;****&amp;quot;;&lt;br /&gt;
                          }&lt;br /&gt;
     Table(const Table &amp;amp;t);&lt;br /&gt;
     Table&amp;amp; operator=(const Table&amp;amp;);&lt;br /&gt;
     int prt();&lt;br /&gt;
     void asgn(char* ts,size_t index);&lt;br /&gt;
     ~Table(){ delete[] p; }&lt;br /&gt;
   };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Table&amp;amp; Table::operator=(const Table &amp;amp;t)&lt;br /&gt;
   {&lt;br /&gt;
     if( this != &amp;amp;t) {&lt;br /&gt;
       delete[] p;&lt;br /&gt;
       p = new Name[sz=t.sz];&lt;br /&gt;
       for(size_t i=0; i&amp;lt; t.sz; ++i) p[i]=t.p[i];&lt;br /&gt;
     }&lt;br /&gt;
     return *this;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   int Table::prt()&lt;br /&gt;
   {&lt;br /&gt;
     for(size_t i=0; i&amp;lt; sz; ++i) std::cout &amp;lt;&amp;lt; p[i].s &amp;lt;&amp;lt; &amp;quot; &amp;quot;;&lt;br /&gt;
     std::cout &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
     return 0;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   /*&lt;br /&gt;
     asgn will increase the array of strings, if needed&lt;br /&gt;
     to size index+1, and add the string ts to position&lt;br /&gt;
     index.&lt;br /&gt;
   */&lt;br /&gt;
   void Table::asgn(char* ts,size_t index)&lt;br /&gt;
   {&lt;br /&gt;
     if(index &amp;lt; sz ) {&lt;br /&gt;
        p[index].s=ts;&lt;br /&gt;
     }else if ( index &amp;gt;= sz ){&lt;br /&gt;
        Name *tp;&lt;br /&gt;
        tp=p;&lt;br /&gt;
&lt;br /&gt;
        p = new Name[index+1];&lt;br /&gt;
&lt;br /&gt;
        for(size_t i=0; i&amp;lt; sz; ++i) p[i].s=tp[i].s;&lt;br /&gt;
        delete [] tp;&lt;br /&gt;
        for(size_t i=sz; i &amp;lt; index; ++i)p[i].s=&amp;quot;****&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
        p[index].s=ts;&lt;br /&gt;
        sz=index+1;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   int main(void)&lt;br /&gt;
   {&lt;br /&gt;
&lt;br /&gt;
     Table t1;&lt;br /&gt;
     Table t2(5);&lt;br /&gt;
&lt;br /&gt;
     // this is bigger than initial sz&lt;br /&gt;
     t1.asgn(&amp;quot;myname&amp;quot;,20);&lt;br /&gt;
     t1.prt();&lt;br /&gt;
     t2.prt();&lt;br /&gt;
&lt;br /&gt;
     t1=t2;&lt;br /&gt;
&lt;br /&gt;
     t1.prt();&lt;br /&gt;
     t2.prt();&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REFERENCES:&lt;br /&gt;
&lt;br /&gt;
  (1)  http://www.tldp.org/LDP/abs/html/index.html&lt;br /&gt;
  (2)  http://www.shelldorado.com/&lt;br /&gt;
  (3)  http://www.faqs.org/ftp/usenet/news.answers/unix-faq/faq/part1&lt;br /&gt;
  (4)  http://www-106.ibm.com/developerworks/library/l-rpm1/&lt;br /&gt;
  (5)  http://www-136.ibm.com/developerworks/linux/&lt;br /&gt;
  (6)  http://www.gnu.org/manual/manual.html&lt;br /&gt;
  (7)  http://fedora.redhat.com/&lt;br /&gt;
  (8)  http://souptonuts.sourceforge.net/chirico/index.php&lt;br /&gt;
  (9)  http://www.faqs.org/faqs/&lt;br /&gt;
 (10)  http://www.faqs.org/docs/linux_network/&lt;br /&gt;
 (11)  http://www.tml.hut.fi/~viu/linux/sag/sag-0.6.2.html/index.html&lt;br /&gt;
 (12)  http://www.yolinux.com/TUTORIALS/LinuxTutorialSysAdmin.html&lt;br /&gt;
 (13)  http://sed.sourceforge.net/grabbag/scripts/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  SUMMARY:&lt;br /&gt;
   (1)(2)(3) Excellent resource for bash scripts.&lt;br /&gt;
   (4)       rpm resource&lt;br /&gt;
   (6)       GNU Manuals Online&lt;br /&gt;
   (7)       Fedora&lt;br /&gt;
   (8)       Authors Website&lt;br /&gt;
   (11)(12)  System Admin&lt;br /&gt;
   (13)      Excellent source of sed scripts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
HIGHLY RECOMMENDED BOOKS:&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX Network Programming, The Sockets Networking API&amp;quot;, Volume 1, Third Edition.&lt;br /&gt;
        W. Richard Stevens, Bill Fenner, Andrew M. Rudoff.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX Network Programming, Interprocess Communications&amp;quot;, Volume 2, Second Edition.&lt;br /&gt;
        W. Richard Stevens.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;UNIX SYSTEMS Programming, Communication, Concurrency, and Threads&amp;quot;, Kay A. Robbins,&lt;br /&gt;
        Steven Robbins&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming with POSIX Threads&amp;quot;, David R. Butenhof. Addison-Wesley&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;The C++ Programming Language&amp;quot; Third Edition. Bjarne Stroustrup. Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C Programming Language&amp;quot; (2nd Edition), Second Edition, Kernighan and Ritchie&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Advanced Linux Programming&amp;quot; by Mark Mitchell, Jeffrey Oldham, and Alex Samuel, of&lt;br /&gt;
        CodeSourcery LL. This book if free at the following resource:&lt;br /&gt;
        http://www.advancedlinuxprogramming.com/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Accelerated C++, Practical Programming by Example&amp;quot; Andrew Koenig, Barbara E. Moo.&lt;br /&gt;
        Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C: A Reference Manual&amp;quot;, Fifth Edition, Samuel P. Harbison, Guy L. Steele.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Standard Library: A Tutorial and Reference, The&amp;quot;, Nicolai M. Josuttis. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Templates: The Complete Guide&amp;quot;, David Vandevoorde, Nicolai M. Josuttis. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Exceptional C++: 47 Engineering Puzzles, Programming Problems, and Solutions&amp;quot;, Herb Sutter.&lt;br /&gt;
     Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;More Exceptional C++&amp;quot;, Herb Sutter.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Exceptional C++ Style: 40 New Engineering Puzzles, Programming Problems, and Solutions&amp;quot;,&lt;br /&gt;
       Herb Sutter. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;The Art of Computer Programming (TAOCP)&amp;quot;, Vol 1,Vol 2, Vol 3. Donald E. Knuth. Addison-Wesley.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming Perl, 3rd Edition&amp;quot;, Tom Christiansen, Jon Orwant, Larry Wall. O'Reilly.&lt;br /&gt;
       http://www.unix.org.ua/orelly/perl/prog3/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Programming from the Ground Up&amp;quot;, Jonathan Bartlett, Edited by Dominick Bruno, Jr.&lt;br /&gt;
       http://savannah.nongnu.org/download/pgubook/&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Expert C Programming&amp;quot;, Peter van der Linden, Prentice Hall PTR.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Coding Standards 101 Rules, Guidelines, and Best Practices&amp;quot;, by Herb Sutter and&lt;br /&gt;
       Andrei Alexandrescu.  http://www.gotw.ca/publications/c++cs/bibliography.htm&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Linux Kernel Development: A practical guide to the design and implementation of&lt;br /&gt;
       the Linux kernel&amp;quot;, by Robert Love, Sams Publishing.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond&amp;quot;, by&lt;br /&gt;
       David Abrahams and Aleksey Gurtovoy. Addison Wesley.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
HIGHLY RECOMMENDED: PHILOSOPHICAL&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;Zen and the Art of Motorcycle Maintenance: An Inquiry into Values&amp;quot;, Robert Pirsig.&lt;br /&gt;
        http://www.virtualschool.edu/mon/Quality/PirsigZen/index.html&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;Lila: An Inquiry Into Morals&amp;quot;, Robert Pirsig.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RECOMMENDED BOOKS:&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Structure and Interpretation of Computer Programs&amp;quot;, Harold Abelson, Gerald Jay Sussman,&lt;br /&gt;
      Julie Sussman. This book is free:&lt;br /&gt;
        http://mitpress.mit.edu/sicp/full-text/book/book.html&lt;br /&gt;
              and&lt;br /&gt;
        http://www.gnu.org/software/mit-scheme/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RECOMMENDED HOTOS:&lt;br /&gt;
&lt;br /&gt;
    Linux Networking-HOWTO (Previously the Net-3 Howto)&lt;br /&gt;
     http://en.tldp.org/HOWTO/NET3-4-HOWTO.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CORRECTIONS:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following people made suggestions and corrections:&lt;br /&gt;
  - Jorge Fabregas &amp;lt;fabregasj@prtc.net&amp;gt; TIP 21&lt;br /&gt;
  - Malcolm Parsons &amp;lt;malcolm.parsons@gmail.com&amp;gt; TIP 44&lt;br /&gt;
  - Andreas Haunschmidt &amp;lt;Andreas.Haunschmidt@utanet.at&amp;gt; TIP 102, TIP 90&lt;br /&gt;
  - P@draigBrady.com (Following links )&lt;br /&gt;
  - Jacques.GARNIER-EXTERIEUR@EU.RHODIA.COM TIP 46&lt;br /&gt;
&lt;br /&gt;
                http://www.pixelbeat.org/cmdline.html&lt;br /&gt;
                http://www.pixelbeat.org/rotagator/linux.tips/rotagator.fortune&lt;br /&gt;
                http://www.pixelbeat.org/scripts/&lt;br /&gt;
&lt;br /&gt;
  - Tobias Nix &amp;lt;tobias.nix@gmail.com&amp;gt; TIP 12&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>C4tboCcdro</name></author>	</entry>

	</feed>