Skip to content

Instantly share code, notes, and snippets.

@anna-geller
anna-geller / process_files_retries.py
Created July 13, 2022 13:31
Retries when processing files in Prefect 2.0
import os
import random
import requests
from prefect import task, flow
from prefect.orion.schemas.states import Completed, Failed
from prefect.futures import PrefectFuture
from typing import List
@task(retries=3, retry_delay_seconds=2)
@Jip-Hop
Jip-Hop / autorun.sh
Created February 28, 2021 17:01
Autorun Synology Hyper Backup and Integrity Check with Email Notifications
#!/bin/sh
# This script is to be used in combination with Synology Autorun:
# - https://github.com/reidemei/synology-autorun
# - https://github.com/Jip-Hop/synology-autorun
#
# You need to change the task_id to match your Hyper Backup task.
# Get it with command: more /usr/syno/etc/synobackup.conf
#
# I like to keep "Beep at start and end" disabled in Autorun, because I don't
@farmio
farmio / knx-relative-dimming-for-lights.yaml
Last active July 16, 2024 21:32
KNX - relative dimming for lights blueprint
blueprint:
name: KNX - relative dimming for lights
description: Control Home Assistant light entities from KNX switching and relative dimming (DPT 3.007) telegrams.
homeassistant:
# `knx.telegram` trigger and `enabled` templates require Home Assistant 2024.6.0
min_version: "2024.6.0"
domain: automation
input:
target_lights:
name: Light
@patmandenver
patmandenver / scp-speed-test.sh
Last active March 28, 2023 04:10
scp speed test between servers
#!/bin/bash
# scp-speed-test.sh
#
# Usage:
# ./scp-speed-test.sh user@hostname [test file size in MBs]
#
#############################################################
ssh_server=$1
test_file=".scp-test-file"
@mpneuried
mpneuried / Makefile
Last active July 7, 2024 14:30
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)