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/env ruby | |
# encoding: UTF-8 | |
# | |
# check-smart | |
# | |
# DESCRIPTION: | |
# | |
# OUTPUT: | |
# plain text | |
# |
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 initialize(device_id) | |
@device_path = "-d megaraid,#{device_id} /dev/sda" | |
@smart_available = false | |
@smart_enabled = false | |
@smart_healty = nil | |
check_smart_capability! | |
check_health! if smart_capable? | |
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
def scan_disks! | |
output = `sudo /usr/sbin/storcli /c0 /eall /sall show J` | |
parsed_output = JSON.parse(output) | |
critical "Can't get device ID from storcli" unless parsed_output["Controllers"][0]["Command Status"]["Status"]=="Success" | |
parsed_output["Controllers"][0]["Response Data"]["Drive Information"].each do |drive| | |
@devices << Disk.new(drive["DID"]) | |
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
# encoding: UTF-8 | |
class Shop | |
SHOP_CONFIG = YAML.load_file("#{Rails.root}/config/holvi_config.yml")[Rails.env] | |
def self.get_shop_url | |
holvi_request = {} | |
holvi_request["pool"] = SHOP_CONFIG["pool"] | |
holvi_request["purchases"] = [{"product"=>holvi_product_id}] | |
holvi_request["firstname"] = firstname | |
holvi_request["lastname"] = lastname |
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.development do |dev| | |
dev.platform.logging.level = :debug | |
dev.platform.logging.outputters<<Logging::Appenders::Syslog.new('my_ahn_app') | |
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 | |
### BEGIN INIT INFO | |
# Provides: bluepill | |
# Required-Start: $local_fs $remote_fs $network $syslog $time | |
# Required-Stop: $local_fs $remote_fs $network $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: bluepill daemon, providing process monitoring | |
# Description: bluepill is a monitoring tool. More info at http://github.com/arya/bluepill. |
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
source 'https://rubygems.org' | |
gem 'rails', '3.2.11' | |
group :assets do | |
gem 'sass-rails', '~> 3.2.3' | |
gem 'coffee-rails', '~> 3.2.1' | |
gem 'uglifier', '>= 1.0.3' | |
gem 'execjs' | |
gem 'therubyracer' | |
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
source 'https://rubygems.org' | |
gem 'rails', '3.2.12' | |
group :assets do | |
gem 'sass-rails', '~> 3.2.3' | |
gem 'coffee-rails', '~> 3.2.1' | |
gem 'uglifier', '>= 1.0.3' | |
gem 'execjs' | |
gem 'therubyracer' | |
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
stop rabbitmq-server | |
start rabbitmq-server | |
status rabbitmq-server | |
bluepill whapps restart | |
bluepill ecallmgr restart |
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::CheckoutController.class_eval do | |
helper Spree::AddressesHelper | |
after_filter :normalize_addresses, :only => :update | |
before_filter :set_addresses, :only => :update | |
protected | |
def set_addresses | |
return unless params[:order] && params[:state] == "address" |
NewerOlder