Skip to content

Instantly share code, notes, and snippets.

View gatoniel's full-sized avatar

niklas breitenbach-netter gatoniel

View GitHub Profile

Syncing between encrypted Git Repositories

Sometimes you want to keep folders in sync across different computers with some kind of file versioning, maybe you also want some kind of backup. You could use a private repository on GitHub, Bitbucket or Gitlab for that. However, when that data is particularly private, you might want to encrypt your data. git-remote-gcrypt can do that for you. As other guides on that topic were not very specific about syncing between two different computers, this guide focuses on that.

Other Sources

These are the sources I used:

num_points = 10000
num_dims = 200
def norm(x, keepdims=False):
return np.linalg.norm(x, ord=2, axis=-1, keepdims=keepdims)
def normalize(x):
return x / norm(x, True)
points = normalize(np.exp(np.random.randn(num_points, num_dims)))
@gatoniel
gatoniel / TiffWriter_series.py
Last active September 7, 2020 08:25
Create Tiff-File with series.
import os
from tifffile import TiffWriter, imread
def create_tif_series(file, list_of_imgs, axes):
"""
Creates a tif file that includes len(list_of_imgs) series.
Arguments:
file: str or File like object, where tif file is written to.
list_of_imgs: list of numpy arrays. The imgs, that are written
axes: list of str. The axes of the imgs, that are written