This commit is contained in:
gferg 2002-02-03 21:04:44 +00:00
parent 22fd2f2487
commit cdd8bc7c83
5 changed files with 651 additions and 656 deletions

File diff suppressed because it is too large Load Diff

View File

@ -18,9 +18,18 @@
</author>
<revhistory>
<revision>
<revnumber>2.5</revnumber>
<date>2002-02-02</date>
<authorinitials>esr</authorinitials>
<revremark>
Corrected description of IP.
</revremark>
</revision>
<revision>
<revnumber>2.4</revnumber>
<date>12 June 2001</date>
<date>2001-06-12</date>
<authorinitials>esr</authorinitials>
<revremark>
Where to find more.
@ -29,7 +38,7 @@
<revision>
<revnumber>2.3</revnumber>
<date>22 May 2001</date>
<date>2001-05-21</date>
<authorinitials>esr</authorinitials>
<revremark>
Introduction to bus types.
@ -39,7 +48,7 @@
<revision>
<revnumber>2.2</revnumber>
<date>5 February 2001</date>
<date>2001-02-05</date>
<authorinitials>esr</authorinitials>
<revremark>
New section on how DNS is organized. Corrected for new
@ -49,7 +58,7 @@
<revision>
<revnumber>2.1</revnumber>
<date>29 November 2000</date>
<date>2000-11-29</date>
<authorinitials>esr</authorinitials>
<revremark>
Correct explanation of twos-complement numbers. Various
@ -59,7 +68,7 @@
<revision>
<revnumber>2.0</revnumber>
<date>5 August 2000</date>
<date>2000-08-05</date>
<authorinitials>esr</authorinitials>
<revremark>
First DocBook version. Detailed description of memory hierarchy.
@ -68,7 +77,7 @@
<revision>
<revnumber>1.7</revnumber>
<date>6 March 2000</date>
<date>2000-03-06</date>
<authorinitials>esr</authorinitials>
<revremark>
Correct and expanded the section on file permissions.
@ -77,7 +86,7 @@
<revision>
<revnumber>1.4</revnumber>
<date>25 September 1999</date>
<date>1999-09-25</date>
<authorinitials>esr</authorinitials>
<revremark>
Be more precise about what kernel does vs. what init does.
@ -86,7 +95,7 @@
<revision>
<revnumber>1.3</revnumber>
<date>27 June 1999</date>
<date>1999-06-27</date>
<authorinitials>esr</authorinitials>
<revremark>
The sections `What happens when you log in?' and `File
@ -96,7 +105,7 @@
<revision>
<revnumber>1.2</revnumber>
<date>26 December 1998</date>
<date>1998-12-26</date>
<authorinitials>esr</authorinitials>
<revremark>
The section `How does my computer store things in memory?'.
@ -105,7 +114,7 @@
<revision>
<revnumber>1.0</revnumber>
<date>29 October 1998</date>
<date>1998-10-29</date>
<authorinitials>esr</authorinitials>
<revremark>
Initial revision.
@ -159,7 +168,7 @@ periodically.</para>
<para>New versions of the Unix and Internet Fundamentals HOWTO will be
periodically posted to <ulink url="news:comp.os.linux.help">
comp.os.linux.help</ulink> and <ulink url="news:comp.os.linux.announce">
news:comp.os.linux.announce</ulink> and <ulink url="news:news.answers">
comp.os.linux.announce</ulink> and <ulink url="news:news.answers">
news.answers</ulink>. They will also be uploaded to various Linux WWW and
FTP sites, including the LDP home page.</para>
@ -203,10 +212,12 @@ on the
which is the heart of your computer.</para>
<para>Your computer has a screen and keyboard. It has hard drives and
floppy disks. The screen and your disks have <firstterm>controller
cards</firstterm> that plug into the motherboard and help the computer drive
these devices. (Your keyboard is too simple to need a separate
card; the controller is built into the keyboard chassis itself.)</para>
floppy disks. Some of these devices are run by <firstterm>controller
cards</firstterm> that plug into the motherboard and help the computer
drive them; others are run by specialized chipsets directly on the
motherboard that fulfill the same function as a controller card. Your
keyboard is too simple to need a separate card; the controller is built
into the keyboard chassis itself.</para>
<para>We'll go into some of the details of how these devices work later. For
now, here are a few basic things to keep in mind about how they work
@ -589,7 +600,7 @@ special <firstterm>swap space</firstterm><indexterm><primary>swap
space</primary></indexterm> area on your hard disk.</para>
<para>Note that in the past, that "Sometimes" last paragraph ago was
"Almost always," -- the size of memory was typically small relative to the
"Almost always" -- the size of memory was typically small relative to the
size of running programs, so swapping was frequent. Memory is far less
expensive nowadays and even low-end machines have quite a lot of it. On
modern single-user machines with 64MB of memory and up, it's possible to
@ -718,7 +729,7 @@ these details. Your programs get faster when they have stronger locality,
because that makes the caching work better. The easiest way to make
programs fast is therefore to make them small. If a program isn't slowed
down by lots of disk I/O or waits on network events, it will usually run at
the speed of the largest cache that it will fit inside.</para>
the speed of the smallest cache that it will fit inside.</para>
<para>If you can't make your whole program small, some effort to tune the
speed-critical portions so they have stronger locality can pay off.
@ -1497,18 +1508,18 @@ the transmission media in the network and the type of service.</para>
know that the Internet actually uses two protocols, stacked one on top
of the other.</para>
<para>The lower level,
<para>The lower level,
<firstterm>IP</firstterm><indexterm><primary>IP</primary></indexterm>
(Internet Protocol), knows how to get individual packets from a source
address to a destination address (this is why these are called IP
addresses). However, IP is not reliable; if a packet gets lost or dropped,
the source and destination machines may never know it. In network jargon,
IP is a <firstterm>connectionless</firstterm> protocol; the sender just fires
a packet at the receiver and doesn't expect an acknowledgement.</para>
<para>IP is fast and cheap, though. Sometimes fast, cheap and unreliable
is OK. When you play networked Doom or Quake, each bullet is represented
by an IP packet. If a few of those get lost, that's OK.</para>
(Internet Protocol), is responsible for labeling
individual packets with the source address and destination address of two
computers exchanging information over a network.
For example, when you access http://www.linuxdoc.org, the packets you send
will have your computer's IP address, such as 192.168.1.101, and the IP
address of the www.linuxdoc.org computer, 152.2.210.81. These addresses
work in much the same way that your home address works when someone sends
you a letter. The post office can read the address and determine where
you are and how best to route the letter to you, much like a router does
for Internet traffic.</para>
<para>The upper level,
<firstterm>TCP</firstterm><indexterm><primary>TCP</primary></indexterm>
@ -1600,3 +1611,4 @@ fill-column:75
compile-command: "mail -s \"Unix and Internet Fundamentals HOWTO update\" submit@linuxdoc.org <Unix-and-Internet-Fundamentals-HOWTO.sgml"
End:
-- >

View File

@ -42,7 +42,7 @@ C++ Programming HOW-TO
<author>Al Dev (Alavoor Vasudevan)
<htmlurl url="mailto:alavoor[AT]yahoo.com"
name="alavoor[AT]yahoo.com">
<date>v41.1, 22 Jan 2002
<date>v41.2, 01 Feb 2002
<abstract>
This document provides a comprehensive list of C++ URL
pointers, links to C++ online textbooks, and programming tips on C++.
@ -427,8 +427,7 @@ will build a sample custom string class by using multiple inheritance,
inheriting the standard C++ library string class and the String class
presented in Appendix A.
Start by downloading the sample file 'string_multi.h' from <ref id="Appendix
A">.
Start by downloading the sample file 'string_multi.h' from <ref id="Appendix A">.
That file is reproduced below:
@ -499,7 +498,12 @@ All the programs, examples are given in Appendix of this document.
You can download as a single tar zip, the String class, libraries
and example programs from
<itemize>
<item> Go here and click on C++Programming howto.tar.gz file <url url="http://www.aldev.8m.com">
<item>
Go to <url url="http://www.aldev.8m.com"> and click on
"Source code C++
Programming howto" (<url name="aldev-site" url="http://www.aldev.8m.com/cppsrc.html">)
<item> Mirror sites are at -
<url name="angelfire" url="http://www.angelfire.com/country/aldev0">,
<url name="geocities" url="http://www.geocities.com/alavoor/index.html">,
@ -537,8 +541,7 @@ software. Human brain is too slow and hence it is better to use the
computer's power to test and validate software.
The program
<url url="http://www.angelfire.com/country/aldev0/cpphowto/example_String.cpp"
name="example_String.cpp">
<url name="example_String.cpp" url="http://www.aldev.8m.com/cppsrc.html">
(and also given in
<ref id ="Appendix A" name="Appendix A">
) has regression test module which you can use to run the regression tests
@ -719,8 +722,8 @@ int main()
}
</code>
See the
<url url="http://www.angelfire.com/country/aldev0/cpphowto/example_String.cpp"
name="example_String.cpp">.
<url name="example_String.cpp" url="http://www.aldev.8m.com/cppsrc.html">
.
<!--
*******************************************
************ End of Section ***************
@ -1510,7 +1513,7 @@ way you should perform many other operations on files.
File.h
<url url="http://www.angelfire.com/country/aldev0/cpphowto/File.h">
and File.cpp
<url url="http://www.angelfire.com/country/aldev0/cpphowto/File.cpp">
<url name="File.cpp" url="http://www.aldev.8m.com/cppsrc.html">
<item> Java: Java.io.File class definition <url url="http://java.sun.com/j2se/1.3/docs/api/java/io/File.html">
<item> Quick Reference on File Class <url url="http://unicornsrest.org/reference/java/qref11/java.io.File.html">
</itemize>
@ -1587,8 +1590,8 @@ The zap() function will delete the pointer and set it NULL.
This will ensure that even if multiple zap()'s are called on the
same deleted pointer then the
program will not crash. Please see the function zap_example() in
<url url="http://www.angelfire.com/country/aldev0/cpphowto/example_String.cpp"
name="example_String.cpp">.
<url name="example_String.cpp" url="http://www.aldev.8m.com/cppsrc.html">
.
<code>
// See zap_example() in example_String.cpp
@ -1627,8 +1630,8 @@ or 'delete' to free memory allocated with malloc. If you do, then
results will be unpredictable.
See the zap examples in
<url url="http://www.angelfire.com/country/aldev0/cpphowto/example_String.cpp"
name="example_String.cpp">.
<url name="example_String.cpp" url="http://www.aldev.8m.com/cppsrc.html">
.
<!--
*******************************************
@ -3735,7 +3738,9 @@ are design goals <url url="http://www.voxilla.org/projects/projape.html">
<p>
<itemize>
<item>You can download all the tutorials in one file from
<url name="aldev-site" url="http://www.aldev.8m.com/cppsrc.html">
<url url="http://www.aldev.8m.com"> and click on
"Source code C++
Programming howto" (<url name="aldev-site" url="http://www.aldev.8m.com/cppsrc.html">)
<p>
<item>Threads tutorial is at <url url="http://www.math.arizona.edu/swig/pthreads/threads.html">
<p>
@ -3980,15 +3985,12 @@ Visit the following sites for C++ Utilities
<itemize>
<item> C++ Binary File I/O
<url url="http://www.angelfire.com/country/aldev0/cpphowto/cpp_BinaryFileIO.html">
and at <url url="http://aldev.50megs.com/cpphowto/cpp_BinaryFileIO.html" name="mirror site">
<p>
<item> Portability Guide
<url url="http://www.angelfire.com/country/aldev0/cpphowto/cpp_PortabilityGuide.html">
and at <url url="http://aldev.50megs.com/cpphowto/cpp_PortabilityGuide.html" name="mirror site">
<p>
<item> Snippets collections of C++ routines
<url url="http://www.angelfire.com/country/aldev0/cpphowto/cpp_Snippets.html">
and at <url url="http://aldev.50megs.com/cpphowto/cpp_Snippets.html" name="mirror site">
and at <url url="http://www.strangecreations.com/library/snippets" name="snippets site">
<p>
<item> escape ISB for C++ - Provides information on how to
@ -4310,7 +4312,7 @@ This will extract the files
<item> string_multi.h
<url url="http://www.angelfire.com/country/aldev0/cpphowto/string_multi.h">
<item> example_String.cpp
<url url="http://www.angelfire.com/country/aldev0/cpphowto/example_String.cpp">
<url name="example_String.cpp" url="http://www.aldev.8m.com/cppsrc.html">
</itemize>
<p>
@ -4319,7 +4321,7 @@ This will extract the files
<item> File.h
<url url="http://www.angelfire.com/country/aldev0/cpphowto/File.h">
<item> File.cpp
<url url="http://www.angelfire.com/country/aldev0/cpphowto/File.cpp">
<url name="File.cpp" url="http://www.aldev.8m.com/cppsrc.html">
</itemize>
<p>
@ -4328,20 +4330,20 @@ This will extract the files
<item> my_malloc.h
<url url="http://www.angelfire.com/country/aldev0/cpphowto/my_malloc.h">
<item> my_malloc.cpp
<url url="http://www.angelfire.com/country/aldev0/cpphowto/my_malloc.cpp">
<url name="my_malloc.cpp" url="http://www.aldev.8m.com/cppsrc.html">
</itemize>
<p>
<item> Implementation of String class...
<itemize>
<item> String.cpp
<url url="http://www.angelfire.com/country/aldev0/cpphowto/String.cpp">
<url name="String.cpp" url="http://www.aldev.8m.com/cppsrc.html">
<item> StringTokenizer.cpp
<url url="http://www.angelfire.com/country/aldev0/cpphowto/StringTokenizer.cpp">
<url name="StringTokenizer.cpp" url="http://www.aldev.8m.com/cppsrc.html">
<item> StringBuffer.cpp
<url url="http://www.angelfire.com/country/aldev0/cpphowto/StringBuffer.cpp">
<url name="StringBuffer.cpp" url="http://www.aldev.8m.com/cppsrc.html">
<item> StringRW.cpp
<url url="http://www.angelfire.com/country/aldev0/cpphowto/StringRW.cpp">
<url name="StringRW.cpp" url="http://www.aldev.8m.com/cppsrc.html">
</itemize>
<p>
@ -4350,9 +4352,9 @@ This will extract the files
<item> debug.h
<url url="http://www.angelfire.com/country/aldev0/cpphowto/debug.h">
<item> debug.cpp
<url url="http://www.angelfire.com/country/aldev0/cpphowto/debug.cpp">
<item> Makefile
<url url="http://www.angelfire.com/country/aldev0/cpphowto/Makefile">
<url name="debug.cpp" url="http://www.aldev.8m.com/cppsrc.html">
<item> Makefile.unx
<url url="http://www.angelfire.com/country/aldev0/cpphowto/Makefile.unx">
</itemize>
<p>

View File

@ -37,7 +37,7 @@
" name="
bri@cs.uchicago.edu
">
<date>v3.3, 28 Jan 2002
<date>v3.4, 01 Feb 2002
<abstract>
This is a detailed guide to kernel configuration, compilation, upgrades,
@ -141,6 +141,8 @@ The latest version of this section is at <url url="http://www.aldev.8m.com"> and
These sites have <bf>lots of linux goodies</bf> and tips.
The latest copy of this document can be found at <bf><url url="http://www.aldev.8m.com"></bf>.
Kernel re-compile is required in order to make the kernel very lean
and which will result in FASTER operating system . It is also
required to support any new devices.
@ -154,127 +156,11 @@ required to support any new devices.
<p>
Before you build kernel, it is a good idea to do a backup of the system.
If you had not backed up your system recently then do it now.
<!--
**** shivalik not recommended - do backup of root partition
Or at least backup essential files using
<url name="shivalik" url="http://algolog.tripod.com/postlnx.htm">
script.
Follow the
<url name="shivalik" url="http://algolog.tripod.com/postlnx.htm">
script
which is a convenient way to make backups of essential files and
information about your Linux installation.
The
<url name="shivalik" url="http://algolog.tripod.com/postlnx.htm">
script is not a tool for complete backup and recovery. Ideally,
the best thing to do would be to make a verbatim copy of your entire Linux installation
along with all files and directories. This is not always possible, necessary, or
advisable. The next best thing would be to take a backup of the most essential
information and files. The
<url name="shivalik" url="http://algolog.tripod.com/postlnx.htm">
script achieves this for you. The script creates a
directory called <bf>/root/postinfo</bf>.
-->
See
<url name="Backup-Recovery-HOWTO" url="http://www.linuxdoc.org/HOWTO/Backup-Recovery-HOWTO.html">.
Or if you feel that you can take risk of losing data, then skip this section and
go to next section.
If you have a tape-drive or a network storage device and you can use fine backup
and restore tools like Arkeia or Bru, go to <url url="http://www.aldev.8m.com">
and search for 'Backup' with CTRL+f keys.
If you have a read-write CDROM on your linux system then you can create the
backups of all filesystems in your linux box.
For CDROM writing refer to
<url name="CD-Writing-HOWTO" url="http://www.linuxdoc.org/HOWTO/CD-Writing-HOWTO.html">
and see the cdrecord.sh script in <ref id="Appendix A">.
To dump all the filesystems to CDROM blanks, do:
<code>
bash$ su - root
bash# mkdir /backups
bash# cd /backups
bash# df
This will list something like:
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/hda9 2529920 242812 2158592 11% /
/dev/hda1 23302 18859 3240 86% /boot
/dev/hda5 3028080 509216 2365044 18% /home
/dev/hda7 7611636 3734668 3490208 52% /usr
/dev/hda8 3834464 447864 3191816 13% /var
/dev/hda11 1375616 461400 844336 36% /misc
bash# mkdir root-partition
bash# mkdir boot-partition
bash# mkdir home-partition
bash# mkdir usr-partition
bash# mkdir var-partition
bash# mkdir misc-partition
bash# mount /dev/hda9 /backups/root-partition (in my case root is /dev/hda9, change this)
bash# mount /dev/hda1 /backups/boot-partition (in my case boot is /dev/hda1, change this)
bash# mount /dev/hda5 /backups/home-partition (in my case home is /dev/hda5, change this)
bash# mount /dev/hda7 /backups/usr-partition (in my case usr is /dev/hda7, change this)
bash# mount /dev/hda8 /backups/var-partition (in my case var is /dev/hda8, change this)
bash# mount /dev/hda11 /backups/misc-partition (in my case misc is /dev/hda11, change this)
and others paritions which you may have
bash# ./cdrecord.sh (load the drivers - see Appendix A and CD-Writing howto)
bash# cdrecord -scanbus
bash# cd /backups
bash# du -sk *
If the size is less than 650MB, it will fit on the CDROM blank.
bash# nice --20 mkisofs -R /backups | cdrecord -v fs=40m speed=2 dev=0,0 -
</code>
If the size is greater than 650MB, you need to dump
separately group of filesystems. Note that you can group multiple paritions, so that
each group is &lt 650 MB and mkisofs command accepts multiple pathnames. As in the example
below, I grouped root and boot and put them on one CDROM.
Load a new CD blank and do :
<code>
bash# nice --20 mkisofs -R /backups/root-partition /backups/boot-partition | cdrecord -v fs=40m speed=2 dev=0,0 -
Load a new CD blank and do :
bash# nice --20 mkisofs -R /backups/home-partition | cdrecord -v fs=40m speed=2 dev=0,0 -
Load a new CD blank and do :
bash# nice --20 mkisofs -R /backups/usr-partition | cdrecord -v fs=40m speed=2 dev=0,0 -
Load a new CD blank and do :
bash# nice --20 mkisofs -R /backups/var-partition | cdrecord -v fs=40m speed=2 dev=0,0 -
</code>
<bf>Large Partitions: </bf>
What will you do if the partition is very large? Let's say the partition size is more than 650 MB?
If you have a DVD drive then you can write upto 5GB. But not all computers come with
DVD read-write drives. If you just have a R-W CD drive,
the maximum that you can store is upto 650MB, hence use the following technique:
Let's assume the usr partition is greater than 650 MB.
<code>
bash# du -sk /backups/usr-partition
</code>
If the total size is greater than 650 MB, then run the shell script (path-list.sh)
given in <ref id="Appendix B">.
The path-list.sh script will create list files like
CDROM-BACKUP1.txt,
CDROM-BACKUP2.txt,
CDROM-BACKUP3.txt and so on.
And each group will total upto 650MB thus filling up a CDROM blank.
<code>
Load a new CD blank and do :
bash# nice --20 mkisofs -R -path-list CDROM-BACKUP1.txt | cdrecord -v fs=40m speed=2 dev=0,0 -
Load a new CD blank and do :
bash# nice --20 mkisofs -R -path-list CDROM-BACKUP2.txt | cdrecord -v fs=40m speed=2 dev=0,0 -
Load a new CD blank and do :
bash# nice --20 mkisofs -R -path-list CDROM-BACKUP3.txt | cdrecord -v fs=40m speed=2 dev=0,0 -
and so on for all the grouplist files which you create.
</code>
<!--
*******************************************
************ End of Section ***************
@ -381,7 +267,7 @@ bash# make clean
<item> Read the following file (to gain some knowledge about kernel building. Tip: Use
the color editor
<url name="gvim" url="http://metalab.unc.edu/LDP/HOWTO/Vim-HOWTO.html">
<url name="gvim" url="http://www.linuxdoc.org/HOWTO/Vim-HOWTO.html">
for better readability.
<code>
bash# gvim -R /usr/src/linux/arch/i386/config.in
@ -2179,166 +2065,5 @@ You can read the latex, LyX output using LyX a X-Windows front end to latex.
<chapt change> Appendix A
-->
<sect> Appendix A - cdrecord.sh <label id="Appendix A">
<p>
This is shell script to do backup on CDROM and is used in the chapter
<ref name="Quick Steps" id="precautions"> of this document.
This script is taken from
<url name="CD-Writing-HOWTO" url="http://www.linuxdoc.org/HOWTO/CD-Writing-HOWTO.html">
<code>
#!/bin/sh
# Filename: cdrecord.sh
test `whoami` = 'root' || echo "You must be root to execute the commands."
cdrecord -scanbus > /dev/null
if ! (pidof kerneld || test -f "/proc/sys/kernel/modprobe"); then
echo "Neither kerneld nor kmod are running to automatically load modules".
fi
report_no_autoload() {
echo "Ensure the module $1 is loaded automatically next time."
}
if test ! -f "/proc/scsi/scsi"; then
report_no_autoload scsi_mod && insmod scsi_mod
fi
if ! grep "^........ sg_" /proc/ksyms > /dev/null; then
report_no_autoload sg && insmod sg
fi
if ! grep "^........ sr_" /proc/ksyms > /dev/null; then
report_no_autoload sr_mod && insmod sr_mod
fi
if ! grep "^........ loop_" /proc/ksyms > /dev/null; then
report_no_autoload loop && insmod loop
fi
if ! grep iso9660 /proc/filesystems > /dev/null; then
report_no_autoload iso9660 && insmod iso9660
fi
echo "The following is only needed for IDE/ATAPI CD-writers."
if ! grep ide-scsi /proc/ide/drivers > /dev/null; then
report_no_autoload ide-scsi && insmod ide-scsi
fi
cdrecord -scanbus
</code>
<!--
*******************************************
************ End of Section ***************
*******************************************
<chapt change> Appendix B
-->
<sect> Appendix B - path-list.sh <label id="Appendix B">
<p>
This is shell script to do backup on CDROM and is used in the chapter
<ref name="Quick Steps" id="precautions"> of this document.
<code>
#!/bin/sh
# Author: Al Dev EMail: alavoor@yahoo.com
# Copyright Al Dev, License : GNU/GPL
# Filename: path-list.sh
# Program to back a large partition > 650 MB over
# several cdrom blanks by splitting into chunks.
# This program will create a list of filenames which can be input
# to mkisofs command's -path-list option. See 'man mkisofs'.
DIRNAME=""
while :
do
if [ "$DIRNAME" != "" ]; then
if [ ! -d $DIRNAME ]; then
echo "******"
echo "****** Wrong entry: Directory does not exist. Try again"
echo "******"
else
break;
fi
fi
echo " "
echo "Please enter the directory name which you want to"
echo "backup to multiple cdrom blanks."
echo "Also make sure you have write/read permissions in that directory."
echo "Enter with leading slash, for example, "
echo -n "something like /backups/usr-partition : "
read DIRNAME
done
OUTFILE="path-list.txt"
# Serious problems is - mkisofs complains and gives errors on
# directories and links (because of duplicate listing).
# Hence, soft/hard links need to be removed when doing mkisofs command
# Work around for soft links: Tar all the soft links to
# a file called Softlinks.tgz and then backup this file
tar zcvf $DIRNAME/Softlinks.tgz ` find $DIRNAME -type l `
if [ ! -f $DIRNAME/Softlinks.tgz ]; then
echo " "
echo "****************************************************************"
echo "FATAL ERROR: Enable to create the file $DIRNAME/Softlinks.tgz"
echo "May be you do not have read/write permissions in $DIRNAME"
echo "****************************************************************"
echo " "
exit
fi
# Avoid directories and links
find $DIRNAME -type f -printf "%s %p\n" > $OUTFILE
find $DIRNAME -type b -printf "%s %p\n" >> $OUTFILE
find $DIRNAME -type c -printf "%s %p\n" >> $OUTFILE
find $DIRNAME -type p -printf "%s %p\n" >> $OUTFILE
find $DIRNAME -type s -printf "%s %p\n" >> $OUTFILE
TOTALSIZE=0
FILECOUNTER=1
rm -f CDROM-BACKUP*.txt
rm -f "CDROM-BACKUP"$FILECOUNTER".txt"
cat "$OUTFILE" |
while read LINE
do
SIZE=`echo $LINE | cut -d' ' -f1 `
#echo SIZE $SIZE
FILENAME=`echo $LINE | cut -d' ' -f2 `
TOTALSIZE=$(( $SIZE + $TOTALSIZE ))
#echo TOTALSIZE $TOTALSIZE
# If greater than 650 MB then switch to new group file
# Do upto 649 MB = 649 * 1024 * 1024 = 680525824
if [ $TOTALSIZE -gt 680525824 ]; then
FILECOUNTER=$(( $FILECOUNTER + 1 ))
TOTALSIZE=0
rm -f "CDROM-BACKUP"$FILECOUNTER".txt"
fi
echo $FILENAME >> "CDROM-BACKUP"$FILECOUNTER".txt"
#echo $FILENAME
done
rm "$OUTFILE"
echo " "
echo "********************************* "
echo " Load a new CDROM blank and do :
nice --20 mkisofs -R -path-list CDROM-BACKUP1.txt | cdrecord -v fs=40m speed=2 dev=0,0 -
Load next CDROM blank
nice --20 mkisofs -R -path-list CDROM-BACKUP2.txt | cdrecord -v fs=40m speed=2 dev=0,0 -
Load next CDROM blank
nice --20 mkisofs -R -path-list CDROM-BACKUP3.txt | cdrecord -v fs=40m speed=2 dev=0,0 - "
echo "********************************* "
</code>
<!--
*******************************************
************ End of Section ***************
*******************************************
-->
</article>

View File

@ -45,7 +45,7 @@ PHP HOW-TO
" name="
alavoor[AT]yahoo.com
">
<date>v25.9, 12 Jan 2002
<date>v26.0, 31 Jan 2002
<abstract>
This document tells you howto develop PHP programs and also to migrate all the
Windows 95 GUI applications to powerful PHP + HTML + DHTML + XML + Java applets + Javascript.
@ -73,6 +73,11 @@ and mainframe operating systems and on all operating systems where "C" compiler
-->
<sect>Introduction
<p>
<bf>
(The latest version of this document is at <url url="http://www.aldev.8m.com">. You may
want to check there for changes).
</bf>
<it><bf>Definition:</bf> PHP is a simple, object-oriented,
interpreted, robust, secure, very high-performance, architecture neutral, portable,
dynamic scripting language. PHP has "class" keyword similar to Java's "class" keyword.
@ -1832,17 +1837,55 @@ and <url name="CGI-Resources" url="http://cgi-resources.com">
</itemize>
In this tutorial we assume that your server has support for PHP activated
and that all files ending in .php3 are handled by PHP.
and that all files ending in .php are handled by PHP.
If you are using Apache then you should edit httpd.conf and make appropriate
changes to enable PHP.
Your first PHP-enabled page:
Create a file named hello.php3 and in it put the following lines:
Create a file named hello.php and in it put the following lines:
<code>
<html><head><title>PHP Test< /title>< /head>
<body>
<?php echo "Hello World<P>"; ?>
< /body>< /html>
<html>
<head>
&lt
title>
PHP Test&lt
/title>
&lt
/head>
<body>
<h1>
This is an example of php script.
<br>
Below, you will see one line saying 'Hello World' and 'foo is foobar':
&lt
/h1>
<?php
echo "Hello World";
$foo = "foobar";
echo "<br>foo is $foo";
?>
&lt
/body>
&lt
/html>
</code>
Copy this file hello.php to the directory known to Apache, like
<bf>/var/www/html</bf> which is also known as DocumentRoot in httpd.conf file.
Now, to run this example, bring up a web browser and type the URL
<it>http://localhost/hello.php</it> or you can type <it>http://127.0.0.1/hello.php</it>.
But make sure you bring up Apache web server on your system.
When you run the example you will get an output like:
<code>
This is an example of php script.
Below, you will see one line saying 'Hello World' and 'foo is foobar':
Hello World
foo is foobar
</code>
If you get some errors or if you see the file with tags then your Apache Web server may
not be working properly or PHP is not enabled.
Note that this is not like a CGI script.
Think of it as a normal HTML file which happens to have a set of
special tags available to you.
@ -1900,13 +1943,21 @@ mode even in the middle of a PHP block:
if(strstr($HTTP_USER_AGENT,"MSIE"))
{
?>
< center>< b>You are using Internet Explorer< /b>< /center>
&lt
center>&lt
b>You are using Internet Explorer&lt
/b>&lt
/center>
<?
}
else
{
?>
< center>< b>You are not using Internet Explorer< /b>< /center>
&lt
center>&lt
b>You are not using Internet Explorer&lt
/b>&lt
/center>
<?
}
?>
@ -1932,7 +1983,8 @@ it:
Your name: <input type=text name=name>
You age: <input type=text name=age>
<input type=submit>
< /form>
&lt
/form>
</code>
There is nothing special about this form. It is a straight HTML form with no
special tags of any kind. When the user fills in this form and hits the