Skip to content

Instantly share code, notes, and snippets.

@sms420
sms420 / gist:392641
Created May 6, 2010 20:09
ora_info.rb
#!/usr//bin/env ruby
#################################
# ora_info.rb
# Sean Stephenson
# 2010-05-05
# a script that tells you the path of:
# > table space names [-t]
# > redo log files [-r]
# > control files [-c]
@sms420
sms420 / gist:377950
Created April 24, 2010 21:14
script ssh login
#!/usr/bin/expect -f
spawn ssh USER@DOMAIN
expect "*?assword:*"
send -- "PASSWORD\r"
send -- "\r"
@sms420
sms420 / gist:366556
Created April 15, 2010 00:53
groupFile.rb
#!/usr//bin/env ruby
# groupFile.rb
# Sean Stephenson
# parses /etc/group file
/******************* getGroupFile *********************/
def getGroupFile
groupFile = `/usr/local/bin/rcopy.rb -q -r /etc/group`
return true if groupFile == ""
@sms420
sms420 / gist:366555
Created April 15, 2010 00:53
ora_acct_mgr.rb
#!/usr//bin/env ruby
# ora_acct_mgr.rb
# Sean Stephenson
# creates and deletes accounts on Oracle
require 'groupFile'
getGroupFile
@sms420
sms420 / gist:354861
Created April 3, 2010 21:20
lisr.rb
#!/usr/local/bin/ruby1.9 -w
#list.rb
#Sean Stephenson
#2009-09-24
#CS 177
#takes as input a file and options to display
#specific lines and [correspding line number]
### usage ###
@sms420
sms420 / gist:353804
Created April 2, 2010 22:18
Toggle Implementation
<h3><a href="#" class="toggleLink">Computers</a></h3>
<ul class="toggle">
<li>Laptops</li>
<li>Desktops</li>
<li>Servers</li>
</ul>
@sms420
sms420 / gist:353801
Created April 2, 2010 22:17
jQuery Toggle List
//jquery.toggle.list.js
jQuery(document).ready(function() {
// hide all of the elements with a class of 'toggle'
jQuery('.toggle').hide();
// clicking .toggleLink element will show the
// child elements with the class of .toggle
jQuery('a.toggleLink').click(function() {
jQuery(this).parent().next('.toggle').toggle('slow');
@sms420
sms420 / gist:321506
Created March 4, 2010 07:31
show Oracle params
#!/usr//bin/env ruby
##################################################################################
#
# Program Name: showParams.rb
# Author: Sean Stephenson
# Course: CS151B
# Date: 2010-02-21
#
# showParams.rb will do the followings:
@sms420
sms420 / gist:314926
Created February 25, 2010 19:16
Show_Oracle_Users.rb
#!/usr//bin/env ruby
################################################################################
#
# Program Name: Show_Oracle_Users.rb
# Author: Sean Stephenson
# Course: CS151B
# Date: 2010-02-07
# Adapted From: oracle_in_ruby.rb AND ShowTables (both by Abbas)
#
@sms420
sms420 / gist:270823
Created January 6, 2010 23:54
sms load file
#!/usr/local/bin/ruby1.9 -w
#smsloadfile.rb
#2010-01-06
#builds Concordance load file
inFile = File.new('input.txt')
k = 0
a = Array.new
while(str = inFile.gets)
a[k] = str
k += 1