Come to the 2010 CMS Expo

February 2009

Journal Article: "At the Foundations of Information Justice"

In 2006 I started working on a paper on a concept I call "Information Justice". The idea is that information can be understood as a form of wealth, complete with a wealthy, oligarchic class and a poor, powerless lower class. If this is so, then there are serious ethical considerations to be had when it comes to intellectual property rights.

Shell script to simplify Drupal CVS module checkouts

I am finally fed up enough with the multi-step process for checking out a Drupal contrib module that I created a simple shell script to do the dirty work for me. This script is named cvs_checkout_module.sh (imaginative, huh?). In hopes that this might be of interest/use to others... here it is.

a++: Using PHP strings in unusual ways

Here's a PHP question for you: When the following code is executed, what will the output be (or will the code fail)?

<?php
$char = 'a';
print ++$char . PHP_EOL;
?>

The answer: The above will print a single line.

b

The reason for this is that an increment operation on a string increments the letter. In short, it treats strings (in this context) more like a char type as in C or Java. Well, it treats them sorta like a char. PHP has some special... behaviors when it comes to strings and incrementing operations. In this article, I'll show some of those behaviors.

Great Brewers: A new website that uses the Quiz module.

An active member of the Quiz community has just released his new website: Great Brewers. I haven't had a chance to peruse the entire website, but it looks cool from what I've seen so far (Check out the front page).

QueryPath

QueryPath is a tool for manipulating HTML and XML documents in PHP using a chainable interface. It is similar to jQuery in that respect.

A typical QueryPath script looks something like this:

<?php
require_once 'QueryPath/QueryPath.php';

Python on Mac: Using the xattr functions to get extended attributes

Have you ever noticed that sometimes when you copy OS X files from your Mac to, say, a Linux or Windows server, you get a bunch of files that begin with ._? Those are metadata files. They store extended attributes for other files. Why don't they appear on Mac OS X? Because on OS X, extended attributes are stored in the file system itself, not in auxiliary hidden files. In this article, I am going to cover how you can use Python on your Mac to access the extended attributes.

SSH Per-Host Configuration

And the "new trick of the week" award goes to... SSH configuration files.

I've been an OpenSSH user for a LONG, LONG time. I've used lots of different configuration, and connected to probably hundreds of hosts. No, I don't use a GUI interface. Yes, I prefer scp to just about any other remote copying tool. I pretty much thought I knew it all.

Turns out there was an elephant-sized hole in my SSH knowledge. One of my colleagues at Palantir.net showed me his .ssh/config file.

Testing Geshi

I am testing the GeSHI syntax highlighting library. A Drupal module is available for adding GeSHI to the input filters. So... here goes.

<?php
require_once 'QueryPath/QueryPath.php';
 
qp(QueryPath::HTML_STUB, 'title')
  ->text('This is the title.')
  ->top()
  ->find('body')
  ->text('Hello world');
?>

The above should produce output looking something like this:
 

TechnoSophos

TechnoSophos is the blog of Matt Butcher, a software developer and author living in Chicago.

Recent comments