Skip to content

Instantly share code, notes, and snippets.


Grigory grigory-v

View GitHub Profile
grigory-v / gist:19e3ee5dd6e2a1294fcc
Created Feb 3, 2016
RaspberryPi backup with dd
View gist:19e3ee5dd6e2a1294fcc
# source:
# backup
sudo dd bs=4M if=/dev/sdd | gzip > raspbian-`date +%d%m%y`.img.gz
# restore
gzip -dc image.gz | sudo dd bs=4M of=/dev/sdd
grigory-v /
Last active Nov 21, 2019
Backup with duplicity to yandex.disk
# Duplicity wrapper
# Not working for now. Yandex prevents uploading lagre files via webdav.
# add to crontab:
# 0 0 * * * /bin/sh /usr/local/sbin/
set -e
grigory-v /
Last active Aug 12, 2016
Backup postgres users dbs to email
export PATH=$PATH:/usr/bin:/usr/sbin
export RECIPIENTS=','
export FROM='admin'
# Setup passwords in /root/.pgpass
export BACKUP_USERS='django postgres'
grigory-v /
Created Aug 11, 2014
Forever retry reconnection every 6 seconds for kazoo
from kazoo.client import KazooClient
from kazoo.retry import KazooRetry
retry = KazooRetry(max_tries=-1, max_delay=6)
zk = KazooClient(hosts='', connection_retry=retry)