Skip to content

Instantly share code, notes, and snippets.

@sms420
sms420 / gist:261558
Created December 22, 2009 06:47
computer class
#!/usr/local/bin/ruby1.9 -w
# class possesing eight methods to provide
# information about the physical system:
# (1) mem_size
# (2) cpu_nums
# (3) cpu_vendor
# (4) cpu_model
# (5) cpu_speed
@sms420
sms420 / gist:261557
Created December 22, 2009 06:46
my system
#!/usr/local/bin/ruby1.9 -w
# mySys.rb
# Sean Stephenson
# CS 177
# 2009-12-17
# provides info re my computer, dude
require 'computer'
@sms420
sms420 / gist:259352
Created December 18, 2009 07:57
find replace
#!/usr/local/bin/ruby1.9 -w
# findReplace.rb
#####################################
# #
# searches files in specified #
# path for specific string #
# and then replaces that string #
# #
@sms420
sms420 / gist:253077
Created December 10, 2009 02:54
Import_To_CaseMap
@ECHO OFF
FOR %%c in (*.pdf*) DO echo %CD%\%%c,%%c >> _IMPORT_LIST.txt
ECHO ON
@sms420
sms420 / gist:226806
Created November 5, 2009 05:54
server
#!/usr/local/bin/ruby1.9 -w
#
# server
# web
#
# Created by GlenC on 2009-10-31.
# Copyright 2009 glenc.com. All rights reserved.
# Modified by SMS420 on 2009-11-04 dude
@sms420
sms420 / gist:214639
Created October 20, 2009 21:36
ruby de dupe
# dedupe.rb
# Sean Stephenson
# 2009-10-20
#################################
# #
# takes one file as input. #
# reads a line and writes #
# this line to output file #
@sms420
sms420 / gist:207235
Created October 10, 2009 23:19
home baked wiki - html converter
#!/bin/bash
#wiki_to_html.sh
#converts wiki formatted doc to html
find . -name "*.html" -exec sed -i 's/\[\[/\<a href="/g' '{}' \;
find . -name "*.html" -exec sed -i 's/|/.html">/g' '{}' \;
find . -name "*.html" -exec sed -i 's/\]\]/\<\/a\>/g' '{}' \;
@sms420
sms420 / gist:186525
Created September 14, 2009 05:37
wiki to html
#!/bin/bash
#wiki_to_html.sh
#converts wiki formatted doc to html
find ./ -name '*.txt' -print | while read i
do
sed 's/\[\[/\<a href="/g' $i >$i.bak && mv $i.bak $i
sed 's/|/">/g' $i >$i.bak && mv $i.bak $i
sed 's/\]\]/\<\/a\>/g' $i >$i.bak && mv $i.bak $i
done
@sms420
sms420 / gist:186511
Created September 14, 2009 04:59
insert at beginning of file
#!/bin/bash
find ./ -name '*.txt' -print | while read i
do
sed '1i\
LINE ZERO DUDE' $i >$i.bak && mv $i.bak $i
done
@sms420
sms420 / gist:175242
Created August 26, 2009 01:56
de_dupe.rb
# de_dupe.rb
# Sean (2009-08-25)
# reads line of data from parent.txt
# which is a super set of child.txt
# and outputs all lines of parent
# file not found in the child file
# WORD OF CAUTION: MAKE SURE THAT
# BOTH PARENT AND CHILD TEXT FILES
# ARE CONSISTENT WITH HAVING OR NOT