wpmufunctions_iconI’ve been having a heck of a time battling sploggers at UCalgaryBlogs.ca – roaches that create accounts and blogs so they can foist their spam links to game Google (thanks for providing spammers with such a powerful incentive, Google).

There’s an option in WordPress Multiuser to ban email domains – provide the domains, one per line, into a text box, and it will reject any roaches trying to create accounts from those domains.

The biggest offenders have been myspace.info and myspacee.info – and although they’ve been in my Banned Email Domains list for months, they just keep getting through. I figured there was some exploit they were using, but couldn’t find a thing.

So, today, I took a look through the code of WPMU 2.8.4, to see if I could find what was going on. Turns out, it’s a really simple fix. There’s a function in wp-includes/wpmu-functions.php, called is_email_address_unsafe() – it’s supposed to check the contents of the Banned Email Domains option field, and reject addresses from the flagged domains.

Except it wasn’t. Rejecting, I mean. It was letting everyone through, because of a simple bug in the code. It was written to treat the value of the option as an array and to directly walk through each item of the array. But, the option is stored as a string, so it needs to be converted to an array first. Easy peasy. Here’s my updated is_email_address_unsafe() function, which goes around line 880 of wpmu-functions.php:

function is_email_address_unsafe( $user_email ) {
	$banned_names_text = get_site_option( "banned_email_domains" ); // grab the string first
	$banned_names = explode("\n", $banned_names_text); // convert the raw text string to an array with an item per line
	if ( is_array( $banned_names ) && empty( $banned_names ) == false ) {
		$email_domain = strtolower( substr( $user_email, 1 + strpos( $user_email, '@' ) ) );
		foreach( (array) $banned_names as $banned_domain ) {
			if( $banned_domain == '' )
				continue;
			if (
				strstr( $email_domain, $banned_domain ) ||
				(
					strstr( $banned_domain, '/' ) &&
					preg_match( $banned_domain, $email_domain )
				)
			)
			return true;
		}
	}
	return false;
}

The fix is in the first 2 lines of the function – getting the value of the string, and then exploding that into the array which is then used by the rest of the function. I’ve tested the updated function out on UCalgaryBlogs.ca and it seems to work just fine. Hopefully the fix will get pulled into the next update of WPMU so everyone with Banned Email Domains can breathe a bit more easily.

1_clumsyphones_adamaOK. I’m a dork. I made some ringtones today to use on my iPhone, based on short clips from Battlestar Galactica. Maybe someone else will find them useful. Please don’t sue me. They were all made from very short sound clips I found online.

BSGRingtones

I’m using “BSG – Phone Ring” as my ringtone (it’s the sound the telephones make on the ship) and the others are handy alarm notification sounds.

Download the ringtones

Red Dawn

Filed under: fun. Tags: , , . | 8 Comments 

200px-Red_dawnIt’s time to pick up the Formative 10 Films series, after abandoning it after the fourth entry…

Red Dawn. 1984. A bunch of misfit high school kids work together to defend their town from an invading Russian military force. Patrick Swayze as the cool older brother. Charlie Sheen. Lea Thompson (I had such an ’80s crush on Lea…). Jennifer Grey. What’s not to love? WOLVERINES!

I was in grade 10, a misfit outcast just starting high school, and watched this movie maybe a dozen times. It was set in small town redneck Colorado. Which felt not too different from Calgary…

There was something about the threat and horror of nuclear war, “the enemy” on North American soil, and an underground guerilla resistance movement that stopped and repelled the invaders that captured my imagination. It’s something that would be simply taught in history class for anyone growing up in Europe – but here, safe in Canada, we’ve never had to put much serious thought into aggressive invading armies (well, not for a few years, anyway, but we showed them! *shakesfist*)

I guess what caught me was the forced self reliance, the adaptability, the absolution of caste, and the need to work together to survive. Sure, the movie was violent, but it was a guerilla war movie. It needed to be violent. The fact that it wasn’t a shiny, happy, “good guys always win” story was important, too. The Wolverines didn’t magically kick Soviet ass, as they would have in a Jerry Bruckheimer or Michael Bay film. They struggled. They died. They sacrificed. And in the end the remaining survivors withdraw in the hopes of finding others.

Growing up in Canada, I wasn’t living in daily fear of Soviet invasion, or nuclear warheads raining out of the skies. We figured if anything went down, we’d likely be catching the debris as Reagan’s Star Wars™ shield zapped Soviet missiles over Canadian airspace. Boom and sizzle, sure, but not invading occupation forces. During the olympics in ‘88, the Soviet team pins and jackets were the hottest items for trade. Everyone wanted to get Soviet stuff, and meet the athletes. Certainly no fear, at least.

And now I see they’re doing a remake of the movie, due out in 2010. Not sure how I feel about that. The TV series Jericho, which was a thinly veiled revamping of Red Dawn, didn’t do so well.

I was extremely fortunate to have been a part of the fantastic YYCPhotoBook 2009 project. It’s a community-based photography book project, featuring 32 different Calgary photographers ranging from amateurs to high-end professionals. The goal was to show the city from various perspectives, outside the traditional stereotypes and stock-photo views. From start to finish, the project took 4 months – including recruiting the photographers, sourcing photos, editing, designing, and releasing to print. Duncan Kinney did an absolutely amazing job in wrangling the project and pushing it forward, and Connor Turner did an equally fantastic job in putting the book design together.

yycMaintitle

I love the project for a few reasons. First, it’s a crowdsourced, grassroots community project. I described it at the first project meeting as being more of a community art project than a photography project. It brought together 32 photographers, with 32 different views, perspectives, and styles. The end result is an incredible, beautiful book of photography that is a wonderful representation of the city of Calgary and those who live here.

The other reason I love the project is that it is a non-profit endeavor, raising funds for the Brown Bagging It for Calgary’s Kids charity – a local charity that is devoted to providing healthy meals to underprivileged Calgary kids.

It was truly an honour to have been a part of this project. The photos in the book are amazing, the photographers are inspiring, and the book itself is gorgeous.

If you’d like a copy of the book (for the awesome page 12 photo *cough*, or to support Brown Bagging It for Calgary’s Kids) head over to the Blurb store to get yours now.

yycphotobook-page12-13

Today was the annual Kickoff event – the home opener for the U of C Dinos football team, combined with a party welcoming students to campus for another year. This year, the whole family went to the game, and we had a blast. Also, this year was different because it was the first time in a long, long time that I was able to score the free tickets offered to students…

We had to leave at half time, because it was just too much sun for The Boy™ to endure, but the first half of the game was a great one. When we left, the Dinos were ahead 10-8 over the Golden Bears. Sounds like the second half was exciting, too, with the Dinos holding onto the slim lead to win the game. Whew.

game - 6dexopen! house!dino pridetakedowngame - 5

One of the things I was missing when I switched from Google Reader to Fever˚ was a way to share items from my subscriptions. Fever˚ didn’t have any way to generate a feed of things I saved, so it was kind of a separate silo. But, the most recent version of Fever˚ includes a cool new feature to share my Saved items in an RSS feed. Easy peasy.

Here’s an embedded view of the last 30 saved items, thanks to the magical wondrousness of Feed2JS: (it’ll probably bork in the feed, though. irony.)

There are lots of other features that got added in the last update, including integration with Twitter and Instapaper. Fever˚ just keeps getting better and better…

Sometime after upgrading our copy of MediaWiki from the antique version I’d had to run, to the shiny latest version, I noticed (well, some of the wiki users noticed first…) that there were some borked characters – accented French characters, Mandarin characters, and fancy schmancy “smart quotes” were displaying as gobbledygook gibberish text. Smelled like a UTF8-related issue – IIRC, MediaWiki switched the front end of the web app to be UTF8, but my database was languishing behind in krufty latin1 encoding. oops.

So, how to convert a database that’s approaching a gigabyte of data? I started googling. Found some hints. But none of the solutions I found actually worked for me. So I googled some more, and duct-tape-and-bubblegummed a script together that seems to have successfully converted the database from latin1 to UTF8.

Here’s what I did, in case I need to do it again…

#!/bin/bash

# general config stuff
mysql_path="/usr/local/mysql/bin"

# source database config
# change this to point to the database server that is currently hosting the database.
source_host="localhost"
source_db="source_database_name" # mine was mediawiki
source_user="source_database_username"
source_pw="password" #change this. duh.
temp_sql_dir="/path/to/a/directory"

# destination database config
# change this to point to the database server that will host the converted database
# this could be the same server as above, but use a different database on it.
dest_host="localhost"
dest_db="dest_database_name" # mine was mediawiki-utf8
dest_user="dest_database_username"
dest_pw="password"

# magic happens
clear
for table in `$mysql_path/mysql --host=$source_host --user=$source_user --password=$source_pw $source_db -e 'show tables' | egrep -v 'Tables_in_' `; do
	echo "Dumping $table"

	# dump the table from the first database
	$mysql_path/mysqldump --host=$source_host --user=$source_user --password=$source_pw --extended-insert=false --quote-names --default-character-set=latin1 $source_db $table > $temp_sql_dir/$table.sql

	# convert the charset declarations from latin1 to utf8
	# sed seems to bork mysteriously, and the mysql 'replace' command borks the files, so I settled on perl...
	# you could add other transformations here, too...
	perl -pi -w -e 's/latin1/utf8/g;' $temp_sql_dir/$table.sql

	# import the converted table data into a fresh database table
	$mysql_path/mysql --host=$dest_host --user=$dest_user --password=$dest_pw --default-character-set=utf8 $dest_db < $temp_sql_dir/$table.sql
done

# or not.
if [ "$table" = "" ]; then
	echo "No tables found in db: $db"
fi

It seems to have worked for me. It took maybe 5 minutes to convert almost a gig of data. It borked on one table – categorylinks failed because of some problem with the key, so I just manually copied it over myself after the script was finished.

It is highly probable that there is a better way to do this. Perhaps even some magic bit that could have been twiddled to do this automagically and/or instantly on the server. I couldn’t find the proper lever to throw, so wound up trying brute force. When in doubt, try brute force. It worked for me. It might not work for you. You’ve been warned.

not my blog anymore

Filed under: general.  | 6 Comments 

my-god-its-full-of-comments-fullA couple of weeks ago, the number of words in comments (i.e., stuff you wrote) passed the number of words in posts (i.e., stuff I wrote) on this blog. And now, the comment word count just pushed over half a million words.

This is no longer my blog. I’m not sure what it is, but it ain’t (just) mine, for sure.

The Open Education conference last week was easily one of the best conferences I’ve ever participated in. It was intense, incredibly run, thoughtfully planned, and brought together an extremely diverse and intelligent group of people. I can’t remember the last time I’ve been so intimidated by the sheer number of scary-smart people in the same room.

The conference was awesome. Lots of people have already recapped the conference itself – I’m not going to even try to add to that. I’m also not going to write a post about how fracking awesome everyone is, listing them all by name. I had a blast talking to everyone. They all rock. I am honoured to have had the chance to meet so many great new people, and to hang out with so many old friends. Blah blah blah…

What I was struck by was the ways I found the conference changing how I was thinking about education, openness, and inclusion. I felt a similar shift at the first Open Education conference I attended back in 2007, but this was a much deeper, more pervasive feeling.

Open Education is not about Resources

Although many of the sessions touched on Open Education Resources (OER, Learning Objects, content, etc…) there was a strong consensus that education is about so much more than content, and is also so much more than the tools and technologies used to present the content and connect the learners. This was a refreshing stance, as we seem to be highly content- and technology-centric when thinking about education (and Open Education, specifically). How do we shift the focus from content to interaction? From publishing and/or consuming to interaction and engagement? There were some interesting conversations about this, and although I don’t think there can be any solid answers, the fact that we’re looking at this stuff as more than just content, at education as more than just broadcast/receive, is a good sign.

Openness

Scott Leslie talks about “planning to share” vs. “just going ahead and sharing” – and the most interesting projects (and non-projects) all shared this theme. There were no RFPs, no committees, no Advisory Boards. People just started sharing. And that’s the only part of Openness that matters. It’s not about licenses, copyright, or anything other than just sharing what you’re doing.

And, there is also some hypocrisy in “open” projects – for example, the showing of a very short clip of RIP: A Remix Manifesto, at an education conference, in an art gallery, apparently cost over $100. And the distributors wanted over $300 to let us watch the entire movie. A movie that ends by saying “Download this movie” – and is not legally downloadable within Canada, even though it was produced by the National Film Board of Canada. Openness is not about licensing, it’s about sharing. And locking a movie that is inherently about sharing behind a paywall is breaking the spirit of openness. Hypocrisy.

Tribalism

At an evening session on copyright, Sonny Assu presented some of his work – where he appropriated many of the commercial symbols that have been pushed on us and have become part of our cultural heritage. He talked about how we now use these symbols as parts of our selected tribal identities. The tribe of the $5 coffee cup. The tribe of the white earbuds. This got me thinking about everything I saw in terms of tribalism and identity – which tribes or shared cultural groups do I broadcast membership in? What does that mean, for how other people perceive me? Do they see the symbols of the group identity? How does my perception of others’ group identities affect my interactions with them? How does this affect the relationships that are crucial in education? Lots of stuff to think about, and no answers to come.

Inclusion

Following on the thoughts of inclusion, and on the strong sense of male dominance at the conference (which was a veritable sausage party), I started thinking much more about inclusion. If the open education conference was so strongly over-represented by white males who shared similar backgrounds, why is that? If it’s not through active exclusion (there is no club to join, no registry to sign, no approval process), it may be through a sense of inclusion or non-inclusion. Why are women, people of colour, people of various other backgrounds, not as strongly represented here? Are they missing because they don’t feel welcome? Do they perceive a risk in joining the community? Do they see a barrier to entry? The middle-aged white dudes may not see barriers and risks, but are they tangible for others?

If so, what can be done to encourage others to actively participate in the community? Is that even something that is desirable for everyone? Does everyone’s participation need to be visible to be valid?

But… I said at the top of this post that the participants were extremely diverse. WTF? well, they were, compared to some other edu- and tech- conference. But were hardly diverse, when put into a global perspective. Yes, people were there from a long list of countries, and from a long list of institutions, but almost all shared a similar privileged western background.

—-
Photo by Diego Leal

Jim just asked me about what I used to do a quick Wikipedia search in Safari – I just hit a key combo and a text entry window pops up, where I entered “w trans lux” and got to the wikipedia page for the company behind the awesome Mighty Hercules cartoon.

I’m using Shortwave to search all kinds of crap – it’s like the Firefox search shortcut dealie, except that you don’t have to inflict Firefox on yourself in order to use it. It’s just a javascript bookmarklet that is configured to search a bunch of services, and you can extend it with your own services by editing a text file. I have it set to search my own flickr account for stuff, search my blog, my delicious.com account, etc… Very cool.

Picture 2

And if I put the bookmarklet on my bookmarks bar, it can be triggered by a keyboard shortcut – on mine, it’s the 9th bookmark in the bookmarks bar, so ⌘+9 brings up the box, and I’m off and running.

Easy. Free. Extensible. Shiny. Now you know, and knowing’s half the battle.

← Previous PageNext Page →

This website uses a Hackadelic PlugIn, Hackadelic SEO Table Of Contents 1.7.2.