28th Dec, 2009

No comments

How to use a Verizon USB Card with Ubuntu

I’ve been having a lot of “Hey, Linux on the desktop is pretty darn good” moments lately. Here’s one from tonight, getting my Verizon USB wireless card to work on my laptop (Dell Studio 17). Getting this same card to work on a Windows Vista netbook was a total chore, so I came at this Linux experience fearing (and expecting) the worst.

After some googling, I settled on this tutorial from ASE Labs. It almost worked. After freezing the laptop, forcing a hard reboot, editing some config files and then running a shell command, my modem worked. Once. This was exactly the experience I was expecting.

Feeling a bit of despair, I tried plan B: right click the Network Manager that sits on the Gnome panel. Hot damn. There’s a wizard for this. The functionality is built right in. So consider this post less of a tutorial and more of an informational post. I just want to tip off the next googler that they don’t have to perform any incantations to get this working.

You need to know this:
username: <yourphonenumber>@vzw3g.com (i.e. 4155551212@vzw3g.com)
password: vzw

Now right click Network manager followed by Edit connections -> Mobile broadband -> Add.

There’s very brief official documentation. The key thing to know is that Ubuntu calls this feature “mobile broadband.” Basically, the only problem with this feature is that it’s not SEO optimized for what I think it should be called.
https://help.ubuntu.com/9.04/internet/C/connecting-mobile.html

If you want to get really tricky you can even configure your laptop to act as a wireless router so that you can share your internet with people around you.
http://www.freesoftwaremagazine.com/…

16th Dec, 2009

No comments

Moderators for @iheartquotes

First, quickly, for people who follow this blog but aren’t quote enthusiasts, I want to share something that I learned from my friend Ben at Fluther. If you have a passionate community and you ask them for help, they will help you. The @iheartquotes twitter account has had a half-hearted update policy for years because I never was willing to ask for help. Then one day I said, hey, what the hell, I’m going to ask if anyone wants to be a moderator. It turns out that lots of people wanted to help out and now almost every day we have a lot of community submitted, moderator-vetted quotes.

Organizing the moderators is a whole different ballgame, which is actually why I wanted to get this post up. As moderators drop out we need to replace them and people always ask, “What does a moderator do?” So I wanted to post somewhere so people could make a decision before I set them up with all of the accounts (we use Google Groups and CoTweet).


Hello moderators,

We have a pretty simple goal–we’re taking user submitting quotes and republishing them for our wider quote-loving audience. Here are instructions for how to participate.

1. If you are a new moderator, you should introduce yourself. Let everyone know who you are and why you love quotes.

2. You will be responsible for a day of the week. You should sign up for one of the open days on the schedule page. Then, every week, when that day rolls around, you will be responsible for checking for new quotes and scheduling them to be republished on the @iheartquotes twitter account. There are a lot of people who have asked to help moderate, so if you can’t check reliably on your day, you should bow out. If skipping your day becomes a habit you will be quietly replaced.

3. To check and republish quotes, you should sign into the CoTweet.com program and:

3A. Check the scheduled outbox to see if there are any tweets already scheduled. Your goal will be to pick up from wherever the scheduled quotes leave off and then make sure there are quotes scheduled for the three days following your day.

3B. Go through the Inbox Messages.

3B. If a message is a RT of one of our quotes, check it off so that it’s archived and no longer in the inbox. Most quotes will be Retweets of quotes we’ve posted.

3C. If the message is a quote that’s reasonably good then you should schedule it for retweeting by clicking the RT button.

3D. We try to format quotes in the style below so that they are clear and while taking a minimum number of characters. Notice that it allows us to skip quotes, some whitespace, and punctuation.
I’m learning all the time. The tombstone will be my diploma~Eartha Kitt | RT @somebody

4. The process should take about 30 minutes.

11th Dec, 2009

No comments

Regex Best Practices

My book, Regular Expression Pocket Reference, has sold well over 30k copies and I’m constantly surprised how often I talk to someone who claims to have a copy of the book on their desk. The thing about that book, though, is that I’m not nearly smart enough from a nuts/bolts or math angle to be qualified to write it. I muddled through, and with the help of amazing tech reviewers and a lot more work than it should have taken, the end result is a pretty good book.

However, by virtue of not starting out as a regex expert, I have a lot more empathy for the every-day coder who just wants to get these suckers to work. So, once the book was published I started working on tips for every day use.

Here’s one of my favorites, a presentation on Regular Expression Best Practices. I think I gave this at a Perl Mongers meeting a few years ago. Excuse the Perl code, all of the ideas are universal.

The basic premise of the presentation is that regular expressions are inherently difficult to write, maintain, and get right, but that we could do much better if we applied a few simple (best) practices.

Here are the inherent reasons:
A.) They have a crummy, terse syntax.
B.) We (normal programmers) don’t use them enough to become proficient.
C.) They are applied to some dirty, hard-to-verify (that’s why we’re writing the regex) data.

Given that, we (normal programmers) then choose to ignore the normal practices of programming, practices that we use reliably with expressive clear languages that we are experts in. The presentation identifies those normal practices and then calls them regex best practices: use white space, code structure, and code verification/testing. Plus, the presentation has one of my favorite security gotchas, a favorite quote, and some common regex mistakes.