Pages

Sunday, December 27, 2009

SETUP OF NEW MythBuntu 9.10 x86

Rev D3A Media MediaMVP (non-flash; older)


https://help.ubuntu.com/community/MythTV/MediaMVP_Frontend

http://mvpmc.sourceforge.net/mvpmc-HOWTO-singlehtml.html


Added  before the exit 0 in /etc/rc.local

/usr/sbin/atftpd --daemon --port 16869 --retry-timeout 120 \

--mcast-addr 192.168.1.0-255 --mcast-ttl 2 --verbose=7 /tftpboot

/usr/sbin/atftpd --daemon --port 69


Disabled DHCP on my Cable/DSL router


apt-get install atftpd dhcp3-server xinetd


Added the following to the /etc/dhcp3/dhcpd.conf

INTERFACES="eth0";


option domain-name              "local";

option subnet-mask              255.255.255.0;

option domain-name-servers 192.168.1.1;


allow bootp;

allow booting;


#option ip-forwarding    false;  # No IP forwarding

#option mask-supplier    false;  # Don't respond to ICMP Mask req


subnet 192.168.1.0 netmask 255.255.255.0 {

  option routers        192.168.1.1;

  range 192.168.1.12 192.168.1.25;

}


group {

  next-server 192.168.1.3;          # IP address of your TFTP server


  host mvp1 { # NOTE: Change the hardware ethernet to the MAC address of your actual MVP

           hardware ethernet 00:0d:fe:xx:xx:xx;

           fixed-address 192.168.1.31;

           filename "dongle.bin";

           option root-path "/home/mvp,rsize=4096,wsize=4096,nolock";

  }

  host mvp2 { # NOTE: Change the hardware ethernet to the MAC address of your actual MVP

           hardware ethernet 00:0d:fe:xx:xx:xx;

           fixed-address 192.168.1.32;

           filename "dongle.bin";

           option root-path "/home/mvp,rsize=4096,wsize=4096,nolock";

  }


}


wget http://downloads.sourceforge.net/project/mvpmc/mvpmc/mvpmc-0.3.4/dongle.bin.mvpmc-0.3.4?use_mirror=iweb


dongle.bin.config

export TZ="MST+7MDT"

/bin/ntpclient -s -h us.pool.ntp.org

mkdir /aRecordings

mkdir -p /var/lib/mythtv/old-recordings

mkdir -p /var/lib/mythtv/recordings

mount -t nfs -o nolock,rsize=2048,wsize=2048,nfsvers=3 192.168.1.2:/var/lib/mythtv/link-share /aRecordings

mount -t nfs -o nolock,rsize=2048,wsize=2048,nfsvers=3 192.168.1.2:/var/lib/mythtv/old-recordings /var/lib/mythtv/old-recordings

mount -t nfs -o nolock,rsize=2048,wsize=2048,nfsvers=3 192.168.1.2:/var/lib/mythtv/recordings /var/lib/mythtv/recordings

mvpmc &


Edit /etc/exports on the myth backend; do not forget to run exportfs -ra after you modify the nfs configuration.

 

Mythbuntu-- mysql root password is the password of the account used to setup the mythbuntu install


crontab on root for mythfilldatabase

crontab on mythtv to create symlinks in the link-share folder (see the script in the article: Mythtv Php Script to Create Symlinks with Titles)


Hubzone Businesses

I don't know much about Hubzones, but what I do know is that government contracting officers get huge credits by using hub zone businesses. I did a quick search using the search link below. Looks like there are only about 16 registered hubzone businesses in El Paso country. If I understand things correctly, of the main conditions is the location of the business. You can zoom in on Colorado Springs using the map link below.


Mythtv Php Script to Create Symlinks with Titles

<?php
###
### CREATE Database file to title lookup
###

$link = mysql_connect('localhost', 'mythtv', 'db_password');
if (!$link) {
    die('Could not connect: ' . mysql_error());
}
$db = mysql_select_db("mythconverg",$link);
if (!$db) {
    die ('Can\'t use mythconverg : ' . mysql_error());
}

$titleLookup = array();

$result = mysql_query("select title, basename from recorded");

while ($row = mysql_fetch_array($result)) {
    $title = $row["title"];
    $titleLookup[$row["basename"]] = $title;
}
mysql_free_result($result);

mysql_close($link);

###
### Create symbolic links
###

$srcBaseFolder = "/var/lib/mythtv/recordings/";
$destBaseFolder = "/var/lib/mythtv/link-share/";

if ($handle = opendir($srcBaseFolder)) {

   while (false !== ($file = readdir($handle))) {

      if ( preg_match('/\.mpg$/', $file) ) {
          $src = $srcBaseFolder . $file;
          $destBase = $destBaseFolder . $titleLookup[$file];
          $dest = $destBase . ".mpg";

          $x = 0;
          while( file_exists($dest) ){
              if( basename(readlink($dest)) == basename($src) ){
                  break;
              }
              $dest = $destBase . "-" . ++$x . ".mpg";
          }
    
          if( !file_exists($dest) ){
              symlink( $src, $dest );
          }
       }
   }

   closedir($handle);
}

###
### Remove bad links
###

if ($handle = opendir($destBaseFolder)) {

   while (false !== ($file = readdir($handle))) {

      $file = $destBaseFolder . $file;

      if ( is_link($file) ) {
          if( !file_exists( readlink($file) ) ){
             unlink($file);
          }
      }
   }

   closedir($handle);
}