Skip to content

Instantly share code, notes, and snippets.

@roskakori
roskakori / remove_synology_media_orphans.sh
Created April 3, 2019 13:58
After moving or removing media files on a Synology NAS the previews etc do not update correctly and will remain visible despite the files being gone. This script collected from the Synology forums removes the orphan data from the media database. Credits go to various users of the Synology forums.
#!/bin/sh
# Usage: ./remove_orphans.sh [-f]
#
# Run this after moving / removing media files on a Synology NAS.
[ "$1" = "-f" ] && REMOVE=1
IFS='
'
@roskakori
roskakori / errorcodes.py
Last active February 5, 2024 19:50
Python OS error codes with symbolic name and human readable error message
# Print a list of possible Python OS error codes together with the symbolic
# name in `errno` and the related human readable error message. The output
# uses Trac Wiki syntax so it can be copied and pasted in a Wiki document
# for later reference.
#
# The output depends on platform and language settings.
import errno
import os
print('||=code =||=symbol =||=message =||')