Monthly Archives: March 2008

Power of Example (and the Long View)

Martin Sexton

Power of example
My mama said it and I heard
She says one ounce of action
Beats a ton of words.

Martin Sexton, “Hallelujah”

Richard Stallman

[...] I didn’t write a whole free operating system, either. I wrote some pieces and invited other people to join me by writing other pieces. So I set an example. I said, “I’m going in this direction. Join me and we’ll get there.” And enough people joined in that we got there. So if you think in terms of, how am I going to get this whole gigantic job done, it can be daunting. So the point is, don’t look at it that way. Think in terms of taking a step and realizing that after you’ve taken a step, other people will take more steps and, together, it will get the job done eventually.

Assuming that humanity doesn’t wipe itself out, the work we do today to produce the free educational infrastructure, the free learning resource for the world, will be useful for as long as humanity exists. If it takes 20 years to get it done, so what? So don’t think in terms of the size of the whole job; think in terms of the piece that you’re going to do. That will show people it can be done, so others will do other pieces.

Richard Stallman, Free Software, Free Society, p153 (155 in PDF)
   ”Copyright and Globalization in the Age of Computer Networks”
   19 April 2001 speech and Q&A at MIT

Richard Feynman

“We are at the very beginning of time for the human race. It is not unreasonable that we grapple with problems. But there are tens of thousands of years in the future. Our responsibility is to do what we can, learn what we can, improve the solutions, and pass them on.”

Richard Feynman

The Long Way Home

Benjamin Franklin

Taking the longer view of humanity’s future, it seems obvious that we should be pursuing free software development and sharing knowledge freely. With proprietary software, we’re always going to have this exclusionary scab over everything that can’t be picked. (Although that’s not a good metaphor because a scab is actually a good thing.) People will spend a lot of time recreating things that aren’t available for free use, instead of taking what’s already there and improving it.

With free software, the solutions are available for everyone to improve.

How much better if we collaboratively build things from which everybody can benefit, immediately. Because even if all things eventually pass in to the public domain, they won’t be available for free use and sharing when it really matters. Sure, many things that enter the public domain (a long, long, long time from now) will still be valuable, but much will be lost, and much software technology will be moot.

We’ve had a long time to learn how to deal with a world of scarce goods, and that’s what most people understand. Scarcity. But I think our solutions will come more slowly until it’s widely understood that we shouldn’t try to create artificial scarcity for information (including software), knowledge, and ideas.

We’ll get there. A growing number of people understand. We’re slowly building up the free world. It’s great advice to not get overwhelmed by the job ahead, but just take steps toward the goal. Set that example. Improve those solutions.

And please share your solutions freely!

Python: Regex Test Function

'Learning Python', by Mark Lutz 'Mastering Regular Expressions', by Jeffrey Friedl

More fun with Python and regular expressions. Following up on a previous post, I wanted to share a little test regex function I wrote in Python to help me as I work through the regular expression book.

I’m mostly working at the interactive prompt and had been running commands from Python re (the regex module) as I experimented with different regular expressions. This was good as I spent time in help(re) and built up some muscle memory for Python regex functions, but it was becoming repetitious to keep typing the commands for analyzing the results of a match. Once I started learning about writing functions in Python, I realized it was time to enhance my regex learning experience with a simple Python function.

I know there are sophisticated regex tools out there and probably simple functions that do more than this, but it was fun to cobble the function together and learn more about Python in order to learn more about Regex. So far it’s proven helpful in understanding how regular expressions work. I hope it may be of use to you also.

Function Definition

The function will print whether there is a match or not, starting and ending positions along with the matched part of the string for each match, captured strings (groups), and then finally will do a global search and replace on the string and print the result.

match(pattern, string[, repl])

  • pattern: the regular expression
  • string: the target string to be matched against and replacements made against
  • repl: the optional string to use for replacements (default = _._)

(I would have preferred putting repl before string to match the re.sub parameter order, but I switched them to make it an optional last argument.) I put the function in a file named imisc.py (interactive miscellaneous) that I import into an interactive session to make regex experimentation more convenient.

Keep reading below the fold for examples and the actual function!

Continue reading

3rd time not quite a charm: Upgrading to Ubuntu 7.10 (Gutsy Gibbon)

The other night, sort of kind of on a whim, but not really, I upgraded my main machine from Ubuntu 7.04 to 7.10. There were some problems, but in the end, not very serious. No need for panic.

I’d upgraded my laptop when 7.10 was released, and that went fine. The plan for my other machines is to keep current, but to wait until the end of the six month release cycles, hoping that things will be more stable by then. After realizing that 8.04 will be coming out before long, I decided to upgrade my system76 box over the weekend, and that went pretty well. (My second upgrade on that one: 6.10 » 7.04 » 7.10.)

I was more apprehensive about upgrading Zodiac, however, since I’ve installed so much more stuff and there would be more opportunities for things to break. This would be my first OS upgrade on my primary machine since switching full-time to GNU/Linux back in June 2007. On Tuesday I just decided to go for it, without doing anything to prepare up front. (The same plan I had used for my other upgrades.)

The install process went very smoothly, and much the same as it had for the other machines. There were occasional prompts to keep or replace various config files, but for the most part everything hummed along. And then finally, a restart, and as text started scrolling up…

An error related to the VirtualBox driver, and…

Some error, something like: “Can’t display this video mode,” with the GUI not starting up and the screen flashing between text and blank screen. Oh, crap. I had a sinking feeling, but I tried to remain calm. I got in to recovery mode from the GRUB menu, and then I remembered from previous experience that deleting xorg.conf will usually get you back to some kind of usable GUI mode. (Backing it up first, of course!) I did that and got in to X, which was reassuring: Things probably weren’t that hosed.

And then I realized why I was being punished: I had installed the proprietary nvidia display drivers in order to get my dual monitors working with less fuss last summer when I made the big switch. That had to be it. From there it didn’t take long to reinstall and get dual monitors back after some fiddling and finally restoring an old xorg.conf file. (Yeah, yeah, I’ll eventually work on free video drivers also.) I was impressed with how well the nvidia installer works. It lets me be a dummy about that whole part of the system.

Other than that, the upgrade was pleasantly uneventful, with just a few minor wrinkles. Phew! Should be good to go for another six months.

Goals: Learning Python and Regular Expressions

'Learning Python', by Mark Lutz 'Mastering Regular Expressions', by Jeffrey Friedl

I don’t want to go all 7 Habits of Highly Effective People on you, but I’ll say this: I think it’s good to have goals and to work towards your goals.

I like this quote, which I’ve seen attributed to Zig Ziglar:

“Most people fail to reach their goals not because their plans are too simple or too complicated. Most people don’t reach their goals because they’re not committed and willing to follow their plans.”

I think that’s very true. There are so many things I haven’t done because I didn’t follow through on a plan.

What this means for you, loyal reader, is that one of the reasons I’m not accomplishing the goal of writing more for the web site (including a write-up of my trip to Boston for the FSF meeting) is that I’m working towards other goals of learning Python and more about regular expressions.

These two books are great:

I’ve had Mastering Regular Expressions since 2006, and although I started on it with interest then, I eventually set it down and found that a year and a half went by before I began thinking about it again. I received Learning Python in December 2007 as payment for a Free Software Magazine article and started working on it over Christmas vacation, but then it fell by the wayside for a few weeks.

This often happens with technical books. I rarely work all the way through them. Something else comes up and they become relegated to the reference shelf. I also learn a lot by doing and using the Internet to figure things out as I go, but I like following a more structured approach if I can find a good book. It can help with getting a solid introduction and learning some good habits.

I didn’t want to let Python slip away. It was fun. I wanted to keep learning.

A Simple Plan

So I decided on a simple plan. My goal is to get through two pages a day in these two books. I have a calendar printed out that has the months arranged by rows (see: “1 Page Color Landscape”), and I’m marking down my current page numbers at the end of each day.

Two pages a day? That doesn’t sound like much, you might be thinking. I agree, but it’s a plan I may be able to follow. The Python book is 645 pages, and the regex book is 484. I can finish them both in less than a year. If I had followed that plan for MRE in 2006, I would have long ago finished it. (And I can skip some parts, like the .NET chapter in MRE.)

I find that the calendar helps with my motivation. I want to fill in the little squares each day. The other night I had cracked the regex book but not Learning Python, and even though I was tired, I opened it up and read a couple of pages. (It helped that they were descriptive pages and didn’t have examples to be experimented upon.)

And of course, once you get the ball rolling with a plan like this, you end up doing more than two pages a day. Since starting to mark my calendar a week ago, I’ve worked through 50 pages in each book. The key is to make progress every day. (Or very nearly every day.) Keep your head in the material.

It feels good to be accomplishing something. But alas, this kind of focus crowds out other things, like writing here.

The two books tend to complement each other, since I use Python for experimenting with regular expressions. The Python book barely mentions regex, so it’s a good opportunity to poke around in the Python documentation and learn my way around the help system there. I was going to end with a Python function I created today for regex testing, but seeing how long this grew, it’ll wait for another day and its own entry.

Related

Back from Boston

And I’m back from the FSF meeting at M.I.T. in Cambridge. The trip went well, I enjoyed myself, and will have more to say later.

One of the highlights was meeting Richard Stallman in person. I think he is a great man, and history will recognize him as a hugely important and influential person. No matter that he can be difficult and off-putting in various ways. It was an honor to shake his hand and thank him for what he’s done and is doing for software freedom.

But time is short and I’ll work on posting later when I can. In the meantime, you might enjoy this picture of Boston over the Charles River, taken from the Longfellow Bridge to Cambridge.

2816 x 2112

Boston, Massachusetts over the Charles River

Shared under the Creative Commons Attribution Share-Alike 3.0 License.

Me and You and a GPG Key Named Boo

“Travellin’ and livin’ off the web…”

I have a GPG key, freshly created a couple of days ago. GPG is the GNU Privacy Guard, also known as GnuPG, used for encryption and digital signatures.

Many people include helpful comments about GPG encryption on a page with their public key and fingerprint. Instead of making similar remarks (which I don’t feel qualified to make), I’ll point to some examples: Karl Fogel, Peter S. May, and Henrik Lund Kramshoej.

I’ve read Karl’s page with interest in the past, and revisited it while preparing my own GPG key page. His comments have been influential in adding to my doubts about using the software and keys properly. I found Peter’s and Henrik’s pages recently in Google search results as I’ve been reading about the subject. All three have wise words of caution and advice about using GPG for encryption and digital signing. Peter and Henrik further get in to the concept of the “web of trust” in public key cryptography. Peter’s page is detailed and he appears to be quite conscientious about being a good participant in this web of trust.

(There is also PGP. Both programs implement the OpenPGP standard, but PGP is not free-as-in-freedom so you should use GnuPG.)

So what’s the point of this page?

Well, to refer you to other sources of information, for starters, and to talk about my shiny new key, reasons for creating it, reasons for attending key signing parties, and lay out my rudimentary key signing policy, which I hope will make the case that I intend to be an upstanding cryptizen* and follow good key signing practices.

However, while not a stranger to GPG, I’m pretty new at key signing and web of trust stuff, so my proclamations and methods have to be viewed with skepticism. You can read this post and perhaps draw your own conclusions.

Why a key now?

I haven’t previously had much (if any) personal need for encryption or signing using GPG, but now seemed like a good time to create a key pair before going to the FSF meeting in Cambridge next weekend where I might gather a few signatures.

That might be an answer for “why now?”, but doesn’t really answer the question of why I need a key at all. Why do I want to use GPG? And it suggests another question: Why do I care about getting signatures for my key? I think my primary motivation at the moment is community. Even though I don’t have an immediate need in mind, being trustworthy (at least with respect to my participation in the web of trust) may help me be a better free software community member.

Continue reading

Heading to Boston for an FSF Meeting

Well, Cambridge, actually. The Free Software Foundation is holding its Annual Associate Member Meeting at MIT on Saturday, March 15. (You can become a member and go also!) ;-)

I started mulling over the idea of attending last month. It occurred to me I might be able to get a deal on a flight with my paltry 31K NWA miles, and that it would be good to get out and do something different. Being on a weekend, I wouldn’t need to take much time off from work. So, with permission from my patient, gracious, and lovely wife, it all came together.

I’m really looking forward to meeting some free software folks. Are you planning on going? :-) Also keeping my ear out for an informal meetup on Friday night, hopefully near MIT since I’ll be staying in the area and without a car.

Weather permitting, I’ll be walking around Boston on Friday and trying to get a bunch of touristy photos to share here and elsewhere. Recommendations for good photo opportunities are welcome. I’m thinking I’ll start out somewhere in the area of Boston Common and work my way towards my hotel over in Cambridge. Get a good 4-6 miles of walking in. Of course, this is assuming it’s not raining/snowing/freezing that day.

I’m usually not a light packer, but I’m hoping to get everything jammed in to one backpack for ease of travel. I haven’t flown for over two years, which was before all this silliness with the 3-ounce containers and quart-size plastic baggies. Should be… fun. I’ll resist the urge to bleat. “Bahhhh. Yes, sir/ma’am. Yes, I’m so happy to take my shoes off. Bahhhhh. Gee, I feel so safe. I’m not resentful at all of the petty power you hold over me. Bahhhhhhhhhhh.”

Photo Attribution

Thanks to ReneS for sharing “Boston at Night” under a free license: Creative Commons Attribution 2.0.