Skip to content

Instantly share code, notes, and snippets.

@joba-1
joba-1 / gopro2016.py
Last active August 7, 2024 21:42
Fix wrong Gopro Hero7 2016 media timestamps from correct JPEG GPS metadata timestamps
"""
Read timestamps of jpegs from given or current directory.
If there are files with creation year 2016
and if the difference between creation date and gps date is the same for all those files
then fix metadata dates and file dates of all 2016 media files (not just the jpegs)
"""
TZ = 2*60 # desired difference in minutes between GPS (UTC) and TZ to use within media files
from subprocess import check_output
@joba-1
joba-1 / owncloud.log
Last active April 13, 2023 14:05
for owncloud forum post
{"reqId":"tRPE1OMrQAzIDz8H4f9d","level":4,"time":"2023-04-13T12:27:03+00:00","remoteAddr":"192.168.1.4","user":"carolin","app":"webdav","method":"PROPFIND","url":"\/owncloud\/remote.php\/webdav\/Photos\/Qubii\/Carolins%20iPhone%208","message":"Exception: An exception occurred while executing 'SELECT * FROM \"oc_share\" WHERE ((\"item_type\" = ?) OR (\"item_type\" = ?)) AND ((\"share_type\" = ?) OR (\"share_type\" = ?) OR (\"share_type\" = ?)) AND (\"uid_initiator\" = ?) AND (\"file_source\" IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)) AND ((\"item_type\" = ?) OR (\"item_type\" = ?)) AND ((\"share_type\" = ?) OR (\"share_type\" = ?) OR (\"share_type\" = ?)) AND (\"uid_initiator\" = ?) AND (\"file_source\" IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?
@joba-1
joba-1 / getpy.sh
Created February 22, 2023 15:54
get, build and install python from python.org on linux
#!/bin/bash
# Get version of python souce from python.org ftp, compile and install in given directory
# Result for target directory $dir and version $ver:
# * python interpreter $dir/python/$ver/bin/python3
# * ready to use virtual environment activated by "source $dir/python/$ver/venv/base/bin/activate"
# * create more virtual environments by "$dir/python/$ver/bin/python3 -m venv $venv_dir
# * source code is in $dir/Python-$ver
# * install log is in $dir/Python-$ver.log
# Needs relevant dev packages installed:
@joba-1
joba-1 / gd32vf103.cfg
Last active October 11, 2020 09:28 — forked from elfmimi/gd32vf103.cfg
OpenOCD script for GD32VF103 with improved reset procedure without power cycle
# Invoke it like this.
# openocd -f interface/ftdi/digilent-hs2.cfg -c "ftdi_device_desc {Digilent USB Device}" -f gd32vf103.cfg -c "program binary.elf verify reset exit"
# openocd -f interface/ftdi/digilent-hs2.cfg -c "ftdi_device_desc {Digilent USB Device}" -f gd32vf103.cfg -c "program binary.bin 0x08000000 verify reset exit"
# openocd -f interface/ftdi/digilent-hs2.cfg -c "ftdi_device_desc {Digilent USB Device}" -f gd32vf103.cfg -c "init; reset run; exit"
# Sure, you may also use other JTAG interfaces.
#
# For platformio copy this file to the openocd target directory
# cd ~/.platformio/packages/tool-openocd-gd32v/share/openocd/scripts/target
# wget -O gd32vf103-elfmimi.cfg https://gist.github.com/joba-1/02454d9d028b37b70be4e4bb4b1d0ce2/raw/gd32vf103.cfg
# Then use these entries in your platformio.ini project file for use with a sipeed usb-jtag adapter:
@joba-1
joba-1 / Dockerfile
Last active September 20, 2019 23:00
Docker file to build tasmota firmware
# Document requirements for building Tasmota firmware by creating a docker image :)
#
# Usage
# Install docker and git on your os, e.g. on opensuse:
# sudo zypper install docker git
# Start docker service on your os, e.g. on systemd based distros like opensuse:
# sudo systemctl start docker
# Build docker image
# sudo docker build -t tasmota /path/to/this/file/
# Clone Tasmota git repository or some fork, e.g.
@joba-1
joba-1 / ESP32RemoteDebug.md
Last active April 15, 2022 01:30
ESP32 Remote Debugging

ESP32 Remote Debugging

Contents

1 ESP32 Remote Debugging
    1.1 Hardware
    1.2 Software
        1.2.1 Minimalist
        1.2.2 IDE
            1.2.2.1 PlatformIO Project Config

1.3 Quirks

@joba-1
joba-1 / screenon.py
Created January 10, 2019 18:32 — forked from EBNull/screenon.py
Forces Windows to keep the display on (temporarily disables sleep mode while running). Netflix's silverlight app failed to do this for me :/
import os
import sys
import ctypes
ES_AWAYMODE_REQUIRED = 0x00000040
ES_CONTINUOUS = 0x80000000
ES_DISPLAY_REQUIRED = 0x2 #Forces the display to be on by resetting the display idle timer.
ES_SYSTEM_REQUIRED = 0x1 #Forces the system to be in the working state by resetting the system idle timer.
@joba-1
joba-1 / fritzbox-cert-update.sh
Last active August 24, 2021 15:07 — forked from wikrie/fritzbox-cert-update.sh
Fritzbox Fritz!Box AVM SSL Letsencrypt automatically update
#!/bin/bash
# parameters
USERNAME="maybe empty"
PASSWORD="fritzbox-password"
CERTPATH="path to cert eg /etc/letsencrypt/live/domain.tld/"
CERTPASSWORD="cert password if needed"
HOST="http://fritz.box"
# make and secure a temporary file. Arrange for automatic cleanup
@joba-1
joba-1 / fritz_cert_upload.py
Created August 3, 2018 23:41 — forked from shtrom/fritz_cert_upload.py
Upload a TLS key and cert to a FRITZ!Box, in pretty Python
#!/usr/bin/env python
"""
Upload a TLS key and cert to a FRITZ!Box, in pretty Python
Copyright (C) 2018 Olivier Mehani <shtrom@ssji.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.