Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
JJ Asghar committed Jun 13, 2012
0 parents commit 081c793
Show file tree
Hide file tree
Showing 57 changed files with 526 additions and 0 deletions.
Binary file added .hg/00changelog.i
Binary file not shown.
1 change: 1 addition & 0 deletions .hg/branch
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
default
2 changes: 2 additions & 0 deletions .hg/cache/branchheads
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
f166d7c804e3110fa6046f672685ae28ba8c1c1b 3
f166d7c804e3110fa6046f672685ae28ba8c1c1b default
2 changes: 2 additions & 0 deletions .hg/cache/tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
2 3d601adc63d8adf0a0c32ab305df5f1b91b81b90

Binary file added .hg/dirstate
Binary file not shown.
4 changes: 4 additions & 0 deletions .hg/last-message.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

Added catalina_log_pull


4 changes: 4 additions & 0 deletions .hg/requires
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
revlogv1
fncache
store
dotencode
Binary file added .hg/store/00changelog.i
Binary file not shown.
Binary file added .hg/store/00manifest.i
Binary file not shown.
Binary file added .hg/store/data/apache.txt.i
Binary file not shown.
Binary file not shown.
Binary file added .hg/store/data/catalina__bb__logs__pull.sh.i
Binary file not shown.
Binary file added .hg/store/data/foo__out.txt.i
Binary file not shown.
Binary file added .hg/store/data/new__pysysinfo.py.i
Binary file not shown.
Binary file added .hg/store/data/pull__bb__logs.sh.i
Binary file not shown.
Binary file added .hg/store/data/py__kill__all__by__user.py.i
Binary file not shown.
Binary file added .hg/store/data/py__sys__sdtin__readline.py.i
Binary file not shown.
Binary file not shown.
Binary file added .hg/store/data/pyls.py.i
Binary file not shown.
Binary file added .hg/store/data/pysysinfo.py.i
Binary file not shown.
Binary file added .hg/store/data/pysysinfo.pyc.i
Binary file not shown.
Binary file added .hg/store/data/pysysinfo__fuction.py.i
Binary file not shown.
Binary file added .hg/store/data/pysysinfo__fuction.pyc.i
Binary file not shown.
Binary file added .hg/store/data/redirect1.py.i
Binary file not shown.
Binary file added .hg/store/data/ssh-copy-id.sh.i
Binary file not shown.
Binary file added .hg/store/data/writelines__outfile.txt.i
Binary file not shown.
17 changes: 17 additions & 0 deletions .hg/store/fncache
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
data/pysysinfo_fuction.pyc.i
data/writelines_outfile.txt.i
data/pysysinfo.py.i
data/py_wrapper_around_xmlconversion.py.i
data/pyls.py.i
data/new_pysysinfo.py.i
data/blackboard_convert_for_course_exports.sh.i
data/pysysinfo.pyc.i
data/pull_bb_logs.sh.i
data/py_sys_sdtin_readline.py.i
data/pysysinfo_fuction.py.i
data/py_kill_all_by_user.py.i
data/catalina_bb_logs_pull.sh.i
data/foo_out.txt.i
data/apache.txt.i
data/redirect1.py.i
data/ssh-copy-id.sh.i
1 change: 1 addition & 0 deletions .hg/store/phaseroots
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1 6a1af0b7d75c2f1ea745752441b92b9d55b7f626
Binary file added .hg/store/undo
Binary file not shown.
1 change: 1 addition & 0 deletions .hg/store/undo.phaseroots
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1 6a1af0b7d75c2f1ea745752441b92b9d55b7f626
Empty file added .hg/undo.bookmarks
Empty file.
1 change: 1 addition & 0 deletions .hg/undo.branch
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
default
2 changes: 2 additions & 0 deletions .hg/undo.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
3
commit
Binary file added .hg/undo.dirstate
Binary file not shown.
31 changes: 31 additions & 0 deletions EUD_ITEM_prune_sp8upgrade.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

delete from EUD_ITEM where START_DATE < (sysdate - 400) and IMPORTANT_IND = 'N';
commit;
delete from EUD_ITEM where START_DATE < (sysdate - 350) and IMPORTANT_IND = 'N';
commit;
delete from EUD_ITEM where START_DATE < (sysdate - 300) and IMPORTANT_IND = 'N';
commit;
delete from EUD_ITEM where START_DATE < (sysdate - 290) and IMPORTANT_IND = 'N';
commit;
delete from EUD_ITEM where START_DATE < (sysdate - 280) and IMPORTANT_IND = 'N';
commit;
delete from EUD_ITEM where START_DATE < (sysdate - 270) and IMPORTANT_IND = 'N';
commit;
delete from EUD_ITEM where START_DATE < (sysdate - 260) and IMPORTANT_IND = 'N';
commit;
delete from EUD_ITEM where START_DATE < (sysdate - 250) and IMPORTANT_IND = 'N';
commit;
delete from EUD_ITEM where START_DATE < (sysdate - 240) and IMPORTANT_IND = 'N';
commit;
delete from EUD_ITEM where START_DATE < (sysdate - 230) and IMPORTANT_IND = 'N';
commit;
delete from EUD_ITEM where START_DATE < (sysdate - 220) and IMPORTANT_IND = 'N';
commit;
delete from EUD_ITEM where START_DATE < (sysdate - 210) and IMPORTANT_IND = 'N';
commit;
delete from EUD_ITEM where START_DATE < (sysdate - 200) and IMPORTANT_IND = 'N';
commit;
delete from EUD_ITEM where START_DATE < (sysdate - 190) and IMPORTANT_IND = 'N';
commit;
delete from EUD_ITEM where START_DATE < (sysdate - 180) and IMPORTANT_IND = 'N';
commit;
Empty file added README
Empty file.
23 changes: 23 additions & 0 deletions apache.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
NameVirtualHost 127.0.0.1:80
<VirtualHost localhost:80>
DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
</VirtualHost>
<VirtualHost local2:80>
DocumentRoot /var/www2/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
ErrorLog /var/log/apache2/error2.log
LogLevel warn
CustomLog /var/log/apache2/access2.log combined
ServerSignature On
</VirtualHost>
23 changes: 23 additions & 0 deletions blackboard_convert_for_course_exports.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

# this was created 4/13/12 to convert files from spider.its.utexas.edu:///mnt/archives/course_exports/2009_spring/remove/ to the output
# <course_id>|<batch_uid>|<course_name>|2009_<semester>_classes
# i pulled the export.csv from courses_main table and ran this awk, i had to create a sed to get rid of all of the " "s

# course_id = $10
# batch_uid = $14
# course_name = $9

# select course_id || '|' || batch_uid || '|' || course_name || '|2009_spring_classes' from course_main where course_id like '%2009_spring%'

# cat 2009_spring_classes.out | sed 's/"//g' >> 2009_spring_classes_sed.out


for i in `cat 2009_summer_exports.bbexport`
do
COURSE_ID=`echo $i | awk -F , '{print $1}'`
grep $COURSE_ID export.csv | awk -F , '{print $10 "|" $14 "|" $9 "| 2009_summer_classes" }' >> 2009_summer_classes.out
done

# added after the script had been completed
cat 2009_summer_classes.out | sed 's/"//g' >> 2009_summer_classes_sed.out
46 changes: 46 additions & 0 deletions catalina_bb_logs_pull.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash

USER=asgharje
DATE=`date +%F`
TOMCAT_DATE=`date +%Y%m%d`
BB_DATE=`date +%Y-%m-%d`

#
# Create the directory
#
mkdir $DATE
cd $DATE

#
# Pull the files down
#
for i in "spider.its.utexas.edu" "maeve.its.utexas.edu" "nancy.its.utexas.edu" "tristran.its.utexas.edu" "rosie.its.utexas.edu"
do
echo ""
echo "Now pulling from $i"
echo ""
scp -C $USER@$i:/usr/local/blackboard/logs/tomcat/catalina-log.txt $DATE.$i.catalina-log.txt
echo ""
echo "Done with $i"
echo ""
done

#
# gzip the files
#
gzip *
cd ..

#
# tar up the directory into a tarball
#
tar zcf catalina_log_pull.$DATE.tar.gz $DATE/

#
# Delete the $DATE/ directory
#
rm -rf $DATE/

# Complete
echo "Your file name is catalina_log_pull.$DATE.tar.gz"

49 changes: 49 additions & 0 deletions create_vm_tmp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/usr/local/bin/bash

VDI_DIR='/home/asgharje/vdi/'
UBUNTU_GOLD_VDI="ubuntu_11_10_gold.vdi"
REDHAT_GOLD_VDI="centos_6_2_gold.vdi"
HOST_NIC="em0"


echo "Name of VM"
read name_of_vm
echo "OS type (Ubuntu, RedHat_64)"
read ostype
cd $VDI_DIR
if [ "$ostype" = "Ubuntu" ]; then
echo "Cloning Ubuntu vdi"
VBoxManage clonehd $UBUNTU_GOLD_VDI ubuntu_11_10_$name_of_vm.vdi
elif [ "$ostype" = "RedHat_64" ]; then
echo "Cloning RedHat vdi"
VBoxManage clonehd $REDHAT_GOLD_VDI centos_6_2_$name_of_vm.vdi
else
clear;
echo "something broke"
fi
VBoxManage createvm --name "$name_of_vm" --ostype "$ostype" -register
echo "Adding 4gigs of memory"
VBoxManage modifyvm "$name_of_vm" --memory 4096 --boot1 dvd
echo "Adding the storage ide controller"
VBoxManage storagectl "$name_of_vm" --name "IDE Controller" --add ide
echo "Attaching vdi to storage controller"
if [ "$ostype" = "Ubuntu" ]; then
VBoxManage storageattach "$name_of_vm" --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium ubuntu_11_10_$name_of_vm.vdi
fi
if [ "$ostype" = "RedHat_64" ]; then
VBoxManage storageattach "$name_of_vm" --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium centos_6_2_$name_of_vm.vdi
fi
echo "Adding NIC and making it a bridge adapter"
VBoxManage modifyvm "$name_of_vm" --nic1 bridged --nictype1 82543GC --bridgeadapter1 $HOST_NIC
clear
echo ""
echo ""
echo ""
echo "Starting it in headless mode have fun!"
echo ""
echo ""
echo "Check the NIC, it could change and you'll have to edit it via the console, hence the VNC connection here in a sec"
echo ""
echo ""
VBoxHeadless -s "$name_of_vm" -n
cd $HOME
2 changes: 2 additions & 0 deletions foo_out.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This is something becasue i want something
BLah!
13 changes: 13 additions & 0 deletions length.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
echo "enter the sting: "
read str;

countStringLength() {
echo `echo -n $1 | wc -c`

# Or can use the below trick to get the string length
# I prefer to use the first one - easy to use and easy to remember
echo ${#1}
}
countStringLength $str

21 changes: 21 additions & 0 deletions new_pysysinfo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env python

#very short script thta reuses pysysinfo

from pysysinfo_fuction import disk_func
import subprocess

def tmp_space():
tmp_usage = 'du'
tmp_arg = '-h'
path = '/tmp/'
print "Space used in /tmp directory"
subprocess.call([tmp_usage, tmp_arg, path])

def main():
disk_func()

tmp_space()

if __name__ == "__main__":
main()
12 changes: 12 additions & 0 deletions nuke_vm_tmp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/local/bin/bash

VDI_DIR='/home/asgharje/vdi/'
UBUNTU_GOLD_VDI="ubuntu_11_10_gold.vdi"
REDHAT_GOLD_VDI="centos_6_2_gold.vdi"


echo "Name of VM"
read name_of_vm
VBoxManage unregistervm "$name_of_vm" --delete
cd $VDI_DIR
rm *_$name_of_vm.vdi
54 changes: 54 additions & 0 deletions pull_bb_logs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/bin/bash

USER=asgharje
DATE=`date +%F`
TOMCAT_DATE=`date +%Y%m%d`
BB_DATE=`date +%Y-%m-%d`

#
# Create the directory
#
mkdir $DATE
cd $DATE

#
# Pull the files down
#
for i in "spider.its.utexas.edu" "maeve.its.utexas.edu" "nancy.its.utexas.edu" "tristran.its.utexas.edu" "rosie.its.utexas.edu"
do
echo ""
echo "Now pulling from $i"
echo ""
scp -C $USER@$i:/usr/local/blackboard/config/bb-config.properties $DATE.$i.bb-config.properties
scp -C $USER@$i:/usr/local/blackboard/logs/bb-sqlerror-log.$BB_DATE.txt $DATE.$i.bb-sqlerror-log.$BB_DATE.txt
scp -C $USER@$i:/usr/local/blackboard/logs/bb-sqlerror-log.txt $DATE.$i.bb-sqlerror-log.txt
scp -C $USER@$i:/usr/local/blackboard/logs/tomcat/stdout-stderr-$TOMCAT_DATE.log $DATE.$i.stdout-stderr.txt
scp -C $USER@$i:/usr/local/blackboard/logs/httpd/error_log $DATE.$i.error_log
scp -C $USER@$i:/usr/local/blackboard/logs/httpd/mod_jk.log $DATE.$i.mod_jk.log
scp -C $USER@$i:/usr/local/blackboard/config/bb-tasks.xml $DATE.$i.bb-tasks.xml
scp -C $USER@$i:/usr/local/blackboard/config/bb-tasks.unix.xml $DATE.$i.bb-tasks.unix.xml
scp -C $USER@$i:/usr/local/blackboard/logs/tomcat/catalina-log.txt $DATE.$i.catalina-log.txt
echo ""
echo "Done with $i"
echo ""
done

#
# gzip the files
#
gzip *
cd ..

#
# tar up the directory into a tarball
#
tar zcf bb_log_pull.$DATE.tar.gz $DATE/

#
# Delete the $DATE/ directory
#
rm -rf $DATE/

# Complete
echo "Your file name is bb_log_pull.$DATE.tar.gz"

36 changes: 36 additions & 0 deletions py_kill_all_by_user.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env python

#
# This is an attempt to kill all procs by an owner
#

import os
import sys
import subprocess

def main():
if (len(sys.argv) > 1):
ps_grep(sys.argv[1:])
else:
print "no args"

def ps_grep(u):
ps="ps"
psopt="-ej"
grep="grep"
cmd="ps aux |grep "
for i in u:

## James suggested this is "cleaner"
#p1=subprocess.Popen([ps,psopt],stdout=subprocess.PIPE)
#p2=subprocess.Popen([grep, i],stdin=p1.stdout,stdout=subprocess.PIPE)
#p1.stdout.close()
#print p2.communicate()[0]
##

## This just "works"
subprocess.call(cmd + i, shell=True)


if __name__ == "__main__":
main()
11 changes: 11 additions & 0 deletions py_sys_sdtin_readline.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env python
import sys

counter = 1

while True:
line = sys.stdin.readline()
if not line:
break
print "%s: %s" % (counter, line)
counter += 1
Loading

0 comments on commit 081c793

Please sign in to comment.