Skip to content

Instantly share code, notes, and snippets.

import (
"bytes"
"crypto/hmac"
"crypto/sha256"
"encoding/base64"
"net/url"
"strings"
"github.com/pkg/errors"
)
import hashlib
import os
import traceback
import json
import time
def checksum_file(path):
with open(path, mode='rb') as f:
return hashlib.md5(f.read()).hexdigest()
user www-data;
worker_processes auto;
events {
worker_connections 4096;
}
http {
include /etc/nginx/mime.types.conf;
default_type application/octet-stream;
#!/bin/bash
sshport=22
sshcert=~/.ssh/id_rsa
remoteserver= # FILL IN, e.g root@0.0.0.0
localpath= # FILL IN without trailing slash, e.g ~/backups/server
usesudo= # FILL IN true or false
if [[ $usesudo == true ]]; then
rsyncargs=(-rlptzhu -e "ssh -p $sshport" --rsync-path="sudo rsync" --partial --delete-after --info=progress2)