This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# See also: http://sundararajana.blogspot.com/2007/05/motion-detection-using-opencv.html | |
import cv | |
import time | |
from scipy import * | |
from scipy.cluster import vq | |
import numpy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
videos = [name for name in os.listdir("D:\\") if name.endswith(".mpg") or name.endswith(".mp4")] | |
for video in videos: | |
print video | |
command = 'C:\\Users\\tim\\Downloads\\ffmpeg-20150220-git-6c91afe-win64-static\\bin\\ffmpeg.exe -i D:\\%s -crf 18 -preset ultrafast -vf format=gray,format=yuv422p,"boxblur=6:4:cr=2:ar=2" -an D:\\overredacted\\%s' % (video,video) | |
print command | |
os.system(command) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C:\Users\tim\Downloads\ffmpeg-20150220-git-6c91afe-win64-static\bin\ffmpeg.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import re | |
os.system('rm *.pdf') | |
os.system('wget -nd -r -l 1 -A pdf http://www.seattle.gov/opa/closed-case-summaries') | |
files = sorted([f for f in os.listdir('.') if f.endswith('.pdf')]) | |
for filename in files: | |
os.system('pdf2txt.py %s > %s' % (filename, filename[:-4]+'.txt')) | |
files = sorted([f for f in os.listdir('.') if f.endswith('.txt')]) | |
opa_files = [] | |
for filename in files: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if 'XXXXX' in cols['body']: | |
cols['body'] = '*******Email content withheld due to my address being in the email********' | |
if 'password reset' in cols['Subject'].lower(): | |
cols['body'] = '*******Email content withheld due to email containing link to reset password********' | |
if 'password:' in cols['body'].lower(): | |
cols['body'] = '*******Email content withheld due to a password being in the email********' | |
if 'XXXX' in cols['body']: | |
cols['body'] = '*******Email content withheld due to my personal phone number being in the email********' | |
if 'XXXXXXXXXX@gmail.com' in cols['To'] or 'XXXXXXXXXXXXXXXXXXXX.org' in cols['To']: | |
cols['To'] = 'secret girlfriend' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This script is free open source code copyright by Timothy A. Clemans 2015 licensed under GPL | |
app.addToolButton({cName: "RedactGoReportForWebsite", cLabel: "Redact Go Report for website", cEnable: "event.rc = (app.doc != null);", cExec: "redactForWebsite(this);" }); | |
var redactForWebsite = app.trustedFunction( function(doc){ | |
app.beginPriv(); | |
var ssnRgExp = /\d{3}-\d{2}-\d{4}/; // regular expression for finding social security numbers | |
var redactionsMade = []; | |
var allTheWords = ''; // Save all the words so we can search for keywords that indicate whether or not redaction is required and whether or not | |
// there are attachments that need to be manually redacted | |
for (var page=0;page<doc.numPages;page++){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This script is free open source code copyright by Timothy A. Clemans 2015 licensed under GPL | |
app.addToolButton({cName: "RedactGoReport", cLabel: "Redact Go Report", cEnable: "event.rc = (app.doc != null);", cExec: "redact(this);" }); | |
var redact = app.trustedFunction( function(doc){ | |
app.beginPriv(); | |
var ssnRgExp = /\d{3}-\d{2}-\d{4}/; // regular expression for finding social security numbers | |
var redactionsMade = []; | |
var allTheWords = ''; // Save all the words so we can search for keywords that indicate whether or not redaction is required and whether or not | |
// there are attachments that need to be manually redacted | |
for (var page=0;page<doc.numPages;page++){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# created by Tim Clemans and is open sourced under GPL | |
import os | |
import re | |
from datetime import datetime | |
from datetime import date | |
def calculate_age(born): | |
today = date.today() | |
try: | |
birthday = born.replace(year=today.year) |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# copyright 2015 by timothy clemans released as free open source code under GPL | |
# this code marks which Go reports can be auto released and which need review/redaction | |
import os | |
import re | |
from datetime import datetime | |
from datetime import date | |
def calculate_age(born): | |
today = date.today() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#copyright 2014 timothyclemans GPL | |
#I'm using Windows. You need https://www.ffmpeg.org/download.html#build-windows and https://www.python.org/downloads/release/python-278/ | |
#The directories need to be changed from the folder's on my girlfriend's laptop to those on the machine that will do the processing. | |
#This is the Python code: | |
import os | |
videos = [name for name in os.listdir("C:\Users\Christine\Desktop\over_redact\\") if name.endswith(".mp3")] | |
for video in videos: |
NewerOlder