old-www/FAQ/Linux-FAQ/tips.html

1414 lines
22 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML
><HEAD
><TITLE
>Tips And Tricks</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="The Linux FAQ"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="Solutions to Common Problems"
HREF="common-problems.html"><LINK
REL="NEXT"
TITLE="The X Window System"
HREF="x-windows.html"></HEAD
><BODY
CLASS="sect1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>The Linux FAQ</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="common-problems.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="x-windows.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="sect1"
><H1
CLASS="sect1"
><A
NAME="tips"
></A
>15. Tips And Tricks</H1
><DIV
CLASS="qandaset"
><DL
><DT
>Q: <A
HREF="tips.html#man-pages-without-man"
>How Do I Format Man Pages without <B
CLASS="command"
>man</B
> or <B
CLASS="command"
>groff</B
>?</A
></DT
><DT
>Q: <A
HREF="tips.html#scrollback-in-text-mode"
>How To Scroll Backwards in Text Mode</A
></DT
><DT
>Q: <A
HREF="tips.html#e-mail-to-work"
>How To Get Email to Work</A
></DT
><DT
>Q: <A
HREF="tips.html#sendmail-pause"
><SPAN
CLASS="application"
>Sendmail</SPAN
> Pauses for Up to a Minute at Each Command</A
></DT
><DT
>Q: <A
HREF="tips.html#switch-virtual-consoles"
>How To Enable and Select Virtual Consoles</A
></DT
><DT
>Q: <A
HREF="tips.html#set-the-time-zone"
>How To Set the Time Zone</A
></DT
><DT
>Q: <A
HREF="tips.html#core-file"
>What Is a <TT
CLASS="filename"
>core</TT
> File?</A
></DT
><DT
>Q: <A
HREF="tips.html#enable-core-dumps"
>How To Enable or Disable Core Dumps</A
></DT
><DT
>Q: <A
HREF="tips.html#remap-keyboard"
>How To Remap a Keyboard to UK, French, Etc.</A
></DT
><DT
>Q: <A
HREF="tips.html#num-lock-default-on"
>How To Get NUM LOCK to Default to On</A
></DT
><DT
>Q: <A
HREF="tips.html#set-terminal-colors"
>How To Set (Or Reset) Initial Terminal Colors</A
></DT
><DT
>Q: <A
HREF="tips.html#more-than-128mb-of-swap"
>How To Have More Than 128Mb of Swap</A
></DT
></DL
><DIV
CLASS="qandaentry"
><DIV
CLASS="question"
><P
><A
NAME="man-pages-without-man"
></A
><B
>Q: </B
>How Do I Format Man Pages without <B
CLASS="command"
>man</B
> or <B
CLASS="command"
>groff</B
>?</P
></DIV
><DIV
CLASS="answer"
><P
><B
>A: </B
>The <B
CLASS="command"
>man2html</B
> program translates <B
CLASS="command"
>groff</B
>
text to HTML, which you can view with a Web browser. The
<B
CLASS="command"
>man2html</B
> program, and many like it, are availble on the
Web. Look for them with your favorite search engine.
</P
><P
>The unformatted manual pages are stored in subdirectories of
<TT
CLASS="filename"
>/usr/man</TT
>, <TT
CLASS="filename"
>/usr/local/man</TT
>, and
elsewhere.
</P
><P
>If you want to view text, use <B
CLASS="command"
>nroff</B
> and <B
CLASS="command"
>less</B
>.
Both of these programs have MSDOS versions with an implementation of the <EM
>man</EM
>
macro package available as well. An example would be:
</P
><P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
> $ nroff -man /usr/man/man1/ls.1 | less </PRE
></FONT
></TD
></TR
></TABLE
>
</P
><P
>If you know where to find a good implementation of the <EM
>man</EM
> macros
without installing <EM
>groff</EM
>, please let the FAQ maintainer
know.
</P
><P
>If the manual page filename ends in <TT
CLASS="literal"
>.gz</TT
>, then you'll need to
uncompress it before formatting it, using <B
CLASS="command"
>gzip -d</B
> or <B
CLASS="command"
>gunzip</B
>.
A one-line example would be:
</P
><P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
> $ gzip -dc /usr/man/man1/ls.1.gz | nroff -man | less </PRE
></FONT
></TD
></TR
></TABLE
>
</P
></DIV
></DIV
><DIV
CLASS="qandaentry"
><DIV
CLASS="question"
><P
><A
NAME="scrollback-in-text-mode"
></A
><B
>Q: </B
>How To Scroll Backwards in Text Mode</P
></DIV
><DIV
CLASS="answer"
><P
><B
>A: </B
>With the default US keymap, you can
use <B
CLASS="keycap"
>Shift</B
> with the <B
CLASS="keycap"
>PgUp</B
> and
<B
CLASS="keycap"
>PgDn</B
> keys. (The gray ones, not the ones on the numeric
keypad.) With other keymaps, look in <TT
CLASS="filename"
>/usr/lib/keytables</TT
>.
You can remap the <B
CLASS="keycap"
>ScrollUp</B
> and <B
CLASS="keycap"
>ScrollDown</B
> keys to be whatever you like.
</P
><P
>The <B
CLASS="command"
>screen</B
> program, <A
HREF="http://vector.co.jp/vpack/browse/person/an010455.html"
TARGET="_top"
><I
CLASS="citetitle"
>http://vector.co.jp/vpack/browse/person/an010455.html</I
></A
>
provides a searchable scrollback buffer and the ability to take
"snapshots" of text-mode screens.
</P
><P
>Recent kernels that have
the VGA Console driver can use dramatically more memory for scrollback,
provided that the video card can <EM
>actually handle</EM
> 64 kb
of video memory. Add the line:
</P
><P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
> #define VGA_CAN_DO_64B </PRE
></FONT
></TD
></TR
></TABLE
>
</P
><P
>to the start of the file <TT
CLASS="filename"
>drivers/video/vgacon.c</TT
>. This feature may become a
standard setting in future kernels. If the video frame buffer is also enabled
in the kernel, this setting may not affect buffering.
</P
><P
>In older kernels, the amount of scrollback is fixed, because it is implemented using
the video memory to store the scrollback text. You may be able to get more
scrollback in each virtual console by reducing the total number of VC's. See
<TT
CLASS="filename"
>linux/tty.h</TT
>.
</P
><P
>[Chris Karakas]
</P
></DIV
></DIV
><DIV
CLASS="qandaentry"
><DIV
CLASS="question"
><P
><A
NAME="e-mail-to-work"
></A
><B
>Q: </B
>How To Get Email to Work</P
></DIV
><DIV
CLASS="answer"
><P
><B
>A: </B
>For sending mail via SMTP (Simple Mail Transfer
Protocol) and receiving mail from an ISP's POP (Post Office Protocol) server,
you can use a desktop client like Netscape Communicator or KDE kmail. You
will need to enter the names of the SMTP and POP servers in the preferences
of the respective application, as well as your E-mail address
(e.g., username@example.com), and your dial-up password. The same applies to
Usenet News. Enter the name of the NNTP (Network News Transfer Protocol)
server in your News client's preferences section. You may also have to
provide the IP addresses of the ISP's primary and secondary name servers.
</P
><P
>If you have a traditional MTA (Mail Transport Agent) like
<SPAN
CLASS="application"
>Sendmail</SPAN
>, <SPAN
CLASS="application"
>Smail</SPAN
>,
<SPAN
CLASS="application"
>qmail</SPAN
>, or <SPAN
CLASS="application"
>Exim</SPAN
>, you'll
need to follow the instructions in each package. Basically, configuration
entails determining which host machine, either on your local LAN or via
dial-up Internet, is the "Smart Host", if you're using SMTP. If you're
using the older UUCP protocol, then you'll need to consult the directions for
configuring UUCP, and also make sure that your ISP's system is configured to
relay mail to you.
</P
><P
>Information about Internet hosting, and
News and E-mail in general, is available on the Usenet News group
<I
CLASS="citetitle"
>news.announce.newusers</I
>, and those FAQ's are also
archived at <A
HREF="ftp://rtfm.mit.edu/pub/usenet/"
TARGET="_top"
><I
CLASS="citetitle"
>ftp://rtfm.mit.edu/pub/usenet/</I
></A
>.
</P
></DIV
></DIV
><DIV
CLASS="qandaentry"
><DIV
CLASS="question"
><P
><A
NAME="sendmail-pause"
></A
><B
>Q: </B
><SPAN
CLASS="application"
>Sendmail</SPAN
> Pauses for Up to a Minute at Each Command</P
></DIV
><DIV
CLASS="answer"
><P
><B
>A: </B
>Make sure that <SPAN
CLASS="application"
>Sendmail</SPAN
>
can resolve your hostname to a valid (i.e., parsable) domain address. If you
are not connected to the Internet, or have a dial-up connection with dynamic
IP addressing, add the fully qualified domain name to the
<TT
CLASS="literal"
>/etc/hosts</TT
> file, <EM
>in addition</EM
> to the
base host name; e.g., if the host name is <TT
CLASS="literal"
>bilbo</TT
> and
the domain is <TT
CLASS="literal"
>bag-end.com</TT
>:
</P
><P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
> 192.168.0.1 bilbo.bag-end.com bilbo </PRE
></FONT
></TD
></TR
></TABLE
>
</P
><P
>And make sure that either the <TT
CLASS="literal"
>/etc/host.conf</TT
> or <TT
CLASS="literal"
>&#13;/etc/resolv.conf</TT
> file contains the line:
</P
><P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
> order hosts,bind </PRE
></FONT
></TD
></TR
></TABLE
>
</P
><P
><DIV
CLASS="caution"
><P
></P
><TABLE
CLASS="caution"
WIDTH="100%"
BORDER="0"
><TR
><TD
WIDTH="25"
ALIGN="CENTER"
VALIGN="TOP"
><IMG
SRC="../images/caution.gif"
HSPACE="5"
ALT="Caution"></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Do not change the <TT
CLASS="literal"
>localhost</TT
>entry in
<TT
CLASS="literal"
>/etc/hosts</TT
>, because many programs depend on it for
internal message-passing.</TD
></TR
></TABLE
></DIV
>
</P
><P
><SPAN
CLASS="application"
>Sendmail</SPAN
>
takes many factors into account when resolving domain addresses. These
factors, collectively, are known as, "rulesets", in
<SPAN
CLASS="application"
>sendmail</SPAN
> jargon. The program does
<EM
>not</EM
> require that a domain address be canonical, or even
appear to be canonical. In the example above, <TT
CLASS="literal"
>bilbo.</TT
>
(note the period) would work just as well as
<TT
CLASS="literal"
>bilbo.bag-end.com</TT
>. This and other modifications apply
mainly to recent versions.
</P
><P
>Prior to version 8.7,
<SPAN
CLASS="application"
>sendmail</SPAN
> required that the FQDN appear first in
the <TT
CLASS="filename"
>/etc/hosts</TT
> entry. This is due to changes in the
envelope address masquerade options. Consult the
<SPAN
CLASS="application"
>sendmail</SPAN
> documents.
</P
><P
>If you have a
domain name server for <EM
>only</EM
> a local subnet, make sure
that "." refers to a SOA record on the server machine, and that reverse
lookups (check by using <SPAN
CLASS="application"
>nslookup</SPAN
>) work for all
machines on the subnet.
</P
><P
>Finally, <TT
CLASS="literal"
>FEATURE</TT
>
configuration macro options like <TT
CLASS="literal"
>nodns</TT
>,
<TT
CLASS="literal"
>always_add_domain</TT
>, and <TT
CLASS="literal"
>nocanonify</TT
>,
control how <SPAN
CLASS="application"
>sendmail</SPAN
> interprets host names.
</P
><P
>The document, <I
CLASS="citetitle"
>Sendmail: Installation and Operation
Guide</I
>, included in the <TT
CLASS="literal"
>doc/</TT
> subdirectory of
<SPAN
CLASS="application"
>Sendmail</SPAN
> source code distributions, discusses
briefly how <SPAN
CLASS="application"
>Sendmail</SPAN
> resolves Internet addresses.
<SPAN
CLASS="application"
>Sendmail</SPAN
> source code archives are listed at:
<A
HREF="http://www.sendmail.org/"
TARGET="_top"
><I
CLASS="citetitle"
>http://www.sendmail.org/</I
></A
>
</P
><P
>[Chris Karakas]
</P
></DIV
></DIV
><DIV
CLASS="qandaentry"
><DIV
CLASS="question"
><P
><A
NAME="switch-virtual-consoles"
></A
><B
>Q: </B
>How To Enable and Select Virtual Consoles</P
></DIV
><DIV
CLASS="answer"
><P
><B
>A: </B
>In text mode, press the left
<B
CLASS="keycap"
>Alt</B
>-<B
CLASS="keycap"
>F1</B
> to
<B
CLASS="keycap"
>Alt</B
>-<B
CLASS="keycap"
>F12</B
> to select the consoles
<TT
CLASS="literal"
>tty1</TT
> to <TT
CLASS="literal"
>tty12</TT
>; Right
<B
CLASS="keycap"
>Alt</B
>-<B
CLASS="keycap"
>F1</B
> gives
<TT
CLASS="literal"
>tty13</TT
> and so on. To switch out of X you must press
<B
CLASS="keycap"
>Ctrl</B
>-<B
CLASS="keycap"
>Alt</B
>-<B
CLASS="keycap"
>F1</B
>, etc;
<B
CLASS="keycap"
>Alt</B
>-<B
CLASS="keycap"
>F5</B
> or whatever will switch back.
</P
><P
>However, If you have a non-PC compatible system, please see the note below.
</P
><P
>If you want to use a VC for ordinary login, it must be listed in
<I
CLASS="citetitle"
>/etc/inittab</I
>, which controls which terminals and
virtual consoles have login prompts. The X Window System needs at least one
free VC in order to start.
</P
><P
><DIV
CLASS="note"
><P
></P
><TABLE
CLASS="note"
WIDTH="100%"
BORDER="0"
><TR
><TD
WIDTH="25"
ALIGN="CENTER"
VALIGN="TOP"
><IMG
SRC="../images/note.gif"
HSPACE="5"
ALT="Note"></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>The key sequence is actually <B
CLASS="keycap"
>Ctrl</B
><TT
CLASS="literal"
>Meta</TT
><B
CLASS="keycap"
>F</B
><EM
>N</EM
>. On PC
compatible systems, the right and left <B
CLASS="keycap"
>Alt</B
>keys are really
synonymous with the keysymbols <TT
CLASS="literal"
>Meta_L</TT
>and
<TT
CLASS="literal"
>Meta_R</TT
>. If the binding is different, you can determine
what keys produce <TT
CLASS="literal"
>Meta_L</TT
>and <TT
CLASS="literal"
>Meta_R</TT
>with <SPAN
CLASS="application"
>xkeycaps</SPAN
>or a similar application.</TD
></TR
></TABLE
></DIV
>
</P
><P
>[David Charlap]
</P
></DIV
></DIV
><DIV
CLASS="qandaentry"
><DIV
CLASS="question"
><P
><A
NAME="set-the-time-zone"
></A
><B
>Q: </B
>How To Set the Time Zone</P
></DIV
><DIV
CLASS="answer"
><P
><B
>A: </B
>Change directory to <TT
CLASS="filename"
>/usr/lib/zoneinfo/</TT
>. Get the time zone package if you
don't have this directory. The source is available in
<A
HREF="ftp://metalab.unc.edu/pub/Linux/system/admin/time/"
TARGET="_top"
><I
CLASS="citetitle"
>ftp://metalab.unc.edu/pub/Linux/system/admin/time/</I
></A
>.
</P
><P
>Then make a symbolic link named <TT
CLASS="filename"
>localtime</TT
>
pointing to one of the files in this directory (or a subdirectory), and one
called <TT
CLASS="filename"
>posixrules</TT
> pointing to
<TT
CLASS="filename"
>localtime</TT
>. For example:
</P
><P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
> $ ln -sf US/Mountain localtime
$ ln -sf localtime posixrules </PRE
></FONT
></TD
></TR
></TABLE
>
</P
><P
>This change will take effect immediatelytry <B
CLASS="command"
>date</B
>.
</P
><P
>If the system uses Red Hat-style configuration files, the respective
time zone info files are <TT
CLASS="filename"
>/usr/share/zoneinfo</TT
> and
<TT
CLASS="filename"
>/etc/localtime</TT
>.
</P
><P
>The manual pages for <B
CLASS="command"
>tzset</B
> or <B
CLASS="command"
>tzselect</B
> describe setting the
time zone. Some programs recognize the <TT
CLASS="literal"
>TZ</TT
> environment
variable, but this is not POSIX-correct.
</P
><P
>You should also make sure that your Linux kernel clock is set to the correct GMT time. Type
<B
CLASS="command"
>date -u</B
> and check that the correct UTC time is displayed.
See <A
HREF="troubleshooting.html#computer-has-wrong-time"
><I
>Why Does the Computer Have the Wrong Time?</I
></A
>.
</P
></DIV
></DIV
><DIV
CLASS="qandaentry"
><DIV
CLASS="question"
><P
><A
NAME="core-file"
></A
><B
>Q: </B
>What Is a <TT
CLASS="filename"
>core</TT
> File?</P
></DIV
><DIV
CLASS="answer"
><P
><B
>A: </B
>A <TT
CLASS="literal"
>core</TT
>
file is created when a program terminates unexpectedly, due to a bug, or a
violation of the operating system's or hardware's protection mechanisms. The
operating system kills the program and creates a <TT
CLASS="filename"
>core</TT
>
file that programmers can use to figure out what went wrong. It contains a
detailed description of the state that the program was in when it died.
</P
><P
>If would like to determine what program a core file came from,
use the <TT
CLASS="literal"
>file</TT
> command, like this:
</P
><P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
> $ file core </PRE
></FONT
></TD
></TR
></TABLE
>
</P
><P
>That will tell you the name of the program
that produced the core dump. You may want to write the maintainer(s) of the
program, telling them that their program <EM
>dumped core.</EM
>
</P
><P
>[Eric Hanchrow]
</P
></DIV
></DIV
><DIV
CLASS="qandaentry"
><DIV
CLASS="question"
><P
><A
NAME="enable-core-dumps"
></A
><B
>Q: </B
>How To Enable or Disable Core Dumps</P
></DIV
><DIV
CLASS="answer"
><P
><B
>A: </B
>By using the <B
CLASS="command"
>ulimit</B
> command in
<B
CLASS="command"
>bash</B
>, the <B
CLASS="command"
>limit</B
> command in
<B
CLASS="command"
>tcsh</B
>, or the <B
CLASS="command"
>rlimit</B
> command in
<B
CLASS="command"
>ksh</B
>. See the appropriate manual page for details.
</P
><P
>This setting affects all programs run from the shell (directly or
indirectly), not the whole system.
</P
><P
>If you wish to enable or disable core dumping for all processes by default,
you can change the default setting in <TT
CLASS="filename"
>linux/sched.h</TT
>. Refer to definition of
<TT
CLASS="literal"
>INIT_TASK</TT
>, and look also in
<TT
CLASS="filename"
>linux/resource.h</TT
>.
</P
><P
>PAM support optimizes
the system's environment, including the amount of memory a user is allowed.
In some distributions this parameter is configurable in the
<TT
CLASS="literal"
>/etc/security/limits.conf</TT
> file. For more information,
refer to the <I
CLASS="citetitle"
>Linux Administrator's Security Guide</I
>.
See <A
HREF="online-resources.html#howtos-and-other-documentation"
><I
>Where Is the Documentation?</I
></A
>.
</P
></DIV
></DIV
><DIV
CLASS="qandaentry"
><DIV
CLASS="question"
><P
><A
NAME="remap-keyboard"
></A
><B
>Q: </B
>How To Remap a Keyboard to UK, French, Etc.</P
></DIV
><DIV
CLASS="answer"
><P
><B
>A: </B
>For recent kernels, get <TT
CLASS="filename"
>/pub/Linux/system/Keyboards/kbd-0.90.tar.gz</TT
> from
<A
HREF="ftp://metalab.unc.edu/"
TARGET="_top"
><I
CLASS="citetitle"
>ftp://metalab.unc.edu/</I
></A
>.
Make sure you get the appropriate version; you have to use the right keyboard
mapping package for your kernel version.
</P
><P
>For older kernels you have to edit the top-level kernel
<TT
CLASS="filename"
>Makefile</TT
>, in <TT
CLASS="filename"
>/usr/src/linux/</TT
>.
</P
><P
>You may find more helpful information in <I
CLASS="citetitle"
>The Linux Keyboard and
Console HOWTO</I
>, by Andries Brouwer, at
<A
HREF="ftp://metalab.unc.edu/pub/Linux/docs/HOWTO/"
TARGET="_top"
><I
CLASS="citetitle"
>ftp://metalab.unc.edu/pub/Linux/docs/HOWTO/</I
></A
>.
</P
></DIV
></DIV
><DIV
CLASS="qandaentry"
><DIV
CLASS="question"
><P
><A
NAME="num-lock-default-on"
></A
><B
>Q: </B
>How To Get NUM LOCK to Default to On</P
></DIV
><DIV
CLASS="answer"
><P
><B
>A: </B
>Use the <B
CLASS="command"
>setleds</B
> program, for
example (in <TT
CLASS="filename"
>/etc/rc.local</TT
> or one of the
<TT
CLASS="filename"
>/etc/rc.d/*</TT
> files):
</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="programlisting"
> for t in 1 2 3 4 5 6 7 8
do
setleds +num &#60; /dev/tty$t &#62; /dev/null
done
</PRE
></FONT
></TD
></TR
></TABLE
><P
><B
CLASS="command"
>setleds</B
> is part of the
kbd package ("How do I remap my keyboard to UK, French, etc.? ").
</P
><P
>Alternatively, patch your kernel. You need to arrange for
<TT
CLASS="literal"
>KBD_DEFLEDS</TT
> to be defined to
(<TT
CLASS="literal"
>1 &#60;&#60; VC_NUMLOCK</TT
>) when compiling
<TT
CLASS="filename"
>drivers/char/keyboard.c</TT
>.
</P
></DIV
></DIV
><DIV
CLASS="qandaentry"
><DIV
CLASS="question"
><P
><A
NAME="set-terminal-colors"
></A
><B
>Q: </B
>How To Set (Or Reset) Initial Terminal Colors</P
></DIV
><DIV
CLASS="answer"
><P
><B
>A: </B
>The following shell script should
work for VGA consoles:
</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="programlisting"
> for n in 1 2 4 5 6 7 8;
do
setterm -fore yellow -bold on -back blue -store &#62; /dev/tty$n
done
</PRE
></FONT
></TD
></TR
></TABLE
><P
>Substitute your favorite colors, and use
<TT
CLASS="filename"
>/dev/ttyS$n</TT
> for serial terminals.
</P
><P
>To make sure they are reset when people log out (if they've been changed):
</P
><P
>Replace the references to <TT
CLASS="literal"
>getty</TT
> (or
<TT
CLASS="literal"
>mingetty</TT
> or <TT
CLASS="literal"
>uugetty</TT
> or whatever) in
<TT
CLASS="filename"
>/etc/inittab</TT
> with references to
<TT
CLASS="literal"
>/sbin/mygetty</TT
>.
</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="programlisting"
> #!/bin/sh setterm -fore yellow -bold on -back blue -store &#62; $1
exec /sbin/mingetty $@
</PRE
></FONT
></TD
></TR
></TABLE
><P
>[Jim Dennis]
</P
></DIV
></DIV
><DIV
CLASS="qandaentry"
><DIV
CLASS="question"
><P
><A
NAME="more-than-128mb-of-swap"
></A
><B
>Q: </B
>How To Have More Than 128Mb of Swap</P
></DIV
><DIV
CLASS="answer"
><P
><B
>A: </B
>Use several swap partitions or swap files.
Linux kernels before version 2.2 supported up to 16 swap areas, each of up to
128Mb. Recent versions do not have this limitation.
</P
><P
>Very old kernels only supported swap partition sizes up to 16Mb.
</P
><P
>Linux on machines with 8KB paging, like Alpha and Sparc64, support a swap partition
up to 512MB. The 128MB limitation comes from
<TT
CLASS="literal"
>PAGE_SIZE*BITSPERBYTE</TT
> on machines with 4KB paging, but is
512KB on machines with 8KB paging. The limit is due to the use of a single
page allocation map.
</P
><P
>The file <TT
CLASS="filename"
>mm/swapfile.c</TT
> has all of the gory details.
</P
><P
>[Peter Moulder, Gordon Weast]
</P
></DIV
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="common-problems.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="x-windows.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Solutions to Common Problems</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>The X Window System</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>