Cheatsheet for image / video metadata manipulation.
Last updated 2019-07-24
until more specific license...
THE CONTENT BELOW IS PROVIDED "AS-IS",
WE DISCLAIM LIABILITY FOR ALL USES TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW.
Copyright (c) 2019 Damien Nozay | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all |
#!/usr/bin/env python3 | |
from collections import defaultdict | |
from datetime import datetime | |
import json | |
import fileinput | |
import os | |
import pprint | |
from xml.dom.minidom import Document |
// LogNow logs the information right away. | |
// This is particularly useful for debugging information in case of a | |
// panic, or because (*testing.T) Log() output is buffered and rolled | |
// up with its parent test output. | |
func LogNow(t *testing.T, format string, args ...interface{}) { | |
_, file, line, ok := runtime.Caller(1) | |
if ok { | |
if file != "" { | |
// Truncate file name | |
if index := strings.LastIndex(file, "/"); index >= 0 { |
# syntax=docker/dockerfile:experimental | |
FROM python:3.7 | |
COPY requirements.txt . | |
COPY requirements-tox.txt . | |
RUN --mount=type=secret,id=pip,dst=/root/.pip/pip.conf \ | |
pip download --destination-directory /root/.pip/cache \ | |
-r requirements.txt \ | |
-r requirements-tox.txt \ | |
tox wheel |
Copyright (c) Django Software Foundation and individual contributors. | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without modification, | |
are permitted provided that the following conditions are met: | |
1. Redistributions of source code must retain the above copyright notice, | |
this list of conditions and the following disclaimer. | |
2. Redistributions in binary form must reproduce the above copyright |
Copyright 2017 Damien Nozay | |
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | |
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | |
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERR |
# Rationale: find all subprocesses of a certain command and do something similar to os.killpg | |
# We need the process ids to wait and be more aggressive if they don't terminate in due time. | |
import psutil | |
def print_info(process): | |
with process.oneshot(): | |
print 'pid={0}, ppid={1}, cmd={2}'.format(process.pid, process.ppid(), str(process.cmdline())) | |
def process_info(pid): |
/* | |
add markers to gradle output so it's easy to extract the block for a failed task, | |
e.g. with a stream editor like sed. | |
*/ | |
useLogger(new CustomEventLogger()) | |
class CustomEventLogger implements TaskExecutionListener { | |
public void beforeExecute(Task task) { | |
println "## Start-task: $task.name" |
#!/usr/bin/python | |
# e.g. python gift-shuffle.py linda dad adam misty laura damien bryan joelle | |
# dad == gives present to ==> damien | |
# damien == gives present to ==> joelle | |
# joelle == gives present to ==> linda | |
# linda == gives present to ==> adam | |
# adam == gives present to ==> laura | |
# laura == gives present to ==> bryan |