Skip to content

Instantly share code, notes, and snippets.

View kampelmuehler's full-sized avatar

Moritz Kampelmühler kampelmuehler

  • Austria
View GitHub Profile
@kampelmuehler
kampelmuehler / backup.bat
Created March 29, 2024 10:59
Backup internal drive to external drive on Windows 10 using robocopy
:: https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/robocopy
:: Adjust the paths as needed
:: Explanation of the command options:
:: /MIR - We're using mirror to ensure the external copy (H:\Z\) is exactly what is the internal copy (Z:\)
:: /XO - Source directory files older than the destination are excluded from the copy.
:: /XD "$RECYCLE.BIN" "System Volume Information" - exclude those directories to avoid access issues
:: /log+:"Z:\backup.log" - append to a backup.log file on Z:
:: /tee - Writes the status output to the console window, and to the log file.
:: /nfl - Specifies that file names aren't to be logged, to avoid bloating the log file
@kampelmuehler
kampelmuehler / mirror_tile_and_crop.py
Created July 27, 2021 06:39
Tiles an image and mirrors every other tile to make seamless transitions
from PIL import Image
from PIL.ImageOps import flip, mirror
import numpy as np
iseven = lambda x: (x % 2) == 0
def mirror_tile_crop(img: Image.Image, target_height=8192, target_width=8192) -> Image.Image:
width, height = img.size