Let's discuss the matter further

Name your home machines using Tomato

April 16th, 2008

I am enjoying my first weeks of using the Tomato Firmware. I purchased a Linksys WRT54GL wireless router because of its admirable support for third-party firmware like Tomato, which replaces the traditional Linksys setup screens with an alterative system with many more configuration options. I can also connect directly to Tomato over SSH and use it as a very small Linux system! This opens endless possibilities for writing fancy firewall rules and running small embedded applications right at the border of my home network.

The Tomato firmware uses a small DNS server named dnsmasq to answer the steady stream of domain name requests from my home computers. It converts domain names that I type, like rhodesmill.org or google.com, into the low-level IP addresses with which computers identify each other.

But I also like using hostnames for the machines sitting right in my home, even though they do not have “real names” out on the Internet. I recommend placing local hostnames inside of a top-level domain that is local to your own network. Choose a suffix that differs from all of the top-level domains that exist out on the Internet — avoid .com, .net, or .uk, for example, in favor of something like .home or .myhouse instead. How, I wondered, could I add extra host names to dnsmasq?

(more…)

this is a visual separator

How To Produce A Linux Screencast

February 27th, 2008

Learning how to create Linux screencasts has been the most frustrating technical challenge that I have tackled for a very long time. I should have been worried when a search for “Linux video editing” returned, as its top hit, a bare and completely unstyled web page from 2002 which concludes that “video editing on Linux hasn’t really arrived yet.”

My efforts were, in the end, successful, and you can see the result — my first two screencasts — in my previous blog entry, which I posted earlier this week.

In the hope that my toil can benefit others, let me outline the details of the process that I have worked out for creating, editing, and posting Linux screencasts. For the impatient, here are the three most important things I learned:

  • Linux tools have great difficulty keeping audio and video from gradually going out of sync over several minutes. To avoid problems, always run recordmydesktop with its “on-the-fly encoding” option, and never let “ffmpeg” anywhere near your audio! This not only means that you have to use “mencoder” instead when converting between video formats, but even within mencoder you must avoid the “lavc” audio module, since its code seems to have the same problems.
  • Do not attempt to directly edit the resulting Ogg/Theora video! Instead, convert first to the Digial Video (DV) format, and perform your editing there. Be prepared for the fact that DV files are enormous, and that DV pixels are not square.
  • Finally, convert to something like AVI for submission to Google Video. Avoid submitting a raw Ogg/Theora file, since even though Google can decode it, their decoders will waste valuable screen space by placing an empty border around the result.

For those interested in more details, I have more to share. Keep reading!

(more…)

this is a visual separator

Presentations on Buildout and KSS

February 23rd, 2008

After several frustrating weeks learning how to create, edit, and publish a screencast under Linux (about which I will write a separate post), I have now published screencasts of both presentations that I gave at the PyAtl meetup in January. I opened with a talk about the import statement, and where Python packages lived before egg files were invented:

The audience seemed most interested in the last section of the talk, where I discuss three techiques for debugging problems with Python’s import statement; fast-forward to around 3:00 if you want to catch that part by itself.

Next, Jeremy Jones spoke about eggs, Noah Gift introduced virtualenv, and, finally, I got back up to talk about buildout. This was probably my own favorite among the recent presentations I have given, and it’s the one I’ve worked hardest to adapt to a competent screencast:

I have prepared a supplement to the above screencast that gives additional hints and tips about using buildout, as well as a link to the source code of the module that I use as my example.

Finally, if you’re ready to see something a little less polished — something that instead of being a screencast is actually a film of me talking in front of a live audience, and gesturing and jumping around — I filled a vacant lightning-talk slot at our February PyAtl meeting with an impromptu introduction to Kinetic Style Sheets (KSS), using an example application that was still sitting on my laptop after at a Georgia Tech developer’s luncheon earlier that week:

Now I can finally turn my attention to preparing for my upcoming talk at PyCon 2008 in Chicago! I will be talking about the basic “adapter” design pattern, and how a framework like Zope 3 can facilitate its use. Stay tuned for more information!

this is a visual separator

New PyEphem release: 3.7.2.2

December 11th, 2007

On Sunday afternoon I released a new version of PyEphem, which is available from the Python Package Index as version 3.7.2.2! I want to thank the users who spurred its development — in particular, John Duchek of the Astronomical Society of Eastern Missouri encouraged me both to create the new moon-phase functions, and, as I announced several weeks ago, to finally make PyEphem available in binary form for Windows. Thanks, John!

PyEphem now also includes a small database of world cities, so that people living near one can simply call ephem.city(’Boston’) to get their longitude, latitude, and elevation, rather than having to look up the numbers themselves.

this is a visual separator

A database symbol for GraphViz

November 23rd, 2007
Download the source for my GraphViz database symbol featured in this article: DatabaseShape.ps

I have started using the GraphViz application, which accepts a list of nodes and arrows, and figures out how to attractively arrange them in a diagram. For example, you can very nearly produce this output:

by supplying this rather modest input file to GraphViz (most of whose length comes from my wanting particular colors)::

 digraph Application {
    rankdir=LR;
    node [shape=box,style=filled,fillcolor="#C0D0C0"];
    subgraph clusterClient {
       label=”Client”; style=filled; bgcolor=”#D0C0A0″;
       “Browser”;
    };
    subgraph clusterServer {
       label=”Server”; style=filled; bgcolor=”#D0C0A0″;
       “App”;
       “Database” [shape=DatabaseShape,peripheries=0];
    };
    “Browser” -> “App” [label="HTTP"];
    “App” -> “Database” [label="SQL"];
 }

I used the words “very nearly” because, in fact, GraphViz only knows how to draw simple shapes like rectangles, and is ignorant of the standard cylinder-shaped database symbol that I have used here by asking for a DatabaseShape. Submitting the above code to GraphViz will, normally, produce three nodes that are all rectangles. To teach it about the database shape, I had to write some PostScript.

(more…)

this is a visual separator

My November Grok Presentation

November 9th, 2007

In this post, I provide the slides and examples from a recent talk that I gave to some fellow software developers at Georgia Tech. Many of them were not familiar with web frameworks, and I wanted to introduce them to two common concepts: the idea of “convention over configuration,” and the practice of passing inert data structures to a page template rather than letting it access live objects directly.

But because I am also really enjoying my work with the new Python web framework Grok, I decided to make it the centerpiece of my presentation (more…)

this is a visual separator

PyEphem available for Windows!

November 9th, 2007

Over the years I have received many requests from frustrated Windows users, asking for a Windows-native version of my PyEphem astronomy library for Python. For most Windows users, an attempt to build the extension ends abruptly with the terrible and famous message:

error: Python was built with version 7.1 of Visual Studio, and extensions need to be built with the same version of the compiler, but it isn’t installed.

And, as I myself do not have Visual Studio on the small Windows machine that I deign to own for the sake of my photo printer, I have never been able to offer my users much help. But earlier this year, a helpful PyEphem user named Jeff Kowalczyk emailed me a link to Philip von Weitershausen’s post “Cheap binary Windows eggs”, which describes a method for building Python extensions using a freely available compiler.

(more…)

this is a visual separator

Check!

November 1st, 2007

I treated my Facebook account as little more than a curiosity, browsing occasionally for friends of my youth, until discovering the Chess Application!

Online chess relieves the game of two horrors for me, of which I had not even been aware until I noticed them during this first online game because of their absence: the horror of a waiting opponent, and the curse of having to wait for them in turn! It turns out that, for a novice like myself who can take upwards of a half-hour to even begin to appreciate the complexity of a given position, to play a live game is only to be rushed through a series of bad decisions. But now, over morning coffee, I can ponder the board for as long as I wish, and can therefore begin — just begin — to glimpse the beauty of the complex possibilies that each move offers. And then, my move complete, I can go about my day without being fixed, inactive, in a chair while my opponent weighs his decision.

I will have to thank Ilan for telling me about this — maybe even by playing him in person sometime, like he originally asked!

this decorates the bottom of the main column this decorates the bottom of the screen

Powered by WordPress