This commit is contained in:
gferg 2003-01-27 15:53:10 +00:00
parent d4b5c80043
commit 019b29950e
5 changed files with 721 additions and 616 deletions

File diff suppressed because it is too large Load Diff

View File

@ -42,7 +42,7 @@ C-C++ Beautifier HOW-TO
<author>Al Dev (Alavoor Vasudevan)
<htmlurl url="mailto:alavoor[AT]yahoo.com"
name="alavoor[AT]yahoo.com">
<date>v16.0, 27 April 2002
<date>v16.2, 23 Jan 2003
<abstract>
This document will help you to format (beautify) the C/C++ programs so
that it is more readable and confirms to your site C/C++ coding standards.
@ -59,16 +59,7 @@ operating systems on this planet!).
<!-- Begin the document -->
<!--
*******************************************
************ End of Section ***************
*******************************************
<chapt>Introduction
-->
<sect>Introduction
<p>
<bf>
@ -127,16 +118,40 @@ BCPP was written by Steven De Toni at
" name="
steve@alpha.ocbbs.gen.nz
">
<!--
*******************************************
************ End of Section ***************
*******************************************
<sect> Installing BCPP
<p>
To install <url name="BCPP" url="http://dickey.his.com/bcpp/bcpp.html">
<code>
Unpacking bcpp:
tar zxvf bcpp.tar.gz
Building bcpp:
cd code
make
cp bcpp ~/local/bin/
cp bcpp.cfg ~/local/bin
Usage:
bcpp -h or bcpp -?
Recommended: Always use spaces instead of tabs in indenting during beautifying.
Use the option -s so that the code looks the same in all types of editors like vi,
emacs, MS DOS edit, Notepad, Wordpad etc..
bcpp -s *.cpp
In Solaris, you can also use:
ls *.cpp | xargs -I{} -t bcpp -s {}
in Linux, you can also use:
ls *.cpp | xargs -i{} -t bcpp -s {}
</code>
<chapt> How can I trust Beautifier programs??!!
-->
<sect> How can I trust Beautifier programs??!!
<p>
For 100% assurance you need a <bf>SCIENTIFIC</bf> way to
@ -148,13 +163,18 @@ In order to verify that beautifier programs like
<bf>bcpp</bf>, <bf>indent</bf> or <bf>cb</bf> is not damaging or
changing the input source-code after formatting, you can use one of
the following technique -
<!--
*******************************************
************ End of Section ***************
*******************************************
-->
<sect1> Method 1: Verfication Program for C++/C <label id="verifycpp">
<sect1> Method 1: Verfication Program for C++/C <label id="verifycpp1">
<p>
<code>
bash$ man diff
bash$ diff -b --ignore-all-space originalfile formattedfile
</code>
<sect1> Method 2: Verfication Program for C++/C <label id="verifycpp">
<p>
Generate the object code from the original input
source code using the compiler -
@ -212,16 +232,15 @@ This method gives you 100% quality assurance and life term or long term
It is strongly recommended that you do these two steps
every time you run beautifier programs like <bf>bcpp</bf>,
<bf>indent</bf> or <bf>cb</bf>.
<!--
*******************************************
************ End of Section ***************
*******************************************
-->
<sect1> Method 2: Verfication Program for Java/C++/Others <label id="verify">
<sect1> Method 3: Verfication Program for Java/C++/Others <label id="verify">
<p>
Since you cannot compile the Java source code to machine code and you can compile
Java source to byte-codes you cannot use the technique given in Method 1 above.
Java source to byte-codes you cannot use the technique given in Method 2 above.
When you do diff on Java class files it will always be different.
In this method, a different technique will be given which can be used to
@ -278,13 +297,12 @@ You should take care of trailing back-slash escaping the new-line and should not
strip trailing whitespace (the new line '\n') for this particular line. You should
have a 'if there is a trailing back-slash' condition in your program to check this case.
-->
<!--
*******************************************
************ End of Section ***************
*******************************************
-->
<sect1> Method 3: Shell script: Verfication Program for C++/C <label id="verifycpp">
<sect1> Method 4: Shell script: Verfication Program for C++/C <label id="verifycpp">
<p>
This is a Korn shell script to verify beautifier program. Requires "pdksh*.rpm" from
Linux 'contrib' cdrom. Save this file as 'text' file and chmod a+rx on it. You can
@ -377,16 +395,11 @@ else
fi
</code>
<!--
*******************************************
************ End of Section ***************
*******************************************
<chapt> Tools for other Languages
-->
<sect> Beautifiers for other Languages
<p>
Visit the following sites to get beautifiers for other languages like
@ -459,16 +472,11 @@ and its KDE frontend Ksrc2html
Also search the search engines like <url url="http://www.yahoo.com">
or <url url="http://www.lycos.com"> and search for keyword "beautfier".
<!--
*******************************************
************ End of Section ***************
*******************************************
<chapt change> Related URLs
-->
<sect> Related URLs
<p>
Visit following locators which are related to C, C++ -
@ -494,16 +502,11 @@ and mirrors at
<url name="Httpcity" url="http://www.httpcity.com/aldev/index.html">,
<url name="Freeservers" url="http://aldev.freeservers.com">.
</itemize>
<!--
*******************************************
************ End of Section ***************
*******************************************
<chapt change> Other Formats of this Document
-->
<sect> Other Formats of this Document
<p>
This document is published in 14 different formats namely - DVI, Postscript,
@ -560,12 +563,10 @@ Compiling the source you will get the following commands like
<item>sgml2rtf xxxxhowto.sgml (to generate RTF file)
<item>sgml2latex xxxxhowto.sgml (to generate latex file)
</itemize>
<!--
*******************************************
************ End of Section ***************
*******************************************
-->
<sect1> Acrobat PDF format <label id="acrobatpdf">
<p>
PDF file can be generated from postscript file using
@ -594,12 +595,10 @@ converts PostScript files to Portable Document Format (PDF) files.
called <bf>pdfwrite</bf>. In order to use ps2pdf, the pdfwrite
device must be included in the makefile when Ghostscript was compiled;
see the documentation on building Ghostscript for details.
<!--
*******************************************
************ End of Section ***************
*******************************************
-->
<sect1> Convert Linuxdoc to Docbook format <label id="linuxdoc2docbook">
<p>
This document is written in linuxdoc SGML format. The Docbook SGML format
@ -625,12 +624,10 @@ And you may have to manually edit some of the minor errors after
running the perl script. For e.g. you may need to put closing tag <
/Para> for each <
Listitem>
<!--
*******************************************
************ End of Section ***************
*******************************************
-->
<sect1> Convert to MS WinHelp format <label id="mswinhelp">
<p>
You can convert the SGML howto document to Microsoft Windows Help file,
@ -641,12 +638,10 @@ first convert the sgml to html using:
</code>
Then use the tool <url name="HtmlToHlp" url="http://javadocs.planetmirror.com/htmltohlpe.html">.
You can also use sgml2rtf and then use the RTF files for generating winhelp files.
<!--
*******************************************
************ End of Section ***************
*******************************************
-->
<sect1> Reading various formats <label id="readformats">
<p>
In order to view the document in dvi format, use the xdvi program. The xdvi
@ -687,16 +682,9 @@ You can read HTML format document using Netscape Navigator, Microsoft Internet
explorer, Redhat Baron Web browser or any of the 10 other web browsers.
You can read the latex, LyX output using LyX a X-Windows front end to latex.
<!--
*******************************************
************ End of Section ***************
*******************************************
<chapt> Copyright
-->
<sect> Copyright
<p>
Copyright policy is GNU/GPL as per LDP (Linux Documentation project).
@ -705,14 +693,9 @@ Additional restrictions are - you must retain the author's name, email address
and this copyright notice on all the copies. If you make any changes
or additions to this document then you should
intimate all the authors of this document.
<!--
*******************************************
************ End of Section ***************
*******************************************
-->
</article>

View File

@ -45,7 +45,7 @@ Al Dev (Alavoor Vasudevan)
" name="
alavoor[AT]yahoo.com
">
<date>v4.1, 11 Jan 2003
<date>v4.2, 26 Jan 2003
<abstract>
This is a detailed guide to kernel configuration, compilation, upgrades,
@ -66,8 +66,15 @@ You compile Linux kernel for one of following reasons:
<p>
<item> For <bf>Defence Industries</bf> or <bf>Military applications</bf>, you must
read the kernel source code and compile with your own hands. No exceptions!!
(U.S Dept of Defence compiles the Linux kernel before distributing computers).
<p>
<item> For your education and knowledge of Linux kernel and ofcourse just for fun!
<item> Every country and every Govt. compiles the kernel on site for security.
Every Govt. audits each and every line of kernel before using the computer.
<p>
<item> Each and every University in the world compiles the kernel before using
any computer!
<p>
<item> For your education and knowledge of Linux kernel and ofcourse, just for fun!
<p>
<item> For very advanced scientific applications - you may need to do kernel compile
<p>
@ -76,7 +83,7 @@ read the kernel source code and compile with your own hands. No exceptions!!
If your time is precious then go straight to chapter 2 "Quick Steps".
And, if you are successful in compiling the Linux kernel then you
can skip rest of the chapters.
can skip the remaining chapters.
<p>
@ -119,7 +126,7 @@ building the Linux kernel.
<item> Unpack the sources
<item> Optional - You can copy the .config file from your old linux kernel source tree
to new kernel tree (may save time, if you want to reuse the old settings).
<item> make clean
<item> make clean; make mrproper
<item> make xconfig
<item> make dep
<item> make
@ -170,18 +177,25 @@ dev86*.rpm on cdrom or from
).
<p>
<item> Optional - You can copy the .config file from your old linux kernel source tree
<item>
<bf>Optional : </bf>
You can copy the .config file from your old linux kernel source tree
to new kernel tree (may save time, if you want to reuse the old settings).
<code>
bash# cd /usr/src/linux
bash# cp ../linux-old-tree/.config .
</code>
or alternatively, you can use "make oldconfig"
which default all questions based on the contents of your existing ./.config file.
<p>
<item>
<bf>Clean : </bf>
Before doing mrproper below, you may want to backup the .config file.
<code>
bash# cd /usr/src/linux
bash# make clean
bash# make clean
bash# make mrproper # Must do this if want to start clean slate
</code>
<p>
@ -221,12 +235,14 @@ If the menuconfig command fails then try -
And <bf>"make config"</bf> brings up command-line console mode interface.
You can load the
configuration file from <it>/usr/src/linux/.config</it> (dot config file. Note the dot
before config).
before config). Click on button "Load Configuration from File".
<p>
Within 'make xconfig' you must do these to avoid problems -
Within 'make xconfig' you must do these (to avoid problems) -
<itemize>
<item> Select proper CPU type - Pentium 3, AMD K6, Cyrix, Pentium 4, Intel 386, DEC Alpha, PowerPC otherwise kernel will not boot!!
<item> <bf>VERY IMPORTANT !!! : </bf> Select proper CPU type - Pentium 3, AMD K6,
Cyrix, Pentium 4, Intel 386, DEC Alpha, PowerPC otherwise kernel compile will fail
and even if it compiles will not boot!!
<item> Select SMP support - whether single CPU or multiple CPUs
<item> Filesystems - Select Windows95 Vfat, MSDOS, NTFS as part of kernel and
not as loadable modules. (My personal preference but you are free to pick your own option).
@ -251,14 +267,28 @@ at <it>/usr/src/linux/.config</it> (dot config file).
<p>
<item>
<bf>Dep and Clean: </bf>
<bf>Dep : </bf>
And now, do -
<code>
bash# make dep
bash# make clean
</code>
<p>
<p>
<item>
<bf>Give Name to Kernel: </bf>
You can give a name to your kernel, so that it is unique and does not
interfere with others.
<code>
bash# cd /usr/src/linux
bash# vi Makefile
</code>
Here look for EXTRAVERSION = -19.8.0blahblah
and change to EXTRAVERSION = -19.8.0MyKer.26Jan03
<p>
<item>
<bf>Do make: </bf>
Read the following file (to gain some knowledge about kernel building. Tip: Use
@ -292,6 +322,13 @@ new kernel <bf>MAY NOT</bf> boot.
<code>
bash# cp /usr/src/linux/arch/i386/boot/bzImage /boot/bzImage.myker.26mar2001
</code>
<bf>NOTE : </bf> For latest kernels (kernel versions 2.4.0 or greater) you may
want to give these commands, so that /boot/initrd*.img is created as well
entries in grub are made automatically:
<code>
bash# make install
</code>
<p>
<item>
@ -341,15 +378,22 @@ See
<item> <url name="Multiboot-with-GRUB minihowto" url="http://www.tldp.org/HOWTO/mini/Multiboot-with-GRUB.html">
<item> <url name="Grub Manual" url="http://www.mcc.ac.uk/grub/grub_toc.html">
</itemize>
<code>
bash# man grub
bash# man grubby # (command line tool for configuring grub, lilo, and elilo)
bash# man grub-install
</code>
Edit the file /etc/grub.conf to make entries for the new kernel.
<p>
<p>
<item> Reboot the machine and at lilo press tab key and
type 'myker' If it boots then you did a good job! Otherwise at lilo
select your old kernel, boot and re-try all over again. Your old kernel
<bf>is still INTACT and SAFE</bf> at say <it>/boot/vmlinuz-2.0.34-0.6</it>
<p>
<p>
<item> If your new kernel 'myker' boots and works properly, you can create the
boot disk. Insert a blank floppy into floppy drive and -
<code>
@ -362,6 +406,7 @@ bash# man mkbootdisk
</code>
<p>
<p>
<item>
<bf>LOADABLE MODULES: </bf>
This step is required <bf>ONLY if</bf> you had enabled Loadable module support in
@ -388,14 +433,26 @@ bash# lsmod
You can set PATH the insmod searches in /etc/modules.conf
<p>
<p>
<item>
<bf>Clean: </bf>
Optional - make clean (If you want to free up disk space)
<p>
<p>
<item>
<bf>Optional - Initrd.img : </bf>
<p>
To create /boot/initrd.img see the documentation at
/usr/src/linux/Documentation/initrd.txt
and
<url name="Loopback-Root-mini-HOWTO" url="http://www.tldp.org/HOWTO/mini/Loopback-Root-FS-3.html#ss3.3">.
You do not need to create as you use the existing /boot/initrd.img.
</enum>
<sect1> Troublshoot Common Mistakes
<sect1> Troubleshoot Common Mistakes
<p>
@ -434,6 +491,23 @@ bash# man init
</code>
<sect2> Lots of Compile Errors
<p>
The 'make', 'make bzImage', 'make modules' or 'make modules_install'
gives compile problems.
You should give 'make mrproper' before doing make.
<code>
bash# make mrproper
</code>
If this problem persists, then try menuconfig instead of xconfig.
Sometimes GUI version xconfig causes some problems:
<code>
bash# export TERM=VT100
bash# make menuconfig
</code>
<sect2> The 'depmod' gives "Unresolved symbol error messages"
<p>
@ -602,6 +676,8 @@ Refer to HOWTO docs relating to your devices at <url url="http://www.linuxdoc.or
<sect1> Sample lilo.conf <label id="liloconf">
<p>
Read this section only if you are using LILO and if you are using GRUB skip
this section.
Given below is a sample /etc/lilo.conf file. You should follow the
naming conventions like ker2217 (for kernel 2.2.17), ker2214 (for kernel 2.2.14).
You can have many kernel images on the same /boot system.

View File

@ -43,7 +43,7 @@ LILO, Linux Crash Rescue HOW-TO
<author>Al Dev (Alavoor Vasudevan)
<htmlurl url="mailto:alavoor[AT]yahoo.com"
name="alavoor[AT]yahoo.com">
<date>v10.7, 02 Nov 2002
<date>v10.8, 25 Jan 2003
<abstract>
This document discusses methods to recover from Linux system failures.
Various reasons for linux system failures can be -
@ -130,7 +130,8 @@ fit in 12MB of media. <url url="http://repairlix.sourceforge.net">
<sect1> Preparation Tips <label id="tips">
<p>
It is a good idea to backup the important system files like /etc/fstab, /etc/lilo.conf
after you login using Tomsrtbt floppy in next section. This can be very handy during
after you login using Tomsrtbt floppy or RedHat Linux CDROM (Rescue option)
in following sections. This can be very handy during
crash situation or something happens to system files.
<code>
bash# cp /etc/fstab /etc/fstab.orig
@ -144,6 +145,22 @@ bash# cp /etc/networks /etc/networks.orig
</code>
<sect1> Using Linux CDROM In Rescue Mode
<p>
Most of the distributions like RedHat, SUSE, Debian provide CDROM which have "Rescue"
option. For this, you have should set the BIOS of your computer to boot first from
IDE CDROM drive. Usually you set the BIOS (using F8 key during boot) to boot
first from CDROM drive, second from Floppy drive and third from hard disk.
Load the Linux cdrom into the CD drive and reboot the system.
The Linux distribution will load and at the prompt select "Rescue Operation".
In the resuce operation mount the hard disks and try to repair.
<code>
# chroot /mnt/SYSIMAGE
# df
</code>
After doing chroot, the system will look as if you had booted the system
from hard disk.
You can see all the partitions and you can repair or recover the files.
<sect1> Quick Steps to recovery
<p>

View File

@ -46,7 +46,7 @@ Vi Improved with syntax color highlighting
"name="
alavoor[AT]yahoo.com
">
<date>v18.5, 02 Nov 2002
<date>v18.7, 25 Jan 2003
<abstract>
This document is a guide to quickly setting up the Vim color editor on Linux or Unix systems. The information here will improve the productivity of programmers because the
Vim editor supports syntax color highlighting and bold fonts, improving the
@ -578,6 +578,17 @@ text color to "marune".
For Windows95 see <url name="Color for MS-DOS prompt window" url="http://www.elementkjournals.com/w95/9711/w9597b3.htm">.
<sect> MS Windows Notepad and Wordpad Imitator in Vim
<p>
For those non-technical users of MS Windows who extensively use the Notepad and
Wordpad, there is a command 'evim' which imitates the Notepad and Wordpad.
The 'evim' is exactly like Notepad and Wordpad and has all their functionalities.
You need to install the package vim-X11 package to enable evim.
<code>
bash$ evim <filename>
</code>
<sect> Setup gvim init files
<p>
To enable the syntax color highlighting you MUST copy the gvimrc file to
@ -1360,6 +1371,14 @@ The following Vi resources are available on internet:
<item> Resources, Tips, News about Vim <url url="http://vim.sourceforge.net">
<p>
<item> Vi Cheatsheet <url url="http://www.geekcheat.com/Merchant2/merchant.mv">
<p>
<item> Vim and vi article <url url="http://www.troubleshooters.com/lpm/200212/200212.htm">
<p>
<item> Vim Outliner -
An outline processor is a software program
enabling the user to quickly construct outlines, and better yet, to correct and rearrange
the outline.
<url url="http://www.troubleshooters.com/vimoutliner">
</itemize>