This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Both files should be put under `/var/lib/pve/local-btrfs/snippets/`. | |
Based on https://gist.github.com/Drallas/7e4a6f6f36610eeb0bbb5d011c8ca0be#file-set-hook-script-sh | |
Modification: | |
1. add direct kernel boot support for NixOS (add -kernel, -initrd, -append) | |
2. always override "args", so use with care if you have extra "args" that you want to keep |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJD0tFTtxd6RS5V0g7/eZ577gnKQOZAkFwgbV3+x2NTg bootstrap |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
IFS=$'\n\t' | |
YOUR_APP="" # eg. my-app | |
YOUR_VOL="" # eg. app-data | |
YOUR_REGION="" # eg. hkg | |
LOCAL_PATH="" # eg. /tmp/data/* | |
REMOTE_PATH="" # eg. /data/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module type BrokenRing = sig | |
type t | |
val zero : t | |
val one : t | |
val ( + ) : t -> t -> t | |
val ( ~- ) : t -> t | |
val ( * ) : t -> t -> t | |
val to_string : t -> string | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
container=$1 | |
port=$2 | |
pubkey=$3 | |
if [ $# -lt 3 ]; then | |
echo "Usage: ./setup_container_ssh.sh [container_name] [port] [pubkey]" | |
else | |
docker exec ${container} /bin/sh -c " |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def my_combination(arr, ns): | |
'''从arr中取若干组大小分别为ns[0], ns[1], ...的数据 | |
''' | |
if sum(ns) != len(arr): | |
return | |
def rec(arr, ns, result): | |
if ns: | |
for subset in combinations(arr, ns[0]): | |
another_result = result.copy() | |
another_result.append(subset) |