Skip to content

Instantly share code, notes, and snippets.

@dot-mike
dot-mike / extract_zst.py
Created November 21, 2023 20:46 — forked from scivision/extract_zst.py
Extract a .zst file in Python
from pathlib import Path
import tempfile
import tarfile
import zstandard
# pip install zstandard
def extract_zst(archive: Path, out_path: Path):
"""extract .zst file
@dot-mike
dot-mike / gpg-ssh-setup.md
Created July 2, 2023 13:54 — forked from mcattarinussi/gpg-ssh-setup.md
A setup guide to use a personal gpg key for ssh authentication

GPG - SSH setup

Generating the master key

Here we create the master key. We want only Certify capability: we use the master key only to create the subkeys, Sign - Encrypt - Authenticate capabilities will be assigned to the subkeys.

Run the following command to start the master key generation process. Select the set your own capabilities creation process (type 8)

  ▶ gpg --full-generate-key --expert

gpg (GnuPG) 2.2.9; Copyright (C) 2018 Free Software Foundation, Inc.

@dot-mike
dot-mike / README.md
Last active July 18, 2022 00:47
Script to fetch Yahoo GMD archive from the Archiveteam and
@dot-mike
dot-mike / git-hook-support-for-portainer.patch
Created July 17, 2022 14:08
Support for running Git hooks in Portainer 2.14
diff --git a/api/exec/compose_stack.go b/api/exec/compose_stack.go
index e99f265b5..2dbfc6b1f 100644
--- a/api/exec/compose_stack.go
+++ b/api/exec/compose_stack.go
@@ -194,7 +194,7 @@ func createNetworkEnvFile(stack *portainer.Stack) error {
}
envfile, err := os.OpenFile(path.Join(stack.ProjectPath, ".env"),
- os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600)
+ os.O_WRONLY|os.O_CREATE, 0600)
@dot-mike
dot-mike / archive_magic_wallpaper.sh
Last active August 31, 2021 22:31
Archive Magic: The Gathering wallpapers
#!/usr/bin/env bash
set -euo pipefail
main() {
which pup > /dev/null || (echo "Error: missing 'pup'; see https://github.com/ericchiang/pup" ; exit 1)
which jq > /dev/null || (echo "Error: missing 'jq'; install with: apt install jq" ; exit 1)
mkdir -p "wizard_wallpapers" && pushd "wizard_wallpapers" >/dev/null || exit
/**
* Advanced Scoreboard
*
* @author Cr1N
* @version 1.0.1
*/
BBLog.handle("add.plugin", {
/* Plugin Infos */
id : "bf4-advanced-scoreboard-plugin-dev-1-0",