Nick Cast Episode #13: Shanghai Bund Sightseeing Tunnel

I have no way of actually describing this ride. Its basically a ride through a tunnel to cross the Hangpu River in Shanghai. Its all…umm… psychedelic.

Nick Cast Episode #12: Shanghai Maglev Train

The wife and I spent a few days in China, visiting Shangai, Xi’an, and Beijing. This is the first in a few video clips from the trip.

When leaving Shanghai, we hopped on the maglev train to go to Pudong Airport. It took around 8 minutes to go 18 miles. Not too shabby.

You get to see the different bits and pieces of China as you ride the maglev train:

Nick Cast Episode 11: #vlomo10 Day 9

Grabbing some dinner with Josh Chase at a snazzy Taco Bell, talking about dieting and how hot dogs are made.

Nick Cast Episode 10: #vlomo10 Day 8, Flip Burger and SBW Crew

At Flip Burger with @joshcaza, @nicdev, @JohnAgan, and @dannyoutlaw, some car flashiness, and Old Navy.

Nick Cast Episode 9: #vlomo10 Day 7

Old cupcakes, Chloe the cat with plastic bags and in the shower.

Music: Test Drive by Zapac

Nick Cast Episode 8: #vlomo10 Day 6

The New Yorker Deli, Firesheep, the bathrooms at The Varsity.

Music: Test Drive by Zapac

Nick Cast Episode 7: #vlomo10 Day 5

So I kinda missed the first few days of the #vlomo10 meme, but I guess its never too late to get started.

If you are interested, check out my other videos.

Magento Connect Manager: Cannot initialize channel://connect.magentocommerce.com/

MagentoI swear I can read. Seriously. No, I know some of you may not believe me, but I can. Yeah, sure. Lets go with that.

Wanting to investigate how a popular extension implemented certain functionality, I decided to install the extension on a new Magento dev environment:

Failed to download magento-community/Foo_Bar within preferred state "stable", latest release is version 1.0.2, stability "alpha", use "channel://connect.magentocommerce.com/community/Foo_Bar-1.0.2" to install
Cannot initialize 'channel://connect.magentocommerce.com/community/Foo_Bar', invalid or missing package file
Install Errors
Package "channel://connect.magentocommerce.com/community/Foo_Bar" is not valid

Immediately thought I had broken PHP or PEAR in my environment. Then at the root Magento directory, I tried:

./pear install magento-community/Foo_Bar

and got this error:

Failed to download magento-community/Foo_Bar within preferred state "stable", latest release is version 1.0.2, stability "alpha", use "channel://connect.magentocommerce.com/community/Foo_Bar-1.0.2" to install
Cannot initialize 'channel://connect.magentocommerce.com/community/Foo_Bar', invalid or missing package file
Install Errors
Package "channel://connect.magentocommerce.com/community/Foo_Bar" is not valid
PEAR ERROR: install failed

I nearly panicked at this point. I started checking file permissions, checking versions…yeah, general panic.

Of course, if you aren’t completely dim-witted like me and actually read the message, you’d see the problem:

Failed to download magento-community/Foo_Bar within preferred state "stable", latest release is version 1.0.2, stability "alpha"

Ohhh. Magento is configured to only accept stable extensions, and Foo_Bar is designated alpha.

Obviously, a quick fix. In the admin backend, go to System -> Magento Connect -> Magento Connect Manager -> Settings and change Preferred State to Alpha or whatever your extension is:

Magento Connect Manager Extension Alpha

See more of my Magento posts.

WordPress 3.0 Multisite Subdomain: Broken Image / Thumbnails

WordPressAfter upgrading nali.org from WordPress 2.9.X to WordPress 3.0, I set it up as multisite. Specifically, I wanted to set up a subdomain: stream.nali.org. Its basically for lifestreaming, but instead of using Tumblr or Posterous, I decided I’d just do it myself with the network/multisite feature of WordPress 3.0. Even though multisite existed in previous versions of WordPress, it was a separate code base. In 3.0, its part of the core functionality.

Having set up the stream blog, I tried uploading pictures for a post about The Original Pancake House. Uploading didn’t give me any errors, but all the thumbnails and images were showing the broken image placeholder.

Here is what happened with my setup: after setting up multisite by following the instructions at the Codex, I tried installing W3 Total Cache. W3 Total Cache required changes to the .htaccess. But W3 Total Cache really wasn’t working on the underpowered Rackspace instance I was testing (completely my fault).

So I decided to go back to the original .htaccess:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Oops. The multisite references are gone! Look what the Codex states, the .htaccess should be:

# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# uploaded files
RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule . index.php [L]
# END WordPress

After making the changes, the thumbnails under Media might still be broken. Edit an image and hit save. The thumbnails should be recreated.

Magento 1.4: Load Sample Data

MagentoAnyone who works a lot on the same platform for different customers goes through the process of creating a base install. The base install should be configured so it can be dropped in somewhere easily, and it should just work.

Setting up the base install is not always easy. What happens if there are updates to the platform? How do deal with development environments versus production environments (think domains, logging, etc). How do you migrate data?

While all good questions, all those issues can be scripted out and handled. There will be tricky edge cases and lots of if-then or case/switch statements, but all doable.

To jump into solving whatever business problem you are working on, you usually need to have some sample data to tinker with. Take Magento for instance. Say you want to change what the product pages display. Gotta have some products in the database or you have to create new ones every time you start working with a new client.

Magento has sample data that can be loaded, but its not obvious how it should be loaded. The sample data needs to be loaded before going through the Magento installation wizard.

So the first step is to download the Magento code. Unzip/untar it in /var/www or wherever the web server can access it. Then create a database.

If you have already gone through the Magento installation process, you need to get rid of all the existing data: drop all the tables in your database and delete app/etc/local.xml (this is where the database access information is stored).

Now lets grab the sample data. Its available on the same page where you download Magento itself: http://www.magentocommerce.com/download. Scroll down a bit and download to your local machine.

Magento Sample Data Download

Untar/unzip the file. You should see a directory and a file:

Magento Sample Data Unzip

The contents of the media directory should be copied into media directory of your Magento install, so afterwards your Magento media directory should contain a catalog directory.

Next, the sample data needs to be inserted into the database. If phpMyAdmin is installed, do an import into the database with the downloaded SQL file.

Magento Sample Data SQL Import

Now go through the Magento installation wizard and you should have products show up on the frontend of the site when you are done.

Problems?

  • Sample data images not showing up on frontpage – This is a permissions issue. If you downloaded the sample data media and moved it to the Magento directory, make sure the media and its sub-directories are owned by the same user who owns the Magento directory. Also make sure to turn off caching and deleting all caches while testing the fix.
  • Admin user can’t login into backend – See my post Magento: Can’t Login after Installation Fix.

See more of my Magento posts.

Atlanta Lions Club