Showing posts with label fedora 11. Show all posts
Showing posts with label fedora 11. Show all posts

Wednesday, October 21, 2009

Installing all the shit you need on fedora core

So I just built a new fedora box...woot. But the problem is I set it all up by hand which is stupid. So I wrote a script in bash for everything I did, so next time I don't have to. First I did it with bash and then I did it with perl. Make sure, your root if you choose to run these scripts, they should be easy to edit to install what you want, becuase there pretty simple, in the perl one you just need to replace the stuff in @yum_installs. Also run yum update, before you run.(The bash one includes two tar balls, not in the perl one)


RUN AS ROOT
RUN YUM UPDATE FIRST


Bash:


#!/bin/bash
#run as root
#prep
cd /root
mkdir /root/tar
#Necessities for existence/development
yum -y install xchat
yum -y install screen
yum -y install cpan
yum -y install wget
yum -y install PCRE
yum -y install cmake
yum -y install gtk+
yum -y install pygame
yum -y install python-devel
yum -y install cmake
yum -y install cmake-devel
yum -y install liblo
yum -y install liblo-devel
yum -y install gcc-c++-devel
yum -y install cmake-gui
#robotics
yum -y install nxt_python
yum -y install pybluez
#Audio programs setup
yum -y install libsndfile
yum -y install libsndfile-devel
yum -y install qjackctl
yum -y install zynaddsubfx
yum -y install vkeybd
yum -y install qtjack-devel
yum -y install csound
yum -y install csound-devel
yum -y install portmidi
yum -y install rosegarden4
yum -y install jamin
yum -y install jack-audio-connection-kit-devel
yum -y install ctapi-cyberjack-devel
yum -y install zynjacku
yum -y install ardour
#installs of utilities through tar balls
#Yes, you can get nmap through yum, however Fyodor reccommends a source install
#and to be honest, it isn't that hard
cd /root/tar
wget http://nmap.org/dist/nmap-5.00.tar.bz2
tar -xvf nmap-5.00.tar.bz2
cd /root/tar/nmap-5.00
./configure
make
make install
cd /root/tar
wget http://download.gna.org/algoscore/AlgoScore-081112.tar.bz2
tar -xvf AlgoScore-081112.tar.bz2
cd /root/tar/AlgoScore
./make_build



Perl version:


#!/usr/bin/perl
use strict;
use warnings;

my $yum;

my @yum_installs = qw(
xchat screen cpan
wget pcre-devel cmake
gtk+ pygame python-devel
cmake cmake-devel liblo
liblo-devel gcc-c++-devel cmake-gui
libsndfile libsndfile-devel qjackctl
zynaddsubfx vkeybd qtjack-devel
csound csound-devel portmidi
rosegarden4 jamin jack-audio-connection-kit-devel
ctapi-cyberjack-devel zynjacku ardour
nxt_python pybluez
);

&array_cracker();

sub array_cracker(){
foreach(@yum_installs){
print $_;
$yum = `yum -y install $_`;
print $yum;
}
}

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: ./scriptname.sh

Before the script:
su
chmod 777 scriptname.sh


#! /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
</Directory>
EOF
cat <<-EOF >/var/www/html/test/mptest.py
#!/usr/bin/python
from mod_python import apache

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


**caveat**
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.