Nathan Wilmes's blog
Ask for Help
"Anyone have good strategies for using S3 as a content delivery network for static files?"
Using S3 as a CDN is pretty common. S3 is certainly cheap, and fairly easy to set up. However, latency can be large - S3 isn't built to act as a CDN, so the performance can be lacking. In addition, you need to work out your pathing in your CSS files to find background images correctly. Relative paths are a common technique here.
The performance of files in your public directory is much better. Amazon's Cloudfront is another (expensive) option.
Note observation #4 in this blog article: link
"I can't get ImageMagick to work on Snow Leopard. What gives?"
A brief look online shows several step-by-step instructions. It's unclear what this particular problem is about.
"After upgrading to the latest version of Mocha, any_instance doesn't clean up after itself. Why?"
Mocha's any_instance stubbing is one of the few features that distinguish Mocha from other mock frameworks.
One suggestion was to update rspec as well.
"How do I set up a Compact Privacy Policy? How does this funky syntax work?"
Definition of compact privacy policy
More info about the CPP workflow
In short, work with your client's legal staff to get a policy and convert it to P3P and compact privacy policy form.
"Heroku 1.5.3 isn't letting me use heroku rake commands. What can I do?"
Upgrade to Heroku 1.5.6.
Interesting Things
EY Cloud's slave database functionality is broken right now. It's supposed to be fixed this afternoon.
Amazon restricts you to 20 EBS volumes/EC2 instances per account by default. The trick here is that deleting volumes does not immediately free up space. Volumes stay in a 'Deleting volume' state for an indefinite amount of time before they are truly free, making it hard to allot space for them. Finding these deleting instances can be a real challenge - the AWS API can find them, but not the EY cloud GUI.
If you need to manipulate AWS credentials for EY Cloud, it's fairly easy to go to the machine and find the appropriate file - /etc/.mysql.backups.yml
Ask for Help
"Ever since we upgraded to RSpec 1.2.9, we haven't seen any stack traces. What gives?"
One of our projects lost stack traces as soon as they upgraded to RSpec 1.2.9. Reverting to RSpec 1.2.8 fixed the problem. No other projects have reported the issue yet.
Interesting Things
- Working with Rails for several years means that, as Rails advances, our testing/mocking codes get stale. We just discovered that one of our old mocks for representing the 'flash' object no longer works as designed with the current version of Rails.
Ask for Help
"What's a good design for sharing a page cache across multiple servers?"
One of our clients would like to have a distributed server environment share its page cache. At this point, they're relying on GFS to do this.. but this solution appears to have problems with reliability.
Several engineers questioned the necessity for such a thing, but memcached appeared to be the solution of choice.
"Any information on RabbitMQ?"
One of our engineers is beginning to play with RabbitMQ. Anyone who has good comments about this technology, please feel free to chime in.
Interesting Things
- load "location" and require "location" do not play nicely with Rail's automatic class reloading.
Rails maintains an internal array of files that it 'knows' about for this purpose. However, load and require bypass this mechanism, and lock files into place.
If you'd like to add a require that will class-reload, use the command 'require_dependency "location"'. This command, added by Rails, will require the file AND add it to ActiveSupport.
Ask for Help
"How do I make attachment_fu use both the file system and S3 as storage backends?"
One of our clients would like to migrate attachments from the file system to S3. They want a clever way to make attachment_fu look in S3 or the filesystem, where new files are in S3 and old files are in the filesystem.
Their current solution, which they're not super happy with, is to monkeypatch the S3 backend by extending it with file system methods. This solution doesn't really seem to work too well, since the two backends share some of the same methods, and calling "extend FileSystemBackend" doesn't give them the freedom to pick and choose their methods. In addition, their patch makes the S3 backend not be an S3 backend any more, which could cause problems for maintenance down the road.
A better solution is to define a new backend object, based on the S3 backend but falling back to file system-style methods. Attachment_fu supports defining custom backend modules; a class using :storage => :my_storage would look for a backend module called Technoweenie::AttachmentFu::Backends::MyStorageBackend.
Attachment_fu still has a design problem. The backend objects are all modules, not classes. As a result, it's not easy to make a new backend descend from one of the existing backends.
Interesting Things
- The new version of the bundler gem, version 0.7.2, does not seem to be Ruby 1.8.6 compliant. The gem relies on symbol.to_proc, which is part of Ruby 1.8.7 (and Rails). A native Ruby 1.8.6 without Rails does not support this method.
Issue tracking: http://github.com/wycats/bundler/issues/#issue/134
