Efax doesn’t support Intel Macs

I needed to fax something today from my new Mac Powerbook and was simply astonished to learn EFax still does not offer Efax Messenger for Intel Macs. (If you’re still using an 8+ year old PowerPC Mac, you’re still in luck.)

You CAN log in to your efax account and upload a document, but there is no nicely-integrated fax-from-print dialog.

I’ve heard of milking a cash cow to death, but that’s a ridiculous refusal to invest in keeping a product current. Glad I found out while I still have time to port my Efax number to another provider.

Migrating a WordPress blog to Heroku

Moved my blog from Godaddy to Heroku today.

There are several good blog posts about using WordPress + Postgres on Heroku, and in fact I did that at first. However, I could not find any info about *migrating**existing blog* data from Mysql to Postgres.

Since I wanted to migrate my old posts I was pretty sure migrating the WordPress database from MySql to Postgres was likely to introduce some problems. So I used the relatively new Heroku MySql option, ClearDB (which also has a free 5 MB option if that’s large enough for you).

The basic steps were:

  1. using Phpmyadmin on Godaddy, I backed up the database (to SQL format, the default) and downloaded the .sql file to my desktop.
  2. Created a heroku app (cedar stack) mkdir MYBLOGDIR cd MYBLOGDIR git init heroku create MY_BLOG_APP_NAME –stack cedar
  3. Downloaded and extracted the wordpress code wget http://wordpress.org/latest.tar.gz tar xzvf latest.tar.gz; mv wordpress/* . rmdir wordpress
  4. Did a git commit before fidding with settings git add . git commit -am “first checkin” git push heroku master
  5. Added a ClearDb database to the app heroku addons:add cleardb:ignite
  6. Discovered the ClearDB login credentials heroku config

Which displays

7. Using those credentials, used Sequel Pro (http://www.sequelpro.com/) on my Mac to upload the .sql file to my Heroku database
8. Copied wp-admin-sample.php to wp-admin.php and edited it with the database credentials
9. pushed the revised code back up to Heroku git add . git commit -am “added db credentials” git push heroku master
10. For pre-existing images, I downloaded the wp-content/uploads directory, copied it to my local git repo, the re-pushed to Heroku.
11. For new images, I downloaded the tantan-s3 plugin and installed it per directions… very nicely redirects uploads to my Amazon S3 account. (Of course, you could continue to manually insert images them by adding to a folder in the wp-content/uploads folder, then re-pushing the repo each time, but using S3 is easier.

That’s it, all my old blog posts were there.

I then added my domain name to my heroku app, changed my DNS to point to proxy.heroku.com, and it worked. (I did have to manually reinstall the plugins I was using. Since Heroku does not support unzipping library, you have to download locally, unzip, put in the plugins directory, then do another git push. Not too hard.)

If anyone else will see your git repo, you’d want to use ENV variables for your database password.

I also installed the WordPress SMTP plugin so mail is sent via an SMTP account instead of the php mail() function since that was causing some issues (system emails such as password reminders were not being sent). http://wordpress.org/extend/plugins/wp-mail-smtp/installation/

One more thing, if you are using permalinks…

Since Heroku will not permit the WordPress app to create/re-write the .htaccess file, you need to manually create the following .htaccess file then push to Heroku:

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

Why my company doesn’t send automated email from a ‘noreply’ address

It’s common – and tempting – for companies to send automated email to customers from an un-monitored address, often called something like “no-reply@”.

We send from an address such as “mail@” and if our customer happens to click the ‘reply’ button and sends an email, we forward it to “support@”.

One of my projects http://www.mondoflyers.com sends email flyers from one real estate agent to all the other agents in town.

Sometimes, a recipient simply clicks “reply” – most often with the intent of sending a note to the sending agent (“hey that house looks interesting, I’ll give you a call”), but sometimes with the intent to send us a note (“unsubscribe” or “wow that’s a great flyer system, how do I send one myself?”).

We really don’t see the downside of forwarding such emails to support and letting them handle it as the situation merits. So sometimes our support folks (a) forward a note to the obviously-intended recipient (which impresses our customer to no end), and sometimes they (b) unsubscribe the recipient even though they didn’t follow the exact instructions, or (c) sell our service to the recipient who asked for info, but sent the inquiry to the wrong place.

If your customer clicks reply, do you really want to throw it away, or bounce it back and ask them re-send it? Why not forward it instead to a human who can, more often than not, discern what needs to be done?

Rails 3.1: Enumerated_attribute breaks scaffolding (easy fix)

We use and recommend the gem enumerated_attribute when you save ‘types’ (such as workflow states) to your rails application.

However, at least for rails 3.1.3, ruby 1.9.2, and the latest released gem 0.2.16, it breaks rails scaffolding completely, throwing the error:

/Users/devmac/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require': no such file to load — rails_generator (LoadError)

The workaround is to

  1. comment out the gem in your Gemfile,
  2. save the file (NO need to run bundle install),
  3. run your scaffold command,
  4. then un-comment the gem and
  5. re-save the Gemfile.

Adding -c=scaffold_controller also needed if using active_admin

As noted in another post, active_admin seems to break scaffolding unless you add -c=scaffold_controller to the end of the scaffold command.