Skip to content

Instantly share code, notes, and snippets.

View switchHandler.py
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")
View deconz.py
"""
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 (
View rclone-backup.sh
#!/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 Jan 15, 2022
Backup script that uses rclone and ZFS snapshots to create incremental backups
View rclone-backup.sh
#!/usr/bin/env bash
## Configs ##
ZFSSNAPSHOTNAME="rclone"
RCLONECONFIGPATH="/root/.config/rclone/rclone.conf"
BWLIMIT="10M"
TRANSFERS=10
mountSnapshots () {
View duplicacy-backup.sh
#!/usr/bin/env bash
## Configs ##
ZFSSNAPSHOTNAME="duplicacy"
mountSnapshots () {
mkdir -p "/mnt/$ZFSSNAPSHOTNAME"
mount -t zfs "$ZFSSNAPSHOTBASE@$ZFSSNAPSHOTNAME" "/mnt/$ZFSSNAPSHOTNAME"
View gist:44352eadc141a2175e3390811f74e810
#!/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//")
View gist:71ccc05acedb03a2b400a32e52b769f9
#!/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 Jan 16, 2017 — 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.
View sync_mail.sh
#/!/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/
#
View Cykelmyggen og Dansemyggen (2007).nfo
<?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 Sep 28, 2014
Keybase verification
View keybase.md

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: