Remotely:
sudo mkdir /var/www/dashboard.app
sudo chown -R deploy:deploy /var/www/dashboard.app/
Locally:
cap deploy:setup
| __author__ = 'bordy' | |
| def checkio(data): | |
| if (len(data)<10) or (data==data.upper()) or (data==data.lower()): | |
| return False | |
| else: | |
| digits = [i for i in data if i in [str(x) for x in range(10)]] | |
| if digits == []: | |
| return False | |
| else: |
| import bs4 | |
| import requests | |
| cath_resp = requests.get('http://www.reddit.com/r/Catholicism/top/') | |
| soup = bs4.BeautifulSoup(cath_resp.text) | |
| print(soup.prettify()) |
| def find_primes(num): | |
| i = 2 | |
| while i * i < num: | |
| while num % i == 0: | |
| num = num/i | |
| i = i + 1 | |
| print num |
| sass_dir = ask("Where would you like to keep your sass files within your project? (default: 'app/stylesheets')") | |
| sass_dir = "app/stylesheets" if sass_dir.blank? | |
| css_dir = ask("Where would you like Compass to store your compiled css files? (default: 'public/stylesheets')") | |
| css_dir = "public/stylesheets" if css_dir.blank? | |
| compass_command = "compass --rails . --css-dir=#{css_dir} --sass-dir=#{sass_dir} " | |
| file 'vendor/plugins/compass/init.rb', <<-CODE | |
| # This is here to make sure that the right version of sass gets loaded (haml 2.2) by the compass requires. |
| SSH_ENV=$HOME/.ssh/environment | |
| function start_agent { | |
| echo "Initializing new SSH agent..." | |
| /usr/bin/ssh-agent | sed 's/^echo/#echo/' > ${SSH_ENV} | |
| echo succeeded | |
| chmod 600 ${SSH_ENV} | |
| . ${SSH_ENV} > /dev/null | |
| /usr/bin/ssh-add; | |
| } |
| require 'rubygems' | |
| require 'money' | |
| require 'yaml' | |
| class Array | |
| def total_hashes | |
| self.inject({}) do |totals, hsh| | |
| hsh.each { |key, value| (totals[key] = totals[key] ? value + totals[key] : value) unless %w(String Hash Array).include?(value.class.to_s) } if hsh.is_a?(Hash) | |
| totals |
| #!/usr/bin/env ruby | |
| v = RUBY_VERSION.match(/^1\.9/) ? "18" : "19" | |
| %w{ruby irb gem erb ri rdoc}.each do |c| | |
| system "sudo ln -fs /usr/local/bin/#{c+v} /usr/local/bin/#{c}" | |
| end | |
| system "ruby --version" | |
| # Notes on Deploying Rails with Passenger on Ubuntu 9.04 and ruby 1.9 | |
| ssh [email protected] | |
| adduser deploy | |
| adduser deploy sudo | |
| visudo | |
| # uncomment or add the line: %sudo ALL=NOPASSWD: ALL |