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
add_column :spree_products, :promotional, :boolean |
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
Spree::Stock::Packer.class_eval do | |
def default_package | |
package = Spree::Stock::Package.new(stock_location, order) | |
order.line_items.each do |line_item| | |
# on_demand? will say if this kind of product has inventory | |
if Spree::Config.track_inventory_levels and not line_item.variant.product.on_demand? | |
next unless stock_location.stock_item(line_item.variant) | |
on_hand, backordered = stock_location.fill_status(line_item.variant, line_item.quantity) | |
package.add line_item.variant, on_hand, :on_hand if on_hand > 0 |
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
# Model Record (Protuário) | |
class Record < ActiveRecord::Base | |
belongs_to :patient | |
has_many :appointments | |
attr_accessible :data, :patient_id | |
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
cp #{latest_release}/system/maintenance.html #{shared_path}/system/maintenance.html.not_active | |
# Swap in the maintenance page | |
namespace :web do | |
task :disable, roles: :web do | |
on_rollback {run "rm #{shared_path}/system/maintenance.html"} | |
run "if [[ !(-f #{shared_path}/system/maintenance.html) ]] ; then ln -s #{shared_path}/system/maintenance.html.not_active #{shared_path}/system/maintenance.html ; else echo 'maintenance page already up'; fi" | |
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
#!/bin/sh | |
# | |
# processname: haproxy | |
# config: /opt/haproxy/haproxy.cfg | |
# pidfile: /var/run/haproxy.pid | |
[ -f /opt/haproxy/haproxy.cfg ] || exit 1 | |
RETVAL=0 |
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
# Fail2Ban configuration file. | |
# | |
# This file was composed for Debian systems from the original one | |
# provided now under /usr/share/doc/fail2ban/examples/jail.conf | |
# for additional examples. | |
# | |
# To avoid merges during upgrades DO NOT MODIFY THIS FILE | |
# and rather provide your changes in /etc/fail2ban/jail.local | |
# | |
# Author: Yaroslav O. Halchenko <debian@onerussian.com> |
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
# The following variable settings are the initial default values, | |
# which can be uncommented and modified to alter logcheck's behaviour | |
# Controls the format of date-/time-stamps in subject lines: | |
# Alternatively, set the format to suit your locale | |
DATE="$(date +'%d/%m/%Y %H:%M')" | |
# Controls the presence of boilerplate at the top of each message: | |
# Alternatively, set to "0" to disable the introduction. |
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
upstream unicorn_app { | |
server unix:/home/ubuntu/www/app.com.br/current/tmp/.sock | |
fail_timeout=0; | |
} | |
server { | |
listen 81; | |
server_name .app.com.br; | |
root /home/ubuntu/www/app.com.br/current/public; |
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
user www-data; | |
worker_processes 4; | |
worker_rlimit_nofile 2048; | |
worker_priority 0; | |
worker_cpu_affinity 0001 0010 0100 1000; | |
error_log /var/log/nginx/error.log; | |
events { |
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
frontend all 0.0.0.0:80 | |
mode tcp | |
maxconn 200000 | |
timeout client 86400000 | |
default_backend www_backend | |
acl is_socket_staging hdr_beg(host) socket.teste | |
acl is_socket hdr(Upgrade) -i WebSocket |
NewerOlder