Categories
Economics Main

The value of free

I just bought Norah Jones’s latest single “Thinking About You” from Yahoo Music, a good song made better by the fact that it’s offered in 192 kbps unprotected MP3 format. That is, there’s no Digital Rights Management (DRM) to “control” it. The publishers take the risk that I’ll (illegally) share the song with all my friends and the world at large, while I Mr. Consumer enjoy the play-anywhere convenience.

The Wall Street journal reports that Yahoo Music General Manager David Goldberg favors unprotected downloads:

Antipiracy software on music isn’t helping the industry because the same music is already available without copy protection on CDs and through Internet file-sharing programs. What’s more, many consumers don’t like the limitations that copy protection imposes on how and on which devices they can listen to their music. (The Wall Street Journal)

This also allows Yahoo Music to compete with the iTunes Music Store since these unprotected MP3 files will play on any iPod.

This week on Forbes.com Cory Doctorow, sci-fi author and co-founder of BoingBoing.net, explains the value of giving away something for free. He invokes Tim O’Reilly who said, “Obscurity is a far greater threat to authors and creative artists than piracy.”

As a consumer, I have too many choices and not enough attention span. To win my attention, give me something for free. To win my wallet, make it easy to buy and consume your product.

Categories
Main Well-being

Being present

While home in Las Vegas, my father and I discussed the benefits of “being present”. Peace of mind comes from not being worried about the past and not being overly anxious about the future. Enjoy the now.

I’m most present when I’m riding my motorcycle. I’m almost never in a hurry — it’s about the ride, not the destination — so it’s immensely satisfying. Jeremy Zawodny feels a similar “peace, focus, and mental calm” while flying a plane. (In his words, the imminent threat of death is a factor.)

In fact, it’s a measure of faith to know that the past is forgiven and the future will take care of itself.

Categories
Main PHP

Report on PHP Hacker Night

Last night John, Jonathan, Alvaro and I got together to talk PHP over dinner and dessert. I had fun and learned a lot. Here are my notes:

  • Sitening is a web development consultancy with a bunch of cool online tools and what appears to be a good blog. (I haven’t read it yet.) John printed a post from their blog about databases and PHP. I’m going to subscribe to it.
  • We talked about Qcodo, a code generator that John likes because it’s simple.
  • Alvaro really likes Propel for creating database objects to perform CRUD operations. It’s “intuitive” to use.
  • We discussed apt-get vs. yum, with the winner being apt-get.
  • We discussed Ruby on Rails and the similar frameworks for PHP such as Cake, Symfony, and PHP on Trax. John and Alvaro think these frameworks are too limiting, though if the scope of your project falls within the conventions of the framework they can be nice. They both prefer a lighter-weight framework.
  • Alvaro is building a custom, light-weight framework that will be simply combine Propel and Smarty. He’ll release it at protonframework.com when it’s ready.
  • Alvaro recommends the Selenium Firefox extension for code testing and automation. It can record each of your steps as you use your web app, then you can set up assertions (unit tests?), then you can run the recorded tests each time you make changes to your web app. This seems like a great way to test web apps consistently and thoroughly. I’m looking forward to trying Selenium.
  • We discussed the virtues of SVG and lamented that Internet Explorer doesn’t have better support for it. John uses SVG extensively for creating reports and modeling streets and traffic flow in his work.
  • Alvaro really likes XPath, a language for querying an XML document. On the browser side, XPath is useful for finding a certain node in the DOM. Firefox has a built-in Javascript function for running XPath queries on the DOM.
  • With AJAX John can change SVG reports in real time by changing the specific DOM node that needs to be updated. XPath could be useful here.
  • On the server side, XPath is useful for screen scraping. You can retrieve an HTML page, run it through Tidy to convert it to XML, then use XPath (through the PHP DOM library) to query it. Alvaro says its easier and more portable than writing regular expressions, which is how I currently do my screen scraping.
  • There are Firefox extensions for working with XPath. They allow you to click anywhere on a web page and see the XPath query that would retrieve that element.
  • Martin Fowler’s book was recommended.
  • By using the Apache directive “ForceType”, you can forgo the “.php” extension on your files and create pretty URL’s. (ALL of your files are parsed for PHP.)

The food was good and the company was excellent. I look forward to doing this again.

Categories
Main MediaWiki MySQL PHP Tech

Password protecting MediaWiki with mod_auth_mysql

MediaWiki is the powerful software on which Wikipedia and many other sites are built. It does not, however, come with the option to password protect pages from being viewed. (It can password protect pages from being edited.)

If you need to setup a private, members-only wiki for internal use, here is how you can do it with MediaWiki software and the Apache server extension mod_auth_mysql:

1. Install MediaWiki as usual. Create a user account for yourself.

2. Add the following line to your LocalSettings.php file, located in the root of your MediaWiki installation. This will cause MediaWiki to use a simple MD5 hash for user passwords in the database, instead of the more complicated “salted hash hash” that it normally uses.

$wgPasswordSalt = false;

3. Activate mod_auth_mysql in Apache. This is usually done with a LoadModule line in your Apache configuration file (httpd.conf), provided the module is available. (If not, you may need to compile or download the module.)

LoadModule mysql_auth_module libexec/apache2/mod_auth_mysql.so

4. Create a new MySQL user that has SELECT access to the “user_name” and “user_password” fields in the “user” table of your MediaWiki installation. Apache will use this MySQL user for connecting to the MediaWiki database.

5. Configure mod_auth_mysql to use the MediaWiki user table for authentication by placing the follow directives in your Apache configuration file:



AuthName "This wiki is password protected (make sure the first letter of the username is Uppercase)"
AuthType Basic
require valid-user
AuthMySQLEnable On
AuthMySQLHost localhost
AuthMySQLUser unprivilegeduser
AuthMySQLPassword thesecretpassword
AuthMySQLDB mediawikidatabase
AuthMySQLUserTable user
AuthMySQLNameField user_name
AuthMySQLPasswordField user_password
AuthMySQLPwEncryption md5
AuthMySQLAuthoritative On

6. Restart Apache.

Your installation of MediaWiki should now be password-protected, but your username and password will let you in. This protects the entire wiki; no one will even know that MediaWiki is present until they login. To give other people access, you can either create user accounts for them, or you can create a guest account that they can use until they sign themselves up.

P.S. Thanks to Gary Thornock for helping me with the details of installing mod_auth_mysql on FreeBSD.

UPDATE (2008-09-11):
The latest version of MediaWiki (version 1.13) uses a new password format which is incompatible with mod_auth_mysql. It prepends “:A:” to each MD5 hash. Here is a workaround:

1. Create a MySQL view that mirrors the username and password, minus the prefix:
CREATE VIEW user_view AS SELECT user_id, user_name, substring_index(user_password, ':', -1) AS user_password FROM user;
2. Configure mod_auth_mysql to use user_view instead of user as the lookup table.

Categories
Main

CTO Breakfast

Last Friday was the monthly CTO Breakfast with Phil Windley. There was a big crowd, as usual, and good discussion.

Phil gave three people time to demonstrate “something cool”. The first was a demonstration of the new desktop version of Suse Linux with Expose-type features and cool desktop switching. The second was a demonstration of some of the new mobile offering from SCO. Both presentations seemed too “salesy” but both were interesting.

The third presentation was from Dallan Quass, demonstrating his new genealogy website called WeRelate. He’s doing very interesting things with WeRelate. It is a user-editable Wiki of genealogical information as well as a search engine. If you edit the Miller page to indicate that “Muller” is a common variation of “Miller” then the search engine will look for those pages too. (As a Mormon missionary in Brazil my name was often pronounced Müller.)

After the presentations there was great discussion. Here are my notes:

  • Groovy is an open source, dynamic interpretation of Java. It uses the same library. Grails is a Rails equivalent for Groovy.
  • I mentioned Twaingle, though I didn’t remember the name, which is a mashup between Flickr and a TWAIN driver.
  • Popcorn from Roxio makes it easy to get videos onto your iPod.
  • Malcolm Gladwell’s book Blink inspired Bruce at SCO to do “blind interviews”. When doing job interviews he puts a whiteboard between himself and the candidate so as to not be influenced by visual impressions. He said it has helped.
  • We are becoming “cyborgs” in a way — our exocortex is a combination of Google, our email, and other online resources that presumably make us faster and more efficient.
  • Scott Lemon referred to the overhead of phone calls as a “human politeness protocol overhead”. It’s much faster to use chat or Nextel’s Direct Connect than email or a phone because you don’t have to go through the pleasantries of hello and goodbye.
  • Croquet is an open source online game being developed by computer scientist Alan Kay. Will be a great learning tool for children and a model for studying distributed parallel computing.
  • In Croquet, any movement by a character is transmitted to all other machines, even if the movement isn’t rendered. A representation of the loss of privacy?
  • In Croquet, voice chats are muted depending on how close you are to the other person. If you whisper, others won’t hear you. (Spatial volume control.)
  • Bruce commented it would be nice if a 3D fly-through of his projects was automatically generated from code, the way documentation is generated. I wonder if Google Sketchup could be a start.
  • In Second Life, each server represents 16 acres of virtual land.
  • Squeak is a Smalltalk derivative that can be used to teach programming to children.
  • Scott said the current model of programming won’t survive. U.S. computers science students won’t be coders, the same way U.S. auto workers aren’t metallurgists. Americans in the tech field will have to be concerned with higher level architecture and management since an army of programmers in India, the Philippines and elsewhere will do the coding for so much cheaper.
  • In the Philippines, $2700/year is average salary. In India, $5000/year.
  • Someone mentioned that they were testing job candidates by asking them to conceptualize a double linked list, a task that ought to be easy for any computer science student. Most failed.
  • Phil Burns asked if candidates were allowed to call for help or use the Internet, since that models real life.
  • Phil said Provo Labs is starting to hire based on candidates’ networks — the size of their LinkedIn profile and their address book. If technical help can be outsourced and answers found online, it doesn’t make sense to hire based on skill alone.
  • Will the future bring people together temporarily (1099 employees) for ad-hoc projects, then disband?
  • In some cities it’s common to see workers gather in the morning at a corner, then a work truck will come by, ask for several of them, and then the group will disband. Will technical projects approach that? It’s possible to find temporary help for any technical skill online. Labor as a liquid asset.
  • See Future of Work by Thomas Malone