Jay Holler’s Blog

Icon

A technologist living in Philadelphia

New opportunities

Yesterday was the last day of my employment at the Nasdaq Operations Center. It is extremely surreal to no longer be responsible for systems that I have been monitoring for several years. All of a sudden I am no longer responsible for the systems that I helped create and curate. It’s hard not to think about it. However, I have a new opportunity at Twitter to leverage my experience in operations at Nasdaq and I am excited to get started there. I will miss the relationships I have fostered at Nasdaq but its time to move on.

20111223-195339.jpg

Filed under: Uncategorized ,

Band of the Day iOS app

I love music, but since I’ve started a family and been working full time (as opposed to doing mostly nothing and playing in a band years ago) its become harder and harder to discover new music. It’s hard to find the time to sit around and listen to music, and most of the time I was getting recommendations from friends that I lived with, which obviously doesn’t happen anymore. I used to use last.fm as a sort of crude music discovery tool, as they will try to play music that matches your tastes based on your listening habits. That mostly never really worked for me as it was rare that I actually heard a band that I wanted to listen to repeatedly.
Today however I was introduced to a new iOS app called Band of the Day, and I loved it instantly! Each day a band is highlighted and you can read a review, check their bio, see messages from other users of the app, and stream whole songs from recent releases. You can also purchase songs or albums directly through the iTunes store. In a word, for me, it’s perfect. I have a train commute to work each day and now I have a super simple, beautiful music discovery app to help me find new bands. I’m going back now to browse trough past Bands of the Day!

Filed under: Uncategorized ,

iPhone app Waze updated

20111014-051157.jpg

I had tried using Waze earlier this year, and while free turn by turn directions were really nice, my issue was with the voice guides navigation. Gladly, with the latest update the voice navigation in Waze has become much more robust! Previously the only voice input from the app was highly generic like, “turn left”, “bear right”. Now however the app tells you specifically the name of the road you are to turn onto, which greatly improves usability and obviate the need to look at the screen.
The other thing I like about Waze is the social aspect of the app. You can easily and quickly add an alert if you happen upon an accident or construction or some other delay. If enough people use this it could be very useful. Since the app is completely free, why not download it and give it a try?

Filed under: Uncategorized ,

handleMedia.sh: update

I made some changes to make my handleMedia.sh script more generic, removing some duplicate code, etc. Here is the final result. I’m still trying to think of a good way to pare it down even more, I don’t like how ugly all the matching is to figure out if the files are located in the Downloads folder or one or two folders deep.

#!/bin/bash

#/usr/local/bin/handleMedia.sh
#
# Jay Holler 09-24-2011
# Find files in the Downloads directory and move them to
# the appropriate folder on the NFS share or put them in the Dropbox directory for syncing to iTunes.

# Set up some reusable variables
notify=$(/usr/local/bin/prowl.pl -apikey=”/dev/null” -application=”`basename $0`” -event=”Done” -notification=”`cat /tmp/emailmessage.txt`”)
umask 0022

#Function for matching TV shows, assumes SxxExx format and “.” separators
function MOVE_TV_SHOWS() {

storageDir=/home/jholler/TV
cd /home/jholler/Downloads

for myFile in *.$ext; do

shopt -s nocasematch
if [[ "$myFile" =~ ([A-Za-z0-9\.]*)\.(S..E..).*.$ext ]] ; then
File=${BASH_REMATCH[2]}.$ext
PreShowName=${BASH_REMATCH[1]}
ShowName=$(echo $PreShowName | sed ‘s/\./ /g’)
echo “[*] A new episode of $ShowName is ready for your enjoyment: $File” > /tmp/emailmessage.txt && sleep 2
[ -d "$storageDir/$ShowName" ] || mkdir -v “$storageDir/$ShowName”
mv -v $myFile “$storageDir/$ShowName/$ShowName.$File”
$notify
else
echo “[+] $myFile does not appear to be a TV show, pushing it to /home/jholler/Movies on lunchbox” > /tmp/emailmessage.txt
mv -v “$myFile” “/home/jholler/Movies/$myFile”
$notify
fi
done

}

#Function for matching mp3s, typically stored in a folder for the album.
function MOVE_MP3() {

storageDir=/home/jholler/Music/new
cd /home/jholler/Downloads

myFile=$(ls */*.mp3 | head -1)

shopt -s nocasematch
if [[ "$myFile" =~ ([A-Za-z0-9].*)\/([A-Za-z0-9].*).mp3 ]] ; then
AlbumName=${BASH_REMATCH[1]}
[ -d "$storageDir/$AlbumName" ] || mkdir -v “$storageDir/$AlbumName”
mv -v “$AlbumName” “$storageDir/”
echo “[*] The album $AlbumName is now ready for your enjoyment” > /tmp/emailmessage.txt && sleep 2
$notify
else
echo “[+] $myFile does not appear to consist of mp3 files, please investigate” > /tmp/emailmessage.txt
$notify
fi

shopt -u nocasematch

}

###############################################
## Start the avi matching portion of the script
## If for some reason the file is located in a folder or several folders deep, find it and put it in the Downloads directory for further manipulation.
###############################################
cd /home/jholler/Downloads
ls *.avi 2> /dev/null | wc -l && ext=avi; MOVE_TV_SHOWS
ls */*.avi 2> /dev/null | wc -l && mv */*.avi /home/jholler/Downloads; ext=avi; MOVE_TV_SHOWS
ls Movies/*/*.avi 2> /dev/null | wc -l && mv Movies/*/*.avi /home/jholler/Downloads; ext=avi; MOVE_TV_SHOWS
ls TV/*.avi 2> /dev/null | wc -l && mv TV/*.avi /home/jholler/Downloads; ext=avi; MOVE_TV_SHOWS
ls TV/*/*.avi 2> /dev/null | wc -l && mv TV/*/*.avi /home/jholler/Downloads; ext=avi; MOVE_TV_SHOWS
#########################################
## End avi matching portion of the script
#########################################
###############################################
## Start the mkv matching portion of the script
## If for some reason the file is located in a folder or several folders deep, find it and put it in the Downloads directory for further manipulation.
###############################################
ls *.mkv i 2> /dev/null | wc -l && ext=mkv; MOVE_TV_SHOWS
ls */*.mkv 2> /dev/null | wc -l && mv */*.mkv /home/jholler/Downloads; ext=mkv; MOVE_TV_SHOWS
ls */*/*.mkv 2> /dev/null | wc -l && mv */*/*.mkv /home/jholler/Downloads; ext=mkv; MOVE_TV_SHOWS
ls Movies/*/*.mkv 2> /dev/null | wc -l && mv Movies/*/*.mkv /home/jholler/Downloads; ext=mkv; MOVE_TV_SHOWS
ls TV/*.mkv 2> /dev/null | wc -l && mv TV/*.mkv /home/jholler/Downloads; ext=mkv; MOVE_TV_SHOWS
ls TV/*/*.mkv 2> /dev/null | wc -l && mv TV/*/*.mkv /home/jholler/Downloads; ext=mkv; MOVE_TV_SHOWS
#########################################
## End mkv matching portion of the script
#########################################
###########################################
## Begin mp3 matching portion of the script
###########################################
MOVE_MP3
#########################################
## End mp3 matching portion of the script
#########################################
exit 0

Filed under: Linux, Media

MythTV

I have decided to take my nice new core quad PC and turn it into a Linux based DVR using Mythbuntu. I ordered a HVR-1600 card to record both HD and SD independently. Anna is looking forward to it greatly, as when we had an old PC serving this duty in the past it was the ultimate TV machine to her. Mostly this is because she sometimes ends up late to see a show while it is in, so now she won’t miss stuff or have to wait for it to download the next day. I am excited to have a great new project to tackle. Looking forward to seeing how much better MythTV is in the last three years.

Filed under: Uncategorized ,

Air Video Server running on a Windows XP Guest OS in virtualbox on Ubuntu Linux

For years I have been trying to find a way to easily and elegantly stream video to multiple small devices in our home. We only have one TV, and not everyone wants to watch the same thing at the same time. This really isn’t the worst problem in the world, obviously, but something I have tried to solve using all manner of different software and hardware combinations. A few weeks ago I discovered an iPhone application that required a server application running on either WIndows or Mac OS X. I tried to install the Windows version on my Ubuntu box running under Wine, but the application would crash as soon as the iPhone app tried to read a file from the hard drive. As they say, Wine Is Not an Emulator, and in this capacity it wasn’t going to cut it. I also checked the forums for the iPhone app developers who provide the PC app, and they had no intention of making a Linux version available anytime soon. So, I did what any self respecting geek would do presented with a solution which could potentially work, made it more complicated.
I first went through the process of building a new virtual machine in VirtualBox to host the Windows XP machine. That was quick and easy, and I happened to have an old XP disc lying around which isn’t in use on any computer anymore, since I haven’t used Windows at home since about 2004. The most challenging part was getting the Windows XP Guest OS to join the same network as the rest of the machines on my internal LAN, because virtual machines create a software interface and the actual packets are actually coming in through the same physical NIC card on the Linux machine. Fortunately, not too much googling later provided me with exactly the solution I was looking for. After installing these two utilities and running the script, provided at this blog, I was able to make the WIndows XP Guest OS join the 192.168.1.0 network! Perfect.
Now, all I had to do was install Bonjour from Apple, the Air Video Server application provided at inmethod.com and start it up.

I had to share the local Linux directory that stores all of our media, and set that up through VirtualBox, but that was relatively painless, requiring only that I get the VirtualBoxGuestAdditions.iso and use that on the Windows XP Guest OS so that it would recognize the shared folders and I could mount them permanently.

Once it was all good to go, I just added the /storage directory (which I mounted under Windows as Z:/ using the command “net use z: \\vboxsvr\storage”) to the shared directories in the Air Video Server app.

Here’s a screenshot of what this all looked like on the Windows XP Guest OS:

Air Video running in a Windows XP Guest OS

Air Video running in a Windows XP Guest OS

Now it was time to fire up the iPhone application and test all this juicy new streaming goodness!

I had been messing with this most of the night so the app had already detected the Windows instance of Air Video Server using Bonjour, which is why I had to install it on the Windows XP Guest OS:

AirVideo app Servers

AirVideo app Servers

Once you tap on the servername, the next screen shows you available shares:

AirVideo app available shares

AirVideo app available shares

Tapping on the Z:/ drive I made available shows me the directories and files located there, including a count of folders and files next to the folder names:

AirVideo app directories list

AirVideo app directories list

Drilling down into the TV directory shows me the same thing, folders and the number of files/folders in each directory:

AirVideo showing the TV directory

AirVideo showing the TV directory

Here I have selected the Bored to Death directory, and you can see that the app grabs screenshots as well as displaying some pertinent file information for each file found, very nice:

AirVideo app Bored to Death

AirVideo app Bored to Death

After selecting a particular file, I am presented with a few different options. Since this file is an xvid encoded avi, the app won’t be able to play the file natively. Air Video Server will take care of transcoding the file on the fly so that the iPhone app can play it:

AirVideo app avi file options

AirVideo app avi file options

Now comes the good stuff, after selecting “Play with Live Conversion”, I am presented with the option to play from the previously played position, the beginning, or seek to a new position, very slick indeed:

AirVideo app Live Conversion options

AirVideo app Live Conversion options

After making my choice: “The Beginning”, the app begins the process of buffering the video to the iPhone app:

AirVideo app Preparing Video

AirVideo app Preparing Video

Now, I suspect that because I’m running Air Video Server inside Windows XP running as a guest OS inside VirtualBox on a Linux host on a older desktop machine, the app complains that it doesn’t have the power to actually play the file, but all is not lost:

AirVideo app lies to me

AirVideo app lies to me

I just tell the app to continue anyway, and I was able to play the entire show without interruption:

AirVideo app buffering video

AirVideo app buffering video

And boom, about 5-10 seconds later, my TV show begins playing in perfect stutter-free fashion:

AirVideo app playing Bored to Death S01E01.avi

AirVideo app playing Bored to Death S01E01.avi

Tapping on the screen while the video is streaming brings up controls, in this case a little different than playing an x264 encoded file because the Air Video Server app is transcoding on the fly:

AirVideo app streaming converted file controls

AirVideo app streaming converted file controls

If I wanted to seek to a different position, the app handles that too, which is pretty nice to have, although honestly I usually just watch a show straight through:

AirVideo app live conversion seek menu

AirVideo app live conversion seek menu

All in all this app kicks total ass! I can now stream to any and all of the three iPhones in our house running from a single instance on a Windows XP Guest OS on my Linux box! The app works so well and I couldn’t be more pleased to be able to have this ability, which means I can now watch stuff while lying in bed without using a laptop, which is very nice indeed.

Filed under: iPhone, Linux, Media

handleMedia.sh

Being partially incapacitated has given me the opportunity to make some tweaks to my personal scripts which deal with all the incoming media formats I pull in using SABnzbd on my Linux box. For a long time I have been using separate scripts to deal with different files types, and I finally decided to make one script that automatically chooses which actions to take based on the file type found in the Downloads folder that SABnzbd dumps its content into. Without further ado, here is the new master script!

#!/bin/bash

#/usr/local/bin/handleMedia.sh
#
# Jay Holler 09-10-2009
# Find files in the Downloads directory and move them to
# the appropriate folder on the NFS share or put them in the Dropbox directory for syncing to iTunes.

## Move to the Downloads directory that SABnzbd uses

cd /home/jayholler/Downloads

###############################################
## Start the avi matching portion of the script
###############################################

if [ -e *.avi ] || [ */*.avi ] || [ -e Movies/*.avi ] || [ -e Movies/*/*.avi ]; then

storageDir=/storage/TV

mv */*.avi /home/jayholler/Downloads
mv Movies/*.avi /home/jayholler/Downloads
mv Movies/*/*.avi /home/jayholler/Downloads
mv TV/*/*.avi /home/jayholler/Downloads
mv TV/*.avi /home/jayholler/Downloads

for i in *.avi
do
myFile=”$i”

shopt -s nocasematch
if [[ "$myFile" =~ ([A-Za-z0-9\.]*)\.(S..E..).*.avi ]] ; then
File=${BASH_REMATCH[2]}.avi
PreShowName=${BASH_REMATCH[1]}
ShowName=$(echo $PreShowName | sed ‘s/\./ /g’)
echo “[*] A new episode of $ShowName is ready for your enjoyment: $File” > /tmp/emailmessage.txt && sleep 2
[ -d "$storageDir/$ShowName" ] || mkdir -v “$storageDir/$ShowName”
mv -v $myFile “$storageDir/$ShowName/$File”
ln -s “$storageDir/$ShowName/$File” “/storage/Unwatched/$myFile”
wget http://localhost:XXXXX/web/ushare.cgi?action=refresh -o /dev/null -P /dev/null
mumbles-send -g qu0x “`basename $0`” “`cat /tmp/emailmessage.txt`”
/usr/local/bin/prowl.pl -application=”`basename $0`” -event=”New Show!” -notification=”`cat /tmp/emailmessage.txt`” -priority=1 -apikey=NOTTODAY
/usr/local/bin/email.sh
else
echo “[+] $myFile does not match our TV shows, pushing it to /storage/Movies on lunchbox” > /tmp/emailmessage.txt
mv -v “$myFile” “/storage/Movies/$myFile”
/usr/local/bin/prowl.pl -application=”`basename $0`” -event=”New Movie!” -notification=”`cat /tmp/emailmessage.txt`” -priority=1 -apikey=NOTTODAY
/usr/local/bin/email.sh
fi
shopt -u nocasematch
done

fi

#########################################
## End avi matching portion of the script
#########################################

###########################################
## Begin mp3 matching portion of the script
###########################################

if [ -e *.mp3 ] || [ -e Music/*.mp3 ] || [ -e Music/*/*.mp3 ] ; then
mv */*.mp3 /home/jayholler/Dropbox
mv Music/*.mp3 /home/jayholler/Dropbox
mv Music/*/*.mp3 /home/jayholler/Dropbox
echo “Moved a new album of mp3s to your Dropbox folder!” > /tmp/emailmessage.txt
mumbles-send -g qu0x “`basename $0`” “`cat /tmp/emailmessage.txt`”
/usr/local/bin/prowl.pl -application=”`basename $0`” -event=”New mp3s!” -notification=”`cat /tmp/emailmessage.txt`” -priority=1 -apikey=NOTTODAY
f7f099
fi

#########################################
## End mp3 matching portion of the script
#########################################

###########################################
## Start mkv matching portion of the script
###########################################
if [ -e *.mkv ] ; then
### Transcode 720p H264 mkv files for the Apple TV

if [ -z "$1" ]; then
echo “Usage: `basename $0` filename”
exit 0
fi

# Wait while any other ffmpeg processes are running
while [ -n "$(ps -ef | egrep "ffmpeg|HandBrakeCLI" | grep -v grep)" ];
do
echo -e “\n[$(date +%b\ %d\ %Y:\ %H:%M:%S)]\nFound another instance of HandBrake or ffmpeg running, pausing 5 minutes…”
sleep 300
done

# Get the beginning time from the date cmd.
START=$(date +%D\ %T)

# Email us that the next process has begun
echo -e “About to start transcoding $1 at $START” > /tmp/emailmessage.txt
/usr/local/bin/email.sh

#HandBrakeCLI cmd
HandBrakeCLI -Z “QuickTime” -i “$1″ -o “$1.m4v”

# Get the ending time of the transcode process from the date cmd.
END=$(date +%D\ %T)

# Inform us with an email that transcoding is completed
echo “Transcoding of $1 was started on $START and completed on $END.” > /tmp/emailmessage.txt
/usr/local/bin/prowl.pl -application=”`basename $0`” -event=”Transcoding Complete” -notification=”`cat /tmp/emailmessage.txt`” -priority=1 -apikey=NOTTODAY

# Move the original mkv file to the backup at /mkvs
mv -v “$1″ /mkvs

# Chop off the .mkv from the file name
transcodedFile=`echo “$1.m4v” | sed -e ‘s/\.mkv//’`
mv “$1.m4v” “$transcodedFile”

# Determine the appropriate place to move the file and do so
/usr/local/bin/moveMp4s.sh “$transcodedFile”
fi

#########################################
## End mkv matching portion of the script
#########################################

exit 0

Filed under: Uncategorized

Catheter: miracle of modern science

Catheter.mp3

Filed under: Uncategorized

iCacti for iPhone ties into running cacti instances

I recently started setting up all kinds of different monitoring and alerting systems on my own Linux box I keep at home for media storage and as a playground/lab. About a week ago I installed cacti and started setting up all kinds of graphs and pollers to hit my localhost as well as the router which spans our internal and external networks. It was simple, and I started to think about how great it is going to be to have all this data logged so I can refer to the data at a later date. Of course, being the iPhone app junkie that I am, I went out looking for an iPhone app that ties into my running cacti instance, and that is exactly what I found.
iCacti only requires that you can supply a URL, username, and password to log into your own instance of cacti running somewhere either in your internal network or over the internet. Setting things up took about 10 seconds. I ran into a problem where the data wasn’t being read from my cacti server, but I worked with the developer Várkonyi Balázs through email and we were able to get everything working. To reward me for helping him get it working with my older version of cacti, he sent me a pre-release copy of the hotfix he sent to Apple. Now, some screenshots.

List of currently configured graphs for my cacti instance


LocalHost Load Average

LocalHost Load Average in landscape

You can also change the length of time that the graph displays, or refresh the graph you are currently viewing. The thing I like the most about this is that it uses existing technologies rather than making you have to run another open port in order to feed the app. It even supports SSL connections to your webserver of choice.

The app runs smoothly and provides the data I need in a beautiful little app. Well worth the $1.99!

Check it out: iCacti iTunes Link

Filed under: iPhone, Linux, Review

Done with Jailbreaking

I am giving up on jailbreaking my iPhone. It takes too much effort, the phone becomes too buggy, and I ultimately don’t need to do anything that jailbreaking provides for me. Yes, it is really awesome to have an app on my phone that automatically scrobbles all music or podcasts that I listen to in the iPod app up to my last.fm account, but totally not necessary. Yes, it is totally badass to be able to discriminately choose which apps will run in the background, but also not entirely necessary. The last straw was when I decided to remove WinterBoard, which is an application that lets you change interface elements such as icons, background images on the home screen and much more. I had decided to remove it because I wanted to speed my phone back up, it does take some resources to run, and I wanted those resources back. Well, after uninstalling WinterBoard I had to reboot my device because the application puts some really deep hooks into the system. It never turned back on. It would try, the Apple logo would appear and the phone stayed in that state for a minute or two, but then it just went dark. Subsequent attempts to start the phone just ended in frustration. I ultimately had to do a full restore to factory settings in order to recover my device. I will be sad to lose the additional functionality, most especially StatusNotifier, which places small icons that look like they were designed by Apple themselves in your taskbar for missed calls, emails, text messages, and IMs. I can’t have my phone running unstable software though, as it’s a pretty important communication device to me, especially since my wife and I don’t use a landline at all in our apartment. This also isn’t the first time that I have run into issues with a jailbroken iPhone. A few months ago I had filmed a short video clip, attempted to upload that video to youtube, and then my phone went into total brick mode. In this instance I was left having to do a full restore, just as was the case today.
Android is starting to look better and better, although I know that platform isn’t without it’s flaws as well, but at least they have a kickass notification system built in without having to hack anything.

Filed under: iPhone

Follow

Get every new post delivered to your Inbox.

Join 133 other followers