Great advice

that I’m clearly not following.

Posted in Uncategorized | 1 Comment

The Laptop-with-Roaming-Services Problem

This is a quick solution to the problem of hosting services on a roaming laptop that need to be semi-reliable and available. When switching connections from wired to wireless (or vice versa), services like ssh need to remain available and active connections should remain connected (albeit with maybe a brief disruption). The solution is to transfer an assigned static IP to some secondary interface (e.g. wlan0) whenever the primary interface (e.g. eth0) becomes disconnected.

The result is nm-connection-delegation, a simple set of scripts that hook into Network Manager events if-up and if-down. To use, simply extract into /etc/network on any Debian or Ubuntu based system:

sudo tar -C /etc/network -zxf nm-connection-delegation-0.1.tar.gz

And configure a few values in /etc/network/connection-delegation. Note that this solution only works when both primary and secondary interfaces are on the same subnet.

Posted in Uncategorized | Leave a comment

Saving Orphaned Terminal Applications

No longer does it require a degree in UNIX voodoo to save shell processes which have become detached from a controlling TTY. Meet reptyr.

Posted in Uncategorized | Tagged , | Leave a comment

Dedication to Open Source Software

Ran across this comment in Eye Of Gnome bug #78514:

I would like to extend my thanks to the gnome team/community for a great last
moment with my dad.

Adrian Hands (my father) wrote the patch above to improve the usability of
gnome for himself and others. You see my dad was suffering from ALS and his
hands were so crippled he could no longer use a keyboard. Thus we used a Darci
usb morse code keyboard emulator to help him type. Even the morse code device
was a struggle as the sensitivity adjustment and positioning of the nice two
paddled key would fall out of whack. I rigged up a pvc cage that wrapped around
his knee and fixed remote switches to the cage so that he could use the
remaining strength in his legs to operate the Darci morse code device. He used
this last bit of body movement to write this patch.

Here is a photo of him using it:

https://picasaweb.google.com/HandsAdrian/ShotwellConnect#5549467460761802914

My father passed away yesterday. I went back through my email to find our last
correspondence (he was in India for treatment, and I live in Raleigh). I would
like to share the email with you.

On Sun, Jan 30, 2011 at 12:16 PM, Adrian Hands wrote:
> ACCEPTed
> COMMITed
> RESOLVEd
> BOO-YAH!
>
> commit 0b209b1ff16e863e60a1d86413aa57c5fbde76b0
> Author: Adrian Hands
> Date: Fri Dec 31 14:34:58 2010 +0100
>
> Add Copy Image and Copy Path to clipboard functionality
>
> Fixes bug 78514.
>
> data/eog-ui.xml | 9 +++++++
> src/eog-window.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 72 insertions(+), 0 deletions(-)

I have the coolest Dad in the world!

I am so glad that my last comment to my Dad was something like this.

Adrian Hands loved free software / open source. I do as well.

Thanks so much for the great software, and a new great memory.
-Ian Page Hands

Posted in Uncategorized | Leave a comment

Efficiency

A Slashdot gem:

Oh, the jobs people work at! Out west, near Hawtch-Hawtch, there’s a Hawtch-Hawtcher Bee-Watcher. His job is to watch… is to keep both his eyes on the lazy town bee. A bee that is watched will work harder, you see.

Well…he watched and he watched. But, in spite of his watch, that bee didn’t work any harder. Not mawtch.

So then somebody said, ‘Our old bee-watching man just isn’t bee-watching as hard as he can. He ought to be watched by another Hawtch-Hawtcher! The thing that we need is a Bee-Watcher -Watcher!’

Well… The Bee-Watcher-Watcher watched the Bee-Watcher. He didn’t watch well. So another Hawtch-Hawtcher had to come in as a Watch Watcher-Watcher!

And today all the Hawtchers who live in Hawtch-Hawtch are watching on Watch-Watcher-Watchering-Watch, Watch-Watching the Watcher who’s watching that bee.

You’re not a Hawtch-Watcher. You’re lucky, you see.

Posted in Uncategorized | 1 Comment

My Feeds

Sounds and Pictures

Blags

Posted in Uncategorized | Leave a comment

Localization is a lot of work!

But satisfying. I’m finally calling elana.braun-jones.org localized enough and I have to say that it is cool to have an identical feature set in two fully localized versions (en_US and fr_FR). Just some of the tasks to get the site fully localized:

  • Make the FreeDream theme localizable by wrapping all the text in __(…) or _e(…) GNU gettext wrappers. Ironically, the theme was written by a French lady who hard-coded some French strings that I had to first translate to English so that I could then …
  • Translate the FreeDream theme to French. I used Poedit which has a mediocre UI, but it met my minimum requirements. This tool scanned the theme’s PHP source and generated a .pot/.po. I commissioned some help to get the strings translated then generated the .mo file (poedit actually does this automatically every time you save) and uploaded to the theme’s directory. Things looked good, but there were still some miscellaneous strings still in English. To zap those, I had to…
  • Install WPML and translate some more. WPML is the key ingredient that makes translating a WordPress site manageable. And it does so without mucking up the default WordPress SQL tables. Aside from providing nice interfaces that allow you to translate all your own content (posts, categories, and pages), it also hunts down those miscellaneous strings that I mentioned and provides a web interface to translate them. You can even export .po/.mo files when you’re done. Very cool. This is the feature that makes it easy to…
  • Localize custom site features. Since WPML can translate Text widgets (which can hold HTML and even PHP) I was able to add a growth chart generated by Google Chart that displayed inches or centimeters based on the locale. In the same way, I added a MailChimp RSS-to-Email subscription form that subscribed users to the correct list – an English one connected to domain.com/feed/ and a French one connected to domain.com/fr/feed/.

And voilà.

Posted in Uncategorized | Tagged , | Leave a comment

!$


YouTube Link:

Posted in Uncategorized | Leave a comment

World’s smallest USB drive… now even smaller!

The PQI i810 claimed to be the smallest drive on the market at one point (I’m not sure if they still do). But having just made a chicago screw compact keychain, I no longer had a spot on my keychain for it. Small wasn’t small enough. Also the spring clip that holds the protective housing in place when expanded or contracted had just broken so I decided to do away with the housing completely.

I was a simple job with needle nose pliers and a utility knife and now I have a wallet-size USB drive:

Posted in Uncategorized | Tagged , | Leave a comment

Stop #@$!ing up my last name!

My last name is not:

  • Braun-jones
  • Braunjones
  • Braun Jones

Yet those were my options according the the person responding from info@reunion-specialists.com. I fully understand the problem they face1:

Sorry about the limited options, alumni were entering their names with all caps or all lower case and the name badges looked terrible so we wrote this rule to keep things as consistent as possible.

But their solution is pathetic: always capitalize the first letter and any subsequent letter that is preceded by a space. Since the support contact at Reunions Specialists was completely unapologetic and not even willing to fix my name by hand, I decided to stop for 15 minutes and spoon feed the webmaster of the reunion-specialists.com. A very good (but not perfect) solution is not difficult to design if you just realize that (1) virtually no surname consists of all lowercase or all uppercase and (2) almost all mis-capitalization is due to the use of all lowercase or all uppercase. So, if the entered surname contains mixed case, the user probably meant for it to be that way. If not, do your best to guess the correct capitalization, but since the user didn’t even care enough to type it right, don’t feel bad if you don’t get it perfect. Here’s a basic PHP implementation:

function CapitalizeLastName($name) {
    /* Only try to "fix" the capitalization if it is wrong */
    if (strtolower($name) == $name || strtoupper($name) == $name) {
        $name = strtolower($name);
        $name = join("'", array_map('ucwords', explode("'", $name)));
        $name = join("-", array_map('ucwords', explode("-", $name)));
    }
    return $name;
}

This gives pretty decent results:

braun-jones -> Braun-Jones
BRAUN-JONES -> Braun-Jones
Braun-Jones -> Braun-Jones
St. Jean -> St. Jean
st. jean -> St. Jean
ST. JEAN -> St. Jean
de cordova -> De Cordova
De Cordova -> De Cordova
de Cordova -> de Cordova
McDonald -> McDonald
o'reilly -> O'Reilly
O'Reilly -> O'Reilly
O'REILLY -> O'Reilly
Brown -> Brown
BROWN -> Brown
brown -> Brown

  1. Well, not really. They are charging $80-100 per person to attend a high school reunion so I know they have the funds to do old-fashioned human input validation. []
Posted in Uncategorized | Tagged , | Leave a comment