Skip to content

Instantly share code, notes, and snippets.

@Blizzke
Blizzke / flash.sh
Last active January 31, 2021 14:38
OctoPrint CLI flasher for Prusa MK2, MK3 and MMU2
#!/usr/bin/env bash
#
# This script was created to flash firmwares for the MK2, MK3 and the MMU2,
# all from the command line of your OctoPrint installation.
#
# The script assumes that you have avrdude and jq installed on your raspbian and that you
# have filled the API key below.
#
# Usage: flash.sh mk2|mk3|mmu2 firmware.hex

Keybase proof

I hereby claim:

  • I am blizzke on github.
  • I am blizzke (https://keybase.io/blizzke) on keybase.
  • I have a public key ASABLAxysPWgs1OW_d-KGnfjYnkmsmUiEJMwb__bIU5M9go

To claim this, I am signing this object:

@Blizzke
Blizzke / adb_touch.py
Last active June 6, 2020 10:11
Correct create and modify times of the images/videos based on the filename on my new android device
import subprocess
from subprocess import PIPE
if __name__ == '__main__':
source = '/storage/self/primary/DCIM/Camera'
files = subprocess.run(["/usr/local/bin/adb", "shell", f"ls -1 {source}"], check=False,
stdout=PIPE).stdout.splitlines()
print(f'{len(files)} files found.')
import re
@Blizzke
Blizzke / restic.sh
Last active December 31, 2024 18:15
restic.sh - restic wrapper script with 1password support (and fallback on files if not available). Support for password/exclude and env.
#!/usr/bin/env bash
# The 1password entries are expected like this: (imagine a plex server from which we want to backup /etc - repository "etc" - and /var/lib/plexmediaserver - repository "library"):
# [plex] <- 1password section, indicating the host/device
# password <- host global password entry (used for all repo's on this host unless overwritten)
# backup <- arguments when the backup subcommand is used, for all repositories under this host (for example "--host plex")
# env <- env for the host (defined before the repo specific one). KEY=VALUE
# forget <- arguments when the forget subcommand is used, for all repositories under this host (eg. "--prune --keep-daily=30")
# etc/password <- dedicated password for "etc" repository
# etc/exclude <- text field that contains the contents for the exclude-file when backing up