Skip to content

Instantly share code, notes, and snippets.

View nilayp's full-sized avatar

Nilay Patel nilayp

View GitHub Profile
@nilayp
nilayp / upload_file_presigned_url.py
Last active December 24, 2021 21:36
Using presigned URLs with Backblaze B2 + AWS Python SDK
#! /usr/bin/env python
'''
Backblaze wants developers and organization to copy and re-use our
code examples, so we make the samples available by several different
licenses. One option is the MIT license (below). Other options are
available here:
https://www.backblaze.com/using_b2_code.html
The MIT License (MIT)
Copyright (c) 2021 Backblaze
@nilayp
nilayp / git-backup-to-Backblaze-B2.sh
Last active May 23, 2023 00:46 — forked from philippb/git-backup-to-AWS-S3.sh
Complete git repository backup script to Backblaze B2
#!/bin/bash
# Script to backup git repo to Backblaze B2
# Set bucket, dir, password and account to use for the backup. I keep mine in local env vars
# These are set by localrc which lives on an encrypted home directory and is executed by my bashrc
# Ensure you have authorized the B2 command line tool with the correct account AND added your SSH
# public key to your github account, if you need to backup private repositories.
# To restore this repo in the future, download it from B2, extract it and then use this command:
# cd old-repository.git