Here are some solutions to problems Linux users often
encounter. If you have a better solution or have a question please send your solutions,
questions, or comments to us.
Are any of these solutions obsolete? Are they clear and easy to understand?
To create swapfile:
dd if=/dev/zero of=swapfile bs=1024 count=65536
where count=size in KB. that one is 64MB
(divided by binary thousand, 1024)
/etc/fstab contains important filesystem mount info.
/dev/hda6 swap swap defaults 0 0
gives you a good description of what these parts mean.
The advantage of this is that it allows you to create extra virtual
memory when needed. You need it when real memory (and maybe permanent
swap if you made one) runs low. The bad part of this is that it is slow
and fragmented. Anyone think different?
To install a rpm package
rpm -i package.1.2.3.rpm
where package.1.2.3.rpm is the package.
This installs all necessary files to default locations.
Now if for some reason you get an error saying that you cannot
install it because of some dependencies. You could
force it to ignore dependencies or you could find out what
libraries are needed. To ignore dependencies:
rpm -i --nodeps package.1.2.3.rpm
You may run into errors or the program may not run at all
if it doesn't get its libraries.
uninstalling a rpm package:
rpm e package.1.2.3
what do I have installed?
rpm -a -q |less
rpm to a specified dir:
man rpm and search for --root and --dbpath
To set current time:
to set system (BIOS) time:
date -s 12:34:56
This will set the system time in this format hh:mm:ss
date -s 991031
This will set the system date in this format oct 31 1999
This will sync your system (software) date and time to your hardware
To set your date and time automatically; to sync it to an official time
where time-nw.nist.gov is a time source, an address.
Other addresses are:
Server name ip address Note Location
time-b.nist.gov 220.127.116.11 2 Maryland
time-b.timefreq.bldrdoc.gov 18.104.22.168 2 Colorado
utcnist.colorado.edu 22.214.171.124 2 Colorado
time-nw.nist.gov 126.96.36.199 2 Washington
utcnist1.reston.mci.net 188.8.131.52 2 Virginia
nist1.datum.com 184.108.40.206 2 California
y2k-test.timefreq.bldrdoc.gov 220.127.116.11 2,6 Colorado
time-a.nist.gov 18.104.22.168 1 Maryland
time-a.timefreq.bldrdoc.gov 22.214.171.124 1,4 Colorado
time-c.timefreq.bldrdoc.gov 126.96.36.199 5,2 Colorado
time-d.timefreq.bldrdoc.gov 188.8.131.52 3 Colorado
time.nist.gov 184.108.40.206 1 Colorado
1. Heavily loaded and not recommended for new users.
2. Recommended for new users.
3. Used for testing only. Not for general users.
4. Does not support anonymous ftp connections.
5. Supports NTP service only -- no other time formats and no ftp
6. This server transmits time messages that are 2 years in the future for
testing the y2k performance of client systems. It is for test purposes
only and should not be used to synchronize operational systems or
those that are not prepared to handle dates in the year 2000 and
More addresses can be found at www.nist.gov
cannot execute binary problem:
instead of doing
to run a program in current dir.
Put a "." in path with:
If you are using:
Include this line in your ~/.bash_login or ~/.login or ~/.csh startup
Redhat and Mandrake:
Include this line in your ~/.bashrc file
Include this line in your ~/.profile file
Hard drive spin down
hdparm -S 1 /dev/hda <---spin down HDD in 5 seconds
hdparm -S 241 /dev/hda <---spin down HDD in 30 Min
-S option: 0 to disable, 1-240 = 5sec - 20 Min.
241-250= 30Min - 5.5 Hr
the scheme is described in
*/1 * * * * /root/tmp/xbin 1> /dev/null 2> /dev/null
this would run a program every minute
this part "1> /dev/null 2> /dev/null" will redirect mail to null.
everytime crond does something the user gets an email about it.
crontab found at /var/spool/cron/
play with crond/crontab. it prevents hdparm from spinning
down hdd because cron periodically writes to hdd.
set it to
0 * * * * /myprog <--do it at 00 of the hour
/etc/rc.d/rc.K rc.S files set update to : update -f 3600 &
flushes buffers every hour
or just dont run it at all
ad an alias s='sync'
ad an alias ='/usr/lib/atrun' <---or whatever is listed in crontab dir
now you dont have update or crond running in the bg.
logs are found in /usr/adm
when user logs in etc...
put a ''-'' before the file like this
to prevent it from syncing the file