Snippet: Copy MySQL Databases Over SSH

I needed to copy a database and the idea of backing it up just to re-import1 seemed like double the work. Here’s a snippet to pipe a mysqldump into a remote database. Keep an eye on the user names and passwords – you’ll need 3 sets; one for the database your copying, one to get into your remote server, and one for the remote, target database.

mysqldump -v -uUSER -pPASSWORD --opt --compress DATABASE_NAME | ssh REMOTE_SERVER_USER@REMOTE_HOSTNAME mysql -uREMOTE-MYSQL-USER -pREMOTE_MYSQL_PASSWORD REMOTE_DATABASE_NAME

1. Backing up is a good thing. Why aren’t you doing it? Here’s a script for that.
mysqldump -h HOSTNAME DATABASE_NAME | gzip -9 > BACKUP_DIR/DATABASE_NAME.sql.gz

Summer Camp Hookie

On this beautiful Saturday, I missed PublicRadioCamp. Unfortunate for many reasons, including – many of my favorite people in town were there. Hell, some of my favorite people in town organized it.

Instead, I had one of the best days ever with my family.

Our Day

  1. Sleep until after 7am
  2. Pick up a few things from the Minneapolis Farmers’ Market
  3. Grab a Coffee
  4. Take a Leisurely Stroll through the Sculpture Garden
  5. Home in time for lunch
  6. “Nap” – I finished my book club book during nap time, while the kids didn’t sleep soundly in their beds 😉
  7. A walk to Audobon Park for a dip, some swings, and an afternoon coffee.
  8. An amazing Pea-Mint-Leek soup dinner
  9. Mixing up bread dough with the boy before bedtime.
  10. A quiet Netflix and wine with Jen after bedtime.

After all that, I’m catching up what I missed with Bob Collins Off to Camp post. Good stuff.

Ruby on Rails Snippet for Changing Relative Paths to Absolute

If you have a bunch of text containing relative path hyperlinks, and you’d like to change to them to absolute paths, you might find this snippet helpful.


content = "some text with a <a href='/path/to/relative_link/'>relative link</a>"
link = "http://somedomain.com/"
content.gsub(/=('|")//, '=1*/').gsub(/*//, link.match(/(http|https)://[w.]+//)[0])

The asterisk ‘*’ is a hackey placeholder for the actual link swapped in with the second gsub. If you know of a way to pass in the link without needing the placeholder, awesome – paste it in the comments. Thanks.

Quoted in APM’s ‘The Pork Wars on YouTube’

As part of APM’s Public Insight Journalism program, I was interviewed as about the use of sites like YouTube for political issues (vs. campaigns) – specifically in the context of the recent tennis match between animal rights groups vs farm industry groups.

Here’s the bit of my interview they used on-air and online.

“Garrick Van Buren is a social media consultant. He says YouTube is useful only as a place to upload videos. It isn’t likely the best destination site for marketers, because videos are lost easily in the heap.”

“‘Figure out where the people that you are trying to reach are. Are they at Facebook? Then create a Facebook app. Find those people that are most likely to spread your message,'” Van Buren said.”

Jon Gordon’s Twin Cities Coffee WiFi Google Map Started

Jon Gordon‘s going to be in the Twin Cities for a while and he thought it’d be fun to review the local selection of independent coffee + wifi shops.

As part of that effort, I’ve started a Google Map for listing and pin-pointing these places. There’s also a handful of invites floating around to for those that want to help.

Want one?


View Larger Map

Update 07 July 2008
I just cracked open a PBWiki for this project: http://twincities-coffee-wifi.pbwiki.com/

Something New In the Air

Two of my favorite people are starting new podcast projects in the next week.

  1. Kris Smith formerly of Croncast will be launching Life in the Can next Friday, still with Betsy on the other mic.
  2. Dave Slusher is launching the Reality Break podcast a couple days later.

Both projects are aiming to be more sponsorship-friendly than their preceding productions and I think that’s interesting. To date, sponsored showed haven’t kept my attention, but that had more to do with me being uninterested, not an aversion to sponsors. I trust Dave and Kris will be doing some interesting things to make it a win for everyone.

Kris, Betsy, Dave, congrats on the new production.

They’re both already in Cullect.com/33.

Diversified Rhino Guarding

“If you’re building on someone else’s platform, whenever they are down, you are down. There is no way around that.” – Brian Breslin on why TwitBin development is stalled.

A year ago, I wrote about my hesitation of building on someone else’s platform. Since then, I launched Cullect. Which is nothing if not built atop OPP [1].

When I first started development on Cullect – it only supported OpenID. Only. Less popular and less understood than many other services. Today, Cullect extends 3 different platforms (4 if you count OpenID). Feels right. Feels successful. Tomorrow, I see that number increasing.

Will some services fall away? Maybe. I’m not married to any of them.

So, Cullect doesn’t care if you stop using your Twitter account and move to Tumblr. As I wrote then, I’m not interested in building on a single platform. There’s plenty of rhinos to guard.

Elsewhere:

“On top of that, there aren’t all that many rewards for building things on top of Twitter. Sure, there are tons of active Twitter users. But with all the outages and the arbitrary changes in the API limits, I just haven’t been feeling the love. Tweeterboard’s gone from a fun diversion to a distraction.” – Gene Smith

1. Other People’s Platforms 😉

The State of Dense Comparisons

One of my biggest pet peeves is comparisons of the U.S to other countries – especially European countries – to show how the U.S. is “behind” in some nationwide attribute like healthcare, broadband speeds/adoption, public transit.

My first issue with these comparisons is one of scale. The United States is closer to the European Union in structure than any individual European country and multiple times larger in geographic area than either. We should be comparing individual states against individual states by GDP.

  • Minnesota ~= Norway
  • California ~= France
  • New York ~= Brazil
  • Illinois ~= Mexico

My second issue is one of population density. Lots of people in a small space increases the demand and makes it logistically easier to deliver public transit and high-speed internet access to more people faster. If nearest neighbors are 40 acres and a mule away, connecting them is far more expensive than if they live on top each other.

Ranking countries by their population density puts the US 180th (31 people/km2).

“Behind”

  • Netherlands: #25 – 395 people/km2
  • Belgium: #31 – 341 people/km2
  • Japan: #32 – 339 people/km2
  • United Kingdom: #51 – 246 people/km2
  • Germany: #53 – 232 people/km2
  • France: #95 – 110 people/km2

Imagine seeing 10x the number people around you everyday. Our towns, cities, and attitudes would have to dramatically change to support that. Just as they have to support their current densities (e.g. Minneapolis got a light rail train).

The US is closer by comparison to Madagascar (32 people/km2) and Estonia (29 people/km2).

I don’t remember the last time I’ve heard the US compared to those developing countries. Though from what I’ve heard about Estonia’s electronic government, there’s some interesting stuff going on there.

Again, individual state level comparisons are more appropriate here as well.

  • Minnesota ~= Somalia[1]
  • California ~= Greece
  • New York ~= Kuwait
  • Illinois ~= Spain

For the densities greater than 100 people / km2 we need to move to New England:

  • South Korea ~= New Jersey
  • Netherlands ~= Rhode Island
  • Belgium or Japan ~= Massachusetts
  • United Kingdom ~= Connecticut
  • Germany ~= Maryland
  • France ~= Ohio or Florida[2]

Looking at these numbers it’s clear why Thomas P. M. Barnett says the U.S. has more in common with emerging markets like Brazil and Russia than Western Europe and Japan.

We’re definitely behind Brazil in open source software adoption.

1. Interesting considering the recent influx of immigrants from that country into Minnesota
2. Yes, I know Ohio and Florida aren’t in New England. I found the comparison of France with Ohio & Florida entertaining so I wanted to keep it in.