|
There are far better pages scattered around out there, but this is the page I wish I'd found to begin with; a linux newbie guide based on a RedHat6 workstation install. I've used Linux at home only since '99 but use UNIX at work. LL: This is for You. A Choice of Operative System is traditionally based on what we'll use a machine for, but borders between OS aspects of usability are fading. Consider Linux if security, uptime, server- and multi-user abilities, automation, tunability or low costs matter. If you're the only user on your PC and mainly use it for office tasks, games and occasional mail and web browsing - stick with Windows, it's excellent for that use. Then again.. if you can't afford an Office suite, Linux offer a lot. But if you're a designer and used to Mac's.. hmm.. well. Some call Linux a "do it yourself" OS - there's some truth to that. You may have to undergo a steep learning curve to unlock it's treasures. But the hype is hot, the kids screaming for drivers.. I decided to take a harder look. And I'm impressed. Linux is getting ready for the desktop. |
Since Aug. 26th 1999
© RKAA 1999, 2001 |
|
HARDWARE STUFF |
|
|
When you know your hardware is OK, partitioning disk(s) is next "obstacle". Give that some thought - it can prove invaluable when you later upgrade your PC. The RedHat Installation Guide is good but there are some points I think could have been made clearer:
|
Linux indicate partition names different than MS operative systems. A Linux partition name also tells what kind of disk we're dealing with, and which partition of that disk it is. There are different types of disks. Single user systems normally use (E)IDE and/or SCSI disks.
If a partition is named hda1:
hd indicates an IDE type drive
the next letter - a - indicates which IDE drive it
refers to, alphanumeric.
the following number - 1 - indicates which of the partitions
it is on the that drive.
hda is the first IDE drive
hda1 is the first IDE drives first partition, what Windows would
know as C:
hdb is the second IDE drive
hdb1 is the second IDE drive's first partition
SCSI disks on Linux have names starting with
sd
SCSI disks would be sda1, sda2, sdb1 etc.
The quickest IDE disks are as fast as SCSI disks. SCSI's benefit
is "unlimited" number of HD's. Most mainboards only have controllers
for up to 4 IDE disks, one of these normally used for a CD-ROM.
A real RAID disk setup is not worth considering on workstations. Typically used on servers demanding 100% uptime, mirrored disks, hot swapping etc. and they require expensive RAID disk-controller cards. Linux, however, also support "soft RAID", providing the mirroring abilities from the RAID system but used on "normal" disks. Private users aren't very likely to need this either.
Example:
My install look like this after just some months. I considered this
a test-install and I was right - it's not an ideal partitioning of a 2
gigabyte disk for a single user machine.
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hdb1 97M 57M 35M 62% /
/dev/hdb3 97M 72M 20M 78% /home
/dev/hdb5 97M 28M 64M 31% /tmp
/dev/hdb2 1.3G 875M 412M 68% /usr
/dev/hdb7 208M 133M 64M 68% /usr/local
/dev/hdc1 3.0G 2.4G 635M 79% /mnt/fat32
/dev/hda1 811M 785M 25M 97% /DOS
The /tmp dir is too big: a separate partition
for /tmp was overkill on a single user machine.
Let install create it as a plain directory under / *unless* you plan
to have more users added to the system later.
Mind you: we're now talking about *simoultanous* users - in other
words networking.
The /home partition is too small - but it IS a partition :) Means
i can replace /home with a 20 gig disk later. Netscape saves your cached
files under your homedir so if you set up a big cache you can run out of
space if /home is too small.
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda12 197M 60M 127M 32% /
/dev/hda1 197M 4.8M 182M 3% /boot
/dev/hda5 6.0G 2.3G 3.4G 41% /home
/dev/hda8 988M 286M 652M 31% /opt
/dev/hda11 296M 128k 281M 0% /tmp
/dev/hda7 1.9G 1.7G 159M 91% /usr
/dev/hda6 1.9G 1.0G 832M 55% /usr/local
/dev/hda10 486M 25M 436M 5% /var
/dev/hdb 12G 2.2G 9.2G 19% /home/dark/DISK
|
When the installation guide refer to the
root partition it means the partition called just /
In addition, a user called root is a basic concept in unix.
A home directory for the user root will automatically be created under
/ and named /root
Again: That is the user root's home directory. Do not
make a separate partition called /root
User root is the superuser with "a license
to kill" - the system administrator, with all priviledges. During install
you will be prompted for a password: It's the root password you then set.
The root account is NOT the account you use on a daily basis. Your
first vital task as root, after install, is to create a private account
for yourself. After you've created your account, you from then on log
in as your private user and only change to user root to do serious system
work, installations etc. (and then you swiftly log out from root again).
Using root as your normal login would sooner or later prove disastrous.
One slip of the finger can erase vital files and mess your system up for
good. The user "root" is a key security concept on unix based systems.
|
Linux by default create common users home-directories
as sub directories under /home
What you assign as the new users login-name will become the name
of his/her home directory.
Each user is set up to belong to a certain group or groups. These
group associations give the user certain rights and restrictions. A set
of default groups and users are predefined. If a new user is to be a common
user on the machine, assign this user to the group "users".
Someone you want to only be able to ftp into the machine, you would
assign to the group "ftp" to restrict their access to ftp only.
The user identification is called UID . The group identification is called GID. Internally, Linux use numbers to say something about users or groups: root always has UID 0. The first common user root creates on the system will be assigned UID 500, the next one UID 501 and so forth. There is no reason to change that on a fresh install UNLESS you're already in a permanent network and a mailserver for instance know users by different UID's. If that is the case, you should probably conform to UID's already in use, and you will find them on the existing system in a file called /etc/passwd (if you don't find it consult the network administrator.)
For each new user you create, a set of default initialization files will be copied to that users home directory. The user can later modify these to her own liking. These files often start with a dot when found in a home directory, and can later be modified by the user. The basis for them can only be changed by root, and are located in /etc and various sub directories there, like /etc/skel.
Usernames should be unique, alphanumeric,
and no longer than 11 characters. Longer usernames are possible but NOT
practical. They must not contain special characters, like spaces. Usernames
longer than 11 characters are possible but NOT practical! Keep them short.
If you want a mail address with a full name, that is arranged via mail aliases
and not the system username.
Don't use space's in passwords either. A good password is "impossible"
to guess. It shouldn't be something you read elsewhere. Instead, compose
it from of a mix of upper- and lowercase letters and numbers. This would
be a good password, if it hadn't been for the fact that you just read it
here: ^D#s*iPL8
Then we're about ready to create a new user account:
<[walktrough to come]
|
pwd The default prompt only show the name of the directory you're in at the moment. If you wonder where you've dug yourself down, write pwd - print working directory. Full path displays. |
cd change directory. "cd /path/somesubdir" to move around. The command cd alone is the quick way "home" - to the home-dir of the user you are currently logged in as. |
tab If you've written enough of a file- or path-name for it to be unique, click on the tabulator key and the rest of the name will be filled in. If several files match, a list of alternatives appear when you key tab once more. |
|
Workstation users will typically want a GUI (Graphical User Interface). For that, you need X configured. Three different configurators are installed:
/usr/X11R6/bin/XF86Setup
/usr/X11R6/bin/xf86config
/usr/X11R6/share/Xconfigurator
During install you are given an option to start X by default. I advice you don't select that till all your setup is guaranteed correct. Most fiddle around for a week before settling down with X, tuning resolution and fonts. During that you're "safer" if you've made a habit of logging in from commandline (at runlevel 3) instead of from an X-enabled login-manager (at runlevel 5). More about runlevels later - just remember X can get grumpy if it disagrees with your typos.
startx from commandline starts an
X session.
The startx command is a front-end to something called xinit. Xinit
reads the script .xinitrc - a prototype script provided with the installation,
with heaps of settings you'll never use. When you get smarter you can
edit that and for instance remove redundant lines, which will cause slightly
less text fly by as you start X. Just never experiment without having a
backup of some sort. To force X to start with another colordepth than your
default, here's a sample to start with 32 bits per pixel (your card must
support it): startx -- -bpp 32
Mouse:
If you have a two-button mouse, select "emulate three buttons". This
makes it act in special ways when you click both buttons. In Unix, that
third button is used to paste with, drag scrollbar buttons and more. You'll
want this! To set up a wheel mouse correct, add the line "ZAxisMapping
4 5" as the last line under "section pointer" in XF86Config, or select
"5 button mouse" in the setup menu. It doesn't actually have 5 buttons,
but it does in effect have three, and events the wheel generate (scroll
up/down) add for two more types of behavior. Most applications understand
the wheel.
Virtual Resolution
With enough memory on your graphics card, you can set up a virtual
desktop larger than the actual display size. You can have a display resolution
at 1024x768 on a 15" and a *virtual resolution* of 1280x1024. The effect
of this is NOT the same as the "desktop" options (1,2,3,4 etc.) where you
can "jump" between desktops via a pager (or sensitive screen-edges). Virtual
desktops are valid for the current desktop and let you "slide" or
"pan" the visible area, so when your cursor hits the edge of the screen
it will move slightly right/left etc. and display the rest of the virtual
resolution you set it up for. Personally I detest that feature - makes
me sea-sick.
Desktop Environments and Window Managers
X is the fundament for any GUI [Graphical User Environment] on Linux
for now. KDE, GNOME, or any other of those more or less good looking
desktop environments and also the window managers utilize X. RH6 comes
with KDE/KDM, GNOME/Enlightenment, fvwm, fvwm2 and AnotherLevel. In RH6
the default GUI is GNOME. It's worth while to also test out KDE. You find
RPM packed upgrades of GNOME and KDE at the RedHat site and I strongly
recommend to install these.
X also has it's own minimalistic GUI: If no desktop environment is
specified, a simple X session with one instance of the Xterm terminal
window will start.
A desktop environment is a complete
GUI solution, providing toolbars, icons, applets, applications, and abilities
like drag/drop. A window manager is just an application, working
in cooperation with the desktop environment and specializing in "makeup
and behavior". It deals with wallpapers, frames, handles, borders and let
you choose how you want windowing events to perform: whether a window shall
rise to top when the mouse is over it, be transparent while moved etc. A
desktop environment can run with one of several different window managers.
KDE is a desktop manager and comes with its own window manager called KDM,
but you aren't obliged to run KDM under KDE.
Gnome doesn't have a window manager of it's own and the RH6 version
comes bundled with a setup that gives you the choice of several window-managers.
I fell flat in love with Enlightenment :)
Since a desktop manager provide programs,
it has to conform to some suitable programming language. GNOME is
based on GTK+ , an Open Source
GUI toolkit primarily developed for use with the X Window System.
KDE is based on QT
- a GPL licenced cross platform GUI toolkit by a norwegian company called
Troll Tech. QT2.0 got the 1999 LinuxWorld Editor's Choice Award for Best
Programming/Library Tools.
If you want to compile programs made for GNOME or KDE on your own, you need these libraries installed. Both are found on the RH6 disk, but newer versions exist.
In addition to applications the desktop environments provide there's a plethora of "pure" X applications and widgets included. As a new user I kept wondering about why there were so damn many filemanagers, editors and process viewers added - it took me days to get oriented in menus...even learn the names. A wilderness . Then again - there's something for every taste and CPU so.. why not.
Switchdesk:
Let you select between KDE, GNOME and AnotherLevel as the desktop
environment to start the next time you run startx. Start it by writing
"switchdesk" from a terminal window.
"Runability":
>Programs written for X run under any Desktop environment. In
addition a Desktop environment can use extra libraries that X don't know
too much about. Applications written for KDE *may* not run under GNOME
and vice versa. Most do, however. If you're on KDE and start a GNOME application,
just avoid using it's docking features or the GNOME toolbar will start
and mess up your display. (it's gone again next time you start x though.)
Toggle Resolution:
Monitor resolution toggles on the fly with "ctrl alt +" and "ctrl
alt -" IF you set up more than one resolution when you configured X. You
can also define your own F-keys for resolutions.
For the curious:
To save the text that flicker past your screen as you startx, redirect
the standard output- and error messages to a file. This syntax is valid
for the shell called bash:
startx > startx.txt 2>&1
If you don't want to see it at all you can
dump the output to /dev/null (think of it as a trashbin with no recovery)
startx > /dev/null 2>&1
Multiple monitors:
Linux doesn't mind and leaves that to the X server. Check out the
XFree86 homepage for compatibility. Keywords: Xinerama, dualhead. This
tehcnology as GPL is currently in beta versions. For broader card support
there are commercial solutions:
MetroX and AccelleratedX .
Multiple terminals: Each display has a "tty" number. A practical excample: To direct log-output to one special display, and have that as the permanent log-terminal, add a line like the following to your syslog.conf file
*.* /dev/tty5Substitute tty5 with which the tty# you want to use.
|
Takes you down to command line level and
you can run startx again. It does NOT necessarily stop running processes.
If you were online via a modem - you're still online. If you were running
single user licensed StarOffice, you may have to kill it's processes
to restart it.
|
In applications you will normally find that
Alt+c Alt+x Alt+v will copy/cut/paste.
Some Linux-app's even use MSWindows standard, for reasons unknown.
(Ctrl instead of Alt)
In virtual terminals it suffice to select the text with the cursor
and then click the middle button to autopaste. Watch out for linefeeds
if you're pasting commands: If you select a whole line you also copy
a linefeed.
|
Sometimes your font display gets messed up and look all cryptic. For instance if you by mistake run "cat" on a binary file. Control sequences in that file can happen to set your display wrong. To reset it write:
^V^O
That's ctrl+v followed by ctrl+o (the letter).
Add a linefeed and you're back in business.
|
In a virtual terminal window you can run
commands and start programs. A common icon for virtual terminals is the "X"
or an image of a monitor. Linux comes with a variety of terminal apps.
What happens when you start a terminal window is comparable to what
happens when you choose "run DOS in a window", but you can only start one
shell called command.com this way in Windows, and the terminal emulator
will always look and behave the same way (apart from fonts). Linux has
plenty of terminal types AND shell-options, highly adaptable. Xterm
is "the mother of all virtual terminals". It's unlikely that you will
need all it's features. I use rxvt instead - a smaller and quicker
xterm clone. (The transparent borderless terminals you see on many screeshots
are either Eterm or Gnome Terminal. You need a "wall to
wall" wallpaper to get a full background shine through - tiled wallpaper
doesn't translate right.)
I made a kdelnk to start rxvt, containing the following command
rxvt -sr -fn fixed -bg black -fg white
-sl 2000
(if you already found a terminal program and test this from command
line, add a & and push enter
rxvt will now start with:
-sr scrollbar on right side (default is left)
-fn fixed the "fixed" font - a font alias that's available
on all unix systems
-bg black a black backgroud
-fg white a white foreground (the text)
-sl 2000 a buffer of the latest 2000 lines that displayed.
A better look, valid if you installed the
RH6 type1 fontpack:
rxvt -sr -fn lucidasanstypewriter-12 -bg black -fg grey -sl 2000
The parameter -pixmap somepicture.xpm
will load a "wallpaper" inside the terminal window.
The -bg color must be indicated even so, to give correct reverse
effect when you select text.
Virtual terminals are not smart about font spacing, they like order and will place variable fonts too far apart according to their own ideas about a grid. Don't use - looks weird.
Now... write: ls -latr --color and
see what happens
Then write xlsfonts
To exit a terminal window you write exit
or simply click the close-button.
To terminate a process running in the window you can break it use
ctrl+C. This isn't considered a nice way to do things but at least it gives
you the prompt back.
|
The RGB color names your system know
are listed in /usr/X11R6/lib/X11/rgb.txt
Read it with more /usr/X11R6/lib/X11/rgb.txt
Click spacebar on full page to proceed the listing. Ctrl+C terminates.
Wonder what OliveDrab2 look like? A utility
Color Browser added with GNOME convert RGB (red/green/blue) values
in rgb.txt and display them as colors + names. ColorBrowser runs OK under
any X desktop.
|
Quick and easy:
Download Xview - an image browser and snapshot utility, and a "must".
Free for private use and supports all common file formats and then some.
The rpm is found under the powertools section at the RH ftp site. Start
it with the command "xv" - or "xv filename"
Already on disk:
X comes with a heap of utilities - amongst others xvd for
snapshots of windows, and xmag for magnifying.
xwd will default dump a snapshot of the active window.
To make a snapshot of the whole display: Use in combo with xmag,
running at 1:1 ("xmag -mag 1") - select the whole display (or whatever
portion is relevant) and then run an xwd of the root window (being "xmag")
- with forinstance:
xwd > filename
Display the file: xwud -in filename
Or pipe it to a postscript file at "snapshot time":
xwd | xpr > filename.ps
The overkill:
The Gimp and ImageMagick are two good but BIG graphics applications
that also do screenshots.
Later Gnome versions have an applet found under applet/utilities, simply
called ScreenShooter. If you use Gnome, this may be the quickest
method.
|
A package you want from the RH6 CD is
mtools. mtools let you access DOS type files on unmounted partitions.
See the manpage; here a basic example:
To read all files from a diskette in "a:" to the directory
you're giving the command from in Linux:
mread a:* .
There's a space between the * and the dot.
The mtools package contain a little bunch of "well known" DOS commands, all with an additional "m" in front of the command name. If the thought of doing this from command-line puts you off: Get MToolsFM . A small but efficient GUI based (GTK) file-manager utilizing mtools.
Linux has native support for DOS and fat32 formatted HD's. Linuxconf let you choose what type you want to mount a disk as, and whether it shall mount during boot or not. Remember: Whatever you want to mount a partition as: you must create that directory first. (For instance "mkdir /DOS") It's "tidyer" (but no "must") to put mounting-point directories under /mnt.
NTFS - NT's generic filesystem - - is incompatible with about everything but itself. NTFS Read-Only drivers have been written for Linux as well as DOS and BEOS. If you need to network versus NT machines, check out SAMBA.
There's a file-manager style utility to let
you access Linux
disks from Windows . It's in beta - go easy.
|
If you're at the point where NOTHING boots
and you only want your Windows back, use a DOS system formatted diskette
with fdisk copied onto it. (fdisk is in the windows/dos dir) Boot
from that. After booting and still on A: write:
fdisk /mbr
This writes a DOS Master Boot Record to your C-disk, in effect wiping out LILO - and your PC is back to it's "pre-lilo" self. You could check BIOS settings before the fdisk-stunt to verify it still looks like a DOS partition. Or just go for it.
NOTE: Separate NT description for multiboot/recovery
yet to come. The above is not valid for NT.
|
What follows is written with RH6.* and XFree86 3.* in mind. It does not fully cover Redhat7* and XFree86 v 4.*. If you use these, the additional info in my little Netscape6/Mozilla FAQ should be read as an appendix.
-
RedHat6 has support for displaying TrueType fonts. It won't automatically let you print with truetype fonts but things sure look better. xfsft - a truetype fontserver - is made a part of xfs, the x fontserver. In order to make this work you should install the Freetype library and ghostscript rpm from the install CD. To install a rpm package you must be user root. Logged in as a common user: just write su in a terminal window, provide root's password, write gnorpm & and a graphical rpm administration program starts. Mount the CD-rom, click "add", find freetype and ghostscript and install. So far, so good.
Quirk 1: Font-names must be in lowercase and contain no spaces. If you already have tt-fonts on a partition containing Windows, a quick way to copy them all in lowercase is to mount the partition as a DOS filesystem instead of fat32. This way they'll all seem to be lowercase without spaces, whatever they might look like on a fat32 partition. Afterwards you can change partition type back to whatever is relevant. The file that needs modyfying if you want to do this is /etc/fstab. Unmount first - change filesystem - remount and the files will be 8.3 type DOS files se seen from Linux. If you don't feel comfortable with editing this file by hand, use linuxconf to unmount. change filesystem, and remount. That way you don't risk typos.
Quirk 2: Fonts can be more or less broken, and not so "true" to their type as the name indicate. Below is a reference to a little program you shall run: "ttmkfdir". We testrun this first and watch the output, to see if some fonts look completely crappy. You'll know when that happens IF it happens - it looks pretty wild. Delete offending fonts and try again. If you think it ALL looks wild, it's probably OK. If unsure, compare with an existing file called fonts.dir in /usr/X11R6/lib/X11/fonts/misc
Here the suggested approach to get TT fonts up and running. Commands are done as user root. What you write is annotated in bold fonts. Open a console window, su root, then:
cd /usr/X11R6/lib/X11/fonts
ls -la
If a directory called TrueType is not there - make it with
mkdir TrueType
then
cd TrueType
Now copy your truetype fonts to the new directory
cp /dir/with/ttfonts/*.* .
(the last dot is a pointer to "current directory" - here applied
as your target directory)
When that is done (still in the TrueType directory) we do the mentioned
testrun of ttmkfdir, to see that the font descriptions we store afterwards
is set up ok in the long unix-wise manner. If one or more fonts seem to
vary wildly from the other descriptions there's something crappy with the
internal font description of that font. Delete it (rm somefont.ttf) and
try again - till the output seems reasonable uniform. The line-lengths can
vary but should contain the same "elements".
ttmkfdir
If the output seem to follow the same type of pattern for all fonts
we proceed:
ttmkfdir -o fonts.scale
Now for the smart part: For some reason ttmkfdir sort the font entries
in reverse. This cause problems with character cell truetype fonts when
the font also contain proportional characters: TT charcell fonts are
not well handled under X. If you ONLY use the command above when creating
fonts.scale, you won't run in to problems: The character cell letters
won't be included for the common MS webfonts. But often we want to include
decorative fonts in fonts.scale. These often lack many characters, and
ttmkfdir by default only tolerate 5 missing characters in a font. However,
we can tell it to be more tolerant with the parameter -m nnn where nnn
is the number of missing characters we want to tolerate in a font. A
"ttmkfdir -m 100 -o fonts.scale" will make a much larger file, however,
and since it sorts them in reverse, the character cell fonts will now
be listed before the proportional variants within the same font. This
plainly sux, because applications can "jump to conclusions" and grab the
first and best occurance of a requested font - and if that is a TT charcell
font it will look like there's heaps of white space on both sides of it.
Bad bad bad.
So as a good rule - before we proceed now - we reverse the
content of the file fonts.scale to put it right again, like this:
tac fonts.scale > fonts.dir
If you write "head fonts.dir" now you will see the first font begins
with an "a" (most likely).
Since the first entry in a fonts.dir and fonts.scale file should
be a number listing how many entries there are in the files, we must
do a little manual editing to perfect it.
Open fonts.dir in an editor
Go to the bottom of the file
Cut out the number there
Go to top of the file and paste the number in there, so it is alone
on the first line.
Make sure the file ends with a linefeed. Then SAVE it and exit the
editor.
NOW we have an OK fonts.dir file! But we still have the old topsy
turvy fonts.scale file. Since these two files in our case are meant to
be identical anyway, we now overwrite the original fonts.scale file we
made:
cat fonts.dir > fonts.scale
We are ready to rehash xfs, which happens automatically whenever
a fontpath is added or removed with the utility "chkfontpath".
/usr/sbin/chkfontpath --add /usr/X11R6/lib/X11/fonts/TrueType
(Remember Linux "fill out" paths/filenames for you when you hit the tab, once you've written enough to make it unique. However: Do NOT let the fontpath end with a /)
Your fonts should now be readable in X .
If you have arial there, check it with:
xlsfonts |grep arial
xfs can be rehashed/restarted in different
ways, here are two other approaches:
The "old" Linux way: /etc/rc.d/init.d/xfs restart
The politically correct X-way: xset fp rehash
If you later add/remove fonts in the truetype
dir, you must make a new fonts.scale and fonts.dir file. BTW: It is only
proportional fonts - variable width fonts - like truetype fonts, that
you should make a fonts.scale file for before you make the fonts.dir.
NOTE: RH6 version of xfs now listen
to a different port than earlier (now set to -1) If you've upgraded
from an earlier version of RedHat: Edit /etc/X11/XF86Config and
replace all references to fontpaths with:
FontPath ``tcp/localhost:7100''
You must also make sure that xfs runs and is started at boot time
- to ensure that write:
sbin/chkconfig --add xfs
Those with fresh installs do not have to bother about this point.
xfstt is another truetype fontdisplay server for X and doesn't require any additional libraries. It's easy to set up and can use the fonts right from your windows-disk, if you have fonts there.
In the Makefile for xfstt a default path
to your windows fonts is given. Modify the relevant line to reflect where
your Windows disk is mounted, if you want to use the fonts located there.
(they're in /whatevermount/windows/fonts) Then "make" and (as root)
"make install". Then - as whoever you want to - from the commandline run:
xfstt --synch &
Now WAIT... some 4 seconds BEFORE starting X, so xfstt gets time
to unwind :)
After X is started - with startx or what
you use - you must set a fontpath that xfstt will find fonts at. xfstt doesn't
cooperate with the native xfs fontserver. Write:
xset fp+ unix/:7101
This tells X that there's an additional fp = fontpath found at that
port. Since xfstt runs independently of xfs, the command "chkfontpath"
does not affect it.
NOTE: It is only the very first time
you start xfstt you need the --synch parameter. This creates a database
of the installed fonts. Synchronizing is only required when xfstt needs
to know about added or removed fonts.
|
Some webpages use tiny fonts, unreadable in Netcape4.* unless we tune for them. X and MSWindows interpret tt-font sizes differently. Netscape under MSWindows display a larger font at "12 points" than the Linux version does - it seems the error is off by approximately 2 points. What this means in practical life is that TT fonts smaller than 9 points aren't readable under Linux. But many sites use them, since they appear larger on MSWindows.
A "font deuglification" page is out there, but I found the suggested fix of perm "swapping" the 100 and 75 dpi fonts caused way too big fonts in menus and elsewhere. Instead: Here is THE fix for those with the MS truetype webfonts installed:
The fix assumes:
RH6* xfs already working
TT fonts in /usr/X11R6/lib/X11/fonts/TrueType
ISO8859-1 character set.
(easily adjustable to other dir's / character sets.)
Before we start the TT fontstuff i have to
correct an error i wrote here earlyer:
I used to recommend this line in .Xdefaults in your homedir:
Netscape*documentFonts.sizeIncrement: 5
REMOVE IT! It's no good.
INSTEAD of sizeIncrement we will add aliases for helvetica! I just
discovered they are lacking in RH6. And that's why helvetica fonts on
typical unix sites on web look way bad and scale as smooth as...a brick.
If you recognize the problem: Do this to check whether there at all are
aliases for helvetica:
grep elve /usr/X11R6/lib/X11/fonts/75dpi/fonts.alias
grep elve /usr/X11R6/lib/X11/fonts/100dpi/fonts.alias
If it isn't already aliased: Check that you have it installed:
grep elve /usr/X11R6/lib/X11/fonts/75dpi/fonts.dir
grep elve /usr/X11R6/lib/X11/fonts/100dpi/fonts.dir
If you didn't have aliases, but did get filenames listed after the
last two commands (lines mentioning helvetica outside filenames) - you
have it aboard, all is well and we will proceed:
Use the contents from these pages 75dpi
and 100dpi
Then start by taking a copy for safekeeping of the original fonts.alias
files you already have in the mentioned directories.
Then - as root:
-fire up your favourite editor
-open the fonts.alias files in the above directories
-paste the content into the corresponding files AFTER what is there
from before
-make sure the files end with one linefeed
-save the files in their respective directories.
Reminders:
OK. That was the basics. Rehash xfs with
"xset fp rehash". And then we go for the good stuff:
Tuning for TrueType fonts
We will create (or add to) a fonts.alias in your TT fontdir. Sample
content for the font Arial is given below. The sample contains a little
"trick" we add to avoid too small font-sizes. We will get back to that later.
Making a correct fonts.alias file in the truetype directory provide more sizes as options under preferences/fonts in Netscape.
Here are the sample contents of a fonts.alias. Must end with one linefeed and be saved as user root:
-monotype-Arial-medium-r-normal--6-60-0-0-p-0-iso8859-1 -monotype-Arial-medium-r-normal--9-90-75-75-p-0-iso8859-1
-monotype-Arial-medium-r-normal--7-70-0-0-p-0-iso8859-1 -monotype-Arial-medium-r-normal--9-90-75-75-p-0-iso8859-1
-monotype-Arial-medium-r-normal--8-80-0-0-p-0-iso8859-1 -monotype-Arial-medium-r-normal--9-90-75-75-p-0-iso8859-1
-monotype-Arial-medium-r-normal--9-90-0-0-p-0-iso8859-1 -monotype-Arial-medium-r-normal--9-90-75-75-p-0-iso8859-1
-monotype-Arial-medium-r-normal--10-100-0-0-p-0-iso8859-1 -monotype-Arial-medium-r-normal--10-100-75-75-p-0-iso8859-1
-monotype-Arial-medium-r-normal--11-110-0-0-p-0-iso8859-1 -monotype-Arial-medium-r-normal--11-110-75-75-p-0-iso8859-1
-monotype-Arial-medium-r-normal--12-120-0-0-p-0-iso8859-1 -monotype-Arial-medium-r-normal--12-120-75-75-p-0-iso8859-1
-monotype-Arial-medium-r-normal--13-130-0-0-p-0-iso8859-1 -monotype-Arial-medium-r-normal--13-130-75-75-p-0-iso8859-1
-monotype-Arial-medium-r-normal--14-140-0-0-p-0-iso8859-1 -monotype-Arial-medium-r-normal--14-140-75-75-p-0-iso8859-1
-monotype-Arial-medium-r-normal--15-150-0-0-p-0-iso8859-1 -monotype-Arial-medium-r-normal--15-150-75-75-p-0-iso8859-1
-monotype-Arial-medium-r-normal--18-180-0-0-p-0-iso8859-1 -monotype-Arial-medium-r-normal--18-180-75-75-p-0-iso8859-1
-monotype-Arial-medium-r-normal--24-240-0-0-p-0-iso8859-1 -monotype-Arial-medium-r-normal--24-240-75-75-p-0-iso8859-1
-monotype-Arial-bold-r-normal--6-60-0-0-p-0-iso8859-1 -monotype-Arial-bold-r-normal--9-90-75-75-p-0-iso8859-1
-monotype-Arial-bold-r-normal--7-70-0-0-p-0-iso8859-1 -monotype-Arial-bold-r-normal--9-90-75-75-p-0-iso8859-1
-monotype-Arial-bold-r-normal--8-80-0-0-p-0-iso8859-1 -monotype-Arial-bold-r-normal--9-90-75-75-p-0-iso8859-1
-monotype-Arial-bold-r-normal--9-90-0-0-p-0-iso8859-1 -monotype-Arial-bold-r-normal--9-90-75-75-p-0-iso8859-1
-monotype-Arial-bold-r-normal--10-100-0-0-p-0-iso8859-1 -monotype-Arial-bold-r-normal--10-100-75-75-p-0-iso8859-1
-monotype-Arial-bold-r-normal--11-110-0-0-p-0-iso8859-1 -monotype-Arial-bold-r-normal--11-110-75-75-p-0-iso8859-1
-monotype-Arial-bold-r-normal--12-120-0-0-p-0-iso8859-1 -monotype-Arial-bold-r-normal--12-120-75-75-p-0-iso8859-1
-monotype-Arial-bold-r-normal--13-130-0-0-p-0-iso8859-1 -monotype-Arial-bold-r-normal--13-130-75-75-p-0-iso8859-1
-monotype-Arial-bold-r-normal--14-140-0-0-p-0-iso8859-1 -monotype-Arial-bold-r-normal--14-140-75-75-p-0-iso8859-1
-monotype-Arial-bold-r-normal--15-150-0-0-p-0-iso8859-1 -monotype-Arial-bold-r-normal--15-150-75-75-p-0-iso8859-1
-monotype-Arial-bold-r-normal--18-180-0-0-p-0-iso8859-1 -monotype-Arial-bold-r-normal--18-180-75-75-p-0-iso8859-1
-monotype-Arial-bold-r-normal--24-240-0-0-p-0-iso8859-1 -monotype-Arial-bold-r-normal--24-240-75-75-p-0-iso8859-1
NEW:
Roman Sulzhyk [roman@starmedia.net]
sent me a nice mail including a python script he wrote to ease the creation
of a fonts.alias file. And after I had edited this page to include the
script, he read the page here once more and modified the script to take
into account the error with fontsizes rendering smaller under Linux than
under Windows. I am still not sure whether this is a bug in FreeType or
whether MS have bumped up the sizes on Windows, but as long as we can
compensate for it, it doesn't matter too much. So thank you Roman, and
thanks again :) It works like a dream.
I added names for common MS webfonts to it earlyer, so this is already
version 0.3 ;)
It is easy to add other fonts it should map, follow the same syntax.
Roman Sulzhyk's script is perfect for making an initial fonts.scale
file for tt-fonts. You should not, however, use it for native X-fonts,
due to the TT specific compensation it does.
To use the script you need
python installed.
(There are perl scripts that do the same thing, but noone ever mailed
me one.)
NOW:
- Save mkfontalias.py and then..
su root
- copy the file to a directory in your path. (echo $PATH). I copied
it to /usr/local/bin
cp mkfontalias.py /usr/local/bin
- change filemode on it so it becomes runnable:
chmod 755 /usr/local/bin/mkfontalias.py
- cd to your TT font-dir, e.g.
cd /usr/X11R6/lib/X11/fonts/TrueType
- run the script by simply writing:
mkfontalias.py
Depending on how you ran ttmkfdir the first
time, you can now end up with a pretty large file: mkfontalias.py use
the existing fonts.dir file as basis for creating a fonts.alias. If you
ran ttmkfdir with for instance the "-m 100" option mentioned earlyer,
you now got a lot of aliases for character sets you will never use, and
thus don't need aliases for.
So what we do now do is filter the file down to something that suits
our language and won't torture X too much. In my case iso8859-1 do nicely,
so I now wrote:
grep 'iso8859-1"' fonts.alias > newfonts.alias
cat newfonts.alias > fonts.alias
This trimmed fonts.alias down to contain only the iso8859-1 entries.
So far so good. We now have a valid fonts.alias
file.
Now remember the fontsize issue: A 12 point font under MSWindows
will look approximately like a 10 point font under Linux. This isn't
a real problem untill the fonts get very small. You *may* want to edit
the fonts.alias file to become 100% consistant, and alias ALL fonts
with an offset of 2 points. But this isn't really required, and personally
i find the bigger fonts become too big for my taste if i do that.
The script has already made aliases for 6, 7 and 8 pt. fonts refer
to what's really the 9 point version of it. Applications that want to
use them, now "find" the small fonts, but what they display is size 9.
For the sake of comparision: Here is my own fonts.alias for TT fonts, but it may contain fonts you don't have, so do NOT copy it as such! Use mkfontalias.py and then finetune It's quick, and if fonts you don't have are defined in the script, it simply ignores them.
When all filemaking and editing is done:
To activate the aliases we restart xfs. You don't have to exit X first, just:
xset fp rehash
Then the final makeup:
After the file is created: Restart Netscape.
Open "preferences/fonts" and select:
"Allow Scaling" for variable width font
Check the checkbox for "use document-specified fonts".
Then select "Arial (monotype)" as your Variable Width Font and choose
font-size 12 in the upper dropbox.
Click OK.
If after all this some fonts still look crappy:
It's CSS bugs! Go to prefs/advanced and disable stylesheets to cure it.
The only bad stylesheet page i know of is Altavista where the error seems
to occur for fonts defined as a % of a size. The new Netscape will handle
this beautifully however, and Mozilla already does.
There is of course a lot more to dealing with fonts under X. Later
you may want to add aliases for larger fonts, for instance. I'll add more
info later when i get in the spirit ;)
A little WARNING to the incurably
curious:
If you get bloodthirsty after the success with TT-fonts: Be aware
that you must be very very careful if you mess around with fonts.alias
files in *other font directories* than the truetype one. Some aliases
must be available at all times! In particular you should keep your
fingers away from the fonts.alias in the /misc directory. There the vital
aliases for "fixed" and "variable" must be the first two entries mentioned.
Mess that up and X won't start. Also be careful with fonts.dir and fonts.scale
files - don't fool around with them unless you mean it ;)
|
If you once configured TrueType fonts correct under Linux, you've gotten used to crisp clear smooth fonts. But with RedHat8 came Xft2 - with the possability for anti-aliasing (AA) set as default. Sorry to say, but IMO, both AA and non-AA fonts under Xft2 look like crap. Even the far superior cleartype technology used on MS Windows looks a little blurred to me so I never used it there either.
In order to get non-aliased fonts without the Xft2 hinting making the fonts look like barbed wired:
In KDE: Run qtconfig and disable antialiased font rendering in it for QT. In GTK/Gnome: Add "export GDK_USE_XFT=0" to .bashrc Personally i don't load the "freetype" or "type1" module in XF86Config, but instead use xfs. Then add the truetype fonts you have to a local ~/.fonts directory and while there, run "fc-cache"
(Or else (basically) KDE/Qt or Gnome/GTK doesn't "see" your TT fonts)
Make sure you don't have any funny font-rendering code added in your After a restart all my TT fonts looked like I prefer them; crisp clear and smooth. I've enjoyed TT fonts on RH for the past 4 years and am very pleased with the quality - now also in RH8 :)
If you can't get it going and things look like shit: Compare to this screenshot (COMING) for how things should look. Do NOT believe people who say you should recompile the freetype library in order to make this look good - they are false prophets!
|
|
|
StarOffice and WordPerfect of course import MS doc files, but are large applications. Here is what I'm using for the moment:
1: ImageMagick
2: WV
3: Abiword
If you only want to read doc-files you only need Abiword, which implements WV. But for extended usage - and the hint below on how to read doc files from Netscape: Might as well install them all.
Abiword uses the wv engine to import MS Word doc's from version 6,7,8 and 9 - in other words Word6, Word95, Word97 and Word2000 documents.
Abiword doesn't save as .doc files but
can save as .rtf
MS-Word can read .rtf files.
As a matter of fact, using .rtf (rich text format) is safer, since
no macro viruses can be attached that way.
Files listed as dependencies you need to
have installed.
To find what you have and not use "locate blabla.so.6" etc.
Here you find the mentioned files:
WV:
http://www.rpmfind.net/linux/RPM/freshmeat/wv/wv-0.5.43-1.i386.html
ImageMagic:
http://www.rpmfind.net/linux/RPM/rawhide/1.0/i386/RedHat/RPMS/ImageMagick-4.2.9-3.i386.html
Abisuite:
http://www.abisource.com/dl_linux_intel.phtml
Read Winword doc's in Netscape 4.*:
Having WV 0.5.44 installed, i modified /usr/doc/wv-0.5.44/helper-scripts/mswordview.wrapper
to look like this, basically:
#!/bin/sh
Then I added this to Netscape preferences for helper apps:
PATH=/bin:/usr/bin:/usr/local/bin
HTML=/tmp/mswordview.$$.html
/usr/bin/wvHtml "$*" > $HTML
netscape -remote 'openUrl(file://'$HTML')'
(sleep 30; rm -f $HTML)&
Description: Winword-file
MIMEType: application/msword
Suffixes: doc
Handled by:
Application: /usr/doc/wv-0.5.44/helper-scripts/mswordview.wrapper %
And VOILA - Netscape displays a html version of doc-files. Quite handy
to quicly browse an attachment.
There are countless other editors and word-processors.
Ranging from console based to full fledged GUI based windowing applications.
One GUI based one that impress me ever more is
Ted . It looks and feels a little odd at first, but isn't at all
difficult to figure out. Ted is a tuneable RTF editor (Rich Text Format)
that saves as HTML as well. It's quick, reliable, and handles images, columns,
hyperlinks and pagecounts. With some tweaking it also saves PDF files -
and let you print right to a faxmodem.
|
This is an area with a few pitfalls and I'll give you a link covering it better than I could. There's a variety of protocols for dialup connections. PPP is the one you'll want for Internet use with a modem. RedHat has an excellent and up to date howto full of hints and details about how to see what responses the modem in the other end expect. There is no such thing as a "windows" or "Linux" ISP. If they can be connected to - they CAN be connected to. However, it's common that ISP's won't know up from down on a Linux system, so their support for Linux users can be meager.
Before you start you need to know the IP of your ISP's nameserver. In my case, it turned out all I needed of info apart from that IP was the instructions under "Setting up PPP with Linuxconf". After having read that it took me 5 minutes to connect to my ISP first time and I had never done this before.
Windows users who never struggled with modem configuration under DOS may wonder about drivers: In normal cases you don't need a "driver" for a modem. The drivers you install under MS Windows are in many cases basically just some strings added to the register, adding info about which port the modem is on and what initialization strings it requires under various conditions. (When it's used to dial an ISP, when it's used for voice, fax, how it's supposed to be reset etc.)
I use a Rockwell v90 based modem and have
this line in /etc/sysconfig/network-scripts/chat-ppp0
'' 'AT&FM0+MS=56'
That works well. The "FM0" here simply tells the modem to use default
factory settings. This may vary from modem to modem. If FM0 doesn't work
- try FM1 or FM2.
In addition, the basic reset-string in /etc/sysconfig/network-scripts/ifcfg-ppp0
is:
INITSTRING="ATZ"
I'll add the whole set of files to compare with, but again: It shouldn't
be neccesary to worry too much about them.
--
If you notice errors about missing compression - it's there but not
yet aliased: Add this to /etc/conf.modules (may be called modules.conf
on non-redhat systems)
alias ppp-compress-21 bsd_comp
alias ppp-compress-24 ppp_deflate
alias ppp-compress-26 ppp_deflate
Hints:
Modem and FAX |
After a half hearted encounter with mgetty+sendfax, I took a closer closer look at efax and xfax. Efax is a commandline based send/receive fax application. Xfax is a GUI for efax, allowing edit, attach, preview, send, log and save, amongst others. Once an xforms beauty she may appear slightly faded now, but let's call it the "retro unix look". The Real Neat Thing is that this is simple - and works!
Flowers to xfax author Kees Lemmens and co-author Jean-Pierre Demailly, who both swiftly mailed me hints and URL's after an xfax compile misbehaved.
-Install the Xforms library. xforms-0.88-9.i386.rpm is found at rpmfind.net.
-
netpbm-8.0.tar.gz is acclaimedly needed, but I am not convinced
this is correct. Seems efax can run without it. Anyway: If you need ppmtoxbm,
ppmtoxpm and others, know that they are compiled and included in Kees Lemmens'
static version of xfax linked to further below. Get that instead.
- efax you want. efax-0.9-3.i386.rpm seems to be the latest.
-xfax:
get
xfax-2.11.tgz
Read INSTALL, edit accordingly
make, su, make install - then chmod u+s /usr/bin/xfax or wherever
you determined to put it. Perhaps a quick and dirty fix but I couldn't
make it work right as non-root. I assume you are aware of the security implications.
Install the
ghostscript and ghostview packages, found on the RH CD. I have ghostscript-5.10-11
and gv-3.5.8-7. They are needed for some browsing, printing and converting
postscript files to fax format. To see what's installed:
rpm -q gv
rpm -q ghostscript
If these are missing: put the RH CD in the player, start gnorpm, select "install", roam around on the CD, find the files and install.
1: Get a
copy of an
efax RPM
Netscape users then right-click
on the link efax-0.9-3 RPM for i386 and select "Save Link As"
The efax
homepage is in Canada at http://casas.ece.ubc.ca/efax/
Efax require /bin/sh and glibc. This is
most likely installed but if you aren't sure, issue these commands and
see if the files are found:
locate
libc.so.6
locate ld-linux.so.2
ls -la /bin/sh
If any are missing you're in trouble and probably not reading this page.
2: Install efax
su
[password]
rpm -Uvh efax-0.9-3.i386.rpm
3: Get
the binary xfax.1.11Linuxbin.tar.gz from
ftp://ta.twi.tudelft.nl/pub/dv/lemmens/
We don't need xforms or netpbm when using
the static binary.
4: Unpack the file and change working directory
tar -zxvf
xfax.1.11Linuxbin.tar.gz
cd Xfax_linux
5: Configure
xfax
Now is when you have to read and edit.
The whole procedure is described crisp clear in the file "INSTALL".
The files you shall modify are:
xfaxrc
faxdirect
In case you would like to compare, here are samples of how i edited them to look, without the personal information. Values you may want to modify are BOLD - leave the rest.
Sample: modified .xfaxrc
Name: My Name
Title: My Title if any
Department: Home Office
Email: myname@myisp.com
AsciiCmd: /opt/lib/xfax/efix -ve -itext
-ofax -p21x29.7cm -d0,0.2 -l62 -n %s.%%03d %s
Editor: xterm -e pico
EmailFlag: False
FrontPageFlag: True
Header: /opt/lib/xfax/faxheader
SpoolDir: /var/spool/fax
FaxSend: /opt/lib/xfax/faxsend
FaxPrint: /opt/lib/xfax/faxprint
GifCmd: /opt/lib/xfax/giftog3 %s.001
%s
PSCmd: gs -q -sDEVICE=faxg3 -dNOPAUSE
-sOutputFile=%s.%%03d %s quit.ps
G3ToXpm: /opt/lib/xfax/g3toxpm
If the directory /var/spool/fax/ does not exist, as root: create
it.
----
Sample: modified faxdirect
for a Class 2 modem capable of 14400 bps,
which is about all of them now. If you have an old old modem, you have
to read that file more thorough, but all you need to possibly modify is
explained. efax has a manpage - xfax a html based help-page.
Only the editable part is here, original
comments mostly deleted and my own added. Comments are prefixed by a #.
[The very first line in a script often states which shell the script uses
- never remove a leading #! line]
Again: Remember that descriptions here
are for RedHat 6.* installations.
#!/bin/sh
XFAX=/opt/lib/xfax
#BELOW: The path to EFAX is modified!!
#We use the newer version we installed
via rpm instead!
EFAX=/usr/bin/efax
DEV=modem
CLASS=2
# Your fax number in international
format, 20 characters maximum.
# Use only digits, spaces, and the
"+" character.
FROM="+47 0123456"
# Your name as it should appear on
the page header.
NAME="MyName"
# Dialprefix "T" for TONE, "P" for
pulse.
DIALPREFIX="T"
DIALSUFFIX=""
LOCK='-x /var/lock/LCK..$DEV'
# Uncomment one of the following lines
to force xon/xoff flow
# control if you have one of the types
of modems listed.
# FCINIT='-j\Q4' # AT&T
(Dataport, Paradyne)
# FCINIT='-j\Q1' # Motorola
(Power Modem, 3400 Pro,...)
# FCINIT='-j*F1' # QuickComm
(Spirit II)
# FCINIT='-j&H2' # USR (Courier,
Sportster)
# ****************************************************************
# The remaining options probably won't
need to be changed.
# ****************************************************************
## well...so it says.. Actually there's
ONE more line you want to change
# for a 14400 capable fax
# scroll down till you find this line:
TXCAP="1,3,0,0,0,0,0,0"
# and change it to this:
TXCAP="1,5,0,0,0,0,0,0"
6: Create the proper directories
The static version is compiled for some predefined directories we
have to comply with. These directories aren't created during a RedHat
installation, so we make them by hand now instead:
(as root)
mkdir -p /opt/lib/xfax
mkdir /opt/bin
7: Move the files to their new homes
Still as root, cd to the directory where
you unpacked xfax
cd /home/mylogin/Xfax_linux
mv xfax.static /opt/bin
mv * /opt/lib/xfax
cd /opt/lib/xfax
The directory the files were originally unpacked, Xfax_linux, should be empty now.
Still as root, make a textfile in /opt/lib/xfax/ called faxheader. Edit the content be whatever you want your faxheaders to display.
8: SUID xfax so you don't have to be root to use the program
cd /opt/bin
chmod u+s xfax.static
9: Now exit from user root
write exit and then cd
Now you should be "yourself" - check that
with the command "whoami"
If you are still root, write "exit" again
and another "whoami" till you become your ordinary login.
When you are "yourself" again make sure
you are in your homedir (cd)