Skip to content

Instantly share code, notes, and snippets.

@John07
John07 / open_wunderlist_tasks.sh
Last active August 29, 2015 14:00
Count the number of open tasks in Wunderlist 2
# counts the number of open tasks in Wunderlist across all lists
# (pretty sure there's a more elegant way of doing this but works for now)
sqlite3 "/Users/USERNAME/Library/Containers/com.wunderkinder.wunderlistdesktop/Data/Library/Application Support/Wunderlist/WKModel.sqlite" "select ZTITLE from ZRESOURCE where ZOWNER1 is not 1 and ZPARENTTASK is null and ZCOMPLETEDAT is null" | wc -l
@John07
John07 / lightroom-exporting.sql
Last active August 29, 2015 14:04
An incomplete collection of ugly sqlite commands to export metadata from a Lightroom catalog. You can export Lightroom keywords, color labels, collections and more depending on your sqlite skills. Only tested with a Lightroom 2 catalog! (Note that this is not a complete script but rather a collection of commands that may need to be modified to run)
sqlite3 backup-catalog.lrcat
.output export.txt
-- get all keywords with their id
SELECT id_local, name FROM AgLibraryKeyword;
-- get list of all files with keyword id 88890
SELECT stackParent_fileName, stackParent____colorLabels, rating FROM Adobe_images AS a JOIN AgLibraryKeywordImage AS b WHERE b.tag=88890 AND a.id_local=b.image;
-- get list of all files for keyword Bob
@John07
John07 / chapter_marks.sh
Created November 16, 2015 18:53
Read a podcast mp3 file and print a list of its chapter marks. Useful if your podcast client of choice doesn't yet support chapter marks
# read a podcast mp3 file and print a list of its chapter marks
ffprobe -v quiet -show_chapters -pretty -print_format csv *.mp3
# more readable, timestamps with seconds
ffprobe -v quiet -show_chapters -pretty -print_format csv *.mp3 | awk -F "," '{print $5 " " $7 " " $8}' | sed 's/\.[0-9]*\ /\ /g'
# more readable, timestamps without seconds
ffprobe -v quiet -show_chapters -pretty -print_format csv *.mp3 | awk -F "," '{print $5 " " $7 " " $8}' | sed 's/\:[0-9][0-9]\.[0-9]*\ /\ /g'