Wednesday, May 13, 2009

Chicken Coop Webcast: The Details

Today I set up a webcam in the chicken coop in order to do a ustream broadcast. If you want to watch it, you can click here. The challenges were numerous, the first among them is that chickens poop on things, and I didn't want my computer equipment pooped on. Luckily, I have a small Dell computer that just so happens to fit wedged into the wall where the chickens aren't able to roost.
The chicks and ducklings are located in a fenced-off area below the nests. There was already an extension cord to the coop so that the chicks and ducklings can have a heat lamp, so all I had to do for power was add a power strip, and I was good to go.
The webcam is located in the corner of the fenced-off area, optimally positioned so that it can see the chicks and ducklings when they are most active, which is during the day. During the night, they tend to cluster beneath the heat lamp, which puts them on the edge or slightly out of view, but I think the viewing angle is the best overall.
Update: I have since pointed the webcam at the spot under the heat lamp, as it turns out most of the time there are birds there.
I brought the monitor in for configuration only. I didn't want to leave in in there and get pooped on, plus it would be in the way. I have a hand-held trackball instead of a mouse, since the surfaces in the coop are... less than ideal for mouse use. The mouse is also a configuration-only item.
The trickiest part of this whole thing is getting an Internet connection in the coop. Actually, it wasn't that hard, once I figured out which equipment was best to use. The Dell is running Windows 2000 Pro, since that's the license sticker that came on the case when I picked it up at the surplus store. Windows 2000 doesn't natively support wireless networking. It will work, but it treats it like regular Ethernet, with a separate configuration app. Anyway my router is in WPA mode, and neither of the two wireless PCI cards I had supported it in Win2k (at least not with the drivers I had), so I went with my other option (besides running a cable to the coop--which would be doable, but require a purchase): a wireless networking bridge.
A few years back I picked up this pair of little black boxes on Woot, and they've come in pretty handy. They're supposed to have a range of 300 feet, and I have no reason do doubt it. Currently, I'm using them at about 75 feet, and they're doing just fine. The stream is live, of course, so if the chicklings are being boring, or you're reading this later on, after they're grown and the stream is gone or of something else, you won't get to see the result on the live stream. Therefore, I will post the following video, which I recorded as I was doing some final tweaks to the webcam setup, and saved it for posterity:
The voice you hear at the beginning is mine. I'm on my cell phone with my wife, who is in the house letting me know that the sound is working.

Thursday, May 07, 2009

Software To Install On A Windows Box

With the Windows 7 release candidate out, I recently wiped my laptop's hard drive clean and installed it (I was previously running beta 2). Whenever I flatten a computer and re-install everything fresh, I like to have a list of things to install that covers the bases.

I put together a bookmarks folder of software to install on a new Windows box, and I decided to share it with the world, so here it is:
The nice thing about sharing it in this way is that I can keep it up-to-date in my browser if there is anything to add or remove, or if any of the links change.

Enjoy.

Wednesday, May 06, 2009

If You're Not A Gentoo User, Move Along...

Whenever I spend time sifting through Internet forums looking for the solution to a technical problem, I like to post a description of the problem along with the solution in a straightforward manner, so that the next person who has the same problem will be able to find my post when they search. This is one such posts. I ran into a frustrating error when updating the software on a Gentoo Linux system that hadn't been updated in a while. I started with:
emerge --sync && emerge -avuDN world
And when that was (finally) done, I ran:
emerge -av --depclean
Which uninstalled a bunch of packages. The problem came when I ran:
revdep-rebuild -- -av
Nothing would emerge. Nothing. Every package I tried to emerge would end in the error:
configure: error: C compiler cannot create executables
The root problem turned out to be a bug with the way that the gcc ebuild updates from certain versions. Portage was configured to use a compiler version that no longer existed on the system. The solution was to run:
binutils-config -l binutils-config num gcc-config -l gcc-config num
Where num above is the numerical selection of one of the items on the list output by the previous command. My gcc-config selection told me when I selected it that it had a bug with GCC_SPECS and to re-emerge it, so I did that. I probably didn't have to, but it's good to be cautious and I had a few hours to kill (this is a 1GHz Pentium III system). After that, I was good to go.

Saturday, May 02, 2009

Ubuntu

Finally, a Linux-related post! I just installed Ubutu Linux (9.04 "Jaunty Jackalope", if you must know) on one of my computers. I'd done it once before, but it was on a partition on my main server athena, so it didn't get much face time (since I would have had to reboot it, and it would be downtime for the main install). The install was really easy. I complicated things by customizing my partition table to leave room for another install, but novices don't need to do that, so it doesn't count. Trouble came when I tried to see what software was available: Add/Remove threw an error, and the commands that it recommended I enter didn't work. It was easy enough to search and find a solution that worked (which was here). Overall, I would say that it was a smashing success. I was a bit disappointed that I had to manually install the ssh server, but I guess it comes with the territory. I couldn't find openssh-server with the GUI, so I did it from the command line. I'm still not sure if it's going to load on startup, and I suppose I need to figure out how to access non-standard software repositories, but I'll leave that for a later time.

Monday, April 13, 2009

That's What She sed

Lately, I've been uploading pictures to Twitter from my phone using TwitPic. Basically, you send them to a TwitPic e-mail address via multimedia messaging, and they are automatically posted to your Twitter account, along with the text from the subject. This all works quite well, and they even supply an RSS feed of your pictures, which you can take and (among other thing) put on your blog's sidebar. The problem was, when I put it in my blog sidebar, there was no thumbnail image. Other feeds that had images in them would have thumbnails, but not this one. This one just had a text link to the picture page. I found that disappointing. So I examined feeds that showed thumbnails and the TwitPic feed to see what the difference was. Feeds that contained images within the feed content showed up in the Blogger widget with a thumbnail. But the TwitPic feed showed images. What was the difference? The difference turned out to be CDATA. CDATA is a way to tell a feed reader, "Don't try to decipher my contents, just pass them along and leave the rendering to the end user application." It so happens that TwitPic's thumbnail images are within a CDATA block, and Blogger obediently ignores the CDATA contents when looking for images to display as a thumbnail. So, how do I fix that? I need to read the feed, and for each item, locate the line that contains the thumbnail URL, and create a new attribute containing the thumbnail in a format that is decipherable to Blogger's widget. Using my digg feed as a model, I figured out what the end result should look like, but how to achieve it? First, I tried Yahoo Pipes. Yahoo has a tool for processing feeds with a number of tools, controlled by a graphical pipe-looking interface. The problem is, none of the tools that I could find would add an attribute based on the transformed contents of another attribute. There were widgets that came close, but I couldn't get it to work, so I decided to host the feed myself and modify it using sed. I had never used sed before, except when the exact command was given, so I didn't know how to use it, but I knew that it was a powerful enough tool to get the job done. So I created a shell script on my Linux box, and a cron job to run it. The script basically downloaded the RSS feed from TwitPic to a local file, and then called sed on it with a particular set of parameters designed to extract the necessary information, and add the appropriate information in a format that is decipherable to Blogger. In order to understand sed, I searched the Internet for a tutorial, and found this page from the Gentoo Linux Documentation to be the most helpful. My sed command does two things, which are piped together:
  1. It adds an xmlns:media declaration, which allows me to use the media tag later on.
  2. It examines each CDATA line with the thumbnail URL, and below it, it adds a line with the media:thumbnail tag and the URL extracted from above.
sed -e 's/<rss version="[^"]*"/& xmlns:media="http:\/\/search.yahoo.com\/mrss\/"/g' $TMP_FILE | sed -e 's/\(http:\/\/twitpic.com\/show\/thumb\/[^"]*\).*/&\n <media:thumbnail url="\1" height="150" width="150" \/>/g' > $FEED_FILE
I know it's possible to consilidate the two sed commands into one and do it in one pass, but this works. I may tweak it in further revisions. It is not necessary to use a yahoo-defined media tag, so I might modify the script later on to simply transform the CDATA portion into parseable encoded HTML. I might also add that I'm using Feedburner to host the feed. Basically, I change the file on my server, and Feedburner goes there to get it, and offers it to the rest of the world. That way if my server is offline, the feed is still active and available, and I don't have to deal with the traffic, just the Feedburner hits. If anyone else wants their TwitPic feed to have thumbnails available, let me know, and I can set one up for you on my server through Feedburner. (It's pretty easy, since the TwitPic username is passed in to the script as a parameter). I can't guarantee anything, but since it's in my interest to keep the script working and up-to-date, you don't have much to worry about. All I need to know is your TwitPic (Twitter) username.
  • Update (2009-04-16): I have modified the code to accept all image formats, and be shorter.