Archive for the 'OS X' Category

Viewing TV on Mac OSX using an HDHomeRun and Plex

Friday, May 10th, 2013

The original HDHomeRun plug-in for Plex Media Server no longer works on the later versions of Plex and V2 is still in need of work. Thanks to those on the PlexApp forums, especially enduser, I am able to easily generate a quick work-around until the plug-in can be finished.

The work around involves creating .strm files for each of the active channels. I wrote a simple bash script, to run as a user on OSX, to find the HDHomeRun device, determine the channel list, and create a number of .strm files in your ~/Movies folder. Make sure to run this app as the person who will be running Plex.

To view a channel, select Video Channels in Plex, then select Movies, and finally select the channel you wish to view.

Copy the following code to a file on your desktop, create-hdhomerun-strms.sh, and when comfortable with the code within, execute the script in the Terminal app, using

sh create-hdhomerun-strms.sh

#!/bin/sh
CleanUp()
{
  rm -rf $SCAN_FILE
}
TUNER_ID=$(hdhomerun_config discover | awk '{ print $3 }')
SCAN_FILE=/tmp/${TUNER_ID}.log
trap CleanUp 1 2 3 15
read -p "Ready to create .strm files for HDHomeRun Tuner ID $TUNER_ID? " -r
if ! [[ "$REPLY" =~ ^[Yy]$ ]]
then
  exit 1
fi
if ! [ -r $SCAN_FILE ]
then
  echo
  echo Please wait while scanning channels. This may take a few minutes
  echo
  hdhomerun_config $TUNER_ID scan /tuner0 $SCAN_FILE
fi
for IDX in 0
do
  sed -En "
    /^SCANNING: [0-9]/ {
      s/^SCANNING: //
      s/ .*//
      h
    }
    /(encrypted)/ d
    /^PROGRAM [0-9]+: 0/ d
    /^PROGRAM [0-9]+: [0-9]+\.[0-9]+ / {
      s/^PROGRAM ([0-9]+): ([0-9]+\.[0-9]+) ([- A-Z0-9a-z.]+)/hdhomerun:\/\/$TUNER_ID-$IDX\/tuner$IDX \2 \3\?channel=auto:##\&program=\1\&range=/
      G
      s/(.+):##(.+)\n([0-9]+)/\1:\3\2/
      P
    }
  " $SCAN_FILE | while read url
  do
    file=$(echo $url | sed -e 's/.* //' -e 's/\?.*//')
    if [ $IDX -gt 0 ]
    then
      file="$file ($IDX)"
    fi
    file="${file}.strm"
    echo $url > ~/Movies/$file
    echo $file
  done
done

Parallels 6 Prompts To Be Activated With Every Start

Sunday, December 26th, 2010

UPDATE: It appears Parallels changes the group to accessibility and this procedure does NOT work.

Parallels 6 had been running great for quite a while but at some point, restarting Parallels would prompt me to re-enter the activation key; the key in the dialog was from the previous version. For whatever reason, it would not stick.

I realized today that the group permissions on the preferences files for Parallels was different than the others; the files had a group of “accessibility.” To fix it, I changed the group back to what was on most of the other files; your group name most likely will be different.

$ cd /Users/rick/Library/Preferences
$ ls -l com.parallels.*
-rw-------  1 rick  accessibility  21059 Dec 26 19:59 com.parallels.Parallels Desktop Statistics.plist
-rw-------  1 rick  accessibility  23972 Dec 26 19:59 com.parallels.Parallels Desktop.plist
-rw-------  1 rick  accessibility   5430 Dec 26 19:59 com.parallels.Parallels.plist
-rw-------  1 rick  accessibility   1642 Dec  7 16:36 com.parallels.desktop.console.plist
-rw-------  1 rick  rick             905 Feb 11  2009 com.parallels.desktop.plist
-rw-------  1 rick  rick             505 Feb 11  2009 com.parallels.imagetool.plist
$ chgrp rick com.parallels.*

Installing MySQL 5.5 on OS X 10.6 (Snow Leopard) and Rails 3

Thursday, December 16th, 2010

I was successfully able to install MySQL 5.5 on OS X 10.6 according to the following steps.

Download MySQL Community Server 5.5.8 for Mac OS X. I chose to download Mac OS X ver. 10.6 (x86, 64-bit), DMG Archive. The DMG archive is nice as it has a startup package that installs a MySQL control panel (although it dosn’t work from the start without tweaking).

Open the DMG archive and execute the mysql-5.5.8-osx10.6-x86_64.pkg. I had no issues with installation although the ReadMe.txt file suggests that problems may occur.

After successful installation, execute the MySQLStartupItem.pkg. This will install the MySQL Startup startup items. This should complete successfully.

Next, install the MySQL preferences pane by double-clicking the MySQL.prefPane item in the mounted drive. This will install the MySQL preferences item, although MySQL cannot yet be started through it. First, the mysql.server file must be edited by hand to specify the location of the base directory.

At a terminal, cd to /usr/local/mysql/support-files and edit mysql.server (with root privileges, using sudo). Around line 46 locate the lines that read:

basedir=
datadir=

and change them to read

basedir=/usr/local/mysql
datadir=/usr/local/mysql/data

Save the file. MySQL can now be started from the preferences pane. Without it, you will see a message in the Console that reads:

mysql.server: line 256: my_print_defaults: command not found

To enable rails 3 to use mysql, install the mysql2 gem. Next, you’ll need to set the DYLD_LIBRARY_PATH to include the MySQL library directory. To do this, edit your ~/.bash_profile and include the following:

export DYLD_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_LIBRARY_PATH

The rails server will now successfully start. Without the inclusion of the directory in the DYLD_LIBRARY_PATH, a message about not finding the library would appear and the server would abort.

The error message, from the mysql2 gem, states (in part):

Library not loaded: libmysqlclient.16.dylib (LoadError)

Upon reboot, MySQL will fail to start with a dialog stating:

Insecure Startup Item disabled.
“/Library/StartupItems/MySQLCOM” has not been started because it does not have the proper security settings.

The group permissions need to be changed to wheel on the MySQL directory by executing the following command in the terminal:

sudo chown -R root:wheel /Library/StartupItems/MySQLCOM

This will prevents the startup error dialog. Finally, ensure the Automatically Start MySQL Server on Startup is checked in the MySQL preferences window.

Good luck!

This copy of iTunes has expired.

Thursday, July 8th, 2010

Without prior indication, when starting iTunes on OSX 10.6 .4 I suddenly received the error dialog stating “This copy of iTunes has expired.” And Software Update states that all of the software is up to date.

The simple resolution is that a beta version of iTunes 9.2 that I installed did expire (so much for reading the fine print) and a re-installation of iTunes is required. iTunes can be downloaded on the apple site as a dmg file. When opened and the volume is mounted, run the iTunes.mpkg installer to restore the computer to a happy equilibrium. Fortunately, the beta version of iTunes does not need to be removed prior to installation.

Adobe Photoshop CS2 Issues After Full Restore to New Disk

Monday, April 19th, 2010

The disk on my MacBook Pro was going bad – S.M.A.R.T. reported imminent failure. I had Apple swap it out for a new one and I restored the new disk with my backup from Time Machine. Unfortunately, with the archaic way Adobe licenses its products, it was the only software I had purchased that did not work after the restore. After two hours online with Adobe support, I was not able to get much further.

After much trial and error, I determined the only way to get the software activated was to fully remove Photoshop CS2 and reinstall. I followed this technote from Adobe to manually uninstall Photoshop CS2, but it was incomplete. I had to remove a license file and only then could it activate successfully. In addition to the files Adobe asks you to remove, the real magic file that needs removal is /Library/Preferences/Adobe Systems/Product licenses_120/B2B86000.dat. After removing that, along with all the others, I was able to get CS2 installed on my machine and successfully activated.

stop spam with honeypot!