Drupal social publishing software

Drupal is a powerful content management system and framework that makes building powerful websites possible for mere mortals. Some of the posts here will be syndicated to Drupal planet.

Create custom Adjix short URLs with Alfred

Alfred.app Logo Although I use it all the time it turns I haven't written here about Adjix. There is one mention in some issues but nothing that spells out just how awesome it is. The short version is Adjix is hands down the single best URL shortener out there. While it deserves it's own post suffice it to say you can use its power and still retain a copy of your links on your own S3 drive. Future proofing at its best.

But this post isn't about that. It's about using your own custom domain and setting up a URL shortener that works from Alfred. Alfred is itself another awesome tool that deserves yet another post. Inspired by a post on Dirt Don I set out to create a url shortening shortcut. (Recursion is encouraged).

So based on this post I setup a quick shell script shortcut in Alfred. The properties end up looking something like this:

Drush away unserialize() errors

When you work with the great folks I do every day it comes as little surprise that when the stuff hits the fan and some site is in need of help there will be a legion of folks who jump into round-the-clock action to get things in a better place. While this could be a whole blog post about that alone it's not about that. Rather it's about one of those nagging little problems we came across while working on a site this Thanksgiving "holiday".

The problem is one that many have seen at one point or another:

[26-Nov-2011 22:35:17] PHP Notice:  unserialize() [<a href='function.unserialize'>function.unserialize</a>]: Error at offset 200 of 1100 bytes in /var/www/mysite/includes/bootstrap.inc on line 1104

In fact this problem pops up enough that it has its own page in the Drupal Handbook. The problem is pretty straightforward to understand. Some object was serialized for storage in the database and has become corrupted.

How to Survive and Thrive at Drupal(con) London

From the opening session of Drupalcon London. This is a handheld video but you get the idea and hopefully a more complete video will be recorded at some point. This video shot from a handheld phone isn't the greatest but you get the idea. The final 5 minutes of the video will have to be posted separately.

Thanks to the wonderful team in London for putting on a great Drupalcon. Looking forward to seeing everyone in Denver next March.

The venue video has now been posted here and is shot from a tripod and much easier to watch. The actual presentation starts at the 3 minute mark.

iPad's greatest flaw

ipad_connect_to_itunes.pngA post on Dave Winer's blog today reminded me that I've been meaning to write about the big flaw in the iPad. Actually it is a flaw in iOS but I notice it most on the iPad.

First a little background. I've had an iPad for as long as they've been around and eagerly stood in line for the iPad 2's new cameras. More than the first iPad the iPad 2 is a transformative device. It is comfortable to hold in bed to read, it has an amazing cover that just works and it's a bright white color instead of the heavy black. (How the color affects the perception of weight is another topic for another day.)

As awesome as the device is for me. It comes with a horrible flaw. This first came to light the very night I picked it up. After the headache of convincing my credit card issuer that yes it really was me staying in a hotel and buying an iPad at an Apple store I met a friend and we headed out for dinner. Being a Drupalcon dinner there were plenty of tech folks. Since the line for Chicago pizza was longer than the line for the iPad 2 we had plenty of time to talk. Eventually I succumbed to peer pressure and opened the box.

While peeling away the shrink wrap on the box (even the box is slightly smaller than the previous iPad) thoughts of taking a few pictures of the group with the new iPad came to mind. With a creative group of smart people what could we do with this new technology while waiting for a dinner with a week's caloric intake? And then all at once it happened.

Scrubbing Drupal databases for development

A couple of weeks ago I delivered a webinar on how to manage the process of moving Drupal websites from development to staging and production. The presentation gives an overview of the process including a few key points for the key pieces. Here are the key points:

  • Manage sites in code (keep configuration and updates in code)
  • Have an effective version control system
  • Test, test and run more Tests

In the presentation I covered a pair of scripts that form the basis of creating a scrubbed database for use on development machines. This is a good practice for several reasons including making sure that a development server doesn't send emails or data to Google Analytics for example.

The first piece is a shell script like this:

#!/bin/bash
# Use as ./sql_scrub_dump.sh local_db_user local_db_pass dump_file.gz

# Creates a scrubbed version of a database dump using the local database defined below as the intermediary.
# note: the dump file will be gzip compressed, as will te resulting file.

local_db=6000_temp_scrub

function db_query() {
    sql=${1}
    mysql -u${local_user} -p${local_pass} -e "$sql" ${local_db}
}

local_user=${1}
local_pass=${2}
dump_file=${3}
new_dump_file=scrubbed-${3}

mysql -u${1} -p${2} -e "DROP DATABASE IF EXISTS $local_db"
mysql -u${1} -p${2} -e "CREATE DATABASE $local_db"
gunzip -c $dump_file | mysql -u${1} -p${2} $local_db

mysql -u${1} -p${2} $local_db < scrub.sql
mysql -u${1} -p${2} $local_db < live_to_dev_scrub.sql

# Here we make sure that all the tables are InnoDB.

mysql -u${1} -p${2} -e "SHOW TABLES" $local_db \
  | grep --invert-match '^Tables' \
  | sed -e 's/\(.*\)/ALTER TABLE `\1` ENGINE = innodb;/' \
  | mysql -u${1} -p${2} $local_db

# Dump the scrubbed version and drop the temporary DB.

mysqldump -u${1} -p${2} $local_db | gzip > $new_dump_file
mysql -u${1} -p${2} -e "DROP DATABASE IF EXISTS $local_db"

If you look through what this shell script does it dumps a copy of the database and creates a new database from that dump. In the new, temporary, copy of the database transformations are performed to clean up the data. The cleaning actually happens in this line:

Connect Drupal sites to social media

Last weekend the fantastic folks at the Seattle Drupal User's Group (SEADUG) put on a fantastic Pacific Northwest Drupal Summit at the Adobe campus in Seattle. I hope to get some time to post some reflections on the many great sessions. In the meantime here are the slides from a talk Jakob Perry and I gave on connecting your site to social media.

You can download the slides here. Unfortunately the slides don't show the demo of the Gigya module for Drupal. However the demo was similar to one that was presented in the Acquia webinar a couple of months ago. You can watch it below.

Drupalcamp Atlanta 2009

Sitting at O'Hare on the way home from the inaugural Drupal Camp Atlanta. It was a great camp on the whole. The waining days of summer brought plenty of rain to Atlanta. Rain in Atlanta is a rather different experience for a life-long westerner. I hold fast to an instinctive reaction to seeing rain outside. When exiting the building the rain means it will be somewhere between chili and downright cold outside. It doesn't rain that way in Atlanta. Rather the opposite every building we exited the outdoors, rain included, was warmer. Never before have I had my glasses fog up so much in September.

While at the camp I did a presentation showing many of the new things in Drupal 7 and demonstrating the Drupal Gardens themebuilder. The presentation is attached below. There are other presentations that are more complete as well as lists of changes on drupal.org.

Popups API for Gigya Socialize module

Generally I'm not a fan of putting out distributions of modules outside of the regular release system at Drupal. In this case, however, the Gigya Socialize module depends on several small patches to the Popups API. All of the issues are in the queue and hopefully with some review will be worked on and ultimately accepted. However to stem the tide of email requests on how to patch a module I'm going to provide a patched version here. This uses today's Popups API 6.x-2.x branch from CVS with the four patches listed on the Gigya Socialize module page included.

Note I do not plan to update package. The package is only an interim stopgap until some action is taken on the issues in the queue.

Pages

Subscribe to Joshua Brauer: All Drupal items Subscribe to Joshua Brauer: Drupal Planet only