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/bash | |
PING_COUNT=10 | |
INFO_LOG=/var/log/ups_monitor.log | |
ERROR_LOG=/var/log/ups_monitor.err | |
STATUS_LOG=/tmp/ups_monitor.log | |
SHUTDOWN_LOG=/var/log/ups_monitor_shutdown.log | |
LOCKER=/tmp/ups_monitor.lock | |
SHUTDOWN_COUNTER=5 |
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
load 'deploy' unless defined?(_cset) | |
_cset :asset_env, "RAILS_GROUPS=assets" | |
_cset :assets_prefix, "assets" | |
_cset :assets_role, [:web] | |
_cset :normalize_asset_timestamps, false | |
before 'deploy:finalize_update', 'deploy:mm_assets:symlink' | |
after 'deploy:update_code', 'deploy:mm_assets:precompile' |
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
=begin | |
** Install required packages | |
sudo apt-get install xvfb # fake X server | |
sudo apt-get install xfonts-base xfonts-75dpi xfonts-100dpi # fonts | |
sudo apt-get install iceweasel # this is firefox | |
=end | |
require 'headless' | |
require 'selenium-webdriver' | |
require 'webdriver-user-agent' |
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
def combine(arr, size) | |
return [] if size > arr.size || size <= 0 | |
return [arr] if size == arr.size | |
return arr.map{|item| [item]} if size == 1 | |
last = arr[-1] | |
left = arr[0..-2] | |
a = combine(left, size - 1).map{|item| item + [last]} | |
b = combine(left, size) | |
return a + b | |
end |
NewerOlder