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 | |
| SELF_URL="${EASYTIER_SELF_URL:-https://xget.xi-xu.me/gist/xx025/bddd2aaac268f302651329cd88505fdd/raw/ddb9b0fb2ce63c07372c056e6d007de28572f22b/esaytire-web.sh}" | |
| if [[ "${EUID}" -ne 0 ]]; then | |
| if [[ -f "$0" ]]; then | |
| exec sudo -E bash "$0" "$@" | |
| fi |
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 | |
| P12_FILE="${1:-}" | |
| P12_PASSWORD="${2:-changeit}" | |
| OUTPUT_PREFIX="${3:-}" | |
| if [[ -z "${P12_FILE}" ]]; then | |
| mapfile -t P12_FILES < <(find . -maxdepth 1 -type f \( -name "*.p12" -o -name "*.P12" \) | sort) | |
| if [[ "${#P12_FILES[@]}" -eq 0 ]]; then |
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 | |
| # 安装 Syncthing 并可选配置指定用户的 systemd 服务及 Web UI 监听地址 | |
| # 用法: sudo ./install-syncthing.sh [--user USER] | |
| set -e | |
| USER_NAME="" | |
| while [[ $# -gt 0 ]]; do | |
| case "$1" in |
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 | |
| # 一键创建 systemd 服务开启 NVIDIA GPU 持久模式 | |
| SERVICE_FILE="/etc/systemd/system/nvidia-persistence.service" | |
| # 检查是否 root | |
| if [ "$EUID" -ne 0 ]; then | |
| echo "请用 root 权限运行此脚本" | |
| exit 1 | |
| fi |
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 | |
| # ===== 可按需修改 ===== | |
| LMOD_ROOT="/shared/apps/lmod/lmod" | |
| MODULE_ROOT="/shared/apps/modulefiles/Core" | |
| # Ubuntu/Debian 运行依赖 | |
| APT_PKGS=( | |
| lua5.3 |
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
| import types | |
| from collections import namedtuple | |
| from itertools import chain | |
| from typing import Literal, Union | |
| def process_result(result): | |
| if not isinstance(result, tuple): | |
| return (result,) |