Archive

Posts Tagged ‘fedora 10’

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 , , ,

Run Commands on Startup in Fedora

December 13th, 2009

To have commands run at the end of the startup process, add the commands to the /etc/rc.local file.

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 ,

Mount Windows Share in Linux

October 17th, 2009

To mount a Windows share in Linux, execute the following command:

mount -t cifs //Server/Share -o username=WinUsername,password=WinPassword /mnt/dir

Linux ,

Finding Packages in Ubuntu

September 29th, 2009

In Fedora, I always use yum search to determine the exact name of a package I want to install using yum install. However, in Ubuntu I noticed apt-get does not have any search function. Instead, I needed to use apt-cache search to locate the exact name of a package. Also, it is good practice to run apt-get update prior to using apt-cache search to ensure the latest list of packages is cached on your computer.

(Note that apt-get update is not the same as yum update. apt-get update updates the list of packages, while yum update updates the list of packages and installs the newest version of any updated packages. In Ubuntu, apt-get upgrade will install the newest version of any updated packages.)

Linux ,

Installing Compiz in Fedora 10

September 6th, 2009

To add some pizzaz to my Fedora 10 box, I decided to install Compiz. I mostly followed the instructions under step 21 at http://www.my-guides.net/en/content/view/125/26/1/9/. Here’s what I did step-by-step:

  1. Installed the latest NVidia drivers for my graphics card. (As far as I know, you cannot use the nv driver with Compiz.)
  2. Ran the command
    glxinfo | grep direct

    and got the response

    Direct Rendering: Yes

    confirming my box had the capacity to run Compiz.

  3. Installed the necessary packages (as root) for using Compiz with Gnome.
    yum install ccsm emerald-themes compizconfig-backend-gconf fusion-icon-gtk \
    emerald compiz-fusion compiz-fusion-gnome libcompizconfig compiz-gnome \
    compiz-bcop compiz compizconfig-python compiz-fusion-extras \
    compiz-fusion-extras-gnome
  4. Added a Startup Program in Gnome to auto-start Compiz at login.
    1. Select System > Preferences > Personal > Sessions.
    2. Click Add.
    3. Enter fusion-icon for command.
    4. Enter a name and comment as you prefer. My comment was Compiz Fusion panel applet .
  5. Logged off and logged back in.
  6. Configured my preferences by selecting System > Preferences > Look and Feel > CompizConfig Settings Manager.

Linux , ,

Tab Completion of SSH Hosts

August 28th, 2009

I was tired of having to type full hostnames every time I wanted to SSH to a computer I commonly use. So, I setup tab completion for hostnames when I use SSH or SCP. The process involved only 3 simple steps.

  1. Create a file .hosts in your home directory. In the file, put the hostnames of computers you commonly connect to, one per line.
    Example .hosts file:

    subdomain.domain.com
    computer.domain.com
  2. Add three lines to your .bashrc file:
    HOSTFILE=~/.hosts
    complete -f -A hostname scp
    complete -A hostname ssh
  3. Enter the command
    source ~/.bashrc

    to reload your settings.

Linux , ,

Playing DVDs on Fedora 10

August 24th, 2009

To setup my Fedora 10 box to play DVDs, I followed the instructions at http://www.fedorafaq.org/#dvd. The key is to have the following packages installed: libdvdcss, libdvdnav, totem-xine, xine-lib-extras-freeworld. I prefer to use xine directly, so I didn’t execute the totem-backend command; instead, I launch xine from the command line.

Linux ,