old-www/LDP/LG/issue38/lg_tips38.html

428 lines
15 KiB
HTML

<!--startcut ==========================================================-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>More 2 Cent Tips & Tricks LG #38</title>
</head>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#0000AF"
ALINK="#FF0000">
<!--endcut ============================================================-->
<H4>"Linux Gazette...<I>making Linux just a little more fun!</I>"
</H4>
<P> <hr> <P>
<!-- QUICK TIPS SECTION ================================================== -->
<center>
<H1><A NAME="tips"><IMG ALIGN=MIDDLE ALT="" SRC="../gx/twocent.gif">
More 2&#162; Tips!</A></H1> <BR>
Send Linux Tips and Tricks to <A HREF="mailto:gazette@ssc.com">
gazette@ssc.com
</A></center>
<p><hr><p>
<H3>New Tips:</H3>
<ul>
<li><a HREF="./lg_tips38.html#veldwijk">
Multiple booting.
</a>
<li><a HREF="./lg_tips38.html#kahn">
Spell checking an single word
</a>
<li><a HREF="./lg_tips38.html#narendra">
Keyboard Macros in Emacs
</a>
</ul>
<H3>Answers to Previous Questions:</H3>
<ul>
<li><a HREF="./lg_tips38.html#fonteyne">
Re: A question please: two modems
</a>
<li><a HREF="./lg_tips38.html#zoltan">
Re: Boot SCSI with IDE Disk Too
</a>
<li><a HREF="./lg_tips38.html#avelon">
Supra SupraSonic Int Modem with Linux
</a>
<li><a HREF="./lg_tips38.html#poplawski">
Supra SupraSonic Int Modem with Linux
</a>
<li><a HREF="./lg_tips38.html#brower">
From .02 Tips issue 36: SupraExpress Modem
</a>
<li><a HREF="./lg_tips38.html#winkler">
MIDI question
</a>
</ul>
<P> <hr> <P>
<!--================================================================-->
<a name="veldwijk"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<font color="navy">
Multiple booting.
</font> </H3>
Date: Mon, 01 Feb 1999 07:04:20 -0500<BR>
From: "Richard E. Veldwijk", <A HREF="mailto:veldwijk@UU.NET">
veldwijk@UU.NET</A> <BR>
<P>
As I've got kids and kids tend to play games, I have to have Micro$oft
products on my machine. As I use OS/2 and Linux myself, here's a nice
tip: Install OS/2's boot manager. If you have OS/2 installation
floppies, you can run an OS/2 FDISK and install the boot manager, even
without installing OS/2 itself.
<P>
On my machine, I have two primary C-partitions. The 1st is DOS 6.2, the
2nd is WIN98. I created these with Partition Magic and the OS/2 boot
manager will take care of hiding and unhiding of these partitions.
The 3rd option is Linux, where LILO is loaded from the Linux partition,
instead of the MBR, so it doesn't interfere with M$ crap. Last option
is, needless to say, OS/2 itself. This works really good!
One drawback: Only the last booted C-partition is visible. If you need
to access the other, you'll have to hide one and unhide the other.
<P>
--<BR>
Richard E. Veldwijk
<P> <hr> <P>
<!--================================================================-->
<a name="kahn"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<font color="navy">
Spell checking an single word
</font> </H3>
Date: Mon, 8 Feb 1999 01:01:43 -0500 (EST)<BR>
From: "Ben 'The Con Man' Kahn", <A HREF="mailto:xkahn@cybersites.com">
xkahn@cybersites.com</A>
<P>
Many times I want to spell check a single word while I'm using an
application which doesn't support ispell. I created a small tcsh alias
which can check a single word from the command line. Here is the alias:
<PRE>
alias spell 'set j=`mktemp /tmp/spell.XXXXXX`; rm -f ${j}*; echo \!:1 >
${j}; ispell ${j}; cat ${j}; rm -f ${j}*; unset j'
</pre>
Please note that the inner quotes are back quotes. This makes the
command run and assigns the output to a variable. I have no idea how to
do this in bash. :^/
<P>
--<BR>
Benjamin Kahn
<P> <hr> <P>
<!--================================================================-->
<a name="narendra"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<font color="navy">
Keyboard Macros in Emacs
</font> </H3>
Date: Mon, 01 Feb 1999 19:09:16 +0500<BR>
From: Vishwas Narendra, <A HREF="mailto:vishen@md2.vsnl.net.in">
vishen@md2.vsnl.net.in</A>
<P>
This is my $0.02 tip on how to use Emacs for programming with a bit
of lesser work for your fingers. Emacs has something known as
keyboard
macros. To create a keyboard macro type `C-x (' when you're editing
any
file(let's say a C source file). Now when the minibuffer says `Defining
kbd macro' type in whatever you want to automate. Take for example you
want to automate the line :
<P><TT>int main(int argc, char
**argv)</TT>
<BR><TT>{</TT>
<BR>&nbsp;
<BR>Once you've finished typing this type `C-x )', emacs should say
`Keyboard
macro defined'. Now you must name your macro, so that you can call it
later.
Just type `M-x name-last-kbd-macro'. It then prompts for the name. In
our
example, let's call this as `main-type' or something like that. Now
open
your .emacs file. When the .emacs file is open, come to the end of the
file and type `M-x insert-kbd-macro'. When it asks for the name of the
macro to insert type in the macro name you had given last time. And
emacs
automatically inserts the Lisp code for your macro.
<P>Now in order to call the macro you must use `M-x &lt;macro-name>'.
But
this doesn't do much good because the whole idea of macros is to
decrease
your typing and this makes it worse. This problem is overcome by
using
keyboard mapping. The next step is to map the macro to one of the
function
keys.
<P>Depending on whether you need the macro in all modes or not you can
use the functions global-set-key or define-key.
<P>1. Here is an example for the global-set-key which you can add to the
end
of the .emacs file:
<P><TT>(global-set-key "\C-cm" 'main-type)</TT>
<P>Now the next time you reload emacs, when you type C-c m the whole
code (not really, just this one line) gets typed for you. Please note
here that it is a bad idea to use keys that have already been
mapped. The most preferable combination is Control C + &lt;yourkey>.
<P>2. If you want the keys to be mapped only in the cc-mode, then place the
following code in your c-mode-common-hook:
<P><TT>(define-key c-mode-base-map "\C-cm" 'main-type)</TT>
<P>The only problem with the first method is that since you have
only
limited keys on the keyboard, they get used up very quickly. Moreover,
when you're editing something like a html file, you wouldn't
wan't emacs to spew out characters like `int main' etc.
<BR>&nbsp;
<P><B>PS to gurus</B>: Please note that I myself am a beginner in
emacs.
I've used it for only six months now. If there is any mistake in what
I've
written, please don't hesitate to write to me.
<P>
--<BR>
Vishwas
<P> <hr> <P>
<!--================================================================-->
<H4><font color="maroon">
Tips in the following section are answers to questions printed in the Mail
Bag column of previous issues.
</font></H4>
<P> <hr> <P>
<!--================================================================-->
<a name="fonteyne"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
ANSWER: <font color="navy">
Re: A question please: two modems
</font> </H3>
Date: Wed, 24 Feb 1999 17:56:21 +0100<BR>
From: Christophe Fonteyne, <A HREF="mailto:christophe.fonteyne@lu.gmeds.com">
christophe.fonteyne@lu.gmeds.com</A>
<P>
It is impossible to connect two modems over a telephone line at a speed
of 56 Kbps.
The reason for that is that the maximum traffic over a telephone line is
64 Kbps.
In order to obtain that speed, both parties need to have a didgital
connection. When you dial up to your provider at 56 Kbps, you're not
dialling to an analogue modem, like you have yourself, but insteed,
you're dialling an ISDN modem...ie digital.
Therefore you cannot have the full 64 Kbps, but only 56 Kbps (loosing 8
KBPS).
Now if you set up a connection between 2 anaolgue modems, you will loose
twice the 8 Kbps, leaving you with a maximum transfer rate of 48 Kbps.
This is only when the lines are in optimal condition, which is rarely
the case. Also, make sure the transfer rate of your serial ports is set
high enough (eg stty 57600 ).
<P>
--<BR>
Christophe
<P> <hr> <P>
<!--================================================================-->
<a name="zoltan"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
ANSWER: <font color="navy">
Re: Boot SCSI with IDE Disk Too
</font> </H3>
Date: Tue, 2 Feb 1999 21:54:40 +0100<BR>
From: "B&ouml;sz&ouml;rm&eacute;nyi Zolt&aacute;n", <A HREF="mailto:zboszor@mol.hu">zboszor@mol.hu</A>
<P>
A local ISP tried to install LILO in a machine that has both
IDE (three disks) and SCSI, and for him the only variation
that worked was when there was no primary master IDE disk,
one of the IDE disks was the slave on the primary controller.
<P>
The BIOS of course allowed to boot from SCSI but LILO
complained all the time that /dev/sda in not the first disk
until the above setting.
<P>
After installing LILO the primary slave could be jumpered
as master but not recommended.
<P>
--<BR>
Zoltan Boszormenyi
<P> <hr> <P>
<!--================================================================-->
<a name="avelon"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
ANSWER: <font color="navy">
Question in lg-37
</font> </H3>
Date: Tue, 9 Feb 1999 10:52:04 +0100<BR>
From: Ian Carr-de Avelon, <A HREF="mailto:ian@emit.pl">
ian@emit.pl></A>
<P>
A reaction to:
<blockquote> <font color="navy">
I have two 3com modems v90's one is internal "3com v90 voice" and the
other is External 3com v90 .... I am using each one with a Linux
System and have them connected to each others by a telephone line ....
my problem is that I don't get the 56 speed that v90 should have. I
get 33 or some thing like that... is there a way to tune up the modems
in Linux operating systems? Thanks a lot.
</font></blockquote>
Unfortunately this is nothing to do with Linux, so normal folks can't meddle
with it, as they could if it were something in Linux. The "56K" speed is
possible only in one direction, and relies on there being a digital connection
to the phone system at the faster sending end. To get 56K in one direction
you will need to change one end to ISDN and purchase suitable equipment
for that end Eg. USR Courier-I. Depending on the cost of ISDN where you
are, you may be better looking at ISDN at both ends as equipment for
straight digital ISDN is much cheaper.
<P>
--<BR>
Ian
<P> <hr> <P>
<!--================================================================-->
<a name="poplawski"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
ANSWER: <font color="navy">
Supra SupraSonic Int Modem with Linux
</font> </H3>
Date: Mon, 08 Feb 1999 09:58:51 PST<BR>
From: "tom poplawski", <A HREF="mailto:tom_poplawski@hotmail.com">
tom_poplawski@hotmail.com</A>
<P>
I have seen the Red Hat page and this about Supra Modems and Linux. I am
writing this from my Linux box connected to the Internet with my diamond
SupraSonic II modem. I am using Red Hat 5.2 and made no changes at all
to get this modem working. I haven't tried using both modems at once -
yet! At first glance it appears Linux has recognized the other modem as
well. I haven't been able to tell why Red Hat says it won't work but it
may need some configuration as a Plug and Play board that Linux can't
provide. I did use it first in another plug and play operating system
before Linux.
<P>
--<BR>
Tom
<P> <hr> <P>
<!--================================================================-->
<a name="brower"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
ANSWER: <font color="navy">
From .02 Tips issue 36: SupraExpress Modem
</font> </H3>
Date: Tue, 1 Dec 1998 09:48:10 -0500<BR>
From: "Brower, William", <A HREF="mailto:wbrower@indiana.edu">
wbrower@indiana.edu </A>
<P>
Richard wrote:
<blockquote> <font color="navy">
I have a PII (350MHz) running with an AGP ATI 3DRage graphics card
(which works fine) and a Sound Blaster 16 PnP (which
also works fine). But, I can't get my internal SupraExpress 56k
modem to work.
</font></blockquote>
Your modem sounded familiar from a past search I had done, so I went to
Red Hat's www site (http://www.redhat.com/) and followed the
support | hardware link. You will find this reference in the modem
category:
<P>
Modems that require software drivers for compression, error correction,
high-speed operation, etc.
PCI Memory Mapped Modems (these do not act like serial ports)
Internal SupraExpress 56k & also the Internal SupraSonic 56k
<P>
It appears that your modem is inherently not compatible with Linux. I
use an inexpensive clone modem called the E-Tech Bullet, pc336rvp
model - paid $28 for it and it operates with no problems at all. Good
luck in finding a compatible modem!
<P>
--<BR>
Bill
<P> <hr> <P>
<!--================================================================-->
<a name="winkler"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
ANSWER: <font color="navy">
MIDI question
</font> </H3>
Date: Tue, 23 Feb 1999 18:47:56 -0500<BR>
From: Paul Winkler, <A HREF="mailto:zarmzarm@erols.com">
zarmzarm@erols.com</A>
<P>
Subject: Idea for an article
<blockquote> <font color="navy">
How about a primer on how to set up one's sound card to do true MIDI?
</font></blockquote>
<P>
Good idea, big topic.
<blockquote> <font color="navy">
I have an Ensoniq AudioPCI card and have been successful in getting it
to play WAV files via the audio
out port and also simulated MIDI using TIMIDITY.
</font></blockquote>
That is all the card is capable of. The AudioPCI _does_not_have_ a
hardware midi synth of any kind!
<blockquote> <font color="navy">
But I can't figure out how to get TRUE MIDI rendering like I get with
the same card in Windows 95.
</font></blockquote>
You've been fooled, I'm afraid. Under Win95, the AudioPCI uses a
software synth (which is what TiMidity is!). Check your system
resources while playing MIDI... CPU usage should go up.
<P>
If you really want / need a card that really has built-in wavetable
synthesis, make sure you get one that stores the samples in ROM, not
RAM. If the samples go in RAM, you need software to load them at boot
time. This software is provided by the manufacturer and guess what... it
won't run on Linux.
<P>
I have a Turtle Beach Malibu which has a 2MB ROM sample set which sounds
OK. The other snag is I've hardly found any Linux apps which work with
it! (Jazz++ sequencer works.).
<P>
--<BR>
Paul
<P> <hr> <P>
<!--================================================================-->
<center>Published in <I>Linux Gazette</I> Issue 38, March 1999</center>
<P> <hr> <P>
<!--================================================================-->
<A HREF="./index.html"><IMG SRC="../gx/indexnew.gif" ALT="[ TABLE OF
CONTENTS ]"></A> <A HREF="../index.html"><IMG SRC="../gx/homenew.gif"
ALT="[ FRONT PAGE ]">
</A> <A HREF="./lg_answer38.html"><IMG SRC="../gx/back2.gif" ALT=" Back "></A>
<A HREF="./cooper.html"><IMG SRC="../gx/fwd.gif" ALT=" Next "></A>
<P> <hr> <P>
<h5>This page maintained by the Editor of <I>Linux Gazette</I>,
<A HREF="mailto: gazette@ssc.com">gazette@ssc.com</A><BR>
Copyright &copy; 1999 Specialized Systems Consultants, Inc. </H5>
<P>
<!--startcut ==========================================================-->
</body>
</html>
<!--endcut ============================================================-->