More Linux Hints
by John W Clark
Last updated 9 Sep 2001
Quick links:
My home page
Setting up Mandrake 8.0 on a Dell
Inspiron 8000 (w/GeForce2Go video)
LPG Measurement Technology
Home Page - My families' business, and my employer
These handy hints are provided on an as-is basis. Use entirely at own
risk.
These hints were developed as a result of my climbing the linux learning
curve. Most importantly, I have done basically all of my linux-learning
on Linux-Mandrake systems. This hints may not be totally applicable on
other distributions (or even much older Mandrake distributions).
At last writing I was using Linux-Mandrake 8.0
Acrobat Reader
Download Acrobat reader for linux from Adobe's website (www.adobe.com)
Installation of the .tar.gz file should be straightforward. Just follow
instructions contained in the archive.
Making associations in Netscape 4.7x:
Edit | Preferences | Navigator | Applications
Choose "Portable Document Format" if it already exists, otherwise create
a new association, according to:
Description: Portable Document Format
MIME Type: application/pdf
Suffixes: pdf
CHECK Use this MIME as the outgoing default
Application: /usr/local/Acrobat4/bin/acroread %s
AudioGalaxy AGSatellite
Download the non-static version of the .tar.gz file
The stuff you unpack, move to the desired folder underneath your home
directory.
You'll need to create shares.txt file in the same directory, containing
the paths of directories to share with other users (one per line)
You'll need to create account.txt file. First line contains the email
address you registered with. Second line contains the password for your
account.
Then just run AGSatellite. Don't expect to see any feedback about whether
or not you were logged-on. The only way to test this will
be to download an MP3 from Audiogalaxy.
To run AGSatellie from a GNOME panel, like the Favourites menu, you'll
need to create a script to ensure that AGSatellite is invoked from the
AGSatellite directory. Here is a sample:
#!/bin/bash
cd ~/data/app/AGSatellite
./AGSatellite
CUPS printing to Windows shared printers suddenly stops working...
Sometimes, after the CUPS package is upgraded, printing to SMB printers
no longer works.
Solution: After upgrading the CUPS package, the SMB printers settings
seems to get changed, so that the login/password to the Windows machine
hosting the printer is changed to "root". Use kupsdconf to change the user
name back to the Windows system username and password that has access to
the printer.
Another reason might be that the DNS on your LAN cannot find the Windows
machine (that is sharing the printer) by it's host.domain style name. Linux
uses RARP (I think) to make sure that the IP address you specify for the
Windows machine matches it's host.domain style name. On my LAN I was using
Winproxy to connect machines on the LAN to the internet and also as a DNS
server, and I needed to add the name and IP address of the machine to the
Winproxy clients list file (in the DNS settings area of Winproxy).
Downloader for X 1.26
Just download the RedHat RPM and install it. Should install fine. run command
is /usr/bin/nt
Downloader for X website: http://www.krasu.ru/soft/chuchelo
Email: Quick-and-dirty setup to allow email to be sent between linux hosts
on a LAN
This is pretty easy to setup. I've had more success when I setup email
clients to send mail via the SMTP service on each machine (rather than
sendmail - probably because I haven't setup postfix properly yet). I've
also had more luck checking my local mail using POP3 on each local machine.
Once these are done and working (test by sending an email to yourself),
simply add the machine names and IP mappings into the 'hosts' (or equivalent)
file of your DNS server for your LAN. Then you should be able to send emails
to different linux machines on the network. Obviously, each linux machine
will need to be setup to be part of the same domain name (e.g. mylocalmachine.localdomainname.com)
Fetchmail - gathering mail from multiple servers to the local mailspool
Install the fetchmail and fetchmailconf packages. Fetchmailconf is a really
handy way to configure fetchmail and the servers you want to retrieve from.
Run fetchmailconf and specify all the settings you want.
Important settings to remember:
-
*VERY IMPORTANT* For each remote server you specify, be sure to specify
the local linux username to which the retrieve mail should be spooled.
-
Automatic detection of remote server protocol doesn't seem to work that
well. Specify manually (eg. POP3)
Below is an example of the resulting ~/.fetchmailrc file that is generated
(passwords removed)
# Configuration created Tue Aug 14 21:05:53 2001 by fetchmailconf
set postmaster "usera"
set bouncemail
set no spambounce
set properties ""
set daemon 10
poll blah.com with proto POP3
user 'blah1' there with password
'xxxxx' is 'user1' here options fetchall
poll pop.ihug.com.au with proto POP3
user 'blah2' there with password
'xxxxx' is 'user2' here
Make sure you test this system to make sure it works, using the Test option
in fetchmailconf
To setup your mail reader to read from the local mailspool: The simplest
way is to just probe the local POP server at localhost. Use your linux
user name and password.
Finally, you'll need to make sure fetchmail is automatically started
in daemon mode when you login. For the moment I've just put it in my GNOME
Startup programs list in the GNOME Control Panel. The command to call is
fetchmail -d 300
This example will cause fetchmail to check all remote servers every 300
seconds (5 mins). The "set daemon" item in ~/fetchmailrc may override this.
Files - locating
slocate (also mapped to locate) is an awesome search tool. Remember
that it searches for the FULL path and file name. You can use as many wildcards
as you like....
e.g. locate *doc*gimp*
Sometimes the search database needs to be updated by running updatedb.
KDE Tweaking
Automatically starting applications when KDE starts
Use the file manager to create links to applications in the ~/.kde/Autostart
directory
Mounting shared folders located on Windows systems (SMB shares)
See smbmount and smbumount in the manual pages.
To allow normal users to mount and unmount smb shares, give SUID root
privileges to smbmnt and smbumount (e.g. 'chmod u+s /usr/bin/smbmnt' and
'chmod u+s /usr/bin/smbumount')
POP3 Mail Server Troubleshooting - "Stuck" message on your POP3 server
account
On the odd occasion I've found that my POP3 mail server chokes on a message.
To delete the offending message, the following example shows how you can
telnet to Port 110 of your mail server and do the job manually.
-
telnet to the server, port 110
-
type USER {username}
-
type PASS {password}
-
type TOP 1 0 (to check the top most item in the
mail queue). The server will report the header so you can check it is the
correct message)
-
type NOOP
-
type DELE 1 (to delete the mail item)
-
QUIT
Prozilla
Cool multithreaded downloader for linux. Console based. Run command is
/usr/bin/proz
Website: http://prozilla.delrom.ro/
StarOffice 5.2
Just execute the huge StarOffice binary (it's shipped as a binary). It
is installed into the user's home directory, so don't do it as root.
The installed astaroffice binary is located at ~/office52/soffice
Tar - Unix Tape Archiver
Common tar commands:
-
To uncompress a tar.gz file: tar -xzvf {tar_file_name}
-
To compress to a tar.gz file: tar -czvf {tar_file_name} --exclude={exclude_file_spec}
{include_file_spec}
Add -W to add post-create verification
Add -p when extracting to preserve permissions
xinetd - Internet Services Daemon
Sometimes upgrading xinetd to the latest version may override the security
openings that are necessary in the xinetd.conf file. The key thing that
I found was missing once was the only_allow option.
xinetd.conf contains only the default settings (global defaults). The
settings for each service are in separate files under /etc/xinetd.d/
An example xinetd.conf file to allow service access to all computers
on the local network are as follows:
#
# Simple configuration file for xinetd
#
# Some defaults, and include /etc/xinetd.d/
defaults
{
instances
= 60
log_type
= SYSLOG authpriv
log_on_success
= HOST PID
log_on_failure
= HOST RECORD
}
Also, to access mail through POP3 protocol on the local host, make sure
the file /etc/xinetd.d/ipop3 file contains the following
# default: on
# description: The POP3 service allows remote users to access their
mail \
#
using an POP3 client such as Netscape Communicator, mutt, \
# or fetchmail.
service pop3
{
socket_type = stream
wait = no
user = root
server = /usr/sbin/ipop3d
log_on_success += USERID
log_on_failure += USERID
}
Multiple internet connections
Install linux while connected to the local intranet and the ethernet-based
networking will be set up automatically.
Setting up dial-in access through an ISP is a little more involved.
But you should be able to get somewhere by:
-
First use draknet to add a new network profile
-
Use kppp to access the net through this new profile. Note: if the logon
to the ISP is not scripted, it is usually a PAP type connection.
Still more work to do in this area
Reinstalling linux mandrake over the top of an existing installation
One problem I encountered when I was reinstalling LM8.0 over an existing
LM8.0 installation (the root filesystem was formatted before reinstalling)
is that when I was recreating the user accounts, the files in the users
accounts were not owned by those users. To fix this, run UserConf (part
of LinuxConf) and change the UID of the desired user to the UID assigned
to the files in that users home directory. It will ask you if you want
to update the owner details for each file in the users directory - choose
recursively change. Everything should be OK.
Setting up Wine
No time to fill this in yet.
GPG Keys support and tools
Download and install gnupg and GPA (the graphical front end)
A good starting place is www.gnupg.org, but it might also be on rpmfind
Castlewood ORB drive
There seems to be some problem with the Castlewood ORB drive (IDE version)
under linux on my desktop PC (Mandrake 7.1). I've found that using hdparm
to turn off dma and LBA mode improves the problem, but doesn't create a
very good transfer rate (1.5M/sec - ugh). The problem that can occur is
that the system freezes every few seconds, then comes back to life continually
during a data transfer. These settings seems to stop this occuring, for
the most part anyway.
hdparm -c1 -A1 -d0 -m0 /dev/hdb
I'm suspicious that newer versions of kernel IDE drivers has fixed this
problem, but I haven't confirmed that yet.
Setting up sound
Sometimes all-of-a-sudden, sound won't work for a user, but works for root.
This occurs usually after installing some X or sound RPM's. The problem
is that the permissions of /dev/dsp and /dev/mixer (and possibly /dev/mixer1)
have been changed to only allow access to root. Add permissions as follows:
chmod g+w /dev/dsp
chmod g+rw /dev/mixer
(may need to do this /dev/mixer1 as well
Configuring GNOME
Configuring hot-keys: GNOME Configuration Tool | Sawfish Window
Manager | Shortcutsfs
XFree86 - switching from 3.3.6 to 4.1.0 and vice-versa
Go to Mandrake Control Centre | Hardware | Display
Click on Expert Mode
It will ask you which server you would like to use. Choose your desired
server and proceed from there.f
XFree86 - Updating to 4.1.0
There are many advantages to upgrading LM8.0 XFree86 from 4.0.3 to 4.1.0,
including major bug fixes and many usability enhancements.
Steps
-
Download all the necessary packages from a LM8.0 "cooker" ftp mirror (e.g.
ftp://ftp.stealth.net/pub/mirrors/ftp.mandrake.com/Mandrake/updates/8.0/RPMS/
)
-
Install these packages.
Notes:
(a) When you update XFree86-xfs package, it will not update the /etc/X11/fs/config
file. Instead it creates a config.rpmnew file there. Propagate any changes
you may have made to this file to the new version, and overwrite the old
file with the new.
(b) Other .rpmnew files are created but they should be identical to
the
Finally, do a rpm -qa | grep XFree86 to ensure all XFree86 RPM's are
4.1.0
-
Tweak some of the font configurations (some good help can be found in the
Font
De-uglification HOWTO by Yu-Chia Chang)
-
Check the box in the KDE Control Center | LookNFeel | Style | Use Anti-aliased
fonts and icons. To support smoothed fonts, XFree86 must support the RENDER
extension for your video card. If RENDER is supported, executing xdpyinfo
| grep RENDER should show you that the extension is there.
-
Specify your display size in order to help X better choose your font sizes.
Do this by adding "DisplaySize {width in mm} {height in mm}" to your "Monitor"
section in /etc/X11/XF86Config-4 file, for example
-
In XF86Config-4, remove the reference to the unix font server by adding
a # to the start of the line, e.g.
and add the following
FontPath "/usr/X11R6/lib/X11/fonts/misc"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/75dpi:unscaled"
# These are specified in /usr/X11R6/lib/X11/XftConfig
FontPath "/usr/X11R6/lib/X11/fonts/truetype"
# These are specified in /usr/X11R6/lib/X11/XftConfig
FontPath "/usr/X11R6/lib/X11/fonts/Type1"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi"
FontPath "/usr/X11R6/lib/X11/fonts/75dpi"
FontPath "/usr/X11R6/lib/X11/fonts/misc"
FontPath "/usr/X11R6/lib/X11/fonts/misc:unscaled"
Fontpath "/usr/X11R6/lib/X11/fonts/Speedo"
-
In XF86Config-4, make sure the "Module" section contains
Load "freetype"
Load "speedo"
Load "type1"
-
Now you should be able to add and remove TTF fonts for X using DrakFont,
but you must ensure that the font file names are lowercase (see the Font
De-uglification HOWTO) in order for them to be recognised properly..
-
Restart X and the fonts situation should be improved.
XFree86 - Fixing mouse problems
Sometimes I have had problems with the mouse being incorrectly configured.
Some useful tips to find the fault are below:
-
Most likely, the problem lies with the mouse settings in the XF86Config-4
file.
-
In the "InputDevice" section, try the following for a wheel type PS/2 mouse
Option "Protocol" "IMPS/2"
or specify "PS/2" if it is not a wheel mouse
-
Option "Device" should be "/dev/psaux" or "/dev/mouse"
-
If it is a wheel mouse, make sure the following setting is also there
Option "ZAxisMapping" "4 5"
Other useful tools
-
Bastille: Tools for learning about security and configuring same
-
cfdisk: Curses-based console disk partition manager
-
cooledit: Cool text/programmers editor
-
curl: Versatile retriever of files over networks using whatever method
it can
-
dia: Diagramming tool like Visio
-
drakfont: Font management
-
ee: Electric Eyes - image viewer
-
gfontview - a tool for previewing Type 1 and Truetype fonts (they do not
need to be installed)
-
gimp: GNOME image manipulation program - pretty cool
-
gnomba: GNOME samba browser
-
gnozip: The WinZip of linux???
-
gnumeric: pretty decent spreadsheet that can read and write Excel
-
gnupg: PGP key management
-
gnuplot: plot 2D and 3D graphs
-
gqview: File browser specifically to view images on a file system
-
grip: GNOME cd player/ripper
-
gtp: GNOME file transfer manager - download multiple files from the internet
-
gv: View PS and pdf documents
-
gxedit: A cool text editor that is network-aware (GNOME)
-
ImageMagick: A set of utlities for image manipulation
-
joe: text mode editor with Wordstar-like key commands
-
ps2pdf: Convert postscript to pdf file
-
tar: To unpack a tar.gz type "tar -xzvf {tarfile}"
-
locate: finds files according to the search spec. It's more flexible than
dos WHEREIS, though, so keep in mind the searchspec is for the FULL path
and name of the file.
-
mha-decode: Cool little utility to decode a file (or mail folder file)
containing mime attachments
-
mirrordir and fmirror: Mirrors an ftp directory
-
msec: Automate setting security levels of a Linux-Mandrake system
-
qcad: Decent DXF-based CAD program (2D)
-
qtcups: Control panel for the CUPS printing system
-
route: shows current connections to the network
-
rpm: console package management application
to install packages: rpm -ivh {package name}
-
split: split files into multiple pieces
-
wget: get files over FTP/HTTP, with resuming
-
which: shows the full path and file name of a file you type, if it is in
your path
-
wvPS and wvPDF - Convert Word files to PS/PDF
-
xwc: Windows-style file manager
Less commonly needed, but still useful
-
xwpick: grab all or part of an X window
-
xpp: Like Windows Printer Control Panel
-
init: Sets the runlevel. "init 3" will set console mode runlevel
Programming tools
-
hexedit - HEX file editor
-
ruby - an object-oriented, interpreted scripting environment. Looks like
a good place to start with my OS.
-
strace - monitor/log all the system calls that a process makes
-
lsof - list open files
-
ltrace - trace the library calls and signals of a program
-
memprof - a tool for profiling memory usage and detecting memory leaks
-
mm - library that provides simple routines for shared-memory management
-
Games
-
lbreakout: Pretty cool breakout game
-
Maelstrom: Asteroids
-
xsoldier: Shoot-em-up
-
pingus: Awesome lemmings clone
-
rocksndiamonds: great boulderdash equivalent
-
scavenger (xscavenger) Lode runner type game
-
Powermanga: Good shoot-em-up
-
Chromium - Cool OpenGL shoot-em-up arcade game
Linux Mandrake 8.1 Help
I've added this section here until it gets big enough to warrant it's own
page.
Setting up RGB Antialiasing for LCD screens
LCD AA looks even better than standard AA. It only looks good on most LCD
screens, mind you. Don't bother trying it on normal CRT monitors 'cos it's
UGLY. To set it up, add the following line to /etc/X11/XftConfig
match edit rgba=rgb
Other options in place of 'bgr' may produce better results on your LCD.
Other options you can try are rgb, vbgr and vrgb. The options starting
with 'v' signify vertical antialiasing. On my LCD screen (on my Dell Inspiron
i8000) I observed the pixels with a magnifying glass, and found that each
pixel was made up of red, green and blue sub-pixels arranged horizontally
with red on the left, green in the middle and blue on the right. So I used
the match edit rgba=rgb option and it gave me the best results.
Making applications start faster under KDE
Having too many fonts installed under xft in KDE causes program start delays.
The current version of xft re-scans every font directory listed in /etc/X11/XftConfig
before each application is started. To reduce program start time you can
just disable Anti-Aliasing. But if you love those smooth fonts, then the
first thing to do is to edit XftConfig and comment-out the lines that point
to nonexistent font directories. To speed things up even more, consider
removing fonts that you don't need or want to use in KDE. As for me, I
use StarOffice/OpenOffice for document generation, so I have very few fonts
installed in KDE - all my fonts are installed in StarOffice instead.
Getting the floppy drive to work
Mandrake 8.1 has a problem on some systems relating to detection and registration
of the floppy drive. Mandrake produced an errata bulletin relating to this
(and other) problems (find it here).
In summary, the problem can be fixed by adding the "nobiospnp" kernel
option at boot. Here's a brief overview of what to do if you're using the
LILO bootloader:
1. As root, open up /etc/lilo.conf in your favourite text editor.
2. Find the entries in lilo.conf relating to your standard linux boot
option. Mine is the standard, simply called linux. On my machine the relevant
section looks like this:
image=/boot/vmlinuz
label=linux
root=/dev/hda5
initrd=/boot/initrd.img
append=" hdb=ide-scsi
devfs=mount nobiospnp quiet"
vga=788
read-only
3. Notice where I've inserted "nobiospnp" That's the addition that
needs to be made to your lilo.conf
4. Close lilo.conf, saving the change.
5. Update the bootloader to reflect the changes made by executing the
following command as root: lilo -C /etc/lilo.conf
6. Reboot your machine and you should now be able to mount your floppy
drive.
(end of document)