Skip to content

Instantly share code, notes, and snippets.

View workmad3's full-sized avatar

David Workman workmad3

View GitHub Profile
class LayoutLookup
attr_reader :override_css, :ie_ver
def initialize
@override_css = ''
@ie_ver = nil
end
def [](landing)
case landing
module Export
module V1
class GroupSerializer < ActiveModel::Serializers
attributes :items
def items_serializer
ItemsSerializer
end
def items
class Balance
attr_reader :value
def initialize(value: 0)
@value = value
end
def apply(credit: 0, charge: 0)
Balance.new(value: self.value + credit - charge)
end
module Kernel
def Structable(*attrs)
Module.new do
attrs.each do |attr|
attr_accessor attr
end
define_method :initialize do |*args|
attrs.zip(args).each do |attr, arg|
send("#{attr}=", arg)
'abxch12354.'.each_char do |c|
case c
when /\d/
puts c
else
# do nothing
end
end
directory "/usr/rails_apps/hss/current"
environment "production"
threads 0,32
workers 2
bind "unix:///var/run/puma/sockets/hss-server"
module Includer
def hi
super if defined?(super)
puts "Hi from Includer"
end
end
module Prepender
def hi
super if defined?(super)

OS

Ubuntu 12.10 64bit server

Setup

Basic OSS standalone setup

Upgrade commands

# authorization: auth account
auth optional pam_krb5.so use_first_pass use_kcminit
auth optional pam_ntlm.so use_first_pass
#auth required pam_opendirectory.so use_first_pass nullok
auth required pam_google_authenticator.so forward_pass try_first_pass
auth required pam_opendirectory.so use_first_pass
account required pam_opendirectory.so use_first_pass
volumes = ec2.volumes.each_with_object({}) do |v, m|
m[v.id] = {status: v.status, name: v.tags["Name"], instance: v.tags["Instance"]}
end
volumes.each do |id, info|
log "#{id} status: #{info[:status]}, name: #{info[:name]}, instance: #{info[:instance]}"
end
log volumes[<some_id>][:status]