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
| # Grab the 0.8.7 binaries, you may need to use a more current mirror | |
| curl -O "http://mirrors.ibiblio.org/apache//cassandra/0.8.7/apache-cassandra-0.8.7-bin.tar.gz" | |
| tar -xzf apache-cassandra-0.8.7-bin.tar.gz | |
| # Shut down Cassandra before changing anything, may take a minute or two | |
| sudo service cassandra stop | |
| # Make backups of the directories we'll be altering | |
| sudo cp -R /usr/bin /usr/bin_original | |
| sudo cp -R /usr/share/cassandra /usr/share/cassandra_original |
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
| require 'rubygems' if RUBY_VERSION < '1.9' | |
| require 'net/https' | |
| require 'uri' | |
| require 'multipart' | |
| FACEBOOK_GRAPH_SERVER='https://graph.facebook.com' | |
| def post_https(url, data, header) | |
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
| # Takes a hash of string and file parameters and returns a string of text | |
| # formatted to be sent as a multipart form post. | |
| # | |
| # Author:: Cody Brimhall <mailto:cbrimhall@ucdavis.edu> | |
| # Created:: 22 Feb 2008 | |
| # Licensed under the WFTPL - http://stackoverflow.com/questions/184178/ruby-how-to-post-a-file-via-http-as-multipart-form-data | |
| # http://sam.zoy.org/wtfpl/ | |
| require 'rubygems' | |
| require 'mime/types' |
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
| require 'rubygems' if RUBY_VERSION < '1.9' | |
| require 'tempfile' | |
| require File.join(ENV['JETPAC_PATH'], 'library/logger') | |
| require File.join(ENV['JETPAC_PATH'], 'library/email') | |
| def image_command(command) | |
| log "IMG: Running '#{command}'" | |
| result = system(command) | |
| if !result |
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 is called before the external site, so we can add dynamic Facebook permissions | |
| # for example. See http://www.mikepackdev.com/blog_posts/2-dynamically-requesting-facebook-permissions-with-omniauth | |
| get '/auth/:name/setup' do | |
| if session[:extra_permissions] | |
| request.env['omniauth.strategy'].options[:scope] = STANDARD_FACEBOOK_PERMISSIONS+','+session[:extra_permissions] | |
| session.delete(:extra_permissions) | |
| end | |
| # This looks odd, but is the expected way to indicate success to Omniauth! | |
| halt 404, 'Setup complete' | |
| end |
NewerOlder