Archive

Posts Tagged ‘fedora 11’

Installing Phidgets in Fedora

January 26th, 2010

Phidgets are boards for sensing and control projects that are managed via a USB connection to a computer. I use the Phidget Interface Kit 0/0/4 for my Christmas light controllers. To control the boards from a Linux workstation, it is necessary to install the Phidgets driver. To allow connectivity to Phidgets from Fedora 12 (or Fedora 10 or 11):

  1. Download the Phidget source: http://www.phidgets.com/drivers.php
  2. Untar the contents and change to the phidget21 directory.
  3. Run make, then sudo make install.
  4. Copy the udev configuration file to the appropriate location.
    sudo cp udev/99-phidgets.rules /etc/udev/rules.d/
  5. Restart udev.
    sudo /etc/init.d/udev-post reload
  6. Connect (or unplug and reconnect) the Phidget board to an available USB port.

I typically control the Phidget board using Python. To install the necessary Python modules:

  1. Download the Python module source: http://www.phidgets.com/programming_resources.php
  2. Unzip the module.
  3. Move the Phidgets directory to the standard location for Python modules.
    sudo mv Phidgets/ /usr/lib64/python2.6/

Christmas Lights, Development, Linux , , , ,

Monitor Network Usage with MRTG and DD-WRT

January 26th, 2010

I currently run DD-WRT on a Linksys WRT54GL. One of the great features of DD-WRT is its Simple Network Management Protocol (SNMP) functionality. You can setup a desktop to gather SNMP data from the router and provide it in nice graphical form.

First, you need to configure the router running DD-WRT:

  1. Login to the DD-WRT web interface by entering the router’s IP address in your browser.
  2. Select the Services tab.
  3. Click the Enable radio button under SNMP.
  4. Enter a description for the location (such as “Home”), a name for the contact (such as “Aaron Gember”), and a name for the router (its hostname is a good choice).
  5. Click the Apply Settings button.

After DD-WRT is configured, MRTG needs to be configured. All the commands below are run as root. A few may be Fedora specific, but the commands are easily adaptable for other Linux distributions.

  1. Install MRTG
    yum install mrtg
  2. Create a configuration file for MRTG
    cfgmaker --global WorkDir:/var/www/mrtg \
             --global 'Options[_]: bits,growright' \
             --output /etc/mrtg/mrtg.conf \
             public@routername

    The working directory is automatically created when MRTG is installed. The growright option causes graphs to display new data on the right as time progresses. The output file is the default location. Lastly, replace routername with the hostname or IP address of the router.

  3. Configure the index page to make a nice one stop interface for viewing the graphs produced by MRTG
    indexmaker --output=/var/www/mrtg/index.html \
               --title=routername --show=day --section=descr \
               /etc/mrtg/mrtg.cfg

    The title is the text at the top of the index page. The daily graphs are show on the index page, per –show=day; you can alternatively show week, month, or year graphs on the index page. The section headers have the graph description per –section=descr. Lastly, the configuration file created earlier is specified.

  4. If the Apache web server is not already running, you’ll need to start it:
    service httpd restart

    You will also want to configure the web server to start whenever the computer starts:

    chkconfig httpd on

    (There are security risks associated with running a web server, which I do not address here. For the most protection, configure the firewall on the computer to block all incoming HTTP traffic, limiting the viewing of logs to only the computer on which MRTG is running.)

  5. Lastly, run MRTG once:
    env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg

Lastly, you should setup a cron job to update the graphs every 5 minutes. As root, add a cron job to be run by root

crontab -e

and put in the MRTG command (on one line)

0,5,10,15,20,25,30,35,40,45,50,55 * * * * env LANG=C /usr/bin/mrtg
/etc/mrtg/mrtg.cfg --logging /var/log/mrtg.log &> /dev/null

piping the output to /dev/null so you don’t get an email with the command output every 5 minutes.

To view the graphs, point your browser to http://localhost/mrtg. If you control multiple routers, you can setup MRTG to aggregate the data from all routers into a single web page, but that’s beyond the scope of this post.

Linux , , , , ,

Installing Flash in 64-bit Fedora

January 12th, 2010

Every time I install 64-bit Fedora, I have issues with flash. The instructions for the 32-bit wrapped version provided on the Fedora Project wiki always work wonderfully: http://fedoraproject.org/wiki/Flash#32_bit_wrapped_version.

Linux , , ,

Permanently Change Hostname in Fedora

October 20th, 2009

To permanently to change the hostname of a Fedora box, edit the file /etc/sysconfig/network. (You need to be root to change this file.) Modify the HOSTNAME line.

Linux ,