April 2010

Video: A Developer's Introduction to Drupal

A few weeks ago I did a webinar for PHP|Architect and the Tek-X conference. The webinar was recorded, and is now available as a video. You can watch the presentation on A Developer's Introduction to Drupal at their site.
Drupal Intro WebinarDrupal Intro Webinar

The presentation is aimed at developers who are just getting started with Drupal and want to know how things work and where they can dive in.

Lots of thanks to Cal Evans and the PHP|Architect crew, all of whom were awesome to work with.

Linux/UNIX/OS X: How to find and combine multiple files

This explains how to use a UNIX-like command line (including Linux and OS X) and the find command to search through a subdirectory and find all of the files with a certain extension, and then combine those all into one file. Surprisingly, this isn't a difficult task. It can be accomplished with one command on the command line:

$ find ./src -name '*.txt' -exec cat '{}' \; > test.txt

The above looks through everything in the ./src directory (including all subdirectories) for any files with the .txt extension. Each file it finds, it adds to test.txt. So at the end of the command's run, all of the text files will be combined together into text.txt. You can use this strategy to easily combine lots of files into one.

Using find, it's easy to customize the command above to do all kinds of things with files. I gave a few examples in an earlier post about the UNIX find command.

mkdir: Creating multiple subdirectories in one command

Often times, I want to create a full directory structure, and I'd like to do it with just one call to mkdir. That is, I want to create a root directory and multiple subdirectories all at once. Here's how to do this.

mkdir -p myProject/{src,doc,tools,db}

The above creates the top-level directory myProject, along with all of the subdirectories (myProject/src, myProject/doc, etc.). How does it work? There are two things of note about the command above:

  • The -p flag: This tells mkdir to create any leading directories that do not already exist. Effectively, it makes sure that myProject gets created before creating myProject/src.
  • The {} lists: The technical name for these is "brace expansion lists". Basically, the shell interprets this as a list of items that should be appended individually to the preceding path. Thus, a/{b,c} is expanded into a/b a/c.

You can nest brace expansion lists. That means you can create more complex sets of subdirectories like this:

mkdir -p myProject/{src,doc/{api,system},tools,db}

Notice that this creates two directories inside of doc/.

Blackboard UX Fail! How not to label buttons.

Several times in my experiences with Blackboard, I have accidentally clicked the wrong button. In Blackboard's forum thread editing screen, there are both Save and Submit buttons.
Blackboard Save and SubmitBlackboard Save and Submit

There are three problems with this display:

  • Both button terms are ambiguous (Save to what? Submit to for what?)
  • These terms are often used interchangeably
  • The buttons are right next to each other with no contextual distinction

Configuring Static IPs on a Comcast SMC Router

I have recently been working on configuring a business-class Comcast SMC router to make use of a group of 5 static IPs. The documentation I found was sparse, and I spent a few days figuring out how to do this.

Turns out that it is very simple.
Configuring the FirewallConfiguring the Firewall