John Paul Ashenfelter

Blogs are for geeks. Guilty!

John Paul Ashenfelter header image 1

Safari appending .rdp to downloaded files

April 12th, 2011 · Uncategorized

The problem: Some files downloaded using Safari on OSX had a .rdp extension appended after the existing extension (eg myfile.txt.rdp)

The details: This is a problem with CoRD 0.5.4 (the latest stable release). It registers itself to basically handle all files that have the ‘application/octet-stream’ mime type. In many cases, if  the server isn’t providing a mime type it gets assigned ‘application/octet-stream’ thus the .rdp extension added.

The solution: The simplest solution is to download a CoRD 0.5.5 nightly (I’m using r633) and install it, which will update the LaunchServices database and get CoRD registered to open only rdp files. More is at http://discussions.apple.com/thread.jspa?threadID=2476698&tstart=-1.

→ No CommentsTags:

Fix for no expansion found for defaults error in Rails 3.0.4

February 9th, 2011 · ruby

Just a quick tech tip from our upgrade to Rails 3.0.4 this morning. Started with bundle update, fired up server, hit it with a browser and immediately got:

No expansion found for :defaults

near

<%= javascript_include_tag :defaults %>

After 30s of Googling, realize I hadn’t done a rake rails:update. Personally, I don’t like clobbering my app with unknown changes, so I typically create a new rails project and run a diff between the apps to see what is different between my app and the new hotness in the latest Rails release. I noticed a difference in config/application.rb in the comments:

# JavaScript files you want as :defaults (application.js is always included).
# config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
In our app, for some reason, we had
config.action_view.javascript_expansions[:defaults] = %w()
There’s a lot of changes around Javascript in the Rails 3.0.4 release to handle some security vulnerabilities, so not surprised things changed here. We are telling are app the default expansion is an empty array — not so smart in any case. The fix was to add some elements to the default, in our case simply
config.action_view.javascript_expansions[:defaults] = %w(rails)
A server restart and everything is back to normal.

→ 6 CommentsTags:

On a Train to RubyConf

November 10th, 2010 · tech

Today is one of those days that I really love my job. I’m on a train headed towards New Orleans, LA for RubyConf happily catching up on my digital backlog of newsfeeds, podcasts, emails, Instapaper articles, emails, watched github repos, and all of the other digital detritus that builds up in my “defer” bin during the normal day-to-day of consulting. The backdrop to all of this is the countryside of the deep South rolling by at a steady pace on a sunny late fall day. I’m honestly thinking I might need to take a trip like this every few months just on general principles.
This year I’ve worked in a number of different environments ranging from a week at the bar at a Pacific beach resort (I *did* get up at 4am, so it wasn’t all palm trees and rum drinks) to my temporary summer office at an 18th Century Hacienda in Oaxaca, Mexico to my corporate office on the Court Square of bucolic Harrisonburg Virginia. I’ve worked onsite with clients in hip downtown office complexes, funky small-town lofts, and coffeeshops of all shapes and sizes. Despite the wide differences between all of these disparate locations, the only two prerequisites for me to be productive are somewhere to plug in to recharge the Macbook and an internet connection.
Power tends to be a given, despite the occasional need to hunt for where the outlet is hidden at a particular coffeeshop or the need to have the right adapter for international travel. The recent increases in battery life in newer laptops, particularly the 5-7 hours new MacBook Pro and Air models, means a solid amount of work can be done on a single charge. Electricity is no real impediment to the mobile developer.
Internet on the other hand, can be a huge problem. In Oaxaca, DSL was widely available, but it was pretty slow (512k usually gave me about 50k download) with huge latency. In Harrisonburg, the local cable company won’t wire my downtown office which gives us 2 bonded 768k DSL lines as our best inexpensive option. And of course if you’re truly mobile, you’ll need some sort of WWAN cellular solution.
I’m no AT&T fanboy — I used Suncomm back in the day, kept them and my Treo when AT&T bought them because it was easy, and then was pumped that I could upgrade to an iPhone when it came out. Of course as we all know, AT&T’s network is pretty spotty as far as coverage which makes it an awful solution for traveling and expecting an WWAN internet connection to work. To add insult to injury, making my iPhone 3gs into a hotspot costs $60 for 2gb of data and more importantly TAKES ME OFF MY UNLIMITED PLAN FOR GOOD. Not cool AT&T.
I got a Verizon MiFi this week for the RubyConf trip. So far, I’m impressed. Setup was generally easy though you have to install a piece of software (VZAccess) and reboot your computer so you can basically press the “activate” button on the modem, which seems like a lot of extra work, especially since the software is then no longer needed. Once it was setup, I reconfigured it to use WPA2-AES, added the MAC addresses of my phone, iPad, and Mac for a little extra security, and started happily surfing the web from all three devices.
It’s been particularly interesting to watch my iPhone connectivity along with the MiFi — my definitely non-scitentific observations of the connectivity of both through VA, NC, SC, GA, and AL is that both connect *great* in the city and AT&T basically dies once there are trees and other outdoors. I would *definitely* move to a Verizon-backed iPhone based on how much coverage and speed I get.
While I was writing this, I downloaded the 11mb release of jRuby over the MiFi traveling somewhere in Georgia in 130s with an average spped of around 88k with spikes above 130k. Wow. I could tell you where, but the wifi is off on my iPhone and it can’t download the maps since there’s no AT&T service, though the GPS signal is fine.
In summary, I’m feeling pretty lucky to be able to work like this — where I want, when I want — even if that place is on a train, a rural Virginia town, or 11,000 feet up a mountain in Mexico. Or the Big Easy for RubyConf.

Today is one of those days that I really love my job. I’m on a train headed towards New Orleans, LA for RubyConf happily catching up on my digital backlog of newsfeeds, podcasts, emails, Instapaper articles, emails, watched github repos, and all of the other digital detritus that builds up in my “defer” bin during the normal day-to-day of consulting. The backdrop to all of this is the countryside of the deep South rolling by at a steady pace on a sunny late fall day. I’m honestly thinking I might need to take a trip like this every few months just on general principles.
This year I’ve worked in a number of different environments ranging from a week at the bar at a Pacific beach resort (I *did* get up at 4am, so it wasn’t all palm trees and rum drinks) to my temporary summer office at an 18th Century Hacienda in Oaxaca, Mexico to my corporate office on the Court Square of bucolic Harrisonburg Virginia. I’ve worked onsite with clients in hip downtown office complexes, funky small-town lofts, and coffeeshops of all shapes and sizes. Despite the wide differences between all of these disparate locations, the only two prerequisites for me to be productive are somewhere to plug in to recharge the Macbook and an internet connection.
Power tends to be a given, despite the occasional need to hunt for where the outlet is hidden at a particular coffeeshop or the need to have the right adapter for international travel. The recent increases in battery life in newer laptops, particularly the 5-7 hours new MacBook Pro and Air models, means a solid amount of work can be done on a single charge. Electricity is no real impediment to the mobile developer.
Internet on the other hand, can be a huge problem. In Oaxaca, DSL was widely available, but it was pretty slow (512k usually gave me about 50k download) with huge latency. In Harrisonburg, the local cable company won’t wire my downtown office which gives us 2 bonded 768k DSL lines as our best inexpensive option. And of course if you’re truly mobile, you’ll need some sort of WWAN cellular solution.
I’m no AT&T fanboy — I used Suncomm back in the day, kept them and my Treo when AT&T bought them because it was easy, and then was pumped that I could upgrade to an iPhone when it came out. Of course as we all know, AT&T’s network is pretty spotty as far as coverage which makes it an awful solution for traveling and expecting an WWAN internet connection to work. To add insult to injury, making my iPhone 3gs into a hotspot costs $60 for 2gb of data and more importantly TAKES ME OFF MY UNLIMITED PLAN FOR GOOD. Not cool AT&T.
I got a Verizon MiFi this week for the RubyConf trip. So far, I’m impressed. Setup was generally easy though you have to install a piece of software (VZAccess) and reboot your computer so you can basically press the “activate” button on the modem, which seems like a lot of extra work, especially since the software is then no longer needed. Once it was setup, I reconfigured it to use WPA2-AES, added the MAC addresses of my phone, iPad, and Mac for a little extra security, and started happily surfing the web from all three devices.
It’s been particularly interesting to watch my iPhone connectivity along with the MiFi — my definitely non-scitentific observations of the connectivity of both through VA, NC, SC, GA, and AL is that both connect *great* in the city and AT&T basically dies once there are trees and other outdoors. I would *definitely* move to a Verizon-backed iPhone based on how much coverage and speed I get.
While I was writing this, I downloaded the 11mb release of jRuby over the MiFi traveling somewhere in Georgia in 130s with an average spped of around 88k with spikes above 130k. Wow. I could tell you where, but the wifi is off on my iPhone and it can’t download the maps since there’s no AT&T service, though the GPS signal is fine. In summary, I’m feeling pretty lucky to be able to work like this — where I want, when I want — even if that place is on a train, a rural Virginia town, or 11,000 feet up a mountain in Mexico. Or the Big Easy for RubyConf.

→ No CommentsTags:

Protip: Using 37Signals Launchpad with Fluid on OSX

April 15th, 2010 · productivity, tech

Since 37Signals introduced their single sign-on solution aka Launchpad, it takes a little more effort to create a Fluidyapplication for Campfire, Basecamp, and all the rest of the tools since authentication happens on one site (launchpad.37signals.com) and your application is on another site (eg. bacon.campfirenow.com). But the fix is easy:

  1. Create your Fluid App as normal
  2. Go to Preferences > Advanced
  3. Add *launchpad.37signals.com* to the list of allowed sites

For extra credit, you can add the related URL paths for any of the other 37signals webapps so you can use the menubar you get on their sites when you’ve authenticated with launchpad.

→ No CommentsTags:··

Ruby Nation 2010, Day 1

April 10th, 2010 · ruby

I’ll be honest — I love RubyNation. I’ve been to it for the past 3 years, ever since I first started programming in Ruby on a regular basis. I’ve been to many conferences and I have to compliment the team on putting together yet another great program for 2010. It’s worth getting up at 5am and driving 2 hours plus the DC commute to hear what the high-quality lineup of speakers has to say and to connect with the Virginia/DC-area Ruby community.
Day 1 of RubyNation did not disappoint. Here’s a quick overview of the sessions I went to today:
Glenn Vandenburg started the day in a single session track basically explaining what’s wrong with enterprise programming and why Ruby fits in well. This is probably the 20th time I’ve seen Glenn give a talk over the past 7 years on a wide variety of topics, moving from Java to Ruby to Agile and everywhere in between. Some tidbits:
* Companies want to get good results with average (or worse) programmers
* Enterprise architecture protects against medidocre workers
* Software creationalism — business focus focuses on cost of building initial app vs cost of maintaining over time
* Paying for something gives perception (illusion) of value. “I bought Oracle and saved $300k instead of using MySQL for free
* What enterprise needs is not what it wants — need code to be adaptable over time.
One key point was that big companies optimize to improve their metrics, so if you use the wrong metrics, you’re optimizing the wrong way.
* Good metric of code quality is cost of new feature over time
I think the right place for this talk is JavaOne or somewhere it’s not preaching to the choir — I’m pretty sure everyone in the audience agreed but Glenn did a great job kicking off the conference and reminding us why many of us came to Ruby from Java and other languages.
Big takeaway — still a lot of room for Ruby in the enterprise.
requote dave thomas — ruby is glue that doesn’t set
Greg Pollack followed Glenn with a talk about “Decoding Yehuda” which is really about some of the key refactoring patterns that were used to build Rails 3. Lots of good meat in there for Ruby programmers *and* now that Rails source is a lot more readable, Rails developers can more easily understand their code.
Five major techniques
* Method compilation:
I skipped the next block to hang up — not too interested about innards of JRuby (Russ Olsen’s talk) or formal workflow systems (David Bock) thought I generally enjoy both speakers.
The highlight of the day for me was the next talk — Joe Damato and Aman Gupta explaining the details of Ruby garbage collection. Yeah — sounds exciting I know — but they gave a very clear overview of how Ruby allocates memory, how the garbage is collected, and how the different defaults of MRI and REE affect your app. The closed with an intro to memprof.com, sort of a NewRelic-y website for analyzing the memory profile of your rails stack. Definitely check that out.
Jim Weirich followed lunch with his SOLID Ruby talk, entertaining as he always is. Didn’t learn a lot that’s new personally, but was an entertaining romp through the fundamentals of Liskov Substitution, Single Dependency Principle, etc.
I started to fade in the afternoon thanks to my 5am wakeup call to get up to DC, so I started to pay less attention to the talks. There weren’t a lot of lightening talks during the block — Bryan Lyles skipped TATFT to suggest using DTerm, which is a free keystroke-combo terminal/command line utility. Nick Sieger’s talk about what’s going on in the Java-based Rails stack was useful for those of us with Java clients. Finally, Dave Thomas closed the day with one of his “Ruby Sucks!” talks, which is a lot of fun, but that he’s done at a number of conferences. Metrostar hosted the RubyBQ to end the evening and an early bedtime ended my first day.
Overall, I thought the day was worthwhile. It certainly wasn’t FutureRuby or JSConf or something similarly mindblowing, but it was a a good opportunity to network with the local Ruby crew, learn a few things (ruby garbage collection, WTF?) I wouldn’t have normally looked at, and get fired up about Ruby.
Mission accomplished.

I’ll be honest — I love RubyNation. I’ve been to it for the past 3 years, ever since I first started programming in Ruby on a regular basis. I’ve been to many conferences and I have to compliment the team on putting together yet another great program for 2010. It’s worth getting up at 5am and driving 2 hours plus the DC commute to hear what the high-quality lineup of speakers has to say and to connect with the Virginia/DC-area Ruby community.
Day 1 of RubyNation did not disappoint. Here’s a quick overview of the sessions I went to today: Glenn Vandenburg started the day in a single session track basically explaining what’s wrong with enterprise programming and why Ruby fits in well. This is probably the 20th time I’ve seen Glenn give a talk over the past 7 years on a wide variety of topics, moving from Java to Ruby to Agile and everywhere in between. Some tidbits:
* Companies want to get good results with average (or worse) programmers* Enterprise architecture protects against medidocre workers* Software creationalism — business focus focuses on cost of building initial app vs cost of maintaining over time* Paying for something gives perception (illusion) of value. “I bought Oracle and saved $300k instead of using MySQL for free* What enterprise needs is not what it wants — need code to be adaptable over time.
One key point was that big companies optimize to improve their metrics, so if you use the wrong metrics, you’re optimizing the wrong way.
* Good metric of code quality is cost of new feature over time
I think the right place for this talk is JavaOne or somewhere it’s not preaching to the choir — I’m pretty sure everyone in the audience agreed but Glenn did a great job kicking off the conference and reminding us why many of us came to Ruby from Java and other languages.
Big takeaway — still a lot of room for Ruby in the enterprise. requote dave thomas — ruby is glue that doesn’t set
Greg Pollack followed Glenn with a talk about “Decoding Yehuda” which is really about some of the key refactoring patterns that were used to build Rails 3. Lots of good meat in there for Ruby programmers *and* now that Rails source is a lot more readable, Rails developers can more easily understand their code.
Five major techniques
* Method compilation:
I skipped the next block to hang up — not too interested about innards of JRuby (Russ Olsen’s talk) or formal workflow systems (David Bock) thought I generally enjoy both speakers.
The highlight of the day for me was the next talk — Joe Damato and Aman Gupta explaining the details of Ruby garbage collection. Yeah — sounds exciting I know — but they gave a very clear overview of how Ruby allocates memory, how the garbage is collected, and how the different defaults of MRI and REE affect your app. The closed with an intro to memprof.com, sort of a NewRelic-y website for analyzing the memory profile of your rails stack. Definitely check that out.
Jim Weirich followed lunch with his SOLID Ruby talk, entertaining as he always is. Didn’t learn a lot that’s new personally, but was an entertaining romp through the fundamentals of Liskov Substitution, Single Dependency Principle, etc.
I started to fade in the afternoon thanks to my 5am wakeup call to get up to DC, so I started to pay less attention to the talks. There weren’t a lot of lightening talks during the block — Bryan Lyles skipped TATFT to suggest using DTerm, which is a free keystroke-combo terminal/command line utility. Nick Sieger’s talk about what’s going on in the Java-based Rails stack was useful for those of us with Java clients. Finally, Dave Thomas closed the day with one of his “Ruby Sucks!” talks, which is a lot of fun, but that he’s done at a number of conferences. Metrostar hosted the RubyBQ to end the evening and an early bedtime ended my first day.
Overall, I thought the day was worthwhile. It certainly wasn’t FutureRuby or JSConf or something similarly mindblowing, but it was a a good opportunity to network with the local Ruby crew, learn a few things (ruby garbage collection, WTF?) I wouldn’t have normally looked at, and get fired up about Ruby.
Mission accomplished.

→ No CommentsTags:

Marketing? Who, me? Seriously?

February 19th, 2010 · business

Yes. Me. Seriously.

I’m beginning to work with clients on advertising and marketing campaigns. While I do like the data analysis and technical side of this, the idea of being a marketer is kind of new. Plus I’m mentally adapted to assuming marketers are sleazebags.

Apparently we all aren’t sleazebags. Yet.

A good start for WordPress bloggers is http://www.upstartblogger.com/blog-to-success-with-stats-tracking

→ No CommentsTags:·

Permissions for WordPress on Joyent Accelerator

February 18th, 2010 · blog, tech

I installed WordPress on my Joyent accelerator by following the wiki instructions but since they’re a bit older, ran into a couple of problems that required some after-the-fact tweaking.

Basically, if you want to use the sexy new WP capabilities for automatically upgrading, directly uploading themes, etc you want to ensure that the process running WP can access the files. I had uploaded WP as a user, so my list files were owned by ashenfelter.com:ashenfelter.com while new files created by WP plugins (eg sitemap.xml)  were owned by www:www. Solution?

web/public >sudo chown -R www:www .

As dozens if not hundreds of posts on the WP forums/etc warn — please DO NOT try to solve this kind of problem by chmod 777 unless you like being hacked.

→ No CommentsTags:··

WordPress and Joyent, Sitting in a Tree

February 18th, 2010 · blog, tech

I’ll be honest upfront that I have a love/hate relationship with Joyent.

One the plus side, I have 3 lifetime accounts — yes, lifetime. When TextDrive, the original company, was bootstrapping themselves, they took the unusual step of offering several rounds of VC (venture capital) lifetime hosting accounts. Breakeven point compared to monthly hosting was about 16months as I remember so considering I’m on year 5(?) I think I’m pretty ahead of the game.

For those that care, I have the equivalent of two Shared Accelerator accounts and one Dedicated (M) Sized Accelerator. Since Joyent bought TextDrive, everything has migrated from FreeBSD to their Solaris based virtual machines (sort of like Xen on Linux). I finally migrated my FreeBSD boxes onto their Shared Solaris machines this month and restarted my long dormant WordPress blog.

Install on the Shared Accelerator was a breeze! The VirtualMin control panel has an install script for WordPress 2.8.5 which then could autoupdate itself to 2.9.x. The only problem is that WordPress on Shared Joyent Accelerators is so slow as to be unusable. Seems like there’s plenty in the forums about it. And by unusable I mean 5-15s (SECONDS!) to render a simple WP post. Admin side could take well over 30-60s. I installed WP-SuperCache and basically had no real improvement. #fail.

Fortunately I had the Dedicated Accelerator. Turns out WP actually runs pretty well on that machine. It’s dedicated space, so it *should* run faster, but my Shared FreeBSD server ran circles around the equivalent Solaris server as well. Chalk it up to shared hosting and it’s resource sharing versus dedicated resources for virtual machines.

Of course I had to manually install everything and then fight a bit with permissions to get everything working. Seems like PHP hasn’t changed *that* much in the years I’ve been avoiding it! But you’re looking at the final result — my personal ashenfelter.com site and my corporate transitionpoint.com site both running WordPress on a Solaris virtual machine.

→ 1 CommentTags:··

Reintroducing…. John Paul Ashenfelter

February 12th, 2010 · blog

Hi, my name is John Paul Ashenfelter.

I build web applications. I also run Transitionpoint — perhaps we could build your next web application?

Nearly all of my new work over the past 3 years has been Ruby on Rails, but I use anything that helps me build better applications with less time and effort. I’ve done a lot of work with ColdFusion and still work on some busy and profitable CFML sites. I also have used a number of open source tools like Drupal and WordPress.

I’m neurotically focused on automation, testing, and agile development techniques.

→ 3 CommentsTags: