My ongoing experiences with Ubuntu, and later Mythbuntu, as a media center with MythTV. I'm also using the system for a virtual machine server, a mediawiki server and a general all around home infrastructure base.

Saturday, September 8, 2007

Updating MythTV to use Schedules Direct

I needed to upgrade to MythTV 0.20.2 to use Schedules Direct. I started by following the directions in http://ubuntuforums.org/showthread.php?t=536555 to upgrade.

Then to use Schedules Direct I following the directions at
http://www.mythtv.org/pipermail/mythtv-users/2007-August/191369.html , with my annotations as sub-bullets:
  1. Go to Schedules Direct and create lineups from the identical provider with the identical set of channels as your existing labs account. [Hint: if you see channels you would like to add or delete, keep them the same for now and fix those problems after converting].
  2. Shutdown all myth processes.
    1. Exit the frontend.
    2. Execute:
      /etc/init.d/mythtv-backend stop
  3. Backup your mysql database as described in the HOWTO.
    1. Execute:
      mysqldump -u mythtv -pmythtv mythconverg -c > mythtv_backup.sql
  4. Run mythtv-setup. Select your existing video sources to change the grabber and login info, "Retrieve Lineups", select the corresponding lineup name then "Finish".
  5. Run mythfilldatabase checking the log to see that things worked correctly.
  6. Restart myth processes.
    1. I just rebooted.

Sunday, August 12, 2007

Upgrading to Ubuntu 7.04 'Feisty Fawn'

Time to bite the bullet today and upgrade the ubuntu box. So I logged out from the mythv account and logged into my admin account and used the package updater. The first thing it did was tell be it was disabling some third party sources. Then it did some checking and told me it planned to remove 16 packages, install 128 new ones and upgrade 994.

After consenting to that it started the upgrade, which it estimated would take about 30 minutes - it reality it took about an hour. Some things that I was asked during the upgrade:
  • It asked about replacing customized /etc/logins.def - I looked at the diff and saw no changes that that warranted keeping the current version, so I told it to go ahead.
  • Which services should be restarted to use new linssl libraries, I responded with the default which was "ssh".
  • It asked about replacing /etc/mysql/my.cnf - the only change that looked relevant was the "bind-address = 127.0.0.1" line, so I told it go ahead.
  • It asked about replacing /etc/modprobe.d/aliases - the only difference appeared to be a line of the form "alias char-major-10-187 irnet" - I told it go ahead.
  • It asked about replacing /etc/avahi/avahi-daemon.conf - the only difference appeared to be the line "enable-dbus=yes" - I told it to go ahead.
  • It asked about replacing /etc/cups/cupsd.conf - the changes appeared minor and since I no longer have the printer connected I told it go ahead
  • The upgrade failed trying to install install libxml-sax-perl - "subprocess post-installation script returned error exit status 255". This resulted in failures in libxml-simple-perl, xmltv-util, xmltv-gui, xmltv and mythvideo. More below.
  • It asked about replacing /etc/ntp.conf - no differences that mattered to me so I told it to go ahead.
At this point everything hung and I power-cycled. It came back up into mythtv and tried to start it. I canceled that, logged out, and logged back in as an admin. I ran the Update Manager and it did a Partial Upgrade - this failed on the libxml-sax-perl module again.

I rebooted. It tried to start up mythtv automatically but complained the autologin user (which is what is used to automatically log into the mythtv account) wasn't a member of the mythtv group. So I logged in as admin and added autologin to the mythtv group.

At this point mythtv seems to be running fine, but the remote isn't working. I re-installed lirc as described here and that solved that problem.

Back to the libxml-sax-perl module, poking around revealed the source of the problem - I actually had three versions of SAX.pm. The one in /usr/share/perl5 seems to have the required bebian method, but all attempts to get the install to use it crapped out for one reason or another. So rather painfully I ended up uninstalling libxml2 and then reinstalling everything that depending on it. Painful and I'm sure there has got to be a better way.

Lastly, apt-get was giving me the following message:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libmpich1.0c2 libopenexr2c2a mythmusic libarts1c2a libzzip-0-12 kdelibs4c2a
libfaad2-0 python2.4-dev apache2-utils mythphone mythbrowser tetex-base
fftw2 kdelibs-data mythdvd libapr0 liblualib50 mythgallery libwavpack0
gcc-3.4-base mythgame libossp-uuid13 libsvn0 tetex-bin mythflix
librpcsecgss2 libt1-5 libavahi-qt3-1 mythcontrols php4-common netpbm
libcdaudio1 libnetpbm10 mythweather liblua50 libg2c0 mythnews tex-common
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
So I ran 'apt-get autoremove' to correct.
Hmmm, at this point everything seems to be working except for httpd and all of its services (MythWeb, the wiki, etc). Poking around I quickly figured out Apache wasn't installed. So re-installing that came first:
#apt-get install apache2
When asked if I wanted to keep my current configuration file, I answered yes. At this point httpd was running and working, but my wiki, MythTV and phpadmin weren't. Next step was installing php and phymyadmin

#apt-get install php5
...
# apt-get install phpmyadmin

PHPMyAdmin working at this point at http://my.host.name/phpmyadmin/, so I turned my attention to installing MythWeb:
# apt-get install mythweb
Mythweb was now working at http://my.host.name/mythweb/
Back to installing mediawiki:
# apt-get install mediawiki
This installed version 1.7, but it still wasn't working. Looks like I had two installs (mediawiki and mediawiki1.7)? So I removed one:
# rm /etc/apache2/conf.d/mediawiki.conf
And restarted apache:
# /etc/init.d/apache2 restart
That did it. Browsing to http://my.host.name/mediawiki/index.php/Main_Page resulted in a setup menu and a link to configure. I ran through the configuration -

And moved that configuration into place:
# mv /var/lib/mediawiki1.7/config/LocalSettings.php /var/lib/mediawiki1.7/LocalSettings.php
Now the only thing left was to re-secure the wiki.


Sunday, July 8, 2007

Updating Guide information

I let my zap2it subscription lapse and then my MythTV PC was off for a few days (power glitch while I was traveling) and I noticed that it was completely out of guide information. So I started by renewing my zap2it subscription (and noticed that after September 29th, another source would need to be found for guide information).

But still I wasn't getting new guide information after a couple days, so I wondered how to manually pull down new guide information. Poking around the net I found this link which gave the following command:
/usr/bin/mythfilldatabase --no-delete
Which I went ahead and added to the mythv crontab:
crontab -u mythtv -e
0 6 * * * /usr/bin/mythfilldatabase --no-delete --quiet

Monday, May 14, 2007

Adding a second hard drive

I needed some room for backups, so I bought a Western Digital SAA 300 250GB drive. Physically installing it was fairly easy, just took me a minute to find the open SATA plugs on the motherboard (about 2 inches below the two used ones for the primary drive and the DVD drive).

What follows are the steps to then get the drive operational.

First, looks like the drive was found on boot:

root@casey:/dev# dmesg | grep sdb
[17179574.992000] SCSI device sdb: 488397168 512-byte hdwr sectors (250059 MB)
[17179574.992000] sdb: Write Protect is off
[17179574.992000] sdb: Mode Sense: 00 3a 00 00
[17179574.992000] SCSI device sdb: drive cache: write back
[17179575.000000] SCSI device sdb: 488397168 512-byte hdwr sectors (250059 MB)
[17179575.000000] sdb: Write Protect is off
[17179575.000000] sdb: Mode Sense: 00 3a 00 00
[17179575.000000] SCSI device sdb: drive cache: write back
[17179575.000000] sdb: unknown partition table
[17179575.008000] sd 2:0:0:0: Attached scsi disk sdb
root@casey:/dev# ls -l /dev/sdb
brw-rw---- 1 root disk 8, 16 2007-05-14 20:22 /dev/sdb

Following directions at http://wiki.linuxquestions.org/wiki/Add_a_new_hard_drive, I first ran fdisk to partition the drive (one big partition in this case):

root@casey:/dev# fdisk /dev/sdb

The number of cylinders for this disk is set to 30401.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-30401, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-30401, default 30401):
Using default value 30401

Command (m for help): p

Disk /dev/sdb: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 30401 244196001 83 Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
Looks like that worked, I now have a partition:
root@casey:/dev# ls -l /dev/sdb*
brw-rw---- 1 root disk 8, 16 2007-05-14 20:29 /dev/sdb
brw-rw---- 1 root disk 8, 17 2007-05-14 20:30 /dev/sdb1
Now to format the drive:
root@casey:/dev# mkfs /dev/sdb1
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
30539776 inodes, 61049000 blocks
3052450 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=62914560
1864 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 28 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
Now I made a mount point and mounted the drive:

root@casey:/# mkdir /mnt/backup
root@casey:/# mount /dev/sdb1 /mnt/backup
root@casey:/# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 237517496 215500056 9952264 96% /
varrun 484776 160 484616 1% /var/run
varlock 484776 0 484776 0% /var/lock
procbususb 10240 116 10124 2% /proc/bus/usb
udev 10240 116 10124 2% /dev
devshm 484776 0 484776 0% /dev/shm
lrm 484776 17580 467196 4% /lib/modules/2.6.17-11-generic/volatile
/dev/sdb1 240362656 61464 228091392 1% /mnt/backup
Then added it to /etc/fstab so it gets mounted at boot:
root@casey:/# vi /etc/fstab
grep sdb1 /etc/fstab
/dev/sdb1 /mnt/backup ext2 defaults 0 0
Now I added the names of all the local users I wanted to be able to write to the volume to the backup group (in this case, I'll use the names user1 and user2):
root@casey:/# vi /etc/group
root@casey:/# grep backup /etc/group
backup:x:34:user1,user2
And made the backup directory writable by that group:
root@casey:/# chgrp backup /mnt/backup
root@casey:/# chmod 775 /mnt/backup
Now I added the new volume to the Samba-exported filesystems and restarted the samba deamon:
root@casey:/# cp /etc/samba/smb.conf /tmp/smb.conf
root@casey:/# vi /etc/samba/smb.conf
root@casey:/# diff -c /tmp/smb.conf /etc/samba/smb.conf
*** /tmp/smb.conf 2007-05-14 20:45:49.000000000 -0500
--- /etc/samba/smb.conf 2007-05-14 20:46:44.000000000 -0500
***************
*** 305,307 ****
--- 305,314 ----
browsable = yes
public = yes
writable = yes
+
+ [backup]
+ path = /mnt/backup
+ available = yes
+ browsable = yes
+ public = yes
+ writable = yes
+ valid users = user1 user2
+ guest ok = yes
root@casey:/# /etc/init.d/samba restart
* Stopping Samba daemons...
...done.
* Starting Samba daemons...
...done.
That did it. I could now mount the backup partition on my windows system and write to it.

Sunday, May 6, 2007

Automatic MythTV Front End Start on Boot

So I wanted MythTV to start automatically when the system boots. Here are the steps that causes this to work for me.

Under System / Administration select Login Window. Select Security Tab and click "Enable Automatic Login" and select the username for the account you want to run MythTV from. Click Close.

Then, running as the automatic login user from the first step, under System / Perferences select Sessions. Select the Startup Programs tab. Click Add and enter /usr/bin/mythfrontend. Click Close.

Reboot and you should get logging in automatically and MythTV should fire up.

Friday, May 4, 2007

Ubuntu automatic update

I wanted to set up automatic updating of all of packages, based on the directions at AutoWeeklyUpdateHowTo I did the following:
# apt-get install cron-apt
# vi /etc/cron.daily/auto-update
# cat /etc/cron.daily/auto-update
#!/bin/bash
/usr/sbin/cron-apt
/usr/bin/apt-get dist-upgrade
# chmod 755 /etc/cron.daily/auto-update



[This process has been updated]

A few other MythTV Configuration Settings

To get channel changing working right:
  • Under "Utilities / Setup" / Setup / TV Settings / General (Basic) set "Change channels immediately without select"
  • Under "Utilities / Setup" / Setup / TV Settings / Playback / View Recordings (Recording Groups) unselect "Show 'LiveTV' recordsings when using "All Programs" filter" and make sure "Default group filter to apply" is "All programs"

Tuesday, May 1, 2007

Blootube-wide MythTV Theme

On the avice of a friend, I added the BlooTube-Wide MythTV Theme:

# cd/tmp
# wget http://downloads.mythtvtalk.com/mythtv/themes/blootube-wide.tar.bz2
# wget http://downloads.mythtvtalk.com/mythtv/themes/blootube-osd.tar.bz2
# cd /usr/share/mythtv/themes/
# tar xvjpf /tmp/blootube-wide.tar.bz2 -C /usr/share/mythtv/themes/
# tar xvjpf /tmp/blootube-osd.tar.bz2 -C /usr/share/mythtv/themes

Then enable it under "Utilities/Setup" / Setup / Appearances / Theme by selecting blootube-wide for Theme and then under "Utilities/Setup" / Setup / TV Settings / Playback / On-screen Display by selecting blootube-osd for OSB theme.

Sunday, April 8, 2007

Outputting MythTV to my AV System

My next step was getting my PC hooked up to my AV system (a Denon AVR-3805 connected to a Dell 2300MP projector). I ordered a Sewell VGA to component adaptor, which is working fairly well, with a few caveats, the main one being I've only got it working at 1024x768@75 Hz and normal windows from the PC look like crap honestly, but MythTV looks fine. This is good enough for my purposes but I don't expect to be web browsing through my home entertainment system. Supposedly the adaptor should take 1280x1024@60Hz, but I can't seem to get my PC to output @60Hz no matter what I try, including adding the following to the Monitor section of my /etc/X11/xorg.conf:
# V-freq: 60.00 Hz // h-freq: 63.73 KHz
Modeline "1280x1024" 109.62 1280 1336 1472 1720 1024 1024 1026 1062
One nice plus of the adaptor is that it comes with a cable with a built in VGA splitter so it can drive both my regular LCD monitor and my AV system.

It also comes with a remote, I guess so that if you have to mount it near a projector or some place hard to reach.

But all-in-all I'm very happy and I'm now watching MythTV on my 8-ft projection screen.

The remote is still not working the way I'd like, but that's "to be continued..."

Saturday, March 31, 2007

Ubuntu Video Performance Woes

I had been noticing poor video performance since I first installed Ubuntu (very similar to what clinto describes here), but with MythTV it was really annoying. So it was time to address that.

Looking at the specs for my PC, I saw that I had a Integrated NVIDIA Quadro® NVS 210S Graphics card. But looking at the video card configuration in at /etc/X11/xorig.conf, I saw that my configuration was for a generic video card:
Section "Device"
Identifier "Generic Video Card"
Driver "vesa"
BusID "PCI:0:5:0"
EndSection
So I poked around for how to install NVIDIA drivers and came across the appropriate section in the Ubuntu Guide. I followed the steps to install and configure the drivers:

sudo apt-get install nvidia-glx nvidia-kernel-common
sudo nvidia-xconfig
I tried to restart gdm using /etc/init.d/gdm restart, but then I had no mouse pointer, so I rebooted the system and all seemed fine. Video at this point seemed very smooth and MythTV looked great.

Subsequent directions in the Ubuntu guide talked about configuring XvMC. They seemed to assume that /etc/X11/XvMCConfig didn't exist, but I already had such a file with the following line in it:
libXvMC.so.1
I went ahead and replaced with it with the following (after making sure such a library existed in /usr/lib):
libXvMCNVIDIA_dynamic.so.1
But then:
# xine -V xxmc filename.ts
bash: xine: command not found
So at this point I put XvMC on the back burner.

Next thing was get get the X configuration for my monitor right. I found the specification for my Dell E193FP LCD and then ran dpkg-reconfigure xserver-xorg entering the values from the monitor specification.
# dpkg-reconfigure xserver-xorg
Then I rebooted.

At this point all looked great. 1280x1024 resolution (ok, not great but as good as this LCD display was going to get) and video was nice and smooth.

Sunday, March 25, 2007

Securing MythWeb

Ok, in my last post I set up MythWeb. Now to lock it down so that it's not publicly accessible. I basically followed the directions at the KnoppMythWiki, with a couple of twists:
  1. I'm running Apache2
  2. I only locked down MythWeb and not my whole web space.
First I edited /etc/apache2/apache2.conf and added the following (I did it right before UseCanonicalName Off but I don't think it matters):

<Directory /var/www/mythweb>
AuthType Basic
AuthName "BasicAuth"
AuthUserFile /etc/apache2/basicauth
Require valid-user
</Directory>

Then I created /etc/apache2/basicauth with a mythtv user, setting the password in the process:
# htpasswd -c /etc/apache2/basicauth mythtv
Then I restarted apache and all was good:
# /etc/init.d/apache2 restart

LIRC and Remote working with Ubuntu and MythTV

Next step was setting up the remote. I have the Grey Hauppauge remote with the 4 color buttons at the bottom, model A415-HPG (confirmed via a sticker inside the battery compartment).

I followed the directions on the LIRC_on_Ubuntu_Edgy_Eft page, with the following exceptions:
  • My lirc device was /dev/lirc/0 and not /dev/lirc0
At this point I fired up the lirc deamons and things seemed to be working in that irw reported key presses (although, yes it was reporting "Hauppauge_350" when I have a 250):
$ irw
00000000000017b7 00 Record Hauppauge_350
0000000000001790 00 Vol+ Hauppauge_350
00000000000017b5 00 Play Hauppauge_350
00000000000017b2 00 Rewind Hauppauge_350
00000000000017a4 00 Replay/SkipBackward Hauppauge_350
00000000000017a4 01 Replay/SkipBackward Hauppauge_350
0000000000001790 00 Vol+ Hauppauge_350
But it still wasn't working with MythTV at this point.

So I poked around on the following sites:
I didn't seem to have lirc support build into MythTV ("native LIRC support"), at least creating a ~mythtv/.mythtv/lircrc file didn't do anything (as described here). I'm not sure how you determine this for certain.

I also didn't have irxevent installed. I figured out I had to install the lirc-x package to get irxevent:
# apt-get install !$
# which irxevent
/usr/bin/irxevent
I then created ~/.lircrc from http://gentoo-wiki.com/HOWTO_Setup_MythTV/Hauppauge_lircrc

Update 4/20/2007:
Looks like adding irxevent to my ~/.xinitrc file doesn't work with Gnome. Instead under System/Preferences select Sessions. Then click on the Startup Programs tab, then Add and enter irxevent --daemon. Then Close.

Back to original text...

At this point I could run irxevent and I could see that IR events were being translated into keystrokes for my Terminal window. I fired up MythFrontend and things sorta worked. By that I mean the arrow keys didn't work for the opening menu and once I started watching TV things worked after I hit enter on the keyboard once. Not ideal.

So after some editing to my .lircrc file it looks like the following. It's working fairly well, but changing channels is still clunky. It seems like I have to hit enter after channel up/down to make the change take effect. I suspect some problem with MythTV since I see the same issue with hitting the up/down keys on the keyboard.

begin
prog = irxevent
button = UP
repeat = 3
config = Key Up CurrentWindow
end
begin
prog = irxevent
button = DOWN
repeat = 3
config = Key Down CurrentWindow
end
begin
prog = irxevent
button = LEFT
repeat = 3
config = Key Left CurrentWindow
end
begin
prog = irxevent
button = RIGHT
repeat = 3
config = Key Right CurrentWindow
end
begin
prog = irxevent
button = OK
repeat = 3
config = Key Return CurrentWindow
end
begin
prog = irxevent
button = CH+
repeat = 3
config = Key Up CurrentWindow
end
begin
prog = irxevent
button = CH-
repeat = 3
config = Key Down CurrentWindow
end
begin
prog = irxevent
button = MENU
repeat = 3
config = Key Return CurrentWindow
end
begin
prog = irxevent
button = RECORD
repeat = 3
config = Key Return CurrentWindow
end
begin
prog = irxevent
button = RED
repeat = 3
config = Key X CurrentWindow
end
begin
prog = irxevent
button = GREEN
repeat = 3
config = Key I CurrentWindow
end
begin
prog = irxevent
button = YELLOW
repeat = 3
config = Key bracketleft CurrentWindow
end
begin
prog = irxevent
button = BLUE
repeat = 3
config = Key bracketright CurrentWindow
end
begin
prog = irxevent
button = BLANK
repeat = 3
config = Key D CurrentWindow
end
begin
prog = irxevent
button = VOL-
repeat = 3
config = Key Left CurrentWindow
end
begin
prog = irxevent
button = REV
repeat = 3
config = Key Left CurrentWindow
end
begin
prog = irxevent
button = PLAY
repeat = 3
config = Key P CurrentWindow
end
begin
prog = irxevent
button = MUTE
repeat = 3
config = Key backslash CurrentWindow
end
begin
prog = irxevent
button = VOL+
repeat = 3
config = Key Right CurrentWindow
end
begin
prog = irxevent
button = FFW
repeat = 3
config = Key Right CurrentWindow
end
begin
prog = irxevent
button = BACK/EXIT
repeat = 3
config = Key Escape CurrentWindow
end
begin
prog = irxevent
button = FULL
repeat = 3
config = Key Escape CurrentWindow
end
begin
prog = irxevent
button = PAUSE
repeat = 3
config = Key P CurrentWindow
end
begin
prog = irxevent
button = 0
config = Key 0 CurrentWindow
end
begin
prog = irxevent
button = 1
config = Key 1 CurrentWindow
end
begin
prog = irxevent
button = 2
config = Key 2 CurrentWindow
end
begin
prog = irxevent
button = 3
config = Key 3 CurrentWindow
end
begin
prog = irxevent
button = 4
config = Key 4 CurrentWindow
end
begin
prog = irxevent
button = 5
config = Key 5 CurrentWindow
end
begin
prog = irxevent
button = 6
config = Key 6 CurrentWindow
end
begin
prog = irxevent
button = 7
config = Key 7 CurrentWindow
end
begin
prog = irxevent
button = 8
config = Key 8 CurrentWindow
end
begin
prog = irxevent
button = 9
config = Key 9 CurrentWindow
end

Saturday, March 24, 2007

MythTV on Ubuntu

My next project was to install my WinTV PVR-250 and MythTV. I followed the directions at the Ubuntu Community Documentation site and specifically the directions for a Backend/Frontend/Desktop install with the exception I was building on a existing Ubuntu install so I skipped most of the initial steps and I started with installing the XFS Utilities:
# apt-get install xfsprogs
Then I set up NTP as specified. I did a "Synchronize Now" before since my clock was 10 minutes off. NTP was not installed, but I selected the auto installaion and all went fine.

For the WinTV-PVR 250 drivers I installed IVTV.

Now I installed MythTV. I skipped the mysql install since I already had it installed when I installed MediaWiki.
# apt-get install mythtv-frontend mythtv-backend mythtv-database
Now set up MythTV following the directions provided. Some details
  • Under Video Source setup, I set the Channel frequency table to "us-cable" since I have cable.
  • Chose the MPEG-2 encoder card (PVR-x50, PVR-500)
  • I registered with Zap2It as specified and got a username and password which I used for MythTV.
I synchronized the channel line up as specified:
# /etc/cron.daily/mythtv-backend
And launched the backend:
# /etc/init.d/mythtv-backend start
Starting MythTV server: mythbackend.
As suggested on the page I installed phpmyadmin:
sudo apt-get install phpmyadmin
And added the channel icons.

And installed the mythplugins. Note I had to restart Apache for the /etc/group change to take effect:
# /etc/init.d/apache2 restart
At this point I could run mythfrontend and everything seemed to be working great except for the remote control, which isn't working at this point. That will be the next post.

Saturday, March 17, 2007

Securing Mediawiki

I noticed that mediawiki was allowing anonymous editing of pages. I wanted to lock it down so that only those I grant accounts to could edit it.

I found the directions here. Which work for the most part, with some tweaks...

I started by restricting the wiki so that users had to be logged in to edit. That went fine.

Then I wanted to give myself sysop privileges. This was more complicated. The big issue is that when I installed mediawiki, I specified a prefix for my mediawiki tables:
$ grep wgDBprefix /etc/mediawiki/LocalSettings.php
$wgDBprefix = "mw_";
So I had to prefiex "mw_" to all the table names on the page. The specific steps were:
  1. First, I had to figure out what version of mediawiki I was running. Fortunately there is a Special:Version page that tells you that.
  2. Now I need to figure out my uid for the 1.4 comments. the best way I found to do that was to log into the mysql database and then issued the following command. From the output I was able to figure out my uid was '2'.
    mysql> SELECT user_id, user_name from mw_user;
  3. Now I could issue the command on the page:
    mysql> UPDATE mw_user_rights SET ur_rights="bureaucrat,sysop" WHERE ur_user=2;
    Query OK, 1 row affected (0.00 sec)
    Rows matched: 1 Changed: 1 Warnings: 0
That did it. I didn't even have to log out and back into the wiki.

Thursday, March 15, 2007

Adding a New Disc to Itunes via Rythmbox/Samba

Itunes is getting music via Samba from Ubuntu. If you import a new CD on the Umbuntu server, you have to import the new folder on the Samba Share under Itunes for it to appear in the library on the Samba client.

To do this select File/Add Folder to Library. Then find the network share and then the specific new folder that the CD was imported into. Yes, if you have a lot of CDs, this will be slow. It should import quickly once you find it and be immediately available under Itunes.

Saturday, March 10, 2007

Installing MediaWiki on Ubuntu

  1. Start by installing MySQL.
    1. I had to use the directions here to set the root password for the mysql DB. Specifically the directions at the bottom of the page for a forgotten root password.
  2. Follow the directions at the following URL to install and configure MediaWiki: http://www.mediawiki.org/wiki/Manual:Running_MediaWiki_on_Ubuntu_GNU/Linux
    1. Note that the current version of MediaWiki has different paths that what are given at the URL

Saturday, February 3, 2007

Samba Sharing from Ubuntu to Itunes

Ok, so I've gotten my music library onto Ubuntu and am sharing it via Samba. Now I want to remove the MP3 files from my Windows laptop and instead get at them via Samba.

My goal here is to be able to continue using Itunes on my Windows laptop to download podcasts and Itunes store purchases (i.e. the dynamic stuff) while keeping the bulk of the static MP3s on the server. And then sync my iPod from the laptop using a combination of the local and remote content. New CD's will be added by ripping them on the Ubuntu server and then being imported on the laptop (I think they will have to be manually added to the iTunes library on each laptop unfortunately).

First, I mount the Samba voume on my windows box. Then I fire up Itunes and delete all the music I copied over to Ubuntu, moving it to the recycle bin in the process. Yes, this takes a little while. (BTW, for reference I have about 8000 MP3s consuming about 40 GB and am using fairly modern machines.)

Now, I make sure that I don't copy the files from Samba to the local disk. I select Edit/Preferences and then select the Advanced tab and make sure "Copy files to iTunes folder when adding to library" is NOT selected. Then click OK.

Now I select File/Add Folder to Library. Then I find the mounted SAMBA folder and select the Music folder and hit OK.

Now go get lunch while it runs. It took roughly 30 minutes to import (after which you can start playing back music) and then another few hours to Process Album Artwork and Determine Gapless Playback Information (during which time iTunes is very sluggish but functional).

Following this I plugged in my iPod and synched. It took a while for the sync to start, I'm assuming iTunes took a while to confirm everything on the iPod matched the "new" MP3s in the iTunes library.

The one weird things I saw during synch, was that my single purchased song off of iTunes became duplicated in my library with the duplicate pointing to a missing file. I deleted this broken duplicate and all seemed well. *Shrug*

Saturday, January 27, 2007

Ubuntu 6.10, Rythmbox and Sound Juicer: Enabling MP3 Ripping

First, a hint about setting up sound. This HowTo is very helpful. The only thing I had to do was double-click on the speaker icon in the upper right and then move the PCM volume up. Until I did that I got no sound output. I found putting the PCM level at about 1/3rd of max worked out about right.

This thread and this help page were useful to figuring this out. Ultimately brian g's post at the end of this thread gave me the right GStreamer encoding stream. What's below is what worked for me taken from all of those postings.
  1. If you haven't already done so, make sure you have gstreamer0.10-plugins-ugly installed:
    sudo apt-get install gstreamer0.10-plugins-ugly

  2. Then do the following install (Thanks to Gordon for confirming it is needed).
    sudo apt-get install gstreamer0.10-plugins-ugly-multiverse

  3. Open Sound Juicer.
  4. Select Edit/Preferences
  5. Click on Edit Profiles
  6. Click on New
  7. Name it "MP3"
  8. Select the new profile, and click on Edit
  9. Set the GStreamer Pipeline to:
    audio/x-raw-int,rate=44100,channels=2 ! lame name=enc vbr=4 vbr-quality=2 ! xingmux ! id3v2mux
  10. Set the File Extension to mp3
  11. Make sure Active? is selected.
  12. Click OK
  13. Close the Audio Profiles window and the Sound Juicer preferences
  14. At this point I couldn't select my newly created profile in Sound Juicer, so I had to...
  15. Close and restart Sound Juicer.
  16. Now select Edit/Preferences again.
  17. For Output Format select your newly created MP3 format.
  18. Close the Preferences pane.
Now if you Extract in Sound Juicer you should end up with MP3 files.

Note: It looks like one should be able to use Rythmbox to rip MP3 directly using its "Copy to library function" but it doesn't work for me. I select Edit/Preferences and then selecting your new MP3 format as the Preferred Format. But then when I try to Copy to library I get the following error:
Error transferring track
no element "xingmux"
Note 2: Apparently these changes will only make MP3 ripping available to the current user. This post has directions for making MP3 ripping available to all users on the system.

Ubuntu 6.10: Getting ITunes to see Rythmbox

My next step was to share music from Rythmbox to ITunes running on the Winsows XP and MacOS laptops. This turned out to be non-obvious.

First, in Rythmbox, click on Edit/Preferences then select the Sharing tab and select Share my music and give it a name of your choosing. I also required a password.

At this point I still couldn't see Rythmbox from ITunes or vice versa.

The next thing to do was to turn on the Avahi daemon. Do this by selecting System/Administration/Networking and then select the General tab and make sure the checkbox for Automatic service discovery is checked.

And then I had to do one more then, which was to enable something called D-Bus. I did this by opening a Terminal and editing /etc/avahi/avahi-daemon.conf

sudo vi /etc/avahi/avahi-daemon.conf

And uncomment the following line:
#enable-dbus=yes
so that it looks like:
enable-dbus=yes
Then restart avahi:

sudo /etc/init.d/avahi-daemon restart

This lets me see Rythmbox from ITunes. I still can't see ITunes from Rythmbox. This post may give the reason why.

Getting Rythmbox to Recognize MP3s

After I copied over my Itunes library to my Ubuntu 6.10 system I was somewhat surprised to find it didn't recognize MP3s. Poking around the net a little turned up this was do to intelletual property issues and there were a number of different fixes posted (for example).

I tried various ones and here's what I think ended up working for me. I say I think because I tried a number and it started working after what I did below. It's possible some of the prior steps I took were important.

First you have to allow your system to download software from universe and mutliverse. Select System/Administration/Software Sources. Make sure "Community maintained Open Source software (universe)" and "Software restricted by copyright or legal issues (multiverse)" are checked. Then click Close.

Then I ran the following command:

sudo apt-get install gstreamer0.10-plugins-ugly

And restarted Rythmbox. After that it recognized MP3 just fine.

Note that it still doesn't seem to be able to rip CDs into MP3s. That's still on the todo list...

For the record, here are some of the other things I found on the net that I tried (after adding universe and multiverse to my software sources), which either didn't work or didn't seem to have any effect:

apt-get install gstreamer0.10-ffmpeg gstreamer0.10-gl gstreamer0.10-plugins-base gstreamer0.10-plugins-good gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse libxine-extracodecs w32codecs

apt-get install gstreamer0.8-mad

apt-get install gstreamer0.8-plugins

apt-get install gstreamer0.10-plugins

Ubuntu 6.10 Print Server with HP PSC 1610

The next step in my process of setting up my Ubuntu server was to connect my HP PSC 1610 printer/scanner to the server and then share it out via Samba to my laptops.

First step, connect the printer to the server via USB.

Second step, make sure the USB cable is actually plugged into the printer. This would have saved me some time later :-)

Add the printer. At this point the printer should work locally. I was also able to scan using XSane (Applications/Graphics/XSane).

The rest of this assumes you have Samba and Cupsd installed. I did by default.

First, I had to edit the cupsd configuration as follows (I use vi as my editor, gedit seems to be what most Ubuntu documentation suggests, but I've learned enough editors already. Replace "vi" with "gedit" if you want).

sudo -s
cd /etc/cups
cp cupsd.conf cupsd.conf.backup
vi cupsd.conf

And change the following lines:
# Only listen for connections from the local machine.
Listen 631
to the following:
# Allow network connections to port 631
Port 631
Then find the following block:

<location>
Order allow, deny
....
</location>
And add the following line into it. If your local subnet address is not 192.168.1.x then replace that appropriately (sorry, you're on your own here, I assume you know your local network configuration):
Allow From 192.168.1.*
Then I restarted cupsd (not sure if this was necessary):

/etc/init.d/cupsys restart

At that point remote printing worked as well. The only real problem is finding a printer driver that works with my PSC1610. Since it's a all-in-one printer/scanner/copier HP doesn't seem to provide a simple print driver. On my windows box I use the driver for the HP DeskJet 1600C which works ok, but not perfectly. If someone knows the right solution to this, please leave a comment.

Ubuntu 6.10 Samba File Sharing

I'm setting up Ubuntu 6.10 (Edgy) on a new PC for use as a general file and MP3 server for a couple Windows XP and MacOS laptops we have. I'm doing this on a Dell n series Optiplex 740, which I mention beause you can order one without windows pre-installed.

As I do this process, I thought I'd share my experiences (and record them so I can remember them) since although Ubuntu is nice, I'm still having to work through a number of non-trivial steps. Hence I created this blog as an experiment to do so. We'll see how it goes...

I'm fairly well versed in Unix and Windows. I'm assuming the reader has some experise, so I'm not going into every little detail, just the stuff I though was non obvious. I strongly recommend the Ubuntu Guide for more information if you're just getting going with Ubuntu.

The first thing I wanted to get going was Samba file sharing so that the various laptops could access server's disk. Starting up Samba turned out to be easy, I selected System/Preferences/Shared Folders and the system informed me I didn't have Samba installed and asked me if I wanted it installed. I replied affirmatively and the install went smooth as silk. I clicked on my home directory (eventually I plan on exporting a number of things, but this works to start with) and Properties. I selected "Windows networks (SMB)" and gave it a share name of my choosing. I unchecked Read only, because I wanted to be able to both read and write from the various laptops.

Back in Shared Folders/General Properties I have MSHOME for a Domain/Workgroup (this seems to be some Windows default name). WINS server was unchecked and the WINS server text field was blank.

Click Close and all seemed well. I was able to see the share from my various laptops, but not able to authenticate to actually mount it. Turns out the way Samba is configured by default, you have to add users to the Samba user database, e.g. launch Applications/Terminal and type:

sudo smbpasswd -L -a username
sudo smbpasswd -L -e username

Replace username with a username of your choosing. It needs to be the same for both commands. In my case the chosen username matched my Unix/Ubuntu username - I think it's ok for the default Samba configure if it doesn't but I haven't tested it yet (see my subsequent notes about smb.conf).

After being asked for the system password, you'll be asked to create a password for the Samba username (this is in response to the first command, the second command just activates the account and doesn't prompt for anything). BTW, I usually don't type sudo for each command, I launch a root shell with "sudo -s", I suspect as I go along I may forget this and leave off sudo.

Then using that username and password I was able to mount the filesystem on my various laptops.

BTW, looking at the /etc/samba/smb.conf file it looks like there are various options to try and keep the Samba and Unix/Ubuntu passwords in sync, including options to force Sambe usernames to have a corresponding Unix username (which seems to be off by default). I haven't played with any at this time and am using the default smb.conf file.