Skip to content

Instantly share code, notes, and snippets.

View casebeer's full-sized avatar

Christopher Casebeer casebeer

View GitHub Profile

Last updated: 2017-03-18

Searching for Files

Find images in a directory that don't have a DateTimeOriginal

exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' .

###Output photos that don't have datetimeoriginal to a CSV### Note this can take a long time if you have a lot of jpgs

@casebeer
casebeer / django-run-dev.sh
Created August 25, 2017 01:29
Start Django and Celery, trapping SIGINT to terminate both daemons cleanly on Ctrl-C
#!/bin/bash
#
# Start Django and Celery, trapping SIGINT to terminate both daemons cleanly on Ctrl-C
#
PYTHON=venv/bin/python
DJANGO_DEV_SERVER_PORT=8000
$PYTHON ./manage.py runserver $DJANGO_DEV_SERVER_PORT "$@" &
@casebeer
casebeer / ema_gen.py
Last active July 6, 2022 07:54
Exponential moving average generator example in Python
def consumer(func):
'''
Decorator taking care of initial next() call to "sending" generators
From PEP-342
http://www.python.org/dev/peps/pep-0342/
'''
def wrapper(*args,**kw):
gen = func(*args, **kw)
next(gen)
@casebeer
casebeer / dhcp121.py
Created January 7, 2014 23:28
Generate DHCP Option 121 hex routing configurations
'''
Generate DHCP Option 121 hex routing configurations
Static routes pushed over DHCP
1) Set option 121.
2) Value is the concatenation of hex route data.
3) Each route has the form:
{prefix_length}{destination_prefix}{router}