home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 8 / CDACTUAL8.iso / docs / tips-how < prev    next >
Encoding:
Text File  |  1996-07-11  |  7.3 KB  |  214 lines

  1.   The Linux Tips HOWTO
  2.   Paul Anderson, panderso@ebtech.net
  3.   v1.0, June 1996
  4.  
  5.   This HOWTO contains those hard to find hints and tweekings that make
  6.   Linux a bit nicer.
  7.  
  8.   1.  Introduction
  9.  
  10.   Welcome to the Linux Tips HOWTO, a list of neato tricks and
  11.   optimizations that make Linux more fun.  All I have in here right now
  12.   are tips off of the top of my head, and tips from the old Tips-
  13.   HOWTO(Why take out decent tips, right?).  So send all your favorite
  14.   hints and tips to me so I can put them in the next Tips-HOWTO.
  15.  
  16.   Paul Anderson Maintainer--Linux TIPS HOWTO
  17.  
  18.   panderso@ebtech.net
  19.  
  20.   2.  Short Tips
  21.  
  22.   2.1.  Handy Syslog Trick Paul Anderson, Tips-HOWTO maintainer
  23.  
  24.   Edit your /etc/syslog.conf, and put in the following line:
  25.  
  26.        # Dump everything on tty8
  27.        *.*                                     /dev/tty8
  28.  
  29.   One caveat: REMEMBER TO USE TABS!  syslog doesn't like spaces...
  30.  
  31.   2.2.  Moving directories between filesystems. Alan Cox,
  32.   A.Cox@swansea.ac.uk
  33.  
  34.   Quick way to move an entire tree of files from one disk to another
  35.  
  36.        (cd /source/directory; tar cf - . ) | (cd /dest/directory; tar xvfp -)
  37.  
  38.   2.3.  The Linux Gazette
  39.  
  40.   Kudos go to John Fisk, creator of the Linux Gazette.  This is an
  41.   excellent e-zine plus, it's FREE!!!  Now what more could you ask?
  42.   Check it out at:
  43.  
  44.        http://www.redhat.com/lg
  45.  
  46.   While you're there, drop John Fisk a note telling him how wonderful an
  47.   e-zine LG is.
  48.  
  49.   2.4.  Ted Stern, stern@amath.washington.edu Pointer to patch for GNU
  50.   Make 3.70 to change VPATH behavior.
  51.  
  52.   I don't know if many people have this problem, but there is a
  53.   "feature" of GNU make version 3.70 that I don't like. It is that VPATH
  54.   acts funny if you give it an absolute pathname.  There is an extremely
  55.   solid patch that fixes this, which you can get from Paul D. Smith
  56.   <psmith@wellfleet.com>.  He also posts the documentation and patch
  57.   after every revision of GNU make on the newsgroup system I have access
  58.   to.
  59.  
  60.   2.5.  How do I stop my system from fscking on each reboot? Dale Lutz,
  61.   dal@wimsey.com
  62.  
  63.   Q:  How do I stop e2fsck from checking my disk every time I boot up.
  64.  
  65.   A:  When you rebuild the kernel, the filesystem is marked as 'dirty'
  66.   and so your disk will be checked with each boot.  The fix is to run:
  67.  
  68.   rdev -R /zImage 1
  69.  
  70.   This fixes the kernel so that it is no longer convinced that the
  71.   filesystem is dirty.
  72.  
  73.   Note: If using lilo, then add read-only to your linux setup in your
  74.   lilo config file (Usually /etc/lilo.conf)
  75.  
  76.   2.6.  How to avoid fscks caused by "device busy" at reboot time. Jon
  77.   Tombs, jon@gtex02.us.es
  78.  
  79.   If you often get device busy errors on shutdown that leave the
  80.   filesystem in need of an fsck upon reboot, here is a simple fix:
  81.  
  82.   To /etc/brc or /sbin/brc, add the line
  83.  
  84.        mount -o remount,ro /mount.dir
  85.  
  86.   for all your mounted filesystems except /, before the call to umount
  87.   -a. This means if, for some reason, shutdown fails to kill all pro¡
  88.   cesses and umount the disks they will still be clean on reboot. Saves
  89.   a lot of time at reboot for me
  90.  
  91.   2.7.  How to print pages with a margin for hole punching. Mike Dickey,
  92.   mdickey@thorplus.lib.purdue.edu
  93.  
  94.        ______________________________________________________________________
  95.                #!/bin/sh
  96.                # /usr/local/bin/print
  97.                # a simple formatted printout, to enable someone to
  98.                # 3-hole punch the output and put it in a binder
  99.  
  100.                cat $1 | pr -t -o 5 -w 85 | lpr
  101.        ______________________________________________________________________
  102.  
  103.   2.8.  Raul Deluth Miller, rockwell@nova.umd.edu A way to search
  104.   through trees of files for a particular regular expression.
  105.  
  106.   I call this script 'forall'.  Use it like this:
  107.  
  108.        forall /usr/include grep -i ioctl
  109.        forall /usr/man grep ioctl
  110.  
  111.   Here's forall:
  112.  
  113.        ______________________________________________________________________
  114.        #!/bin/sh
  115.        if [ 1 = `expr 2 \> $#` ]
  116.        then
  117.                echo Usage: $0 dir cmd [optargs]
  118.                exit 1
  119.        fi
  120.        dir=$1
  121.        shift
  122.        find $dir -type f -print | xargs "$@"
  123.        ______________________________________________________________________
  124.  
  125.   2.9.  Barry Tolnas, tolnas@nestor.engr.utk.edu A script for cleaning
  126.   up after programs that creat autosave and backup files.
  127.  
  128.   Here is a simple two-liner which recursively descends a directory
  129.   hierarchy removing emacs auto-save ( ) and backup (#) files, .o files,
  130.   and  TeX .log files. It also compresses .tex files and README files. I
  131.   call it 'squeeze' on my system.
  132.  
  133.        ______________________________________________________________________
  134.        #!/bin/sh
  135.        #SQUEEZE removes unnecessary files and compresses .tex and README files
  136.        #By Barry tolnas, tolnas@sun1.engr.utk.edu
  137.        #
  138.        echo squeezing $PWD
  139.        find  $PWD \( -name \*~ -or -name \*.o -or -name \*.log -or -name \*\#\) -exec
  140.        rm -f {} \;
  141.        find $PWD \( -name \*.tex -or -name \*README\* -or -name \*readme\* \) -exec gzip -9 {} \;
  142.        ______________________________________________________________________
  143.  
  144.   3.  Detailed Tips
  145.  
  146.   3.1.  Sharing swap partitions between Linux and Windows. Tony Acero,
  147.   ace3@midway.uchicago.edu
  148.  
  149.   1. Format the partition as a dos partition, and create the Windows
  150.      swap file on it, but don't run windows yet. (You want to keep the
  151.      swap file completely empty for now, so that it compresses well).
  152.  
  153.   2. Boot linux and save the partition into a file.  For example if the
  154.      partition was /dev/hda8:
  155.  
  156.        dd if=/dev/hda8 of=/etc/dosswap
  157.  
  158.   3. Compress the dosswap file; since it is virtually all 0's it will
  159.      compress very well
  160.  
  161.        gzip -9 /etc/dosswap
  162.  
  163.   4. Add the following to the /etc/rc file to prepare and install the
  164.      swap space under Linux:
  165.  
  166.      XXXXX is the number of blocks in the swap partition
  167.  
  168.        mkswap /dev/hda8 XXXXX
  169.        swapon -av
  170.  
  171.   Make sure you add an entry for the swap partition in your /etc/fstab
  172.   file
  173.  
  174.   5. If your init/reboot package supports /etc/brc or /sbin/brc add the
  175.      following to /etc/brc, else do this by hand when you want to boot
  176.      to dos|os/2 and you want to convert the swap partition back to the
  177.      dos/windows version:
  178.  
  179.        swapoff -av
  180.        zcat /etc/dosswap.gz | dd of=/dev/hda8 bs=1k count=100
  181.  
  182.   # Note that this only writes the first 100 blocks back to the parti¡
  183.   tion. I've found empirically that this is sufficient
  184.  
  185.   >>  What are the pros and cons of doing this?
  186.  
  187.   Pros: you save a substantial amount of disk space.
  188.  
  189.   Cons: if step 5 is not automatic, you have to remember to do it by
  190.   hand, and it slows the reboot process by a nanosecond :-)
  191.  
  192.   3.2.  How to configure xdm's chooser for host selection. Arrigo Tri¡
  193.   ulzi, a.triulzi@ic.ac.uk
  194.  
  195.   1. Edit the file that launches xdm most likely /etc/rc/rc.6 or
  196.      /etc/rc.local) so that it contains the following lines in the xdm
  197.      startup section.
  198.  
  199.   /usr/bin/X11/xdm
  200.   exec /usr/bin/X11/X -indirect hostname
  201.  
  202.   2. Edit /usr/lib/X11/xdm/Xservers and comment out the line which
  203.      starts the server on the local machine i.e. starting 0:
  204.  
  205.   3. Reboot the machine and you're home and away.
  206.  
  207.   I add this because when I was, desperately, trying to set it up for my
  208.   own subnet over here it took me about a week to suss out all the
  209.   problems.
  210.  
  211.   Caveat: with old SLS (1.1.1) for some reason you can leave a -nodaemon
  212.   after the xdm line -- this does NOT work for later releases.
  213.  
  214.