This guide assumes you are upgrading from Mac OSX 10.6 Snow Leopard to 10.7 Lion.
This file contains 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
after "deploy", "deploy:migrate", "deploy:static", "deploy:restart", "custom:git:tag" | |
namespace :deploy do | |
[:stop, :start, :restart, :reload].each do |action| | |
desc "#{action.to_s.capitalize} Apache." | |
task action, :roles => :app do | |
run "sudo /etc/init.d/apache2 #{action.to_s}" | |
end | |
end |
The latest Xcode and Command Line Tools for Xcode changes the default compiler from gcc to the llvm compiler. Only ruby-1.9.3-p125+ is LLVM ready. So, you will have to install gcc-4.2 to compile older versions of Ruby. More detail here https://github.com/mxcl/homebrew/wiki/Custom-GCC-and-cross-compilers.
This worked for me. I hope it saves some people time:
brew install https://raw.github.com/Homebrew/homebrew-dupes/master/apple-gcc42.rb
CC=/usr/local/bin/gcc-4.2 rvm install 1.8.7
This file contains 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
# install libs | |
sudo apt-get install gifsicle | |
sudo apt-get install imagemagick | |
sudo apt-get install pngcrush | |
sudo apt-get install libjpeg-progs | |
sudo apt-get install pkg-config | |
sudo apt-get install libpng-dev | |
# get smush.py | |
cd /var/apps/macarthur_cms_env/bin/ |
This file contains 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
<html> | |
<body> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript" charset="utf-8"></script> | |
<script type="text/javascript" charset="utf-8"> | |
$(document).ready(function(){ | |
$("img").error(function(){ | |
$(this).attr("src", function(){ | |
size = ($(this).attr("width") + "x" + $(this).attr("height")).match(/\d+x\d+|\d+/i); | |
return "http://placehold.it/" + size; | |
}); |
This file contains 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
cd /etc/apache2/mods-enabled | |
sudo ln -s ../mods-available/headers.load headers.load | |
... | |
sudo vim /etc/apache2/sites-enabled/000-default | |
# Used for New Relic instrumentation | |
RequestHeader add X-Queue-Start "%t" |
This file contains 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
#!/usr/bin/ruby | |
require 'time' | |
def format_time(seconds) | |
hours = (seconds / 3600).to_i | |
minutes = ((seconds % 3600) / 60).to_i | |
seconds = (seconds % 60).to_i | |
minutes = "0#{minutes}" if minutes < 10 | |
seconds = "0#{seconds}" if seconds < 10 |
This file contains 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
# Apache server | |
upstream django { | |
server 127.0.0.1:9000; | |
} | |
# Redirect all requests on the root subdomain to the www domain. | |
server { | |
listen 80; | |
server_name example.com; | |
rewrite ^(.*) http://www.example.com$1 permanent; |
This file contains 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
config.action_controller.asset_host = Proc.new do |source, request| | |
asset_config = YAML::load(File.open(File.join(Rails.root, "config/amazon_s3.yml")))[Rails.env] | |
if request.ssl? | |
return "https://#{asset_config['bucket_name']}" | |
else | |
return "http://#{asset_config['cdn_host']}" | |
end | |
end |
This file contains 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
# Ignore RVM gemsets | |
echo "export rvm_ignore_gemsets_flag=1" >> ~/.rvmrc | |
# Activate RVM Bundler binstubs integration | |
chmod +x $rvm_path/hooks/after_cd_bundler | |
# Install bundle with binstubs | |
cd <project> | |
bundle install --binstubs | |
echo "bin/" >> .git/info/exclude |
OlderNewer