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 | |
script_name = File.basename(__FILE__) | |
file_path = ARGV[0] | |
abort "No input CSV file provided. Example: #{script_name} ./prod_center_accounts.csv" if file_path.nil? | |
abort 'File must have a .csv extension' unless file_path =~ /\.csv\Z/ | |
new_file_path = file_path.gsub(/\.csv\Z/, '_with_netids.csv') |
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
# Run with command: | |
# CAS_SERVER="http://example.com/login" rackup | |
require 'sinatra/base' | |
require 'rack/cas' | |
require 'yaml' | |
class SinatraRackCASExample < Sinatra::Base | |
before do | |
unless session['cas'] && session['cas']['user'] |
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 'rack' |
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
# Usage: | |
# Log.info 'done' | |
# Log.debug @var.inspect | |
# Log.error 'OH NOES!!!1' | |
# etc. | |
module Log | |
def self.method_missing(meth, *args, &block) | |
if logger.respond_to? meth | |
logger.send meth, *args, &block |
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
10.200.160.83 apps.static1.prod.biola.edu | |
10.200.160.83 career.static1.prod.biola.edu | |
10.200.160.83 wireless.static1.prod.biola.edu | |
10.200.160.83 www.static1.prod.biola.edu | |
10.200.160.246 academics.ruby2.staging.biola.edu | |
10.200.160.246 answers.ruby2.staging.biola.edu | |
10.200.160.246 api.ruby2.staging.biola.edu | |
10.200.160.246 apps.ruby2.staging.biola.edu | |
10.200.160.246 forms.ruby2.staging.biola.edu |
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 | |
require 'csv' | |
file = ARGV.first | |
TABLE = 'everbridge_user' | |
date_modified = Time.now.strftime '%Y-%m-%d %H:%M:%S' | |
CSV.foreach(file, headers: :first_row) do |row| |
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
* { margin: 0; } | |
html, body { height: 100%; font-family: Arial, Helvetica, sans-serif; } | |
body { background: #f5f5f5; } | |
img { border-style: none; font-weight: normal; } | |
a:link, a:visited { color: #009; font-weight: bold; text-decoration: none; } | |
a:hover, a:active { color: #6cb33f; font-weight: bold; text-decoration: none; outline: none; } | |
a:focus, a:active { outline: none; } | |
:focus { outline-style: none; } | |
.clear { clear: both; margin: 0px; padding: 0px; height: 1px; } | |
p { color: #333; margin: 0px 0px 5px; font-size: 0.8em; display: block; width: 100%; } |
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
class LocalODServer | |
attr_accessor :username, :password | |
def initialize(username, password) | |
@username = username | |
@password = password | |
end | |
def ip | |
'127.0.0.1' |
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
description "faye" | |
version "1.0" | |
author "Adam Crownoble" | |
env LANG=en_US.UTF-8 | |
env APP_ROOT=/srv/rack/faye-server | |
start on startup | |
stop on shutdown |
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 batch_session_prune(keep_after = 1.month.ago, batch_by = 1.day, pause_time = 10) | |
time = ActiveRecord::SessionStore::Session.order(:updated_at).first[:updated_at] | |
while time < keep_after | |
time = time + batch_by | |
puts "Deleting sessions from #{time.to_s(:short)}" | |
ActiveRecord::SessionStore::Session.where('updated_at < ?', time).delete_all | |
sleep pause_time |