Saturday, October 3, 2009

Prepping Fedora Core for NXT brick, and Arduino, to be used with pygame and mod_python, in a python environment

If you do a fresh install of Fedora 11, you just need to save this script and run it as root on your machine, once you have saved it with a .sh extenstion, open the terminal, use the command su to become root, then navigate to the directory you have saved it in. Change the permissions, before you try to run it, so it is executable. Run it by typing dot then slash the the script name: ./

Before the script:
chmod 777

#! /bin/bash
yum -y install mod_python
mkdir -p /var/www/html/test
cat <<-EOF >/etc/httpd/conf.d/pythonTwo.conf
<Directory /var/www/html/test>
AddHandler python-program .py
PythonHandler mptest
PythonDebug On
cat <<-EOF >/var/www/html/test/
from mod_python import apache

def handler(req):
req.write("Hello World!")
return apache.OK
yum -y install python-devel
yum -y install git
git clone
cd python-firmata
python install
yum -y install gcc
yum -y install pybluez
yum -y install nxt_python
yum -y install pygame
/usr/sbin/apachectl restart

Be careful where you save it, it will create a directory for the python-firmata in that directory. If you use this right when your machine boots, there is a possibility the yum updater will start using yum, if the script will pause until the updater is finished using yum then continue, or you can run it before you start the script.

No comments: