diff --git a/bin/clean_pyc b/bin/clean_pyc new file mode 100755 index 0000000..e11869a --- /dev/null +++ b/bin/clean_pyc @@ -0,0 +1,3 @@ +#!/bin/bash +find . -name "*.pyc" -exec rm -f {} \; +#find . -name "*.pyc" -exec ls {} \; diff --git a/bin/dirdiff b/bin/dirdiff new file mode 100755 index 0000000..4921d3b --- /dev/null +++ b/bin/dirdiff @@ -0,0 +1,6 @@ +#!/bin/bash +#ls -lR $1 > /tmp/diff_01 +#ls -lR $2 > /tmp/diff_02 +ls -logR $1 > /tmp/diff_01 +ls -logR $2 > /tmp/diff_02 +diff /tmp/diff_01 /tmp/diff_02 |less diff --git a/bin/fixpermissions b/bin/fixpermissions new file mode 100755 index 0000000..3512d5b --- /dev/null +++ b/bin/fixpermissions @@ -0,0 +1,4 @@ +#!/bin/bash +find . -type d -exec chmod 755 {} \; +find . -type f -exec chmod 644 {} \; + diff --git a/bin/privfilessystem b/bin/privfilessystem new file mode 100755 index 0000000..ced5405 --- /dev/null +++ b/bin/privfilessystem @@ -0,0 +1,2 @@ +#!/bin/bash +sudo mount -t ecryptfs ~/files/system/backup ~/Documents/private/backup diff --git a/bin/sanitise_mapleleaves_programma.py b/bin/sanitise_mapleleaves_programma.py new file mode 100755 index 0000000..e6cc5fc --- /dev/null +++ b/bin/sanitise_mapleleaves_programma.py @@ -0,0 +1,75 @@ +#!/usr/bin/python +import argparse + +parser = argparse.ArgumentParser(description='Cleanup Mapleleaves program tables') + +#parser.add_argument('inputFile', metavar='1', type=string +#parser.add_argument('inputFile', help='original table snippet from Gnumeric', dest='inputFile') +parser.add_argument('inputFile', help='original table snippet from Gnumeric') +parser.add_argument('outputFile', help='new file with clean html') + +args = parser.parse_args() +#print vars(args) +#argparse.Namespace(origFile='inputFile') + +print 'Sanitising {0}'.format(args.inputFile) +print 'Writing to {0}'.format(args.outputFile) + +#origFile = open(args['inputFile'], 'r') +origFile = open(args.inputFile, 'r') +cleanFile = open(args.outputFile, 'w') + +#thisLine = origFile.readline() +#print thisLine + +inHeader = False + +for thisLine in origFile.readlines(): + thisLine = thisLine.strip() + # regular strippage + thisLine = thisLine.replace(' font-size:9pt;', '').replace(' font-size:10pt;', '').replace(' font-size:11pt;', '').replace(' style=""', '').replace(' valign="bottom"', '').replace(' ', ' ').replace('', '') + thisLine = thisLine.replace('', '').replace('', '').replace('', '').replace('', ' ') + + lineSoFar = thisLine + + # if it is a table header + thisLine = thisLine.replace('Datum', 'Datum') + thisLine = thisLine.replace('Tijd', 'Tijd') + thisLine = thisLine.replace('Tijd', 'Tijd') + thisLine = thisLine.replace('Veld', 'Veld') + thisLine = thisLine.replace('Poule', 'Poule') + thisLine = thisLine.replace('Code', 'Code') + thisLine = thisLine.replace('Team Thuis', 'Team Thuis') + thisLine = thisLine.replace('Team Uit', 'Team Uit') + thisLine = thisLine.replace('Plaats/Sporthal', 'Plaats/Sporthal') + thisLine = thisLine.replace('Scheidsrechters', 'Scheidsrechters') + thisLine = thisLine.replace('Schrijvers', 'Schrijvers') + thisLine = thisLine.replace('Zaaldienst', 'Zaaldienst') + thisLine = thisLine.replace('Vertrektijd', 'Vertrektijd') + + thisLine = thisLine.replace('Veld', 'Veld') + thisLine = thisLine.replace('Code', 'Code') + thisLine = thisLine.replace('Thuis', 'Thuis') + thisLine = thisLine.replace('Uit', 'Uit') + thisLine = thisLine.replace('Hal', 'Hal') + thisLine = thisLine.replace('Adres', 'Adres') + thisLine = thisLine.replace('postcode', 'Postcode') + thisLine = thisLine.replace('Plaats', 'Plaats') + thisLine = thisLine.replace('Vertrektijd', 'Vertrektijd') + + thisLine = thisLine.replace('Scheidsrechter', 'Scheidsrechter') + thisLine = thisLine.replace('Zaaldienst', 'Zaaldienst') + + if (thisLine != lineSoFar): + inHeader = True + + if (inHeader): + thisLine = thisLine.replace(' ', ' ') + if thisLine == '': + inHeader = False + + #print thisLine + cleanFile.write(thisLine + '\n') + +origFile.close() +cleanFile.close() diff --git a/bin/wav2mp3 b/bin/wav2mp3 new file mode 100755 index 0000000..cea303f --- /dev/null +++ b/bin/wav2mp3 @@ -0,0 +1,10 @@ +#!/bin/bash +if test -z "$1" +then + echo "Usage: wav2mp3 source.wav destination.mp3" +elif test -z "$2" +then + echo "Missing destination.mp3" +else + lame -m s --cbr --preset insane "$1" "$2" +fi