This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OH NO! It turns out that simple one-port SSH Tunnels won't work for FTP since it uses another random port to actually transfer data. No problem! SOCKS Proxy to the rescue! | |
This assumes that you have SSH access to a server that can successfully connect to the FTP server you want access to. | |
On your local execute (if you have a woople ssh alias setup): | |
ssh -ND 1234 woople | |
You'll need an FTP client that supports SOCKS Proxies. I recommend Filezilla. Enter localhost:1234 as your SOCKS proxy server and connect to the FTP server using its regular internet address (as though you were connecting from your production server). SWEEEET! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def search_cache | |
@search_cache ||= Sunspot.search [Course, Channel, Episode] do | |
keywords(query) | |
any_of do | |
with(:channel_id, accessible_channel_ids) | |
with(:course_id, accessible_course_ids) | |
with(:episode_id, accessible_episode_ids) | |
end | |
paginate(:page => current_page) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>org.apache.solr</string> | |
<key>OnDemand</key> | |
<true/> | |
<key>ProgramArguments</key> | |
<array> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC | |
"-//Apple Computer//DTD PLIST 1.0//EN" " | |
http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>org.apache.solr</string> | |
<key>ProgramArguments</key> | |
<array> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# Use this behind the scenes to migrate files from your filesystem to Amazon S3 | |
# %: rake paperclip_migration:migrate_to_s3 | |
## | |
namespace :attachments do | |
desc "migrate files from filesystem to s3" | |
task :migrate_to_s3 => :environment do | |
require 'aws/s3' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Cookbook Name:: passenger_memory_increase | |
# Recipe:: default | |
# | |
if node.engineyard.environment.stack.passenger? | |
ey_cloud_report "passenger_memory_increase" do | |
message "processing passenger memory increase" | |
end | |
node.engineyard.apps.each do |app| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Tue, 28 Jun 2011 12:55:51 -0700] INFO: Starting Chef Solo Run | |
/etc/chef-custom/recipes/cookbooks/passenger_memory_increase/recipes/default.rb:5:in `from_file': undefined method `environment' for #<Mash:0xb780fe28> (NoMethodError) | |
from /usr/local/ey_resin/ruby/lib/ruby/gems/1.8/gems/chef-0.6.0.2/lib/chef/cookbook.rb:139:in `load_recipe' | |
from /usr/local/ey_resin/ruby/lib/ruby/gems/1.8/gems/chef-0.6.0.2/lib/chef/recipe.rb:76:in `include_recipe' | |
from /usr/local/ey_resin/ruby/lib/ruby/gems/1.8/gems/chef-0.6.0.2/lib/chef/recipe.rb:63:in `each' | |
from /usr/local/ey_resin/ruby/lib/ruby/gems/1.8/gems/chef-0.6.0.2/lib/chef/recipe.rb:63:in `include_recipe' | |
from /usr/local/ey_resin/ruby/lib/ruby/gems/1.8/gems/chef-0.6.0.2/lib/chef/recipe.rb:82:in `require_recipe' | |
from /etc/chef-custom/recipes/cookbooks/main/recipes/default.rb:73:in `from_file' | |
from /usr/local/ey_resin/ruby/lib/ruby/gems/1.8/gems/chef-0.6.0.2/lib/chef/cookbook.rb:139:in `load_recipe' | |
from /usr/local/ey_resin/ruby/lib/ruby/gems/1.8/gems/chef-0.6.0.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ProgressiveContent | |
# additionally you could pass in arguments | |
# to help initialize a specific scope | |
def initialize | |
@generated = false | |
@test_response = false | |
end | |
# this method is used in the CSV Responder |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ProgressiveController < ApplicationController | |
def show | |
respond_to do |wants| | |
wants.csv { | |
render :csv => ProgressiveContent.new, :status => :ok | |
} | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this renderer allows the system to render progressively generated content | |
# rendering a proc was removed in Rails 3.0 | |
ActionController::Renderers.add :csv do |detailed_report, options| | |
filename = detailed_report.to_filename | |
headers['Cache-Control'] = 'must-revalidate, post-check=0, pre-check=0' | |
headers['Content-Disposition'] = "attachment; filename=#{filename}" | |
headers['Content-Type'] = 'text/csv' | |
headers['Content-Transfer-Encoding'] = 'binary' | |