Skip to content

Instantly share code, notes, and snippets.

View btittelbach's full-sized avatar

Bernhard Tittelbach btittelbach

View GitHub Profile
@btittelbach
btittelbach / insta360_project_fix.py
Created March 25, 2026 00:18
Insta360 Studio Bad Project XML Fix Python Script
#!/usr/bin/env python
## (c) Bernhard Tittelbach, 2026
## MIT License
##
## This script fixes broken Insta360 Studio Projects (even automatic projects where you just edit a single file)
## Specifically those, where parts of an exported flat video are black.
##
## This happens when keyframes in Insta360 Studio have a negative pan or tilt.
## This can happen after a DeepTrack or if you move your mouse outside the window when dragging the image. I am not sure about this happens,
#!/bin/zsh
HOST=homeassistant.lan
snapname=$(date +%Y-%m-%d_%T_homeassistant_autosnap)
slugname=$(ssh $HOST "source /etc/profile; ha backups new --name \"${snapname}\" " | tail -n 1 ) || exit 1
[[ -z $slugname ]] && exit 2
echo $slugname | grep -q "slug: " || exit 3
slugname=$(echo $slugname | cut -c 7-)
snapfilename=backup/${slugname}.tar
@btittelbach
btittelbach / backup_homeassistant.sh
Created April 4, 2024 16:01
homeassistant remote backup script
#!/bin/zsh
HOST=homeassistant.lan
snapname=$(date +%Y-%m-%d_%T_homeassistant_autosnap)
slugname=$(ssh $HOST "source /etc/profile; ha backups new --name \"${snapname}\" " | tail -n 1 ) || exit 1
[[ -z $slugname ]] && exit 2
echo $slugname | grep -q "slug: " || exit 3
slugname=$(echo $slugname | cut -c 7-)
snapfilename=backup/${slugname}.tar