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
if Rails.env.production? | |
@viva_url = "https://www.vivapayments.com" | |
@rest = RestClient::Resource.new "#{@viva_url}/api/orders", :user => "user_id4", :password => "password" | |
else | |
@viva_url = "http://demo.vivapayments.com" | |
@rest = RestClient::Resource.new "#{@viva_url}/api/orders", :user => "user_id", :password => "password" | |
end | |
email = @order.email | |
phone = @order.phone |
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
check process your_project_sidekiq | |
with pidfile /your_project/current/tmp/pids/sidekiq.pid | |
start program = "/bin/bash -l -c 'cd /your_project/current && bundle exec sidekiq -e staging -C config/sidekiq.yml -d -P tmp/pids/sidekiq.pid -L log/sidekiq.log'" | |
stop program = "/bin/bash -l -c kill -s TERM `cat /your_project/current/tmp/pids/sidekiq.pid`" |
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
check process your_project_unicorn | |
with pidfile /your_project_unicorn/current/tmp/pids/unicorn.pid | |
start program = "/bin/bash -l -c 'cd /your_project_unicorn/current && bundle exec unicorn -E staging -c /your_project_unicorn/current/config/unicorn.rb -D'" | |
stop program = "/bin/bash -l -c kill -QUIT `cat /your_project_unicorn/current/tmp/pids/unicorn.pid` |
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
check process sshd with pidfile /var/run/sshd.pid | |
start program "/etc/init.d/ssh start" | |
stop program "/etc/init.d/ssh stop" |
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
check process nginx with pidfile /var/run/nginx.pid | |
start program = "/etc/init.d/nginx start" | |
stop program = "/etc/init.d/nginx stop" |
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
check process redis-server | |
with pidfile "/var/run/redis/redis-server.pid" | |
start program = "/etc/init.d/redis-server start" | |
stop program = "/etc/init.d/redis-server stop" |
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
set daemon 30 | |
set logfile /var/log/monit.log | |
set idfile /var/lib/monit/id | |
set statefile /var/lib/monit/state | |
set eventqueue | |
basedir /var/lib/monit/events # set the base directory where events will be stored | |
slots 100 # optionally limit the queue siz | |
set httpd port 2812 | |
allow 0.0.0.0/0.0.0.0 | |
allow username:password |
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
.groups{ng_repeat: "row in [] | skip_range:0:keyword_groups.length-1:3"} | |
.group{ng_repeat: "keyword_group in [] | range:row*3:((row+1)*3)-1:keyword_groups"} |
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 'aws-sdk' | |
require 'mail' | |
# The filename for using it during the script and the location | |
filename = "#{Time.now.to_s.split(" ").first}_data_only_dump.sql" | |
store_location = "/home/your_user/your_backups/#{filename}" | |
# Local backup of a postgres database | |
`pg_dump -U your_user your_db_name -f #{store_location} --data-only` |
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
bet1 = 2.25 | |
bet2 = 3.15 | |
bet3 = 3.15 | |
puts "#{(1 - 1/(1/bet1 + 1/bet2 + 1/bet3)) * 100}%" |