Skip to content

Instantly share code, notes, and snippets.

@scrapix
scrapix / gist:7b4013b322b6a1cdecd9367b72850da1
Last active February 8, 2024 15:20
ZHA - Philips Hue Dimmer Switch (Fixed)
blueprint:
name: ZHA - Philips Hue Dimmer Switch (Fixed)
description: 'Control lights with a Philips Hue Dimmer Switch.
The top "on" button will turn the lights on to the last set brightness
(unless the force brightness is toggled on in the blueprint).
Dim up/down buttons will change the brightness smoothly and can be pressed
@scrapix
scrapix / DSM7.2-USB-DRIVER.md
Last active November 13, 2024 19:49
Synology DSM 7.2 - Adding USB Devices / Dongles (SkyConnect / Z-Wave)

Adding SkyConnect Dongle according to Blog Post or better Youtube

image

Summary

Synology has disabled USB drivers. Additionally one important driver is not available on Synology DSM 7+. Thus we need to enable some USB drivers plus download one driver and enable this on the system. For future DSM updates we need to add a Scheduled Task, so that the drivers will be loaded.

@scrapix
scrapix / Synology_DSM7_Packaga_Migration.sh
Created December 17, 2021 00:56
Synology DSM7 Package Migration Script
sudo mv "/volume1/@appstore/Perl" "/volume2/@appstore"
sudo rm "/var/packages/Perl/target"
sudo ln -s "/volume2/@appstore/Perl" "/var/packages/Perl/target"
sudo mv "/volume1/@apphome/Perl" "/volume2/@apphome"
sudo rm "/var/packages/Perl/home"
sudo ln -s "/volume2/@apphome/Perl" "/var/packages/Perl/home"
sudo mv "/volume1/@appconf/Perl" "/volume2/@appconf"
sudo rm "/var/packages/Perl/etc"
@scrapix
scrapix / compress_videos.py
Last active July 25, 2021 06:11 — forked from asdfgeoff/compress_videos.py
Bulk compress phone videos using H.265 HEVC encoding 🔥 More info: https://geoffruddock.com/bulk-compress-videos-x265-with-ffmpeg/
import click
from pathlib import Path
from subprocess import call, check_output
from tqdm import tqdm
@click.command()
@click.argument('directory', type=click.Path(exists=True))
@click.option('--recursive', is_flag=True, help='Recursive')
@click.option('--file-ext', help='File format to process')
def main(directory, file_ext='mp4', recursive=False):

Last updated: 2017-03-18

Searching for Files

Find images in a directory that don't have a DateTimeOriginal

exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' .

###Output photos that don't have datetimeoriginal to a CSV### Note this can take a long time if you have a lot of jpgs