Archive for the 'WILT' 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

Network Connection fails after Windows Update for 64-bit Windows 7 running in Hyper-V 2008 R2

Thursday, October 13th, 2011

I have a number of virtual machines running on a very stable Hyper-V 2008 R2 machine. Yesterday’s reboot of my instances to accomodate Windows Update left only my 64-bit Windows 7 instance without a network connection. No amount of fiddling within the instance could restore it. After much frustration I finally removed the Network Adapter from the shut down instance in the Hyper-V Manager and added a new network interface. Upon booting the instance, it installed new drivers and successfully connected to the network.

Being Open To New Ideas

Saturday, February 12th, 2011

Although not an avid Angry Birds player, my 3yo son is and has told me that the red bird does indeed do something when the screen is tapped. In fact, when he told me what happens, I had a difficult time believing it, even when trying it multiple times myself. But now, it is crystal clear to me.

Turns out my son has found something about Angry Birds that I have not seen anyone else find. Most (if not all) people think when you tap the screen while the red bird is airborne, nothing will happen. That is not entirely correct. The red bird makes a sound similar to “peee-kaaaaa!”

The moral is the obvious one – don’t dismiss an idea because of the messenger or because you think you may know better.

OpenVPN Stops Working on DD-WRT v24 preSP2 (Build13064)

Monday, January 10th, 2011

After struggling for quite some time to discover why the once-working OpenVPN setup on my DD-WRT router suddenly stopped working, I finally realized the configuration was corrupted. I had been issuing a number of iptables commands (inserts and deletes) at the command prompt via ssh prior to the failure, although I do not know if the two are connected.

After disabling the OpenVPN client and rebooting the router, I noticed the Public Client Cert was partially truncated. I pasted the certificates back in, applied changes and rebooted the router and it works again once more.

Port Forwarding / Port Mapping on Windows Server 2008 R2

Saturday, January 8th, 2011

As a long time friend of linux’s itables command, I mistakenly assumed that trying to port forward on Windows Server 2008 R2 would be just as easy. After quite a long while of searching I was able to determine the correct command; through use of netsh on the command line, it is easy to map incoming TCP traffic from one port to another port.

In my scenario, I needed to have an SSL connection initiated on a port other than 443 on the same machine, but handled by a service listening on port 443. To do this, the following command is entered on the command line; in this example, port 12345 is used as the initiating port.

C:\Users\Administrator> netsh interface portproxy add v4tov4 listenport=12345 listenaddress=192.168.1.1 connectport=443 connectaddress=192.168.1.1

Port 12345 is mapped to port 443 on the same machine. To have the traffic transferred to another machine, change the ip address for the connect address to the desired ip address.

stop spam with honeypot!