Tips & Tricks for Redhat Linux
Here are some tips and tricks I've found useful for running
Redhat Linux systems over the years, from version 5.1 to 8.0.
Some may be helpful to you.
Some may be out of date.
Some may be obvious in the manual, but who ever reads those?
NOTE: You need to be root to do most of these!
RPM commands lock up or freeze
Sounds like the RPM database has been corrupted.
- cd /var/lib/rpm
- db_verify Packages (only salvagable if this is ok)
- rm -f __db.*
- rpm -vv --rebuilddb
- Cross your fingers!
Adding new TrueType fonts
- Make a new directory, say /usr/X11R6/lib/X11/fonts/MyTTFdir
- Copy your .ttf font files into there
- cd /usr/X11R6/lib/X11/fonts/MyTTFdir
- ttmkfdir to make the fonts.scale file
- mkfontdir to make the fonts.dir file
(needed for TTF fonts?)
- chkfontpath --add=/usr/X11R6/lib/X11/fonts/MyTTFdir
(or manually by editing /etc/X11/fs/config)
- service xfs restart (or /etc/init.d/xfs restart)
- chkfontpath --list to see if MyTTFdir was added
- xfontsel to browse/view available fonts
- cdrecord -scanbus
to find out the SCSI ID X,Y,Z of your burner (usually 0,0,0)
- cdrecord -v dev=0,0,0 blank=fast
to fast blank a CD-RW
- cdrecord -v dev=0,0,0 blank=all
to thoroughly blank a CD-RW
- mkisofs -v -J -r -o mysrcdir.iso mysrcdir
to create an ISO image of all files in directory mysrcdir
- mount -t iso9660 -o ro,loop mysrcdir.iso /mnt/cdrom
to check that the ISO image is OK before burning
- mkisofs -v dev=0,0,0 speed=10 -data mysrcdir.iso
to burn ISO image at 10x speed
- cdrecord -dummy ...
will do a dummy write for testing
- cdrecord driveropts=burnproof
will turn on 'burnproof' settings
- mkisofs -v -J -r . |
cdrecord -v driveropts=burnproof speed=10 dev=0,0,0 -
will avoid creating an intermediate ISO image
- mount /mnt/cdrom
to mount the CD
- cdrecord -v speed=10 dev=0,0,0 -pad -audio *.wav
will burn an audio CD of .wav files
The /etc/profile.d/ directory
Most people know about /etc/profile script which gets
run for each new shell, setting up 'global' environmental variables etc.
Well, the /etc/profile.d/*.sh (for sh-style shells: sh, bash, bash2)
and /etc/profile.d/*.csh (for csh-style shells: csh, tcsh)
are also run.
It's a nice clean way to easily plug settings (like $PATH)
in and out for new programs you can't get RPMs for.