Skip to content

Instantly share code, notes, and snippets.

View cnrd's full-sized avatar

Conrad Juhl Andersen cnrd

  • Festina Finance
  • Denmark
  • 11:52 (UTC +02:00)
View GitHub Profile
import appdaemon.plugins.hass.hassapi as hass
import time
from datetime import datetime, timedelta
class switchHandler(hass.Hass):
def initialize(self):
self.listen_event(self.button_press, "deconz_event")
"""
Support for deCONZ covers.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/cover.deconz/
"""
from homeassistant.components.deconz.const import (
COVER_TYPES, DOMAIN as DATA_DECONZ, DATA_DECONZ_ID, DATA_DECONZ_UNSUB,
DECONZ_DOMAIN)
from homeassistant.components.cover import (
#!/usr/bin/env bash
## Configs ##
ZFSSNAPSHOTNAME="rclone"
RCLONECONFIGPATH="/root/.config/rclone/rclone.conf"
BWLIMIT=10M
TRANSFERS=10
ZFSPATH="/sbin/zfs"
mountSnapshots () {
@cnrd
cnrd / rclone-backup.sh
Last active October 8, 2024 10:59
Backup script that uses rclone and ZFS snapshots to create incremental backups
#!/usr/bin/env bash
## Configs ##
ZFSSNAPSHOTNAME="rclone"
RCLONECONFIGPATH="/root/.config/rclone/rclone.conf"
BWLIMIT="10M"
TRANSFERS=10
mountSnapshots () {
#!/usr/bin/env bash
## Configs ##
ZFSSNAPSHOTNAME="duplicacy"
mountSnapshots () {
mkdir -p "/mnt/$ZFSSNAPSHOTNAME"
mount -t zfs "$ZFSSNAPSHOTBASE@$ZFSSNAPSHOTNAME" "/mnt/$ZFSSNAPSHOTNAME"
#!/usr/bin/env bash
mountSnapshots () {
mkdir -p "/mnt/$ZFSSNAPSHOTNAME"
mount -t zfs "$ZFSSNAPSHOTBASE@$ZFSSNAPSHOTNAME" "/mnt/$ZFSSNAPSHOTNAME"
while read -r line
do
MOUNTPATH=$(echo "$line" | sed "s/$ESCAPEDZFSSNAPSHOTBASE\///" | sed "s/@$ZFSSNAPSHOTNAME//")
#!/usr/bin/env bash
if [ $# -eq 2 ]
then
BASENAME=$(basename $1)
RUNNAME=rclone-$BASENAME
ZFSSNAPSHOTBASE=$(zfs list | grep "$BASENAME" | grep -v "$BASENAME/" | awk '{print $1}')
PIDFILE=/var/lock/$RUNNAME.pid
ISOTIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
YEAR=$(date -u +"%Y")
ZFSSNAPSHOTNAME="rclone"
@cnrd
cnrd / sync_mail.sh
Last active January 16, 2017 21:02 — forked from dalethedeveloper/sync_mail.sh
Transferring to/from Gmail accounts to a Google Apps account with imapsync. Also good for GApps to GApps transfers, archives, or migrations.
#/!/bin/bash
# Most of the tweaks here are wrapped up in gmailmig
# https://code.google.com/p/gmailmig/
#
# Props to brave folks who figured this out before me
# http://imapsync.lamiral.info/FAQ
# http://www.thamtech.com/blog/2008/03/29/gmail-to-google-apps-email-migration
# http://seagrief.co.uk/2010/12/moving-to-google-apps-with-imapsync/
# http://blog.mcfang.com/tag/imapsync/
#
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<movie>
<fileinfo>
<streamdetails>
<video>
<width>720</width>
<height>552</height>
<aspect>1,85</aspect>
<codec>h264</codec>
<format>avc1</format>
@cnrd
cnrd / keybase.md
Created September 28, 2014 22:25
Keybase verification

Keybase proof

I hereby claim:

  • I am ConradAndersen on github.
  • I am cnrd (https://keybase.io/cnrd) on keybase.
  • I have a public key whose fingerprint is 30D6 FDE7 2C82 9952 73CD 96D0 D6ED CB29 B0B6 8EFC

To claim this, I am signing this object: