sandip's blog

Using Fedora Core's up2date with Fedora Legacy

The Fedora Core up2date program is, by default, only configured to update from the Red Hat servers. Once your Fedora Core version reaches End of Life, you will want to reconfigure it to use the Fedora Legacy repository so that you can continue to receive updates.

Step 1: Preliminaries: Install up2date

This document assumes you have already installed and are using up2date on your system. If not, it is perhaps better to use yum instead; please see "Keeping Fedora upto date with Yum !" for information on how to install and use yum on your machine. Official documentation can also be reached at: fedoralegacy.org.

How to allow write permissions to mounted partitions...

Open up "/etc/fstab" in your favorite text editor, and add or edit the mounted partition line to be:

/dev/hda1 /mnt/dos1 vfat users,owner,rw,noauto 0 0

Meanings:
/dev/hda1 = hard drive partition
/mnt/dos1 = mount point where you want the disk mounted
vfat = filesystem type
users,owner,rw,noauto = options to mount

users => allow users to mount
owner => allow device owner to mount
rw => read and write permissions
noauto => do not mount at boot (otherwise will mount as root)
0 0 => backup option (to dump, don't dump) and fsck option (don't fsck)

Once you do this, any user can do:

$ mount /mnt/dos1

... and this will mount the filesystem.

Check the man on "fstab" and "mount" for more help.

If you want to get deeper into administration, you could set up an
automounter.

See:
Automount mini-Howto at TLDP.org

Set up a default editor...

The following example shows how to determine if an editor has been defined, and how to set up "vi" as the default.

$ echo $EDITOR
$ 
$ EDITOR=vi
$ export EDITOR

Get a Report of Missing Files from Apache Error Log

If you manage several sites on a server and want to track down the missing files, here is a hacked up script to do so. Put it into a weekly cron and chmod the file to be an executable.

#!/bin/sh
# /etc/cron.weekly/404.sh
# report of top 20 missing files in error_log
 
# array of error_log file paths of the different domains.
log_file=("/path/to/domain1/error_log" "/path/to/domain2/error_log" "/path/to/domain3/error_log")

(for ((i=0; i<${#log_file[@]}; i++))
do
  echo "Report of top 20 'missing' files in ${log_file[$i]}."
  for x in `grep "File does not exist:" ${log_file[$i]} | awk '{print $13}' | sort | uniq`
  do grep $x ${log_file[$i]} | wc -l | tr -d '\n'
    echo " : $x"
  # Change the head value to the number of missing files to report.
  done | sort -rn | head -20 
  echo
done) | mail -s "Missing File Report" username@yourdomain.com

Change the "username@yourdomain.com" to reflect the email address of the person that should get the reports.

XF86Config for Dual Monitor with TwinView Option in NVIDIA GeForce FX5200

The NVIDIA GeForce FX5200 video card allows for dual monitor via the TwinView option.

To enable TwinView, you must specify the following options in the "Device" section of your XF86Config file:

Option "TwinView"
Option "SecondMonitorHorizSync"     "<hsync range(s)>"
Option "SecondMonitorVertRefresh"   "<vrefresh range(s)>"
Option "MetaModes"                  "<list of metamodes>"

You may also use any of the following options, though they are not
required:

Option "TwinViewOrientation"        "<relationship of head 1 to head 0>"
Option "ConnectedMonitor"           "<list of connected display devices>"

See the detailed descriptions of each option mentioned in the driver README file.

My current device setting is shown below:

Looking for Open Files on a Linux System

Got a program sucking up system resources? Looking for a possible security breach?

Check out the command `lsof`.

The name "lsof" is short for "ls (or list) open files". Using it, you can look at certain processes, file descriptors of a process, or show certain network connections, since network connections use file descriptors like normal files.

To identify a suspect process, first run `ps -ef`, which will show the command line and environment information about swapped out processes. Then, run

#lsof -sp <pid>

Where "<pid>" is the process ID of the suspect process.

NDISwrapper in Fedora using Dell TrueMobile 1300

This step-by-step walk through is for Fedora CORE 1.0 using a Dell Latitude CPi with the PCMCIA Dell TrueMobile 1300 (BroadCom BCM94306) 802.11b/g wireless network card.

Install the ndiswrapper by following the installation wiki documentation.

NOTE: I was getting errors with the current release and 0.9 version finally worked for me, so try installing previous releases and use the one which works for you.

Below are the steps that I took:
1. Install the ndiswrapper using the rpm.

#tar -zxvf ndiswrapper.tar.gz
#cd ndiswrapper
#make rpm
#rpm -Uvh /usr/src/redhat/RPMS/i386/ndiswrapper*.rpm

2. Install the windows driver as described in the infFile using ndiswrapper. You should have a ".inf" and a ".sys" file for this to work.

#mount /mnt/cdrom (place the Dell TrueMobile Driver disk in the cdrom first)
#ndiswrapper -i /mnt/cdrom/Setup/bcmwl5.inf

3. Load the ndiswrapper module

#modprobe ndiswrapper

The light on the card should turn on at this point.

Access Control to your web files via .htaccess

Setting up access control using HTACCESS

There is an advantage to controlling access to certain parts of your domain. If, for instance, you wanted to make general information public, but only wanted to make specific information available to your customers you could use a feature of NCSA-based httpd servers commonly reffered to as HTACCESS.

Using this access control method you can limit access to certain branches of the directory tree. If you want to really understand how this works, nothing is better than reading the manual.

Basic Access Control

You can control access to your webpage two different ways, by host filtering or user authentication. But keep in mind that neither method is fullproof. This should be considered as secure as a courtesy lock on a restroom door; nice, but ultimately ineffective.

The default name of the access control file is .htaccess but that is not written in stone. In the server configuration overview we looked at a file called httpd.conf. This file had the following entry:

Redirecting Dynamic URL using mod_rewrite

What do you do when you need to move servers or web-files to a different domain or directory, especially if you need to be moving dynamic content. How would you prevent down-time? This is not an end all solution, but Apaches' module mod_rewrite comes to the rescue of redirecting URLs.

Below are the steps that was taken to move web-files to a different servers.

1. Create a temporary unused sub-domain to point to the new servers IP address.

2. Allow for a day before you migrate your content to let the subdomain resolve.

3. Setup rewrite rule to redirect your current domain to the temporary domain after migrating content.

Binding Multiple IP Address on RedHat Linux...

Go to /etc/sysconfig/network-scripts where you will find a file "ifcfg-eth0" .

Copy this file to ifcfg-eth0:0, ifcfg-eth0:1, ifcfg-eth0:2, etc... one per IP you want to bind to the box.

Edit each file replacing the line eth0 with eth0:0, eth0:1, eth0:2, etc... as per the filename, and replace the IP address with your new ipaddress, so that you have one ifcfg-eth0:x file per ip address.

When you're done do: `ifup eth0:0, ifup eth0:1, etc...` or `service network restart`.

Syndicate content
Comment