Shallow Thoughts

Akkana's Musings on Open Source, Science, and Nature.

Tue, 27 Mar 2007

Fun With Motel Kiosks

The wireless network was messed up at the Super-8. No surprise there -- Super-8 motels always have flaky wireless. But last night's wi-fi travails were quite a bit more interesting than the usual story.

When we checked in, the sign at the desk saying "We know the wi-fi is flaky; you've been warned, no refunds", wasn't encouraging. We needed some information from the web fairly quickly, so rather than futz with trying to get the motel system to work we headed over to the public library, where I got re-acquainted with the travails of browsing circa 1999 by using their slow link and Internet Explorer. How do people live without being able to open lots of search results in multiple tabs? And hitting return didn't work in any search fields. Eesh.

I was also amused to find that when I searched on terms related to IRS and tax information, several of the results brought up a page saying they were blocked by the library's firewall. Wouldn't want anyone looking at that sort of smut on public library machines!

Anyway, after dinner we had time to fiddle with the hotel wi-fi. When we couldn't get a reliable signal in the room, we carted our laptops down to the lobby to see if things were better there. They weren't.

But the single public lobby workstation was free (showing a myspace page), so we decided to try that and see if it worked any better than our laptops. Nope.

But something about the throbber in the lobby workstation's browser seemed familiar to me. That's not IE ... it's not firefox either ... Why, it's konqueror! But ... doesn't that mean ...?

We tried browsing to a few familiar file paths, like /etc/fstab, and sure enough, the lobby workstation was running linux (Slackware). We played filename guessing games for a bit before discovering Tools->Open Terminal. That wasn't very reliable, though -- it seemed to have a redraw problem and it was hard to get past that. (Later I found an alternative elsewhere in the Konqueror menus, "Show Terminal Emulator". I'm not clear on why Konqueror needs two different terminal emulators, but it was helpful here.)

Then I experimentally typed "whoami" and discovered that we were root. How handy!

It turned out that the machine was running a live CD based distro. Dave stumbled on /etc/issue, which began with the lines:

-------------------------------------------------------
:: WHAX 1.0 -- Dev Edition: http://www.iwhax.net
-------------------------------------------------------

User : root
Pass : toor

If you use this CD not for development purposes, remember to change passwords!

Great fun! And we played around with the machine for a bit. But alas, none of this helped with the net -- the WHAX box was just as much a victim of the network as we were.

After a brief delay to admire the bright yellow Sunbeam Alpine that pulled up on a trailer outside the registration desk (the folks playing poker at the next table had never seen a Sunbeam before), Dave took to the parking lot with his laptop looking for a stronger signal. (He can do this with his Prism2 card while I can't with my Prism54. Why is it that every Linux wi-fi driver has a completely different set of supported operations?) Does it still count as war-walking if you're just looking for a working connection for a net you've paid for?

He found the strongest signal at the Travelodge next door (the net is shared between the two motels), just outside the metal door marked "DISCONNECT MAIN ELECTRIC".

I guess whoever set up this network decided that the perfect place to put a radio transmitter was in the electric main box surrounded by lots of metal and current-carrying wires. Not being an RF engineer myself, somehow that would not have occurred to me as the ideal spot. But what do I know?

Tags:
[ 20:28 Mar 27, 2007    More tech | permalink to this entry ]

Sat, 24 Mar 2007

Enabling CGI and PHP on Apache2

Every time I do a system upgrade on my desktop machine, I end up with a web server that can't do PHP or CGI, and I have to figure out all over again how to enable all the important stuff. It's all buried in various nonobvious places. Following Cory Doctorow's "My blog, my outboard brain" philosophy, I shall record here the steps I needed this time, so next time I can just look them up:
  1. Install apache2.
  2. Install an appropriate mod-php package (or, alternately, a full fledged PHP package).
  3. Edit /etc/apache2/sites-enabled/000-default, find the stanza corresponding to the default site, and change AllowOverride from None to something more permissive. This controls what's allowed through .htaccess files. For testing, use All; for a real environment you'll probably want something more fine grained than that.
  4. While you're there, look for the Options line in the same stanza and add +ExecCGI to the end.
  5. Edit /etc/apache2/apache2.conf and search for PHP. No, not the line that already includes index.php; keep going to the lines that look something like
    #AddType application/x-httpd-php .php
    #AddType application/x-httpd-php-source .phps
    
    Uncomment these. Now PHP should work. The next step is to enable CGI.
  6. Still in /etc/apache2/apache2.conf, search for CGI. Eventually you'll get to
    # To use CGI scripts outside /cgi-bin/:
    #
    #AddHandler cgi-script .cgi
    
    Uncomment the AddHandler line.
  7. Finally, disable automatic start of apache at boot time (I don't need a web server running on my workstation every day, only on days when I'm actually doing web development). I think some upcoming Ubuntu release may offer a way to do that through Upstart, but for now, I
    mv /etc/init.d/apache /etc/noinit.d
    
    (having previously created /etc/noinit.d for that purpose).

Tags: , ,
[ 17:54 Mar 24, 2007    More tech/web | permalink to this entry ]

Thu, 22 Mar 2007

Pho 0.9.5 Released

Pho 0.9.5-pre5 has been working nicely since I released it two weeks ago. And meanwhile, I've already started working on the next version. So I've released it as 0.9.5 with no changes (except for version string and some updates to the documentation and debian config files).

I made a .deb on Ubuntu Edgy, but haven't actually tested it yet (anyone who sees problems, please let me know) and I'll try to make a straight Debian package on Sarge sometime soon.

So what's this stuff I've been working on for the next version? Image categorization. I shoot so many photos, and categorizing them by keyword can be a lot of work. Although Pho's "Notes 0 through 9" are helpful for a small number of notes, it's tough keeping track of which note corresponds to which keyword when I'm categorizing a directory full of photos from a trip. The next Pho release (which will have a much shorter release cycle than 0.9.5 did, honest!) will have an optional Keywords dialog where you can type in keywords and associate them with photos. I know there are apps such as f-spot, gthumb and Picasa, but they all seem much more heavyweight than what I need, and Pho only needs a tiny bit of work to get there.

While I'm working on dialogs, I'm also cleaning up modality: Pho dialogs will now stay visible so they can't get lost behind the image, and the question dialog ("Really delete?" or "Do you want to quit?" will be modal.

But that's all coming in the next version. For now, 0.9.5 is the stable version: get it from the Pho page.

Tags:
[ 15:56 Mar 22, 2007    More programming | permalink to this entry ]

Sat, 17 Mar 2007

A New Open Source Adventure

[The Last Mimzy] I opened the paper and immediately noticed the ad at right.

The ad doesn't include any plot details, but I didn't need them after seeing the ad.

Obviously this must be a movie about two children who boldly install Debian Linux on the family PC, and the adventures that ensue.

Indeed, a check of the official web site -- which I can only read with View Page Source because otherwise all I see is whines about needing Flash 8 -- contains the following synopsis:

Based on the acclaimed science fiction short story by Lewis Padgett, The Last Mimzy tells the story of two children who discover a mysterious box that contains some strange devices they think are toys. As the children play with these 'toys,' they begin to display higher and higher intelligence levels. Their teacher tells their parents that they seem to have grown beyond genius.

Cool, finally a Linux movie! (You can see the Debian logo at Wikimedia if you're not already familiar with it.)

Tags:
[ 20:57 Mar 17, 2007    More humor | permalink to this entry ]

Wed, 14 Mar 2007

The Various Debian Upgrade Methods

Carla Schroder's latest (excellent) article, Cheatsheet: Master Linux Package Management, spawned a LinuxChix discussion of the subtleties of Debian package management (which includes other Debian-based distros such as Ubuntu, Knoppix etc.) Specifically, we were unclear on the differences among apt-get upgrade or dist-upgrade, aptitude upgrade, aptitude dist-upgrade, and aptitude -f dist-upgrade. Most of us have just been typing whichever command we learned first, without understanding the trade-offs.

But Erinn Clark, our Debian Diva, checked with some of her fellow Debian experts and got us most of the answers, which I will attempt to summarize with a little extra help from web references and man pages.

First, apt-get vs. aptitude: we were told that the primary difference between them is that "aptitude is less likely to remove packages." I confess I'm still not entirely clear on what that means, but aptitude is seen as safer and smarter and I'll go on using it.

aptitude upgrade gets updates (security, bug fixes or whatever) to all currently installed packages. No packages will be removed, and no new packages will be installed. If a currently installed package changes to require a new package that isn't installed, upgrade will refuse to update those packages (they will be "kept back"). To install the "kept back" packages with their dependencies, you can use:

aptitude dist-upgrade gets updates to the currently installed packages, including any new packages which are now required. But sometimes you'll encounter problems in the dependencies, in which case it will suggest that you:

aptitude -f dist-upgrade tries to "fix broken packages", packages with broken dependencies. What sort of broken dependencies? Well, for example, if one of the new packages conflicts with another installed package, it will offer to remove the conflicting package. Without -f, all you get is that a package will be "held back" for unspecified reasons, and you have to go probing with commands like aptitude -u install pkgname or apt-get -o Debug::pkgProblemResolver=yes dist-upgrade to find out the reason.

The upshot is that if you want everything to just happen in one step without pestering you, use aptitude -f dist-upgrade; if you want to be cautious and think things through at each step, use aptitude upgrade and be willing to type the stronger commands when it runs into trouble.

Sections 6.2 and 6.3 of the Debian Reference cover these commands a little, but not in much detail. The APT Howto is better, and runs through some useful examples (which I used to try to understand what -f does).

Thanks go to Erinn, Ari Pollak, and Martin Krafft (whose highly rated book, The Debian System: Concepts and Techniques, apparently would have answered these questions, and I'll be checking it out).

Tags: , ,
[ 21:19 Mar 14, 2007    More linux | permalink to this entry ]

Tue, 13 Mar 2007

Appropriate Starch

Holder's County Inn, a local diner chain, has new menus. All dinner entrees now come with choice of soup or salad, fresh vegetables, and "appropriate starch."

Invoking Dave Barry, I thought, wouldn't that be a great name for a band?

Or perhaps a phrase to save for fiction writing. "Sir," she replied with appropriate starch, "your participles are dangling."

Tags:
[ 10:36 Mar 13, 2007    More humor | permalink to this entry ]

Mon, 05 Mar 2007

Pho 0.9.5-pre5

Pho's been static for a long time -- it's been working well enough that I keep forgetting that there were a couple of bugs that need fixing for a 0.9.5 release.

I had some time tonight, so I dug in and fixed the bugs I remembered: some issues with zooming in and out, a bug with aspect ratio when switching out of fullscreen mode, and the fact that Note 0 didn't work.

While I was at it, I added an environment variable, PHO_ARGS, where you can preset your default values. I find that I always want -p (presentation mode), so now I can specify that with PHO_ARGS=p, and use pho -P when I want window borders. I also updated the man page.

I'll test this for a little while and if nobody finds any serious bugs, maybe I can finally release 0.9.5.

Get Pho here.

Tags:
[ 23:06 Mar 05, 2007    More programming | permalink to this entry ]