All articles, tagged with “just trying to help”


Being Cocky Will Ruin Your Product: A Western Digital Passport Case Study

Product managers, engineers, marketers, and those who support them can be amazingly pretentious. If you are involved in designing a product, please make sure that you understand this important point: it doesn’t matter what you build, or how good a job you do, your product is not cool enough to force on everyone and expect them to like it. Yes, this is a universal law. Yes, even for Apple. Eventually you will find out how much you have alienated your customers.

The Western Digital Passport drives are a perfect example. I recently needed to buy an external backup drive for work. I really liked the Passport drives: lots of storage packed into a sleek form factor small enough to be tossed in a laptop bag. However, they ruined the drives with their awful backup software *ahem* rootkit. They implemented this “feature” in the most awful way possible; it is on the drive taking up space, but the firmware makes it look like a read-only CD image. It is really hard to remove, but it might be possible to disable it with a tool available at Western Digital’s web site. Unfortunately for me, the tool bricked my drive (and lost my data). I guess they posted the tool because removing the software would look like admitting a mistake. I am actually glad it failed because then it was easy to return the drive and get a SeaGate FreeAgent.

If I was in the market for a backup solution, I would have bought a product marketed as a backup solution. Western Digital: I wouldn’t be offended that you gave me free software if you put it on the drive like every other sane manufacturer. All of your funny business adds confusion and gets in the way of me using the drive for its intended purpose: dumb file storage.

The lesson for product designers is clear: understand that every option you remove limits your customer base, and options that look senselessly removed make for angry former customers. If you can provide ease of use without limiting flexibility, exerting control just makes you look like a jerk. Being cocky can ruin your product.

By the way, though not quite as small and sleek as the Passport, the Seagate FreeAgent Go provides more storage per dollar, a significantly longer warranty, and works fuss free.

Thank you Seagate for providing an excellent alternative.

[ Read More | 0 comments | 0 pingbacks | , , ]

Kubuntu Karmic on Dell Mini 10

Background to Buying a Linux System

My family switched to all-Linux in 2002. Mid-2004 was the last time I purchased a Windows license for personal use; though I have a copy of XP that I still occasionally load in a VM. 2004 was the year I bought an HP laptop that came with Windows, and I put Linux on it during its first boot. Since then I have purchased a Lenovo Thinkpad and four Dells with Linux pre-installed. It is infuriatingly difficult to avoid the Microsoft Tax, but it is possible. A lot of vendors offer FreeDOS systems these days. More important than not paying Microsoft (and more difficult) is finding a machine with Linux pre-installed.

This is not as difficult as it was. Not long ago, the only way to obtain a machine pre-installed with Linux was to purchase from a reseller like Emperor Linux. These resellers don’t have the resources of the manufacturer, and they likely paid the Microsoft Tax for you before they put Linux on the device. However, options are gradually improving. The manufacturers have experimented with Linux systems and HP, Lenovo, and Dell all sold consumer equipment pre-installed with Linux in the recent past. (I hear Sony does too, but I refuse to buy Sony products given their history of proprietary technologies, root kits, etc.) Unfortunately, all these manufacturers stopped selling the systems after a short time. After a couple of failed experiments, Dell seems to have figured things out and turned into a reliable Linux distributor with a decent selection of systems. Here is the secret to buying a Linux system from Dell: many of the best Linux configurations are only available when using the “Small and Medium Business” section of their site; the open source offerings page does not list all of their Linux offerings. The rest of this blog post details the other sad secret: Linux systems from Dell don’t necessarily play nicely with Linux.

Before we proceed, I should point out three reasons why it is worth putting in the effort to get a system with Linux pre-installed:

  • Since the manufacturer is willing to support Linux running on the hardware, it is reasonable to expect that it should be easier to configure with Linux than other equipment.
  • Being officially counted as a Linux user sends a direct message to the market that manufacturers should support Linux.
  • Buying a machine with Linux pre-installed confers moral superiority.

Okay, so the second and third reasons are probably imaginary. I am sorry to report that the first reason is largely a fiction as well. It would be more accurate to say: since the manufacturer is willing to support Linux running on the hardware, I know that someone, somewhere got Linux to at least sort-of run.

Notice that saving money is not on the list. I am not sure what back-room deals make it as expensive to buy a machine installed with Redmond’s proprietary OS as it is to purchase a freely available OS like FreeDOS or Linux, but that is how Dell’s pricing model currently works. In other words, at the current time paying the Windows Tax, and then putting Linux on yourself is just as economical a decision as purchasing Linux pre-installed. This is good for Emperor Linux.

Buying a Dell

Dell has been shipping systems pre-installed with Ubuntu for over two years now. The ten minutes I spent playing with the stock OS were impressive. However, I choose to reinstall with the latest stock Kubuntu release for a few reasons:

  • I am a control freak and want to know exactly what is on the system.
  • I am a KDE fan, and Dell ships Gnome by default.
  • The Dell releases are pretty old (they are still shipping 8.04).
  • I don’t see much value in having an officially licensed DVD and MP3 player, though others might.

I bought an Inspiron 530 with Ubuntu over eighteen months ago. It took stock Kubuntu flawlessly and has run great the entire time. It has been the perfect Linux desktop for my kids’ machine. I highly recommend this product.

I have purchased two Inspiron Mini 10v netbooks with Ubuntu since last September. I really like these machines. They took stock Kubuntu okay—you have to install a binary blob for the wireless card (you can get the details in the Mini 10 section below), but everything else worked out-of-the-box. They are reliable machines, though I hated the touchpad for a long time. After three months I am starting to get used to it. These machines are so great that I can’t seem to keep them—family members keep buying them from me and then I have to order myself another.

I was so happy with my previous experiences that I decided to buy the top-of-the-line Linux netbook: the Inspiron Mini 10. This model must be purchased through the “Small and Medium Business” website. It has a much nicer screen, a multi-touch touchpad, faster processor, and more memory. However, getting stock Kubuntu to work on it was not as easy as I expected. Here are the details.

Kubuntu on a Dell Inspiron Mini 10

Proprietary drivers: bringing the pains of Windows to Linux!

Though I don’t know the exact reason Dell ships their Linux netbooks with a lot of binary-only proprietary drivers, I suspect that it has to do with their desire to pack in as much power per battery mWh as possible. The Mini 10 series does have impressive battery life—I am constantly surprised at how long I can go without plugging in (I plug it in most nights and haven’t run out of juice yet). I guess that Dell feels like the only way to achieve that is to use the Intel Poulsbo Chipset that requires a proprietary graphics driver. I suspect similar logic is behind the awful Broadcom wireless card as well.

Broadcom wireless driver

These Dell netbooks are not very useful until you get wireless networking setup. I had to install using a wired connection for both the Mini 10 and the Mini 10v. It is then necessary to setup the binary Broadcom driver. My understanding is that the new Jocky hardware tool will take care of this once all the correct packages are pulled down, but I am more comfortable with the command line.

aptitude install dkms patch bcmwl-kernel-source b43-fwcutter

That command is all it takes, but I’ll offer a little bit of explanation:

  • dkms: This is the Dynamic Kernel Module Support framework. It is a really nice way of making sure that picky kernel modules are always correctly built against the currently running kernel. Not only does this make binary drivers easier to manage, it also solved my constant problems with updates breaking VirtualBox (on my development box—I would not recommend running VirtualBox on these netbooks).
  • patch: This is required for the script to edit the bcmwl package before compilation. It should really be a dependency. It took me a while to realize the error I was getting was due to patch not being installed.
  • bcmwl-kernel-source: This is the proprietary driver for Broadcom wireless cards.
  • b43-fwcutter: This is a tool to install the binary blob into the Broadcom 43XX firmware. I’m not certain that it is necessary. I installed this before I realized that the DKMS driver was failing to build because of the missing patch dependency. I suspect that I would have eventually had problems if I hadn’t installed this tool.

As part of the install, dpkg correctly compiled the kernel module, inserted the binary blob, and got everything setup. KNetworkManager appeared to see the wireless at that point, but KNetworkManager hates my WPA2 setup, so I always use wicd. Don’t forget to manually tell wicd that eth1 is the wireless interface, or wicd will report that no networks are found even though iwconfig will work and wlist scan will show networks.

Sound

Remember to turn up the volume of the PCM channel.

Multi-touch touchpad

Works great:

  • 1 finger tap: left click
  • 2 finger tap: middle click
  • 3 finger tap: right click
  • place 1 finger, drag one finger: scroll (vertical only)

I don’t currently have horizontal scroll or pinch zoom working.

Video

The biggest let down with the Dell Mini 10 is the Intel Poulsbo chipset. The larger resolution of the 10 is the most appealing feature to justify the upgrade from the 10v. Unfortunately, Intel didn’t open source the driver like they have with their other GPUs because the Poulsbo is based on third party technologies. If you think the Intel name will guarantee good Linux support, you are mistaken. Ars Technica has a good rundown on the problem.

The summary is that the binary driver is only supported by Dell on the versions of Ubuntu that they are shipping. Getting packages for other versions and distributions is challenging and not very reliable. However, I was able to get the driver to work on Kubuntu Karmic Koala (9.10).

Here are the basic steps, distilled from a Launchpad Bug Report:

  1. Add this PPA to ”/etc/apt/sources.list”:

    deb http://ppa.launchpad.net/lucazade/gma500/ubuntu/ karmic main
    deb-src http://ppa.launchpad.net/lucazade/gma500/ubuntu/ karmic main
    
  2. Get this missing package: wget xorg-video-psb.deb. Install it with dpkg -i.

  3. Run this command:

    aptitude update; aptitude install psb-kernel-headers psb-kernel-source psb-modules psb-firmware libdrm-poulsbo1 poulsbo-driver-2d poulsbo-driver-3d xpsb-glx
    
  4. Create this file: “/etc/X11/xorg.conf” with these contents:

    Section "Device"
            Identifier "Configured Video Device"
            Option "IgnoreACPI"
            Option "AccelMethod" "exa"
            Option "MigrationHeuristic" "greedy"
            Option "NoDDC"
            Driver "psb"
    EndSection
    
    Section "DRI"
        Mode 0666
    EndSection
    
    Section "Monitor"
            Identifier "Configured Monitor"
    EndSection
    
    Section "Screen"
            Identifier "Default Screen"
            Monitor "Configured Monitor"
            Device "Configured Video Device"
    EndSection
    
    #Added for mouse pad
    Section "InputDevice"
            Identifier "Mouse0"
            Driver "synaptics"
            Option "Protocol" "auto"
            Option "Device" "/dev/input/mouse0"
            Option "ZAxisMapping" "4 5 6 7"
            Option "CorePointer"
            Option "HorizEdgeScroll" "1"
    EndSection
    
  5. Reboot

Once it all works, you are rewarded with a very nice display which makes the netbook significantly more usable.

HDMI out

Video worked fine after enabling the external display with xrandr.

I couldn’t get audio working. Here is what I tried:

  • Unmuted the IEC958 channel in alsa-mixer (and enabled it in KMix to be sure.
  • Changed the device order in System Settings -> Multimedia.

Remaining problems

  • Enabling desktop effects completely broke KDE. I had to revert to a backup.
  • The driver cannot keep up with a full screen Hulu video, even when the video was fully buffered and at a non-HD resolution.
  • The panel that is the top menu for Kubuntu Netbook Remix cannot be resized. On the high resolution screen the lock / logout buttons are very tiny and cannot be configured to be any bigger.
  • I am getting lots of these errors: hda-intel: spurious response 0x0:0x0, last cmd=0x . . . but I don’t see any negative effects.

Conclusion

I am undecided whether the Dell Mini 10 is worth the hassle. I really like the multi-touch touchpad, the additional RAM, and the bigger memory. On the other hand, the significantly cheaper Mini 10v just works. If Intel and Dell could get the video driver problems ironed out, this netbook would be great.

[ Read More | 2 comments | 0 pingbacks | , , , , , ]

NetBeans 6.7 as a PyQt IDE

The Setup

After working for over a year as the only tech guy in our little start-up company, we brought another developer on to help with some of the reporting tasks. In an effort to mitigate the damage a contracted hit-man could do to our collective efforts (the hit-by-a-bus metaphor is so passé), I have been trying make sure my new teammate is familiar with the development tools I have been using.

We are from two very different worlds. I have been comfortable doing all of my development in Vim, though I occasional use Qt Designer for complex form layout and Eric IDE for visual debugging. My teammate found the Vim plus shell toolset to have too steep a learning curve, so I started a quest to find an IDE that we could both use comfortably.

Eric4 IDE

My first attempt was with Eric. It is a decent, open-source PyQt IDE. It is a snap to install on Ubuntu, but my teammate got frustrated installing the various dependencies for development on Windows. Though Eric is an adequate IDE for my purposes, it is very cluttered and has a confusing interface. Given how clumsy it can be to navigate, I didn’t feel good about pushing my team member to get it working. Eric does however have excellent integration with the Qt tools. I was a little nervous to move away from Eric until I realized that most of the magic is done by calling pyuic4 on the back-end.

Eclipse and PyDev

My next experiment was with Eclipse. I used Eclipse plus PyDev long ago, and found it adequate though I reverted back to Vim. When I gave it a fresh look, I was encouraged that PyDev was no longer half-proprietary and had lots of new features. Eclipse also has a lot of database plugins which might help my teammate visualize the structure of our embedded SQLite data store.

Installation on Linux was a single aptitude command, but it proved to be a complex IDE to set up. Learning how to install plugins wasn’t bad, but the selection was confusing. I’m still not sure which Qt plugins are necessary for PyQt development—I erred on the side of installing extra. Then I had to wrap my brain around perspectives, and configure them to be logical (Mylyn looks to address some of these problems, but it was yet another new paradigm that had to be grasped before I could get any work done). I also had to find a supported Mercurial plugin and figure out how to get my existing code into a project—a process which was not very intuitive. Riddle me this: Do you create a Mercurial Project or a PyDev project? Answer: Create a PyDev project and give it your existing Mercurial repo as the home directory, then right click on the folder in the project explorer, go to “Team”, and select “Share Project”. At that point you can tell it that you are using Mercurial. After all this work, I still felt like it was a clunky IDE with no good Vi keybindings (though the reasonably priced proprietary viPlugin might have solved that one). My other big gripe is that when stepping through my Python application, the integrated Python shell does not see the current debugging stack—a feature of Eric that I found to be extremely valuable. My teammate spent a little bit of time trying to install Eclipse and found it to have more dependencies than Eric.

At the end of the day, I think I like Eclipse but I don’t think it will work for my current project. It compares favorably with Visual Studio (which is also a bear to setup for an existing project, especially with a heterogeneous tool set), but it will take a lot of effort to get my team productive in it. Though I expect it would eventually prove adequate, I decided to explore alternatives before settling.

NetBeans Plus nbPython

At some point last month I came across a blog posting about the NetBeans Python plugin. It looked like it might meet our needs, so I decided to give it a shot. I think it is the most complete solution I have come across so far, though it currently has some annoying bugs.

My first impression is that NetBeans is ugly. I mean the kind of ugly that gets kids sent home from school. Yeah, it is Java Swing ugly. Swing’s default look and feel (Metal) payed more homage to Motif than to the competing toolkits of 1995. Metal is so ugly that it single-handedly prevented developers from adopting Java on the desktop (that and the fact that early expectations for Java far exceeded reality, oh and Microsoft’s abusive tactics). But enough ranting, because Sun finally sort of fixed it. To get NetBeans to use the not-so-ugly Nimbus look and feel, simply copy “/etc/netbeans.conf” into your local .netbeans folder, and add --laf Nimbus to the --netbeans_default_options line.

Impressions:

  • NetBeans is pretty usable by default. It is much quicker to get started with than Eclipse.
  • NetBeans appears customizable enough for my needs. It is much more configurable than it at first appears.
  • The options dialog is very poorly organized and hard to use.
  • My Dansguardian setup was blocking the automatic download and installation of updates and some plugins, so I had to add updates.netbeans.org to ”/etc/dansguardian/lists/exceptionsitelist”.
  • I turned off the additional update check in the plugins dialog; it was annoying me.
  • There are some decent dark themes, but it doesn’t look like it because the option window doesn’t change the background color.
  • I installed the “Extra Color Schemes” package under the “Ruby” Category, and settled on “Dark Pastels”. I then changed the default to a fixed-width font (Lucida Sans Typewriter). It looks much better.
  • Unfortunately, I don’t see how to change any window except for the editor window to be dark.
  • The jVi plugin is awesome. It is everything you would expect an embedded Vi plugin to be. Manually installing plugins was a little tricky: Under the “Tools” menu, select “Plugins” then select the “Downloaded” tab and click “Add Plugins”
  • The Mercurial plugin was already installed in the Ubuntu package. It works okay. It is straight-forward to use.
  • It reduced confusion for me to disable the plugins that I am not using (like CVS). The menus are less cluttered now.
  • The Python plugin works good. The Python shell is aware of the symbols in the debugger. There doesn’t appear to be a command history in the python shell, which is annoying.
  • There is a nice SqlBrowser plugin. It’s pretty basic, but it is useful. To hook it up to SQLite, you need to install the JDBC Sqlite Driver plugin, which is downloadable from http://plugins.netbeans.org. Once it is installed, go to the “Window” menu and select “Services”. Then in the Services explorer, you can configure an SQLite Driver data source. Leave the username and password blank. Specify the jdbc connection like so: jdbc:sqlite://home/<dir>/<dbfilename>.db The SqlBrowser does not provide any visual view of tables with foreign key relationships mapped out. But there is a tree view of the database schema and you can execute SQL line-by-line and browse the results.
  • There are some cool tools. It says that I don’t have a very consistent coding style. That is true, and useful. I wish I had started the project with a good coding style and then followed it’s warnings—for new I just have to turn it off.
  • PyLint appears to be integrated already. I don’t see any pylint configuration, but it is giving me warnings that I usually expect from that tool (unused import, etc).
  • I didn’t need to do anything special to work with a PyQt application.

Remaining Problems:

  • It is not saving the Python Platform setting. I have to reselect Python 2.6 (instead of Jython 2.5) each time I open NetBeans. I am hitting the “Make Default” button, but it forgets every time it is closed.
  • Debugging seems kind of buggy. It has problems with my signal handling (the error message says “ValueError: signal only works in main thread”). I commented out the signal assignment for now, and I’ll detect when I’m in debug mode in the future. Now the debugger runs the application alright (don’t be weirded out because it stops on the first line—that’s configurable), but once it hits the first breakpoint it doesn’t want to resume code stepping (though the application GUI is still responsive). I can’t get it to break at a second breakpoint. It sounds like this bug to me: https://netbeans.org/bugzilla/show_bug.cgi?id=169757
  • The UI is sometimes laggy.

Summary: NetBeans is really close to being an excellent Python development environment. I think I’ll nudge my team in this direction and hope that the next release addresses the bugginess that I’m struggling with.

[ Read More | 3 comments | 0 pingbacks | , , , , , ]

Kubuntu Karmic

I am about to start a big project for work, and I wanted to get the latest tools on my machine because I know I won’t have the opportunity for a while. Unfortunately, my install of Kubuntu Hardy 8.04 is starting to feel behind-the-times and the latest versions of my applications are getting increasingly hard to install as they depend on newer libraries. However, I have been very nervous to upgrade. I love KDE 3.5; it is a nearly perfect mix of stability, configurability, and usability; perhaps I’ve just grown very used to it. I avoided upgrading to the unfinished KDE 4.0, and have been following KDE4 closely while waiting for it to get complete enough not to drive me crazy. It looks almost there. So last week, when the project start got delayed yet again, I tackled upgrading to the freshly released Alpha 6 of Kubuntu Karmic.

Now I understand that alpha-quality software is not for production use. I also understand that the jump from KDE3 to KDE4 is a big one. However, Karmic is coming along nicely, and Alpha 6 looks almost there. My logic went like this: get the reinstall out of the way, upgrade to ext4, get used to KDE4, get the configuration file merging headache out of the way, and get everything working in the KDE4 version of my most important apps. Then it should be easy to aptitude dist-upgrade through the betas to the release even in the middle of a firestorm.

I expected this project would take a day or two, and it went more or less according to plan, but the experience was more painful than I expected. Perhaps my notes might help out others.

Before upgrading I did some due diligence. I checked the bug database, and didn’t see anything that would obviously effect me. I reviewed the development mailing list logs. Finally, I hung out on IRC for a couple of days and got opinions on the stability of the development branch. At that point I had collected enough courage to jump in.

Impressions of Karmic

For me the big change from Hardy to Karmic is KDE4. However, I did notice:

  • The installer is really fast and easy to use.
  • The system boots far faster.
  • There is no more grub screen by default.
  • I have a bunch of new folders in my home directory that I don’t need and don’t want: Documents, Pictures, Videos, Templates. The Desktop folder is being deprecated. And now they make me use a Download folder (instead of sticking it in Desktop). I’m sure this can all be configured away.

Impressions of KDE4

Summary

It is usable, but not yet as good as 3.5.

Plasma

My first impression of plasma was overwhelmingly negative. I could appreciate the configurability, but found it exceptionally painful to get things organized in a way that supported my preferred workflow. I find plasma’s interaction between panels, activities, dashboards, and virtual desktops to be too complex—especially on my dual monitor setup. It’s a lot simpler with the “one activity per virtual desktop” setting introduced in KDE 4.3, but it still isn’t intuitive. Riddle-me this: 3 virtual desktops across 2 monitors with 1 separate dashboard equals 8 activity panes. It also isn’t obvious what will happen when I disconnect a display. I suspect some of the confusion is related to inconsistent behavior as a result of bugginess.

I also find plasma to be slower than KDE 3.5. Again, it is mostly the effect of zooming out to configure my activities and desktops (the slowness contributes to the feeling of bugginess). It doesn’t seem as snappy and responsive. On the other hand, there are lots of nice effects and they run a lot faster than equivalent effects under the compiz setup I played with previously (and then turned off). The effects are well integrated into system settings and much easier to navigate and tweak than under compiz.

Perhaps the problem with plasma is just having non-intuitive defaults. Things got easier once I deciphered the nomenclature (the weirdest is how they call the “edit plasmoid bubble” a “cashew”; while figuring out the desktop I started feeling an overwhelming urge to get a snack). I started over by deleting all my activities and I let the “one activity per virtual desktop” button set everything up for me. I think I had gotten myself into a bad state while playing around. Now that I’m actually able to use the setup, plasma is really growing on me. It does make it easy to do things that were previously hard to conceive.

I think the paradigm can be just as useful and a lot simpler by merging the idea of activities and virtual desktops. There should then be an option for “virtual desktop per monitor” or “virtual desktop across all monitors”.

Scorecard

Problems with Clean Solutions

  • Kopete fails to connect to Google Talk. Workaround: aptitude install qca-tls.
  • KNetworkManager doesn’t like WPA on my access point. Workaround: use wicd. Bug#: 434342
  • Default weather widgets won’t search for my city. Workaround: use plasma-widget-weatherforecast. Bug#: 434254
  • The change monitor button (Fn-F7, a.k.a. the video button) didn’t work on my ThinkPad T61. This is the same as previous version of Ubuntu (but the monitor naming changed a little bit). Thinkwiki has a solution. Essentially, drop the script into /usr/local/bin, and create a file in /etc/acpi/events/ibmvideobtn that says:
    event=ibm/hotkey HKEY 00000080 00001007
    action=/usr/local/bin/thinkpad-fn-f7
    A copy of the script is here.

Problems with Ugly Workarounds

  • Logging out crashes X and takes the keyboard with it. Workaround: reboot. Bug#: 428662
  • Can’t unlock screen. Workaround: run killall kscreenlocker from a virtual terminal. Bug#: 434276
  • Spaces break bash tab completion. Workaround: prepend command with a slash (). Bug#: 419509
  • Kopete won’t connect to jabber through a CNAME. Workaround: Use the A record or IP address. Bug#: 434214
  • Kmail can’t pass options to GVim. Workaround: use gvim -f %f as the command and lose the options. Bug#: 434180
  • Weird cups problems where cupsctl wants a password on bootup, and then reports “unathorized”. This is easy to ignore, but I got another authorization error while trying to install one of my printers—it reported my password as incorrect. It turns out that temporarily disabling apparmor with /etc/init.d/apparmor stop allowed me to get the task done. Debian Bug#: 543468.
  • Corner actions in SystemSettings→Desktop→Screen Edges conflicts with the ones in SystemSettings→Desktop→Screen Saver→Advanced Options. I didn’t log this one.

Annoying Missing Features

  • Severity 1: It does not appear to be possible to get the Application Launcher to display under the mouse pointer through a click on the background. I use this all the time, and it drives me crazy to have to move my mouse all the way to the panel on the edge of my dual-monitor widescreen display. Typing it makes it sound petty, but it drives me nuts.
  • Severity 4: Konsole doesn’t save a default window size anymore. Whatever size my last closed window has is the size the next one will open with. It’s annoying because I like my terminals to be exactly half of my screen, but sometimes I will adjust it for a specific task. Now every time I adjust it I have to fiddle it back.

Summary

The good news is that in my judgment KDE 4.3 has only one really annoying missing feature. That means that KDE 4.3 is pretty feature complete in comparison to KDE 3.5. Now that I’ve got a usable system, I’m really happy with it. Though this is definitely a usable alpha, I am anxiously looking forward to the final release of Karmic Koala. Hopefully it will include fixes to some of these problems.

Getting Back to Work

Of course the moment I pass the no-turning-back point of the upgrade, I got notified of the start of my project. That means that messing with the alpha has put me behind schedule. I’d better stop submitting bug reports and buckle-down to put my shiny new tools to work.

[ Read More | 2 comments | 0 pingbacks | , , , , , , , ]

Transitioning to Byteflow

Banjo Six Months Later

Banjo is a good foundation for a blog engine, but it needs some work. It is certainly quicker to implement than writing your own blog engine, but it is not as finished as I had hoped. I fixed a number of bugs, and the banjo maintainer was nice enough to give me write access to contribute my changes back. However, my goal was to work with a community where I could learn from experienced Django developers, and there isn’t much of a community around Banjo right now.

Discovering Byteflow

When fireant came across my blog post on Banjo, he asked me why I wasn’t using Byteflow. My answer was that I had not heard of Byteflow. I started looking into it, and it looked like a good alternative to Banjo.

My first impression of Byteflow was very similar to Banjo: lots of features, lots of potential, but it looked like a dead project. The server wasn’t responding well, the homepage news was out of date, and the mailing lists were full of spam.

Then I looked at the IRC logs and found an active community that mostly speaks an Eastern European language (Russian or Ukrainian, based on the location of the authors). When I asked a couple of questions in English, I got very friendly and helpful responses from piranha, the main Byteflow author. Not only are the Byteflow developers active, but they are open to contributions. I helped clean up the newsgroup spam, and updated the homepage to reflect the release last spring. And as I adapted Byteflow to the specifics of my installation, they accepted my patches and got them into the code base in the same day.

So far Byteflow has exceeded my expectations. Not only has it been a reliable blog engine (for the last two days anyway), it also incorporates many of the features I was hoping to implement* in Banjo. Most of all, I’ve been learning a lot from working with the Byteflow developers (piranha already showed me a few cool Mercurial tricks). That is my biggest justification for spending time on a Django blog instead of using a mature product. I’ve been the only tech guy at my family startup for the past year, and I’ve needed to find a project where I can keep my skills fresh by working with others.

* I’m finally an OpenID provider! After almost ten years, I signed up for a Slashdot account just to test it out.

Setting up Byteflow

This week I had two free days between work projects, so I decided to migrate my blog to Byteflow. The installation went very smoothly—the best I have experienced with a Django app.

Dependencies

Byteflow has no dependencies that needed to be filled outside of a typical package management system.

Base (all from Aptitude):

  • Debian Lenny
  • Postgres
  • Django 1.1 (1.0 should work)
  • Python 2.5.2
  • Apache
  • mod_python*

* I’m convinced that I should switch to mod_wsgi, but Byteflow works fine with my existing mod_python install.

From Aptitude:

  • python-psycopg2 2.0.7-4
  • python-openid 2.2.1-2
  • python-beautifulsoup 3.0.7-1
  • python-imaging 1.1.6-3

Installation

In the past the Byteflow project has announced releases, but I don’t see them packaged for download anywhere. It would be preferable to have a known functional configuration. Since it has been a couple of weeks without a series of commits to the Mercurial repository, I decided to have faith that it’s in working condition and I cloned the repo.

hg clone http://hg.piranha.org.ua/byteflow/

It is a small repo and a clean codebase. Everything worked out of the box by copying settings_local.py.template to setting_local.py, editing it to point to a clean database, running syncdb, and pointing Apache to the Byteflow settings.py. The default template came up, and a test post through the admin interface appeared.

Very easy, very slick.

Configuring Byteflow as an App

I like to keep code maintained by other people strictly separate from code I maintain. It was as easy to do that with Byteflow as with most Django apps, but did require some tweaking. The basic idea is to keep Byteflow in my shared_django_libs directory (I’ll call this PROJECT_ROOT), and have the apps Apache sees in a completely different directory tree (I’ll call my personal site REPO_ROOT).

I’ll define a couple of variables to make this easier to follow:

  • PROJECT_ROOT: my clone of the Byteflow repository.
  • REPO_ROOT: the repository where I keep my site.
  • WEB_ROOT: the Apache web root where I keep static files, .htaccess files, and other stuff serve-able by Apache. The location is REPO_ROOT/WEB_ROOT.
  • STATIC_ROOT: the directory where Django serves static files. The location is REPO_ROOT/WEB_ROOT/static.
  • STATIC_URL: the URL where Apache can see static files. It is SITE_NAME + ‘static’.
  • MEDIA_ROOT: The Byteflow settings.py differentiates between media files and static files. I treat them the same, so my MEDIA_ROOT = STATIC_ROOT.
  • MEDIA_URL: As described above, my MEDIA_URL = STATIC_URL.
  • SITE_ROOT: the directory containing my settings.py and other local Django code. It’s at REPO_ROOT/SITE_ROOT.
  • THEMES_DIR: The directory where my local themes live. It is SITE_ROOT/THEMES_DIR.
  1. Copy the default settings.py into your app (not settings_local.py).
  2. Edit your settings.py as follows:
    • At the top of the file, just before the lines where it adds ‘apps’ and ‘compat’ to the sys.path, set PROJECT_ROOT to point at your byteflow install. Then add this line:
      sys.path.insert(0, os.path.join(os.path.dirname(PROJECT_ROOT)))
    • Add variables for SITE_ROOT and WEB_ROOT. Then use those variables to define STATIC_ROOT, MEDIA_ROOT, and THEMES_DIR.
    • Remove the loading of settings_local.py.
  3. Create a file containing your SECRET_KEY, and point your settings.py to it (I used the SITE_ROOT variable).
  4. Add these lines at the bottom of your urls.py, where it can catch any URLs you don’t already deal with:
    import byteflow.urls
    urlpatterns += byteflow.urls.urlpatterns
  5. Copy from PROJECT_ROOT/static to STATIC_ROOT these directories: css, img, js.

That’s all I remember it taking. Now Byteflow plays happily with everything I’m already running.

Creating a Custom Theme

Of course the default theme doesn’t look like _my_ ugly blog. To get my distinctive look, I had to create a custom theme. It took a while to get everything looking right, but the process wasn’t really difficult. It mostly involved me merging the important parts of Byteflow’s default base.html into my existing template, and looking at the other Byteflow themes to figure out how to make changes to the Byteflow pages.

  • In THEMES_DIR, create a directory with the name of the theme you specified in your settings.py
  • It needs a base.html in that directory. My base.html includes the contents of PROJECT_ROOT/templates/base.html, header.html, and footer.html.
  • You can over-ride any template in PROJECT_ROOT/templates by having a template with the same name and directory structure in your theme. For example, I changed the way a blog post looks by copying post_entry.html from PROJECT_ROOT/templates/blog into THEMES_DIR/my_theme/blog, and editing it. You can also override templatetags by copying them from PROJECT_ROOT/templates/templatetags into THEMES_DIR/my_theme/templatetags. I changed the way the dates looked by stealing the datelinks,html from one of the included Byteflow templates. (Thanks for the tip on that one, piranha.)
  • Create a directory in STATIC_ROOT with your theme name, and then you can override the contents of css, img, and js. Took my existing CSS file, called it main.css, and then added a couple of entries to change the look of Byteflow generated elements.

Importing the Data from Banjo

Since I only had 30 or so posts to migrate, I figured I’d just do it by hand to gain experience with Byteflow’s interface and the various markup languages. It also gave me the chance to correct some typos and formatting problems introduced during the last two migrations and the use of Banjo’s unpredictable markup engine. Though I fixed a lot, unfortunately I suspect I added some new typos.

Before I installed Byteflow, I did a pg_dump on my blog database. Then I dropped and recreated the database for Byteflow. I then used that dump to enter each post through the Admin interface.

I couldn’t bear to lose the comments on my previous blog (all two of them), but the Admin UI doesn’t allow comment creation. So I submitted the comments through the blog interface, and edited the DB to have the original timestamps. Unbeknownst to me, Byteflow sent out an email for each comment alerting the original submitter that they had just created an account on my site. One of them contacted me, worried about being blamed for something they didn’t do. If you decide to do a similar migration, disable Django’s email sending ability until you complete the migration.

Problems with reStructered Text

I couldn’t use reStructured Text out of the box. I was getting weird errors that perfectly matched the bug reported here: http://code.djangoproject.com/ticket/6681

The workaround discussed there worked for me. All you need to do is comment out this line in django/contrib/admindocs/utils.py: docutils.parsers.rst.roles.DEFAULT_INTERPRETED_ROLE = 'cmsreference'

With that change, a was able to use reStructured Text on two posts, but the third had strange docutils errors showing up in my page. I didn’t have time to turn that in to a reproducible bug report, so I just switched to Markdown.

Impressions

Banjo features not in Byteflow

There are a few things I preferred in Banjo:

  • Byteflow has no concept of a “Post Summary” and a “Post Excerpt”. The entire post shows up on the home page. I prefer this, but some people might not.
  • Byteflow has a good tagging engine, but it has no concept of hierarchical Categories. Personally, I like Categories better than tags, but I’m willing to live without them for now (I’m emulating them with tags).
  • Byteflow has no concept of a post update time. This also doesn’t bother me, but some might care.
  • Byteflow can not configure the URL to a blog post in the same way as Banjo. I set Banjo up to by YYYY/slug, but byteflow insists on YYYY/MM/DD/slug. Given how rarely I post, I don’t need such a complex URL structure.

Best things about Byteflow

There is a lot to praise, but at the top of my list is the very helpful developer community (as represented by piranha). I appreciated their willingness to accept my patches and allow me to contribute.

The code is well organized and easy to modify.

I also like the way it handles comment spam. When a person posts a comment, a site account is automatically generated and an email is sent to the comment author. The comment is not viewable until it has been approved by either the site administrator or through the email sent to the comment author. In the future the author can log in to post without needing any moderation. This scheme should eliminate the majority of comment spam which is produced by people using non-legitimate email addresses. However, anonymity is sacrificed. I’m not sure if I prefer it to reCAPTCHA—that will take some thought.

Annoyances

There are a couple of design decisions that bother me a little bit, like the lack of admin control over comments and how subscriptions are handled, but these are pretty minor.

I worry about having problems with my data during upgrade, but the author is working on South integration so I’m hoping that is addressed soon.

The Byteflow.su project server responds to me only intermittently, but I’m starting to suspect it’s DNS related and might be on my end.

I’m not sure I understand the authentication system. The default template has some buttons related to authentication that mystify me (“Close”?). But it appears to be working okay.

On the whole, I have very few annoyances with Byteflow. The only big one I had (not being able to store themes outside of the byteflow root), was quickly addressed when they incorporated my patch.

Conclusion

As usual, the migration took longer than I expected, but it was less than two days of work (including research into Byteflow, documentation work, contributing changes back, playing with the CSS of my theme, and importing data). Manually importing and formatting posts took half of a long day. A clean setup without all the additional activities would take just a couple of hours.

I like how the Byteflow authors run their project. The pace of development has slowed recently because piranha is happy with the current feature set and has largely moved on to other projects. However Byteflow is not abandoned; piranha still uses it as his primary blogging platform. Since he is readily available on IRC and active on the mailing list, it is easy to discuss the architecture with him and make contributions. I am betting that I’ll be happy with Byteflow for a long time to come.

[ Read More | 3 comments | 1 pingback | , , , , , ]

Email: Password:
OpenID URL:
Forgot Login? Close