Skip to content

Instantly share code, notes, and snippets.

@ebot
ebot / convert_xml.py
Created November 15, 2011 17:43
Convert Soarian Xml Declarations to ZOS Compatible Ones
#!/usr/bin/python
#
# Soarian Conversion Script
# Created By Ed Botzum
#
# This script replaces the UTF xml declaration with an IBM one.
input_file = open( 'soar_1-1-0.xml', 'r' )
input_text = input_file.read()
print input_text.replace( 'utf-8', 'IBM-1047' )
@ebot
ebot / gist:1339448
Created November 4, 2011 14:31
Script that compresses all Mongo DBs except admin and local.
var hospitals = db.getMongo().getDBNames();
for(var h in hospitals){
if (hospitals[h] != "admin" && hospitals[h] != "local") {
var db = db.getMongo().getDB( hospitals[h] );
var size_before = ((db.stats()["dataSize"] / 60) / 60);
print( "Repairing DB " + db.getName() + " - " + size_before );
db.repairDatabase();
var size = ((db.stats()["dataSize"] / 60) / 60);
print( " Complete - " + size + ". Size reduced by " + ( size_before - size ) + " MB." );
}
@ebot
ebot / 01_README.markdown
Created October 18, 2011 18:47
How to gather data on open and closed deficiencies
  1. Get the the list of active deficiencies by running the 02_open_deficiencies.sql.
    1. Def Assignment TAT = DeficiencyCreateDateTime - DocumentCreateDateTime
  2. Get the list of completed deficiencies by running the 03_completed_deficiencies.sql.
    1. Parse the ListData field's xml.
      1. If the DocId is not listed in the deficiencies table in the operational database and the DocType is valid:
        1. Def Assignment TAT = //Deficiency/CreateDateTime - Document.CreateDateTime
  3. Def Completed TAT = Event.StartDateTime - Document.CreateDateTime
@ebot
ebot / non_leap_year_download.rb
Created August 12, 2011 16:33
Script that downloads file on Mar 1 if Feb only has 28 days
#!/usr/bin/env ruby -wKU
# Non Leap Year Download Script
# Create By Ed Botzum
# Last Updated 2011-08-12
# Code maintained at https://gist.github.com/1142420
#
# This script will download the specified files on March 1 in years when
# February has only twenty eight days, b/c the normal monthly job is scheduled
# to run on the twenty ninth of each month. This custom job will run on the
# first of each month. Yay rediculous waste!
@ebot
ebot / .gemrc
Created July 6, 2011 14:19
My Standard git, gem, and rspec configurations for Ruby development.
gem: --local --no-rdoc --no-ri
@ebot
ebot / gist:1054804
Created June 29, 2011 20:05
kickstart
# Initialize the var
dupe_docs = {}
# In your loop/routine
dupe_docs[doc_id] = [] if dupe_docs[doc_id].nil?
dupe_docs[doc_id] << encounter_number
# At the bottom, output the totals
puts "There were #{dupe_docs.count} duplicate documents:"
dupe_docs.each do |doc, encounters|
@ebot
ebot / find_failed_export_docs.rb
Created June 14, 2011 18:56
Scans the export logs and locates the doc id of specified job ids.
#!/usr/bin/env ruby -wKU
job_ids = [ '9555141D-0728-473C-9C98-F62E2D944F2F',
'C8AB8CF9-1A1D-45D8-A6E0-D65C3F6D7DBB',
'C8531ECE-E771-432C-8D24-86E1881EEA41',
'3531688C-BD89-4394-A786-DCF6FEE4753B',
'3C8890BE-4D24-4521-A780-1E896A3BB49B',
'D4A2B1D7-3ABE-4CA2-B22E-720552936D7D',
'309B2CD2-4277-45ED-870D-E7AC2CC51700',
'20B56A51-6D47-4207-AD34-8C0EAE49C6F9',
@ebot
ebot / fix_csv.rb
Created March 31, 2011 16:40
Strips out doc id brackets at trims white space on csv files
#!/usr/bin/env ruby -wKU
input = File.new 'generic_doc_labels.csv'
output = File.new 'generic_document_labels.csv', 'w'
line_number = 0
input.each_line do |line|
unless line_number == 0
fields = line.split '","'
@ebot
ebot / gist:893675
Created March 30, 2011 01:03
Passenger Setup Notes
To fix server permissions
===========================
In httpd.conf (/etc/apache2)
* Comment out User and Group
* Add User <name of admin user>
Create App Entries
====================