jtolds.com http://www.jtolds.com/ JT Olds' RSS Feed en-us Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License Public Service Announcements: Lessig on the Economy of Influence JT Olds http://www.jtolds.com/newsletter/5/36/ 1217870031 Mon, 4 Aug 2008 11:13:52 +1800 this Lessig essay, and I realized that I thought it was important enough that I should share it.

This goes along with my previous admonitions of things being more important that who the next president is.

If you have a minute, read Lessig's essay. ]]>
Tech: How to get V4L2 devices to work with Flash JT Olds http://www.jtolds.com/newsletter/3/35/ 1217200446 Sun, 27 Jul 2008 18:01:25 +1800 BackgroundRecently, I wanted to get a webcam I have working with TokBox. The allure of TokBox is great, since it's videochatting with no downloadable software, as long as you have Flash set up correctly. Unfortunately, however, Flash currently supports Video4Linux version 1 devices, and most new webcam drivers for Linux are Video4Linux version 2.

As of this writing, Flash 10 Beta 2 is the most recent release of Adobe Flash, and it now has support for V4L2 devices! However, not many devices (help out here), and if you're not the sort of person that wants to uninstall your comforting Flash Player deb package for some beta tarball, Flash 10 Beta 2 isn't actually the solution yet.

So, I started looking for another way. Well, Gstreamer supports my webcam, and most other V4L2 devices, so if there was a way of converting a Gstreamer pipeline to a V4L (v1) device, then I'd be set. Turns out, there is! gstfakevideo was written so that Skype users could get better webcam support in Linux.

So now, if you want to get your Gstreamer-supported V4L2 video device to work with Flash (even pre-V4L2 supporting builds of Flash), follow these instructions. I admit they're a bit high-level.

Implementation

First, grab gstfakevideo. I did everything with the repository's revision 3 (the latest at the time of this writing), so if the gstfakevideo people change something, these instructions will work with codetree version 3.

Stupidly, gstfakevideo is hardcoded to intercept any attempts to grab /dev/video0. You'll probably want to change that so applications can see all of your video devices, including the fake one we're about to make. I plan on submitting a patch to the gstfakevideo people soon so this is configurable, but haven't yet.

To fix this for now, you'll need to edit both the gstfakevideo shell script and gstfakevideo.c source before compilation. Just pick an unused video device name and change all instances in both files of /dev/video0 to your new video device. I just used /dev/video1. Then compile.

Next, find in the gstfakevideo script where it says "exec skype". Change that to exec firefox, or whatever webbrowser you use. Make sure you close your running webbrowser instances. Then, on your command line, try "./gstfakevideo v4l2src ! ffmpegcolorspace ! videoscale". All we're doing here is setting up a Gstreamer pipeline that the gstfakevideo library will convert to a V4L device. This should launch your webbrowser. Navigate to a website that has Flash and right click the Flash applet. Go to settings, and select the webcam tab. Change the input device to the gstfakevideo device and click the webcam icon box to see if it works. If it does, you're set.

If it doesn't work, there's a chance that figuring out a different Gstreamer pipeline would work better (the pipeline is the "v4l2src ! ffmpegcolorspace ! videoscale" part). If you can get the pipeline "videotestsrc is-live=true ! ffmpegcolorspace ! videoscale" to work, then Gstreamer is probably not the problem. Play around with pipelines (help elsewhere). You can test pipelines by using gst-launch (gst-launch-0.10 on Ubuntu Hardy). You'll need to add ! xvimagesink at the end of any pipeline given to gst-launch.

Once you have a working system, you can make the whole process a little easier to start up the next time around by replacing the line that says 'GST_PIPE="$*"' in the gstfakevideo script with 'GST_PIPE="v4l2src ! ffmpegcolorspace ! videoscale"' (or whatever pipeline you figured out), moving the libgstfakevideo.so file to /usr/local/lib, and renaming gstfakevideo to a name that makes more sense, like firefox-video. Then, move the script to somewhere more useful like ~/bin.
Every time you run that script, you'll start your browser with Flash support for your V4L2 Gstreamer default input device (configurable with gstreamer-properties). Since all you need is your compiled libgstfakevideo.so library and the script you just moved, you can delete the source directory.

Hooray! Please let me know if you have a question or comments. ]]>
Tech: Mox JT Olds http://www.jtolds.com/newsletter/3/34/ 1216253205 Wed, 16 Jul 2008 18:20:46 +1800 Viricide, I spent a good deal of time writing unit tests for the server portion. The majority of my previous Python unit testing experience being at Google, I looked around on the internet for potentially similar solutions to write my unit tests in.

I was surprised to discover that mock-object unit test frameworks for Python essentially boiled down to the following three solutions:I didn't like any of the solutions, really, as they all seemed to have various glaring problems or inconveniences (the specifics of which I have forgotten), but I settled on Mocker as it was closest to the Google mock-object system, right after sending an email to a friend at Google requesting that they open source what I was used to.

It appears that my friend totally pulled through, sent an email to the right people, and Mox was released on Google Code in mid-June.

Though I first noticed that Mox was available for download the day Protocol Buffers were released on Google Code (Mox is included in the Protocol Buffer source distribution as it is required for unit tests), the Google blog is now announcing Mox for general availability.

I guess I'm not surprised the announcement references other former Googlers requesting it, as it's a pretty sweet mock-object system. But hooray!

Also, do check out Protocol Buffers. I'm pretty excited about them, too. ]]>
Project: Viricide JT Olds http://www.jtolds.com/projects/1/ 1214363693 Tue, 24 Jun 2008 21:14:55 +1800
I've been working on this project in various respects for over a year, as it was originally a way to teach myself Python. However, the project has since matured a bit and now features a client/server architecture, among other things.

I've open-sourced the project and put it up for development at Google Code. For more information, please see the official Viricide website.
Please click here to read more and see the project's associated files.
]]>
Miscellaneous: Website back up! JT Olds http://www.jtolds.com/newsletter/1/33/ 1214299449 Tue, 24 Jun 2008 03:24:12 +1800 ]]> Actual newsletter entries: I'm done with undergrad college! JT Olds http://www.jtolds.com/newsletter/2/32/ 1210962213 Fri, 16 May 2008 12:25:57 +1800 Here's my thesis.
I'm not incredibly proud of it, but oh my goodness I'm so ready to go to sleep for a week. ]]>
Miscellaneous: My OLPC software is actually useful! JT Olds http://www.jtolds.com/newsletter/1/31/ 1210367795 Fri, 9 May 2008 15:16:36 +1800 OLPC laptop as part of their Give1Get1 program. One of the things it was missing was a way of launching native Linux applications and commands without opening a terminal, so I wrote a simple OLPC Activity that provided this ability to some extent. The project page is here.

Early this week I found out that my little project is of some use to the Teaching Matters non-profit, and they are now rolling out my app on XO laptops in NYC.

Here's the blog post where I'm mentioned. ]]>
Tech: Holy crap: Google App Engine! JT Olds http://www.jtolds.com/newsletter/3/30/ 1207644230 Tue, 8 Apr 2008 02:55:19 +1800 Update: whoa, check out one of the first demo apps: HuddleChat
Update 2: as usual, Google does a better job of explaining their own products than I do.

Probably unsurprisingly, there are a number of unlaunched Google projects I learned about while I worked there last summer. Unfortunately, I've had to keep my lips completely sealed due to the NDA I signed. So, I've had some amount of quiet and unshared (at least, outside of Google) anticipation for a number of different things I happen to know Google has been working on.

Few of these things, however, even come close to matching my anticipation for the service that was finally released today.

Even though I knew Google planned to release a web-services platform, I didn't fully understand the details. I was sort of expecting a me-too competitor to Amazon Web Services, and figured Amazon had simply beaten Google to the punch here. Hey, it could happen.

However, with the public release of Google App Engine, I am again blown away by the details with which Google nailed this product.

TechCrunch just covered the launch, and although their initial article simply reported the news, I expected more thought and speculation on how much this is a game-changer. Every crappy part of AWS is fixed. There are some limitations that Google App Engine has that AWS doesn't (only Python is supported, say), but these are silly when compared to the limitations of AWS*:
  • cost - App Engine is free under certain very reasonable limits, AWS is not.
  • elasticity - load balancing and replication are automatic with App Engine, not AWS
  • simplicity - the only work involved with App Engine is writing some Python code; you don't have to manage your own virtual machine images
* I haven't actually used AWS, and I've only used internal Google technologies (basically App Engine, but not exactly), so this feature comparison is based on my loose reading of news clippings.

Here's what I see happening:
  1. The barrier to entry for scalable website design is totally lowered. Tons of developers see this and go "ooh, neat, I can write that personal project pretty easily now" and do so.
  2. Some of these projects become financially viable from Google Advertising, but where the costs would usually go straight into maintenance for the growing user demand, Google manages it all very cheaply and efficiently. Instead of developers having to choose between killing their project due to too much demand or quitting their day job just to support it, Google eases the maintenance of the site considerably. Futhermore, the cost-effectiveness of running your own service is now much better due to the low over-head costs. Developers actually could quit their day jobs.
  3. Many new, innovative services start springing up like wildfire, and don't be surprised to find that they're all only one or two man shops.

I've already been convinced that Android is going to completely revolutionize the cellphone market, and I feel the same way about Google App Engine. Even though AWS really started this product space, App Engine seems like enough done right that this will open the floodgates on cloud application hosting. I do not expect Google App Engine to simply be a footnote in the history of the internet.

If you're interested in developing for App Engine, make sure you sign up soon, as there's only a limited number of trial accounts during the preview release.

We could totally rewrite Chipmark on Google App Engine. That would be sweet. ]]>
Project: Google Chatback Replacement JT Olds http://www.jtolds.com/projects/9/ 1207250309 Thu, 3 Apr 2008 13:18:29 +1800 Google Talk Chatback Badge. It's pretty cool. You place it on your website, and it displays your current online status and away message, and has a link such that anonymous website visitors can chat with you. Great.

As you may have noticed, I just did a site redesign, and the existing Chatback widget did not match my new color scheme. In fact, it was sort of jarring. So, in looking for ways to fix the situation, I ended up writing a similar service that, aside from depending on your Google Talk username, also depends on a stylesheet that you supply.

If you'd like to set it up to replace your Chatback widget, do the following steps:
  1. Obtain the Google Chatback widget code chunk here.
  2. Locate your chatback id. Mine is highlighted in the following code Google gave me.
    <iframe src="http://www.google.com/talk/service/badge/Show?tk=z01q6......4irhg&amp;w=200&h=60" frameborder="0" allowtransparency="true" width="200" height="60"></iframe>
  3. Use the following code instead of the Google widget code, replacing the highlighted parts with the URL of your desired stylesheet and your chatback id, respectively.
    <iframe src="http://web.jtolds.com/chatback/?stylesheet=http://path/to/css&tk=z01q6......4irhg" frameborder="0" allowtransparency="true" width="200" height="40"></iframe>
  4. Modify your stylesheet to configure the presentation of your new Chatback widget (requires knowledge of CSS)



Please click here to read more and see the project's associated files.
]]>
Public Service Announcements: Change Congress! JT Olds http://www.jtolds.com/newsletter/5/29/ 1206516228 Wed, 2 Apr 2008 16:23:48 +1800 even though I hope this information sways your opinion there, too (see the bottom).

If you have time, please watch this video:


If you don't, please look at this website: http://change-congress.org/about/.

Update: I hope I have convinced you that lobbying is bad. Now watch this, then watch this. Ahhhhhh! ]]>