Skip to content

Instantly share code, notes, and snippets.

#!/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
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)
C:\Users\tim\Downloads\ffmpeg-20150220-git-6c91afe-win64-static\bin\ffmpeg.exe
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:
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'
@policevideorequests
policevideorequests / gist:f127163338036e66e455
Created January 27, 2015 18:12
redact_go_report_for_website.js
// 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 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++){
# 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.
# 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()
#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: